Skip to content

Commit 82adc02

Browse files
committed
Change Brd from uint8 to uint32.
Some packet-forwarders encode more information in this field and therefore require require an uint32 type instead of uint8. Closes #104 and #105. Thanks @gillespilloudwyres.
1 parent c3d0e85 commit 82adc02

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

internal/gateway/semtech/packets/pull_resp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type TXPK struct {
7777
Size uint16 `json:"size"` // RF packet payload size in bytes (unsigned integer)
7878
NCRC bool `json:"ncrc,omitempty"` // If true, disable the CRC of the physical layer (optional)
7979
Data []byte `json:"data"` // Base64 encoded RF packet payload, padding optional
80-
Brd uint8 `json:"brd"` // Concentrator board used for RX (unsigned integer)
80+
Brd uint32 `json:"brd"` // Concentrator board used for RX (unsigned integer)
8181
Ant uint8 `json:"ant"` // Antenna number on which signal has been received
8282
}
8383

@@ -95,7 +95,7 @@ func GetPullRespPacket(protoVersion uint8, randomToken uint16, frame gw.Downlink
9595
Size: uint16(len(frame.PhyPayload)),
9696
Data: frame.PhyPayload,
9797
Ant: uint8(frame.TxInfo.Antenna),
98-
Brd: uint8(frame.TxInfo.Board),
98+
Brd: uint32(frame.TxInfo.Board),
9999
},
100100
},
101101
}

internal/gateway/semtech/packets/push_data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ type RXPK struct {
247247
Tmms *int64 `json:"tmms"` // GPS time of pkt RX, number of milliseconds since 06.Jan.1980
248248
Tmst uint32 `json:"tmst"` // Internal timestamp of "RX finished" event (32b unsigned)
249249
Freq float64 `json:"freq"` // RX central frequency in MHz (unsigned float, Hz precision)
250-
Brd uint8 `json:"brd"` // Concentrator board used for RX (unsigned integer)
250+
Brd uint32 `json:"brd"` // Concentrator board used for RX (unsigned integer)
251251
AESK uint8 `json:"aesk"` //AES key index used for encrypting fine timestamps
252252
Chan uint8 `json:"chan"` // Concentrator "IF" channel used for RX (unsigned integer)
253253
RFCh uint8 `json:"rfch"` // Concentrator "RF chain" used for RX (unsigned integer)

internal/legacy/gateway/pf_structs.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ type RXPK struct {
392392
Tmms *int64 `json:"tmms"` // GPS time of pkt RX, number of milliseconds since 06.Jan.1980
393393
Tmst uint32 `json:"tmst"` // Internal timestamp of "RX finished" event (32b unsigned)
394394
Freq float64 `json:"freq"` // RX central frequency in MHz (unsigned float, Hz precision)
395-
Brd uint8 `json:"brd"` // Concentrator board used for RX (unsigned integer)
395+
Brd uint32 `json:"brd"` // Concentrator board used for RX (unsigned integer)
396396
Chan uint8 `json:"chan"` // Concentrator "IF" channel used for RX (unsigned integer)
397397
RFCh uint8 `json:"rfch"` // Concentrator "RF chain" used for RX (unsigned integer)
398398
Stat int8 `json:"stat"` // CRC status: 1 = OK, -1 = fail, 0 = no CRC
@@ -445,7 +445,7 @@ type TXPK struct {
445445
Size uint16 `json:"size"` // RF packet payload size in bytes (unsigned integer)
446446
NCRC bool `json:"ncrc,omitempty"` // If true, disable the CRC of the physical layer (optional)
447447
Data string `json:"data"` // Base64 encoded RF packet payload, padding optional
448-
Brd uint8 `json:"brd"` // Concentrator board used for RX (unsigned integer)
448+
Brd uint32 `json:"brd"` // Concentrator board used for RX (unsigned integer)
449449
Ant uint8 `json:"ant"` // Antenna number on which signal has been received
450450
}
451451

@@ -560,7 +560,7 @@ func newTXPKFromTXPacket(txPacket gw.TXPacketBytes) (TXPK, error) {
560560
Size: uint16(len(txPacket.PHYPayload)),
561561
Data: base64.StdEncoding.EncodeToString(txPacket.PHYPayload),
562562
Ant: uint8(txPacket.TXInfo.Antenna),
563-
Brd: uint8(txPacket.TXInfo.Board),
563+
Brd: uint32(txPacket.TXInfo.Board),
564564
}
565565

566566
if txPacket.TXInfo.TimeSinceGPSEpoch != nil {

0 commit comments

Comments
 (0)