The ookSwitch function sometimes returns a non-zero value when there were messages in the Rx buffer when called. This is not documented very well. For example mqtt-energenie-ener314rt (before v0.5) checked for non-zero return code, and logs an error if non-zero. This is believed to be the dodgy code:
/*
** flush Rx buffer if required
*/
ret = empty_radio_Rx_buffer(DT_CONTROL);
The record count is used in openthings_scan() to return messages before timeout reached. So the solution should be to change ookSwitch to ignore record count
The ookSwitch function sometimes returns a non-zero value when there were messages in the Rx buffer when called. This is not documented very well. For example mqtt-energenie-ener314rt (before v0.5) checked for non-zero return code, and logs an error if non-zero. This is believed to be the dodgy code: