45 return ((len + 3) & ~3);
BUInt32 checksum
Packet checksum, when used.
Definition: BoapMc1.h:29
BUInt32 oapiVersion
Definition: BoapMc1.h:90
void setComms(BComms &comms)
Sets the communications interface to use.
Definition: BoapMc1.cpp:68
BInt16 number
The error number.
Definition: BoapMc1.h:40
BUInt16 cmd
The RPC command or reply number.
Definition: BoapMc1.h:27
BUInt16 addressFrom
Address packet is from.
Definition: BoapMc1.h:26
BUInt16 oaddressTo
Definition: BoapMc1.h:93
Semaphore class.
Definition: BSemaphore.h:15
BUInt32 otimeout
The timeout in us for calls.
Definition: BoapMc1.h:92
virtual ~BoapMc1Comms()
Definition: BoapMc1.cpp:61
BError packetRxEnd()
Definition: BoapMc1.cpp:164
virtual BError processRequest()
Check and process any request.
Definition: BoapMc1.cpp:254
BoapMc1Comms(Bool threaded=0, BUInt reqSize=512)
Definition: BoapMc1.cpp:47
BoapMc1Packet * opacketTx
The TX packet.
Definition: BoapMc1.h:99
BInt16 error
Error number.
Definition: BoapMc1.h:28
int16_t BInt16
Definition: BTypes.h:18
BMutex olockTx
Lock for TX.
Definition: BoapMc1.h:88
BUInt16 addressTo
Address to send to.
Definition: BoapMc1.h:21
bool Bool
Definition: BTypes.h:15
BoapMc1Type
Definition: BoapMc1.h:19
BSemaphore opacketRpcSema
Wait RPC reply semaphore.
Definition: BoapMc1.h:101
BUInt opacketRpcCmd
Waiting for RPC reply to cmd.
Definition: BoapMc1.h:100
BoapMc1Packet opacketRxBase
Definition: BoapMc1.h:96
BMutex olockCall
Lock for RPC calls. Only one at a time.
Definition: BoapMc1.h:87
Bool ohalfDuplex
Half duplex mode.
Definition: BoapMc1.h:91
BUInt32 oreqSize
The maximum request size.
Definition: BoapMc1.h:86
BoapMc1PacketHead head
Definition: BoapMc1.h:35
BoapMc1Error oerror
The call return error;.
Definition: BoapMc1.h:103
const BUInt16 BoapMc1Magic
Definition: BoapMc1.h:18
BUInt32 boapMc1CommsRoundupLen(BUInt32 len)
Definition: BoapMc1.h:44
Bool othreaded
Threaded operation.
Definition: BoapMc1.h:85
BoapMc1Packet * packetRx()
Returns a reference to the current RX packet.
Definition: BoapMc1.cpp:97
BUInt16 cmd
The RPC command or reply number.
Definition: BoapMc1.h:23
BSemaphore opacketRpcDoneSema
Wait RPC complete semaphore.
Definition: BoapMc1.h:102
BUInt32 BUInt
Definition: BTypes.h:30
void setCommsMode(Bool halfDuplex)
Sets half duplex mode.
Definition: BoapMc1.cpp:64
uint32_t BUInt32
Definition: BTypes.h:21
BUInt16 oaddressFrom
Definition: BoapMc1.h:94
BError packetTx(BDataChunk *chunks, BUInt nChunks, BUInt16 waitCmdReply)
Definition: BoapMc1.cpp:101
BUInt16 addressFrom
Address packet is from.
Definition: BoapMc1.h:22
char data[8]
Definition: BoapMc1.h:36
BError packetRxData(void *data, BUInt nBytes)
Definition: BoapMc1.cpp:142
BoapMc1Packet opacketTxBase
Definition: BoapMc1.h:98
BComms * ocomms
Definition: BoapMc1.h:89
char data[8]
Definition: BoapMc1.h:21
void setAddress(BUInt16 addressTo, BUInt16 addressFrom)
Sets the to and from addresses.
Definition: BoapMc1.cpp:76
uint16_t BUInt16
Definition: BTypes.h:19
BUInt32 setTimeout(BUInt32 timeoutUs)
Sets the call timeout returning the current value.
Definition: BoapMc1.cpp:85
BUInt16 magic
Packet magic pattern.
Definition: BoapMc1.h:23
BoapMc1Packet * opacketRx
The RX packet.
Definition: BoapMc1.h:97
virtual BError processRequests()
Check and process any requests.
Definition: BoapMc1.cpp:266
class BoapMc1Comms __attribute__
BUInt32 getApiVersion()
Returns the API version.
Definition: BoapMc1.cpp:81
BUInt16 length
Total packet length including the header.
Definition: BoapMc1.h:24
BUInt16 addressTo
Address to send to.
Definition: BoapMc1.h:25
virtual BError validate()
Validate the request.
Definition: BoapMc1.cpp:93
virtual BError processRx()
Process any RX packets queuing them as needed.
Definition: BoapMc1.cpp:173