XBee-mbed library http://mbed.org/users/okini3939/notebook/xbee-mbed/

Dependents:   device_server_udp led_sender_post XBee_API_ex1 XBee_API_ex2 ... more

Embed: (wiki syntax)

« Back to documentation index

XBeeWiFi Class Reference

Primary interface for communicating with an XBee Wi-Fi. More...

#include <XBeeWiFi.h>

Inherits XBee.

Public Member Functions

void readPacket ()
 Reads all available serial bytes until a packet is parsed, an error occurs, or the buffer is empty.
bool readPacket (int timeout)
 Waits a maximum of timeout milliseconds for a response packet before timing out; returns true if packet is read.
void readPacketUntilAvailable ()
 Reads until a packet is received or an error occurs.
void begin (long baud)
 Starts the serial connection at the supplied baud rate.
XBeeResponsegetResponse ()
 Returns a reference to the current response Note: once readPacket is called again this response will be overwritten!
void send (XBeeRequest &request)
 Sends a XBeeRequest (TX packet) out the serial port.
uint8_t getNextFrameId ()
 Returns a sequential frame id between 1 and 255.

Protected Member Functions

int getWiAddr (IpAddr &ipaddr)
 Call with instance of AtCommandResponse only if getApiId() == AT_COMMAND_RESPONSE.

Detailed Description

Primary interface for communicating with an XBee Wi-Fi.

Definition at line 106 of file XBeeWiFi.h.


Member Function Documentation

void begin ( long  baud ) [inherited]

Starts the serial connection at the supplied baud rate.

Definition at line 740 of file XBee.cpp.

uint8_t getNextFrameId (  ) [inherited]

Returns a sequential frame id between 1 and 255.

Definition at line 728 of file XBee.cpp.

XBeeResponse & getResponse (  ) [inherited]

Returns a reference to the current response Note: once readPacket is called again this response will be overwritten!

Definition at line 750 of file XBee.cpp.

int getWiAddr ( IpAddr &  ipaddr ) [protected]

Call with instance of AtCommandResponse only if getApiId() == AT_COMMAND_RESPONSE.

Definition at line 235 of file XBeeWiFi.cpp.

bool readPacket ( int  timeout ) [inherited]

Waits a maximum of timeout milliseconds for a response packet before timing out; returns true if packet is read.

Returns false if timeout or error occurs.

Definition at line 772 of file XBee.cpp.

void readPacket (  ) [inherited]

Reads all available serial bytes until a packet is parsed, an error occurs, or the buffer is empty.

You may call xbee.getResponse().isAvailable() after calling this method to determine if a packet is ready, or xbee.getResponse().isError() to determine if a error occurred.

This method should always return quickly since it does not wait for serial data to arrive. You will want to use this method if you are doing other timely stuff in your loop, where a delay would cause problems. NOTE: calling this method resets the current response, so make sure you first consume the current response

Definition at line 822 of file XBee.cpp.

void readPacketUntilAvailable (  ) [inherited]

Reads until a packet is received or an error occurs.

Caution: use this carefully since if you don't get a response, your Arduino code will hang on this call forever!! often it's better to use a timeout: readPacket(int)

Definition at line 765 of file XBee.cpp.

void send ( XBeeRequest request ) [inherited]

Sends a XBeeRequest (TX packet) out the serial port.

Definition at line 1401 of file XBee.cpp.