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

Indicator/NodeIdentificationIndicator.cpp

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

File content as of revision 6:5f31ddc17239:

#include "NodeIdentificationIndicator.h"

NodeIdentificationIndicator::NodeIdentificationIndicator(APIFrame * frame)
    : RxBase(frame)
{
    offset = getPosition() - 8;
}

int NodeIdentificationIndicator::getReceiveStatus()
{
    return data[11];
}

Address NodeIdentificationIndicator::getRemoteDevice()
{
    return Address(data + 14, data + 8);
}

Address NodeIdentificationIndicator::getSenderDevice()
{
    return Address(data + 1);
}

unsigned  char * NodeIdentificationIndicator::getNIString()
{
    int length = getPosition() - 31;

    if (length <= 0)
        return NULL;

    return data + 22;
}

int NodeIdentificationIndicator::getParentNetworkAddress()
{
    return (data[offset] << 8) | data[offset + 1];
}

int NodeIdentificationIndicator::getDeviceType()
{
    return data[offset + 2];
}

int NodeIdentificationIndicator::getSourceEvent()
{
    return data[offset + 3];
}

int NodeIdentificationIndicator::getDigiProfileID()
{
    return (data[offset + 4] << 8) | data[offset + 5];
}

int NodeIdentificationIndicator::getManufacturerID()
{
    return (data[offset + 6] << 8) | data[offset + 7];
}

bool  NodeIdentificationIndicator::convert(APIFrame * frame)
{
    if (frame == NULL)
        return false;

    if (frame->getFrameType() != APIFrame::Node_Identification_Indicator)
        return false;

    return APIFrame::convert(frame);
}