void autopnp_adv_cleaningGui_cleaningGuiComponentWrapper_completeReadOperations(void) { uint8_t portIndex; for (portIndex = 0; portIndex < PORT_COUNT; portIndex++) { xme_core_dataHandler_completeReadOperation(ports[portIndex]); } }
xme_status_t sensorMonitor_adv_monitorB_monitorBComponentWrapper_readNextPacket ( sensorMonitor_adv_monitorB_monitorBComponentWrapper_internalPortId_t portId ) { xme_status_t status = XME_STATUS_SUCCESS; #ifdef XME_MULTITHREAD char* accessed; #endif // #ifdef XME_MULTITHREAD XME_ASSERT(portId < inputPortCount); #ifdef XME_MULTITHREAD XME_ASSERT(inputPortAccessed != XME_HAL_TLS_INVALID_TLS_HANDLE); accessed = (char*) xme_hal_tls_get(inputPortAccessed); XME_ASSERT(NULL != accessed); // We need to complete the read operation if the port has been accessed if (accessed[portId / 8U] & (1 << (portId % 8U))) #else // #ifdef XME_MULTITHREAD if (inputPorts[portId].state.locked) #endif // #ifdef XME_MULTITHREAD { status = xme_core_dataHandler_completeReadOperation(inputPorts[portId].dataPacketId); XME_CHECK_MSG ( XME_STATUS_SUCCESS == status, XME_STATUS_INTERNAL_ERROR, XME_LOG_ERROR, "[monitorBComponentWrapper] CompleteReadOperation for port (interalPortId: %d, dataPacketId: %d) returned error code %d.\n", portId, inputPorts[portId].dataPacketId, status ); #ifdef XME_MULTITHREAD accessed[portId / 8U] &= ~(1 << (portId % 8U)); #endif // #ifdef XME_MULTITHREAD inputPorts[portId].state.dataValid = 0; inputPorts[portId].state.attributesValid = 0; inputPorts[portId].state.locked = 0; inputPorts[portId].state.error = 0; } return status; }
xme_status_t doMarshaling ( xme_core_topic_t topic, xme_core_dataManager_dataPacketId_t inputPort, xme_core_dataManager_dataPacketId_t outputPort ) { void* buffer; unsigned int bufferSize; xme_status_t status; // Switch for the correct topic // In the respective cases we allocate a buffer with the right size for the topic and // call a function that performs the read from the inputPort and the actual marshaling if (XME_CORE_TOPIC(CHROMOSOMEGUI_TOPIC_BUTTONSIGNAL) == topic) { uint8_t marshaledData[1]; buffer = marshaledData; bufferSize = 1; status = doMarshalingForButtonSignal ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(CHROMOSOMEGUI_TOPIC_WRITETEXT) == topic) { uint8_t marshaledData[1000]; buffer = marshaledData; bufferSize = 1000; status = doMarshalingForWriteText ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_PNPMANAGER_RUNTIME_GRAPH_MODEL) == topic) { uint8_t marshaledData[2962]; buffer = marshaledData; bufferSize = 2962; status = doMarshalingForPnpManager_runtime_graph_model ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_PNPMANAGER_RUNTIME_GRAPH_MODEL2) == topic) { uint8_t marshaledData[2962]; buffer = marshaledData; bufferSize = 2962; status = doMarshalingForPnpManager_runtime_graph_model2 ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_PNPMANAGER_RUNTIME_GRAPH_MODEL3) == topic) { uint8_t marshaledData[2962]; buffer = marshaledData; bufferSize = 2962; status = doMarshalingForPnpManager_runtime_graph_model3 ( inputPort, (void*)marshaledData ); } else { XME_LOG ( XME_LOG_ERROR, "xme_wp_marshaler_run(): Given topic with id %" PRIu64 " is not " "supported by this marshaler.", topic ); return XME_STATUS_INTERNAL_ERROR; } XME_CHECK ( XME_STATUS_SUCCESS == status, XME_STATUS_INTERNAL_ERROR ); // Write marshaled data to outputPort status = xme_core_dataHandler_writeData ( outputPort, buffer, bufferSize ); XME_CHECK ( XME_STATUS_SUCCESS == status, XME_STATUS_INTERNAL_ERROR ); xme_core_dataHandler_completeWriteOperation(outputPort); xme_core_dataHandler_completeReadOperation(inputPort); return XME_STATUS_SUCCESS; }
xme_status_t doMarshaling ( xme_core_topic_t topic, xme_core_dataManager_dataPacketId_t inputPort, xme_core_dataManager_dataPacketId_t outputPort ) { void* buffer; unsigned int bufferSize; xme_status_t status; // Switch for the correct topic // In the respective cases we allocate a buffer with the right size for the topic and // call a function that performs the read from the inputPort and the actual marshaling if (XME_CORE_TOPIC(XME_WP_DEMARSHALERTEST_TOPIC_TEST) == topic) { uint8_t marshaledData[90]; buffer = marshaledData; bufferSize = 90; status = doMarshalingForTest ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_WP_DEMARSHALERTEST_TOPIC_TOPIC0) == topic) { uint8_t marshaledData[4]; buffer = marshaledData; bufferSize = 4; status = doMarshalingForTopic0 ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_WP_DEMARSHALERTEST_TOPIC_TOPIC1) == topic) { uint8_t marshaledData[4]; buffer = marshaledData; bufferSize = 4; status = doMarshalingForTopic1 ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_WP_DEMARSHALERTEST_TOPIC_TOPIC2) == topic) { uint8_t marshaledData[4]; buffer = marshaledData; bufferSize = 4; status = doMarshalingForTopic2 ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_PNPMANAGER_RUNTIME_GRAPH_MODEL) == topic) { uint8_t marshaledData[3024]; buffer = marshaledData; bufferSize = 3024; status = doMarshalingForPnpManager_runtime_graph_model ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_LOGIN_LOGINREQUEST) == topic) { uint8_t marshaledData[18]; buffer = marshaledData; bufferSize = 18; status = doMarshalingForLogin_loginRequest ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_LOGIN_LOGINRESPONSE) == topic) { uint8_t marshaledData[22]; buffer = marshaledData; bufferSize = 22; status = doMarshalingForLogin_loginResponse ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_LOGIN_PNPLOGINREQUEST) == topic) { uint8_t marshaledData[10]; buffer = marshaledData; bufferSize = 10; status = doMarshalingForLogin_pnpLoginRequest ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_LOGIN_PNPLOGINRESPONSE) == topic) { uint8_t marshaledData[10]; buffer = marshaledData; bufferSize = 10; status = doMarshalingForLogin_pnpLoginResponse ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_LOGIN_LOGINACKNOWLEDGMENT) == topic) { uint8_t marshaledData[4]; buffer = marshaledData; bufferSize = 4; status = doMarshalingForLogin_loginAcknowledgment ( inputPort, (void*)marshaledData ); } else if (XME_CORE_TOPIC(XME_CORE_TOPIC_PNP_COMPONENTINSTANCEMANIFEST) == topic) { uint8_t marshaledData[84]; buffer = marshaledData; bufferSize = 84; status = doMarshalingForPnp_componentInstanceManifest ( inputPort, (void*)marshaledData ); } else { XME_LOG ( XME_LOG_ERROR, "xme_wp_marshal_marshaler_run(): Given topic with id %" PRIu64 " is not " "supported by this marshaler.", topic ); return XME_STATUS_INTERNAL_ERROR; } XME_CHECK ( XME_STATUS_SUCCESS == status, XME_STATUS_INTERNAL_ERROR ); // Write marshaled data to outputPort status = xme_core_dataHandler_writeData ( outputPort, buffer, bufferSize ); XME_CHECK ( XME_STATUS_SUCCESS == status, XME_STATUS_INTERNAL_ERROR ); XME_CHECK(XME_STATUS_SUCCESS == xme_core_dataHandler_completeWriteOperation(outputPort), XME_STATUS_INTERNAL_ERROR); XME_CHECK(XME_STATUS_SUCCESS == xme_core_dataHandler_completeReadOperation(inputPort), XME_STATUS_INTERNAL_ERROR); return XME_STATUS_SUCCESS; }