nl::Weave::Profiles::BDX_Development::BlockSendV1

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

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

Summary

It has a 4 byte block counter.

Inheritance

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

Constructors and Destructors

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

Public attributes

mBlockCounter
uint32_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(uint32_t aCounter, uint64_t aLength, uint8_t *aData)
Initialize a BlockSendV1 message.
operator==(const BlockSendV1 &) const
bool
Equality comparison between BlockSendV1 messages.
packedLength(void)
uint16_t
Returns the packed length of this block send message.

Public static functions

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

Public attributes

mBlockCounter

uint32_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

BlockSendV1

 BlockSendV1(
  void
)

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

init

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

Initialize a BlockSendV1 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 BlockSendV1 &
) const 

Equality comparison between BlockSendV1 messages.

Details
Parameters
[in] another
Another BlockSendV1 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,
  BlockSendV1 & aResponse
)

Parse data from an PacketBuffer into a BlockSendV1 message format.

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