added initializeInterface for comIF/cookie

This commit is contained in:
Robin Müller 2020-03-24 15:33:18 +01:00
parent ea49d88c4b
commit b2b6b8ee23
3 changed files with 17 additions and 6 deletions

View File

@ -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

View File

@ -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<StorageManagerIF>(objects::IPC_STORE);
if (IPCStore == NULL) {

View File

@ -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;