46 return ((len + 3) & ~3);
int16_t BInt16
Definition: BTypes.h:21
uint16_t BUInt16
Definition: BTypes.h:22
BUInt32 BUInt
Definition: BTypes.h:33
uint32_t BUInt32
Definition: BTypes.h:24
bool Bool
Definition: BTypes.h:18
BUInt16 addressTo
Address to send to.
Definition: BoapMc1.h:2
BUInt16 cmd
The RPC command or reply number.
Definition: BoapMc1.h:4
BUInt32 boapMc1CommsRoundupLen(BUInt32 len)
Definition: BoapMc1.h:45
class BoapMc1Comms __attribute__
BUInt16 addressFrom
Address packet is from.
Definition: BoapMc1.h:3
const BUInt16 BoapMc1Magic
Definition: BoapMc1.h:19
BoapMc1Type
Definition: BoapMc1.h:20
@ BoapMc1TypeReply
Definition: BoapMc1.h:20
@ BoapMc1TypeRequest
Definition: BoapMc1.h:20
char data[8]
Definition: BoapMc1.h:2
A base class for communications classes having a generic API.
Definition: BComms.h:17
A chunk of data allowing writes of multiple chunks of segmented data.
Definition: BTypes.h:94
Error return class. This class is used to return the error status from a function....
Definition: BError.h:31
Mutex class. Note these are recursive Mutexes and so you need to make sure the number of unlocks equa...
Definition: BMutex.h:14
Base Semaphore class.
Definition: BSemaphore.h:16
BMutex olockCall
Lock for RPC calls. Only one at a time.
Definition: BoapMc1.h:88
virtual BError processRequests()
Check and process any requests.
Definition: BoapMc1.cpp:273
BUInt32 getApiVersion()
Returns the API version.
Definition: BoapMc1.cpp:82
BSemaphore opacketRpcSema
Wait RPC reply semaphore.
Definition: BoapMc1.h:102
BSemaphore opacketRpcDoneSema
Wait RPC complete semaphore.
Definition: BoapMc1.h:103
virtual BError validate()
Validate the request.
Definition: BoapMc1.cpp:94
void setAddress(BUInt16 addressTo, BUInt16 addressFrom)
Sets the to and from addresses.
Definition: BoapMc1.cpp:77
BUInt32 oreqSize
The maximum request size.
Definition: BoapMc1.h:87
BError packetTx(BDataChunk *chunks, BUInt nChunks, BUInt16 waitCmdReply)
Definition: BoapMc1.cpp:102
BoapMc1Packet * packetRx()
Returns a reference to the current RX packet.
Definition: BoapMc1.cpp:98
BoapMc1Packet * opacketTx
The TX packet.
Definition: BoapMc1.h:100
virtual BError processRequest()
Check and process any request.
Definition: BoapMc1.cpp:261
void setCommsMode(Bool halfDuplex)
Sets half duplex mode.
Definition: BoapMc1.cpp:65
BComms * ocomms
Definition: BoapMc1.h:90
virtual ~BoapMc1Comms()
Definition: BoapMc1.cpp:62
BMutex olockTx
Lock for TX.
Definition: BoapMc1.h:89
virtual BError processRx()
Process any RX packets queuing them as needed.
Definition: BoapMc1.cpp:180
BoapMc1Packet opacketRxBase
Definition: BoapMc1.h:97
BUInt32 setTimeout(BUInt32 timeoutUs)
Sets the call timeout returning the current value.
Definition: BoapMc1.cpp:86
Bool othreaded
Threaded operation.
Definition: BoapMc1.h:86
BUInt16 oaddressFrom
Definition: BoapMc1.h:95
BoapMc1Packet * opacketRx
The RX packet.
Definition: BoapMc1.h:98
BError packetRxEnd()
Definition: BoapMc1.cpp:171
BUInt32 oapiVersion
Definition: BoapMc1.h:91
Bool ohalfDuplex
Half duplex mode.
Definition: BoapMc1.h:92
BUInt opacketRpcCmd
Waiting for RPC reply to cmd.
Definition: BoapMc1.h:101
void setComms(BComms &comms)
Sets the communications interface to use.
Definition: BoapMc1.cpp:69
BUInt16 oaddressTo
Definition: BoapMc1.h:94
BoapMc1Packet opacketTxBase
Definition: BoapMc1.h:99
BError packetRxData(void *data, BUInt nBytes)
Definition: BoapMc1.cpp:149
BUInt32 otimeout
The timeout in us for calls.
Definition: BoapMc1.h:93
BoapMc1Error oerror
The call return error;.
Definition: BoapMc1.h:104
char data[8]
Definition: BoapMc1.h:37
BoapMc1PacketHead head
Definition: BoapMc1.h:36
BInt16 number
The error number.
Definition: BoapMc1.h:41
BInt16 error
Error number.
Definition: BoapMc1.h:29
BUInt16 addressFrom
Address packet is from.
Definition: BoapMc1.h:27
BUInt16 magic
Packet magic pattern.
Definition: BoapMc1.h:24
BUInt16 addressTo
Address to send to.
Definition: BoapMc1.h:26
BUInt16 cmd
The RPC command or reply number.
Definition: BoapMc1.h:28
BUInt32 checksum
Packet checksum, when used.
Definition: BoapMc1.h:30
BUInt16 length
Total packet length including the header.
Definition: BoapMc1.h:25