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.

Dependencies:   BufferedArray

Dependents:   MBEDminiproject

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TransmitOptions.cpp Source File

TransmitOptions.cpp

00001 #include "TransmitOptions.h"
00002 
00003 TransmitOptions::TransmitOptions()
00004     : OptionsBase()
00005 { }
00006 
00007 TransmitOptions::TransmitOptions(unsigned char option)
00008     : OptionsBase(option)
00009 { }
00010 
00011 TransmitOptions::TransmitOptions(bool disable_retries_and_route_repair, bool enable_APS_encryption, bool use_extended_transmission_timeout)
00012 {
00013     value = 0x00;
00014     if (disable_retries_and_route_repair)
00015         value |= 0x01;
00016     if (enable_APS_encryption)
00017         value |= 0x20;
00018     if (use_extended_transmission_timeout)
00019         value |= 0x40;
00020 }
00021 
00022 TransmitOptions * TransmitOptions::EnableAPS = new TransmitOptions(0x20);
00023 
00024 TransmitOptions * TransmitOptions::UseExtendedTimeout = new TransmitOptions(0x40);
00025 
00026 bool TransmitOptions::getEnableAPS()
00027 {
00028     if (value & 0x20 == 0x20)
00029         return true;
00030     else return false;
00031 }
00032 
00033 void TransmitOptions::setEnableAPS(bool status)
00034 {
00035     if (status)
00036         value |= 0x20;
00037     else
00038         value &= 0xDF;
00039 }
00040 
00041 bool TransmitOptions::getUseExtendedTimeout()
00042 {
00043     if ((value & 0x40) == 0x40)
00044         return true;
00045     else return false;
00046 }
00047 
00048 void TransmitOptions::setUseExtendedTimeout(bool status)
00049 {
00050     if (status)
00051         value |= 0x40;
00052     else
00053         value &= 0xBF;
00054 }