lorawan.cpp: code sanitizations

This commit is contained in:
Klaus K Wilting 2020-03-03 16:52:29 +01:00
parent c17bfa02af
commit efd0cc3819
2 changed files with 12 additions and 6 deletions

View File

@ -46,7 +46,7 @@ void lora_queuereset(void);
void IRAM_ATTR myEventCallback(void *pUserData, ev_t ev);
void IRAM_ATTR myRxCallback(void *pUserData, uint8_t port,
const uint8_t *pMsg, size_t nMsg);
void IRAM_ATTR myTxCallback(void *pUserData, int fSuccess);
//void IRAM_ATTR myTxCallback(void *pUserData, int fSuccess);
void mac_decode(const uint8_t cmd[], const uint8_t cmdlen, const mac_t table[],
const uint8_t tablesize);
//u1_t os_getBattLevel(void);

View File

@ -261,10 +261,14 @@ void lora_send(void *pvParameters) {
// attempt to transmit payload
else {
switch (LMIC_setTxData2_strict(SendBuffer.MessagePort, SendBuffer.Message,
SendBuffer.MessageSize,
(cfg.countermode & 0x02))) {
// switch (LMIC_sendWithCallback_strict(
switch (LMIC_sendWithCallback(
SendBuffer.MessagePort, SendBuffer.Message, SendBuffer.MessageSize,
(cfg.countermode & 0x02), myTxCallback, &SendBuffer.MessagePort)) {
// SendBuffer.MessagePort, SendBuffer.Message,
// SendBuffer.MessageSize, (cfg.countermode & 0x02), myTxCallback,
// &SendBuffer.MessagePort)) {
case LMIC_ERROR_SUCCESS:
@ -566,7 +570,8 @@ void myRxCallback(void *pUserData, uint8_t port, const uint8_t *pMsg,
} // switch
}
// transmit complete message handler
/*
// event TRANSMIT COMPLETE message handler
void myTxCallback(void *pUserData, int fSuccess) {
uint8_t *const sendport = (uint8_t *)pUserData;
@ -577,6 +582,7 @@ void myTxCallback(void *pUserData, int fSuccess) {
// LMIC could not tx on *sendport -> error handling yet to come
}
}
*/
// decode LORAWAN MAC message
void mac_decode(const uint8_t cmd[], const uint8_t cmdlen, const mac_t table[],