Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
blfwk::SimPacketizer Class Reference

Provides source and sink for packets in the simulator space. More...

#include <SimPacketizer.h>

+ Inheritance diagram for blfwk::SimPacketizer:
+ Collaboration diagram for blfwk::SimPacketizer:

Public Types

enum  _simPacketizer_contants { kSimReadTimeoutMs = 5000 }
 Constants.
 

Public Member Functions

 SimPacketizer (SimPeripheral *peripheral)
 Default Constructor.
 
virtual ~SimPacketizer ()
 Destructor.
 
virtual SimPeripheralgetPeripheral ()
 Peripheral accessor.
 
virtual status_t readPacket (uint8_t **packet, uint32_t *packetLength, packet_type_t packetType)
 Read a packet. More...
 
virtual status_t writePacket (const uint8_t *packet, uint32_t byteCount, packet_type_t packetType)
 Write a packet. More...
 
virtual void abortPacket ()
 Abort data phase.
 
virtual void sync ()
 Send framing packet ack.
 
virtual void finalize ()
 Finalize.
 
virtual void enableSimulatorPump ()
 Enable simulator command processor pump.
 
virtual void pumpSimulator ()
 Pump simulator command processor.
 
virtual void setAborted (bool aborted)
 Set aborted flag. More...
 
virtual uint32_t getMaxPacketSize ()
 Return the max packet size.
 
- Public Member Functions inherited from blfwk::Packetizer
 Packetizer (Peripheral *peripheral, uint32_t packetTimeoutMs)
 
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

bool m_isPumpEnabled
 True if simulator pump enabled.
 
bool m_isAborted
 Data phase abort requested by receiver.
 
uint8_t m_buffer [kDefaultMaxPacketSize]
 Buffer for bytes used to build read packet.
 
- Protected Attributes inherited from blfwk::Packetizer
Peripheralm_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

Provides source and sink for packets in the simulator space.

Member Function Documentation

status_t SimPacketizer::readPacket ( uint8_t **  packet,
uint32_t *  packetLength,
packet_type_t  packetType 
)
virtual

Read a packet.

Provides the address of a buffer containing the packet.

Parameters
packetPointer location to write packet pointer
packetLengthNumber of bytes in returned packet.

Implements blfwk::Packetizer.

virtual void blfwk::SimPacketizer::setAborted ( bool  aborted)
inlinevirtual

Set aborted flag.

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

Implements blfwk::Packetizer.

status_t SimPacketizer::writePacket ( const uint8_t *  packet,
uint32_t  byteCount,
packet_type_t  packetType 
)
virtual

Write a packet.

Parameters
packetPointer to packet to write.
byteCountNumber of bytes in packet.

Implements blfwk::Packetizer.


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