All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups
BluetoothConnectionService

Detailed Description

Determine when Pebble is connected to the phone.

The BluetoothConnectionService allows your app to know whether Pebble is connected to the phone. You can ask the system for this information at a given time or you can register to receive events every time Pebble connects or disconnects to the phone.

Function Documentation

bool bluetooth_connection_service_peek ( void  )

Query the bluetooth connection service for the current connection status.

Returns
true if connected, false otherwise
void bluetooth_connection_service_subscribe ( BluetoothConnectionHandler  handler)

Subscribe to the bluetooth event service. Once subscribed, the handler gets called on every bluetooth connection event.

Parameters
handlerA callback to be executed on connection event
void bluetooth_connection_service_unsubscribe ( void  )

Unsubscribe from the bluetooth event service. Once unsubscribed, the previously registered handler will no longer be called.

Typedef Documentation

typedef void(* BluetoothConnectionHandler)(bool connected)

Callback type for bluetooth connection events.

Parameters
connectedtrue on bluetooth connection, false on disconnection