nl::Weave::Profiles::BDX_Development::BdxProtocol

Summary

Functions

HandleConnectionClosed(ExchangeContext *anEc, WeaveConnection *aCon, WEAVE_ERROR aConErr)
void
Handler for when the connection itself is closed.
HandleKeyError(ExchangeContext *anEc, WEAVE_ERROR aKeyErr)
void
Handler for when the key used to encrypt and authenticate Weave messages is no longer usable.
HandleResponse(ExchangeContext *anEc, const IPPacketInfo *aPktInfo, const WeaveMessageInfo *aWeaveMsgInfo, uint32_t aProfileId, uint8_t aMessageType, PacketBuffer *aPacketBuffer)
void
The main handler for messages arriving on the BDX exchange.
HandleResponseNotAccepted(BDXTransfer & aXfer, uint32_t aProfileId, uint8_t aMessageType, PacketBuffer *aPacketBuffer)
HandleResponseReceive(BDXTransfer & aXfer, uint32_t aProfileId, uint8_t aMessageType, PacketBuffer *aPacketBuffer)
HandleResponseTimeout(ExchangeContext *anEc)
void
Handler for when we timeout waiting for a response.
HandleResponseTransmit(BDXTransfer & aXfer, uint32_t aProfileId, uint8_t aMessageType, PacketBuffer *aPacketBuffer)
HandleSendError(ExchangeContext *anEc, WEAVE_ERROR aSendErr, void *aMsgCtxt)
void
Handler for when the WRMP message we sent was not acknowledged.
InitBdxReceive(BDXTransfer & aXfer, bool aICanDrive, bool aUCanDrive, bool aAsyncOk, ReferencedTLVData *aMetaData)
InitBdxSend(BDXTransfer & aXfer, bool aICanDrive, bool aUCanDrive, bool aAsyncOk, ReferencedTLVData *aMetaData)
InitBdxSend(BDXTransfer & aXfer, bool aICanDrive, bool aUCanDrive, bool aAsyncOk, SendInit::MetaDataTLVWriteCallback aMetaDataWriteCallback, void *aMetaDataAppState)
SendBadBlockCounterStatusReport(BDXTransfer & aXfer)
SendBlockAckV1(BDXTransfer & aXfer)
This function sends a BlockAckV1 message for the given BDXTransfer.
SendBlockEOFAckV1(BDXTransfer & aXfer)
This function sends a BlockEOFAckV1 message for the given BDXTransfer.
SendBlockQuery(BDXTransfer & aXfer)
SendBlockQueryV1(BDXTransfer & aXfer)
This function sends a BlockQueryV1 message for the given BDXTransfer.
SendNextBlock(BDXTransfer & aXfer)
SendNextBlockV1(BDXTransfer & aXfer)
This function sends the next BlockSendV1 retrieved by calling the BDXTransfer's GetBlockHandler.
SendStatusReport(ExchangeContext *anEc, uint32_t aProfileId, uint16_t aStatusCode)
void
Sends a status report message with the associated profile id, status code, and exchange context.
SendTransferError(ExchangeContext *anEc, uint32_t aProfileId, uint16_t aStatusCode)
void

Functions

HandleConnectionClosed

void HandleConnectionClosed(
  ExchangeContext *anEc,
  WeaveConnection *aCon,
  WEAVE_ERROR aConErr
)

Handler for when the connection itself is closed.

Calls the associated transfer's error handler and shuts down the transfer.

Details
Parameters
[in] anEc
Exchange context that detected a closed connection We can find the associated BDXTransfer from this
[in] aCon
The Weave connection, unused in the actual function
[in] aConErr
Error associated with the connection closing

HandleKeyError

void HandleKeyError(
  ExchangeContext *anEc,
  WEAVE_ERROR aKeyErr
)

Handler for when the key used to encrypt and authenticate Weave messages is no longer usable.

Details
Parameters
[in] anEc
Exchange context that detected a key error We can find the associated BDXTransfer from this
[in] aKeyErr
Error associated with the key no longer being usable

HandleResponse

void HandleResponse(
  ExchangeContext *anEc,
  const IPPacketInfo *aPktInfo,
  const WeaveMessageInfo *aWeaveMsgInfo,
  uint32_t aProfileId,
  uint8_t aMessageType,
  PacketBuffer *aPacketBuffer
)

The main handler for messages arriving on the BDX exchange.

It essentially acts as a router to extract the appropriate BDX header info and data, dispatching the appropriate handler to act on this object.

Details
Parameters
[in] anEc
The exchange context in case we need it
[in] aPktInfo
Unused, but need to match the function prototype
[in] aWeaveMsgInfo
Weave Message Information for the message
[in] aProfileId
ID of the profile under which the message is defined
[in] aMessageType
The message type of that profile
[in] aPacketBuffer
The packed message itself

HandleResponseNotAccepted

WEAVE_ERROR HandleResponseNotAccepted(
  BDXTransfer & aXfer,
  uint32_t aProfileId,
  uint8_t aMessageType,
  PacketBuffer *aPacketBuffer
)

HandleResponseReceive

WEAVE_ERROR HandleResponseReceive(
  BDXTransfer & aXfer,
  uint32_t aProfileId,
  uint8_t aMessageType,
  PacketBuffer *aPacketBuffer
)

HandleResponseTimeout

void HandleResponseTimeout(
  ExchangeContext *anEc
)

Handler for when we timeout waiting for a response.

Shuts down the transfer that timed out, and calls that transfer's error handler.

Details
Parameters
[in] anEc
Exchange context which we can find the BDXTransfer from

HandleResponseTransmit

WEAVE_ERROR HandleResponseTransmit(
  BDXTransfer & aXfer,
  uint32_t aProfileId,
  uint8_t aMessageType,
  PacketBuffer *aPacketBuffer
)

HandleSendError

void HandleSendError(
  ExchangeContext *anEc,
  WEAVE_ERROR aSendErr,
  void *aMsgCtxt
)

Handler for when the WRMP message we sent was not acknowledged.

Details
Parameters
[in] anEc
Exchange context that had an unacknowleged message We can find the associated BDXTransfer from this
[in] aSendErr
Error associated with the message send failure
[in] aMsgCtxt
An arbitrary message context that was associated with the unacknowledged message.

InitBdxReceive

WEAVE_ERROR InitBdxReceive(
  BDXTransfer & aXfer,
  bool aICanDrive,
  bool aUCanDrive,
  bool aAsyncOk,
  ReferencedTLVData *aMetaData
)

InitBdxSend

WEAVE_ERROR InitBdxSend(
  BDXTransfer & aXfer,
  bool aICanDrive,
  bool aUCanDrive,
  bool aAsyncOk,
  ReferencedTLVData *aMetaData
)

InitBdxSend

WEAVE_ERROR InitBdxSend(
  BDXTransfer & aXfer,
  bool aICanDrive,
  bool aUCanDrive,
  bool aAsyncOk,
  SendInit::MetaDataTLVWriteCallback aMetaDataWriteCallback,
  void *aMetaDataAppState
)

SendBadBlockCounterStatusReport

WEAVE_ERROR SendBadBlockCounterStatusReport(
  BDXTransfer & aXfer
)

SendBlockAckV1

WEAVE_ERROR SendBlockAckV1(
  BDXTransfer & aXfer
)

This function sends a BlockAckV1 message for the given BDXTransfer.

The acknowledged block number is equal to aXfer.mBlockCounter - 1 as this function may only be called after the transfer state advanced to the next counter.

Details
Parameters
[in] aXfer
The BDXTransfer we're sending a BlockAck for.
Return Values
WEAVE_NO_ERROR
If we successfully sent the message.
WEAVE_ERROR_NO_MEMORY
If no available PacketBuffers.

SendBlockEOFAckV1

WEAVE_ERROR SendBlockEOFAckV1(
  BDXTransfer & aXfer
)

This function sends a BlockEOFAckV1 message for the given BDXTransfer.

The acknowledged block number is equal to aXfer.mBlockCounter.

Details
Parameters
[in] aXfer
The BDXTransfer we're sending a BlockEOFAck for.
Return Values
WEAVE_NO_ERROR
If we successfully sent the message.
WEAVE_ERROR_NO_MEMORY
If no available PacketBuffers.

SendBlockQuery

WEAVE_ERROR SendBlockQuery(
  BDXTransfer & aXfer
)

SendBlockQueryV1

WEAVE_ERROR SendBlockQueryV1(
  BDXTransfer & aXfer
)

This function sends a BlockQueryV1 message for the given BDXTransfer.

The requested block number is equal to aXfer.mBlockCounter.

Details
Parameters
[in] aXfer
The BDXTransfer we're sending a BlockQuery for.
Return Values
WEAVE_NO_ERROR
If we successfully sent the message.
WEAVE_ERROR_NO_MEMORY
If no available PacketBuffers.

SendNextBlock

WEAVE_ERROR SendNextBlock(
  BDXTransfer & aXfer
)

SendNextBlockV1

WEAVE_ERROR SendNextBlockV1(
  BDXTransfer & aXfer
)

This function sends the next BlockSendV1 retrieved by calling the BDXTransfer's GetBlockHandler.

Details
Parameters
[in] aXfer
The BDXTransfer whose GetBlockHandler is called to get the next block before sending it using the associated ExchangeContext
Return Values
WEAVE_ERROR_INCORRECT_STATE
If the GetBlockHandler is NULL

SendStatusReport

void SendStatusReport(
  ExchangeContext *anEc,
  uint32_t aProfileId,
  uint16_t aStatusCode
)

Sends a status report message with the associated profile id, status code, and exchange context.

Details
Parameters
[in] anEc
The exchange context where we should be sending the status report message
[in] aProfileId
Profile ID
[in] aStatusCode
Code associated with the transfer error

SendTransferError

void SendTransferError(
  ExchangeContext *anEc,
  uint32_t aProfileId,
  uint16_t aStatusCode
)