summaryrefslogtreecommitdiffstats
path: root/binding/iiodevices-binding.c
AgeCommit message (Collapse)AuthorFilesLines
2021-11-03binding iiodevices: Support 64-bit raw values.lamprey_12.1.9lamprey_12.1.8lamprey_12.1.7lamprey_12.1.6lamprey_12.1.5lamprey_12.1.4lamprey_12.1.3lamprey_12.1.20lamprey_12.1.2lamprey_12.1.19lamprey_12.1.18lamprey_12.1.17lamprey_12.1.16lamprey_12.1.15lamprey_12.1.14lamprey_12.1.13lamprey_12.1.12lamprey_12.1.11lamprey_12.1.10lamprey_12.1.1lamprey_12.1.0lamprey/12.1.9lamprey/12.1.8lamprey/12.1.7lamprey/12.1.6lamprey/12.1.5lamprey/12.1.4lamprey/12.1.3lamprey/12.1.20lamprey/12.1.2lamprey/12.1.19lamprey/12.1.18lamprey/12.1.17lamprey/12.1.16lamprey/12.1.15lamprey/12.1.14lamprey/12.1.13lamprey/12.1.12lamprey/12.1.11lamprey/12.1.10lamprey/12.1.1lamprey/12.1.012.1.912.1.812.1.712.1.612.1.512.1.412.1.312.1.2012.1.212.1.1912.1.1812.1.1712.1.1612.1.1512.1.1412.1.1312.1.1212.1.1112.1.1012.1.112.1.0lampreyAndriy Tryshnivskyy1-5/+5
IIO SCMI sensor can return such values. Bug-AGL: SPEC-3865 Signed-off-by: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com> Change-Id: Ifbdae831fd69bce6b3d0e360fb5848264b1db4e5 (cherry picked from commit 14ae864f8d4824049fd91dc471d7b70f708bb410)
2021-11-03Add SCMI IIO accelerometer and gyroscope.Andriy Tryshnivskyy1-0/+2
ARM System Control and Management Interface [1] provides sensor protocol which can implement various sensors. In particular, using virtio transport for SCMI one can provide virtual sensors. For now add sensors which can be backed by physical one on AGL Reference Hardware board. [1]: https://developer.arm.com/architectures/system-architectures/software-standards/scmi Bug-AGL: SPEC-3865 Signed-off-by: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com> Change-Id: I932101dd057eb305338459930a243fb1749496de (cherry picked from commit 34924f5a91df68134a5b5fb04cce05f08da06199)
2021-09-21binding iiodevices: Fix service crash when subscribing to two iio devices.Andriy Tryshnivskyy1-6/+4
It fixes a segmentation fault when subscribing to two or more devices [1]. For every device, a client structure is created and stored in the linked list. If the device is not present, the corresponding client is removed from this list (it is done in deinit_client_sub()). There is an internal pointer last_client, which stores a pointer to the last client. The root cause for this bug is that last_client was not updated after the client was removed from the linked list. The solution is to not save the last pointer since it can be easily found when it is needed. 1: ON-REPLY 2:iiodevices/subscribe: ERROR { "jtype":"afb-reply", "request":{ "status":"aborted", "info":"signal Segmentation fault(11) caught" } } Issue: SPEC-4066 Signed-off-by: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com> Change-Id: I72658ffd9f3b43a4ff71346f7fe4cf2c8f1242ca (cherry picked from commit 537e8fb05c31fab3ab447f0a4e222b1091245a1a)
2021-09-21binding iiodevices: Change subscribe to scan all devices.Andriy Tryshnivskyy1-5/+11
It fixes a problem when there are several devices with the same event, but not all devices are available on system. Previously, service did not check all devices and returned error on first not available device. Bug-AGL: SPEC-3865 Change-Id: I91e38dc31824c3956829180569ad819b27da6b6c Signed-off-by: Andriy Tryshnivskyy <andriy.tryshnivskyy@opensynergy.com> (cherry picked from commit 87f8fa282d76da55fe61651a5ee49a29632e9d7c)
2021-09-21Fix channel names for sensors devices.Vasyl Vavrychuk1-2/+2
Clearly channel names for gyroscope and compass were swapped. Bug-AGL: SPEC-3865 Change-Id: I8cf281486ffcc97f28ff49f33027cc9fa0bd7b04 Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> (cherry picked from commit f4240dafa9d5afd446aea3a70a4ea082f6ed2420)
2021-09-21Add sensors from AGL Reference Hardware board.Vasyl Vavrychuk1-1/+3
Bug-AGL: SPEC-3865 Change-Id: Id7900ede639e0535ebcf694c2b033cfe39df01af Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com> (cherry picked from commit 07500b890cb2ac11bed6b945e04cd9f4f9ef8fba)
2020-08-18Migration to binding V3marlin_12.90.0marlin/12.90.0lamprey_11.92.0lamprey_11.91.0lamprey/11.92.0lamprey/11.91.0koi_10.93.0koi_10.92.0koi_10.91.0koi/10.93.0koi/10.92.0koi/10.91.0jellyfish_9.99.4jellyfish_9.99.3jellyfish/9.99.4jellyfish/9.99.39.99.49.99.312.90.011.92.011.91.010.93.010.92.010.91.0Li, Xiaoming1-48/+48
Bug-AGL: SPEC-2745 Change-Id: I83c3a86a55f5e729e6cc1a4bb437edc300cccfad Signed-off-by: Li, Xiaoming <lixm.fnst@cn.fujitsu.com>
2020-02-06license: declare license on source filesClément Bénier1-0/+16
BUG-AGL: SPEC-3164 Change-Id: I93977106ccdcd12f5258f832c1f2bc2b9a8243e6 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2019-11-14fix(iiodevices-binding.c): use afb_event_is_valid to check eventicefish_8.99.5icefish_8.99.4icefish_8.99.3icefish_8.99.2icefish_8.99.1icefish/8.99.5icefish/8.99.4icefish/8.99.3icefish/8.99.2icefish/8.99.18.99.58.99.48.99.38.99.28.99.1Li Xiaoming1-1/+1
it will fix error of make: agl-service-iiodevices/binding/iiodevices-binding.c:103:15: error: ‘e->event’ is a pointer; did you mean to use ‘->’? if (!e->event.closure) { free(e); return NULL; } Bug-AGL: SPEC-2807 Change-Id: Id74ddff09b660e9dcdab046caf4770e31bfff39b Signed-off-by: Li Xiaoming <lixm.fnst@cn.fujitsu.com>
2019-04-08iiodevices-binding: Use-after-free fixedhalibut_8.0.6halibut_8.0.5halibut_8.0.4halibut_8.0.3halibut_8.0.2halibut_8.0.1halibut_8.0.0halibut_7.99.3halibut_7.99.2halibut_7.99.1halibut/8.0.6halibut/8.0.5halibut/8.0.4halibut/8.0.3halibut/8.0.2halibut/8.0.1halibut/8.0.0halibut/7.99.3halibut/7.99.2halibut/7.99.18.0.68.0.58.0.48.0.38.0.28.0.18.0.07.99.37.99.27.99.1halibutClément Bénier1-1/+1
- call afb req fail before free client Change-Id: I8e5157a6ede435541bbfe0f05e3db4dfd1f37dd9 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-10-12iiodevices: add afb_req_failClément Bénier1-4/+16
add afb_req_fail when a request is not desired Change-Id: Ifacf7203cf503229689db195c7844a73a4b1de13 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-10-12set_channel: no next channel when it doesn't existClément Bénier1-2/+21
in set_channel, when channel does not exist, next_channel has to be set to NULL Change-Id: I512691126200b2a1cc5041b1d2855087b8da1895 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-06-29Remove useless code and declare iio_infos in C codeClément Bénier1-1/+8
- Remove treat_iio_infos function that is no used at all in source code. - it's really not a good idea to define static variable in header file (causing redefinition each time header file is included), so move static definition of iio_infos in C code. Change-Id: I66c6c5593c9d10581b49ce5f2a9b2f4952584259 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh> Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-06-22string copy: use n copy(snprintf, strncpy)cle©mentbeénier1-13/+16
Change-Id: Ie543eb9628d2632427dd2d6ca215c92358d5920e Signed-off-by: cle©mentbeénier <clement.benier@iot.bzh>
2018-06-21read static infos: improve read static infos for channelsclement benier1-15/+53
gather all same static infos and add suffix for different values between channels. Change-Id: I48d3b01667b829411efa39405347d6e396211431 Signed-off-by: clement benier <clement.benier@iot.bzh>
2018-06-21add client_sub structure: split channel_fd structure into channel and client_subclement benier1-239/+252
Change-Id: I1bd0cea12128ac3d78d6f4c4ee472cd74e69469d Signed-off-by: clement benier <clement.benier@iot.bzh>
2018-06-21context_set vs uid: remove json key uid and set context for afb_reqclement benier1-39/+12
Remove the uid json argument and using afb_req_context_set/get to identify client session. Change-Id: Ib57f4443d20f4ee7cec9db17b6c6b81d6ca0e24c Signed-off-by: clement benier <clement.benier@iot.bzh>
2018-06-21binding iiodevices: handles 3 iiodevicesClément Bénier1-0/+571
handle accel, magn et anglvel iiodevices args key indicates the desired coordinates at subcription frequency can be also specified at subscription Example for subscription: - iiodevices subscribe { "event": "accel", "uid": "1", "args": "xyz", "frequency": "0.1" } - iiodevices subscribe { "event": "magn", "uid": "1", "args": "xz", "frequency": "0.1" } Change-Id: I7f300f56b5d69506434f31fbb6e552c7afdf7489 Signed-off-by: Clément Bénier <clement.benier@iot.bzh> Signed-off-by: clement benier <clement.benier@iot.bzh>