JM9 XRCU Board 0.2.0a
Libraries API Reference
Loading...
Searching...
No Matches
Serial_packer Class Reference

JM9 UART packet packer. More...

#include <Serial_packer.h>

Inheritance diagram for Serial_packer:
JM9_packer

Public Member Functions

 Serial_packer (HardwareSerial &init_uart, const uint8_t init_start_byte)
 Creates a packer.
 
bool send (const uint8_t *const tx_buf, const uint8_t tx_buf_len)
 Creates and sends a packet.
 
HardwareSerialget_uart ()
 Gets the UART object to send the packets to.
 

Detailed Description

JM9 UART packet packer.

This packer can pack data into packets and send the packets through a UART bus.

Author
YH Choi @ JM9

Constructor & Destructor Documentation

◆ Serial_packer()

Serial_packer::Serial_packer ( HardwareSerial & init_uart,
const uint8_t init_start_byte )

Creates a packer.

Parameters
init_uartthe UART object to send the packets to
init_start_bytethe start byte of each packet

Member Function Documentation

◆ get_uart()

HardwareSerial & Serial_packer::get_uart ( )

Gets the UART object to send the packets to.

Returns
the UART object to send the packets to

◆ send()

bool Serial_packer::send ( const uint8_t *const tx_buf,
const uint8_t tx_buf_len )

Creates and sends a packet.

Parameters
tx_bufthe array of bytes to be sent
tx_buf_lenthe number of bytes to be sent
Returns
true if packet is successfully sent, false otherwise

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