XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.

Dependencies:   BufferedArray

Dependents:   MBEDminiproject

Core/ISerial.h

Committer:
yangcq88517
Date:
2015-11-14
Revision:
6:5f31ddc17239
Parent:
1:3dc0ec2f9fd6

File content as of revision 6:5f31ddc17239:

#ifndef UK_AC_HERTS_SMARTLAB_XBEE_ISerial
#define UK_AC_HERTS_SMARTLAB_XBEE_ISerial

/// Serial data interface.
class ISerial
{
public:
    /** Read one byte data from the serila port.
    * @returns if success return non zero [0x00-0xFF], -1 means something is wrong
    */
    virtual int readByte() = 0;

    /** write one byte data to the serila port.
    * @param data [0x00-0xFF]
    */
    virtual void writeByte(char data) = 0;

    /// Check if the serial port is already open.
    virtual bool isOpen() = 0;

    /// Open the serila port.
    virtual void open() = 0;

    /// Close the serila port.
    virtual void close() = 0;
    
    /// Check if data is avaliable to read. 
    virtual bool peek() = 0;
};

#endif