Eclipse.org Eclipse.org - Device Kit

Transports

In the Device Kit environment, the transport handles the sending and receiving of messages. When the devices requests that the transport send a message, the transport translates the message into a set of bytes into a format the hardware device can understand. Before the transport writes messages to the connection, the transport completes any modifications that cannot be computed by the device, such as a message checksum.

The transport monitors the connection input byte stream coming from the hardware device and translates the bytes into received messages. After the transport parses the bytes into messages, the transport notifies registered listeners of the messages received. It is important to remember that the transport understands the format of a message but does not understand the meaning of the message.

Since all connections support a common connection service interface, a transport can switch between one connection and another. For example, the some RFID readers support either a serial port (RS232) or TCP/IP connection.

Similarly, devices aren't attached to specific transports. For example, a diagnostics device can run on transports from different vendors, as long as each transport is written for diagnostic tools.

Note:
If the hardware interface is already message-based, such as UDP (User Datagram Protocol), transports might not use connections to send and receive messages. To determine whether or not you need to use connections, decide whether you parse messages through a stream or append multiple packets to understand the hardware. If your device meets either of these requirements, you need to use a connection.