From 15c358cc5c616e9b0d84f50faddcacbac45b6342 Mon Sep 17 00:00:00 2001 From: Alina Laba Date: Wed, 5 Jun 2024 16:31:27 +0300 Subject: [PATCH] RDKBDEV-2687 tableSyncHandler callback to avoid undefined behavior while unregistering a row --- include/rbus.h | 19 +++ sampleapps/consumer/rbusOpenTelemetry.c | 3 +- sampleapps/provider/rbusCSIEventProvider.c | 4 +- sampleapps/provider/rbusEventProvider.c | 10 +- .../provider/rbusGeneralEventProvider.c | 4 +- sampleapps/provider/rbusIntervalProvider.c | 4 +- sampleapps/provider/rbusMethodProvider.c | 6 +- sampleapps/provider/rbusRawDataProvider.c | 2 +- sampleapps/provider/rbusSampleProvider.c | 54 ++++---- sampleapps/provider/rbusSampleTableProvider.c | 6 +- sampleapps/provider/rbusTableProvider.c | 12 +- sampleapps/provider/rbusValueChangeProvider.c | 2 +- src/rbus/rbus.c | 121 +++++++++++------- src/rbus/rbus_element.c | 25 +++- src/rbus/rbus_element.h | 1 + test/rbus/common/runningParamHelper.c | 2 +- test/rbus/consumer/elementTree.c | 2 +- .../multiProviderThreadsForSingleEvent.c | 2 +- .../multiRbusOpenMethodProvider.c | 6 +- .../multiRbusOpenProvider.c | 2 +- .../rbusOpenRegRbusOpenProvider.c | 2 +- .../multiRbusOpenRbusGetProvider.c | 2 +- test/rbus/provider/rbusTestMultiProvider.c | 6 +- test/rbus/provider/rbusTestProvider.c | 120 ++++++++--------- 24 files changed, 241 insertions(+), 176 deletions(-) diff --git a/include/rbus.h b/include/rbus.h index 41dcaa42..a9259f7d 100644 --- a/include/rbus.h +++ b/include/rbus.h @@ -530,6 +530,24 @@ typedef rbusError_t (* rbusEventSubHandler_t)( bool* autoPublish ); + +/** @fn typedef rbusError_t (*rbusTableSyncHandler_t)( + * rbusHandle_t handle, + * char const* tableName) + * @brief A table sync callback handler + * + * A provider can implement this handler to allow dynamic tables to synchronize rows. + * The tableName parameter will be a fully qualified name, specifying table's name + * (e.g. "Device.IP.Interface."). + * @param handle Bus Handle + * @param tableName The name of a table (e.g. "Device.IP.Interface.") + * @return RBus error code as defined by rbusError_t. + */ +typedef rbusError_t (*rbusTableSyncHandler_t)( + rbusHandle_t handle, + char const* tableName +); + /** @struct rbusCallbackTable_t * @brief The list of callback handlers supported by a data element. * @@ -566,6 +584,7 @@ typedef struct rbusCallbackTable_t handler for the event name */ rbusMethodHandler_t methodHandler; /**< Method handler */ + rbusTableSyncHandler_t tableSyncHandler; /** Synchronize table */ } rbusCallbackTable_t; /// @brief rbusDataElement_t The structure used when registering or diff --git a/sampleapps/consumer/rbusOpenTelemetry.c b/sampleapps/consumer/rbusOpenTelemetry.c index e5bf0798..56374bcb 100644 --- a/sampleapps/consumer/rbusOpenTelemetry.c +++ b/sampleapps/consumer/rbusOpenTelemetry.c @@ -167,7 +167,8 @@ void run_server() get_handler, set_handler, NULL, NULL, NULL, - method_handler}} + method_handler, + NULL}} }; rbus_open(&rbus, "test-server"); diff --git a/sampleapps/provider/rbusCSIEventProvider.c b/sampleapps/provider/rbusCSIEventProvider.c index 0cd22cb7..5d13c2f0 100644 --- a/sampleapps/provider/rbusCSIEventProvider.c +++ b/sampleapps/provider/rbusCSIEventProvider.c @@ -39,8 +39,8 @@ rbusError_t SampleProvider_SampleDataGetHandler(rbusHandle_t handle, rbusPropert rbusError_t eventSubHandler(rbusHandle_t handle, rbusEventSubAction_t action, const char* eventName, rbusFilter_t filter, int32_t interval, bool* autoPublish); rbusDataElement_t dataElements[TotalParams] = { - {"Device.WiFi.X_RDK_CSI.1.sampleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, NULL, NULL, NULL, eventSubHandler, NULL}}, - {"Device.SampleProvider.BigData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, NULL, NULL, NULL, eventSubHandler, NULL}} + {"Device.WiFi.X_RDK_CSI.1.sampleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.SampleProvider.BigData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}} }; char m_bigdata[RBUS_BIGDATA_SIZE] = "ABCD"; diff --git a/sampleapps/provider/rbusEventProvider.c b/sampleapps/provider/rbusEventProvider.c index 10901006..9bb9f5e4 100644 --- a/sampleapps/provider/rbusEventProvider.c +++ b/sampleapps/provider/rbusEventProvider.c @@ -127,11 +127,11 @@ int main(int argc, char *argv[]) char* eventData[2] = { "Hello Earth", "Hello Mars" }; rbusDataElement_t dataElements[5] = { - {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Provider1.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Provider1.Prop1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.SampleData2.StrData", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL}} + {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Provider1.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Provider1.Prop1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.SampleData2.StrData", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusGeneralEventProvider.c b/sampleapps/provider/rbusGeneralEventProvider.c index ebc83d54..310b54a1 100644 --- a/sampleapps/provider/rbusGeneralEventProvider.c +++ b/sampleapps/provider/rbusGeneralEventProvider.c @@ -76,8 +76,8 @@ int main(int argc, char *argv[]) char* eventData[2] = { "Hello Earth", "Hello Mars" }; rbusDataElement_t dataElements[2] = { - {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Provider1.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}} + {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Provider1.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusIntervalProvider.c b/sampleapps/provider/rbusIntervalProvider.c index ca915d51..103af0fb 100644 --- a/sampleapps/provider/rbusIntervalProvider.c +++ b/sampleapps/provider/rbusIntervalProvider.c @@ -90,8 +90,8 @@ int main(int argc, char *argv[]) int rc = RBUS_ERROR_SUCCESS; char componentName[] = "EventProvider"; rbusDataElement_t dataElements[2] = { - {"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, NULL, NULL, NULL, NULL, NULL}}, - {"Device.Provider1.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, NULL, NULL, NULL, NULL, NULL}} + {"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.Provider1.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, NULL, NULL, NULL, NULL, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusMethodProvider.c b/sampleapps/provider/rbusMethodProvider.c index e7047140..ed668d41 100644 --- a/sampleapps/provider/rbusMethodProvider.c +++ b/sampleapps/provider/rbusMethodProvider.c @@ -142,9 +142,9 @@ int main(int argc, char *argv[]) char componentName[] = "MethodProvider"; rbusDataElement_t dataElements[3] = { - {"Device.Methods.SimpleMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.Methods.SimpleMethod1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.Methods.AsyncMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}} + {"Device.Methods.SimpleMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.Methods.SimpleMethod1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.Methods.AsyncMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusRawDataProvider.c b/sampleapps/provider/rbusRawDataProvider.c index 1215bb25..6a13b95a 100644 --- a/sampleapps/provider/rbusRawDataProvider.c +++ b/sampleapps/provider/rbusRawDataProvider.c @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) char componentName[] = "RawDataEventProvider"; rbusDataElement_t dataElements[1] = { - {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}} + {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusSampleProvider.c b/sampleapps/provider/rbusSampleProvider.c index 7b2537a6..d1d9ea8f 100644 --- a/sampleapps/provider/rbusSampleProvider.c +++ b/sampleapps/provider/rbusSampleProvider.c @@ -52,36 +52,36 @@ rbusError_t SampleProvider_allTypesGetHandler(rbusHandle_t handle, rbusProperty_ rbusError_t SampleProvider_allTypesSetHandler(rbusHandle_t handle, rbusProperty_t prop, rbusSetHandlerOptions_t* opts); rbusDataElement_t dataElements[TotalParams] = { - {"Device.DeviceInfo.SampleProvider.Manufacturer", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.DeviceInfo.SampleProvider.ModelName", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.DeviceInfo.SampleProvider.SoftwareVersion", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.SampleData.IntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.SampleData.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.SampleData.UIntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.NestedObject1.TestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.NestedObject1.AnotherTestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.NestedObject2.TestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.NestedObject2.AnotherTestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.TestData.IntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.TestData.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.TestData.UIntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL}} + {"Device.DeviceInfo.SampleProvider.Manufacturer", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.DeviceInfo.SampleProvider.ModelName", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.DeviceInfo.SampleProvider.SoftwareVersion", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_DeviceGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.SampleData.IntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.SampleData.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.SampleData.UIntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_SampleDataGetHandler, SampleProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.NestedObject1.TestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.NestedObject1.AnotherTestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.NestedObject2.TestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.NestedObject2.AnotherTestParam", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_NestedObjectsGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.TestData.IntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.TestData.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.TestData.UIntData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_BuildResponseDataGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}} }; rbusDataElement_t allTypeDataElements[14] = { - {"Device.SampleProvider.AllTypes.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.CharData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.ByteData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.Int16Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.UInt16Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.Int32Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.UInt32Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.Int64Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.UInt64Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.SingleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.DoubleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.DateTimeData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.StringData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.SampleProvider.AllTypes.BytesData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL}} + {"Device.SampleProvider.AllTypes.BoolData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.CharData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.ByteData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.Int16Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.UInt16Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.Int32Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.UInt32Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.Int64Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.UInt64Data", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.SingleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.DoubleData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.DateTimeData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.StringData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.SampleProvider.AllTypes.BytesData", RBUS_ELEMENT_TYPE_PROPERTY, {SampleProvider_allTypesGetHandler, SampleProvider_allTypesSetHandler, NULL, NULL, NULL, NULL, NULL}} }; typedef struct _rbus_sample_data { diff --git a/sampleapps/provider/rbusSampleTableProvider.c b/sampleapps/provider/rbusSampleTableProvider.c index 1276e13f..84edc407 100644 --- a/sampleapps/provider/rbusSampleTableProvider.c +++ b/sampleapps/provider/rbusSampleTableProvider.c @@ -155,9 +155,9 @@ int main(int argc, char *argv[]) unsigned int quit_counter = 10; static rbusDataElement_t dataElements[] = { - {"Device.Tables.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, NULL, NULL}}, - {"Device.Tables.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.TestElements", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, setHandler, NULL, NULL, NULL, NULL}} + {"Device.Tables.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, NULL, NULL, NULL}}, + {"Device.Tables.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.TestElements", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, setHandler, NULL, NULL, NULL, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusTableProvider.c b/sampleapps/provider/rbusTableProvider.c index 3edf0a5f..5de08c3d 100644 --- a/sampleapps/provider/rbusTableProvider.c +++ b/sampleapps/provider/rbusTableProvider.c @@ -438,12 +438,12 @@ int main(int argc, char *argv[]) char componentName[] = "TableProvider1"; static rbusDataElement_t dataElements[6] = { - {"Device.Tables1.T1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler1, tableRemoveRowHandler1, eventSubHandler, NULL}}, - {"Device.Tables1.T1.{i}.Alias", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, setHandler1, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Tables1.T1.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, setHandler1, NULL, NULL, eventSubHandler, NULL}}, - {"Device.Tables1.T1.{i}.T2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler2, tableRemoveRowHandler2, NULL, NULL}}, - {"Device.Tables1.T1.{i}.T2.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, setHandler2, NULL, NULL, NULL, NULL}}, - {"Device.Tables1.T1.{i}.T2.{i}.AnotherData", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, NULL, NULL, NULL, NULL, NULL}} + {"Device.Tables1.T1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler1, tableRemoveRowHandler1, eventSubHandler, NULL, NULL}}, + {"Device.Tables1.T1.{i}.Alias", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, setHandler1, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Tables1.T1.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler1, setHandler1, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.Tables1.T1.{i}.T2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler2, tableRemoveRowHandler2, NULL, NULL, NULL}}, + {"Device.Tables1.T1.{i}.T2.{i}.Data", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, setHandler2, NULL, NULL, NULL, NULL, NULL}}, + {"Device.Tables1.T1.{i}.T2.{i}.AnotherData", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler2, NULL, NULL, NULL, NULL, NULL, NULL}} }; printf("provider: start\n"); diff --git a/sampleapps/provider/rbusValueChangeProvider.c b/sampleapps/provider/rbusValueChangeProvider.c index 0be49e4c..ea7d2ab3 100644 --- a/sampleapps/provider/rbusValueChangeProvider.c +++ b/sampleapps/provider/rbusValueChangeProvider.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) char componentName[] = "EventProvider"; - rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL}}}; + rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}}; printf("provider: start\n"); diff --git a/src/rbus/rbus.c b/src/rbus/rbus.c index a12965e1..e2987dec 100644 --- a/src/rbus/rbus.c +++ b/src/rbus/rbus.c @@ -1452,7 +1452,7 @@ static void _set_callback_handler (rbusHandle_t handle, rbusMessage request, rbu { /* Retrive the element node */ char const* paramName = rbusProperty_GetName(pProperties[loopCnt]); - el = retrieveInstanceElement(handleInfo->elementRoot, paramName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, paramName, true); if(el != NULL) { if(el->cbTable.setHandler) @@ -1613,46 +1613,55 @@ static void _get_recursive_partialpath_handler(elementNode* node, char const* qu if (node != NULL) { - /*if table getHandler, then pass the query to it and stop recursion*/ - if(node->type == RBUS_ELEMENT_TYPE_TABLE && node->cbTable.getHandler) + if(node->type == RBUS_ELEMENT_TYPE_TABLE) { - rbusError_t result; - rbusProperty_t tmpProperties; - char instanceName[RBUS_MAX_NAME_LENGTH]; - char partialPath[RBUS_MAX_NAME_LENGTH]; + /*if table getHandler, then pass the query to it and stop recursion*/ + if (node->cbTable.getHandler) + { + rbusError_t result; + rbusProperty_t tmpProperties; + char instanceName[RBUS_MAX_NAME_LENGTH]; + char partialPath[RBUS_MAX_NAME_LENGTH]; - snprintf(partialPath, RBUS_MAX_NAME_LENGTH-1, "%s.", - query ? _convert_reg_name_to_instance_name(node->fullName, query, instanceName) : node->fullName); + snprintf(partialPath, RBUS_MAX_NAME_LENGTH-1, "%s.", + query ? _convert_reg_name_to_instance_name(node->fullName, query, instanceName) : node->fullName); - RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler calling table getHandler partialPath=%s", level*4, " ", partialPath); + RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler calling table getHandler partialPath=%s", level*4, " ", partialPath); - rbusProperty_Init(&tmpProperties, partialPath, NULL); + rbusProperty_Init(&tmpProperties, partialPath, NULL); - ELM_PRIVATE_LOCK(node); - result = node->cbTable.getHandler(handle, tmpProperties, &options); - ELM_PRIVATE_UNLOCK(node); + ELM_PRIVATE_LOCK(node); + result = node->cbTable.getHandler(handle, tmpProperties, &options); + ELM_PRIVATE_UNLOCK(node); - if (result == RBUS_ERROR_SUCCESS ) - { - int count = rbusProperty_Count(tmpProperties); + if (result == RBUS_ERROR_SUCCESS ) + { + int count = rbusProperty_Count(tmpProperties); - RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler table getHandler returned %d properties", level*4, " ", count-1); + RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler table getHandler returned %d properties", level*4, " ", count-1); - /*the first property is just the partialPath we passed in */ - if(count > 1) + /*the first property is just the partialPath we passed in */ + if(count > 1) + { + /*take the second property, which is a list*/ + rbusProperty_Append(properties, rbusProperty_GetNext(tmpProperties)); + *pCount += count - 1; + } + } + else { - /*take the second property, which is a list*/ - rbusProperty_Append(properties, rbusProperty_GetNext(tmpProperties)); - *pCount += count - 1; + RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler table getHandler failed rc=%d", level*4, " ", result); } + + rbusProperty_Release(tmpProperties); + return; } - else + else if (node->cbTable.tableSyncHandler) { - RBUSLOG_DEBUG("%*s_get_recursive_partialpath_handler table getHandler failed rc=%d", level*4, " ", result); + ELM_PRIVATE_LOCK(node); + node->cbTable.tableSyncHandler(handle, node->fullName); + ELM_PRIVATE_UNLOCK(node); } - - rbusProperty_Release(tmpProperties); - return; } elementNode* child = node->child; @@ -1726,13 +1735,20 @@ rbusError_t get_recursive_wildcard_handler (rbusHandle_t handle, char const *par tmpPtr[0] = '\0'; tmpPtr++; - el = retrieveInstanceElement(handleInfo->elementRoot, instanceName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, instanceName, true); if (!el) return RBUS_ERROR_ELEMENT_DOES_NOT_EXIST; else if(el->type != RBUS_ELEMENT_TYPE_TABLE) return RBUS_ERROR_ACCESS_NOT_ALLOWED; + if (el->cbTable.tableSyncHandler) + { + ELM_PRIVATE_LOCK(el); + el->cbTable.tableSyncHandler(handle, el->fullName); + ELM_PRIVATE_UNLOCK(el); + } + child = el->child; while(child) { @@ -1752,7 +1768,7 @@ rbusError_t get_recursive_wildcard_handler (rbusHandle_t handle, char const *par else if (instanceName[length] == '.') { int hasInstance = 1; - el = retrieveInstanceElement(handleInfo->elementRoot, instanceName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, instanceName, true); if(el) { if(strstr(el->fullName, "{i}")) @@ -1764,7 +1780,7 @@ rbusError_t get_recursive_wildcard_handler (rbusHandle_t handle, char const *par } else { - child = retrieveInstanceElement(handleInfo->elementRoot, instanceName); + child = retrieveInstanceElementEx(handle, handleInfo->elementRoot, instanceName, true); if (!child) return RBUS_ERROR_ELEMENT_DOES_NOT_EXIST; @@ -1800,7 +1816,7 @@ static rbusError_t _get_single_dml_handler (rbusHandle_t handle, char const *par RBUSLOG_DEBUG("calling get single for [%s]", parameterName); - el = retrieveInstanceElement(handleInfo->elementRoot, parameterName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, parameterName, true); if(el != NULL) { RBUSLOG_DEBUG("Retrieved [%s]", parameterName); @@ -1952,7 +1968,7 @@ static void _get_callback_handler (rbusHandle_t handle, rbusMessage request, rbu return; } -static void _get_parameter_names_recurse(elementNode* el, int* count, rbusMessage response, int requestedDepth, int currentDepth) +static void _get_parameter_names_recurse(rbusHandle_t handle, elementNode* el, int* count, rbusMessage response, int requestedDepth, int currentDepth, bool syncTables) { int absDepth = abs(requestedDepth); @@ -2003,13 +2019,22 @@ static void _get_parameter_names_recurse(elementNode* el, int* count, rbusMessag if(currentDepth < absDepth) { - elementNode* child = el->child; + elementNode* child; + + if (syncTables && el->type == RBUS_ELEMENT_TYPE_TABLE && el->cbTable.tableSyncHandler) + { + ELM_PRIVATE_LOCK(el); + el->cbTable.tableSyncHandler(handle, el->fullName); + ELM_PRIVATE_UNLOCK(el); + } + + child = el->child; while(child) { if( !(child->type == RBUS_ELEMENT_TYPE_TABLE && child->cbTable.getHandler) && /*TODO table with get handler */ !(el->type == RBUS_ELEMENT_TYPE_TABLE && strcmp(child->name, "{i}") == 0))/*if not a table row template*/ { - _get_parameter_names_recurse(child, count, response, requestedDepth, currentDepth+1); + _get_parameter_names_recurse(handle, child, count, response, requestedDepth, currentDepth+1, syncTables); } child = child->nextSibling; } @@ -2037,7 +2062,7 @@ static void _get_parameter_names_handler (rbusHandle_t handle, rbusMessage reque rbusMessage_Init(response); - el = retrieveInstanceElement(handleInfo->elementRoot, objName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, objName, true); if (!el) { rbusMessage_SetInt32(*response, (int)RBUS_ERROR_ELEMENT_DOES_NOT_EXIST); @@ -2046,7 +2071,7 @@ static void _get_parameter_names_handler (rbusHandle_t handle, rbusMessage reque if(getRowNamesOnly) { - elementNode* child = el->child; + elementNode* child; int numRows = 0; if(el->type != RBUS_ELEMENT_TYPE_TABLE) @@ -2054,6 +2079,14 @@ static void _get_parameter_names_handler (rbusHandle_t handle, rbusMessage reque rbusMessage_SetInt32(*response, (int)RBUS_ERROR_INVALID_INPUT); return; } + else if (el->cbTable.tableSyncHandler) + { + ELM_PRIVATE_LOCK(el); + el->cbTable.tableSyncHandler(handle, el->fullName); + ELM_PRIVATE_UNLOCK(el); + } + + child = el->child; while(child) { @@ -2087,13 +2120,13 @@ static void _get_parameter_names_handler (rbusHandle_t handle, rbusMessage reque rbusMessage_SetInt32(*response, RBUS_ERROR_SUCCESS); - _get_parameter_names_recurse(el, &count, NULL, requestedDepth, 0); + _get_parameter_names_recurse(handle, el, &count, NULL, requestedDepth, 0, true); RBUSLOG_DEBUG("found %d elements", count); rbusMessage_SetInt32(*response, (int)count); - _get_parameter_names_recurse(el, NULL, *response, requestedDepth, 0); + _get_parameter_names_recurse(handle, el, NULL, *response, requestedDepth, 0, false); } #if 0 //TODO-finish else /*if table with getHandler*/ @@ -2172,7 +2205,7 @@ static void _table_add_row_callback_handler (rbusHandle_t handle, rbusMessage re RBUSLOG_DEBUG("table [%s] alias [%s] name [%s]", tableName, aliasName, handleInfo->componentName); elementNode* tableRegElem = retrieveElement(handleInfo->elementRoot, tableName); - elementNode* tableInstElem = retrieveInstanceElement(handleInfo->elementRoot, tableName); + elementNode* tableInstElem = retrieveInstanceElementEx(handle, handleInfo->elementRoot, tableName, true); if(tableRegElem && tableInstElem) { @@ -2224,7 +2257,7 @@ static void _table_remove_row_callback_handler (rbusHandle_t handle, rbusMessage /*get the element for the row */ elementNode* rowRegElem = retrieveElement(handleInfo->elementRoot, rowName); - elementNode* rowInstElem = retrieveInstanceElement(handleInfo->elementRoot, rowName); + elementNode* rowInstElem = retrieveInstanceElementEx(handle, handleInfo->elementRoot, rowName, true); if(rowRegElem && rowInstElem) { @@ -2304,7 +2337,7 @@ static int _method_callback_handler(rbusHandle_t handle, rbusMessage request, rb rbusObject_Init(&outParams, NULL); /*get the element for the row */ elementNode* methRegElem = retrieveElement(handleInfo->elementRoot, methodName); - elementNode* methInstElem = retrieveInstanceElement(handleInfo->elementRoot, methodName); + elementNode* methInstElem = retrieveInstanceElementEx(handle, handleInfo->elementRoot, methodName, true); if(methRegElem && methInstElem) { @@ -2431,7 +2464,7 @@ static void _subscribe_callback_handler (rbusHandle_t handle, rbusMessage reques RBUSLOG_ERROR("payload missing in subscribe request for event %s from %s", event_name, sender); } - el = retrieveInstanceElement(handleInfo->elementRoot, event_name); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, event_name, true); if (!el) { @@ -2578,7 +2611,7 @@ static void _create_direct_connection_callback_handler (rbusHandle_t handle, rbu rbusMessage_Init(response); - el = retrieveInstanceElement(handleInfo->elementRoot, paramName); + el = retrieveInstanceElementEx(handle, handleInfo->elementRoot, paramName, true); if (el) { diff --git a/src/rbus/rbus_element.c b/src/rbus/rbus_element.c index a404c03c..ef23c217 100644 --- a/src/rbus/rbus_element.c +++ b/src/rbus/rbus_element.c @@ -236,7 +236,7 @@ elementNode* insertElement(elementNode* root, rbusDataElement_t* elem) if(!mutex_init) { ERROR_CHECK(pthread_mutexattr_init(&attrib)); - ERROR_CHECK(pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_ERRORCHECK)); + ERROR_CHECK(pthread_mutexattr_settype(&attrib, PTHREAD_MUTEX_RECURSIVE)); ERROR_CHECK(pthread_mutex_init(&element_mutex, &attrib)); mutex_init = 1; } @@ -472,6 +472,11 @@ elementNode* retrieveElement(elementNode* root, const char* elmentName) } elementNode* retrieveInstanceElement(elementNode* root, const char* elmentName) +{ + return retrieveInstanceElementEx(NULL, root, elmentName, false); +} + +elementNode* retrieveInstanceElementEx(rbusHandle_t handle, elementNode* root, const char* elmentName, bool syncTables) { char* token = NULL; char* name = NULL; @@ -510,8 +515,6 @@ elementNode* retrieveInstanceElement(elementNode* root, const char* elmentName) { RBUSLOG_DEBUG("tokenFound!"); tokenFound = 1; - currentNode = nextNode; - nextNode = currentNode->child; } else { @@ -525,8 +528,6 @@ elementNode* retrieveInstanceElement(elementNode* root, const char* elmentName) { RBUSLOG_DEBUG("tokenFound!"); tokenFound = 1; - currentNode = nextNode; - nextNode = currentNode->child; break; } else @@ -543,8 +544,6 @@ elementNode* retrieveInstanceElement(elementNode* root, const char* elmentName) { RBUSLOG_DEBUG("tokenFound by alias %s!", nextNode->alias); tokenFound = 1; - currentNode = nextNode; - nextNode = currentNode->child; break; } } @@ -559,6 +558,18 @@ elementNode* retrieveInstanceElement(elementNode* root, const char* elmentName) token = strtok_r(NULL, ".", &saveptr); + if (tokenFound) + { + if (token && nextNode->type == RBUS_ELEMENT_TYPE_TABLE && (syncTables && nextNode->cbTable.tableSyncHandler)) + { + ELM_PRIVATE_LOCK(nextNode); + nextNode->cbTable.tableSyncHandler(handle, nextNode->fullName); + ELM_PRIVATE_LOCK(nextNode); + } + currentNode = nextNode; + nextNode = currentNode->child; + } + if(token && nextNode && nextNode->parent && nextNode->parent->type == RBUS_ELEMENT_TYPE_TABLE) { if(!isWildcard && !strcmp(token,"*")) diff --git a/src/rbus/rbus_element.h b/src/rbus/rbus_element.h index ce8b3834..207d2865 100644 --- a/src/rbus/rbus_element.h +++ b/src/rbus/rbus_element.h @@ -82,6 +82,7 @@ elementNode* insertElement(elementNode* root, rbusDataElement_t* elem); void removeElement(elementNode* element); elementNode* retrieveElement(elementNode* root, const char* name); elementNode* retrieveInstanceElement(elementNode* root, const char* name); +elementNode* retrieveInstanceElementEx(rbusHandle_t handle, elementNode* root, const char* name, bool syncTables); void printRegisteredElements(elementNode* root, int level); void fprintRegisteredElements(FILE* f, elementNode* root, int level); void addElementSubscription(elementNode* node, rbusSubscription_t* sub, bool checkIfExists); diff --git a/test/rbus/common/runningParamHelper.c b/test/rbus/common/runningParamHelper.c index 025074b0..76476b8b 100644 --- a/test/rbus/common/runningParamHelper.c +++ b/test/rbus/common/runningParamHelper.c @@ -80,7 +80,7 @@ rbusError_t runningParamProvider_Init(rbusHandle_t handle, char* paramName) strncpy(gParamName, paramName, MAXPATH); - rbusDataElement_t dataElement = { paramName, RBUS_ELEMENT_TYPE_PROPERTY, {getRunningParamHandler, setRunningParamHandler, NULL, NULL, NULL, NULL}}; + rbusDataElement_t dataElement = { paramName, RBUS_ELEMENT_TYPE_PROPERTY, {getRunningParamHandler, setRunningParamHandler, NULL, NULL, NULL, NULL, NULL}}; rc = rbus_regDataElements(handle, 1, &dataElement); if(rc == RBUS_ERROR_SUCCESS) diff --git a/test/rbus/consumer/elementTree.c b/test/rbus/consumer/elementTree.c index ca4a5343..76f49665 100644 --- a/test/rbus/consumer/elementTree.c +++ b/test/rbus/consumer/elementTree.c @@ -73,7 +73,7 @@ void insertElem(elementNode* root, char* path, rbusElementType_t type) void insertElemWithGetter(elementNode* root, char* path, rbusElementType_t type) { - rbusDataElement_t elem = {path, type, {(rbusGetHandler_t)!NULL, NULL, NULL, NULL, NULL, NULL}}; + rbusDataElement_t elem = {path, type, {(rbusGetHandler_t)!NULL, NULL, NULL, NULL, NULL, NULL, NULL}}; insertElement(root, &elem); } diff --git a/test/rbus/multiProviderThreadsForSingleEvent/multiProviderThreadsForSingleEvent.c b/test/rbus/multiProviderThreadsForSingleEvent/multiProviderThreadsForSingleEvent.c index c55369bd..53639cda 100644 --- a/test/rbus/multiProviderThreadsForSingleEvent/multiProviderThreadsForSingleEvent.c +++ b/test/rbus/multiProviderThreadsForSingleEvent/multiProviderThreadsForSingleEvent.c @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) char eventData[] = "ThreadTest"; rbusDataElement_t dataElements[4] = { - {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL}}, + {"Device.Provider1.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}, }; printf("provider: start\n"); diff --git a/test/rbus/multiRbusOpenMethodProvider/multiRbusOpenMethodProvider.c b/test/rbus/multiRbusOpenMethodProvider/multiRbusOpenMethodProvider.c index 24a77597..6ac66c95 100644 --- a/test/rbus/multiRbusOpenMethodProvider/multiRbusOpenMethodProvider.c +++ b/test/rbus/multiRbusOpenMethodProvider/multiRbusOpenMethodProvider.c @@ -144,9 +144,9 @@ int main(int argc, char *argv[]) char componentName[] = "multiRbusOpenMethodProvider"; rbusDataElement_t dataElements[3] = { - {"Device.Methods.SimpleMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.Methods.SimpleMethod1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.Methods.AsyncMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}} + {"Device.Methods.SimpleMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.Methods.SimpleMethod1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.Methods.AsyncMethod()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}} }; printf("multiRbusOpenMethodProvider: start\n"); diff --git a/test/rbus/multiRbusOpenProvider/multiRbusOpenProvider.c b/test/rbus/multiRbusOpenProvider/multiRbusOpenProvider.c index 0b6c51db..b1e735c8 100644 --- a/test/rbus/multiRbusOpenProvider/multiRbusOpenProvider.c +++ b/test/rbus/multiRbusOpenProvider/multiRbusOpenProvider.c @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) char componentName[] = "multiRbusOpenProvider"; - rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL}}}; + rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}}; printf("provider: start\n"); rc1 = rbus_open(&handle1, componentName); diff --git a/test/rbus/multiRbusOpenProvider/rbusOpenRegRbusOpenProvider.c b/test/rbus/multiRbusOpenProvider/rbusOpenRegRbusOpenProvider.c index 66dfed14..e2e69666 100644 --- a/test/rbus/multiRbusOpenProvider/rbusOpenRegRbusOpenProvider.c +++ b/test/rbus/multiRbusOpenProvider/rbusOpenRegRbusOpenProvider.c @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) char componentName[] = "RbusOpenRegRbusOpenProvider"; - rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL}}}; + rbusDataElement_t dataElements[1] = {{"Device.Provider1.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {getHandler, NULL, NULL, NULL, eventSubHandler, NULL, NULL}}}; printf("provider: start\n"); diff --git a/test/rbus/multiRbusOpenRbusGetProvider/multiRbusOpenRbusGetProvider.c b/test/rbus/multiRbusOpenRbusGetProvider/multiRbusOpenRbusGetProvider.c index c3f7ef85..4e513e70 100644 --- a/test/rbus/multiRbusOpenRbusGetProvider/multiRbusOpenRbusGetProvider.c +++ b/test/rbus/multiRbusOpenRbusGetProvider/multiRbusOpenRbusGetProvider.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) char componentName[] = "multiRbusOpenRbusGetProvider"; - rbusDataElement_t dataElements = {"Device.multiRbusOpenGetTestProvider.Value.RBUS_INT32", RBUS_ELEMENT_TYPE_PROPERTY, {multiRbusProvider_SampleDataGetHandler, multiRbusProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL}}; + rbusDataElement_t dataElements = {"Device.multiRbusOpenGetTestProvider.Value.RBUS_INT32", RBUS_ELEMENT_TYPE_PROPERTY, {multiRbusProvider_SampleDataGetHandler, multiRbusProvider_SampleDataSetHandler, NULL, NULL, NULL, NULL, NULL}}; printf("provider: start\n"); diff --git a/test/rbus/provider/rbusTestMultiProvider.c b/test/rbus/provider/rbusTestMultiProvider.c index bf448c31..e0305dbf 100644 --- a/test/rbus/provider/rbusTestMultiProvider.c +++ b/test/rbus/provider/rbusTestMultiProvider.c @@ -202,9 +202,9 @@ void* run_provider(void* p) char hashName[64]; char defaultValue[64]; rbusDataElement_t dataElements[3] = { - {elemName[0], RBUS_ELEMENT_TYPE_PROPERTY, {getHandler,setHandler,NULL,NULL,NULL,NULL}}, - {elemName[1], RBUS_ELEMENT_TYPE_PROPERTY, {getHandler,setHandler,NULL,NULL,NULL,NULL}}, - {elemName[2], RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL,eventSubHandler,NULL}} + {elemName[0], RBUS_ELEMENT_TYPE_PROPERTY, {getHandler,setHandler,NULL,NULL,NULL,NULL,NULL}}, + {elemName[1], RBUS_ELEMENT_TYPE_PROPERTY, {getHandler,setHandler,NULL,NULL,NULL,NULL,NULL}}, + {elemName[2], RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL,eventSubHandler,NULL,NULL}} }; int usecWait = 0; static int sLastIndex = 0; diff --git a/test/rbus/provider/rbusTestProvider.c b/test/rbus/provider/rbusTestProvider.c index a0c43c27..be315607 100644 --- a/test/rbus/provider/rbusTestProvider.c +++ b/test/rbus/provider/rbusTestProvider.c @@ -1465,67 +1465,67 @@ int main(int argc, char *argv[]) #define numDataElems 58 rbusDataElement_t dataElement[numDataElems] = { - {"Device.%s.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventSubHandler, NULL}}, - {"Device.%s.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventSubHandler, NULL}}, - {"Device.%s.ErrorSubHandlerEvent!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, provideErrorSubHandler, NULL}}, + {"Device.%s.Event1!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventSubHandler, NULL, NULL}}, + {"Device.%s.Event2!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventSubHandler, NULL, NULL}}, + {"Device.%s.ErrorSubHandlerEvent!", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, provideErrorSubHandler, NULL, NULL}}, /*testing value-change filter for Int32 and Strings only, for now*/ - {"Device.%s.VCParam", RBUS_ELEMENT_TYPE_PROPERTY, {getVCHandler,NULL,NULL,NULL, subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt0", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt1", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt2", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt3", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt4", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamInt5", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr0", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr1", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr2", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr3", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr4", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamStr5", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.VCParamBy", RBUS_ELEMENT_TYPE_PROPERTY, {getVCByHandler,setVCByHandler,NULL,NULL,subAutoPubIntHandler, NULL}}, - {"Device.%s.NoAutoPubInt", RBUS_ELEMENT_TYPE_PROPERTY, {NULL,NULL,NULL,NULL,subNoAutoPubIntHandler, NULL}}, - {"Device.%s.Table1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL}}, - {"Device.%s.Table1.{i}.Table2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL}}, - {"Device.%s.Table1.{i}.Table2.{i}.Table3.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL}}, - {"Device.%s.Table1.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL}}, - {"Device.%s.Table1.{i}.Table2.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL}}, - {"Device.%s.Table1.{i}.Table2.{i}.Table3.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL}}, - {"Device.%s.TableReg.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableRegAddRowHandler, tableRegRemoveRowHandler, tableRegSubHandler, NULL}}, - {"Device.%s.TableReg.{i}.TableReg.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableRegAddRowHandler, tableRegRemoveRowHandler, tableRegSubHandler, NULL}}, - {"Device.%s.ResetTables", RBUS_ELEMENT_TYPE_PROPERTY, {NULL, resetTablesSetHandler, NULL, NULL, NULL, NULL}}, - {"Device.%s.Method11()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.Method3()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.Table1.{i}.Method1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.Table1.{i}.Table2.{i}.Method2()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.MethodAsync1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.Table1.{i}.MethodAsync2()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, - {"Device.%s.MethodAsync3()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler}}, + {"Device.%s.VCParam", RBUS_ELEMENT_TYPE_PROPERTY, {getVCHandler,NULL,NULL,NULL, subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt0", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt1", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt2", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt3", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt4", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamInt5", RBUS_ELEMENT_TYPE_PROPERTY, {getVCIntHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr0", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr1", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr2", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr3", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr4", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamStr5", RBUS_ELEMENT_TYPE_PROPERTY, {getVCStrHandler,NULL,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.VCParamBy", RBUS_ELEMENT_TYPE_PROPERTY, {getVCByHandler,setVCByHandler,NULL,NULL,subAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.NoAutoPubInt", RBUS_ELEMENT_TYPE_PROPERTY, {NULL,NULL,NULL,NULL,subNoAutoPubIntHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.Table2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.Table2.{i}.Table3.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableAddRowHandler, tableRemoveRowHandler, eventSubHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.Table2.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.%s.Table1.{i}.Table2.{i}.Table3.{i}.data", RBUS_ELEMENT_TYPE_PROPERTY, {dataGetHandler, dataSetHandler, NULL, NULL, eventSubHandler, NULL, NULL}}, + {"Device.%s.TableReg.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableRegAddRowHandler, tableRegRemoveRowHandler, tableRegSubHandler, NULL, NULL}}, + {"Device.%s.TableReg.{i}.TableReg.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, tableRegAddRowHandler, tableRegRemoveRowHandler, tableRegSubHandler, NULL, NULL}}, + {"Device.%s.ResetTables", RBUS_ELEMENT_TYPE_PROPERTY, {NULL, resetTablesSetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.Method11()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.Method3()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.Table1.{i}.Method1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.Table1.{i}.Table2.{i}.Method2()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.MethodAsync1()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.Table1.{i}.MethodAsync2()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, + {"Device.%s.MethodAsync3()", RBUS_ELEMENT_TYPE_METHOD, {NULL, NULL, NULL, NULL, NULL, methodHandler, NULL}}, /*Device.%s.PartialPath1 will have row instances added via rbusTable_registerRow*/ - {"Device.%s.PartialPath1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubObject1.Param3", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubObject1.Param4", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubTable.{i}.Param5", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubTable.{i}.SubObject2.Param6", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath1.{i}.SubTable.{i}.SubObject2.Param7", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubObject1.Param3", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubObject1.Param4", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubTable.{i}.Param5", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubTable.{i}.SubObject2.Param6", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath1.{i}.SubTable.{i}.SubObject2.Param7", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, /*Device.%s.PartialPath2 will not add rows with rbusTable_registerRow but will use table level getHandler execute partial path query*/ - {"Device.%s.PartialPath2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {ppTableGetHandler, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubObject1.Param3", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubObject1.Param4", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {ppTableGetHandler, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubTable.{i}.Param5", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubTable.{i}.SubObject2.Param6", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.PartialPath2.{i}.SubTable.{i}.SubObject2.Param7", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL}}, - {"Device.%s.TestProviderNotFound", RBUS_ELEMENT_TYPE_PROPERTY, {NULL,setProviderNotFound,NULL,NULL,NULL, NULL}}, - {"Device.%s.BigString", RBUS_ELEMENT_TYPE_PROPERTY, {getBigHandler,setBigHandler,NULL,NULL,NULL, NULL}}, - {"Device.%s.BigBytes", RBUS_ELEMENT_TYPE_PROPERTY, {getBigHandler,setBigHandler,NULL,NULL,NULL, NULL}}, - {"Device.%s.EventsTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, eventsTablesAddRowHandler, eventsTablesRemRowHandler, NULL, NULL}}, - {"Device.%s.EventsTable.{i}.Prop", RBUS_ELEMENT_TYPE_PROPERTY, {eventsTablesPropGetHandler, NULL, NULL, NULL, eventsTablesEventSubHandler, NULL}}, - {"Device.%s.EventsTable.{i}.Event", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventsTablesEventSubHandler, NULL}} + {"Device.%s.PartialPath2.{i}.", RBUS_ELEMENT_TYPE_TABLE, {ppTableGetHandler, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.Param1", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.Param2", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubObject1.Param3", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubObject1.Param4", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {ppTableGetHandler, NULL, ppTableAddRowHandler, ppTableRemRowHandler, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubTable.{i}.Param5", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubTable.{i}.SubObject2.Param6", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.PartialPath2.{i}.SubTable.{i}.SubObject2.Param7", RBUS_ELEMENT_TYPE_PROPERTY, {ppParamGetHandler, NULL, NULL, NULL, NULL, NULL, NULL}}, + {"Device.%s.TestProviderNotFound", RBUS_ELEMENT_TYPE_PROPERTY, {NULL,setProviderNotFound,NULL,NULL,NULL, NULL, NULL}}, + {"Device.%s.BigString", RBUS_ELEMENT_TYPE_PROPERTY, {getBigHandler,setBigHandler,NULL,NULL,NULL, NULL, NULL}}, + {"Device.%s.BigBytes", RBUS_ELEMENT_TYPE_PROPERTY, {getBigHandler,setBigHandler,NULL,NULL,NULL, NULL, NULL}}, + {"Device.%s.EventsTable.{i}.", RBUS_ELEMENT_TYPE_TABLE, {NULL, NULL, eventsTablesAddRowHandler, eventsTablesRemRowHandler, NULL, NULL, NULL}}, + {"Device.%s.EventsTable.{i}.Prop", RBUS_ELEMENT_TYPE_PROPERTY, {eventsTablesPropGetHandler, NULL, NULL, NULL, eventsTablesEventSubHandler, NULL, NULL}}, + {"Device.%s.EventsTable.{i}.Event", RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, eventsTablesEventSubHandler, NULL, NULL}} }; for(i=0; iname) { - rbusDataElement_t el = { data->name, RBUS_ELEMENT_TYPE_PROPERTY, {getValueHandler,setValueHandler,NULL,NULL,NULL,NULL}}; + rbusDataElement_t el = { data->name, RBUS_ELEMENT_TYPE_PROPERTY, {getValueHandler,setValueHandler,NULL,NULL,NULL,NULL,NULL}}; rc = rbus_regDataElements(handle, 1, &el); printf("provider: rbus_regDataElements=%d\n", rc); if(rc != RBUS_ERROR_SUCCESS) @@ -1663,7 +1663,7 @@ int main(int argc, char *argv[]) if(providerNotFoundTest++ == 20)/*20 seconds after we are told to run this test -- register the data element to let them know provider ready*/ { rbusDataElement_t el = { - getName("Device.%s.ProviderNotFoundEvent1!"), RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, provideNotFoundSubHandler, NULL} + getName("Device.%s.ProviderNotFoundEvent1!"), RBUS_ELEMENT_TYPE_EVENT, {NULL,NULL,NULL,NULL, provideNotFoundSubHandler, NULL, NULL} }; rc = rbus_regDataElements(handle, 1, &el); }