Commit graph

40 commits

Author SHA1 Message Date
Max Friedrich f84a0a3897
Merge branch 'develop' into remove-nm-reference 2022-04-19 00:40:29 +02:00
Jean-François Milants a8b7fbe48b New changes according to the review : Priority 0 for display, 1 for system, timer and ble host, and 2 for ble LL 2022-03-21 20:53:46 +01:00
Reinhold Gschweicher 5fe5cee9ef Add missing nrf_log.h includes shadowed by SystemMonitor.h
Some components were missing a `nrf_log.h` include. This missing
include was accidentally provided by the SystemMonitor.h header, which
was included by Systemtask.h
2022-03-08 20:28:54 +01:00
Jean-François Milants ef44b763d9 Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime into evergreen22-airplane-mode
Apply a few changes that were requested in the PR during the review.

# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/Apps.h
#	src/displayapp/DisplayApp.cpp
#	src/displayapp/Messages.h
#	src/displayapp/screens/settings/Settings.cpp
2022-02-20 15:40:49 +01:00
Jean-François Milants 40cdb54772 Merge branch 'airplane-mode' of https://github.com/evergreen22/InfiniTime into evergreen22-airplane-mode
# Conflicts:
#	src/CMakeLists.txt
#	src/displayapp/Apps.h
#	src/displayapp/DisplayApp.cpp
#	src/displayapp/Messages.h
#	src/displayapp/screens/settings/Settings.cpp
2022-02-20 15:25:24 +01:00
minacode a1db9fca13 remove unused reference 2022-02-16 13:34:14 +01:00
Zorvalt d967efa197 Fix biased BLE pass key generation 2022-02-12 18:44:05 +01:00
James A. Jerkins 319030d9e1 Add airplane mode feature
Implements 'Airplane mode' feature to disable and enable bluetooth/ble
Adds airplaneMode as a non-persisted setting
Adds a setting menu for switching airplane mode on and off
Displays an airplane symbol on the Digital watch face and the
    PineTimeStyle watch face when airplane mode is enabled
Always enables bluetooth/ble on boot (disable airplane mode)
Alphabetizes the settings menu options
Style cleanups

Closes #632
2021-12-23 20:30:14 -06:00
James A. Jerkins eca0588c23 Optional secure pairing with a passkey
Support passkey pairing when requested by the central
Fix a comment and reorder warning
2021-12-21 16:02:01 -06:00
Tim Keller 1470489e7b Fix Failed rebase. 2021-12-10 01:49:03 +00:00
Tim Keller 6393a17d74 List Dir works? 2021-12-10 01:18:57 +00:00
Tim Keller f57f797ff5 Added Blank FSService that exposes only version info 2021-12-10 01:18:57 +00:00
Avamander e8c1302cd6
Merge branch 'develop' into patch-weather 2021-12-09 22:20:29 +02:00
James A. Jerkins 048ecd41e4 Adjust BLE/LL stacks, style, comments, refactoring
Increase BLE task stack +200 and decrease LL task stack -200
more braces!
2021-12-09 21:14:16 +01:00
James A. Jerkins 150fa3b661 Persist bond between reboots
Save bond information in the FS after a disconnect or encryption change
if the bond is not already stored. The bond is restored on boot enabling
automatic reconnection to a previously bonded central.

Two consecutive watch reboots with the central out of range (or BLE off)
will remove the stored bond from the watch.
2021-12-09 21:14:16 +01:00
James A. Jerkins 62dbcbfc95 Connect and bond with a passkey
This commit adds the following:
    Passkey pairing - passkey is displayed on watch
    Swipe down to clear passkey screen
    Connection encryption
    Connection bonding
    Automatic reconnects to a bonded peripheral
    Trusted device on Android

Note that persisting the bond between reboots is NOT included in
this commit. Therefore, rebooting the watch will cause reconnect failures.
You must delete the bond from the phone to reconnect/pair.
2021-12-09 21:14:16 +01:00
Avamander bda96dc595 Initial Weather service skeleton 2021-12-04 22:03:40 +02:00
Reinhold Gschweicher ac7b2da611 Update includes to to be relative to src directory
Don't use relative imports like `../foo.h` as those depend on the
relative position of both files. Rather than that use imports relative
to the `src` directory, which explicitly is part of the include
directories.
2021-11-15 22:02:49 +01:00
Jean-François Milants 2c5015add7 Enable/disable notifications for motion service. 2021-10-17 08:42:49 +02:00
Jean-François Milants 60a49af886 Add MotionService : expose step count and RAW X/Y/Z values to the host. 2021-10-17 08:23:44 +02:00
Jean-François Milants d1f50157c7 MotionService : fix typo and characteristic array size + send notification only if the host subscribed to them. 2021-10-17 08:23:01 +02:00
Jean-François Milants 9afa412a2a Merge branch 'refactor_adv' of https://github.com/evergreen22/InfiniTime into evergreen22-refactor_adv
# Conflicts:
#	src/components/ble/NimbleController.cpp
2021-09-13 20:22:27 +02:00
Tim Gates 84a93b5441
docs: Fix a few typos (#606)
* docs: Fix a few typos

There are small typos in:
- doc/versioning.md
- src/components/ble/NimbleController.cpp
- src/libs/mynewt-nimble/CODING_STANDARDS.md
- src/libs/mynewt-nimble/docs/btshell/btshell_GAP.rst
- src/systemtask/SystemTask.cpp

Fixes:
- Should read `milliseconds` rather than `miliseconds`.
- Should read `unnecessary` rather than `uncesseray`.
- Should read `target` rather than `tharget`.
- Should read `project` rather than `projct`.
- Should read `preferred` rather than `prefered`.
- Should read `functioning` rather than `functionning`.
- Should read `forever` rather than `forver`.
- Should read `existing` rather than `exisiting`.
2021-09-13 20:02:53 +02:00
James A. Jerkins 22571d4b38 Advertise fast for at least 30 secs then slow down
On power up, advertise aggressively for at least 30 seconds then switch
to a longer interval to conserve battery life. This fast/slow pattern
is designed to balance connection response time and battery life.

When a disconnect event is received restart the fast/slow pattern.

When a failed connect event is received, restart the fast/slow pattern.

When the screen is activated and ble is not connected, restart the fast/slow pattern.

This pattern is consistent with Apple's BLE developer standards (QA 1931).
2021-09-05 15:53:20 -05:00
James A. Jerkins 4820b2ffe8 Revert "Linear decrease of advert rate to conserve battery"
This reverts commit c32ba844e0.
2021-09-05 15:52:01 -05:00
James A. Jerkins c32ba844e0 Linear decrease of advert rate to conserve battery
Start advertising aggressively when powered on then
slow down linearly over 75 seconds. This will conserve
battery by not advertising rapidly the whole time we
are seeking a connection. The slowest rate is
approximately once every 4.5 seconds to balance
responsiveness and battery life.

We use a fixed advertising duration of 5 seconds and start
with a 62.5 ms advertising interval. Every 5 seconds
(the advertising duration) we step up to a larger
advertising interval (slower advertising). We continue
to increase the advertising interval linearly for
75 seconds from the start of advertising. At 75 seconds
we have an advertising interval of 4.44 seconds which we
keep until connected. A reboot will restart the sequence.

When we receive a disconnect event we restart the sequence
with fast advertising and then slow down as described above.
Note that we are not using the BLE high duty cycle setting to
change the advertising rate. The rate is managed by repeatedly
setting the minimum and maximum intervals.

The linear rate of decrease and the slowest interval size
were determined experimentally by the author. The 5.3 Core
spec suggests that you not advertise slower than once
every 1.2 seconds to preserve responsiveness but we
ignored that suggestion.
2021-09-04 15:57:07 -05:00
James A. Jerkins 3e1fe687b8 Fix styles issues - no change to functionality 2021-09-01 22:50:56 -05:00
James A. Jerkins d69a8e84fa Fix race condition, connect->disconnect->discovery 2021-09-01 22:48:01 -05:00
James A. Jerkins 00a3f84ea7 Completely reset connection state on fail 2021-08-30 23:17:16 -05:00
James A. Jerkins be31f417db WIP Refactor ble advertising
Refactor ble advertising based on ble standards and conventions.
Changes are based on the bleprph example code, bluetooth docs, and nimble docs.
2021-08-29 15:50:04 -05:00
Jean-François Milants e21f6a7f41 Notify battery level every 10 minutes when connected to a BLE host.
Refactor battery percent : only use uint8_t to store the battery % remaining.
2021-07-11 16:55:06 +02:00
Jean-François Milants 7f9cc51b05 Initialize SystemTask, DisplayApp and HeartRateTask as global static variable instead of variables on the heap. We don't need them on the heap as we know their size at build time, it'll reduce memory fragmentation and it'll make memory analysis easier. 2021-06-06 15:56:03 +02:00
Avamander 40d45d923b Reformatted all the files according to clang-format style 2021-04-24 11:39:53 +03:00
petter 169b861af1 fix build warnings in HR implementation 2021-01-25 14:53:44 +01:00
Jean-François Milants 522a1eb0be Merge branch piggz/nav into develop:
- fix conflict
 - add a icon for the navigation app.
2021-01-20 21:34:09 +01:00
Jean-François Milants 68674cec53 Add heart rate BLE service. 2021-01-17 16:34:14 +01:00
okaestne 1516573df4
Include cleanup: components 2020-11-16 01:35:45 +01:00
JF 29f8074fcb Refactoring of BLE service discovery : it is now implemented into the classes of the services. 2020-10-29 16:06:01 +01:00
JF f90f2254f5 Reset BLE services on disconnect, do not start advertising if a connection is already established. 2020-10-28 18:23:09 +01:00
Avamander 6c86d1d9d7 Fixed all the includes that were broken due to the renames 2020-10-02 22:16:48 +03:00
Renamed from src/components/Ble/NimbleController.cpp (Browse further)