OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
hardware_io.automotive.tcp_stream_transport.TcpStreamTransport Class Reference

Expose a TCP connection through the automotive stream contract. More...

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

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

Expose a TCP connection through the automotive stream contract.

Member Function Documentation

◆ is_connected()

bool hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.is_connected (   self)

Return whether the transport is connected.

Returns
True when the transport is connected; otherwise False.

Reimplemented from hardware_io.automotive.stream_transport_if.StreamTransportIf.

◆ read()

bytes hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.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 from hardware_io.automotive.stream_transport_if.StreamTransportIf.

◆ write()

int hardware_io.automotive.tcp_stream_transport.TcpStreamTransport.write (   self,
bytes  data 
)

Write bytes to the transport.

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

Reimplemented from hardware_io.automotive.stream_transport_if.StreamTransportIf.


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