19#include "command_code.h"
147 void deserialize(std::string &gpioDatagramPayload);
166 void setBuffer(
const uint8_t *data, uint8_t length);
Definition: gpio_datagram.h:36
const uint8_t * getBuffer() const
Gets the Gpio buffer.
Definition: gpio_datagram.cc:87
void clearBuffer()
Clear the Gpio data buffer.
Definition: gpio_datagram.cc:71
void setBuffer(const uint8_t *data, uint8_t length)
Sets data in the Gpio buffer.
Definition: gpio_datagram.cc:66
Mode
Gpio Mode definition.
Definition: gpio_datagram.h:60
AltFunction
Gpio Alt function definition.
Definition: gpio_datagram.h:75
static const constexpr uint8_t PINS_PER_PORT
Definition: gpio_datagram.h:38
Port getGpioPort() const
Gets the target Gpio port.
Definition: gpio_datagram.cc:75
Port
Gpio Port definition.
Definition: gpio_datagram.h:43
std::string serialize(const CommandCode &commandCode) const
Serializes Gpio data with command code for transmission.
Definition: gpio_datagram.cc:22
static constexpr size_t GPIO_MAX_BUFFER_SIZE
Definition: gpio_datagram.h:113
uint8_t getBufferLength() const
Gets the Gpio buffer length.
Definition: gpio_datagram.cc:83
void deserialize(std::string &gpioDatagramPayload)
Deserializes Gpio data from payload string.
Definition: gpio_datagram.cc:37
void setGpioPort(const Port &gpioPort)
Sets the target Gpio port.
Definition: gpio_datagram.cc:58
uint8_t getGpioPin() const
Gets the target Gpio pin.
Definition: gpio_datagram.cc:79
Payload m_gpioDatagram
Definition: gpio_datagram.h:198
Gpio()=default
Default constructor for Gpio object.
void setGpioPin(const uint8_t &gpioPin)
Sets the target Gpio pin.
Definition: gpio_datagram.cc:62
CommandCode
Command Code Class.
Definition: command_code.h:28
@ GPIO_ALT1_TIM1
Definition: gpio.h:66
@ GPIO_ALT1_TIM2
Definition: gpio.h:67
@ GPIO_ALT0_SWDIO
Definition: gpio.h:62
@ GPIO_ALT7_USART3
Definition: gpio.h:84
@ GPIO_ALT5_SPI1
Definition: gpio.h:75
@ GPIO_ALT4_I2C1
Definition: gpio.h:70
@ GPIO_ALT_NONE
Definition: gpio.h:59
@ GPIO_ALT0_SWCLK
Definition: gpio.h:63
@ GPIO_ALT9_CAN1
Definition: gpio.h:87
@ GPIO_ALT4_I2C2
Definition: gpio.h:71
@ GPIO_ALT14_TIM16
Definition: gpio.h:91
@ GPIO_ALT5_SPI2
Definition: gpio.h:76
@ GPIO_ALT6_SPI3
Definition: gpio.h:79
@ GPIO_ALT14_TIM15
Definition: gpio.h:90
@ GPIO_ALT4_I2C3
Definition: gpio.h:72
@ GPIO_ALT7_USART1
Definition: gpio.h:82
@ GPIO_ALT7_USART2
Definition: gpio.h:83
Gpio Datagram payload storage.
Definition: gpio_datagram.h:118
uint8_t bufferLength
Definition: gpio_datagram.h:121
Port gpioPort
Definition: gpio_datagram.h:119
uint8_t gpioPin
Definition: gpio_datagram.h:120
uint8_t buffer[GPIO_MAX_BUFFER_SIZE]
Definition: gpio_datagram.h:122