This commit is contained in:
Martin Zietz
2021-06-24 12:04:36 +02:00
parent 88181d8fb4
commit d05b1913ab
8 changed files with 95 additions and 41 deletions

View File

@ -6,7 +6,8 @@
RwHandler::RwHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
LinuxLibgpioIF* gpioComIF, gpioId_t enableGpio) :
DeviceHandlerBase(objectId, comIF, comCookie), temperatureSet(this), statusSet(this) {
DeviceHandlerBase(objectId, comIF, comCookie), gpioComIF(gpioComIF), enableGpio(enableGpio),
temperatureSet(this), statusSet(this) {
if (comCookie == NULL) {
sif::error << "RwHandler: Invalid com cookie" << std::endl;
}
@ -19,6 +20,9 @@ RwHandler::~RwHandler() {
}
void RwHandler::doStartUp() {
if(gpioComIF->pullHigh(enableGpio) != RETURN_OK) {
sif::debug << "RwHandler::doStartUp: Failed to pull enable gpio to high";
}
#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1
setMode(MODE_NORMAL);
#else
@ -27,7 +31,9 @@ void RwHandler::doStartUp() {
}
void RwHandler::doShutDown() {
if(gpioComIF->pullLow(enableGpio) != RETURN_OK) {
sif::debug << "RwHandler::doStartUp: Failed to pull enable gpio to low";
}
}
ReturnValue_t RwHandler::buildNormalDeviceCommand(DeviceCommandId_t * id) {