The library for waveshare ZBee Core2530 (B):

Dependents:   zbee_rx_analog zbee_tx_analog simple_zb_rx simple_zb_tx

Embed: (wiki syntax)

« Back to documentation index

zbee Class Reference

zbee Class Reference

Zbee interface class for configuring, sending and recieving data using an waveshare Zbee. More...

#include <zbee.h>

Public Member Functions

 zbee (PinName tx, PinName rx, int baud)
 Configure serial data pin.
int GetAddr (char *)
 Puts the Xbee into config mode.
int GetPanId (char *)
 Sets the encryption key to the one stored in security_key.
int SetPanId (int)
 Sets the encryption key to the one stored in security_key.
int SendData (char *)
 Sets the encryption key to the one stored in security_key.
void ReceiveData (char *, int)
 Recieves data sent to the xbee.
void Reset ()
 Resets the Xbee.

Detailed Description

Zbee interface class for configuring, sending and recieving data using an waveshare Zbee.

Definition at line 24 of file zbee.h.


Constructor & Destructor Documentation

zbee ( PinName  tx,
PinName  rx,
int  baud 
)

Configure serial data pin.

Parameters:
txThe serial tx pin the xbee is conected to.
rxThe serial rx pin the xbee is conected to.
resetThe pin connected to the Xbee reset pin.

Definition at line 22 of file zbee.cpp.


Member Function Documentation

int GetAddr ( char *  addr )

Puts the Xbee into config mode.

Returns:
Returns 1 on success.

Definition at line 34 of file zbee.cpp.

int GetPanId ( char *  panid )

Sets the encryption key to the one stored in security_key.

Parameters:
keyPointer to the network key to set.
Returns:
Returns 1 on success.

Definition at line 44 of file zbee.cpp.

void ReceiveData ( char *  data_buf,
int  numchar 
)

Recieves data sent to the xbee.

Parameters:
data_bufPointer to the buffer to put recieved data into.
numcharNumber of characters to read. If 0, will use the size of data_buf.

Definition at line 65 of file zbee.cpp.

void Reset (  )

Resets the Xbee.

Definition at line 100 of file zbee.cpp.

int SendData ( char *  data_buf )

Sets the encryption key to the one stored in security_key.

Parameters:
PanIdPointer to the network key to set.
Returns:
Returns 1 on success.

Definition at line 55 of file zbee.cpp.

int SetPanId ( int  pan_id )

Sets the encryption key to the one stored in security_key.

Parameters:
keyPointer to the network key to set.
Returns:
Returns 1 on success.

Definition at line 83 of file zbee.cpp.