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

Request/ATCommandRequest.cpp

Committer:
yangcq88517
Date:
2015-11-14
Revision:
6:5f31ddc17239
Parent:
0:837e6c48e90d

File content as of revision 6:5f31ddc17239:

#include "ATCommandRequest.h"

ATCommandRequest::ATCommandRequest(unsigned  char frameID, const char * command, const unsigned  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 unsigned  char * parameter, int offset, int length)
{
    setPosition(4);
    sets(parameter, offset, length);
}