MicroLabo / Mbed OS mbed-Dot-AT-Firmware

Dependencies:   MTS-Serial libmDot-mbed5

Fork of Dot-AT-Firmware by MultiTech

Embed: (wiki syntax)

« Back to documentation index

ATSerial Class Reference

ATSerial Class Reference

This class derives from MTSBufferedIO and provides a buffered wrapper to the standard mbed Serial class. More...

#include <ATSerial.h>

Inherited by ATSerialFlowControl.

Public Member Functions

 ATSerial (PinName TXD, PinName RXD, int txBufferSize=256, int rxBufferSize=256)
 Creates a new ATSerial object that can be used to talk to an mbed serial port through internal SW buffers.
virtual ~ATSerial ()
 Destructs an ATSerial object and frees all related resources, including internal buffers.
void reattach (PinName TXD, PinName RXD)
 Attach the internal serial object to provided pins.
void baud (int baudrate)
 This method is used to the set the baud rate of the serial port.
void format (int bits=8, SerialBase::Parity parity=mbed::SerialBase::None, int stop_bits=1)
 This method sets the transmission format used by the serial port.
void sendBreak ()
 Generate a break condition on the serial line.
bool escaped ()
 Check for escape sequence detected on serial input.

Detailed Description

This class derives from MTSBufferedIO and provides a buffered wrapper to the standard mbed Serial class.

Since it depends only on the mbed Serial class for accessing serial data, this class is inherently portable accross different mbed platforms.

Definition at line 15 of file ATSerial.h.


Constructor & Destructor Documentation

ATSerial ( PinName  TXD,
PinName  RXD,
int  txBufferSize = 256,
int  rxBufferSize = 256 
)

Creates a new ATSerial object that can be used to talk to an mbed serial port through internal SW buffers.

Parameters:
TXDthe transmit data pin on the desired mbed Serial interface.
RXDthe receive data pin on the desired mbed Serial interface.
txBufferSizethe size in bytes of the internal SW transmit buffer. The default is 256 bytes.
rxBufferSizethe size in bytes of the internal SW receive buffer. The default is 256 bytes.

Definition at line 7 of file ATSerial.cpp.

~ATSerial (  ) [virtual]

Destructs an ATSerial object and frees all related resources, including internal buffers.

Definition at line 23 of file ATSerial.cpp.


Member Function Documentation

void baud ( int  baudrate )

This method is used to the set the baud rate of the serial port.

Parameters:
baudratethe baudrate in bps as an int. The default is 9600 bps.

Definition at line 30 of file ATSerial.cpp.

bool escaped (  )

Check for escape sequence detected on serial input.

Returns:
true if escape sequence was seen

Definition at line 74 of file ATSerial.cpp.

void format ( int  bits = 8,
SerialBase::Parity  parity = mbed::SerialBase::None,
int  stop_bits = 1 
)

This method sets the transmission format used by the serial port.

Parameters:
bitsthe number of bits in a word (5-8; default = 8)
paritythe parity used (SerialBase::None, SerialBase::Odd, SerialBase::Even, SerialBase::Forced1, SerialBase::Forced0; default = SerialBase::None)
stopthe number of stop bits (1 or 2; default = 1)

Definition at line 36 of file ATSerial.cpp.

void reattach ( PinName  TXD,
PinName  RXD 
)

Attach the internal serial object to provided pins.

Parameters:
TXDthe transmit data pin on the desired mbed Serial interface.
RXDthe receive data pin on the desired mbed Serial interface.

Definition at line 60 of file ATSerial.cpp.

void sendBreak (  )

Generate a break condition on the serial line.

Definition at line 70 of file ATSerial.cpp.