Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::DatagramClient Class Referenceabstract

Use this class to send datagrams. More...

#include <Datagram.hxx>

Inheritance diagram for openlcb::DatagramClient:
QMember openlcb::DatagramClientImpl

Public Types

enum  ResultCodes {
  PERMANENT_ERROR = 0x1000 , RESEND_OK = 0x2000 , TRANSPORT_ERROR = 0x4000 , BUFFER_UNAVAILABLE = 0x0020 ,
  OUT_OF_ORDER = 0x0040 , SOURCE_NOT_PERMITTED = 0x0020 , DATAGRAMS_NOT_ACCEPTED = 0x0040 , OPERATION_SUCCESS = 0x10000 ,
  OPERATION_PENDING = 0x20000 , DST_NOT_FOUND = Defs::ERROR_DST_NOT_FOUND , TIMEOUT = Defs::OPENMRN_TIMEOUT , DST_REBOOT = Defs::ERROR_DST_REBOOT ,
  RESPONSE_FLAGS_SHIFT = 24 , RESPONSE_CODE_MASK = (1<<RESPONSE_FLAGS_SHIFT) - 1 , OK_REPLY_PENDING = (1 << 31)
}
 Known result codes from the DatagramClient. More...
 
enum  ResponseFlag { REPLY_PENDING = 0x80 , REPLY_TIMEOUT_SEC = 0x1 , REPLY_TIMEOUT_MASK = 0xf }
 

Public Member Functions

virtual void write_datagram (Buffer< GenMessage > *b, unsigned priority=UINT_MAX)=0
 Triggers sending a datagram.
 
virtual void cancel ()=0
 Requests cancelling the datagram send operation.
 
uint32_t result ()
 Returns a bitmask of ResultCodes for the transmission operation.
 
- Public Member Functions inherited from QMember
void init ()
 Initiailize a QMember, in place of a public placement construction.
 

Protected Attributes

uint32_t result_
 
- Protected Attributes inherited from QMember
QMembernext
 pointer to the next member in the queue
 

Additional Inherited Members

- Protected Member Functions inherited from QMember
 QMember ()
 Constructor.
 
 ~QMember ()
 Destructor.
 

Detailed Description

Use this class to send datagrams.

Definition at line 78 of file Datagram.hxx.

Member Enumeration Documentation

◆ ResponseFlag

enum openlcb::DatagramClient::ResponseFlag

Definition at line 140 of file Datagram.hxx.

◆ ResultCodes

Known result codes from the DatagramClient.

Some of these are duplicates from the general result codes; others (the ones above 16 bit) are specific to the DatagramClient.

Definition at line 113 of file Datagram.hxx.

Constructor & Destructor Documentation

◆ ~DatagramClient()

virtual openlcb::DatagramClient::~DatagramClient ( )
inlinevirtual

Definition at line 81 of file Datagram.hxx.

Member Function Documentation

◆ cancel()

virtual void openlcb::DatagramClient::cancel ( )
pure virtual

Requests cancelling the datagram send operation.

Will notify the done callback when the canceling is completed.

Implemented in openlcb::DatagramClientImpl.

◆ result()

uint32_t openlcb::DatagramClient::result ( )
inline

Returns a bitmask of ResultCodes for the transmission operation.

Definition at line 105 of file Datagram.hxx.

◆ write_datagram()

virtual void openlcb::DatagramClient::write_datagram ( Buffer< GenMessage > *  b,
unsigned  priority = UINT_MAX 
)
pure virtual

Triggers sending a datagram.

Parameters
bis the datagra buffer.
priorityis the priority of the datagram client in the executor.

Callers should set the done closure of the Buffer. After that closure is notified, the caller must ensure that the datagram client is released back to the freelist.

@TODO(balazs.racz): revisit the type of DatagramPayload and ensure that there will be no extra copy of the data happening.

Implemented in openlcb::DatagramClientImpl.

Member Data Documentation

◆ result_

uint32_t openlcb::DatagramClient::result_
protected

Definition at line 148 of file Datagram.hxx.


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