コード例 #1
0
        AuditHandlerInterfaceTest() : app() {
            xme_core_dataHandler_init(DATAHANDLER_TEST_MEMORYVALUE);

            EXPECT_EQ(XME_STATUS_SUCCESS,
                      xme_core_dataHandler_createPort(app.identifier,
                                                      app.inport[0]->type,
                                                      app.inport[0]->topic,
                                                      app.inport[0]->bufferSize * sizeof(xme_core_topic_t),
                                                      auditTestMetadata, 1,
                                                      false, false, 0,
                                                      &app.inport[0]->portHandle));
            EXPECT_EQ(XME_STATUS_SUCCESS,
                      xme_core_dataHandler_createPort(app.identifier,
                                                      app.inport[1]->type,
                                                      app.inport[1]->topic,
                                                      app.inport[1]->bufferSize * sizeof(xme_core_topic_t),
                                                      XME_CORE_NO_ATTRIBUTE, 1,
                                                      false, false, 0,
                                                      &app.inport[1]->portHandle));
            EXPECT_EQ(XME_STATUS_SUCCESS,
                      xme_core_dataHandler_createPort(app.identifier,
                                                      app.outport[0]->type,
                                                      app.outport[0]->topic,
                                                      app.outport[0]->bufferSize * sizeof(xme_core_topic_t),
                                                      XME_CORE_NO_ATTRIBUTE, 1,
                                                      false, false, 0,
                                                      &app.outport[0]->portHandle));
            EXPECT_EQ(XME_STATUS_SUCCESS,
                      xme_core_dataHandler_createPort(app.identifier,
                                                      app.outport[1]->type,
                                                      app.outport[1]->topic,
                                                      app.outport[1]->bufferSize * sizeof(xme_core_topic_t),
                                                      XME_CORE_NO_ATTRIBUTE, 1,
                                                      false, false, 0,
                                                      &app.outport[1]->portHandle));
        }
コード例 #2
0
ファイル: measurementTest.cpp プロジェクト: donal3000/autopnp
    /**
     * \brief Add CONFIG_COUNT configurations to marshaler waypoint.
     */
    void addMarshalerConfigs()
    {
        xme_core_dataManager_dataPacketId_t subDataPacketId;
        xme_core_dataManager_dataPacketId_t pubDataPacketId;
        uint32_t i;
#if 0
        xme_core_attribute_descriptor_list_t metadata;
        xme_core_attribute_descriptor_t metadata_elements[1];
#endif // #if 0
        xme_status_t status;

#if 0
        metadata_elements[0].key = (xme_core_attribute_key_t) 0;
        metadata_elements[0].size = (size_t) 0;
        metadata.length = 1;
        metadata.element = metadata_elements;
#endif // #if 0

        status = xme_core_dataHandler_createDataPacket(sizeof(xme_wp_deMarshalerTest_topic_test_t), &subDataPacketId);

#if 0
        // Create subscription, which will be used in all configurations
        xme_core_dataHandler_createPort
        (
            (xme_core_component_t)1,
            XME_CORE_COMPONENT_PORTTYPE_DCC_SUBSCRIPTION,
            (xme_core_topic_t) XME_WP_DEMARSHALERTEST_TOPIC_TEST,
            sizeof(xme_wp_deMarshalerTest_topic_test_t),
            metadata,
            1,
            false,
            false,
            0,
            &subDataPacketId
        );
#endif // #if 0
        XME_ASSERT_NORVAL(XME_STATUS_SUCCESS == status);

        status = xme_core_dataHandler_createDataPacket(sizeof(xme_wp_deMarshalerTest_topic_test_t), &pubDataPacketId);

#if 0
        // Create publication, which will be used in all configurations
        xme_core_dataHandler_createPort
        (
            (xme_core_component_t)1,
            XME_CORE_COMPONENT_PORTTYPE_DCC_PUBLICATION,
            (xme_core_topic_t) XME_WP_DEMARSHALERTEST_TOPIC_TEST,
            sizeof(xme_wp_deMarshalerTest_topic_test_t),
            metadata,
            1,
            false,
            false,
            0,
            &pubDataPacketId
        );
#endif // #if 0
        XME_ASSERT_NORVAL(XME_STATUS_SUCCESS == status);

        xme_core_dataHandler_configure();
        // Add configurations
        // Every configuration will use the same port and topic (this should not influence execution time)
        for (i = 0; i < CONFIG_COUNT; i++)
        {
            xme_wp_marshal_marshaler_addConfig
            (
                &marshalerInstanceIds[i],
                (xme_core_topic_t) 5000,
                subDataPacketId,
                pubDataPacketId
            );
        }
    }