WaspXBee868 Class Reference

WaspXBee868 Class. More...

#include <WaspXBee868.h>

Inheritance diagram for WaspXBee868:

Inheritance graph
[legend]
Collaboration diagram for WaspXBee868:

Collaboration graph
[legend]

Public Member Functions

 WaspXBee868 ()
 class constructor
void init (uint8_t protocol_used, uint8_t frequency, uint8_t model_used)
 It initializes the necessary variables.
uint8_t getRFerrors ()
 It gets the number of times the RF receiver detected a CRC or length error.
uint8_t getGoodPackets ()
 It gets the number of good frames with valid MAC headers that are received on the RF interface.
uint8_t getChannelRSSI (uint8_t channel)
 It gets the DBM level of the designated channel.
uint8_t getTransmisionErrors ()
 It gets the number of MAC frames that exhaust MAC retries without ever receiving a MAC acknowledgement message from the adjacent node.
uint8_t getTemperature ()
 It gets module temperature in Celsius. Negatives temperatures can be returned.
uint8_t getSupplyVoltage ()
 It gets the voltage on the Vcc pin.
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 setMultipleBroadcast (uint8_t mtrans)
 It sets the number of additional broadcast retransmissions.
uint8_t getMultipleBroadcast ()
 It gets the number of additional broadcast retransmissions.
uint8_t setMacRetries (uint8_t macretries)
 It sets the number of retries than can be sent for a given unicast RF packet.
uint8_t getMacRetries ()
 It gets the number of retries than can be sent for a given unicast RF packet.
uint8_t getDutyCicle ()
 It gets the % it has been used of available Duty Cicle.
uint8_t getResetReason ()
 It gets the reason for the last module reset.
uint8_t getACKerrors ()
 It gets the number of failed ACK retries.

Data Fields

uint8_t ACKerrors [2]
 Variable : the number of failed ACK retries.
uint8_t errorsRF [2]
 Variable : the number of times the RF receiver detected a CRC or length error.
uint8_t goodPackets [2]
 Variable : the number of good frames with valid MAC headers that are received on the RF interface.
uint8_t channelRSSI
 Variable : the DBM level of the designated channel.
uint8_t transmisionErrors [2]
 Variable : the number of MAC frames that exhaust MAC retries without ever receiving a MAC acknowledgement message from the adjacent node.
uint8_t temperature [2]
 Variable : module temperature in Celsius. Negatives temperatures can be returned.
uint8_t supplyVoltage [2]
 Variable : Voltage on the Vcc pin.
uint8_t maxPayloadBytes [2]
 Variable : Max payload to be used for transmission.
uint8_t deviceType [4]
 Variable : the current device type.
uint8_t multipleBroadcast
 Variable : the number of additional broadcast retransmissions (range [0x00-0x0F]).
uint8_t macRetries
 Variable : the number of retries than can be sent for a given unicast RF packet (range [0x00-0x0F]).
uint8_t dutyCicle
 Variable : the % it has been used of available Duty Cicle.
uint8_t resetReason
 Variable : Reason for the last module reset.

Detailed Description

WaspXBee868 Class.

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

Definition at line 60 of file WaspXBee868.h.


Constructor & Destructor Documentation

WaspXBee868::WaspXBee868 (  )  [inline]

class constructor

It does nothing

Parameters:
void 
Returns:
void

Definition at line 70 of file WaspXBee868.h.

00070 {};


Member Function Documentation

void WaspXBee868::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 (XBEE_868 in this case)
uint8_t frequency : specifies the frequency used in the XBee module (FREQ868M in this case)
uint8_t model_used : specifies the XBee model used (PRO in this case)
Returns:
void

Reimplemented from WaspXBeeCore.

Definition at line 29 of file WaspXBee868.cpp.

References ACKerrors, WaspXBeeCore::add_type, WaspXBeeCore::clearCommand(), WaspXBeeCore::clearFinishArray(), WaspXBeeCore::data_length, WaspXBeeCore::discoveryOptions, WaspXBeeCore::encryptMode, WaspXBeeCore::error_AT, WaspXBeeCore::error_RX, WaspXBeeCore::error_TX, errorsRF, WaspXBeeCore::finish, WaspXBeeCore::frag_length, WaspXBeeCore::frameNext, WaspXBeeCore::freq, goodPackets, WaspXBeeCore::indexNotModified, WaspXBeeCore::it, macRetries, maxPayloadBytes, WaspXBeeCore::mode, WaspXBeeCore::model, multipleBroadcast, WaspXBeeCore::nextIndex1, WaspXBeeCore::pendingPackets, WaspXBeeCore::pos, WaspXBeeCore::powerLevel, WaspXBeeCore::protocol, WaspXBeeCore::replacementPolicy, resetReason, WaspXBeeCore::scanTime, WaspXBeeCore::start, WaspXBeeCore::TIME1, WaspXBeeCore::timeRSSI, WaspXBeeCore::totalFragmentsReceived, transmisionErrors, 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         
00040         scanTime[0]=0x00;
00041         scanTime[1]=0x82;
00042         encryptMode=0;
00043         powerLevel=4;
00044         timeRSSI=0x20;
00045 
00046         ACKerrors[0]=0x00;
00047         ACKerrors[1]=0x00;
00048         errorsRF[0]=0x00;
00049         errorsRF[1]=0x00;
00050         goodPackets[0]=0x00;
00051         goodPackets[1]=0x00;
00052         transmisionErrors[0]=0x00;
00053         transmisionErrors[1]=0x00;
00054         maxPayloadBytes[0]=0x01;
00055         maxPayloadBytes[1]=0x00;
00056         multipleBroadcast=0x03;
00057         macRetries=0x0A;
00058         resetReason=0x00;
00059         
00060         data_length=0;
00061         it=0;
00062         start=0;
00063         finish=0;
00064         add_type=0;
00065         mode=0;
00066         frag_length=0;
00067         TIME1=0;        
00068         nextIndex1=0;
00069         frameNext=0;
00070         replacementPolicy=XBEE_OUT;
00071         indexNotModified=1;
00072         error_AT=2;
00073         error_RX=2;
00074         error_TX=2;
00075         clearFinishArray();
00076         clearCommand();
00077 }

Here is the call graph for this function:

uint8_t WaspXBee868::getRFerrors (  ) 

It gets the number of times the RF receiver detected a CRC or length error.

It stores in global 'errorsRF' variable the number of times the RF receiver detected a CRC or length error

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

Definition at line 87 of file WaspXBee868.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, errorsRF, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_RF_errors_868.

00088 {
00089     int8_t error=2;
00090      
00091     error_AT=2;
00092     gen_data(get_RF_errors_868);
00093     error=gen_send(get_RF_errors_868);
00094     
00095     if(!error)
00096     {
00097         errorsRF[0]=data[0];
00098         delay(20);
00099         errorsRF[1]=data[1];
00100         delay(20);       
00101     }
00102     return error;
00103 }

Here is the call graph for this function:

uint8_t WaspXBee868::getGoodPackets (  ) 

It gets the number of good frames with valid MAC headers that are received on the RF interface.

It stores in global 'goodPackets' variable the number of good frames with valid MAC headers that are received on the RF interface

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

Definition at line 113 of file WaspXBee868.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_good_pack_868, and goodPackets.

00114 {
00115     int8_t error=2;
00116      
00117     error_AT=2;
00118     gen_data(get_good_pack_868);
00119     error=gen_send(get_good_pack_868);
00120     
00121     if(!error)
00122     {
00123         goodPackets[0]=data[0];
00124         delay(20);
00125         goodPackets[1]=data[1];
00126         delay(20);       
00127     } 
00128     return error;
00129 }

Here is the call graph for this function:

uint8_t WaspXBee868::getChannelRSSI ( uint8_t  channel  ) 

It gets the DBM level of the designated channel.

It stores in global 'channelRSSI' variable the DBM level of the designated channel

Parameters:
uint8_t channel : the channel where to get the DBM level (range [0-11])
Returns:
'0' on success, '1' otherwise

Definition at line 141 of file WaspXBee868.cpp.

References channelRSSI, WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_checksum(), WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_channel_RSSI_868.

00142 {
00143     int8_t error=2;
00144      
00145     error_AT=2;
00146     gen_data(get_channel_RSSI_868,channel);
00147     gen_checksum(get_channel_RSSI_868);
00148     error=gen_send(get_channel_RSSI_868);
00149     
00150     if(error==0)
00151     {
00152         channelRSSI=data[1];
00153         delay(20);
00154     } 
00155     return error;
00156 }

Here is the call graph for this function:

uint8_t WaspXBee868::getTransmisionErrors (  ) 

It gets the number of MAC frames that exhaust MAC retries without ever receiving a MAC acknowledgement message from the adjacent node.

It stores in global 'transmisionErrors' variable the number of MAC frames that exhaust MAC retries without ever receiving a MAC acknowledgement message from the adjacent node

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

Definition at line 167 of file WaspXBee868.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_trans_errors_868, and transmisionErrors.

00168 {
00169     int8_t error=2;
00170      
00171     error_AT=2;
00172     gen_data(get_trans_errors_868);
00173     error=gen_send(get_trans_errors_868);
00174     
00175     if(!error)
00176     {
00177         transmisionErrors[0]=data[0];
00178         delay(20);
00179         transmisionErrors[1]=data[1];
00180         delay(20);       
00181     } 
00182     return error;
00183 }

Here is the call graph for this function:

uint8_t WaspXBee868::getTemperature (  ) 

It gets module temperature in Celsius. Negatives temperatures can be returned.

It stores in global 'temperature' variable module temperature in Celsius

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

Definition at line 193 of file WaspXBee868.cpp.

References WaspXBeeCore::data, delay(), WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_temperature_868, and temperature.

00194 {
00195     int8_t error=2;
00196      
00197     error_AT=2;
00198     gen_data(get_temperature_868);
00199     error=gen_send(get_temperature_868);
00200     
00201     if(error==0)
00202     {
00203             temperature[0]=data[0];
00204             delay(20);
00205             temperature[1]=data[1];    
00206             delay(20);
00207     }
00208     return error;
00209 }

Here is the call graph for this function:

uint8_t WaspXBee868::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 219 of file WaspXBee868.cpp.

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

00220 {
00221     int8_t error=2;
00222      
00223     error_AT=2;
00224     gen_data(get_supply_Volt_868);
00225     error=gen_send(get_supply_Volt_868);
00226     
00227     if(error==0)
00228     {
00229             supplyVoltage[0]=data[0];
00230             delay(20);
00231             supplyVoltage[1]=data[1];    
00232             delay(20);
00233     }
00234     return error;
00235 }

Here is the call graph for this function:

uint8_t WaspXBee868::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 245 of file WaspXBee868.cpp.

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

00246 {
00247     int8_t error=2;
00248      
00249     error_AT=2;
00250     gen_data(get_device_type_868);
00251     error=gen_send(get_device_type_868);
00252     
00253     if(error==0)
00254     {
00255         for(it=0;it<4;it++)
00256         {
00257             deviceType[it]=data[it];
00258             delay(20);
00259         }
00260     }
00261     return error;
00262 }

Here is the call graph for this function:

uint8_t WaspXBee868::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 272 of file WaspXBee868.cpp.

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

00273 {
00274     int8_t error=2;
00275      
00276     error_AT=2;
00277     gen_data(get_payload_bytes_868);
00278     error=gen_send(get_payload_bytes_868);
00279     
00280     if(error==0)
00281     {
00282         maxPayloadBytes[0]=data[0];
00283         maxPayloadBytes[1]=data[1];
00284     }
00285     return error;
00286 } 

Here is the call graph for this function:

uint8_t WaspXBee868::setMultipleBroadcast ( uint8_t  mtrans  ) 

It sets the number of additional broadcast retransmissions.

Parameters:
uint8_t mtrans : specifies the number of additional broadcast retransmissions (range [0x00-0x0F])
Returns:
'0' on success, '1' otherwise

Definition at line 298 of file WaspXBee868.cpp.

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

00299 {
00300     int8_t error=2;
00301      
00302     error_AT=2;
00303     gen_data(set_mult_broadcast_868,mtrans);
00304     gen_checksum(set_mult_broadcast_868);
00305     error=gen_send(set_mult_broadcast_868);
00306     
00307     if(error==0)
00308     {
00309         multipleBroadcast=mtrans;
00310     }
00311     return error;
00312 }

Here is the call graph for this function:

uint8_t WaspXBee868::getMultipleBroadcast (  ) 

It gets the number of additional broadcast retransmissions.

It stores in global 'multipleBroadcast' variable the number of additional broadcast retransmissions

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

Definition at line 322 of file WaspXBee868.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_mult_broadcast_868, and multipleBroadcast.

00323 {
00324     int8_t error=2;
00325      
00326     error_AT=2;
00327     gen_data(get_mult_broadcast_868);
00328     error=gen_send(get_mult_broadcast_868);
00329     
00330     if(error==0)
00331     {
00332         multipleBroadcast=data[0];
00333     }
00334     return error;
00335 }

Here is the call graph for this function:

uint8_t WaspXBee868::setMacRetries ( uint8_t  macretries  ) 

It sets the number of retries than can be sent for a given unicast RF packet.

Parameters:
uint8_t macretries : specifies the number of retries than can be sent for a given unicast RF packet (range [0x00-0x0F])
Returns:
'0' on success, '1' otherwise

Definition at line 347 of file WaspXBee868.cpp.

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

00348 {
00349     int8_t error=2;
00350      
00351     error_AT=2;
00352     gen_data(set_retries_868,macretries);
00353     gen_checksum(set_retries_868);
00354     error=gen_send(set_retries_868);
00355     
00356     if(error==0)
00357     {
00358         macRetries=macretries;
00359     }
00360     return error;
00361 }

Here is the call graph for this function:

uint8_t WaspXBee868::getMacRetries (  ) 

It gets the number of retries than can be sent for a given unicast RF packet.

It stores in global 'macRetries' variable the number of retries than can be sent for a given unicast RF packet

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

Definition at line 371 of file WaspXBee868.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_retries_868, and macRetries.

00372 {
00373     int8_t error=2;
00374      
00375     error_AT=2;
00376     gen_data(get_retries_868);
00377     error=gen_send(get_retries_868);
00378     
00379     if(error==0)
00380     {
00381         macRetries=data[0];
00382     }
00383     return error;
00384 }

Here is the call graph for this function:

uint8_t WaspXBee868::getDutyCicle (  ) 

It gets the % it has been used of available Duty Cicle.

It stores in global 'dutyCicle' variable the % it has been used of available Duty Cicle

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

Definition at line 394 of file WaspXBee868.cpp.

References WaspXBeeCore::data, dutyCicle, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_duty_cicle_868.

00395 {
00396     int8_t error=2;
00397      
00398     error_AT=2;
00399     gen_data(get_duty_cicle_868);
00400     error=gen_send(get_duty_cicle_868);
00401     
00402     if(error==0)
00403     {
00404         dutyCicle=data[0];
00405     }
00406     return error;
00407 }

Here is the call graph for this function:

uint8_t WaspXBee868::getResetReason (  ) 

It gets the reason for the last module reset.

It stores in global 'resetReason' variable the reason for the last module reset

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

Definition at line 417 of file WaspXBee868.cpp.

References WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), get_reset_reason_868, and resetReason.

00418 {
00419     int8_t error=2;
00420      
00421     error_AT=2;
00422     gen_data(get_reset_reason_868);
00423     error=gen_send(get_reset_reason_868);
00424     
00425     if(error==0)
00426     {
00427         resetReason=data[0];
00428     }
00429     return error;
00430 }

Here is the call graph for this function:

uint8_t WaspXBee868::getACKerrors (  ) 

It gets the number of failed ACK retries.

It stores in global 'ACKerrors' variable the number of failed ACK retries

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

Definition at line 440 of file WaspXBee868.cpp.

References ACKerrors, WaspXBeeCore::data, WaspXBeeCore::error_AT, WaspXBeeCore::gen_data(), WaspXBeeCore::gen_send(), and get_ACK_errors_868.

00441 {
00442     int8_t error=2;
00443      
00444     error_AT=2;
00445     gen_data(get_ACK_errors_868);
00446     error=gen_send(get_ACK_errors_868);
00447     
00448     if(error==0)
00449     {
00450         ACKerrors[0]=data[0];
00451         ACKerrors[1]=data[1];
00452     }
00453     return error;
00454 }

Here is the call graph for this function:


Field Documentation

Variable : the number of failed ACK retries.

Definition at line 191 of file WaspXBee868.h.

Referenced by getACKerrors(), and init().

Variable : the number of times the RF receiver detected a CRC or length error.

Definition at line 196 of file WaspXBee868.h.

Referenced by getRFerrors(), and init().

Variable : the number of good frames with valid MAC headers that are received on the RF interface.

Definition at line 201 of file WaspXBee868.h.

Referenced by getGoodPackets(), and init().

Variable : the DBM level of the designated channel.

Definition at line 206 of file WaspXBee868.h.

Referenced by getChannelRSSI().

Variable : the number of MAC frames that exhaust MAC retries without ever receiving a MAC acknowledgement message from the adjacent node.

Definition at line 211 of file WaspXBee868.h.

Referenced by getTransmisionErrors(), and init().

Variable : module temperature in Celsius. Negatives temperatures can be returned.

Definition at line 216 of file WaspXBee868.h.

Referenced by getTemperature().

Variable : Voltage on the Vcc pin.

Definition at line 221 of file WaspXBee868.h.

Referenced by getSupplyVoltage().

Variable : Max payload to be used for transmission.

Definition at line 226 of file WaspXBee868.h.

Referenced by getPayloadBytes(), and init().

Variable : the current device type.

Definition at line 231 of file WaspXBee868.h.

Referenced by getDeviceType().

Variable : the number of additional broadcast retransmissions (range [0x00-0x0F]).

Definition at line 236 of file WaspXBee868.h.

Referenced by getMultipleBroadcast(), init(), and setMultipleBroadcast().

Variable : the number of retries than can be sent for a given unicast RF packet (range [0x00-0x0F]).

Definition at line 241 of file WaspXBee868.h.

Referenced by getMacRetries(), init(), and setMacRetries().

Variable : the % it has been used of available Duty Cicle.

Definition at line 246 of file WaspXBee868.h.

Referenced by getDutyCicle().

Variable : Reason for the last module reset.

Definition at line 251 of file WaspXBee868.h.

Referenced by getResetReason(), and init().


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

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