Fix data size issue

This commit is contained in:
Kyle Gabriel 2019-04-03 20:46:45 -04:00
parent dd105959c4
commit ba20a4c382
10 changed files with 3 additions and 3 deletions

View File

@ -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++;
} }

View File

@ -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);
} }