A library for talking to Multi-Tech's Cellular SocketModem Devices.

Dependents:   M2X_dev axeda_wrapper_dev MTS_M2x_Example1 MTS_Cellular_Connect_Example ... more

io/MTSSerial.h

Committer:
mfiore
Date:
2013-12-13
Revision:
10:2bd727a4b329
Parent:
0:563b70517320
Child:
36:bb6b293c7495
Child:
39:6e94520a3217

File content as of revision 10:2bd727a4b329:

#ifndef MTSSERIAL_H
#define MTSSERIAL_H

#include "mbed.h"
#include "MTSBufferedIO.h"

class MTSSerial : public MTSBufferedIO
{
public:
    MTSSerial(PinName TXD, PinName RXD, int txBufferSize = 64, int rxBufferSize = 64, char* name = "");
    ~MTSSerial();
    void baud(int baudrate);
//    void format(int bits=8, Parity parity=SerialBase::None, int stop_bits=1);

    virtual void handleRead(); // Overridden function to handle reading from the serial port
    virtual void handleWrite(); // Overridden function to handle writing to the serial port

private:
    Serial* serial; // Internal mbed Serial object
    int writeSize; // Amount of data to write based on buffer size
    char* if_name; // Name of the interface
};

#endif /* MTSSERIAL_H */