diff --git a/devicehandlers/DeviceCommunicationIF.h b/devicehandlers/DeviceCommunicationIF.h index 6f271504..931fc8b5 100644 --- a/devicehandlers/DeviceCommunicationIF.h +++ b/devicehandlers/DeviceCommunicationIF.h @@ -46,6 +46,18 @@ public: virtual ~DeviceCommunicationIF() {} + /** + * @brief Device specific initialization, using the cookie. + * @details + * The cookie is already prepared in the factory. If the communication + * interface needs to be set up in some way and requires cookie information, + * this can be performed in this function, which is called on device handler + * initialization. + * @param cookie + * @return + */ + virtual ReturnValue_t initializeInterface(CookieIF * cookie) = 0; + /** * Called by DHB in the SEND_WRITE doSendWrite(). * This function is used to send data to the physical device diff --git a/devicehandlers/DeviceHandlerBase.cpp b/devicehandlers/DeviceHandlerBase.cpp index ebb361d9..ad699508 100644 --- a/devicehandlers/DeviceHandlerBase.cpp +++ b/devicehandlers/DeviceHandlerBase.cpp @@ -102,11 +102,10 @@ ReturnValue_t DeviceHandlerBase::initialize() { return RETURN_FAILED; } -// result = communicationInterface->open(&cookie, logicalAddress, -// maxDeviceReplyLen, comParameter1, comParameter2); -// if (result != RETURN_OK) { -// return result; -// } + result = communicationInterface->initializeInterface(comCookie); + if (result != RETURN_OK) { + return result; + } IPCStore = objectManager->get(objects::IPC_STORE); if (IPCStore == NULL) { diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 5faaa8e0..dcca2cc4 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -464,7 +464,7 @@ protected: * indicates either that all raw messages to and from the device should be sent to #theOneWhoWantsToReadRawTraffic * or that all device TM should be downlinked to #theOneWhoWantsToReadRawTraffic */ - enum WiretappingMode { + enum WiretappingMode: uint8_t { OFF = 0, RAW = 1, TM = 2 } wiretappingMode;