PebbleOS v4.45.0-179-g439c45a48
Loading...
Searching...
No Matches
App sessions

Pebble protocol session serving the running watch app. More...

Functions

struct pbl_pp_session * app_session_get_current (void)
 Get the session serving the running watch app.
 
void app_session_sanitize (struct pbl_pp_session **session)
 Restrict a session to the one the running app may use.
 
bool app_session_has_capability (enum pbl_pp_capability capability)
 Check whether the running app's phone counterpart announced a capability.
 
void app_session_capabilities_evict (const Uuid *app_uuid)
 Forget the cached capabilities of an app.
 
void app_session_capabilities_init (void)
 Compact the capability cache.
 

Detailed Description

Pebble protocol session serving the running watch app.

Function Documentation

◆ app_session_capabilities_evict()

void app_session_capabilities_evict ( const Uuid *  app_uuid)

Forget the cached capabilities of an app.

Parameters
app_uuidUUID of the app.

◆ app_session_capabilities_init()

void app_session_capabilities_init ( void  )

Compact the capability cache.

Called once at boot.

◆ app_session_get_current()

struct pbl_pp_session * app_session_get_current ( void  )

Get the session serving the running watch app.

For apps that use PebbleKit JS this is the system session.

Returns
The session, or NULL if none can serve the app.

◆ app_session_has_capability()

bool app_session_has_capability ( enum pbl_pp_capability  capability)

Check whether the running app's phone counterpart announced a capability.

Answers from a per-app cache while no session is open.

Parameters
capabilityCapability.
Returns
true if the capability was announced.

◆ app_session_sanitize()

void app_session_sanitize ( struct pbl_pp_session **  session)

Restrict a session to the one the running app may use.

NULL selects the app's session; any other session is kept only if it is the app's session.

Parameters
[in,out]sessionSession to check; set to NULL if not permitted or none is open.