PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Music endpoint

Pebble Protocol music backend for Music. More...

Data Structures

struct  MusicEndpointPlayStateInfo
 Payload of MusicEndpointCmdIDPlayStateInfoResponse. More...
 

Enumerations

enum  MusicEndpointCmdID {
  MusicEndpointCmdIDTogglePlayPause = 0x1 , MusicEndpointCmdIDPause = 0x2 , MusicEndpointCmdIDPlay = 0x3 , MusicEndpointCmdIDNextTrack = 0x4 ,
  MusicEndpointCmdIDPreviousTrack = 0x5 , MusicEndpointCmdIDVolumeUp = 0x6 , MusicEndpointCmdIDVolumeDown = 0x7 , MusicEndpointCmdIDGetAllInfo = 0x8 ,
  MusicEndpointCmdIDNowPlayingInfoResponse = 0x10 , MusicEndpointCmdIDPlayStateInfoResponse = 0x11 , MusicEndpointCmdIDVolumeInfoResponse = 0x12 , MusicEndpointCmdIDPlayerInfoResponse = 0x13 ,
  MusicEndpointCmdIDInvalid = 0xff
}
 Music endpoint message identifier, the first byte of every message. More...
 
enum  MusicEndpointPlaybackState {
  MusicEndpointPlaybackStatePaused = 0 , MusicEndpointPlaybackStatePlaying = 1 , MusicEndpointPlaybackStateRewinding = 2 , MusicEndpointPlaybackStateForwarding = 3 ,
  MusicEndpointPlaybackStateUnknown = 4
}
 Playback state on the wire. More...
 
enum  MusicEndpointShuffleMode { MusicEndpointShuffleModeUnknown = 0 , MusicEndpointShuffleModeOff = 1 , MusicEndpointShuffleModeOn = 2 }
 Shuffle mode on the wire. More...
 
enum  MusicEndpointRepeatMode { MusicEndpointRepeatModeUnknown = 0 , MusicEndpointRepeatModeOff = 1 , MusicEndpointRepeatModeOne = 2 , MusicEndpointRepeatModeAll = 3 }
 Repeat mode on the wire. More...
 
enum  MusicEndpointSkipSeeksFlag { MusicEndpointSkipSeeksWithinTrack = (1 << 0) }
 Bits of the optional byte trailing MusicEndpointPlayStateInfo. More...
 

Functions

void music_endpoint_handle_mobile_app_info_event (const PebbleRemoteAppInfoEvent *app_info_event)
 Handle the mobile app info event.
 
void music_endpoint_handle_mobile_app_event (const PebbleCommSessionEvent *app_event)
 Handle a comm session event.
 

Detailed Description

Pebble Protocol music backend for Music.

Used with phone apps that do not run on iOS, where the Apple Media Service is used instead. Commands go to the phone over the system session on endpoint 0x20; responses update the music service.


Data Structure Documentation

◆ MusicEndpointPlayStateInfo

struct MusicEndpointPlayStateInfo

Payload of MusicEndpointCmdIDPlayStateInfoResponse.

An optional byte of MusicEndpointSkipSeeksFlag bits may follow; check the message length before reading it.

Data Fields
int32_t play_rate Playback rate in percent.
uint8_t play_repeat_mode MusicEndpointRepeatMode, currently ignored.
uint8_t play_shuffle_mode MusicEndpointShuffleMode, currently ignored.
uint8_t play_state MusicEndpointPlaybackState.
int32_t track_pos_ms Track position in milliseconds, negative if progress is not reported.

Enumeration Type Documentation

◆ MusicEndpointCmdID

Music endpoint message identifier, the first byte of every message.

Enumerator
MusicEndpointCmdIDTogglePlayPause 

Watch to phone: toggle play/pause.

MusicEndpointCmdIDPause 

Watch to phone: pause.

MusicEndpointCmdIDPlay 

Watch to phone: play.

MusicEndpointCmdIDNextTrack 

Watch to phone: next track.

MusicEndpointCmdIDPreviousTrack 

Watch to phone: previous track.

MusicEndpointCmdIDVolumeUp 

Watch to phone: volume up.

MusicEndpointCmdIDVolumeDown 

Watch to phone: volume down.

MusicEndpointCmdIDGetAllInfo 

Watch to phone: request all the info responses.

MusicEndpointCmdIDNowPlayingInfoResponse 

Phone to watch: artist, album and title, then optional extended fields.

MusicEndpointCmdIDPlayStateInfoResponse 

Phone to watch: MusicEndpointPlayStateInfo.

MusicEndpointCmdIDVolumeInfoResponse 

Phone to watch: volume percentage, one byte.

MusicEndpointCmdIDPlayerInfoResponse 

Phone to watch: player package and name.

MusicEndpointCmdIDInvalid 

No equivalent command.

◆ MusicEndpointPlaybackState

Playback state on the wire.

Enumerator
MusicEndpointPlaybackStatePaused 

Paused.

MusicEndpointPlaybackStatePlaying 

Playing.

MusicEndpointPlaybackStateRewinding 

Rewinding.

MusicEndpointPlaybackStateForwarding 

Fast-forwarding.

MusicEndpointPlaybackStateUnknown 

Unknown.

◆ MusicEndpointRepeatMode

Repeat mode on the wire.

Enumerator
MusicEndpointRepeatModeUnknown 

Unknown.

MusicEndpointRepeatModeOff 

Repeat off.

MusicEndpointRepeatModeOne 

Repeat the current track.

MusicEndpointRepeatModeAll 

Repeat all tracks.

◆ MusicEndpointShuffleMode

Shuffle mode on the wire.

Enumerator
MusicEndpointShuffleModeUnknown 

Unknown.

MusicEndpointShuffleModeOff 

Shuffle off.

MusicEndpointShuffleModeOn 

Shuffle on.

◆ MusicEndpointSkipSeeksFlag

Bits of the optional byte trailing MusicEndpointPlayStateInfo.

Phone apps that predate it send the shorter message, which reads as no bits set.

Enumerator
MusicEndpointSkipSeeksWithinTrack 

Next/previous track commands seek within the track.

Function Documentation

◆ music_endpoint_handle_mobile_app_event()

void music_endpoint_handle_mobile_app_event ( const PebbleCommSessionEvent *  app_event)

Handle a comm session event.

Disconnects this backend when the system session closes.

Parameters
app_eventSession event.

◆ music_endpoint_handle_mobile_app_info_event()

void music_endpoint_handle_mobile_app_info_event ( const PebbleRemoteAppInfoEvent *  app_info_event)

Handle the mobile app info event.

Connects this backend, disconnecting AMS, when the phone app runs on Android, macOS, Linux or Windows.

Parameters
app_info_eventEvent reported by the phone app.