lib60870-C  2.3.2
C source code library for the IEC 60870-5-101/104 protocols
Typedefs | Enumerations | Functions
hal_serial.h File Reference

Abstraction layer for serial ports. Has to be implemented for the serial link layer of CS 101. More...

#include "hal_base.h"
Include dependency graph for hal_serial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct sSerialPort * SerialPort
 

Enumerations

enum  SerialPortError {
  SERIAL_PORT_ERROR_NONE = 0 , SERIAL_PORT_ERROR_INVALID_ARGUMENT = 1 , SERIAL_PORT_ERROR_INVALID_BAUDRATE = 2 , SERIAL_PORT_ERROR_OPEN_FAILED = 3 ,
  SERIAL_PORT_ERROR_UNKNOWN = 99
}
 

Functions

PAL_API SerialPort SerialPort_create (const char *interfaceName, int baudRate, uint8_t dataBits, char parity, uint8_t stopBits)
 Create a new SerialPort instance. More...
 
PAL_API void SerialPort_destroy (SerialPort self)
 Destroy the SerialPort instance and release all resources.
 
PAL_API bool SerialPort_open (SerialPort self)
 Open the serial interface. More...
 
PAL_API void SerialPort_close (SerialPort self)
 Close (release) the serial interface.
 
PAL_API int SerialPort_getBaudRate (SerialPort self)
 Get the baudrate used by the serial interface. More...
 
PAL_API void SerialPort_setTimeout (SerialPort self, int timeout)
 Set the timeout used for message reception. More...
 
PAL_API void SerialPort_discardInBuffer (SerialPort self)
 Discard all data in the input buffer of the serial interface.
 
PAL_API int SerialPort_readByte (SerialPort self)
 Read a byte from the interface. More...
 
PAL_API int SerialPort_write (SerialPort self, uint8_t *buffer, int startPos, int numberOfBytes)
 Write the number of bytes from the buffer to the serial interface. More...
 
PAL_API SerialPortError SerialPort_getLastError (SerialPort self)
 Get the error code of the last operation.
 

Detailed Description

Abstraction layer for serial ports. Has to be implemented for the serial link layer of CS 101.