58 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:57
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
BoapMc1 API version.
Definition BoapMc1.h:23
BoapMc1ApiVer(BUInt32 version=0)
Definition BoapMc1.cpp:44
BUInt16 maj
The major version component.
Definition BoapMc1.h:31
BUInt16 mid
The mid version component.
Definition BoapMc1.h:30
BMutex olockCall
Lock for RPC calls. Only one at a time.
Definition BoapMc1.h:100
virtual BError processRequests()
Check and process any requests.
Definition BoapMc1.cpp:288
BSemaphore opacketRpcSema
Wait RPC reply semaphore.
Definition BoapMc1.h:114
BSemaphore opacketRpcDoneSema
Wait RPC complete semaphore.
Definition BoapMc1.h:115
virtual BError validate()
Validate the request.
Definition BoapMc1.cpp:109
void setAddress(BUInt16 addressTo, BUInt16 addressFrom)
Sets the to and from addresses.
Definition BoapMc1.cpp:92
BoapMc1ApiVer oapiVersion
The API version major.
Definition BoapMc1.h:103
BUInt32 oreqSize
The maximum request size.
Definition BoapMc1.h:99
BError packetTx(BDataChunk *chunks, BUInt nChunks, BUInt16 waitCmdReply)
Definition BoapMc1.cpp:117
BoapMc1Packet * packetRx()
Returns a reference to the current RX packet.
Definition BoapMc1.cpp:113
BoapMc1Packet * opacketTx
The TX packet.
Definition BoapMc1.h:112
virtual BError processRequest()
Check and process any request.
Definition BoapMc1.cpp:276
void setCommsMode(Bool halfDuplex)
Sets half duplex mode.
Definition BoapMc1.cpp:80
BComms * ocomms
Definition BoapMc1.h:102
virtual ~BoapMc1Comms()
Definition BoapMc1.cpp:77
BMutex olockTx
Lock for TX.
Definition BoapMc1.h:101
virtual BError processRx()
Process any RX packets queuing them as needed.
Definition BoapMc1.cpp:195
BoapMc1Packet opacketRxBase
Definition BoapMc1.h:109
BUInt32 setTimeout(BUInt32 timeoutUs)
Sets the call timeout returning the current value.
Definition BoapMc1.cpp:101
Bool othreaded
Threaded operation.
Definition BoapMc1.h:98
BUInt16 oaddressFrom
Definition BoapMc1.h:107
BoapMc1ApiVer getApiVersion()
Returns the API version.
Definition BoapMc1.cpp:97
BoapMc1Packet * opacketRx
The RX packet.
Definition BoapMc1.h:110
BError packetRxEnd()
Definition BoapMc1.cpp:186
Bool ohalfDuplex
Half duplex mode.
Definition BoapMc1.h:104
BUInt opacketRpcCmd
Waiting for RPC reply to cmd.
Definition BoapMc1.h:113
void setComms(BComms &comms)
Sets the communications interface to use.
Definition BoapMc1.cpp:84
BUInt16 oaddressTo
Definition BoapMc1.h:106
BoapMc1Packet opacketTxBase
Definition BoapMc1.h:111
BError packetRxData(void *data, BUInt nBytes)
Definition BoapMc1.cpp:164
BoapMc1Comms(Bool threaded=0, BUInt reqSize=512)
Definition BoapMc1.cpp:63
BUInt32 otimeout
The timeout in us for calls.
Definition BoapMc1.h:105
BoapMc1Error oerror
The call return error;.
Definition BoapMc1.h:116
char data[8]
Definition BoapMc1.h:49
BoapMc1PacketHead head
Definition BoapMc1.h:48
BInt16 number
The error number.
Definition BoapMc1.h:53
BInt16 error
Error number.
Definition BoapMc1.h:41
BUInt16 addressFrom
Address packet is from.
Definition BoapMc1.h:39
BUInt16 magic
Packet magic pattern.
Definition BoapMc1.h:36
BUInt16 addressTo
Address to send to.
Definition BoapMc1.h:38
BUInt16 cmd
The RPC command or reply number.
Definition BoapMc1.h:40
BUInt32 checksum
Packet checksum, when used.
Definition BoapMc1.h:42
BUInt16 length
Total packet length including the header.
Definition BoapMc1.h:37