Digi XBeeLib fixed for NonCopyable issue
Dependents: XBeeZB_Receive_Data
Fork of XBeeLib by
This lib fixes NonCopyable<T> issues of Digi XBeeLib. Also, lib has been reworked in order to make it RTOS-aware, overcoming several others issues due to stdio Mutex operations.
Diff: XBee/RadioConfig.cpp
- Revision:
- 11:c49cf952d67d
- Parent:
- 6:06522f3a6642
diff -r 926dbab7a7bc -r c49cf952d67d XBee/RadioConfig.cpp --- a/XBee/RadioConfig.cpp Sat Mar 24 18:15:23 2018 +0000 +++ b/XBee/RadioConfig.cpp Sat Mar 24 19:50:19 2018 +0100 @@ -209,9 +209,9 @@ } _timeout_ms = nd_timeout; - Timer nd_timer = Timer(); + Timer* pnd_timer = new Timer(); - nd_timer.start(); + pnd_timer->start(); AtCmdFrame atnd_frame = AtCmdFrame("ND", (const uint8_t *)node_id, strlen(node_id)); const uint8_t frame_id = atnd_frame.get_frame_id(); @@ -225,6 +225,7 @@ if (resp_frame == NULL) { digi_log(LogLevelWarning, "_get_remote_node_by_id: timeout when waiting for ATND response"); + delete pnd_timer; return; } @@ -232,6 +233,7 @@ /* In 802.15.4 this might be the OK or Timeout message with no information */ digi_log(LogLevelInfo, "_get_remote_node_by_id: node not found\r\n", __FUNCTION__, node_id); _framebuf_syncr.free_frame(resp_frame); + delete pnd_timer; return; } @@ -239,6 +241,7 @@ if (resp != AtCmdFrame::AtCmdRespOk) { digi_log(LogLevelWarning, "_get_remote_node_by_id: send_at_cmd bad response: 0x%x\r\n", resp); _framebuf_syncr.free_frame(resp_frame); + delete pnd_timer; return; } @@ -247,11 +250,12 @@ _framebuf_syncr.free_frame(resp_frame); if (wait_for_complete_timeout) { - while (nd_timer.read_ms() < nd_timeout) { + while (pnd_timer->read_ms() < nd_timeout) { wait_ms(10); } } + delete pnd_timer; return; }