@@ -433,7 +433,8 @@ impl RxPk {
433
433
rx_info : Some ( gw:: UplinkRxInfo {
434
434
gateway_id : hex:: encode ( gateway_id) ,
435
435
uplink_id,
436
- time : match self . time . map ( pbjson_types:: Timestamp :: from) {
436
+ ns_time : None ,
437
+ gw_time : match self . time . map ( pbjson_types:: Timestamp :: from) {
437
438
Some ( v) => Some ( v) ,
438
439
None => {
439
440
if time_fallback_enabled {
@@ -724,12 +725,30 @@ impl PullResp {
724
725
gw:: modulation:: Parameters :: Fsk ( v) => Some ( v. frequency_deviation as u16 ) ,
725
726
_ => None ,
726
727
} ,
727
- ncrc : None ,
728
+ ncrc : match modulation_params {
729
+ gw:: modulation:: Parameters :: Lora ( v) => {
730
+ if v. no_crc {
731
+ Some ( v. no_crc )
732
+ } else {
733
+ None
734
+ }
735
+ }
736
+ _ => None ,
737
+ } ,
728
738
ipol : match modulation_params {
729
739
gw:: modulation:: Parameters :: Lora ( v) => Some ( v. polarization_inversion ) ,
730
740
_ => None ,
731
741
} ,
732
- prea : None ,
742
+ prea : match modulation_params {
743
+ gw:: modulation:: Parameters :: Lora ( v) => {
744
+ if v. preamble > 0 {
745
+ Some ( v. preamble as u16 )
746
+ } else {
747
+ None
748
+ }
749
+ }
750
+ _ => None ,
751
+ } ,
733
752
size : item. phy_payload . len ( ) as u16 ,
734
753
data : item. phy_payload . clone ( ) ,
735
754
} ,
@@ -1140,7 +1159,7 @@ mod test {
1140
1159
rx_info: Some ( gw:: UplinkRxInfo {
1141
1160
gateway_id: "0102030405060708" . into( ) ,
1142
1161
uplink_id: 123 ,
1143
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1162
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1144
1163
rssi: 120 ,
1145
1164
snr: 3.5 ,
1146
1165
channel: 5 ,
@@ -1210,7 +1229,7 @@ mod test {
1210
1229
rx_info: Some ( gw:: UplinkRxInfo {
1211
1230
gateway_id: "0102030405060708" . into( ) ,
1212
1231
uplink_id: 123 ,
1213
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1232
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1214
1233
time_since_gps_epoch: Some ( pbjson_types:: Duration :: from( Duration :: from_secs(
1215
1234
5
1216
1235
) ) ) ,
@@ -1283,7 +1302,7 @@ mod test {
1283
1302
rx_info: Some ( gw:: UplinkRxInfo {
1284
1303
gateway_id: "0102030405060708" . into( ) ,
1285
1304
uplink_id: 123 ,
1286
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1305
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1287
1306
time_since_gps_epoch: Some ( pbjson_types:: Duration :: from(
1288
1307
Duration :: from_millis( 5_100 )
1289
1308
) ) ,
@@ -1373,7 +1392,7 @@ mod test {
1373
1392
rx_info: Some ( gw:: UplinkRxInfo {
1374
1393
gateway_id: "0102030405060708" . into( ) ,
1375
1394
uplink_id: 123 ,
1376
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1395
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1377
1396
rssi: 120 ,
1378
1397
snr: 5.4 ,
1379
1398
channel: 5 ,
@@ -1404,7 +1423,7 @@ mod test {
1404
1423
rx_info: Some ( gw:: UplinkRxInfo {
1405
1424
gateway_id: "0102030405060708" . into( ) ,
1406
1425
uplink_id: 123 ,
1407
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1426
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1408
1427
rssi: 130 ,
1409
1428
snr: 3.5 ,
1410
1429
channel: 6 ,
@@ -1471,7 +1490,7 @@ mod test {
1471
1490
rx_info: Some ( gw:: UplinkRxInfo {
1472
1491
gateway_id: "0102030405060708" . into( ) ,
1473
1492
uplink_id: 123 ,
1474
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1493
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1475
1494
rssi: 120 ,
1476
1495
channel: 5 ,
1477
1496
rf_chain: 1 ,
@@ -1540,7 +1559,7 @@ mod test {
1540
1559
rx_info: Some ( gw:: UplinkRxInfo {
1541
1560
gateway_id: "0102030405060708" . into( ) ,
1542
1561
uplink_id: 123 ,
1543
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1562
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1544
1563
rssi: 120 ,
1545
1564
channel: 5 ,
1546
1565
rf_chain: 1 ,
@@ -1614,7 +1633,7 @@ mod test {
1614
1633
rx_info: Some ( gw:: UplinkRxInfo {
1615
1634
gateway_id: "0102030405060708" . into( ) ,
1616
1635
uplink_id: 123 ,
1617
- time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1636
+ gw_time : Some ( pbjson_types:: Timestamp :: from( now) ) ,
1618
1637
rssi: 120 ,
1619
1638
snr: 3.5 ,
1620
1639
channel: 5 ,
@@ -1667,7 +1686,7 @@ mod test {
1667
1686
} ;
1668
1687
let pl = pl. to_proto_uplink_frames ( false ) . unwrap ( ) ;
1669
1688
assert_eq ! ( 1 , pl. len( ) ) ;
1670
- assert ! ( pl[ 0 ] . rx_info. as_ref( ) . unwrap( ) . time . is_none( ) ) ;
1689
+ assert ! ( pl[ 0 ] . rx_info. as_ref( ) . unwrap( ) . gw_time . is_none( ) ) ;
1671
1690
}
1672
1691
1673
1692
#[ test]
@@ -1702,7 +1721,7 @@ mod test {
1702
1721
} ;
1703
1722
let pl = pl. to_proto_uplink_frames ( true ) . unwrap ( ) ;
1704
1723
assert_eq ! ( 1 , pl. len( ) ) ;
1705
- assert ! ( pl[ 0 ] . rx_info. as_ref( ) . unwrap( ) . time . is_some( ) ) ;
1724
+ assert ! ( pl[ 0 ] . rx_info. as_ref( ) . unwrap( ) . gw_time . is_some( ) ) ;
1706
1725
}
1707
1726
1708
1727
#[ test]
0 commit comments