Wiselib
Public Member Functions | Public Attributes
concepts::Serial_communication_concept Class Reference

Basic Concept for Serial Communication. More...

List of all members.

Public Member Functions

int enable_serial_comm ()
 Turn on serial communication.
int disable_serial_comm ()
 Turn off serial communication.
int write (size_t len, block_data_t *buf)
 Write len bytes of data to serial port.
template<class T , void(T::*)(size_t, block_data_t *) TMethod>
int reg_read_callback (T *obj_pnt)
 Register callback function.
int unreg_read_callback (int idx)
 Unregister callback function - use unique identifier returned by registration.

Public Attributes

typedef OsModel
 Type of Os Concept which has been set for the serial communication facet.
typedef block_data_t
 Data type used for raw data in message sending process.
typedef size_t
 Unsigned integer that represents length information.

Detailed Description

Basic Concept for Serial Communication.


Member Function Documentation

int concepts::Serial_communication_concept::disable_serial_comm ( )

Turn off serial communication.

Data can not be sent and received.

int concepts::Serial_communication_concept::enable_serial_comm ( )

Turn on serial communication.

Data can be sent and received..

template<class T , void(T::*)(size_t, block_data_t *) TMethod>
int concepts::Serial_communication_concept::reg_read_callback ( T *  obj_pnt)

Register callback function.

Whenever data is received, the callback function is called. Data can be anything (bytes, lines, packets), but must be described in detail in the appropriate model. Return unique identifier for this registration.

int concepts::Serial_communication_concept::unreg_read_callback ( int  idx)

Unregister callback function - use unique identifier returned by registration.

int concepts::Serial_communication_concept::write ( size_t  len,
block_data_t buf 
)

Write len bytes of data to serial port.


Member Data Documentation

Data type used for raw data in message sending process.

Usually an uint8_t.

Type of Os Concept which has been set for the serial communication facet.

Unsigned integer that represents length information.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines