#include #include #include #include "bsp_linux/comIF/cookies/P60DockCookie.h" #include "bsp_linux/comIF/P60DockComIF.h" P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie):DeviceHandlerBase(objectId, comIF, comCookie) { } P60DockHandler::~P60DockHandler() { } void P60DockHandler::doStartUp(){ } void P60DockHandler::doShutDown(){ } ReturnValue_t P60DockHandler::buildNormalDeviceCommand(DeviceCommandId_t * id){ return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t P60DockHandler::buildTransitionDeviceCommand( DeviceCommandId_t * id){ return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t P60DockHandler::buildCommandFromCommand( DeviceCommandId_t deviceCommand, const uint8_t * commandData, size_t commandDataLen) { switch(deviceCommand) { case(READ_MODULE_CFG):{ internalState = InternalStates::READ_MODULE_CFG; break; } case(PING): { break; } default: break; } return HasReturnvaluesIF::RETURN_OK; } void P60DockHandler::fillCommandAndReplyMap(){ this->insertInCommandAndReplyMap(READ_MODULE_CFG, 3); } ReturnValue_t P60DockHandler::scanForReply(const uint8_t *start, size_t remainingSize, DeviceCommandId_t *foundId, size_t *foundLen) { switch(internalState) { case(InternalStates::READ_MODULE_CFG): { *foundId = READ_MODULE_CFG; *foundLen = moduleCfgTableSize; break; } default: return IGNORE_REPLY_DATA; } return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t P60DockHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) { switch(id) { case(READ_MODULE_CFG): { handleDeviceTM((SerializeIF*)packet, id, true, true); break; } default: break; } return HasReturnvaluesIF::RETURN_OK; } void setNormalDatapoolEntriesInvalid(){ }