Provides source and sink for packets that go over the serial peripherals.
More...
#include <SerialPacketizer.h>
|
|
status_t | send_deferred_ack () |
| | Send ACK if needed.
|
| |
| status_t | serial_packet_read (uint8_t **packet, uint32_t *packetLength, packet_type_t packetType) |
| | Read packet using serial framing. More...
|
| |
|
status_t | serial_packet_write (const uint8_t *packet, uint32_t byteCount, packet_type_t packetType) |
| | Write packet using serial framing.
|
| |
| void | serial_packet_abort () |
| | Abort data phase. More...
|
| |
|
uint32_t | serial_packet_get_max_packet_size () |
| | Get max packet size.
|
| |
|
status_t | serial_packet_send_sync (uint8_t framingPacketType) |
| | Send a sync packet of the specified type.
|
| |
|
status_t | serial_send_ping_response () |
| | Send a ping message back in response to a ping.
|
| |
|
status_t | wait_for_ack_packet () |
| | Wait for an ACK, handling NAKs as needed.
|
| |
|
status_t | read_data_packet (framing_data_packet_t *packet, uint8_t *data, packet_type_t packetType) |
| | Read from peripheral until entire data framing packet read.
|
| |
|
status_t | read_start_byte (framing_header_t *header) |
| | Read from peripheral until start byte found.
|
| |
|
status_t | read_header (framing_header_t *header) |
| | Read from peripheral until packet header found.
|
| |
|
status_t | read_length (framing_data_packet_t *packet) |
| | Read from peripheral until packet length found.
|
| |
|
status_t | read_crc16 (framing_data_packet_t *packet) |
| | Read from peripheral until crc16 is found.
|
| |
|
uint16_t | calculate_framing_crc16 (framing_data_packet_t *packet, const uint8_t *data) |
| | Calculate crc over framing data packet.
|
| |
Provides source and sink for packets that go over the serial peripherals.
| status_t SerialPacketizer::ping |
( |
int |
retries, |
|
|
unsigned int |
delay, |
|
|
ping_response_t * |
response, |
|
|
int |
comSpeed |
|
) |
| |
|
virtual |
Send a ping packet and receive an ack.
This is a method for host only side pinging of the target. The reponse from the target to a ping packet is a ping response packet. Since the target may or may not be online there is optionally a series of retries to make the best attempt at communication possible
- Parameters
-
| retries | The number of attempts that should be made. |
| delay | The time in milliseconds between each attempt. |
| comSpeed | The peripheral baud rate. Used in order to calculate the receive delay in the case of low com speeds such as 100 and 300 which need nearly a second to complete |
| status_t SerialPacketizer::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
-
| packet | Pointer location to write packet pointer |
| packetLength | Number of bytes in returned packet. |
Implements blfwk::Packetizer.
| void SerialPacketizer::serial_packet_abort |
( |
| ) |
|
|
protected |
Abort data phase.
Respond to next host data packet with AckAbort instead of Ack (i.e. receiver data phase abort).
| status_t SerialPacketizer::serial_packet_read |
( |
uint8_t ** |
packet, |
|
|
uint32_t * |
packetLength, |
|
|
packet_type_t |
packetType |
|
) |
| |
|
protected |
Read packet using serial framing.
On return, caller must call flow control method to send AckContinue or AckWait followed by Continue.
| status_t SerialPacketizer::writePacket |
( |
const uint8_t * |
packet, |
|
|
uint32_t |
byteCount, |
|
|
packet_type_t |
packetType |
|
) |
| |
|
virtual |
Write a packet.
- Parameters
-
| packet | Pointer to packet to write. |
| byteCount | Number of bytes in packet. |
Implements blfwk::Packetizer.
The documentation for this class was generated from the following files: