|
Open Model Railroad Network (OpenMRN)
|
Use this class to send datagrams. More...
#include <Datagram.hxx>
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 | |
| QMember * | next |
| pointer to the next member in the queue | |
Additional Inherited Members | |
Protected Member Functions inherited from QMember | |
| QMember () | |
| Constructor. | |
| ~QMember () | |
| Destructor. | |
Use this class to send datagrams.
Definition at line 78 of file Datagram.hxx.
| enum openlcb::DatagramClient::ResponseFlag |
Definition at line 140 of file Datagram.hxx.
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.
|
inlinevirtual |
Definition at line 81 of file Datagram.hxx.
|
pure virtual |
Requests cancelling the datagram send operation.
Will notify the done callback when the canceling is completed.
Implemented in openlcb::DatagramClientImpl.
|
inline |
Returns a bitmask of ResultCodes for the transmission operation.
Definition at line 105 of file Datagram.hxx.
|
pure virtual |
Triggers sending a datagram.
| b | is the datagra buffer. |
| priority | is 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.
|
protected |
Definition at line 148 of file Datagram.hxx.