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 SensorReadIndicator.cpp Source File

SensorReadIndicator.cpp

00001 #include "SensorReadIndicator.h"
00002 
00003 SensorReadIndicator::SensorReadIndicator(APIFrame * frame)
00004     : RxBase(frame)
00005 { }
00006 
00007 Address SensorReadIndicator::GetRemoteDevice()
00008 {
00009     return Address(data + 1);
00010 }
00011 
00012 int SensorReadIndicator::GetReceiveStatus()
00013 {
00014     return data[11];
00015 }
00016 
00017 int SensorReadIndicator::GetOneWireSensor()
00018 {
00019     return data[12];
00020 }
00021 
00022 int SensorReadIndicator::GetAD0()
00023 {
00024     return (data[13] << 8) | data[14];
00025 }
00026 
00027 int SensorReadIndicator::GetAD1()
00028 {
00029     return (data[15] << 8) | data[16];
00030 }
00031 
00032 int SensorReadIndicator::GetAD2()
00033 {
00034     return (data[17] << 8) | data[18];
00035 }
00036 
00037 int SensorReadIndicator::GetAD3()
00038 {
00039     return (data[19] << 8) | data[20];
00040 }
00041 
00042 int SensorReadIndicator::GetThemometer()
00043 {
00044     return (data[21] << 8) | data[22];
00045 }
00046 
00047 bool  SensorReadIndicator::convert(APIFrame * frame)
00048 {
00049     if (frame == NULL)
00050         return false;
00051 
00052     if (frame->getFrameType() != APIFrame::XBee_Sensor_Read_Indicato)
00053         return false;
00054 
00055     return APIFrame::convert(frame);
00056 }