From ef895cc67f4d312a52895c736f037e97d83c7a18 Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Fri, 22 Apr 2016 20:11:58 -0300 Subject: [PATCH] soletta: update to 1_beta19 Main reason for this update is to support NodeJS bindings. Backports are dropped. There's a new Soletta version with the following changes: * Add JS API for SPI, I2C * Add simple JSON types as HTTP node types * Make IIO device creation/addressing synchronous * Many fixes on OIC generator * Add API to discovery OIC resources using resource interface * Make OIC device IDs and resource structure compatible with IoTivity 1.1 RC3 Signed-off-by: Bruno Dilly --- ...-iio-release-buffer-on-sol_iio_close.patch | 35 --------- .../0047-oic-gen-fix-rep_vec-issue.patch | 37 --------- ...-props-from-imported-json-objs-were-.patch | 75 ------------------- ...d-client-to_repr_vec-when-all-props-.patch | 46 ------------ ...enerate-code-using-same-order-of-res.patch | 31 -------- recipes-soletta/soletta/soletta_git.bb | 9 +-- 6 files changed, 2 insertions(+), 231 deletions(-) delete mode 100644 recipes-soletta/soletta/files/0013-lib-sol-iio-release-buffer-on-sol_iio_close.patch delete mode 100644 recipes-soletta/soletta/files/0047-oic-gen-fix-rep_vec-issue.patch delete mode 100644 recipes-soletta/soletta/files/0048-oic-gen-ReadOnly-props-from-imported-json-objs-were-.patch delete mode 100644 recipes-soletta/soletta/files/0049-oic-gen-Don-t-add-client-to_repr_vec-when-all-props-.patch delete mode 100644 recipes-soletta/soletta/files/0050-oic-gen-Always-generate-code-using-same-order-of-res.patch diff --git a/recipes-soletta/soletta/files/0013-lib-sol-iio-release-buffer-on-sol_iio_close.patch b/recipes-soletta/soletta/files/0013-lib-sol-iio-release-buffer-on-sol_iio_close.patch deleted file mode 100644 index 0602bb4..0000000 --- a/recipes-soletta/soletta/files/0013-lib-sol-iio-release-buffer-on-sol_iio_close.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9c9c744a7f7161aa45ddc2affcce68a233d5d8aa Mon Sep 17 00:00:00 2001 -From: Bruno Dilly -Date: Tue, 12 Apr 2016 18:36:19 -0300 -Subject: [PATCH 13/50] lib/sol-iio: release buffer on sol_iio_close() - -Otherwise after using a Soletta application the following -issue should happen when trying to access it: - -root@edison:/sys/bus/iio/devices/iio:device1# cat *raw -cat: in_voltage0_raw: Device or resource busy -cat: in_voltage1_raw: Device or resource busy -cat: in_voltage2_raw: Device or resource busy - -Signed-off-by: Bruno Dilly ---- - src/lib/io/sol-iio.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/lib/io/sol-iio.c b/src/lib/io/sol-iio.c -index 622842c..6c674a5 100644 ---- a/src/lib/io/sol-iio.c -+++ b/src/lib/io/sol-iio.c -@@ -873,6 +873,9 @@ sol_iio_close(struct sol_iio_device *device) - } - sol_ptr_vector_clear(&device->channels); - -+ if ((device->buffer_enabled) && (!set_buffer_enabled(device, false))) -+ SOL_WRN("Could not disable buffer for device%d", device->device_id); -+ - if (device->fd_handler) sol_fd_del(device->fd_handler); - if (device->fd > -1) close(device->fd); - if (device->name_fd > -1) close(device->name_fd); --- -2.4.11 - diff --git a/recipes-soletta/soletta/files/0047-oic-gen-fix-rep_vec-issue.patch b/recipes-soletta/soletta/files/0047-oic-gen-fix-rep_vec-issue.patch deleted file mode 100644 index 1013f75..0000000 --- a/recipes-soletta/soletta/files/0047-oic-gen-fix-rep_vec-issue.patch +++ /dev/null @@ -1,37 +0,0 @@ -From dc3e187aed3bc119ffc5a790340b36172c723ae5 Mon Sep 17 00:00:00 2001 -From: Bruno Dilly -Date: Tue, 19 Apr 2016 10:42:31 -0300 -Subject: [PATCH 47/50] oic-gen: fix rep_vec issue - -It was passing wrong parameters to create the code - -Closes gh-1897 - -Signed-off-by: Bruno Dilly ---- - data/scripts/sol-oic-gen.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/data/scripts/sol-oic-gen.py b/data/scripts/sol-oic-gen.py -index 559040a..5d41f91 100755 ---- a/data/scripts/sol-oic-gen.py -+++ b/data/scripts/sol-oic-gen.py -@@ -152,13 +152,13 @@ def generate_object_to_repr_vec_fn_common_c(state_struct_name, name, props, clie - if 'enum' in prop_descr: - tbl = '%s_%s_tbl' % (state_struct_name, prop_name) - val = '%s[state->state.%s].key' % (tbl, prop_name) -- vallen = '%s[state->state.%s].len' % val -+ vallen = '%s[state->state.%s].len' % (tbl, prop_name) - - ftype = 'SOL_OIC_REPR_TEXT_STRING' - fargs = (val, vallen) - elif prop_descr['type'] == 'boolean': - val = 'state->state.%s' % prop_name -- -+ - ftype = 'SOL_OIC_REPR_BOOLEAN' - fargs = (val, ) - elif prop_descr['type'] == 'string': --- -2.4.11 - diff --git a/recipes-soletta/soletta/files/0048-oic-gen-ReadOnly-props-from-imported-json-objs-were-.patch b/recipes-soletta/soletta/files/0048-oic-gen-ReadOnly-props-from-imported-json-objs-were-.patch deleted file mode 100644 index a9e1e96..0000000 --- a/recipes-soletta/soletta/files/0048-oic-gen-ReadOnly-props-from-imported-json-objs-were-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From aa5dca36395164855689bc2350f7b313cb5b707f Mon Sep 17 00:00:00 2001 -From: Otavio Pontes -Date: Tue, 19 Apr 2016 15:03:35 -0300 -Subject: [PATCH 48/50] oic-gen: ReadOnly props from imported json objs were - not considered ro - -We can't override json 'description' property when processing json -files, because files that import this 'description' should use unchanged -'description'. - -If we remove the ReadOnly string from the beggining of the -'description', other json files that import from the original json won't -have its properties considered ReadOnly. - -Signed-off-by: Otavio Pontes ---- - data/scripts/sol-oic-gen.py | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/data/scripts/sol-oic-gen.py b/data/scripts/sol-oic-gen.py -index 5d41f91..229d002 100755 ---- a/data/scripts/sol-oic-gen.py -+++ b/data/scripts/sol-oic-gen.py -@@ -71,7 +71,9 @@ def load_json_schema(directory, path, schemas={}): - props['required'] = field in required - - if props['read_only']: -- props['description'] = props['description'][len('ReadOnly,'):].strip() -+ props['short_description'] = doc[len('ReadOnly,'):].strip() -+ else: -+ props['short_description'] = props.get('description', None) - - descr['title'] = title - -@@ -133,7 +135,7 @@ def props_are_equivalent(p1, p2): - def object_fields_common_c(state_struct_name, name, props): - fields = [] - for prop_name, descr in props.items(): -- doc = '/* %s */' % descr.get('description', '???') -+ doc = '/* %s */' % descr.get('short_description', '???') - if 'enum' in descr: - var_type = 'enum %s_%s' % (state_struct_name, prop_name) - else: -@@ -758,8 +760,8 @@ def generate_enums_common_c(name, props): - output = [] - for field, descr in props.items(): - if 'enum' in descr: -- if 'description' in descr: -- output.append('''/* %s */''' % descr['description']) -+ if 'short_description' in descr: -+ output.append('''/* %s */''' % descr['short_description']) - output.append('''enum %(struct_name)s_%(field_name)s { %(items)s };''' % { - 'struct_name': name, - 'field_name': field, -@@ -871,7 +873,7 @@ def generate_object_json(resource_type, struct_name, node_name, title, props, se - - in_ports.append({ - 'data_type': JSON_TO_SOL_JSON[prop_descr.get('type', 'string')], -- 'description': prop_descr.get('description', '???'), -+ 'description': prop_descr.get('short_description', '???'), - 'methods': { - 'process': '%s_set_%s' % (struct_name, prop_name) - }, -@@ -894,7 +896,7 @@ def generate_object_json(resource_type, struct_name, node_name, title, props, se - for prop_name, prop_descr in props.items(): - out_ports.append({ - 'data_type': JSON_TO_SOL_JSON[prop_descr.get('type', 'string')], -- 'description': prop_descr.get('description', '???'), -+ 'description': prop_descr.get('short_description', '???'), - 'name': '%s' % get_port_name(prop_name) - }) - --- -2.4.11 - diff --git a/recipes-soletta/soletta/files/0049-oic-gen-Don-t-add-client-to_repr_vec-when-all-props-.patch b/recipes-soletta/soletta/files/0049-oic-gen-Don-t-add-client-to_repr_vec-when-all-props-.patch deleted file mode 100644 index f1edee3..0000000 --- a/recipes-soletta/soletta/files/0049-oic-gen-Don-t-add-client-to_repr_vec-when-all-props-.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ac1a7c2ecc3c4e7fd7d2c64c4725b7ee67321adb Mon Sep 17 00:00:00 2001 -From: Otavio Pontes -Date: Tue, 19 Apr 2016 15:06:35 -0300 -Subject: [PATCH 49/50] oic-gen: Don't add client to_repr_vec when all props - are readonly - -Method generate_object_to_repr_vec_fn_common_c is not generating the -to_repr_vec functions when all props from one object are read only, but -this was not being checked in method object_to_repr_vec_fn_common_c. - -If we generate a to_repr_vec function in object_to_repr_vec_fn_common_c -when all props are read only, we will try to call the to_repr_vec -function that was supposed to be generated by -generate_object_to_repr_vec_fn_common_c, so we will fail. - -Signed-off-by: Otavio Pontes ---- - data/scripts/sol-oic-gen.py | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/data/scripts/sol-oic-gen.py b/data/scripts/sol-oic-gen.py -index 229d002..c03e2e6 100755 ---- a/data/scripts/sol-oic-gen.py -+++ b/data/scripts/sol-oic-gen.py -@@ -217,7 +217,18 @@ def get_type_from_property(prop): - return 'enum:%s' % ','.join(prop['enum']) - raise ValueError('Unknown type for property') - -+def all_props_are_read_only(props): -+ for prop_name, prop_descr in props.items(): -+ if not prop_descr['read_only']: -+ return False -+ -+ return True -+ -+ - def object_to_repr_vec_fn_common_c(state_struct_name, name, props, client, equivalent={}): -+ if client and all_props_are_read_only(props): -+ return ''; -+ - for item_name, item_props in equivalent.items(): - if item_props[0] == client and props_are_equivalent(props, item_props[1]): - return '''static bool --- -2.4.11 - diff --git a/recipes-soletta/soletta/files/0050-oic-gen-Always-generate-code-using-same-order-of-res.patch b/recipes-soletta/soletta/files/0050-oic-gen-Always-generate-code-using-same-order-of-res.patch deleted file mode 100644 index aefb529..0000000 --- a/recipes-soletta/soletta/files/0050-oic-gen-Always-generate-code-using-same-order-of-res.patch +++ /dev/null @@ -1,31 +0,0 @@ -From dc9b80f225164a8d412476d8f5b50033f2802315 Mon Sep 17 00:00:00 2001 -From: Otavio Pontes -Date: Tue, 19 Apr 2016 15:37:46 -0300 -Subject: [PATCH 50/50] oic-gen: Always generate code using same order of - resource types - -os.listdir documentation states that list order is arbitrary. Sorting -the list dir to make sure we are always generating the oic file in same -order. - -Signed-off-by: Otavio Pontes ---- - data/scripts/sol-oic-gen.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/scripts/sol-oic-gen.py b/data/scripts/sol-oic-gen.py -index c03e2e6..c8523a8 100755 ---- a/data/scripts/sol-oic-gen.py -+++ b/data/scripts/sol-oic-gen.py -@@ -1711,7 +1711,7 @@ if __name__ == '__main__': - generated = [] - print('Generating code for schemas: ', end='') - for schema_dir in args.schema_dirs: -- for path in (f for f in os.listdir(schema_dir) if seems_schema(f)): -+ for path in (f for f in sorted(os.listdir(schema_dir)) if seems_schema(f)): - print(path, end=', ') - - try: --- -2.4.11 - diff --git a/recipes-soletta/soletta/soletta_git.bb b/recipes-soletta/soletta/soletta_git.bb index 245ca61..224f804 100644 --- a/recipes-soletta/soletta/soletta_git.bb +++ b/recipes-soletta/soletta/soletta_git.bb @@ -8,19 +8,14 @@ DEPENDS = "glib-2.0 libpcre pkgconfig python3-jsonschema-native icu curl libmicr DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=93888867ace35ffec2c845ea90b2e16b" -PV = "1_beta18+git${SRCPV}" +PV = "1_beta19+git${SRCPV}" SRC_URI = "gitsm://github.com/solettaproject/soletta.git;protocol=git \ file://run-ptest \ - file://0013-lib-sol-iio-release-buffer-on-sol_iio_close.patch \ - file://0047-oic-gen-fix-rep_vec-issue.patch \ - file://0048-oic-gen-ReadOnly-props-from-imported-json-objs-were-.patch \ - file://0049-oic-gen-Don-t-add-client-to_repr_vec-when-all-props-.patch \ - file://0050-oic-gen-Always-generate-code-using-same-order-of-res.patch \ file://i2c-dev.conf \ file://iio-trig-sysfs.conf \ " -SRCREV = "97091af414193c37278ba5ff88c70c596eecd7ea" +SRCREV = "6a7bc32376904ac385dea073cb8d71a74f2e8629" S = "${WORKDIR}/git"