InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.63k stars 901 forks source link

Add "Find my phone" app. #2053

Open vchigrin opened 2 months ago

vchigrin commented 2 months ago

This change set adds implementation of client for BLE "Immediate alert service", allowing companion apps get notifications from PineTime watch when requested by user.

Fixes: #343

vchigrin commented 2 months ago

This pull request is result of joint work of @jmlich and @vchigrin, most of the code is written by Jozef (personal contributions can be found by commit history).

vchigrin commented 2 months ago

That is how that app looks like photo_2024-04-25_23-57-58 After user presses "Mild" or "High" button phone starts ringing and vibrating. User can stop this either by pressing "None" button on the PineTime, or by pressing button in GadgetBridge companion app on the phone.

To make this work some changes in GadgetBridge application were required, I suppose to upstream this after ensuring that this functionality will be accepted in InfiniTime.

github-actions[bot] commented 2 months ago
Build size and comparison to main: Section Size Difference
text 379080B 1584B
data 940B 0B
bss 62660B -880B
vchigrin commented 1 month ago

Corresponding PR to GadgetBridge https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3746

NitroNils commented 1 month ago

And reverse? Find my watch? Make PineTime blink display and vibrate? Don't know what this would take. Just a logical follow up 😁

jmlich commented 1 month ago

Find my watch already works. It is Alert Notification Service. In Amazfish -> Settings -> Debug page -> Phone Call. Also Immediate Alert Service is implemented and shows None/Mild/High levels, but this is not right to find watch.

crazycrystals commented 1 month ago

Sorry if its offtopic, but is it also possible to have something like a signal strength indicator so you can see how close the device is and triangulate it? Doing a ring with an app could be broken by do not disturb.

jmlich commented 1 month ago

The signal strength or more precisely RSSI (Received Signal Strength Indication) is specified/measured in BLE and Nimble can provide the value. I am not sure if it is reasonable reachable in the code.