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.
Options/RemoteCommandOptions.cpp@0:837e6c48e90d, 2015-10-22 (annotated)
- Committer:
- yangcq88517
- Date:
- Thu Oct 22 12:28:26 2015 +0000
- Revision:
- 0:837e6c48e90d
- Child:
- 4:a0f1fba6c2fb
initial upload
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 0:837e6c48e90d | 1 | #include "RemoteCommandOptions.h" |
yangcq88517 | 0:837e6c48e90d | 2 | |
yangcq88517 | 0:837e6c48e90d | 3 | |
yangcq88517 | 0:837e6c48e90d | 4 | RemoteCommandOptions::RemoteCommandOptions() |
yangcq88517 | 0:837e6c48e90d | 5 | : TransmitOptions() |
yangcq88517 | 0:837e6c48e90d | 6 | { } |
yangcq88517 | 0:837e6c48e90d | 7 | |
yangcq88517 | 0:837e6c48e90d | 8 | RemoteCommandOptions::RemoteCommandOptions(char option) |
yangcq88517 | 0:837e6c48e90d | 9 | : TransmitOptions(option) |
yangcq88517 | 0:837e6c48e90d | 10 | { } |
yangcq88517 | 0:837e6c48e90d | 11 | |
yangcq88517 | 0:837e6c48e90d | 12 | RemoteCommandOptions::RemoteCommandOptions(bool disable_retries_and_route_repair, bool apply_changes, bool enable_APS_encryption, bool use_extended_transmission_timeout) |
yangcq88517 | 0:837e6c48e90d | 13 | : TransmitOptions(disable_retries_and_route_repair, enable_APS_encryption, use_extended_transmission_timeout) |
yangcq88517 | 0:837e6c48e90d | 14 | { |
yangcq88517 | 0:837e6c48e90d | 15 | if (apply_changes) |
yangcq88517 | 0:837e6c48e90d | 16 | value |= 0x02; |
yangcq88517 | 0:837e6c48e90d | 17 | } |
yangcq88517 | 0:837e6c48e90d | 18 | |
yangcq88517 | 0:837e6c48e90d | 19 | RemoteCommandOptions RemoteCommandOptions::ApplyChanges = RemoteCommandOptions (0x02); |
yangcq88517 | 0:837e6c48e90d | 20 | |
yangcq88517 | 0:837e6c48e90d | 21 | void RemoteCommandOptions::setApplyChanges(bool status) |
yangcq88517 | 0:837e6c48e90d | 22 | { |
yangcq88517 | 0:837e6c48e90d | 23 | if (status) |
yangcq88517 | 0:837e6c48e90d | 24 | value |= 0x02; |
yangcq88517 | 0:837e6c48e90d | 25 | else |
yangcq88517 | 0:837e6c48e90d | 26 | value &= 0xFD; |
yangcq88517 | 0:837e6c48e90d | 27 | } |
yangcq88517 | 0:837e6c48e90d | 28 | |
yangcq88517 | 0:837e6c48e90d | 29 | bool RemoteCommandOptions::getApplyChanges() |
yangcq88517 | 0:837e6c48e90d | 30 | { |
yangcq88517 | 0:837e6c48e90d | 31 | if (value & 0x02 == 0x02) |
yangcq88517 | 0:837e6c48e90d | 32 | return true; |
yangcq88517 | 0:837e6c48e90d | 33 | else return false; |
yangcq88517 | 0:837e6c48e90d | 34 | } |