Skip to content

Commit

Permalink
Merge pull request #273 from mcci-catena/issue268
Browse files Browse the repository at this point in the history
Fix #268: these callbacks are now in client data
  • Loading branch information
terrillmoore authored Mar 19, 2019
2 parents 43caadd + 1d978e7 commit e30e56e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lmic/lmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,16 +1794,16 @@ static bit_t processDnData (void) {
#if LMIC_ENABLE_DeviceTimeReq
lmic_request_time_state_t const requestTimeState = LMIC.txDeviceTimeReqState;
if ( requestTimeState != lmic_RequestTimeState_idle ) {
lmic_request_network_time_cb_t * const pNetworkTimeCb = LMIC.pNetworkTimeCb;
lmic_request_network_time_cb_t * const pNetworkTimeCb = LMIC.client.pNetworkTimeCb;
int flagSuccess = (LMIC.txDeviceTimeReqState == lmic_RequestTimeState_success);
LMIC.txDeviceTimeReqState = lmic_RequestTimeState_idle;
if (pNetworkTimeCb != NULL) {
// reset the callback, so that the user's routine
// can post another request if desired.
LMIC.pNetworkTimeCb = NULL;
LMIC.client.pNetworkTimeCb = NULL;

// call the user's notification routine.
(*pNetworkTimeCb)(LMIC.pNetworkTimeUserData, flagSuccess);
(*pNetworkTimeCb)(LMIC.client.pNetworkTimeUserData, flagSuccess);
}
}
#endif // LMIC_ENABLE_DeviceTimeReq
Expand Down Expand Up @@ -2337,8 +2337,8 @@ void LMIC_requestNetworkTime(lmic_request_network_time_cb_t *pCallbackfn, void *
#if LMIC_ENABLE_DeviceTimeReq
if (LMIC.txDeviceTimeReqState == lmic_RequestTimeState_idle) {
LMIC.txDeviceTimeReqState = lmic_RequestTimeState_tx;
LMIC.pNetworkTimeCb = pCallbackfn;
LMIC.pNetworkTimeUserData = pUserData;
LMIC.client.pNetworkTimeCb = pCallbackfn;
LMIC.client.pNetworkTimeUserData = pUserData;
return;
}
#endif // LMIC_ENABLE_DeviceTimeReq
Expand Down

0 comments on commit e30e56e

Please sign in to comment.