nl::Weave::Profiles::BDX_Development::BlockSend

#include <src/lib/profiles/bulk-data-transfer/Development/BDXMessages.h>

The BlockSend message is used to transfer a block of data from sender to receiver.

Summary

Inheritance

Inherits from: nl::Weave::Profiles::RetainedPacketBuffer
Direct Known Subclasses: nl::Weave::Profiles::BDX_Development::BlockEOF

Constructors and Destructors

BlockSend(void)
The no-arg constructor with defaults for the block send message.

Public attributes

mBlockCounter
uint8_t
Counter of this block that is being sent.
mData
uint8_t *
Pointer to the data to be received or transferred.
mLength
uint64_t
Length of data contained in this block.

Public functions

init(uint8_t aCounter, uint64_t aLength, uint8_t *aData)
Initialize a BlockSend message.
operator==(const BlockSend &) const
bool
Equality comparison between BlockSend messages.
packedLength(void)
uint16_t
Returns the packed length of this block send message.

Public static functions

parse(PacketBuffer *aBuffer, BlockSend & aResponse)
Parse data from an PacketBuffer into a BlockSend message format.

Public attributes

mBlockCounter

uint8_t mBlockCounter

Counter of this block that is being sent.

mData

uint8_t * mData

Pointer to the data to be received or transferred.

mLength

uint64_t mLength

Length of data contained in this block.

Public functions

BlockSend

 BlockSend(
  void
)

The no-arg constructor with defaults for the block send message.

init

WEAVE_ERROR init(
  uint8_t aCounter,
  uint64_t aLength,
  uint8_t *aData
)

Initialize a BlockSend message.

Details
Parameters
[in] aCounter
Block counter value for this block
[in] aLength
Length of the block
[in] aData
Pointer to the data to be transferred
Returns
WEAVE_NO_ERROR if successful

operator==

bool operator==(
  const BlockSend &
) const 

Equality comparison between BlockSend messages.

Details
Parameters
[in] another
Another BlockSend message to compare this one to
Returns
true iff they have all the same fields.

packedLength

uint16_t packedLength(
  void
)

Returns the packed length of this block send message.

Details
Returns
length of the message when packed

Public static functions

parse

WEAVE_ERROR parse(
  PacketBuffer *aBuffer,
  BlockSend & aResponse
)

Parse data from an PacketBuffer into a BlockSend message format.

Details
Parameters
[in] aBuffer
Pointer to an PacketBuffer which has the data we want to parse out
[out] aResponse
Pointer to a BlockSend object where we should store the results
Return Values
WEAVE_NO_ERROR
If successful
WEAVE_ERROR_BUFFER_TOO_SMALL
If buffer is too small