Commit Graph

593 Commits (ecaa0c8dc5616d15ea2791770cf89ea1d6592cca)

Author SHA1 Message Date
Simon Stürz ecaa0c8dc5 Update discovery and action timeouts and make JSONRPC timeout the last timeout 2022-07-21 16:27:11 +02:00
jenkins eb32e2274a Merge PR #539: Add phaseCount state to electricvehicle interface 2022-06-30 15:04:39 +02:00
jenkins a0186a0fb6 Merge PR #533: Add support for CoIoT 2022-06-30 15:04:37 +02:00
jenkins 48d5a182c6 Merge PR #531: Some fixes in Coap 2022-06-30 15:04:35 +02:00
Michael Zanetti 57048dd6e9 Add support for CoIoT
CoIoT is a shelly specific extensions to CoAP:
It adds a new Request code which is not part of the CoAP spec
as well as using CoAP multicast (which is part of CoAP).

This commit
* renames "statusCode" to "reqRspCode" which describes
the actual field more precisely as it is in fact a Request or Response
code, not a status code.
* Allows joining multicast groups, by default using the CoAP specified
multicast address.
* Allows setting custom Request codes in requests, as well as
processing the PDUs Request/response code by the client.
2022-06-30 10:16:20 +02:00
Michael Zanetti 62644650c0 Some fixes in Coap
* Fixed an indexOutOfRange warning when creating coap requests
  because the first addOption() call was calling
  m_options.insert(1) on an empty list.

* Old code was appending multiple UDP datagrams to a single big Coap
  message, however, Coap is specified to only send s single datagram
  per message. The datagram length specifies the payload size.

* some boolean member variables weren't initialized which resulted in
  occational wrong flags.

* Parsing had issues with determining the option length in some occations
  and also would crash when receiving coap messages without any options
  or payload. To get rid of the complex and erraneous index calculations,
  the entire package parsing is now using a DataStream.

(This makes it work with Shelly devices)
2022-06-30 10:15:31 +02:00
Simon Stürz 6bb36a773b Make sure the ping replies get cleaned up from queues 2022-06-29 12:47:55 +02:00
Simon Stürz c398f7ab2f Fix ping requestId and sequence number endiness from and to the network 2022-06-29 12:25:09 +02:00
Michael Zanetti 8d50955bcc Add phaseCount state to electricvehicle interface 2022-06-27 12:37:44 +02:00
Simon Stürz 0d20cf7816 Hold reference count of monitor objects
Make host lookup optional
Cleanup pending ping on monitor unregister
2022-06-20 16:58:05 +02:00
Michael Zanetti 568bbc6972 Smaller fixes in the NetworkDiscovery
Fixes a theoretical memory leak (m_cacheSettings wasn't delete)
which isn't really an issue in practice but valgrind complains on it.

Fixes a typo: m_reties -> m_retries
2022-06-20 13:16:42 +02:00
Simon Stürz 2dbd8c47ba Add ping retry feature and provide it to the monitor 2022-06-20 13:16:42 +02:00
jenkins f33d674d3c Merge PR #529: Provide access to the network device discovery cache 2022-06-16 00:20:52 +02:00
jenkins d44776111e Merge PR #528: Properly use pkgconfig to find nymea-mqtt 2022-06-16 00:20:50 +02:00
jenkins 79e8c52765 Merge PR #527: Print a better warning when setStateValue() is called with a wrong name 2022-06-16 00:20:49 +02:00
jenkins 45c20c56cc Merge PR #526: Fix Things filter by param method 2022-06-16 00:20:47 +02:00
jenkins 03efba295e Merge PR #524: Add alarm and firesensor interfaces 2022-06-16 00:20:46 +02:00
jenkins c52e2ef6b8 Merge PR #522: Fix allowedValues for battery interface 2022-06-16 00:20:44 +02:00
Simon Stürz 289998af32 Align cache updated signal with method wording 2022-06-02 14:09:23 +02:00
Simon Stürz 08d4599f01 Provide access to the network device discovery cache 2022-06-02 14:07:35 +02:00
Michael Zanetti f6da6d47a9 Properly use pkgconfig to find nymea-mqtt 2022-05-31 17:19:33 +02:00
Michael Zanetti 48095b2ced Print a better warning when setStateValue() is called with a wrong name 2022-05-31 17:17:52 +02:00
Michael Zanetti 6da1c70e5b Add alarm and fire seonsor interfaces 2022-05-31 17:16:42 +02:00
Simon Stürz 964edeee5d Things filter by param 2022-05-23 16:10:12 +02:00
Michael Zanetti 2a62ab17d4 Fix allowedValues for battery interface 2022-05-13 11:26:32 +02:00
Michael Zanetti bbc585e92e Fix filters genering wrong data types
When enabling a jitter filter on integer states (e.g. a signal
strength that repeatedly jumps up and down by 1), old code
may cause integer state to be populated with floating point values
as the filtering happens after the intial validation for the new
value being valid.
2022-05-13 11:25:48 +02:00
jenkins dbcbbfcf97 Merge PR #515: Allow modbus RTU plugins to request a connection reset 2022-05-03 23:27:13 +02:00
jenkins eec7566d50 Merge PR #512: Remove smartmeterconsumer from evcharger 2022-05-03 23:27:09 +02:00
Simon Stürz 1d04da6205 Make sure the ping timer exists to prevent crash if not available 2022-04-26 16:45:07 +02:00
Simon Stürz f3760ff84a Fix networkdevicemonitor virtual destructor 2022-04-26 11:17:12 +02:00
Simon Stürz 66d62b87de Update debug categories and use qInfo, fix vietual destructor for the monitor 2022-04-25 17:07:48 +02:00
Simon Stürz 76b7bc1267 Fix ping crash if the host address is not valid 2022-04-25 15:27:35 +02:00
Simon Stürz c59185672f Add mac address class and unit tests
Finish updated network discovery
Improve ARP and monitor handling
Introduce network device info cache housekeeping
2022-04-13 11:08:29 +02:00
Simon Stürz 14ea1bef4a Restructure network discovery and add discovery 2022-04-13 11:08:00 +02:00
Michael Zanetti 9b7e5e469d Allow modbus RTU plugins to request a connection reset 2022-04-06 23:28:54 +02:00
Michael Zanetti ffd0c7d690 Remove smartmeterconsumer from evcharger 2022-04-04 15:45:42 +02:00
Jenkins nymea 8b87cf674f Merge PR #505: Fix crash for long taking mac address lookup 2022-03-27 19:49:44 +02:00
Jenkins nymea 20956525b3 Merge PR #498: Add discoveryType thing class property 2022-03-27 19:49:35 +02:00
Jenkins nymea d83fed97d8 Merge PR #496: Don't generate events for state changes any more 2022-03-27 19:49:32 +02:00
Jenkins nymea 443dbfb42b Merge PR #494: Split thing cache into individual files 2022-03-27 19:49:30 +02:00
Jenkins nymea 86c6026690 Merge PR #493: Fix some interface definitions (minimum/maximum vs min/max) 2022-03-27 19:49:28 +02:00
Simon Stürz 64d347d921 Fix crash for long taking mac address loockup 2022-03-21 12:49:51 +01:00
Michael Zanetti 5323ab2631 Add discoveryType thing class property
Some plugins may support network discovery, but may not be able to clearly
identify a device and return a list of discovery results that may
be the device, but also may not. As this breaks some app flows they
will be marked as "weak" discovery and can be excluded from said setup
wizards.

NOTE: This commit does not bump the API version even though it should
to avoid merge conflicts with other branches that do bump the version.
2022-02-10 17:38:01 +01:00
Michael Zanetti 7bfb48feac Split thing state cache into individual files 2022-02-09 12:04:08 +01:00
Michael Zanetti 2a91dad1f0 Don't generate events for state changes any more
Up until now, nymea would generate EventTypes for every StateType
as well as emit an Event (along with a StateChanged notification) for
every change. This results in a lot of duplicated network traffic
which is of not much use. The StateChanged notification contains
all the information in the Event too and nymea:app actually never
really used Events for state changes.

This commit removes the events from the ThingClass, making it a lot
smaller and stops emitting Events for state changes.

As this is breaking the behavior, the JSONRPC API major version
is bumped.
2022-02-08 10:38:41 +01:00
Michael Zanetti 6ab4d49ee1 Add multi user support 2022-02-08 10:36:14 +01:00
Michael Zanetti 717b4f33cc Remove deprecated Devices, Action, Events, States namespaces from JSONRPC 2022-02-08 00:29:07 +01:00
Michael Zanetti ecac5d9dc9 Fix some interface definitions (minimum/maximum vs min/max) 2022-02-02 14:35:12 +01:00
Jenkins nymea 3d5c9b477b Merge PR #483: Add a providedInterfaces property to thingClass 2021-12-11 00:31:11 +01:00
Jenkins nymea b8e58511b9 Merge PR #482: Add more "by name" thing methods and c++11 list_initializers for lists 2021-12-11 00:31:10 +01:00