XBee API operation library for mbed

Embed: (wiki syntax)

« Back to documentation index

Address Class Reference

XBee address class for both S1 and S2 hardware. More...

#include <Address.h>

Inherited by ExplicitAddress.

Public Member Functions

 Address ()
 Create empty address : 0x00000000 0x00000000 0x0000 this is the default ZigBee Coordinatior.
 Address (const unsigned char *address64, const unsigned char *NET16)
 Create address from existing byte aray value : 8 bytes of ieee + 2 bytes network.
 Address (const unsigned char *addr)
 Create address from existing byte array value ( 8 bytes of IEEE address + 2 bytes 16 bit network address)
 Address (long serialNumberHigh, long serialNumberLow, int networkAddress)
 Create address from number value.
unsigned long getSerialNumberHigh ()
 Get the first 4 bytes of IEEE address.
unsigned long getSerialNumberLow ()
 Get the last 4 bytes of IEEE address.
unsigned int getNetworkAddress ()
 Get the 16 bit network address.
void setSerialNumberHigh (long SerialNumberHigh)
 Set the first 4 bytes of IEEE address.
void setSerialNumberLow (long SerialNumberLow)
 Set the last 4 bytes of IEEE address.
void setNetworkAddress (int NetworkAddress)
 Set the 16 bit network address.
const unsigned char * getAddressValue ()
 Convert the device address to 10 bytes array.

Static Public Attributes

static AddressBROADCAST_ZIGBEE = new Address(0x00000000, 0x0000FFFF, 0xFFFE)
 Get the ZigBee broadcast address.
static AddressBROADCAST_XBEE = new Address(0x00000000, 0x00000000, 0xFFFF)
 Get the XBee broadcast address.

Protected Attributes

unsigned char value [10]
 total 10 bytes (IEEE 64 bits + 16 bits networ address)

Friends

bool operator== (const Address &a, const Address &b)
 Compare two XBee addresses and check if both point to the same device.
bool operator!= (const Address &a, const Address &b)
 Compare two XBee addresses and check if both point to the same device.

Detailed Description

XBee address class for both S1 and S2 hardware.

Definition at line 7 of file Address.h.


Constructor & Destructor Documentation

Address (  )

Create empty address : 0x00000000 0x00000000 0x0000 this is the default ZigBee Coordinatior.

Definition at line 6 of file Address.cpp.

Address ( const unsigned char *  address64,
const unsigned char *  NET16 
)

Create address from existing byte aray value : 8 bytes of ieee + 2 bytes network.

Parameters:
address648 bytes of IEEE address
NET16value 2 bytes network address

Definition at line 8 of file Address.cpp.

Address ( const unsigned char *  addr )

Create address from existing byte array value ( 8 bytes of IEEE address + 2 bytes 16 bit network address)

Parameters:
addr10 bytes leong : (0-7 bytes for IEEE address, 8-9 bytes for 16 bit network address)

Definition at line 19 of file Address.cpp.

Address ( long  serialNumberHigh,
long  serialNumberLow,
int  networkAddress 
)

Create address from number value.

Parameters:
serialNumberHighfirst four byts of IEEE address and this can be retrieved by 'SH' command (eg. 0x0013A200)
serialNumberLowlast four byts of IEEE address and this can be retrieved by 'SL' command.
networkAddressa dynamic allocated value for XBee module, 0x0000 is reserved for the coordinator, and this can be retrieved by 'MY' command.

Definition at line 25 of file Address.cpp.


Member Function Documentation

const unsigned char * getAddressValue (  )

Convert the device address to 10 bytes array.

Returns:
IEEE 64 bit address follow by 16 bit network address

Definition at line 69 of file Address.cpp.

unsigned int getNetworkAddress (  )

Get the 16 bit network address.

Definition at line 42 of file Address.cpp.

unsigned long getSerialNumberHigh (  )

Get the first 4 bytes of IEEE address.

Definition at line 32 of file Address.cpp.

unsigned long getSerialNumberLow (  )

Get the last 4 bytes of IEEE address.

Definition at line 37 of file Address.cpp.

void setNetworkAddress ( int  NetworkAddress )

Set the 16 bit network address.

Definition at line 63 of file Address.cpp.

void setSerialNumberHigh ( long  SerialNumberHigh )

Set the first 4 bytes of IEEE address.

Definition at line 47 of file Address.cpp.

void setSerialNumberLow ( long  SerialNumberLow )

Set the last 4 bytes of IEEE address.

Definition at line 55 of file Address.cpp.


Friends And Related Function Documentation

bool operator!= ( const Address a,
const Address b 
) [friend]

Compare two XBee addresses and check if both point to the same device.

Definition at line 82 of file Address.cpp.

bool operator== ( const Address a,
const Address b 
) [friend]

Compare two XBee addresses and check if both point to the same device.

Definition at line 74 of file Address.cpp.


Field Documentation

Address * BROADCAST_XBEE = new Address(0x00000000, 0x00000000, 0xFFFF) [static]

Get the XBee broadcast address.

Definition at line 17 of file Address.h.

Address * BROADCAST_ZIGBEE = new Address(0x00000000, 0x0000FFFF, 0xFFFE) [static]

Get the ZigBee broadcast address.

Definition at line 14 of file Address.h.

unsigned char value[10] [protected]

total 10 bytes (IEEE 64 bits + 16 bits networ address)

Definition at line 11 of file Address.h.