From e7aa4e5092d0734d0a666442f78bbb59e7698fc6 Mon Sep 17 00:00:00 2001 From: pradeeptakdas <37864641+pradeeptakdas@users.noreply.github.com> Date: Wed, 23 Oct 2024 06:06:01 -0400 Subject: [PATCH] RDKBDEV-2828: A DOS line ending is \r\n. A Unix line ending is \n. (#224) Reason for change: The sequence \n\r is not a valid line ending on either system. Test Procedure: Sanity. Risks: None. Signed-off-by: Andre McCurdy Co-authored-by: Andre McCurdy Co-authored-by: Karunakaran A <48997923+karuna2git@users.noreply.github.com> --- sampleapps/consumer/rbusRawDataConsumer.c | 14 +- sampleapps/consumer/rbusSampleConsumer.c | 2 +- src/rbus/rbus_object.c | 2 +- src/rbus/rbus_property.c | 4 +- unittests/util.cpp | 2 +- utils/rbuscli/rbuscli.c | 986 +++++++++++----------- 6 files changed, 505 insertions(+), 505 deletions(-) diff --git a/sampleapps/consumer/rbusRawDataConsumer.c b/sampleapps/consumer/rbusRawDataConsumer.c index a03f1270..49f45f3f 100644 --- a/sampleapps/consumer/rbusRawDataConsumer.c +++ b/sampleapps/consumer/rbusRawDataConsumer.c @@ -37,11 +37,11 @@ static void generalEvent1Handler( { (void)handle; (void)subscription; - printf("\nevent_receive_handler1 called\n\r"); - printf("Event received %s\n\r", event->name); - printf("Event data: %s\n\r", (char*)event->rawData); - printf("Event data len: %d\n\r", event->rawDataLen); - printf("\n\r"); + printf("\nevent_receive_handler1 called\r\n"); + printf("Event received %s\r\n", event->name); + printf("Event data: %s\r\n", (char*)event->rawData); + printf("Event data len: %d\r\n", event->rawDataLen); + printf("\r\n"); } int main(int argc, char *argv[]) @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) rc = rbus_openDirect(handle, &directHandle, "Device.Provider1.Event1!"); if (RBUS_ERROR_SUCCESS != rc) { - printf ("Failed to open direct connection to %s\n\r", "Device.Provider1.Event1!"); + printf ("Failed to open direct connection to %s\r\n", "Device.Provider1.Event1!"); } else { @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) rc = rbus_closeDirect(directHandle); if (RBUS_ERROR_SUCCESS != rc) { - printf ("Failed to close direct connection to %s\n\r", "Device.Provider1.Event1!"); + printf ("Failed to close direct connection to %s\r\n", "Device.Provider1.Event1!"); } } rbusEvent_UnsubscribeExRawData(handle, subscriptions, 1); diff --git a/sampleapps/consumer/rbusSampleConsumer.c b/sampleapps/consumer/rbusSampleConsumer.c index 18ef4beb..67869c43 100644 --- a/sampleapps/consumer/rbusSampleConsumer.c +++ b/sampleapps/consumer/rbusSampleConsumer.c @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) else { rbusProperty_t next = outputVals; - printf ("List of params\n\r"); + printf ("List of params\r\n"); for (int i = 0; i < numOfOutVals; i++) { rbusValue_t val = rbusProperty_GetValue(next); diff --git a/src/rbus/rbus_object.c b/src/rbus/rbus_object.c index d4deed89..bbd2a373 100644 --- a/src/rbus/rbus_object.c +++ b/src/rbus/rbus_object.c @@ -448,7 +448,7 @@ void rbusObject_fwrite(rbusObject_t obj, int depth, FILE* fout) VERIFY_NULL(fout); for(i=0; i, >=, <, <=, =, !=)\n\r", "operator"); - printf ("\t%-20sOptional filter trigger value\n\r", "value"); - printf ("\t%-20sTo get initial value of the event being subscribed\n\r", "initialValue"); - printf ("Examples:\n\r"); - printf ("\tsub Example.SomeEvent!\n\r"); - printf ("\tsub Example.SomeTable.\n\r"); - printf ("\tsub Example.SomeIntProp > 10\n\r"); - printf ("\tsub Example.SomeStrProp = \"Hello\"\n\r"); - printf ("\tsub Example.SomeEvent! true\n\r"); - printf ("\tsub Example.SomeEvent! = \"data\" true\n\r"); - printf ("\n\r"); + printf ("\e[1msub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m \e[4minitialValue\e[0m]\r\n"); + printf ("Subscribe to a single event.\r\n"); + printf ("Rbus supports general events, value-change events, and table events.\r\n"); + printf ("And the type depends on that type of element \e[4mevent\e[0m refers to.\r\n"); + printf ("If the type is a parameter then it is value-change event.\r\n"); + printf ("If the type is a table then it is table events.\r\n"); + printf ("If the type is a event then it is a general event.\r\n"); + printf ("For value-change, an optional filter can be applied using the \e[4moperator\e[0m \e[4mvalue\e[0m parameters.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to subscribe to\r\n", "event"); + printf ("\t%-20sOptional filter relational operator. Supported operators (>, >=, <, <=, =, !=)\r\n", "operator"); + printf ("\t%-20sOptional filter trigger value\r\n", "value"); + printf ("\t%-20sTo get initial value of the event being subscribed\r\n", "initialValue"); + printf ("Examples:\r\n"); + printf ("\tsub Example.SomeEvent!\r\n"); + printf ("\tsub Example.SomeTable.\r\n"); + printf ("\tsub Example.SomeIntProp > 10\r\n"); + printf ("\tsub Example.SomeStrProp = \"Hello\"\r\n"); + printf ("\tsub Example.SomeEvent! true\r\n"); + printf ("\tsub Example.SomeEvent! = \"data\" true\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 4, "subinterval")) { - printf ("\e[1msubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] \e[4minitialValue\e[0m]\n\r"); - printf ("Subscribe to an event with interval\n\r"); - printf ("For interval, can be applied using the \e[4minterval\e[0m parameter.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to subscribe to\n\r", "event"); - printf ("\t%-20sThe interval trigger value\n\r", "interval"); - printf ("\t%-20sOptional duration trigger value\n\r", "duration"); - printf ("\t%-20sOptional to get initial value of the event being subscribed\n\r", "initialValue"); - printf ("Example:\n\r"); - printf ("\tsubint Example.SomeIntProp 10\n\r"); - printf ("\tsubint Example.SomeIntProp 10 60\n\r"); - printf ("\tsubint Example.SomeIntProp 5 true\n\r"); - printf ("\tsubint Example.SomeIntProp 5 20 true\n\r"); - printf ("\n\r"); + printf ("\e[1msubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] \e[4minitialValue\e[0m]\r\n"); + printf ("Subscribe to an event with interval\r\n"); + printf ("For interval, can be applied using the \e[4minterval\e[0m parameter.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to subscribe to\r\n", "event"); + printf ("\t%-20sThe interval trigger value\r\n", "interval"); + printf ("\t%-20sOptional duration trigger value\r\n", "duration"); + printf ("\t%-20sOptional to get initial value of the event being subscribed\r\n", "initialValue"); + printf ("Example:\r\n"); + printf ("\tsubint Example.SomeIntProp 10\r\n"); + printf ("\tsubint Example.SomeIntProp 10 60\r\n"); + printf ("\tsubint Example.SomeIntProp 5 true\r\n"); + printf ("\tsubint Example.SomeIntProp 5 20 true\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 5, "unsubscribe")) { - printf ("\e[1munsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\n\r"); - printf ("Unsubscribe from a single event.\n\r"); - printf ("If a value-change filter was used to subscribe then the same filter must be passed to unsubscribe.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to unsubscribe from\n\r", "event"); - printf ("\t%-20sOptional operator that was used when subscribing to this event. Supported operators (>, >=, <, <=, =, !=)\n\r", "operator"); - printf ("\t%-20sOptional value that was used when subscribing to this event.\n\r", "value"); - printf ("Examples:\n\r"); - printf ("\tunsub Example.SomeEvent!\n\r"); - printf ("\tunsub Example.SomeTable.\n\r"); - printf ("\tunsub Example.SomeIntProp > 10\n\r"); - printf ("\tunsub Example.SomeStrProp = \"Hello\"\n\r"); - printf ("\n\r"); + printf ("\e[1munsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\r\n"); + printf ("Unsubscribe from a single event.\r\n"); + printf ("If a value-change filter was used to subscribe then the same filter must be passed to unsubscribe.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to unsubscribe from\r\n", "event"); + printf ("\t%-20sOptional operator that was used when subscribing to this event. Supported operators (>, >=, <, <=, =, !=)\r\n", "operator"); + printf ("\t%-20sOptional value that was used when subscribing to this event.\r\n", "value"); + printf ("Examples:\r\n"); + printf ("\tunsub Example.SomeEvent!\r\n"); + printf ("\tunsub Example.SomeTable.\r\n"); + printf ("\tunsub Example.SomeIntProp > 10\r\n"); + printf ("\tunsub Example.SomeStrProp = \"Hello\"\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 11, "rawdataunsubscribe")) { - printf ("\e[1mrawdataunsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\n\r"); - printf ("Unsubscribe from a single event.\n\r"); - printf ("If a value-change filter was used to subscribe then the same filter must be passed to rawdataunsubscribe.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to rawdataunsubscribe from\n\r", "event"); - printf ("\t%-20sOptional operator that was used when subscribing to this event. Supported operators (>, >=, <, <=, =, !=)\n\r", "operator"); - printf ("\t%-20sOptional value that was used when subscribing to this event.\n\r", "value"); - printf ("Examples:\n\r"); - printf ("\trawdataunsub Example.SomeEvent!\n\r"); - printf ("\n\r"); + printf ("\e[1mrawdataunsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\r\n"); + printf ("Unsubscribe from a single event.\r\n"); + printf ("If a value-change filter was used to subscribe then the same filter must be passed to rawdataunsubscribe.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to rawdataunsubscribe from\r\n", "event"); + printf ("\t%-20sOptional operator that was used when subscribing to this event. Supported operators (>, >=, <, <=, =, !=)\r\n", "operator"); + printf ("\t%-20sOptional value that was used when subscribing to this event.\r\n", "value"); + printf ("Examples:\r\n"); + printf ("\trawdataunsub Example.SomeEvent!\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 6, "unsubinterval")) { - printf ("\e[1munsubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m]\n\r"); - printf ("Unsubscribe from a single event\n\r"); - printf ("If interval, duration are used to subscribe then the same interval, duration must be passed to unsubscribe.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to unsubscribe from\n\r", "event"); - printf ("\t%-20sThe interval that was used when subscribing to this event.\n\r", "interval"); - printf ("\t%-20sOptional duration that was used when subscribing to this event.\n\r", "duration"); - printf ("Example:\n\r"); - printf ("\tunsubint Example.SomeIntProp 10\n\r"); - printf ("\tunsubint Example.SomeIntProp 10 60\n\r"); - printf ("\n\r"); + printf ("\e[1munsubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m]\r\n"); + printf ("Unsubscribe from a single event\r\n"); + printf ("If interval, duration are used to subscribe then the same interval, duration must be passed to unsubscribe.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to unsubscribe from\r\n", "event"); + printf ("\t%-20sThe interval that was used when subscribing to this event.\r\n", "interval"); + printf ("\t%-20sOptional duration that was used when subscribing to this event.\r\n", "duration"); + printf ("Example:\r\n"); + printf ("\tunsubint Example.SomeIntProp 10\r\n"); + printf ("\tunsubint Example.SomeIntProp 10 60\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 4, "asubscribe")) { - printf ("\e[1masub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\n\r"); - printf ("Asynchronously subscribe to a single event.\n\r"); - printf ("Rbus supports general events, value-change events, and table events.\n\r"); - printf ("And the type depends on that type of element \e[4mevent\e[0m refers to.\n\r"); - printf ("If the type is a parameter then it is value-change event.\n\r"); - printf ("If the type is a table then it is table events.\n\r"); - printf ("If the type is a event then it is a general event.\n\r"); - printf ("For value-change, an optional filter can be applied using the \e[4moperator\e[0m \e[4mvalue\e[0m parameters.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to subscribe to\n\r", "event"); - printf ("\t%-20sOptional filter relational operator. Supported operators (>, >=, <, <=, =, !=)\n\r", "operator"); - printf ("\t%-20sOptional filter trigger value\n\r", "value"); - printf ("Examples:\n\r"); - printf ("\tasub Example.SomeEvent!\n\r"); - printf ("\tasub Example.SomeTable.\n\r"); - printf ("\tasub Example.SomeIntProp > 10\n\r"); - printf ("\tasub Example.SomeStrProp = \"Hello\"\n\r"); - printf ("\n\r"); + printf ("\e[1masub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\r\n"); + printf ("Asynchronously subscribe to a single event.\r\n"); + printf ("Rbus supports general events, value-change events, and table events.\r\n"); + printf ("And the type depends on that type of element \e[4mevent\e[0m refers to.\r\n"); + printf ("If the type is a parameter then it is value-change event.\r\n"); + printf ("If the type is a table then it is table events.\r\n"); + printf ("If the type is a event then it is a general event.\r\n"); + printf ("For value-change, an optional filter can be applied using the \e[4moperator\e[0m \e[4mvalue\e[0m parameters.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to subscribe to\r\n", "event"); + printf ("\t%-20sOptional filter relational operator. Supported operators (>, >=, <, <=, =, !=)\r\n", "operator"); + printf ("\t%-20sOptional filter trigger value\r\n", "value"); + printf ("Examples:\r\n"); + printf ("\tasub Example.SomeEvent!\r\n"); + printf ("\tasub Example.SomeTable.\r\n"); + printf ("\tasub Example.SomeIntProp > 10\r\n"); + printf ("\tasub Example.SomeStrProp = \"Hello\"\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 3, "rawdatasubscribe")) { - printf ("\e[1mrawdatasub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m \e[4minitialValue\e[0m]\n\r"); - printf ("Subscribe to a single event.\n\r"); - printf ("Rbus supports general events, value-change events, and table events.\n\r"); - printf ("And the type depends on that type of element \e[4mevent\e[0m refers to.\n\r"); - printf ("If the type is a parameter then it is value-change event.\n\r"); - printf ("If the type is a table then it is table events.\n\r"); - printf ("If the type is a event then it is a general event.\n\r"); - printf ("For value-change, an optional filter can be applied using the \e[4moperator\e[0m \e[4mvalue\e[0m parameters.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to subscribe to\n\r", "event"); - printf ("\t%-20sOptional filter relational operator. Supported operators (>, >=, <, <=, =, !=)\n\r", "operator"); - printf ("\t%-20sOptional filter trigger value\n\r", "value"); - printf ("\t%-20sTo get initial value of the event being subscribed\n\r", "initialValue"); - printf ("Examples:\n\r"); - printf ("\tsub Example.SomeEvent!\n\r"); - printf ("\tsub Example.SomeTable.\n\r"); - printf ("\tsub Example.SomeIntProp > 10\n\r"); - printf ("\tsub Example.SomeStrProp = \"Hello\"\n\r"); - printf ("\tsub Example.SomeEvent! true\n\r"); - printf ("\tsub Example.SomeEvent! = \"data\" true\n\r"); - printf ("\n\r"); + printf ("\e[1mrawdatasub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m \e[4minitialValue\e[0m]\r\n"); + printf ("Subscribe to a single event.\r\n"); + printf ("Rbus supports general events, value-change events, and table events.\r\n"); + printf ("And the type depends on that type of element \e[4mevent\e[0m refers to.\r\n"); + printf ("If the type is a parameter then it is value-change event.\r\n"); + printf ("If the type is a table then it is table events.\r\n"); + printf ("If the type is a event then it is a general event.\r\n"); + printf ("For value-change, an optional filter can be applied using the \e[4moperator\e[0m \e[4mvalue\e[0m parameters.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to subscribe to\r\n", "event"); + printf ("\t%-20sOptional filter relational operator. Supported operators (>, >=, <, <=, =, !=)\r\n", "operator"); + printf ("\t%-20sOptional filter trigger value\r\n", "value"); + printf ("\t%-20sTo get initial value of the event being subscribed\r\n", "initialValue"); + printf ("Examples:\r\n"); + printf ("\tsub Example.SomeEvent!\r\n"); + printf ("\tsub Example.SomeTable.\r\n"); + printf ("\tsub Example.SomeIntProp > 10\r\n"); + printf ("\tsub Example.SomeStrProp = \"Hello\"\r\n"); + printf ("\tsub Example.SomeEvent! true\r\n"); + printf ("\tsub Example.SomeEvent! = \"data\" true\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 3, "publish")) { - printf ("\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\n\r"); - printf ("Publishes an event which will be sent to all subscribers of this event.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to publish\n\r", "event"); - printf ("\t%-20sThe data to publish with the event (as a string)\n\r", "data"); - printf ("Examples:\n\r"); - printf ("\tpub Example.MyEvent! \"Hello World\"\n\r"); - printf ("\n\r"); + printf ("\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\r\n"); + printf ("Publishes an event which will be sent to all subscribers of this event.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to publish\r\n", "event"); + printf ("\t%-20sThe data to publish with the event (as a string)\r\n", "data"); + printf ("Examples:\r\n"); + printf ("\tpub Example.MyEvent! \"Hello World\"\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 3, "rawdatapublish")) { - printf ("\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\n\r"); - printf ("Publishes an event which will be sent to all subscribers of this event.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of the event to publish\n\r", "event"); - printf ("\t%-20sThe data to publish with the event (as a string)\n\r", "data"); - printf ("Examples:\n\r"); - printf ("\tpub Example.MyEvent! \"Hello World\"\n\r"); - printf ("\n\r"); + printf ("\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\r\n"); + printf ("Publishes an event which will be sent to all subscribers of this event.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of the event to publish\r\n", "event"); + printf ("\t%-20sThe data to publish with the event (as a string)\r\n", "data"); + printf ("Examples:\r\n"); + printf ("\tpub Example.MyEvent! \"Hello World\"\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 9, "method_noargs")) { - printf ("\e[1mmethod_no\e[0margs \e[4mmethodname\e[0m\n\r"); - printf ("Used when a method does not require any input arguement.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sName of a method\n\r", "methodname"); - printf ("Examples:\n\r"); - printf ("\tIsLanEnabled()\n\r"); - printf ("\n\r"); + printf ("\e[1mmethod_no\e[0margs \e[4mmethodname\e[0m\r\n"); + printf ("Used when a method does not require any input arguement.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sName of a method\r\n", "methodname"); + printf ("Examples:\r\n"); + printf ("\tIsLanEnabled()\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 9, "method_names")) { - printf ("\e[1mmethod_na\e[0mmes \e[4mmethodname\e[0m \e[4mparameter\e[0m [[\e[4mparameter\e[0m] \e[4m...\e[0m]\n\r"); - printf ("Uses the parameter name as an input to the specified method.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sName of a method\n\r", "methodname"); - printf ("\t%-20sName of a parameter\n\r", "parameter"); - printf ("Examples:\n\r"); - printf ("\tGetPSMRecordValue() Device.Test.Psm\n\r"); - printf ("\n\r"); + printf ("\e[1mmethod_na\e[0mmes \e[4mmethodname\e[0m \e[4mparameter\e[0m [[\e[4mparameter\e[0m] \e[4m...\e[0m]\r\n"); + printf ("Uses the parameter name as an input to the specified method.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sName of a method\r\n", "methodname"); + printf ("\t%-20sName of a parameter\r\n", "parameter"); + printf ("Examples:\r\n"); + printf ("\tGetPSMRecordValue() Device.Test.Psm\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 9, "method_values")) { - printf ("\e[1mmethod_va\e[0mlues \e[4mmethodname\e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\n\r"); - printf ("Uses the type and value of the parameter name as an input to the specified method.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sName of a method\n\r", "methodname"); - printf ("\t%-20sName of a parameter\n\r", "parameter"); - printf ("\t%-20sType of the parameter\n\r", "type"); - printf ("\t%-20sValue to be stored in the parameter\n\r", "value"); - printf ("Examples:\n\r"); - printf ("\tSetPSMRecordValue() Device.Test.Psm string test_value\n\r"); - printf ("\n\r"); + printf ("\e[1mmethod_va\e[0mlues \e[4mmethodname\e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\r\n"); + printf ("Uses the type and value of the parameter name as an input to the specified method.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sName of a method\r\n", "methodname"); + printf ("\t%-20sName of a parameter\r\n", "parameter"); + printf ("\t%-20sType of the parameter\r\n", "type"); + printf ("\t%-20sValue to be stored in the parameter\r\n", "value"); + printf ("Examples:\r\n"); + printf ("\tSetPSMRecordValue() Device.Test.Psm string test_value\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 10, "create_session")) { - printf ("\e[1mcreate_ses\e[0sion\n\r"); - printf ("Create a session.\n\r"); - printf ("Examples:\n\r"); - printf ("\tcreate_session\n\r"); - printf ("\n\r"); + printf ("\e[1mcreate_ses\e[0sion\r\n"); + printf ("Create a session.\r\n"); + printf ("Examples:\r\n"); + printf ("\tcreate_session\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 7, "get_session")) { - printf ("\e[1mget_ses\e[0sion\n\r"); - printf ("Get the current session Id value.\n\r"); - printf ("\tget_session\n\r"); - printf ("\n\r"); + printf ("\e[1mget_ses\e[0sion\r\n"); + printf ("Get the current session Id value.\r\n"); + printf ("\tget_session\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 9, "close_session")) { - printf ("\e[1mclose_ses\e[0sion\n\r"); - printf ("Close the current session.\n\r"); - printf ("\tclose_session\n\r"); - printf ("\n\r"); + printf ("\e[1mclose_ses\e[0sion\r\n"); + printf ("Close the current session.\r\n"); + printf ("\tclose_session\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 3, "log")) { - printf ("\t\e[1mlog\e[0m \e[4mlevel\e[0m\n\r"); - printf ("Sets the logging level.\n\r"); - printf ("You both adjust the rbus log level and enable additional client logging of event data for any subscription made by the program.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe level of logging to enable. Supported levels: debug, info, warn, error, fatal, event\n\r", "level"); - printf ("Examples:\n\r"); - printf ("\tToggle event logging:\n\r"); - printf ("\t\tlog events\n\r"); - printf ("\tEnable full rbus logging (minus events):\n\r"); - printf ("\t\tlog debug\n\r"); - printf ("\tReturn logging to default/quiet:\n\r"); - printf ("\t\tlog fatal\n\r"); - printf ("\n\r"); + printf ("\t\e[1mlog\e[0m \e[4mlevel\e[0m\r\n"); + printf ("Sets the logging level.\r\n"); + printf ("You both adjust the rbus log level and enable additional client logging of event data for any subscription made by the program.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe level of logging to enable. Supported levels: debug, info, warn, error, fatal, event\r\n", "level"); + printf ("Examples:\r\n"); + printf ("\tToggle event logging:\r\n"); + printf ("\t\tlog events\r\n"); + printf ("\tEnable full rbus logging (minus events):\r\n"); + printf ("\t\tlog debug\r\n"); + printf ("\tReturn logging to default/quiet:\r\n"); + printf ("\t\tlog fatal\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 5, "opendirect")) { - printf ("\e[1mopend\e[0mirect \e[4mpath\e[0m\n\r"); - printf ("Opens direct connection to the DML.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of a parameter \n\r", "path"); - printf ("Examples:\n\r"); - printf ("\topendirect Example.Prop1\n\r"); - printf ("\n\r"); + printf ("\e[1mopend\e[0mirect \e[4mpath\e[0m\r\n"); + printf ("Opens direct connection to the DML.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of a parameter \r\n", "path"); + printf ("Examples:\r\n"); + printf ("\topendirect Example.Prop1\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 5, "closedirect")) { - printf ("\e[1mclosed\e[0mirect \e[4mpath\e[0m\n\r"); - printf ("closes direct connection to the DML.\n\r"); - printf ("Args:\n\r"); - printf ("\t%-20sThe name of a parameter \n\r", "path"); - printf ("Examples:\n\r"); - printf ("\tclosedirect Example.Prop1\n\r"); - printf ("\n\r"); + printf ("\e[1mclosed\e[0mirect \e[4mpath\e[0m\r\n"); + printf ("closes direct connection to the DML.\r\n"); + printf ("Args:\r\n"); + printf ("\t%-20sThe name of a parameter \r\n", "path"); + printf ("Examples:\r\n"); + printf ("\tclosedirect Example.Prop1\r\n"); + printf ("\r\n"); } else if(matchCmd(command, 4, "quit")) { - printf ("\t\e[1mquit\e[0m\n\r"); - printf ("exist the program\n\r"); + printf ("\t\e[1mquit\e[0m\r\n"); + printf ("exist the program\r\n"); } else { - printf ("Invalid command: %s\n\r", command); + printf ("Invalid command: %s\r\n", command); } } else { if(!g_isInteractive) { - printf ("\nrbuscli\n\r"); - printf ("\nThis utility allows you to interact with the rbus system on this device.\n\r"); - printf ("\nUsage:\n\r"); - printf ("\trbuscli [command]\n\r"); - printf ("\trbuscli [-i]\n\r"); - printf ("\trbuscli [-g \e[0m \e[4mparameter\e\e[0m \e[0m]\n\r"); - printf ("\trbuscli [-s \e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m \e[0m]\n\r"); - printf ("\n\r"); - printf ("Options:\n\r"); - printf ("\t\e[1m-i\e[0m Run as interactive shell.\n\r"); - printf ("\t\e[1m-g\e[0m Get the value of parameter\n\r"); - printf ("\t\e[1m-s\e[0m Set the value of parameter\n\r"); - printf ("\n\r"); - printf ("Commands:\n\r"); - } - printf ("\t\e[1mopen\e[0mdirect \e[4mpath\e[0m\n\r"); - printf ("\t\e[1mclose\e[0mdirect \e[4mpath\e[0m\n\r"); - printf ("\t\e[1mget\e[0mvalues \e[4mpath\e[0m [\e[4mpath\e[0m \e[4m...\e[0m]\n\r"); - printf ("\t\e[1mset\e[0mvalues \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\n\r"); - printf ("\t\e[1msetc\e[0mommit \e[4mcomponents\e[0m [sessionid]\n\r"); - printf ("\t\e[1madd\e[0mrow \e[4mtable\e[0m [alias]\n\r"); - printf ("\t\e[1mdel\e[0mrow \e[4mrow\e[0m\n\r"); - printf ("\t\e[1mgetr\e[0mows \e[4mpath\e[0m\n\r"); - printf ("\t\e[1mgetn\e[0mames \e[4mpath\e[0m [nextLevel]\n\r"); - printf ("\t\e[1mdiscc\e[0momponents \e[4melement\e[0m [\e[4melement\e[0m \e[4m...\e[0m]\n\r"); - printf ("\t\e[1mdisca\e[0mllcomponents\n\r"); - printf ("\t\e[1mmethod_no\e[0margs \e[4mmethodname\e[0m\n\r"); - printf ("\t\e[1mmethod_na\e[0mmes \e[4mmethodname\e[0m \e[4mparameter\e[0m [[\e[4mparameter\e[0m] \e[4m...\e[0m]\n\r"); - printf ("\t\e[1mmethod_va\e[0mlues \e[4mmethodname\e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\n\r"); - printf ("\t\e[1mdisce\e[0mlements \e[4mcomponent\e[0m\n\r"); - printf ("\t\e[1mdisce\e[0mlements \e[4mpartial-path\e[0m immediate/all\n\r"); - printf ("\t\e[1mdiscw\e[0mildcarddests\n\r"); + printf ("\nrbuscli\r\n"); + printf ("\nThis utility allows you to interact with the rbus system on this device.\r\n"); + printf ("\nUsage:\r\n"); + printf ("\trbuscli [command]\r\n"); + printf ("\trbuscli [-i]\r\n"); + printf ("\trbuscli [-g \e[0m \e[4mparameter\e\e[0m \e[0m]\r\n"); + printf ("\trbuscli [-s \e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m \e[0m]\r\n"); + printf ("\r\n"); + printf ("Options:\r\n"); + printf ("\t\e[1m-i\e[0m Run as interactive shell.\r\n"); + printf ("\t\e[1m-g\e[0m Get the value of parameter\r\n"); + printf ("\t\e[1m-s\e[0m Set the value of parameter\r\n"); + printf ("\r\n"); + printf ("Commands:\r\n"); + } + printf ("\t\e[1mopen\e[0mdirect \e[4mpath\e[0m\r\n"); + printf ("\t\e[1mclose\e[0mdirect \e[4mpath\e[0m\r\n"); + printf ("\t\e[1mget\e[0mvalues \e[4mpath\e[0m [\e[4mpath\e[0m \e[4m...\e[0m]\r\n"); + printf ("\t\e[1mset\e[0mvalues \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\r\n"); + printf ("\t\e[1msetc\e[0mommit \e[4mcomponents\e[0m [sessionid]\r\n"); + printf ("\t\e[1madd\e[0mrow \e[4mtable\e[0m [alias]\r\n"); + printf ("\t\e[1mdel\e[0mrow \e[4mrow\e[0m\r\n"); + printf ("\t\e[1mgetr\e[0mows \e[4mpath\e[0m\r\n"); + printf ("\t\e[1mgetn\e[0mames \e[4mpath\e[0m [nextLevel]\r\n"); + printf ("\t\e[1mdiscc\e[0momponents \e[4melement\e[0m [\e[4melement\e[0m \e[4m...\e[0m]\r\n"); + printf ("\t\e[1mdisca\e[0mllcomponents\r\n"); + printf ("\t\e[1mmethod_no\e[0margs \e[4mmethodname\e[0m\r\n"); + printf ("\t\e[1mmethod_na\e[0mmes \e[4mmethodname\e[0m \e[4mparameter\e[0m [[\e[4mparameter\e[0m] \e[4m...\e[0m]\r\n"); + printf ("\t\e[1mmethod_va\e[0mlues \e[4mmethodname\e[0m \e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m [[\e[4mparameter\e[0m \e[4mtype\e[0m \e[4mvalue\e[0m] \e[4m...\e[0m] [commit]\r\n"); + printf ("\t\e[1mdisce\e[0mlements \e[4mcomponent\e[0m\r\n"); + printf ("\t\e[1mdisce\e[0mlements \e[4mpartial-path\e[0m immediate/all\r\n"); + printf ("\t\e[1mdiscw\e[0mildcarddests\r\n"); if(!g_isInteractive) { - printf ("\t\e[1mhelp\e[0m [\e[4mcommand\e[0m]\n\r"); - printf ("Additional interactive shell commands:\n\r"); - } - printf ("\t\e[1mreg\e[0mister \e[4mtype\e[0m \e[4mname\e[0m\n\r"); - printf ("\t\e[1munreg\e[0mister \e[4mname\e[0m\n\r"); - printf ("\t\e[1msub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m] [\e[4minitialValue\e[0m]\n\r"); - printf ("\t\e[1msubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] [\e[4minitialValue\e[0m]\n\r"); - printf ("\t\e[1mrawdatasub\e[0mscribe \e[4mevent\e[0m]\n\r"); - printf ("\t\e[1munsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\n\r"); - printf ("\t\e[1mrawdataunsub\e[0mscribe \e[4mevent\e[0m]\n\r"); - printf ("\t\e[1munsubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] [\e[4minitialValue\e[0m]\n\r"); - printf ("\t\e[1masub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\n\r"); - printf ("\t\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\n\r"); - printf ("\t\e[1mrawdatapub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\n\r"); - printf ("\t\e[1mcreate_ses\e[0msion\n\r"); - printf ("\t\e[1mget_ses\e[0msion\n\r"); - printf ("\t\e[1mclose_ses\e[0msion\n\r"); - printf ("\t\e[1mquit\e[0m\n\r"); + printf ("\t\e[1mhelp\e[0m [\e[4mcommand\e[0m]\r\n"); + printf ("Additional interactive shell commands:\r\n"); + } + printf ("\t\e[1mreg\e[0mister \e[4mtype\e[0m \e[4mname\e[0m\r\n"); + printf ("\t\e[1munreg\e[0mister \e[4mname\e[0m\r\n"); + printf ("\t\e[1msub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m] [\e[4minitialValue\e[0m]\r\n"); + printf ("\t\e[1msubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] [\e[4minitialValue\e[0m]\r\n"); + printf ("\t\e[1mrawdatasub\e[0mscribe \e[4mevent\e[0m]\r\n"); + printf ("\t\e[1munsub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\r\n"); + printf ("\t\e[1mrawdataunsub\e[0mscribe \e[4mevent\e[0m]\r\n"); + printf ("\t\e[1munsubi\e[0mnterval \e[4mevent\e[0m \e[4minterval\e[0m [\e[4mduration\e[0m] [\e[4minitialValue\e[0m]\r\n"); + printf ("\t\e[1masub\e[0mscribe \e[4mevent\e[0m [\e[4moperator\e[0m \e[4mvalue\e[0m]\r\n"); + printf ("\t\e[1mpub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\r\n"); + printf ("\t\e[1mrawdatapub\e[0mlish \e[4mevent\e[0m [\e[4mdata\e[0m]\r\n"); + printf ("\t\e[1mcreate_ses\e[0msion\r\n"); + printf ("\t\e[1mget_ses\e[0msion\r\n"); + printf ("\t\e[1mclose_ses\e[0msion\r\n"); + printf ("\t\e[1mquit\e[0m\r\n"); if(g_isInteractive) { - printf ("\t\e[1mhelp\e[0m [\e[4mcommand\e[0m]\n\r"); + printf ("\t\e[1mhelp\e[0m [\e[4mcommand\e[0m]\r\n"); } - printf ("\n\r"); + printf ("\r\n"); } } @@ -589,7 +589,7 @@ void rbus_log_handler( case RBUS_LOG_ERROR: slevel = "ERROR"; break; case RBUS_LOG_FATAL: slevel = "FATAL"; break; } - printf("%s %5s %s:%d -- Thread-%d: %s \n\r", rtTime_ToString(&tm, tbuff), slevel, file, line, threadId, message); + printf("%s %5s %s:%d -- Thread-%d: %s \r\n", rtTime_ToString(&tm, tbuff), slevel, file, line, threadId, message); } rbusValueType_t getDataType_fromString(const char* pType) @@ -761,7 +761,7 @@ rbusError_t property_get_handler(rbusHandle_t handle, rbusProperty_t property, r { if(g_logEvents) { - printf("Get handler called for invalid property %s\n\r", name); + printf("Get handler called for invalid property %s\r\n", name); } return RBUS_ERROR_INVALID_INPUT; } @@ -771,7 +771,7 @@ rbusError_t property_get_handler(rbusHandle_t handle, rbusProperty_t property, r if(g_logEvents) { char* buff; - printf("Get handler called for %s, returning value: %s\n\r", + printf("Get handler called for %s, returning value: %s\r\n", name, buff = rbusValue_ToString(rbusProperty_GetValue(property), NULL, 0)); free(buff); } @@ -793,7 +793,7 @@ rbusError_t property_set_handler(rbusHandle_t handle, rbusProperty_t prop, rbusS { if(g_logEvents) { - printf("Get handler called for invalid property %s\n\r", name); + printf("Get handler called for invalid property %s\r\n", name); } return RBUS_ERROR_INVALID_INPUT; } @@ -802,7 +802,7 @@ rbusError_t property_set_handler(rbusHandle_t handle, rbusProperty_t prop, rbusS if(g_logEvents) { - printf("Set handler called for %s, new value: %s\n\r", + printf("Set handler called for %s, new value: %s\r\n", name, buff = rbusValue_ToString(rbusProperty_GetValue(registeredProp), NULL, 0)); free(buff); } @@ -820,7 +820,7 @@ rbusError_t table_add_row_handler(rbusHandle_t handle, char const* tableName, ch runSteps = __LINE__; if(g_logEvents) { - printf("Table add row handler called for %s\n\r", tableName); + printf("Table add row handler called for %s\r\n", tableName); } return RBUS_ERROR_SUCCESS; } @@ -830,7 +830,7 @@ rbusError_t table_remove_row_handler(rbusHandle_t handle, char const* rowName) (void)handle; if(g_logEvents) { - printf("Table remove row handler called for %s\n\r", rowName); + printf("Table remove row handler called for %s\r\n", rowName); } return RBUS_ERROR_SUCCESS; } @@ -844,7 +844,7 @@ static rbusError_t method_invoke_handler(rbusHandle_t handle, char const* method runSteps = __LINE__; if(g_logEvents) { - printf("Method handler called for %s\n\r", methodName); + printf("Method handler called for %s\r\n", methodName); } rbusObject_fwrite(inParams, 1, stdout); return RBUS_ERROR_SUCCESS; @@ -859,7 +859,7 @@ rbusError_t event_subscribe_handler(rbusHandle_t handle, rbusEventSubAction_t ac runSteps = __LINE__; if(g_logEvents) { - printf("Subscribe handler called for %s, action: %s\n\r", eventName, + printf("Subscribe handler called for %s, action: %s\r\n", eventName, action == RBUS_EVENT_ACTION_SUBSCRIBE ? "subscribe" : "unsubscribe"); } return RBUS_ERROR_SUCCESS; @@ -870,11 +870,11 @@ static void event_receive_handler1(rbusHandle_t handle, rbusEventRawData_t const (void)handle; (void)subscription; runSteps = __LINE__; - printf("\nevent_receive_handler1 called\n\r"); - printf("Event received %s\n\r", event->name); - printf("Event data: %s\n\r", (char*)event->rawData); - printf("Event data len: %d\n\r", event->rawDataLen); - printf("\n\r"); + printf("\nevent_receive_handler1 called\r\n"); + printf("Event received %s\r\n", event->name); + printf("Event data: %s\r\n", (char*)event->rawData); + printf("Event data len: %d\r\n", event->rawDataLen); + printf("\r\n"); } void event_receive_handler2(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription) @@ -896,12 +896,12 @@ void event_receive_handler2(rbusHandle_t handle, rbusEvent_t const* event, rbusE case RBUS_EVENT_DURATION_COMPLETE: stype = "RBUS_EVENT_DURATION_COMPLETE"; break; } - printf("Event received %s of type %s\n\r", event->name, stype); - printf("Event data:\n\r"); + printf("Event received %s of type %s\r\n", event->name, stype); + printf("Event data:\r\n"); rbusObject_fwrite(event->data, 2, stdout); - printf("\n\r"); + printf("\r\n"); if (subscription->userData) - printf("User data: %s\n\r", (const char*)subscription->userData); + printf("User data: %s\r\n", (const char*)subscription->userData); } } @@ -923,7 +923,7 @@ static bool verify_rbus_open() rc = rbus_open(&g_busHandle, compName); if(rc != RBUS_ERROR_SUCCESS) { - printf("rbus_open failed err: %d\n\r", rc); + printf("rbus_open failed err: %d\r\n", rc); return false; } } @@ -946,17 +946,17 @@ void execute_discover_registered_components_cmd(int argc, char* argv[]) if(RBUSCORE_SUCCESS == rc) { int i; - printf ("Discovered registered components..\n\r"); + printf ("Discovered registered components..\r\n"); for (i = 0; i < componentCnt; i++) { - printf ("\tComponent %d: %s\n\r", (i + 1), pComponentNames[i]); + printf ("\tComponent %d: %s\r\n", (i + 1), pComponentNames[i]); free(pComponentNames[i]); } free(pComponentNames); } else { - printf ("Failed to discover components. Error Code = %d\n\r", rc); + printf ("Failed to discover components. Error Code = %d\r\n", rc); } } @@ -982,24 +982,24 @@ void execute_discover_component_cmd(int argc, char* argv[]) rc = rbus_discoverComponentName (g_busHandle, elementCnt, pElementNames, &componentCnt, &pComponentNames); if(RBUS_ERROR_SUCCESS == rc) { - printf ("Discovered components for the given elements.\n\r"); + printf ("Discovered components for the given elements.\r\n"); if(componentCnt) { for (i = 0; i < componentCnt; i++) { - printf ("\tComponent %d: %s\n\r", (i + 1), pComponentNames[i]); + printf ("\tComponent %d: %s\r\n", (i + 1), pComponentNames[i]); free(pComponentNames[i]); } free(pComponentNames); } else { - printf ("\tNone\n\r"); + printf ("\tNone\r\n"); } } else { - printf ("Failed to discover components. Error Code = %d\n\r", rc); + printf ("Failed to discover components. Error Code = %d\r\n", rc); } } @@ -1029,22 +1029,22 @@ void execute_discover_elements_cmd(int argc, char *argv[]) if(numElements) { int i; - printf ("Discovered elements are:\n\r"); + printf ("Discovered elements are:\r\n"); for (i = 0; i < numElements; i++) { - printf ("\tElement %d: %s\n\r", (i + 1), pElementNames[i]); + printf ("\tElement %d: %s\r\n", (i + 1), pElementNames[i]); free(pElementNames[i]); } free(pElementNames); } else { - printf("No elements discovered!\n\r"); + printf("No elements discovered!\r\n"); } } else { - printf ("Failed to discover elements. Error Code = %d\n\r", rc); + printf ("Failed to discover elements. Error Code = %d\r\n", rc); } } @@ -1059,7 +1059,7 @@ void execute_discover_wildcard_dests_cmd(int argc, char* argv[]) if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1076,19 +1076,19 @@ void execute_discover_wildcard_dests_cmd(int argc, char* argv[]) int i; for(i = 0; i < numDestinations; i++) { - printf ("\tComponent %d: %s\n\r", (i + 1), destinations[i]); + printf ("\tComponent %d: %s\r\n", (i + 1), destinations[i]); free(destinations[i]); } free(destinations); } else { - printf("No destinations discovered.\n\r"); + printf("No destinations discovered.\r\n"); } } else { - printf ("Failed to discover components. Error Code = %d\n\r", rc); + printf ("Failed to discover components. Error Code = %d\r\n", rc); } } @@ -1100,7 +1100,7 @@ void validate_and_execute_open_n_close_direct_cmd(int argc, char *argv[], bool i if (numOfInputParams != 1) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1112,7 +1112,7 @@ void validate_and_execute_open_n_close_direct_cmd(int argc, char *argv[], bool i if(pInputParam[0][strlen(pInputParam[0])-1] == '.' || strchr(pInputParam[0], '*')) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1125,7 +1125,7 @@ void validate_and_execute_open_n_close_direct_cmd(int argc, char *argv[], bool i rc = rbus_openDirect(g_busHandle, &directHandle, pInputParam[0]); if (RBUS_ERROR_SUCCESS != rc) { - printf ("Failed to open direct connection to %s\n\r", pInputParam[0]); + printf ("Failed to open direct connection to %s\r\n", pInputParam[0]); } else { @@ -1142,7 +1142,7 @@ void validate_and_execute_open_n_close_direct_cmd(int argc, char *argv[], bool i rc = rbus_closeDirect(directHandle); if (RBUS_ERROR_SUCCESS != rc) { - printf ("Failed to close direct connection to %s\n\r", pInputParam[0]); + printf ("Failed to close direct connection to %s\r\n", pInputParam[0]); } else { @@ -1151,7 +1151,7 @@ void validate_and_execute_open_n_close_direct_cmd(int argc, char *argv[], bool i } else { - printf ("Failed to find direct connection to %s\n\r", pInputParam[0]); + printf ("Failed to find direct connection to %s\r\n", pInputParam[0]); } } return; @@ -1170,7 +1170,7 @@ void validate_and_execute_get_cmd (int argc, char *argv[]) if ((numOfInputParams < 1) || ((strcmp("-g", argv[1]) == 0) && (numOfInputParams > 1))) { - RBUSCLI_LOG ("Invalid arguments. Please see the help\n\r"); + RBUSCLI_LOG ("Invalid arguments. Please see the help\r\n"); return; } @@ -1224,10 +1224,10 @@ void validate_and_execute_get_cmd (int argc, char *argv[]) } else { - printf ("Parameter %2d:\n\r", i+1); - printf (" Name : %s\n\r", rbusProperty_GetName(next)); - printf (" Type : %s\n\r", getDataType_toString(type)); - printf (" Value : %s\n\r", pStrVal); + printf ("Parameter %2d:\r\n", i+1); + printf (" Name : %s\r\n", rbusProperty_GetName(next)); + printf (" Type : %s\r\n", getDataType_toString(type)); + printf (" Value : %s\r\n", pStrVal); } if(pStrVal) { @@ -1240,7 +1240,7 @@ void validate_and_execute_get_cmd (int argc, char *argv[]) } else { - RBUSCLI_LOG ("Failed to get the data. Error : %d\n\r",rc); + RBUSCLI_LOG ("Failed to get the data. Error : %d\r\n",rc); } } @@ -1253,7 +1253,7 @@ void validate_and_execute_addrow_cmd (int argc, char *argv[]) if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1270,11 +1270,11 @@ void validate_and_execute_addrow_cmd (int argc, char *argv[]) if(RBUS_ERROR_SUCCESS == rc) { - printf ("\n\n%s%d. added\n\n\r", pTablePathName, instanceNum); + printf ("\n\n%s%d. added\n\r\n", pTablePathName, instanceNum); } else { - printf ("Add row to a table failed with error code:%d..\n\r", rc); + printf ("Add row to a table failed with error code:%d..\r\n", rc); } } @@ -1285,7 +1285,7 @@ void validate_and_execute_delrow_cmd (int argc, char *argv[]) if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1299,11 +1299,11 @@ void validate_and_execute_delrow_cmd (int argc, char *argv[]) if(RBUS_ERROR_SUCCESS == rc) { - printf ("\n\n%s deleted successfully\n\n\r", pTablePathName); + printf ("\n\n%s deleted successfully\n\r\n", pTablePathName); } else { - printf ("\n\nDeletion of a row from table failed with error code:%d..\n\r", rc); + printf ("\n\nDeletion of a row from table failed with error code:%d..\r\n", rc); } } @@ -1319,7 +1319,7 @@ void validate_and_execute_set_cmd (int argc, char *argv[]) * could be having commit and set to true/false */ if (((strcmp("-s", argv[1]) == 0 ) && (i > 3)) || (!((i >= 3) && ((i % 3 == 0) || (i % 3 == 1))))) { - RBUSCLI_LOG ("Invalid arguments. Please see the help\n\r"); + RBUSCLI_LOG ("Invalid arguments. Please see the help\r\n"); return; } @@ -1342,14 +1342,14 @@ void validate_and_execute_set_cmd (int argc, char *argv[]) rbusValue_Init(&setVal[index]); setNames[index] = argv[loopCnt+2]; - printf ("Name = %s \n\r", argv[loopCnt+2]); + printf ("Name = %s \r\n", argv[loopCnt+2]); /* Get Param Type */ rbusValueType_t type = getDataType_fromString(argv[loopCnt+3]); if (type == RBUS_NONE) { - printf ("Invalid data type. Please see the help\n\r"); + printf ("Invalid data type. Please see the help\r\n"); isInvalid = 1; break; } @@ -1518,17 +1518,17 @@ void validate_and_execute_set_cmd (int argc, char *argv[]) else { rc = RBUS_ERROR_INVALID_INPUT; - RBUSCLI_LOG ("Invalid data type. Please see the help\n\r"); + RBUSCLI_LOG ("Invalid data type. Please see the help\r\n"); } } if(RBUS_ERROR_SUCCESS == rc) { - RBUSCLI_LOG ("setvalues succeeded..\n\r"); + RBUSCLI_LOG ("setvalues succeeded..\r\n"); } else { - RBUSCLI_LOG ("setvalues failed with return value: %d\n\r", rc); + RBUSCLI_LOG ("setvalues failed with return value: %d\r\n", rc); } } @@ -1553,16 +1553,16 @@ void validate_and_execute_setcommit_cmd (int argc, char *argv[]) rc = rbus_setCommit(g_busHandle, argv[2], &opts); if(RBUS_ERROR_SUCCESS == rc) { - RBUSCLI_LOG ("setcommit succeeded..\n\r"); + RBUSCLI_LOG ("setcommit succeeded..\r\n"); } else { - RBUSCLI_LOG ("setcommit failed with return value: %d\n\r", rc); + RBUSCLI_LOG ("setcommit failed with return value: %d\r\n", rc); } } else { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); } } @@ -1575,7 +1575,7 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1592,7 +1592,7 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) nextLevel = false; else { - printf ("Invalid nextLevel option. This should be 'true' or 'false'.\n\r"); + printf ("Invalid nextLevel option. This should be 'true' or 'false'.\r\n"); return; } } @@ -1638,10 +1638,10 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) elem = elem->next; } - len = printf("%*s %-8s %6s %-*s %-*s\n\r", (int)maxIndexLen, " ", "type", "access", (int)maxComponentLen, "component", (int)maxNameLen, "name"); + len = printf("%*s %-8s %6s %-*s %-*s\r\n", (int)maxIndexLen, " ", "type", "access", (int)maxComponentLen, "component", (int)maxNameLen, "name"); for(index = 0; index < (int)len; ++index) printf("%c", '-'); - printf("\n\r"); + printf("\r\n"); elem = elems; component = NULL; @@ -1650,7 +1650,7 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) while(elem) { - printf("%*d %-8s %d%d%d%d%d%d %-*s %s\n\r", + printf("%*d %-8s %d%d%d%d%d%d %-*s %s\r\n", (int)maxIndexLen, index++, elem->type == RBUS_ELEMENT_TYPE_PROPERTY ? "property" : @@ -1681,13 +1681,13 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) { if(component == NULL || strcmp(component, elem->component) != 0) { - printf("\n\rComponent %s:\n\r", elem->component); + printf("\r\nComponent %s:\r\n", elem->component); component = elem->component; index = 1; } - printf ("Element %2d:\n\r", index++); - printf (" Name : %s\n\r", elem->name); - printf (" Type : %s\n\r", + printf ("Element %2d:\r\n", index++); + printf (" Name : %s\r\n", elem->name); + printf (" Type : %s\r\n", elem->type == RBUS_ELEMENT_TYPE_PROPERTY ? "Property" : (elem->type == RBUS_ELEMENT_TYPE_TABLE ? "Table" : (elem->type == RBUS_ELEMENT_TYPE_EVENT ? "Event" : @@ -1700,9 +1700,9 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) printf( "Writable"); else if(elem->access & RBUS_ACCESS_GET) printf( "ReadOnly"); - printf( "\n\r"); + printf( "\r\n"); - printf (" Access Flags: %d%d%d%d%d%d\n\r", + printf (" Access Flags: %d%d%d%d%d%d\r\n", elem->access & RBUS_ACCESS_GET ? 1 : 0, elem->access & RBUS_ACCESS_SET ? 1 : 0, elem->access & RBUS_ACCESS_ADDROW ? 1 : 0, @@ -1719,12 +1719,12 @@ void validate_and_execute_getnames_cmd (int argc, char *argv[]) } else { - printf ("No results returned for %s\n\r",argv[2]); + printf ("No results returned for %s\r\n",argv[2]); } } else { - printf ("Failed to get the data. Error : %d\n\r",rc); + printf ("Failed to get the data. Error : %d\r\n",rc); } } @@ -1736,7 +1736,7 @@ void validate_and_execute_getrownames_cmd (int argc, char *argv[]) if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1751,14 +1751,14 @@ void validate_and_execute_getrownames_cmd (int argc, char *argv[]) rbusRowName_t* row = rows; while(row) { - printf("Row %2u: instNum=%u, alias=%s, name=%s\n\r", i++, row->instNum, row->alias ? row->alias : "None", row->name); + printf("Row %2u: instNum=%u, alias=%s, name=%s\r\n", i++, row->instNum, row->alias ? row->alias : "None", row->name); row = row->next; } rbusTable_freeRowNames(g_busHandle, rows); } else { - printf ("Failed to get the data. Error : %d\n\r",rc); + printf ("Failed to get the data. Error : %d\r\n",rc); } } @@ -1769,7 +1769,7 @@ void validate_and_execute_register_command (int argc, char *argv[], bool add) if( !(argc >= 4 && (argc % 2) == 0)) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -1813,7 +1813,7 @@ void validate_and_execute_register_command (int argc, char *argv[], bool add) } else { - printf("Invalid element type: %s. Must be prop, table, event, or method.\n\r", stype); + printf("Invalid element type: %s. Must be prop, table, event, or method.\r\n", stype); continue; } @@ -1828,7 +1828,7 @@ void validate_and_execute_register_command (int argc, char *argv[], bool add) if(rc == RBUS_ERROR_SUCCESS) { - printf("%s %s\n\r", add ? "Registered" : "Unregistered", name); + printf("%s %s\r\n", add ? "Registered" : "Unregistered", name); if(add) { @@ -1863,7 +1863,7 @@ void validate_and_execute_register_command (int argc, char *argv[], bool add) } else { - printf("Failed to %s %s, error: %d\n\r", add ? "register" : "unregister", name, rc); + printf("Failed to %s %s, error: %d\r\n", add ? "register" : "unregister", name, rc); } } } @@ -1955,7 +1955,7 @@ void validate_and_execute_subscribe_cmd (int argc, char *argv[], bool add, bool if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -2064,7 +2064,7 @@ void validate_and_execute_subscribe_cmd (int argc, char *argv[], bool add, bool { exit_error: runSteps = __LINE__; - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); rt_free(userData); return; } @@ -2101,7 +2101,7 @@ void validate_and_execute_subscribe_cmd (int argc, char *argv[], bool add, bool if(rc != RBUS_ERROR_SUCCESS) { - printf("Invalid Subscription err:%d\n\r", rc); + printf("Invalid Subscription err:%d\r\n", rc); rt_free (userData); } else @@ -2142,7 +2142,7 @@ void validate_and_execute_publish_command(int argc, char *argv[], bool rawDataPu if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -2179,7 +2179,7 @@ void validate_and_execute_publish_command(int argc, char *argv[], bool rawDataPu if(rc != RBUS_ERROR_SUCCESS) { - printf("Publish failed err: %d\n\r", rc); + printf("Publish failed err: %d\r\n", rc); } rbusObject_Release(data); } @@ -2203,7 +2203,7 @@ static void execute_method_cmd(char *cmd, char *method, rbusObject_t inParams) { if(outParams) { - printf("%s failed for %s with err: '%s'\n\r",cmd, method,rbusError_ToString(rc)); + printf("%s failed for %s with err: '%s'\r\n",cmd, method,rbusError_ToString(rc)); rbusObject_fwrite(outParams, 1, stdout); rbusObject_Release(outParams); } @@ -2225,10 +2225,10 @@ static void execute_method_cmd(char *cmd, char *method, rbusObject_t inParams) if(str_value) { - printf ("Parameter %2d:\n\r", ++i); - printf (" Name : %s\n\r", rbusProperty_GetName(prop)); - printf (" Type : %s\n\r", getDataType_toString(type)); - printf (" Value : %s\n\r", str_value); + printf ("Parameter %2d:\r\n", ++i); + printf (" Name : %s\r\n", rbusProperty_GetName(prop)); + printf (" Type : %s\r\n", getDataType_toString(type)); + printf (" Value : %s\r\n", str_value); free(str_value); } } @@ -2243,7 +2243,7 @@ void validate_and_execute_method_values_cmd (int argc, char *argv[]) { if(!((argc >= 6) && (0 == (argc % 3)))) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -2263,7 +2263,7 @@ void validate_and_execute_method_values_cmd (int argc, char *argv[]) type = getDataType_fromString(argv[i+1]); if (type == RBUS_NONE) { - printf ("Invalid data type '%s' for the parameter %s\n\r",argv[i+1],argv[i]); + printf ("Invalid data type '%s' for the parameter %s\r\n",argv[i+1],argv[i]); if(inParams) rbusObject_Release(inParams); return; @@ -2272,7 +2272,7 @@ void validate_and_execute_method_values_cmd (int argc, char *argv[]) rbusValue_Init(&value); if(false == rbusValue_SetFromString(value, type, argv[i+2])) { - printf ("Invalid value '%s' for the parameter %s\n\r",argv[i+2],argv[i]); + printf ("Invalid value '%s' for the parameter %s\r\n",argv[i+2],argv[i]); if(inParams) rbusObject_Release(inParams); return; @@ -2291,7 +2291,7 @@ void validate_and_execute_method_noargs_cmd (int argc, char *argv[]) { if (argc < 3) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -2306,7 +2306,7 @@ void validate_and_execute_method_names_cmd (int argc, char *argv[]) { if (argc < 4) { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); return; } @@ -2345,7 +2345,7 @@ void validate_and_execute_get_session_cmd ( ) if (!verify_rbus_open()) return; rbus_getCurrentSession(g_busHandle, &g_curr_sessionId); - printf ("current sessionID %d\n\r", g_curr_sessionId); + printf ("current sessionID %d\r\n", g_curr_sessionId); } void validate_and_execute_close_session_cmd (int argc, char *argv[]) @@ -2408,7 +2408,7 @@ int handle_cmds (int argc, char *argv[]) } else { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); } } else if(matchCmd(command, 5, "discelements")) @@ -2420,7 +2420,7 @@ int handle_cmds (int argc, char *argv[]) } else { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); } } else if(matchCmd(command, 5, "discallcomponents")) @@ -2510,13 +2510,13 @@ int handle_cmds (int argc, char *argv[]) { if(argc < 3) { - printf("Missing log level\n\r"); + printf("Missing log level\r\n"); return 0; } if(matchCmd(argv[2], 5, "events")) { g_logEvents = !g_logEvents; - printf("Event logs %s\n\r", g_logEvents ? "enabled" : "disabled"); + printf("Event logs %s\r\n", g_logEvents ? "enabled" : "disabled"); } else { @@ -2553,11 +2553,11 @@ int handle_cmds (int argc, char *argv[]) rbus_setLogLevel(level); g_logLevel = level; - printf("Log level set to %s\n\r", argv[2]); + printf("Log level set to %s\r\n", argv[2]); } else { - printf("Invalid log level\n\r"); + printf("Invalid log level\r\n"); } } } @@ -2575,7 +2575,7 @@ int handle_cmds (int argc, char *argv[]) } else { - printf ("Invalid arguments. Please see the help\n\r"); + printf ("Invalid arguments. Please see the help\r\n"); } return 0; @@ -2953,25 +2953,25 @@ static void exception_handler(int sig, siginfo_t *info) } /* dump general information */ - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!!!! Exception Caught !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); - - printf("\n\n\rSignal info:\n\r" - "\n\rTime: %s " - "\n\rProcess name: <%s>" - "\n\rPID: %d" - "\n\rFault Address: %p" - "\n\rSignal: %d" - "\n\rSignal Code: %d", + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!! Exception Caught !!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); + + printf("\n\r\nSignal info:\r\n" + "\r\nTime: %s " + "\r\nProcess name: <%s>" + "\r\nPID: %d" + "\r\nFault Address: %p" + "\r\nSignal: %d" + "\r\nSignal Code: %d", asctime (timeinfo), cmdName, getpid(), info->si_addr, sig, info->si_code); - printf("\n\r\n\rThe cmd line is :%s.", cmdLine ); - printf("\n\rThe latest Line number is:%d.\n\r", runSteps); + printf("\r\n\r\nThe cmd line is :%s.", cmdLine ); + printf("\r\nThe latest Line number is:%d.\r\n", runSteps); #if (__linux__ && __GLIBC__ && !__UCLIBC__) || __APPLE__ int size, i; @@ -2979,16 +2979,16 @@ static void exception_handler(int sig, siginfo_t *info) size = backtrace(addresses, BT_BUF_SIZE); backtrace_symbols_fd(addresses,size,STDOUT_FILENO); if(size >= 3) { - printf("backtrace returned: %d\n\r", size); + printf("backtrace returned: %d\r\n", size); for(i = 0; i < size; i++) { - printf("\n\r%d: %p \n\r", i, addresses[i]); + printf("\r\n%d: %p \r\n", i, addresses[i]); } } #endif - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!! Dump Ending!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); - printf("\n\r!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\r"); + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!! Dump Ending!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" ); + printf("\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n"); exit(0); } @@ -3050,7 +3050,7 @@ int main( int argc, char *argv[] ) free(interArgv[i]); } else - printf("Command missing quotes\n\r"); + printf("Command missing quotes\r\n"); } runSteps = __LINE__; linenoiseFree(line);