blfwk::DataPacket Class Reference

Data packet operations. More...

`#include <Command.h>`

Collaboration diagram for blfwk::DataPacket:
[legend]

## Classes

class | DataConsumer
| Abstract class to consume data from data phase. More...
class | DataProducer
| Abstract class to provide data for data phase. More...
class | FileDataConsumer
| Write file data for data phase receive. More...
class | FileDataProducer
| Provide file data for data phase. More...
class | HexDataProducer
| Provide data from hex string for data phase. More...
class | SegmentDataProducer
| Provide DataSource::Segment data for data phase. More...
class | StdOutDataConsumer
| Print data for data phase receive. More...

## Public Member Functions

| DataPacket (DataProducer *dataProducer)
| Constructor that takes a DataProducer.
| DataPacket (DataConsumer *dataConsumer)
| Constructor that takes a DataConsumer.
uint8_t * | sendTo (Packetizer &device, uint32_t *bytesWritten, Progress *progress)
| Send data packet to device. More...
uint8_t * | receiveFrom (Packetizer &device, uint32_t *byteCount, Progress *progress)
| Receive data packet from device. More...

## Protected Attributes

DataProducer * | m_dataProducer
| Provides data for the packet.
DataConsumer * | m_dataConsumer
| Process the data in the packet.
uint8_t | m_packet [kMinPacketBufferSize]
| The data packet.

## Detailed Description

Data packet operations.

Formats data packets and runs data phase.

## Member Function Documentation

uint8_t * blfwk::DataPacket::receiveFrom | ( | Packetizer & | device,
|  | uint32_t * | byteCount,
|  | Progress * | progress
| ) |  |

Receive data packet from device.

See host_command.h for documentation on this function.

Calls the data consumer to process the receied data.

uint8_t * blfwk::DataPacket::sendTo | ( | Packetizer & | device,
|  | uint32_t * | bytesWritten,
|  | Progress * | progress
| ) |  |

Send data packet to device.

See host_command.h for documentation on this function.

Calls the data provide to get the data to send.

The documentation for this class was generated from the following files:

- Command.h
- Command.cpp