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

Options/RemoteCommandOptions.cpp

Committer:
yangcq88517
Date:
2015-11-14
Revision:
6:5f31ddc17239
Parent:
4:a0f1fba6c2fb

File content as of revision 6:5f31ddc17239:

#include "RemoteCommandOptions.h"


RemoteCommandOptions::RemoteCommandOptions()
    : TransmitOptions()
{ }

RemoteCommandOptions::RemoteCommandOptions(unsigned char option)
    : TransmitOptions(option)
{ }

RemoteCommandOptions::RemoteCommandOptions(bool disable_retries_and_route_repair, bool apply_changes, bool enable_APS_encryption, bool use_extended_transmission_timeout)
    : TransmitOptions(disable_retries_and_route_repair, enable_APS_encryption, use_extended_transmission_timeout)
{
    if (apply_changes)
        value |= 0x02;
}

RemoteCommandOptions * RemoteCommandOptions::ApplyChanges =  new RemoteCommandOptions (0x02);

void RemoteCommandOptions::setApplyChanges(bool status)
{
    if (status)
        value |= 0x02;
    else
        value &= 0xFD;
}

bool RemoteCommandOptions::getApplyChanges()
{
    if (value & 0x02 == 0x02)
        return true;
    else return false;
}