IoT::XBee

class XBeePort

File Information

Library: IoT/XBee
Package: XBee
Header: IoT/XBee/XBeePort.h

Description

This class provides an interface to a Digi XBee module using the Digi XBee API frame-based protocol.

Member Summary

Member Functions: poll, receiveFrame, sendFrame

Constructors

XBeePort

XBeePort(
    Poco::SharedPtr < Poco::Serial::SerialPort > pSerialPort
);

Creates a XBeePort using the given SerialPort.

The SerialPort must be open and properly configured for communication with the Digi XBee module.

Destructor

~XBeePort

~XBeePort();

Destroys the ZBPort.

Member Functions

poll inline

bool poll(
    const Poco::Timespan & timeout
);

Waits for data to arrive at the port.

Returns true immediately if data is already in the internal buffer, or if data arrives during the specified time interval, otherwise false.

receiveFrame

std::size_t receiveFrame(
    XBeeFrame & frame
);

Receives an API frame from the XBee ZB module.

Blocks until data becomes available.

receiveFrame

std::size_t receiveFrame(
    XBeeFrame & frame,
    const Poco::Timespan & timeout
);

Receives an API frame from the XBee ZB module.

Returns the number of bytes received, which may be 0 if the receive operation times out.

sendFrame

void sendFrame(
    const XBeeFrame & frame
);

Sends an API frame to the XBee ZB module.

Securely control IoT edge devices from anywhere   Connect a Device