OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
hardware_io.automotive.stream_transport_if.StreamTransportIf Class Reference

Provide a connected bidirectional byte stream. More...

Inheritance diagram for hardware_io.automotive.stream_transport_if.StreamTransportIf:
hardware_io.automotive.serial_stream_transport.SerialStreamTransport hardware_io.automotive.tcp_stream_transport.TcpStreamTransport

Public Member Functions

bool is_connected (self)
 Return whether the transport is connected.
 
None connect (self)
 Connect the transport.
 
None close (self)
 Close the transport.
 
None reset_input_buffer (self)
 Discard unread input bytes already waiting on the transport.
 
int write (self, bytes data)
 Write bytes to the transport.
 
None flush (self)
 Flush pending output when the transport requires it.
 
bytes read (self, int size)
 Read bytes from the transport.
 

Detailed Description

Provide a connected bidirectional byte stream.

Member Function Documentation

◆ is_connected()

bool hardware_io.automotive.stream_transport_if.StreamTransportIf.is_connected (   self)

Return whether the transport is connected.

Returns
True when the transport is connected; otherwise False.

Reimplemented in hardware_io.automotive.serial_stream_transport.SerialStreamTransport, and hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.

◆ read()

bytes hardware_io.automotive.stream_transport_if.StreamTransportIf.read (   self,
int  size 
)

Read bytes from the transport.

Parameters
sizeMaximum number of bytes to read.
Returns
Up to size bytes, or empty bytes on timeout.

Reimplemented in hardware_io.automotive.serial_stream_transport.SerialStreamTransport, and hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.

◆ write()

int hardware_io.automotive.stream_transport_if.StreamTransportIf.write (   self,
bytes  data 
)

Write bytes to the transport.

Parameters
dataBytes to write.
Returns
Number of bytes accepted by the transport.

Reimplemented in hardware_io.automotive.serial_stream_transport.SerialStreamTransport, and hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.


The documentation for this class was generated from the following file: