Fix data size issue
This commit is contained in:
parent
dd105959c4
commit
ba20a4c382
@ -51,7 +51,7 @@ void send() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ttn_cnt(count);
|
ttn_cnt(count);
|
||||||
ttn_send(txBuffer, LORAWAN_PORT, confirmed);
|
ttn_send(txBuffer, sizeof(txBuffer), LORAWAN_PORT, confirmed);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
@ -201,7 +201,7 @@ void ttn_cnt(unsigned char num) {
|
|||||||
LMIC_setSeqnoUp(num);
|
LMIC_setSeqnoUp(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ttn_send(uint8_t * data, uint8_t port, bool confirmed){
|
void ttn_send(uint8_t * data, uint8_t data_size, uint8_t port, bool confirmed){
|
||||||
// Check if there is not a current TX/RX job running
|
// Check if there is not a current TX/RX job running
|
||||||
if (LMIC.opmode & OP_TXRXPEND) {
|
if (LMIC.opmode & OP_TXRXPEND) {
|
||||||
_ttn_callback(EV_PENDING);
|
_ttn_callback(EV_PENDING);
|
||||||
@ -210,7 +210,7 @@ void ttn_send(uint8_t * data, uint8_t port, bool confirmed){
|
|||||||
|
|
||||||
// Prepare upstream data transmission at the next possible time.
|
// Prepare upstream data transmission at the next possible time.
|
||||||
// Parameters are port, data, length, confirmed
|
// Parameters are port, data, length, confirmed
|
||||||
LMIC_setTxData2(port, data, sizeof(data), confirmed ? 1 : 0);
|
LMIC_setTxData2(port, data, data_size, confirmed ? 1 : 0);
|
||||||
|
|
||||||
_ttn_callback(EV_QUEUED);
|
_ttn_callback(EV_QUEUED);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user