nl::Weave::Profiles::BDX_Development::ReceiveAccept

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

The ReceiveAccept message is used to accept a proposed exchange when the receiver is the initiator.

Summary

Inheritance

Inherits from: nl::Weave::Profiles::BDX_Development::SendAccept

Constructors and Destructors

ReceiveAccept(void)
The no-arg constructor with defaults for the send accept message.

Public attributes

mDefiniteLength
bool
True if a definite length was chosen.
mLength
uint64_t
Length of transfer we decided on.
mMetaData
Optional TLV Metadata.
mWideRange
bool
True if our range and offset fields are 64 bits.

Public functions

init(uint8_t aVersion, uint8_t aTransferMode, uint16_t aMaxBlockSize, uint64_t aLength, ReferencedTLVData *aMetaData)
Initialze a "wide" receive accept frame.
init(uint8_t aVersion, uint8_t aTransferMode, uint16_t aMaxBlockSize, uint32_t aLength, ReferencedTLVData *aMetaData)
Initialze a "non-wide" receive accept frame (32 bit length)
operator==(const ReceiveAccept &) const
bool
Equality comparison between ReceiveAccept messages.
pack(PacketBuffer *aBuffer)
Pack a receive accept message into an PacketBuffer.
packedLength(void)
uint16_t
Returns the packed length of this receive accept message.

Public static functions

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

Public attributes

mDefiniteLength

bool mDefiniteLength

True if a definite length was chosen.

mLength

uint64_t mLength

Length of transfer we decided on.

mMetaData

ReferencedTLVData mMetaData

Optional TLV Metadata.

mWideRange

bool mWideRange

True if our range and offset fields are 64 bits.

Public functions

ReceiveAccept

 ReceiveAccept(
  void
)

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

init

WEAVE_ERROR init(
  uint8_t aVersion,
  uint8_t aTransferMode,
  uint16_t aMaxBlockSize,
  uint64_t aLength,
  ReferencedTLVData *aMetaData
)

Initialze a "wide" receive accept frame.

Details
Parameters
[in] aVersion
Version of BDX that we are using
[in] aTransferMode
Transfer mode to be used in the transfer
[in] aMaxBlockSize
Maximum allowed block size for this transfer
[in] aLength
Length of the file to be transferred, 0 if indefinite
[in] aMetaData
(optional) TLV Metadata
Returns
WEAVE_NO_ERROR if successful

init

WEAVE_ERROR init(
  uint8_t aVersion,
  uint8_t aTransferMode,
  uint16_t aMaxBlockSize,
  uint32_t aLength,
  ReferencedTLVData *aMetaData
)

Initialze a "non-wide" receive accept frame (32 bit length)

Details
Parameters
[in] aVersion
Version of BDX that we are using
[in] aTransferMode
Transfer mode to be used in the transfer
[in] aMaxBlockSize
Maximum allowed block size for this transfer
[in] aLength
Length of the file to be transferred, 0 if indefinite
[in] aMetaData
(optional) TLV Metadata
Returns
WEAVE_NO_ERROR if successful

operator==

bool operator==(
  const ReceiveAccept &
) const 

Equality comparison between ReceiveAccept messages.

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

pack

WEAVE_ERROR pack(
  PacketBuffer *aBuffer
)

Pack a receive accept message into an PacketBuffer.

Details
Parameters
[out] aBuffer
An PacketBuffer to pack the ReceiveAccept message in
Return Values
WEAVE_NO_ERROR
If successful
WEAVE_ERROR_BUFFER_TOO_SMALL
If buffer is too small

packedLength

uint16_t packedLength(
  void
)

Returns the packed length of this receive accept message.

Details
Returns
length of the message when packed

Public static functions

parse

WEAVE_ERROR parse(
  PacketBuffer *aBuffer,
  ReceiveAccept & aResponse
)

Parse data from an PacketBuffer into a ReceiveAccept message format.

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