XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.
Diff: Request/ATCommandRequest.cpp
- Revision:
- 0:837e6c48e90d
- Child:
- 6:5f31ddc17239
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Request/ATCommandRequest.cpp Thu Oct 22 12:28:26 2015 +0000 @@ -0,0 +1,31 @@ +#include "ATCommandRequest.h" + +ATCommandRequest::ATCommandRequest(char frameID, const char * command, const char * parameter, int offset, int length) + : TxBase(2 + (parameter == NULL ? 0 : length), APIFrame::AT_Command, frameID) +{ + set(command[0]); + set(command[1]); + + if (parameter != NULL) + sets(parameter, offset, length); +} + +void ATCommandRequest::setAppleChanges(bool appleChanges) +{ + if (appleChanges) + setFrameType(APIFrame::AT_Command); + else + setFrameType(APIFrame::AT_Command_Queue_Parameter_Value); +} + +void ATCommandRequest::setCommand(const char * command) +{ + set(2, command[0]); + set(3, command[1]); +} + +void ATCommandRequest::setParameter(const char * parameter, int offset, int length) +{ + setPosition(4); + sets(parameter, offset, length); +} \ No newline at end of file