File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/commonMain/kotlin/io/rebble/libpebblecommon/services/app Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
kotlin.code.style =official
2
2
3
3
group =io.rebble.libpebblecommon
4
- version =0.1.22
4
+ version =0.1.23
5
5
org.gradle.jvmargs =-Xms128M -Xmx1G -XX:ReservedCodeCacheSize =200M
6
6
kotlin.native.binary.memoryModel =experimental
7
7
kotlin.mpp.androidSourceSetLayoutVersion =2
Original file line number Diff line number Diff line change 1
1
package io.rebble.libpebblecommon.services.app
2
2
3
+ import com.benasher44.uuid.Uuid
3
4
import io.rebble.libpebblecommon.ProtocolHandler
4
5
import io.rebble.libpebblecommon.packets.AppRunStateMessage
5
6
import io.rebble.libpebblecommon.protocolhelpers.PebblePacket
6
7
import io.rebble.libpebblecommon.protocolhelpers.ProtocolEndpoint
7
8
import io.rebble.libpebblecommon.services.ProtocolService
8
9
import kotlinx.coroutines.channels.Channel
10
+ import kotlinx.coroutines.flow.first
11
+ import kotlinx.coroutines.flow.receiveAsFlow
9
12
10
13
class AppRunStateService (private val protocolHandler : ProtocolHandler ) : ProtocolService {
11
14
val receivedMessages = Channel <AppRunStateMessage >(Channel .BUFFERED )
@@ -26,4 +29,12 @@ class AppRunStateService(private val protocolHandler: ProtocolHandler) : Protoco
26
29
receivedMessages.trySend(packet)
27
30
}
28
31
32
+ suspend fun startApp (uuid : Uuid ) {
33
+ send(AppRunStateMessage .AppRunStateStart (uuid))
34
+ }
35
+
36
+ suspend fun stopApp (uuid : Uuid ) {
37
+ send(AppRunStateMessage .AppRunStateStop (uuid))
38
+ }
39
+
29
40
}
You can’t perform that action at this time.
0 commit comments