WaspXBeeZB Class Reference

WaspXBeeZB Class. More...

#include <WaspXBeeZB.h>

Inheritance diagram for WaspXBeeZB:

Inheritance graph
[legend]
Collaboration diagram for WaspXBeeZB:

Collaboration graph
[legend]

Public Member Functions

 WaspXBeeZB ()
 class constructor
void init (uint8_t protocol_used, uint8_t frequency, uint8_t model_used)
 It initializes the necessary variables.
uint8_t resetNetwork (uint8_t reset)
 It resets the network.
uint8_t getParentNetworkAddress ()
 It gets the 16b parent´s network address.
uint8_t getRemainingChildren ()
 It gets the number of children which can still connect to the current device.
uint8_t setDeviceType (uint8_t *type)
 It sets the current device type.
uint8_t getDeviceType ()
 It gets the current device type.
uint8_t getPayloadBytes ()
 It gets the bytes that can be used in the payload.
uint8_t getExtendedPAN ()
 It gets the Extended PAN ID.
uint8_t getOperatingPAN ()
 It gets the Operating PAN ID.
uint8_t setMaxUnicastHops (uint8_t hops)
 It sets the maximum hops limit.
uint8_t getMaxUnicastHops ()
 It gets the maximum hop limits.
uint8_t setMaxBroadcastHops (uint8_t bhops)
 It sets the maximum number of hops for each broadcast data transmission.
uint8_t getMaxBroadcastHops ()
 It gets the maximum number of hops for each broadcast data transmission.
uint8_t setStackProfile (uint8_t profile)
 It sets the ZigBee Stack profile.
uint8_t getStackProfile ()
 It gets the ZigBee Stack profile.
uint8_t setPeriodSleep (uint8_t *periods)
 It sets the number of Sleep Periods to not assert XBee pin.
uint8_t setJoinTime (uint8_t time)
 It sets the time that a Coordinator/Router allows nodes to join.
uint8_t getJoinTime ()
 It gets the time that a Coordinator/Router allows nodes to join.
uint8_t setChannelVerification (uint8_t verif)
 It sets the channel verification parameter.
uint8_t getChannelVerification ()
 It gets the channel verification parameter.
uint8_t setJoinNotification (uint8_t notif)
 It sets the join notification setting.
uint8_t getJoinNotification ()
 It gets the join notification setting.
uint8_t setAggregateNotification (uint8_t anotif)
 It sets the time between consecutive aggregate route broadcast messages.
uint8_t getAggregateNotification ()
 It gets the time between consecutive aggregate route broadcast messages.
uint8_t getAssociationIndication ()
 It gets information regarding last node join request.
uint8_t setEncryptionOptions (uint8_t eoptions)
 It sets options for encryption.
uint8_t getEncryptionOptions ()
 It gets options for encryption.
uint8_t setNetworkKey (char *key)
 It sets the 128-bit AES encryption key.
uint8_t setPowerMode (uint8_t power)
 It sets the power mode of the device.
uint8_t getPowerMode ()
 It gets the power mode of the device.
uint8_t getSupplyVoltage ()
 It gets the voltage on the Vcc pin.
uint8_t setAPSencryption (uint8_t mode)
 It sets the Application Layer Encryption.

Data Fields

uint8_t parentNA [2]
 Variable : the 16b parent´s network address.
uint8_t remainingChildren
 Variable : the number of children which can still connect to the current device.
uint8_t deviceType [4]
 Variable : the current device type.
uint8_t maxPayloadBytes [2]
 Variable : the bytes that can be used in the payload.
uint8_t extendedPAN [8]
 Variable : the extended PAN ID.
uint8_t operatingPAN [2]
 Variable : the operating PAN ID.
uint8_t maxUnicastHops
 Variable : the maximum hops limit (range [0x00-0xFF]).
uint8_t maxBroadcastHops
 Variable : the maximum number of hops for each broadcast data transmission (range [0x00-0x20]).
uint8_t stackProfile
 Variable : the ZigBee Stack profile (range [0-2]).
uint8_t periodSleep [2]
 Variable : the number of Sleep Periods to not assert XBee pin.
uint8_t joinTime
 Variable : the time that a Coordinator/Router allows nodes to join (range [0x00-0xFF]).
uint8_t channelVerification
 Variable : the channel verification parameter (range [0-1]).
uint8_t joinNotification
 Variable : the join notification setting (range [0-1]).
uint8_t aggregateNotification
 Variable : the time between consecutive aggregate route broadcast messages (range [0x00-0xFF]).
uint8_t associationIndication
 Variable : information regarding last node join request.
uint8_t encryptOptions
 Variable : options for encryption (range [0-2]).
uint8_t networkKey [16]
 Variable : the 128-bit AES encryption key (range [0-0xFFFFFFFFFFFFFFFF]).
uint8_t powerMode
 Variable : the power mode of the device (range [0-1]).
uint8_t supplyVoltage [2]
 Variable : the voltage on the Vcc pin.

Detailed Description

WaspXBeeZB Class.

WaspXBeeZB Class defines all the variables and functions used to manage XBee ZigBee modules. It inherits from 'WaspXBeeCore' class the necessary functions, variables and definitions

Definition at line 60 of file WaspXBeeZB.h.


Constructor & Destructor Documentation

WaspXBeeZB::WaspXBeeZB (  )  [inline]

class constructor

It does nothing

Parameters:
void 
Returns:
void

Definition at line 70 of file WaspXBeeZB.h.

00070 {};


Member Function Documentation

void WaspXBeeZB::init ( uint8_t  protocol_used,
uint8_t  frequency,
uint8_t  model_used 
)

It initializes the necessary variables.

It initalizes all the necessary variables including its father's variables

Parameters:
uint8_t protocol_used : specifies the protocol used in the XBee module (ZIGBEE in this case)
uint8_t frequency : specifies the frequency used in the XBee module (FREQ2_4G in this case)
uint8_t model_used : specifies the XBee model used (NORMAL or PRO)
Returns:
void

Reimplemented from WaspXBeeCore.

Definition at line 29 of file WaspXBeeZB.cpp.

References WaspXBeeCore::add_type, aggregateNotification, WaspXBeeCore::apsEncryption, AWAKE_TIME_ZIGBEE_H, AWAKE_TIME_ZIGBEE_L, WaspXBeeCore::awakeTime, channelVerification, WaspXBeeCore::clearCommand(), WaspXBeeCore::clearFinishArray(), WaspXBeeCore::data_length, deviceType, WaspXBeeCore::discoveryOptions, ENCRYPT_MODE_ZIGBEE, WaspXBeeCore::encryptMode, encryptOptions, WaspXBeeCore::error_AT, WaspXBeeCore::error_RX, WaspXBeeCore::error_TX, extendedPAN, WaspXBeeCore::finish, WaspXBeeCore::frag_length, WaspXBeeCore::frameNext, WaspXBeeCore::freq, WaspXBeeCore::indexNotModified, WaspXBeeCore::it, joinNotification, joinTime, maxBroadcastHops, maxUnicastHops, WaspXBeeCore::mode, WaspXBeeCore::model, networkKey, WaspXBeeCore::nextIndex1, parentNA, WaspXBeeCore::pendingPackets, WaspXBeeCore::pos, POWER_LEVEL_ZIGBEE, WaspXBeeCore::powerLevel, powerMode, WaspXBeeCore::protocol, WaspXBeeCore::replacementPolicy, SCAN_CHANNELS_ZIGBEE_H, SCAN_CHANNELS_ZIGBEE_L, SCAN_TIME_ZIGBEE, WaspXBeeCore::scanChannels, WaspXBeeCore::scanTime, SLEEP_OPTIONS_ZIGBEE, SLEEP_TIME_ZIGBEE_H, SLEEP_TIME_ZIGBEE_L, WaspXBeeCore::sleepOptions, WaspXBeeCore::sleepTime, stackProfile, WaspXBeeCore::start, WaspXBeeCore::TIME1, TIME_ENERGY_CHANNEL_ZIGBEE, TIME_RSSI_ZIGBEE, WaspXBeeCore::timeEnergyChannel, WaspXBeeCore::timeRSSI, WaspXBeeCore::totalFragmentsReceived, and XBEE_OUT.

00030 {
00031         protocol=protocol_used;
00032         freq=frequency;
00033         model=model_used;
00034         
00035         totalFragmentsReceived=0;
00036         pendingPackets=0;
00037         pos=0;
00038         discoveryOptions=0x00;
00039         awakeTime[0]=AWAKE_TIME_ZIGBEE_H;
00040         awakeTime[1]=AWAKE_TIME_ZIGBEE_L;
00041         sleepTime[0]=SLEEP_TIME_ZIGBEE_H;
00042         sleepTime[1]=SLEEP_TIME_ZIGBEE_L;
00043         scanTime[0]=SCAN_TIME_ZIGBEE;
00044         scanChannels[0]=SCAN_CHANNELS_ZIGBEE_H;
00045         scanChannels[1]=SCAN_CHANNELS_ZIGBEE_L;
00046         timeEnergyChannel=TIME_ENERGY_CHANNEL_ZIGBEE;
00047         encryptMode=ENCRYPT_MODE_ZIGBEE;
00048         powerLevel=POWER_LEVEL_ZIGBEE;
00049         timeRSSI=TIME_RSSI_ZIGBEE;
00050         sleepOptions=SLEEP_OPTIONS_ZIGBEE;
00051 
00052         parentNA[0]=0xFF;
00053         parentNA[1]=0xFE;
00054         deviceType[0]=0x00;
00055         deviceType[1]=0x03;
00056         deviceType[2]=0x00;
00057         deviceType[3]=0x00;
00058         for(it=0;it<8;it++)
00059         {
00060                 extendedPAN[it]=0x00;
00061         }
00062         maxUnicastHops=0x1E;
00063         maxBroadcastHops=0x00;
00064         stackProfile=0;
00065         joinTime=0xFF;
00066         channelVerification=0x00;
00067         joinNotification=0x00;
00068         aggregateNotification=0xFF;
00069         encryptOptions=0;
00070         for(it=0;it<16;it++)
00071         {
00072                 networkKey[it]=0x00;
00073         }
00074         powerMode=4;
00075         
00076         data_length=0;
00077         it=0;
00078         start=0;
00079         finish=0;
00080         add_type=0;
00081         mode=0;
00082         frag_length=0;
00083         TIME1=0;
00084         nextIndex1=0;
00085         frameNext=0;
00086         replacementPolicy=XBEE_OUT;
00087         indexNotModified=1;
00088         error_AT=2;
00089         error_RX=2;
00090         error_TX=2;
00091         clearFinishArray();
00092         clearCommand();
00093         apsEncryption=0;
00094 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::resetNetwork ( uint8_t  reset  ) 

It resets the network.

Parameters:
uint8_t reset : specifies the reset to do (0: reset the node network interface || 1: reset the entirely network)
Returns:
'0' on success, '1' otherwise

Definition at line 108 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and reset_network_ZB.

00109 {
00110     int8_t error=2;
00111         
00112     error_AT=2;
00113     gen_data(reset_network_ZB,reset);
00114     gen_checksum(reset_network_ZB);
00115     error=gen_send(reset_network_ZB);
00116     
00117     return error;
00118 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getParentNetworkAddress (  ) 

It gets the 16b parent´s network address.

It stores in global 'parentNA' variable the 16b parent´s network address

Returns:
'0' on success, '1' otherwise

Definition at line 129 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_parent_NA_ZB, and parentNA.

00130 {
00131     int8_t error=2;
00132         
00133     error_AT=2;
00134     gen_data(get_parent_NA_ZB);
00135     error=gen_send(get_parent_NA_ZB);
00136     
00137     if(error==0)
00138     {
00139         parentNA[0]=data[0];
00140         parentNA[1]=data[1];
00141     }
00142     return error;
00143 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getRemainingChildren (  ) 

It gets the number of children which can still connect to the current device.

It stores in global 'remainingChildren' variable the number of children which can still connect to the current device

Returns:
'0' on success, '1' otherwise

Definition at line 154 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_rem_children_ZB, and remainingChildren.

00155 {
00156     int8_t error=2;
00157         
00158     error_AT=2;
00159     gen_data(get_rem_children_ZB);
00160     error=gen_send(get_rem_children_ZB);
00161     
00162     if(error==0)
00163     {
00164         remainingChildren=data[0];
00165     }
00166     return error;
00167 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setDeviceType ( uint8_t *  type  ) 

It sets the current device type.

Parameters:
uint8_t* type : the current device type (range [0-0xFFFFFFFF])
Returns:
'0' on success, '1' otherwise

Definition at line 179 of file WaspXBeeZB.cpp.

References deviceType, WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), WaspXBeeCore::it, and set_device_type_ZB.

00180 {
00181     int8_t error=2;
00182         
00183     error_AT=2;
00184     gen_data(set_device_type_ZB,type);
00185     gen_checksum(set_device_type_ZB);
00186     error=gen_send(set_device_type_ZB);
00187     
00188     if(error==0)
00189     {
00190         for(it=0;it<4;it++)
00191         {
00192             deviceType[it]=type[it];
00193         }
00194     }
00195     return error;
00196 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getDeviceType (  ) 

It gets the current device type.

It stores in global 'deviceType' variable the current device type

Returns:
'0' on success, '1' otherwise

Definition at line 206 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, delay(), deviceType, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_device_type_ZB, and WaspXBeeCore::it.

00207 {
00208     int8_t error=2;
00209         
00210     error_AT=2;
00211     gen_data(get_device_type_ZB);
00212     error=gen_send(get_device_type_ZB);
00213     
00214     if(error==0)
00215     {
00216         for(it=0;it<4;it++)
00217         {
00218             deviceType[it]=data[it];
00219             delay(20);
00220         }
00221     }
00222     return error;
00223 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getPayloadBytes (  ) 

It gets the bytes that can be used in the payload.

It stores in global 'maxPayloadBytes' variable the bytes that can be used in the payload

Returns:
'0' on success, '1' otherwise

Definition at line 233 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_payload_ZB, and maxPayloadBytes.

00234 {
00235     int8_t error=2;
00236         
00237     error_AT=2;
00238     gen_data(get_payload_ZB);
00239     error=gen_send(get_payload_ZB);
00240     
00241     if(error==0)
00242     {
00243         maxPayloadBytes[0]=data[0];
00244         maxPayloadBytes[1]=data[1];
00245     }
00246     return error;
00247 } 

Here is the call graph for this function:

uint8_t WaspXBeeZB::getExtendedPAN (  ) 

It gets the Extended PAN ID.

It stores in global 'extendedPan' variable the Extended PAN ID

Returns:
'0' on success, '1' otherwise

Definition at line 257 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, extendedPAN, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_ext_PAN_ZB, and WaspXBeeCore::it.

00258 {
00259     int8_t error=2;
00260         
00261     error_AT=2;
00262     gen_data(get_ext_PAN_ZB);
00263     error=gen_send(get_ext_PAN_ZB);
00264     
00265     if(error==0)
00266     {
00267         for(it=0;it<8;it++)
00268         {
00269             extendedPAN[it]=data[it];
00270             delay(25);
00271         }
00272     }  
00273     return error;
00274 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getOperatingPAN (  ) 

It gets the Operating PAN ID.

It stores in global 'operatingPAN' variable the Operating PAN ID

Returns:
'0' on success, '1' otherwise

Definition at line 284 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_opt_PAN_ZB, WaspXBeeCore::it, and operatingPAN.

00285 {
00286     int8_t error=2;
00287         
00288     error_AT=2;
00289     gen_data(get_opt_PAN_ZB);
00290     error=gen_send(get_opt_PAN_ZB);
00291     
00292     if(error==0)
00293     {
00294         for(it=0;it<2;it++)
00295         {
00296             operatingPAN[it]=data[it];
00297             delay(25);
00298         }
00299     }  
00300     return error;
00301 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setMaxUnicastHops ( uint8_t  hops  ) 

It sets the maximum hops limit.

Parameters:
uint8_t type : the maximum hops limit (range [0x00-0xFF])
Returns:
'0' on success, '1' otherwise

Definition at line 313 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), maxUnicastHops, and set_max_uni_hops_ZB.

00314 {
00315     int8_t error=2;
00316         
00317     error_AT=2;
00318     gen_data(set_max_uni_hops_ZB,hops);
00319     gen_checksum(set_max_uni_hops_ZB);
00320     error=gen_send(set_max_uni_hops_ZB);
00321     
00322     if(error==0)
00323     {
00324     maxUnicastHops=hops;
00325     }
00326     return error;
00327 } 

Here is the call graph for this function:

uint8_t WaspXBeeZB::getMaxUnicastHops (  ) 

It gets the maximum hop limits.

It stores in global 'maxUnicastHops' variable the maximum hop limits

Returns:
'0' on success, '1' otherwise

Definition at line 338 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_max_uni_hops_ZB, and maxUnicastHops.

00339 {
00340     int8_t error=2;
00341         
00342     error_AT=2;
00343     gen_data(get_max_uni_hops_ZB);
00344     error=gen_send(get_max_uni_hops_ZB);
00345     
00346     if(error==0)
00347     {
00348         maxUnicastHops=data[0];
00349     }
00350     return error;
00351 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setMaxBroadcastHops ( uint8_t  bhops  ) 

It sets the maximum number of hops for each broadcast data transmission.

Parameters:
uint8_t bhops : the maximum number of hops for each broadcast data transmission (range [0x00-0x20])
Returns:
'0' on success, '1' otherwise

Definition at line 363 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), maxBroadcastHops, and set_max_brd_hops_ZB.

00364 {
00365     int8_t error=2;
00366         
00367     error_AT=2;
00368     gen_data(set_max_brd_hops_ZB,bhops);
00369     gen_checksum(set_max_brd_hops_ZB);
00370     error=gen_send(set_max_brd_hops_ZB);
00371     
00372     if(error==0)
00373     {
00374         maxBroadcastHops=bhops;
00375     }
00376     return error;
00377 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getMaxBroadcastHops (  ) 

It gets the maximum number of hops for each broadcast data transmission.

It stores in global 'maxBroadcastHops' variable the maximum number of hops for each broadcast data transmission

Returns:
'0' on success, '1' otherwise

Definition at line 388 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_max_brd_hops_ZB, and maxBroadcastHops.

00389 {
00390     int8_t error=2;
00391         
00392     error_AT=2;
00393     gen_data(get_max_brd_hops_ZB);
00394     error=gen_send(get_max_brd_hops_ZB);
00395     
00396     if(error==0)
00397     {
00398         maxBroadcastHops=data[0];
00399     }
00400     return error;
00401 } 

Here is the call graph for this function:

uint8_t WaspXBeeZB::setStackProfile ( uint8_t  profile  ) 

It sets the ZigBee Stack profile.

Parameters:
uint8_t profile : the ZigBee Stack profile (range [0-2])
Returns:
'0' on success, '1' otherwise

Definition at line 413 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), set_stack_profile_ZB, and stackProfile.

00414 {
00415     int8_t error=2;
00416         
00417     error_AT=2;
00418     gen_data(set_stack_profile_ZB,profile);
00419     gen_checksum(set_stack_profile_ZB);
00420     error=gen_send(set_stack_profile_ZB);
00421     
00422     if(error==0)
00423     {
00424         stackProfile=profile;
00425     }
00426     return error;
00427 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getStackProfile (  ) 

It gets the ZigBee Stack profile.

It stores in global 'stackProfile' variable the ZigBee Stack profile

Returns:
'0' on success, '1' otherwise

Definition at line 437 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_stack_profile_ZB, and stackProfile.

00438 {
00439     int8_t error=2;
00440         
00441     error_AT=2;
00442     gen_data(get_stack_profile_ZB);
00443     error=gen_send(get_stack_profile_ZB);
00444     
00445     if(error==0)
00446     {
00447         stackProfile=data[0];
00448     }
00449     return error;
00450 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setPeriodSleep ( uint8_t *  periods  ) 

It sets the number of Sleep Periods to not assert XBee pin.

Parameters:
uint8_t* periods : the number of Sleep Periods to not assert XBee pin (range [0x20-0xAF0])
Returns:
'0' on success, '1' otherwise

Definition at line 462 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), periodSleep, and set_period_sleep_ZB.

00463 {
00464     int8_t error=2;
00465         
00466     error_AT=2;
00467     gen_data(set_period_sleep_ZB,periods);
00468     gen_checksum(set_period_sleep_ZB);
00469     error=gen_send(set_period_sleep_ZB);
00470     
00471     if(error==0)
00472     {
00473         periodSleep[0]=periods[0];
00474         periodSleep[1]=periods[1];
00475     }
00476     return error;
00477 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setJoinTime ( uint8_t  time  ) 

It sets the time that a Coordinator/Router allows nodes to join.

Parameters:
uint8_t time : the time that a Coordinator/Router allows nodes to join (range [0x00-0xFF])
Returns:
'0' on success, '1' otherwise

Definition at line 490 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), joinTime, and set_join_time_ZB.

00491 {
00492     int8_t error=2;
00493         
00494     error_AT=2;
00495     gen_data(set_join_time_ZB,time);
00496     gen_checksum(set_join_time_ZB);
00497     error=gen_send(set_join_time_ZB);
00498     
00499     if(error==0)
00500     {
00501         joinTime=time;
00502     }
00503     return error;
00504 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getJoinTime (  ) 

It gets the time that a Coordinator/Router allows nodes to join.

It stores in global 'joinTime' variable the time that a Coordinator/Router allows nodes to join

Returns:
'0' on success, '1' otherwise

Definition at line 514 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_join_time_ZB, and joinTime.

00515 {
00516     int8_t error=2;
00517         
00518     error_AT=2;
00519     gen_data(get_join_time_ZB);
00520     error=gen_send(get_join_time_ZB);
00521     
00522     if(error==0)
00523     {
00524         joinTime=data[0];
00525     }
00526     return error;
00527 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setChannelVerification ( uint8_t  verif  ) 

It sets the channel verification parameter.

Parameters:
uint8_t time : the channel verification parameter (range [0-1])
Returns:
'0' on success, '1' otherwise

Definition at line 539 of file WaspXBeeZB.cpp.

References channelVerification, WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and set_channel_verif_ZB.

00540 {
00541     int8_t error=2;
00542         
00543     error_AT=2;
00544     gen_data(set_channel_verif_ZB,verif);
00545     gen_checksum(set_channel_verif_ZB);
00546     error=gen_send(set_channel_verif_ZB);
00547     
00548     if(error==0)
00549     {
00550         channelVerification=verif;
00551     }
00552     return error;
00553 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getChannelVerification (  ) 

It gets the channel verification parameter.

It stores in global 'channelVerification' variable the channel verification parameter

Returns:
'0' on success, '1' otherwise

Definition at line 564 of file WaspXBeeZB.cpp.

References channelVerification, WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_channel_verif_ZB.

00565 {
00566     int8_t error=2;
00567         
00568     error_AT=2;
00569     gen_data(get_channel_verif_ZB);
00570     error=gen_send(get_channel_verif_ZB);
00571     
00572     if(error==0)
00573     {
00574         channelVerification=data[0];
00575     }
00576     return error;
00577 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setJoinNotification ( uint8_t  notif  ) 

It sets the join notification setting.

Parameters:
uint8_t notif : the join notification setting (range [0-1])
Returns:
'0' on success, '1' otherwise

Definition at line 589 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), joinNotification, and set_join_notif_ZB.

00590 {
00591     int8_t error=2;
00592         
00593     error_AT=2;
00594     gen_data(set_join_notif_ZB,notif);
00595     gen_checksum(set_join_notif_ZB);
00596     error=gen_send(set_join_notif_ZB);
00597     
00598     if(error==0)
00599     {
00600         joinNotification=notif;
00601     }
00602     return error;
00603 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getJoinNotification (  ) 

It gets the join notification setting.

It stores in global 'joinNotification' variable the join notification setting

Returns:
'0' on success, '1' otherwise

Definition at line 614 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_join_notif_ZB, and joinNotification.

00615 {
00616     int8_t error=2;
00617         
00618     error_AT=2;
00619     gen_data(get_join_notif_ZB);
00620     error=gen_send(get_join_notif_ZB);
00621     
00622     if(error==0)
00623     {
00624         joinNotification=data[0];
00625     }
00626     return error;
00627 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setAggregateNotification ( uint8_t  anotif  ) 

It sets the time between consecutive aggregate route broadcast messages.

Parameters:
uint8_t anotif : the time between consecutive aggregate route broadcast messages (range [0x00-0xFF])
Returns:
'0' on success, '1' otherwise

Definition at line 639 of file WaspXBeeZB.cpp.

References aggregateNotification, WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and set_aggreg_notif_ZB.

00640 {
00641     int8_t error=2;
00642         
00643     error_AT=2;
00644     gen_data(set_aggreg_notif_ZB,anotif);
00645     gen_checksum(set_aggreg_notif_ZB);
00646     error=gen_send(set_aggreg_notif_ZB);
00647     
00648     if(error==0)
00649     {
00650         aggregateNotification=anotif;
00651     }
00652     return error;
00653 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getAggregateNotification (  ) 

It gets the time between consecutive aggregate route broadcast messages.

It stores in global 'aggregateNotification' variable the time between consecutive aggregate route broadcast messages

Returns:
'0' on success, '1' otherwise

Definition at line 663 of file WaspXBeeZB.cpp.

References aggregateNotification, WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_aggreg_notif_ZB.

00664 {
00665     int8_t error=2;
00666         
00667     error_AT=2;
00668     gen_data(get_aggreg_notif_ZB);
00669     error=gen_send(get_aggreg_notif_ZB);
00670     
00671     if(error==0)
00672     {
00673         aggregateNotification=data[0];
00674     }
00675     return error;;
00676 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getAssociationIndication (  ) 

It gets information regarding last node join request.

It stores in global 'associationIndication' variable information regarding last node join request

Returns:
'0' on success, '1' otherwise

Definition at line 687 of file WaspXBeeZB.cpp.

References associationIndication, WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_assoc_indic_ZB.

00688 {
00689     int8_t error=2;
00690         
00691     error_AT=2;
00692     gen_data(get_assoc_indic_ZB);
00693     error=gen_send(get_assoc_indic_ZB);
00694     
00695     if(error==0)
00696     {
00697         associationIndication=data[0];
00698     }
00699     return error;
00700 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setEncryptionOptions ( uint8_t  eoptions  ) 

It sets options for encryption.

Parameters:
uint8_t eoptions : options for encryption (range [0-2])
Returns:
'0' on success, '1' otherwise

Definition at line 712 of file WaspXBeeZB.cpp.

References encryptOptions, WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and set_encryp_options_ZB.

00713 {
00714     int8_t error=2;
00715         
00716     error_AT=2;
00717     gen_data(set_encryp_options_ZB,eoptions);
00718     gen_checksum(set_encryp_options_ZB);
00719     error=gen_send(set_encryp_options_ZB);
00720     
00721     if(error==0)
00722     {
00723         encryptOptions=eoptions;
00724     }
00725     return error;
00726 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getEncryptionOptions (  ) 

It gets options for encryption.

It stores in global 'encrypOptions' variable options for encryption

Returns:
'0' on success, '1' otherwise

Definition at line 737 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, encryptOptions, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_encryp_options_ZB.

00738 {
00739     int8_t error=2;
00740         
00741     error_AT=2;
00742     gen_data(get_encryp_options_ZB);
00743     error=gen_send(get_encryp_options_ZB);
00744     
00745     if(error==0)
00746     {
00747         encryptOptions=data[0];
00748     }
00749     return error;
00750 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setNetworkKey ( char *  key  ) 

It sets the 128-bit AES encryption key.

Parameters:
char* key : the 128-bit AES encryption key (range [0-0xFFFFFFFFFFFFFFFF])
Returns:
'0' on success, '1' otherwise

Definition at line 762 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), WaspXBeeCore::it, networkKey, and set_netwk_key_ZB.

00763 {
00764     int8_t error=2;
00765         
00766     error_AT=2;
00767     gen_data(set_netwk_key_ZB,key);
00768     gen_checksum(set_netwk_key_ZB);
00769     error=gen_send(set_netwk_key_ZB);
00770     
00771     if(error==0)
00772     {
00773         for(it=0;it<16;it++)
00774         {
00775                 networkKey[it]=key[it];
00776         }
00777     }
00778     return error;
00779 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setPowerMode ( uint8_t  power  ) 

It sets the power mode of the device.

Parameters:
uint8_t power : the power mode of the device (range [0-1])
Returns:
'0' on success, '1' otherwise

Definition at line 791 of file WaspXBeeZB.cpp.

References WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), powerMode, and set_power_mode_ZB.

00792 {
00793     int8_t error=2;
00794         
00795     error_AT=2;
00796     gen_data(set_power_mode_ZB,power);
00797     gen_checksum(set_power_mode_ZB);
00798     error=gen_send(set_power_mode_ZB);
00799     
00800     if(error==0)
00801     {
00802         powerMode=power;
00803     }
00804     return error;
00805 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getPowerMode (  ) 

It gets the power mode of the device.

It stores in global 'powerMode' variable the power mode of the device

Returns:
'0' on success, '1' otherwise

Definition at line 815 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_power_mode_ZB, and powerMode.

00816 {
00817     int8_t error=2;
00818         
00819     error_AT=2;
00820     gen_data(get_power_mode_ZB);
00821     error=gen_send(get_power_mode_ZB);
00822     
00823     if(error==0)
00824     {
00825         powerMode=data[0];
00826     }
00827     return error;
00828 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::getSupplyVoltage (  ) 

It gets the voltage on the Vcc pin.

It stores in global 'supplyVoltage' variable the voltage on the Vcc pin

Returns:
'0' on success, '1' otherwise

Definition at line 838 of file WaspXBeeZB.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_supply_Volt_ZB, and supplyVoltage.

00839 {
00840     int8_t error=2;
00841         
00842     error_AT=2;
00843     gen_data(get_supply_Volt_ZB);
00844     error=gen_send(get_supply_Volt_ZB);
00845     
00846     if(error==0)
00847     {
00848         supplyVoltage[0]=data[0];
00849         delay(20);
00850         supplyVoltage[1]=data[1];    
00851         delay(20);
00852     }
00853     return error;
00854 }

Here is the call graph for this function:

uint8_t WaspXBeeZB::setAPSencryption ( uint8_t  mode  ) 

It sets the Application Layer Encryption.

Parameters:
uint8_t mode : enables or disables this encryption mode (XBEE_ON or XBEE_OFF)
Returns:
'0' on success, '1' otherwise

Definition at line 863 of file WaspXBeeZB.cpp.

References WaspXBeeCore::apsEncryption, WaspXBeeCore::error_AT, XBEE_OFF, and XBEE_ON.

00864 {
00865     int8_t error=0;
00866         
00867     if(mode==XBEE_ON) apsEncryption=1;
00868     else if(mode==XBEE_OFF) apsEncryption=0;
00869     
00870     error_AT=0;
00871     
00872     return error;
00873 }


Field Documentation

Variable : the 16b parent´s network address.

Definition at line 302 of file WaspXBeeZB.h.

Referenced by getParentNetworkAddress(), and init().

Variable : the number of children which can still connect to the current device.

Definition at line 307 of file WaspXBeeZB.h.

Referenced by getRemainingChildren().

Variable : the current device type.

Definition at line 312 of file WaspXBeeZB.h.

Referenced by getDeviceType(), init(), and setDeviceType().

Variable : the bytes that can be used in the payload.

Definition at line 317 of file WaspXBeeZB.h.

Referenced by getPayloadBytes().

Variable : the extended PAN ID.

Definition at line 322 of file WaspXBeeZB.h.

Referenced by getExtendedPAN(), and init().

Variable : the operating PAN ID.

Definition at line 327 of file WaspXBeeZB.h.

Referenced by getOperatingPAN().

Variable : the maximum hops limit (range [0x00-0xFF]).

Definition at line 332 of file WaspXBeeZB.h.

Referenced by getMaxUnicastHops(), init(), and setMaxUnicastHops().

Variable : the maximum number of hops for each broadcast data transmission (range [0x00-0x20]).

Definition at line 337 of file WaspXBeeZB.h.

Referenced by getMaxBroadcastHops(), init(), and setMaxBroadcastHops().

Variable : the ZigBee Stack profile (range [0-2]).

Definition at line 342 of file WaspXBeeZB.h.

Referenced by getStackProfile(), init(), and setStackProfile().

Variable : the number of Sleep Periods to not assert XBee pin.

Definition at line 347 of file WaspXBeeZB.h.

Referenced by setPeriodSleep().

Variable : the time that a Coordinator/Router allows nodes to join (range [0x00-0xFF]).

Definition at line 352 of file WaspXBeeZB.h.

Referenced by getJoinTime(), init(), and setJoinTime().

Variable : the channel verification parameter (range [0-1]).

Definition at line 357 of file WaspXBeeZB.h.

Referenced by getChannelVerification(), init(), and setChannelVerification().

Variable : the join notification setting (range [0-1]).

Definition at line 362 of file WaspXBeeZB.h.

Referenced by getJoinNotification(), init(), and setJoinNotification().

Variable : the time between consecutive aggregate route broadcast messages (range [0x00-0xFF]).

Definition at line 367 of file WaspXBeeZB.h.

Referenced by getAggregateNotification(), init(), and setAggregateNotification().

Variable : information regarding last node join request.

Definition at line 372 of file WaspXBeeZB.h.

Referenced by getAssociationIndication().

Variable : options for encryption (range [0-2]).

Definition at line 377 of file WaspXBeeZB.h.

Referenced by getEncryptionOptions(), init(), and setEncryptionOptions().

Variable : the 128-bit AES encryption key (range [0-0xFFFFFFFFFFFFFFFF]).

Definition at line 382 of file WaspXBeeZB.h.

Referenced by init(), and setNetworkKey().

Variable : the power mode of the device (range [0-1]).

Definition at line 387 of file WaspXBeeZB.h.

Referenced by getPowerMode(), init(), and setPowerMode().

Variable : the voltage on the Vcc pin.

Definition at line 392 of file WaspXBeeZB.h.

Referenced by getSupplyVoltage().


The documentation for this class was generated from the following files:

Generated on Tue Jul 20 09:31:07 2010 for WaspmoteAPI by  doxygen 1.5.6