blfwk::Packetizer Class Referenceabstract

Interface class for packetization of commands and data. More...

`#include <Packetizer.h>`

Inheritance diagram for blfwk::Packetizer:
[legend]
Collaboration diagram for blfwk::Packetizer:
[legend]

## Public Member Functions

| Packetizer (Peripheral *peripheral, uint32_t packetTimeoutMs)
virtual status_t | readPacket (uint8_t **packet, uint32_t *packetLength, packet_type_t packetType)=0
| Read a packet.
virtual status_t | writePacket (const uint8_t *packet, uint32_t byteCount, packet_type_t packetType)=0
| Write a packet.
virtual void | abortPacket ()=0
| Abort data phase.
virtual void | sync ()=0
| Send framing packet ack.
virtual void | finalize ()=0
| Finalize.
virtual void | enableSimulatorPump ()=0
| Enable simulator command processor pump.
virtual void | pumpSimulator ()=0
| Pump simulator command processor.
virtual void | setAborted (bool aborted)=0
| Set aborted flag. More...
virtual uint32_t | getMaxPacketSize ()=0
| Return the max packet size.
virtual Peripheral * | getPeripheral ()
| Peripheral accessor.
standard_version_t | getVersion ()
| Get Framing Protocol Version.
uint16_t | getOptions ()
| Get Framing Protocol Options.
void | setAbortEnabled (bool isEnabled)
| Set abort packet check enable.
bool | isAbortEnabled ()
| Check if abort data phase is enabled.

## Protected Attributes

Peripheral * | m_peripheral
| Peripheral to send/receive bytes on.
standard_version_t | m_version
| Framing protocol version.
uint16_t | m_options
| Framing protocol options bitfield.
clock_t | m_startTime
| Beginning time of packet transaction.
uint32_t | m_packetTimeoutMs
bool | m_isAbortEnabled
| True if allowing abort packet. Not used by all packetizers.

## Detailed Description

Interface class for packetization of commands and data.

## Member Function Documentation

virtual void blfwk::Packetizer::setAborted | ( | bool | aborted | ) |

pure virtual

Set aborted flag.

Used for out-of-band flow control for simulator.

Implemented in blfwk::UsbHidPacketizer, blfwk::SimPacketizer, and blfwk::SerialPacketizer.

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

- Packetizer.h