Library to easily communicate with XBee modules.
Fork of XBeeLib by
Diff: XBeeDM/XBeeDM.cpp
- Revision:
- 7:3ac2a461ce76
- Parent:
- 6:06522f3a6642
- Child:
- 8:b5f4a0e92249
--- a/XBeeDM/XBeeDM.cpp Thu Jul 28 10:17:20 2016 +0200 +++ b/XBeeDM/XBeeDM.cpp Thu Jul 28 15:36:36 2016 +0200 @@ -548,3 +548,34 @@ return Success; } + +RadioStatus XBeeDM::config_poll_destination(const RemoteXBee& destination) +{ + uint32_t dh; + uint32_t dl; + + if (destination.is_valid_addr64b()) { + const uint64_t dest64 = destination.get_addr64(); + dh = (uint32_t)((dest64 >> 32) & 0xFFFFFFFF); + dl = (uint32_t)((dest64 & 0xFFFFFFFF)); + } else { + digi_log(LogLevelError, "config_poll_destination: Invalid destination"); + return Failure; + } + + AtCmdFrame::AtCmdResp cmdresp; + + cmdresp = set_param("DH", dh); + if (cmdresp != AtCmdFrame::AtCmdRespOk) { + digi_log(LogLevelError, "config_poll_destination: error %d:\r\n", cmdresp); + return Failure; + } + + cmdresp = set_param("DL", dl); + if (cmdresp != AtCmdFrame::AtCmdRespOk) { + digi_log(LogLevelError, "config_poll_destination: error %d:\r\n", cmdresp); + return Failure; + } + + return Success; +}