PebbleOS v4.47.0-757-g12b6c531f
Loading...
Searching...
No Matches
music_ams.h File Reference

The session with the Apple Media Service of the phone: it registers for the player, the queue and the track with the AMS client, and is the music server the music service controls the phone through. More...

#include <stdint.h>

Functions

void ams_create (uint16_t conn_handle)
 Starts a session on the connection of the phone: looks for the service, and subscribes to it when the phone has it.
 
void ams_destroy (void)
 Ends the session.
 
void ams_handle_services_changed (void)
 The services of the phone changed: looks for the service again.
 
void ams_music_disconnect (void)
 Disconnect AMS from the music service if currently registered.
 
const char * ams_music_server_debug_name (void)
 For testing purposes.
 
bool ams_is_registered_for_all_entity_updates (void)
 For testing purposes.
 

Detailed Description

The session with the Apple Media Service of the phone: it registers for the player, the queue and the track with the AMS client, and is the music server the music service controls the phone through.

KernelMain only.

Function Documentation

◆ ams_create()

void ams_create ( uint16_t  conn_handle)

Starts a session on the connection of the phone: looks for the service, and subscribes to it when the phone has it.

◆ ams_destroy()

void ams_destroy ( void  )

Ends the session.

◆ ams_handle_services_changed()

void ams_handle_services_changed ( void  )

The services of the phone changed: looks for the service again.

◆ ams_is_registered_for_all_entity_updates()

bool ams_is_registered_for_all_entity_updates ( void  )

For testing purposes.

Returns
Whether AMS has registered itself for updates of all entities (Player, Queue and Track).

◆ ams_music_disconnect()

void ams_music_disconnect ( void  )

Disconnect AMS from the music service if currently registered.

No-op otherwise. Some Android phones expose something that looks like an AMS GATT service, letting AMS grab the music slot before we learn the remote is Android. The PP music endpoint calls this on Android-detect so it can take over the slot.

◆ ams_music_server_debug_name()

const char * ams_music_server_debug_name ( void  )

For testing purposes.

Returns
The debug name with which AMS registers itself with the music.c service.