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-19
Revision:
39:6e94520a3217
Parent:
10:2bd727a4b329
Child:
40:14342c4de476

File content as of revision 39:6e94520a3217:

#ifndef MTSSERIAL_H
#define MTSSERIAL_H

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

namespace mts {

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 */