Commit graph

14 commits

Author SHA1 Message Date
rbaron
9ea5c7b4d0 Make init & loop fns static 2023-07-23 18:30:23 +02:00
rbaron
1a5acd02a5 [ble] __ASSERT initialization & sensor reading
After we tracked down a rare, annoying bug for the zigbee sample in #150,
this PR does something similar for the ble sample. If there's an error
either initializing the board of reading the sensors, __ASSERT will
reboot the system, instead of letting it hang forever.
2023-07-23 18:10:28 +02:00
rbaron
7ac6d98b3b [ble] Make advertising non-connectable
I've been debugging a Shelly [bluetooth
proxy](https://www.home-assistant.io/integrations/shelly/#bluetooth-support)
feature, which didn't like b-parasite's advertising. It swallowed it before proxying it to HA.

I compared to both ATC and the legacy b-parasite advertising
(pre-nrf-connect) and found it to be related to the
non-connectable/non-scannable settings. Until this PR, we were
mistankenly settings the advertising to scannable, although with no
scannable data. The Zephyr code that sets this parameter based on the
scannable data is [here](c0fcd35531/subsys/bluetooth/host/adv.c (L860)).

My bet is that some scanners like ESPHome are okay with this, but Shelly
is not. Either way, I believe this PR makes the advertisements more
compliant.
2023-04-16 12:28:23 +02:00
rbaron
28db7224a6 Make advertisement intervals configurable
We were previously relying on the default values (100ms, 150ms). This
PR makes it easier to test and configure parameters for different
tradeoffs between range / power consumption (#98).
2023-01-28 11:44:17 +01:00
Marvin Rohrbach
ee38d4561a Fix: Counter was missing 2023-01-12 08:12:18 +00:00
rbaron
cb6ed73691 Add battery percentage computation 2022-12-09 19:02:55 +01:00
rbaron
f7806d4c7e Really fixing BTHome v2 illuminance encoding this time 2022-12-04 10:32:20 +01:00
rbaron
cab55d9b8c <zephyr/zephyr.h> -> <zephyr/kernel.h> everywhere 2022-12-04 10:16:00 +01:00
rbaron
381bbb7ceb Fix illuminance encoding in ble, BTHome v2 2022-12-04 10:13:01 +01:00
rbaron
8bfd75de78 Fix BTHome v2 encoding - sort entries by Object IDs 2022-12-03 13:49:17 +01:00
rbaron
bc08c8284a Updates Zephyr imports to use the <zephyr/...> prefix
See https://docs.zephyrproject.org/latest/releases/release-notes-3.2.html#api-changes
2022-12-03 11:26:03 +01:00
rbaron
a93171b9bf Adds support for user-supplied BT address
Also cleans up BLE configs
2022-12-01 19:48:36 +01:00
rbaron
3b104cdf24 Implements BTHome v1 and v2 encodings for ble sample 2022-11-29 20:05:41 +01:00
rbaron
5ceccfafcc Extracts prstlib
Moves ble sample to code/nrf-connect/samples
2022-11-27 18:37:42 +01:00