@@ -22,22 +22,26 @@ struct BLEWriteManager {
2222 return
2323 }
2424 bleManager. infiniTime. writeValue ( writeData, for: characteristic, type: . withResponse)
25+ log ( " Wrote to music app " , type: . info, caller: " BLEWriteManager " )
2526 }
2627
2728 func writeHexToMusicApp( message: [ UInt8 ] , characteristic: CBCharacteristic ) -> Void {
2829 guard bleManager. infiniTime != nil else { return }
2930 let writeData = Data ( bytes: message, count: message. capacity)
3031
3132 bleManager. infiniTime. writeValue ( writeData, for: characteristic, type: . withResponse)
33+ log ( " Wrote to music app " , type: . info, caller: " BLEWriteManager " )
3234 }
3335
3436 func setTime( characteristic: CBCharacteristic ) {
3537 guard bleManager. infiniTime != nil else { return }
3638
3739 do {
3840 try bleManager. infiniTime. writeValue ( SetTime ( ) . currentTime ( ) . hexData, for: characteristic, type: . withResponse)
41+ log ( " Set watch time " , type: . info, caller: " BLEWriteManager " )
3942 } catch {
4043 bleManager. setTimeError = true
44+ log ( " Error setting watch time " , caller: " BLEWriteManager " )
4145 }
4246 }
4347
@@ -52,6 +56,7 @@ struct BLEWriteManager {
5256
5357 if !notification. isEmpty && watchNotifications {
5458 bleManager. infiniTime. writeValue ( notification, for: bleManager. notifyCharacteristic, type: . withResponse)
59+ log ( " Notification sent with title: \( notif. title) " , caller: " BLEWriteManager " )
5560 }
5661 }
5762
@@ -65,6 +70,7 @@ struct BLEWriteManager {
6570
6671 if notification. count > 0 && watchNotifications {
6772 bleManager. infiniTime. writeValue ( notification, for: bleManager. notifyCharacteristic, type: . withResponse)
73+ log ( " Sent lost notification " , type: . info, caller: " BLEWriteManager " )
6874 }
6975 }
7076
@@ -102,6 +108,7 @@ struct BLEWriteManager {
102108 let writeData = Data ( bytes: bytes as [ UInt8 ] , count: 49 )
103109 if bleManager. weatherCharacteristic != nil && bleManager. infiniTime != nil {
104110 bleManager. infiniTime. writeValue ( writeData, for: bleManager. weatherCharacteristic, type: . withResponse)
111+ log ( " Set watch current weather " , type: . info, caller: " BLEWriteManager " )
105112 }
106113 }
107114
@@ -133,6 +140,7 @@ struct BLEWriteManager {
133140
134141 if bleManager. weatherCharacteristic != nil && bleManager. infiniTime != nil {
135142 bleManager. infiniTime. writeValue ( writeData, for: bleManager. weatherCharacteristic, type: . withResponse)
143+ log ( " Set watch forecast " , type: . info, caller: " BLEWriteManager " )
136144 }
137145 }
138146
@@ -151,6 +159,8 @@ struct BLEWriteManager {
151159 bleManager. infiniTime. writeValue ( distance, for: bleManager. navigationDistanceCharacteristic, type: . withResponse)
152160 bleManager. infiniTime. writeValue ( progress, for: bleManager. navigationProgressCharacteristic, type: . withResponse)
153161 bleManager. infiniTime. writeValue ( icon, for: bleManager. navigationFlagsCharacteristic, type: . withResponse)
162+
163+ log ( " Wrote navigation update " , type: . info, caller: " BLEWriteManager " )
154164 }
155165}
156166
0 commit comments