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 Address.h Source File

Address.h

00001 #ifndef UK_AC_HERTS_SMARTLAB_XBEE_Address
00002 #define UK_AC_HERTS_SMARTLAB_XBEE_Address
00003 
00004 #include "mbed.h"
00005 
00006 class Address
00007 {
00008 protected:
00009     // total 10 bytes
00010     // IEEE 64 + 16bit networ address
00011     unsigned char value[10];
00012 public:
00013     static Address * BROADCAST_ZIGBEE;
00014     static Address * BROADCAST_XBEE;
00015 
00016     /// <summary>
00017     /// create empty address : 0x00000000 0x00000000 0x0000
00018     /// this is the default ZigBee Coordinatior
00019     /// </summary>
00020     Address();
00021 
00022     /// <summary>
00023     /// create address from byte[8 + 2] value : 8 bytes of ieee + 2 bytes network
00024     /// </summary>
00025     /// <param name="Address64"></param>
00026     /// <param name="NET16"></param>
00027     Address(const unsigned char * address64, const unsigned char * NET16);
00028 
00029     /// <summary>
00030     /// create address from byte[10] value : 8 bytes of ieee follow 2 bytes network
00031     /// </summary>
00032     /// <param name="value"></param>
00033     Address(const unsigned char * addr);
00034 
00035     Address(long serialNumberHigh, long serialNumberLow, int networkAddress);
00036 
00037     unsigned long getSerialNumberHigh();
00038 
00039     unsigned long getSerialNumberLow();
00040 
00041     unsigned int getNetworkAddress();
00042 
00043     void setSerialNumberHigh(long SerialNumberHigh);
00044 
00045     void setSerialNumberLow(long SerialNumberLow);
00046 
00047     void setNetworkAddress(int NetworkAddress);
00048 
00049     /// <summary>
00050     /// total 10 bytes
00051     /// IEEE 64 + 16bit networ address
00052     /// </summary>
00053     /// <returns></returns>
00054     const unsigned  char * getAddressValue();
00055 
00056     friend bool operator ==(const Address &a,const Address &b);
00057 
00058     friend bool operator !=(const Address &a,const Address &b);
00059 };
00060 
00061 #endif