Skip to content

Commit 56fd7e0

Browse files
committed
Fix #416: add lmic_tx_error_t
1 parent 4ff37e8 commit 56fd7e0

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/lmic/lmic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ void LMIC_setTxData (void) {
27362736

27372737

27382738
// send a message w/o callback
2739-
int LMIC_setTxData2 (u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed) {
2739+
lmic_tx_error_t LMIC_setTxData2 (u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed) {
27402740
if ( LMIC.opmode & OP_TXDATA ) {
27412741
// already have a message queued
27422742
return LMIC_ERROR_TX_BUSY;
@@ -2761,11 +2761,11 @@ int LMIC_setTxData2 (u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed) {
27612761
}
27622762

27632763
// send a message with callback
2764-
int LMIC_sendWithCallback(
2764+
lmic_tx_error_t LMIC_sendWithCallback (
27652765
u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed,
27662766
lmic_txmessage_cb_t *pCb, void *pUserData
27672767
) {
2768-
int const result = LMIC_setTxData2(port, data, dlen, confirmed);
2768+
lmic_tx_error_t const result = LMIC_setTxData2(port, data, dlen, confirmed);
27692769
if (result == 0) {
27702770
LMIC.client.txMessageCb = pCb;
27712771
LMIC.client.txMessageUserData = pUserData;

src/lmic/lmic.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ enum {
291291
LMIC_ERROR_TX_FAILED = -4,
292292
};
293293

294+
typedef int lmic_tx_error_t;
295+
294296
#define LMIC_ERROR_NAME__INIT \
295297
"LMIC_ERROR_SUCCESS", \
296298
"LMIC_ERROR_TX_BUSY", \
@@ -612,8 +614,8 @@ void LMIC_init (void);
612614
void LMIC_reset (void);
613615
void LMIC_clrTxData (void);
614616
void LMIC_setTxData (void);
615-
int LMIC_setTxData2 (u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed);
616-
int LMIC_sendWithCallback(u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed, lmic_txmessage_cb_t *pCb, void *pUserData);
617+
lmic_tx_error_t LMIC_setTxData2(u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed);
618+
lmic_tx_error_t LMIC_sendWithCallback(u1_t port, xref2u1_t data, u1_t dlen, u1_t confirmed, lmic_txmessage_cb_t *pCb, void *pUserData);
617619
void LMIC_sendAlive (void);
618620

619621
#if !defined(DISABLE_BEACONS)

0 commit comments

Comments
 (0)