#include "pcduSwitchCb.h" #include #include "devices/gpioIds.h" void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void* args) { LinuxLibgpioIF* gpioComIF = reinterpret_cast(args); if (gpioComIF == nullptr) { return; } if (pdu == GOMSPACE::Pdu::PDU1) { PDU1::Channels typedChannel = static_cast(channel); if (typedChannel == PDU1::Channels::ACS_A_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET); } else { gpioComIF->pullLow(gpioIds::GNSS_0_NRESET); } } } else if (pdu == GOMSPACE::Pdu::PDU2) { PDU2::Channels typedChannel = static_cast(channel); if (typedChannel == PDU2::Channels::ACS_B_SIDE) { if (state) { gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET); } else { gpioComIF->pullLow(gpioIds::GNSS_1_NRESET); } } } }