You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates:
- cleaned up lots of comments and debug stuff
- set device selection menu to filter by the hash generated by CoreBluetooth to prune out devices that advertise noisily (like my TV, which beacons pretty much nonstop and clutters up the menu)
// ************************* remove if statement from code! but holy fuck this TV is the noisiest BLE advertiser in the world what the actual fuck *****************************
101
-
/*
102
-
P.S. I'd love to figure out how to filter by a unique ID other than the name, but all I can seem to find online is that MAC address and other hardware flag things I think would be helpful to filter by are not advertised over BLE, so I don't know what to do about it.
103
-
A unique identifier would be super helpful for flagging your pinetime in the app so you can have the app automatically connect and skip the process of scanning and selecting a pinetime.
104
-
For now I'm going to selfishly block my TV, and anyone else who touches this can either modify the if statement below to suit their TV or remove it.
105
-
*/
106
-
107
-
if newPeripheral.name !="[TV] Samsung 8 Series (50)"{
// compare peripheral hashes to make sure we're only adding each device once -- super helpful if you have a very noisy BLE advertiser nearby!
101
+
if !peripherals.contains(where:{$0.peripheralHash == newPeripheral.peripheralHash}){
102
+
// I think there's probably a way to get rid of this array someday, but for now it's useful for displaying the device names. You cant have a Peripheral struct as a key in the peripheralDictionary, so there has to be some way to pass the names to the UI, and the peripherals array seems like it.
TODO: hey alpha testers! Please send me a message/comment/email/toot/whatever with the peripheralHash of your PineTime! While the hash is valuable for weeding out repeat broadcasters, I'm not sure what exactly is hashed, and if that would be unique between two of the same device. If it's just a hash of "InfiniTime" + $INFINITIMEUUID, then there will be unintended collisions and this won't solve anything for people that have more than one InfiniTime watch to sync.
109
+
110
+
I'm getting the same value each time I run the app (138271609), let's hope yours is different!
Copy file name to clipboardExpand all lines: README.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,12 +21,11 @@ This is a proof-of-concept, barely-functional iOS application to interact with y
21
21
- Figure out how to control music from watch
22
22
- Optional auto-connect: save some device-specific characteristic (MAC address? Serial number?) to the app, and allow users to automatically connect to their device. I know I probably won't want to connect to anything other than my own pinetime with very few exceptions, so it'd save me a few taps if it just snagged my watch automatically when I open the app.
23
23
- Learn anything whatsoever about making an app design in SwiftUI that isn't a horrific clusterwhoops
24
-
- Send notifications to the phone, probably. Might be nice to get a buzz on your phone if the watch disconnects for some reason?
25
-
- Options menu: I think it'd be nice to have user-configurable options. I was thinking things like:
26
-
- "send notification to watch when watch battery falls below [x]"
27
-
- "send notification to watch when phone battery falls below [x]"
28
-
- "turn on/off watch notifications"
29
-
- etc. I guess my ideas are all based on adding/subtracting notifications...
24
+
- Send notifications to the phone, probably. Might be nice to get a buzz on your phone if the watch disconnects for some reason
25
+
- User-configurable settings:
26
+
- select device for autoconnect
27
+
- enable/disable notifications
28
+
- taking suggestions
30
29
- Clean everything up. Still tons of commented lines and code blocks from debugging and trial and error stuff that I should really remove. Probably should add a few more explanatory comments here and there too, mostly for my own benefit...
31
30
- I mean, there's the navigation thing? I guess poke at that. I'm not super sure that's a priority for me at all, but if that's something that people want I can definitely look into it sooner.
0 commit comments