From c787fc3405e0d510f9763ef06113064205f0f97b Mon Sep 17 00:00:00 2001 From: John Rucker Date: Sun, 10 May 2020 09:15:47 -0500 Subject: [PATCH 1/5] added support for DBUS_TYPE_OBJECT_PATH_AS_STRING to getSignatureFromV8Type() --- src/encoder.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/encoder.cc b/src/encoder.cc index 4660fc9..2760978 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -93,6 +93,18 @@ string GetSignatureFromV8Type(Local& value) { return const_cast(DBUS_TYPE_DOUBLE_AS_STRING); } if (IsString(value)) { + // JR mods bellow this line ......................................... + char* jrData = strdup(*String::Utf8Value( + v8::Isolate::GetCurrent(), + value->ToString(Nan::GetCurrentContext()).ToLocalChecked()) + ); + char jrFirstInitial = jrData[0]; + char jrObjTest = '/'; + if( jrFirstInitial == jrObjTest ) { + printf("Object path -> %s \n", jrData); + return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); + } + // JR mods above this line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return const_cast(DBUS_TYPE_STRING_AS_STRING); } if (IsArray(value)) { From 2838c8df16dbfaed8877cc04baa34a950a689699 Mon Sep 17 00:00:00 2001 From: John Rucker Date: Tue, 12 May 2020 07:07:01 -0500 Subject: [PATCH 2/5] . --- src/encoder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/encoder.cc b/src/encoder.cc index 2760978..034af13 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -101,8 +101,8 @@ string GetSignatureFromV8Type(Local& value) { char jrFirstInitial = jrData[0]; char jrObjTest = '/'; if( jrFirstInitial == jrObjTest ) { - printf("Object path -> %s \n", jrData); - return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); + printf("Skipping Object path -> %s \n", jrData); + //return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); } // JR mods above this line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return const_cast(DBUS_TYPE_STRING_AS_STRING); From a65c7cf9ec2a6245b7416b016564e678f73c6ba3 Mon Sep 17 00:00:00 2001 From: John Rucker Date: Tue, 12 May 2020 07:28:34 -0500 Subject: [PATCH 3/5] . --- src/encoder.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/encoder.cc b/src/encoder.cc index 034af13..68e9abd 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -94,16 +94,16 @@ string GetSignatureFromV8Type(Local& value) { } if (IsString(value)) { // JR mods bellow this line ......................................... - char* jrData = strdup(*String::Utf8Value( - v8::Isolate::GetCurrent(), - value->ToString(Nan::GetCurrentContext()).ToLocalChecked()) - ); - char jrFirstInitial = jrData[0]; - char jrObjTest = '/'; - if( jrFirstInitial == jrObjTest ) { - printf("Skipping Object path -> %s \n", jrData); - //return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); - } + // char* jrData = strdup(*String::Utf8Value( + // v8::Isolate::GetCurrent(), + // value->ToString(Nan::GetCurrentContext()).ToLocalChecked()) + // ); + // char jrFirstInitial = jrData[0]; + // char jrObjTest = '/'; + // if( jrFirstInitial == jrObjTest ) { + // printf("Object path -> %s \n", jrData); + // return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); + // } // JR mods above this line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return const_cast(DBUS_TYPE_STRING_AS_STRING); } From 5d7e4c3785502d9d65e057cd9b43d5d1974719df Mon Sep 17 00:00:00 2001 From: John Rucker Date: Tue, 12 May 2020 11:13:43 -0500 Subject: [PATCH 4/5] . --- src/encoder.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/encoder.cc b/src/encoder.cc index 68e9abd..2760978 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -94,16 +94,16 @@ string GetSignatureFromV8Type(Local& value) { } if (IsString(value)) { // JR mods bellow this line ......................................... - // char* jrData = strdup(*String::Utf8Value( - // v8::Isolate::GetCurrent(), - // value->ToString(Nan::GetCurrentContext()).ToLocalChecked()) - // ); - // char jrFirstInitial = jrData[0]; - // char jrObjTest = '/'; - // if( jrFirstInitial == jrObjTest ) { - // printf("Object path -> %s \n", jrData); - // return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); - // } + char* jrData = strdup(*String::Utf8Value( + v8::Isolate::GetCurrent(), + value->ToString(Nan::GetCurrentContext()).ToLocalChecked()) + ); + char jrFirstInitial = jrData[0]; + char jrObjTest = '/'; + if( jrFirstInitial == jrObjTest ) { + printf("Object path -> %s \n", jrData); + return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); + } // JR mods above this line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return const_cast(DBUS_TYPE_STRING_AS_STRING); } From 1db760eccc5914ee96fc711590776a5d124ff52a Mon Sep 17 00:00:00 2001 From: John Rucker Date: Tue, 19 May 2020 15:20:31 -0500 Subject: [PATCH 5/5] removed last printf after a week of testing. --- src/encoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encoder.cc b/src/encoder.cc index 2760978..511a9fa 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -101,7 +101,7 @@ string GetSignatureFromV8Type(Local& value) { char jrFirstInitial = jrData[0]; char jrObjTest = '/'; if( jrFirstInitial == jrObjTest ) { - printf("Object path -> %s \n", jrData); + // printf("Object path -> %s \n", jrData); return const_cast(DBUS_TYPE_OBJECT_PATH_AS_STRING); } // JR mods above this line ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^