Skip to content

Commit 96490c9

Browse files
authored
Merge pull request #14 from matejdro/docs
Improve protocol documentation
2 parents fff6b3a + b3943c3 commit 96490c9

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

src/commonMain/kotlin/io/rebble/libpebblecommon/packets/Music.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ open class MusicControl(val message: Message) : PebblePacket(ProtocolEndpoint.MU
3131
artist: String = "",
3232
album: String = "",
3333
title: String = "",
34+
/**
35+
* Length of current track in milliseconds
36+
*/
3437
trackLength: Int? = null,
3538
trackCount: Int? = null,
3639
currentTrack: Int? = null
@@ -57,7 +60,13 @@ open class MusicControl(val message: Message) : PebblePacket(ProtocolEndpoint.MU
5760

5861
class UpdatePlayStateInfo(
5962
playbackState: PlaybackState = PlaybackState.Unknown,
63+
/**
64+
* Current playback position in milliseconds
65+
*/
6066
trackPosition: UInt = 0u,
67+
/**
68+
* Play rate in percentage (100 = normal speed)
69+
*/
6170
playRate: UInt = 0u,
6271
shuffle: ShuffleState = ShuffleState.Unknown,
6372
repeat: RepeatState = RepeatState.Unknown

src/commonMain/kotlin/io/rebble/libpebblecommon/packets/System.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ open class WatchVersion(message: Message) : SystemPacket(endpoint) {
278278

279279
/**
280280
* When *true*, it means watch has been connected to a different phone before this phone.
281+
*
282+
* Flag remains true until
283+
* [io.rebble.libpebblecommon.packets.blobdb.BlobCommand.ClearCommand] is
284+
* sent to the watch
281285
*/
282286
val isUnfaithful = SBoolean(m)
283287
}

src/commonMain/kotlin/io/rebble/libpebblecommon/packets/blobdb/Timeline.kt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,27 @@ class TimelineItem(
3131

3232
val itemId = SUUID(m, itemId)
3333
val parentId = SUUID(m, parentId)
34+
35+
/**
36+
* Timeline pin timestamp in unix time
37+
*/
3438
val timestamp = SUInt(m, timestamp, endianness = '<')
39+
40+
/**
41+
* Duration of the pin in minutes
42+
*/
3543
val duration = SUShort(m, duration, endianness = '<')
44+
45+
/**
46+
* Serialization of [Type]. Use [Type.value].
47+
*/
3648
val type = SUByte(m, type.value)
49+
50+
/**
51+
* Serialization of [Flag] entries. Use [Flag.makeFlags].
52+
*/
3753
val flags = SUShort(m, flags, endianness = '<')
54+
3855
val layout = SUByte(m, layout)
3956
val dataLength = SUShort(m, endianness = '<')
4057
val attrCount = SUByte(m, attributes.size.toUByte())
@@ -116,11 +133,30 @@ class TimelineItem(
116133
}
117134

118135
enum class Flag(val value: Int) {
136+
/**
137+
* ???
138+
*
139+
* Name suggests that setting this to false would hide the pin on the watch,
140+
* but it does not seem to do anything
141+
*/
119142
IS_VISIBLE(0),
143+
144+
/**
145+
* When set, pin is always displayed in UTC timezone on the watch
146+
*/
120147
IS_FLOATING(1),
148+
149+
/**
150+
* Whether pin spans throughout the whole day
151+
*/
121152
IS_ALL_DAY(2),
153+
122154
FROM_WATCH(3),
123155
FROM_ANCS(4),
156+
157+
/**
158+
* When set, quick view will be displayed on the watchface when event in progress.
159+
*/
124160
PERSIST_QUICK_VIEW(5);
125161

126162
companion object {

0 commit comments

Comments
 (0)