PebbleOS
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
session.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <comm/bt_conn_mgr.h>

Macros

#define COMM_SESSION_DEFAULT_TIMEOUT   (4000)
 Default send timeout in milliseconds.
 

Enumerations

enum  CommSessionType { CommSessionTypeInvalid = -1 , CommSessionTypeSystem = 0 , CommSessionTypeApp = 1 , NumCommSessions }
 Kind of session. More...
 
enum  CommSessionCapability {
  CommSessionRunState = 1 << 0 , CommSessionInfiniteLogDumping = 1 << 1 , CommSessionExtendedMusicService = 1 << 2 , CommSessionExtendedNotificationService = 1 << 3 ,
  CommSessionLanguagePackSupport = 1 << 4 , CommSessionAppMessage8kSupport = 1 << 5 , CommSessionActivityInsightsSupport = 1 << 6 , CommSessionVoiceApiSupport = 1 << 7 ,
  CommSessionSendTextSupport = 1 << 8 , CommSessionNotificationFilteringSupport = 1 << 9 , CommSessionUnreadCoredumpSupport = 1 << 10 , CommSessionWeatherAppSupport = 1 << 11 ,
  CommSessionRemindersAppSupport = 1 << 12 , CommSessionWorkoutAppSupport = 1 << 13 , CommSessionSmoothFwInstallProgressSupport = 1 << 14 , CommSessionImagingSupport = 1 << 17 ,
  CommSessionSettingsSyncSupport = 1 << 23 , CommSessionNotificationWindowStateSupport = 1 << 26 , CommSessionOutOfRange
}
 Protocol capabilities announced by the phone. More...
 

Functions

bool comm_session_has_capability (CommSession *session, CommSessionCapability capability)
 Check whether a session supports a capability.
 
CommSessionCapability comm_session_get_capabilities (CommSession *session)
 Get the capabilities of a session.
 
CommSession * comm_session_get_system_session (void)
 Get the system (Pebble mobile app) session.
 
CommSession * comm_session_get_current_app_session (void)
 Get the session serving the currently running watch app.
 
void comm_session_sanitize_app_session (CommSession **session_in_out)
 Restrict a session to the one the current app is permitted to use.
 
CommSessionType comm_session_get_type (const CommSession *session)
 Get the kind of a session.
 
CommSession * comm_session_get_by_type (CommSessionType type)
 Get a session by kind.
 
const Uuid * comm_session_get_uuid (const CommSession *session)
 Get the UUID of the app a session is connected to.
 
bool comm_session_is_system (CommSession *session)
 Check whether a session is the system session.
 
void comm_session_reset (CommSession *session)
 Reset a session by asking its transport to close and reopen it.
 
bool comm_session_send_data (CommSession *session, uint16_t endpoint_id, const uint8_t *data, size_t length, uint32_t timeout_ms)
 Send a complete Pebble Protocol message.
 
void comm_session_set_responsiveness (CommSession *session, enum pbl_bt_consumer consumer, enum pbl_bt_response_time_state state, uint16_t max_period_secs)
 Request a connection response time for a session.
 
void comm_session_set_responsiveness_ext (CommSession *session, enum pbl_bt_consumer consumer, enum pbl_bt_response_time_state state, uint16_t max_period_secs, pbl_bt_responsiveness_granted_cb_t granted_handler)
 Request a connection response time for a session, with a granted callback.
 
void comm_session_init (void)
 Initialize the session module.