File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed
src/commonMain/kotlin/io/rebble/libpebblecommon/services Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import kotlinx.coroutines.channels.Channel
17
17
*/
18
18
class SystemService (private val protocolHandler : ProtocolHandler ) : ProtocolService {
19
19
val receivedMessages = Channel <SystemPacket >(Channel .BUFFERED )
20
+ public final var appVersionRequestHandler: (suspend () -> PhoneAppVersion .AppVersionResponse )? = null
20
21
21
22
private var watchVersionCallback: CompletableDeferred <WatchVersion .WatchVersionResponse >? = null
22
23
private var watchModelCallback: CompletableDeferred <UByteArray >? = null
@@ -72,28 +73,8 @@ class SystemService(private val protocolHandler: ProtocolHandler) : ProtocolServ
72
73
watchModelCallback?.completeExceptionally(Exception (" Failed to fetch watch model" ))
73
74
watchModelCallback = null
74
75
}
75
- is PhoneAppVersion -> {
76
- val responsePacket = PhoneAppVersion .AppVersionResponse (
77
- UInt .MAX_VALUE ,
78
-
79
- 0u ,
80
- PhoneAppVersion .PlatformFlag .makeFlags(
81
- getPlatform(), emptyList()
82
- ),
83
- 2u ,
84
- 4u ,
85
- 4u ,
86
- 2u ,
87
- ProtocolCapsFlag .makeFlags(
88
- listOf (
89
- ProtocolCapsFlag .Supports8kAppMessage ,
90
- ProtocolCapsFlag .SupportsExtendedMusicProtocol
91
- )
92
- )
93
-
94
- )
95
-
96
- protocolHandler.send(responsePacket)
76
+ is PhoneAppVersion .AppVersionRequest -> {
77
+ appVersionRequestHandler?.invoke()
97
78
}
98
79
else -> receivedMessages.offer(packet)
99
80
}
You can’t perform that action at this time.
0 commit comments