16#include <unordered_map>
19#include "gpio_datagram.h"
39 using PinInfo = std::unordered_map<std::string, std::string>;
Definition: gpio_datagram.h:36
Mode
Gpio Mode definition.
Definition: gpio_datagram.h:60
AltFunction
Gpio Alt function definition.
Definition: gpio_datagram.h:75
Class that manages receiving and transmitting Gpio commands and JSON logging.
Definition: gpio_manager.h:36
std::unordered_map< std::string, PinInfo > m_gpioInfo
Definition: gpio_manager.h:41
std::string stringifyPinMode(Datagram::Gpio::Mode mode)
Matches a string based on the received Gpio mode.
Definition: gpio_manager.cc:30
void updateGpioPinAltFunction(std::string &projectName, std::string &payload)
Update a Gpio Pin alternate function for a provided project given the data payload.
Definition: gpio_manager.cc:216
std::unordered_map< std::string, std::string > PinInfo
Hash-map to store Pin specific data such as state, mode, or alternate function.
Definition: gpio_manager.h:39
void loadGpioInfo(std::string &projectName)
Loads the Hash-map cache with a projects Gpio data.
Definition: gpio_manager.cc:124
void updateGpioPinState(std::string &projectName, std::string &payload)
Update a Gpio Pin state for a provided project given the data payload.
Definition: gpio_manager.cc:135
void updateGpioAllModes(std::string &projectName, std::string &payload)
Update all Gpio Pin modes for a provided project given the data payload.
Definition: gpio_manager.cc:194
void saveGpioInfo(std::string &projectName)
Saves the Hash-map cache to a projects Gpio data.
Definition: gpio_manager.cc:128
Datagram::Gpio m_gpioDatagram
Definition: gpio_manager.h:38
void updateGpioAllStates(std::string &projectName, std::string &payload)
Update all Gpio Pin states for a provided project given the data payload.
Definition: gpio_manager.cc:155
void updateGpioPinMode(std::string &projectName, std::string &payload)
Update a Gpio Pin mode for a provided project given the data payload.
Definition: gpio_manager.cc:179
GpioManager()=default
Constructs a GpioManager object.
void updateGpioAllAltFunctions(std::string &projectName, std::string &payload)
Update all Gpio Pin alternate functions for a provided project given the data payload.
Definition: gpio_manager.cc:231
std::string stringifyPinAltFunction(Datagram::Gpio::AltFunction altFunction)
Matches a string based on the received Gpio mode.
Definition: gpio_manager.cc:75
std::string createGpioCommand(CommandCode commandCode, std::string &gpioPortPin, std::string data)
Create a Gpio command given a CommandCode and if required, a specific Port/Pin map and data.
Definition: gpio_manager.cc:253
CommandCode
Command Code Class.
Definition: command_code.h:28