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.
Request/ATCommandRequest.cpp@0:837e6c48e90d, 2015-10-22 (annotated)
- Committer:
- yangcq88517
- Date:
- Thu Oct 22 12:28:26 2015 +0000
- Revision:
- 0:837e6c48e90d
- Child:
- 6:5f31ddc17239
initial upload
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 0:837e6c48e90d | 1 | #include "ATCommandRequest.h" |
yangcq88517 | 0:837e6c48e90d | 2 | |
yangcq88517 | 0:837e6c48e90d | 3 | ATCommandRequest::ATCommandRequest(char frameID, const char * command, const char * parameter, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 4 | : TxBase(2 + (parameter == NULL ? 0 : length), APIFrame::AT_Command, frameID) |
yangcq88517 | 0:837e6c48e90d | 5 | { |
yangcq88517 | 0:837e6c48e90d | 6 | set(command[0]); |
yangcq88517 | 0:837e6c48e90d | 7 | set(command[1]); |
yangcq88517 | 0:837e6c48e90d | 8 | |
yangcq88517 | 0:837e6c48e90d | 9 | if (parameter != NULL) |
yangcq88517 | 0:837e6c48e90d | 10 | sets(parameter, offset, length); |
yangcq88517 | 0:837e6c48e90d | 11 | } |
yangcq88517 | 0:837e6c48e90d | 12 | |
yangcq88517 | 0:837e6c48e90d | 13 | void ATCommandRequest::setAppleChanges(bool appleChanges) |
yangcq88517 | 0:837e6c48e90d | 14 | { |
yangcq88517 | 0:837e6c48e90d | 15 | if (appleChanges) |
yangcq88517 | 0:837e6c48e90d | 16 | setFrameType(APIFrame::AT_Command); |
yangcq88517 | 0:837e6c48e90d | 17 | else |
yangcq88517 | 0:837e6c48e90d | 18 | setFrameType(APIFrame::AT_Command_Queue_Parameter_Value); |
yangcq88517 | 0:837e6c48e90d | 19 | } |
yangcq88517 | 0:837e6c48e90d | 20 | |
yangcq88517 | 0:837e6c48e90d | 21 | void ATCommandRequest::setCommand(const char * command) |
yangcq88517 | 0:837e6c48e90d | 22 | { |
yangcq88517 | 0:837e6c48e90d | 23 | set(2, command[0]); |
yangcq88517 | 0:837e6c48e90d | 24 | set(3, command[1]); |
yangcq88517 | 0:837e6c48e90d | 25 | } |
yangcq88517 | 0:837e6c48e90d | 26 | |
yangcq88517 | 0:837e6c48e90d | 27 | void ATCommandRequest::setParameter(const char * parameter, int offset, int length) |
yangcq88517 | 0:837e6c48e90d | 28 | { |
yangcq88517 | 0:837e6c48e90d | 29 | setPosition(4); |
yangcq88517 | 0:837e6c48e90d | 30 | sets(parameter, offset, length); |
yangcq88517 | 0:837e6c48e90d | 31 | } |