PebbleOS
Loading...
Searching...
No Matches
Data Structures | Functions
Phone calls

Incoming call handling. More...

Data Structures

struct  PebblePhoneCaller
 Caller identity carried by phone events. More...
 

Functions

void phone_call_service_init (void)
 Initialize the service and subscribe to the events it handles.
 
void phone_call_answer (void)
 Answer the current incoming call.
 
void phone_call_decline (void)
 Decline or hang up the current call.
 
PebblePhoneCaller * phone_call_util_create_caller (const char *number, const char *name)
 Create a caller to pass in a phone event.
 
void phone_call_util_destroy_caller (PebblePhoneCaller *caller)
 Free a caller created with phone_call_util_create_caller().
 

Detailed Description

Incoming call handling.

Calls are reported over ANCS on iOS and over the Pebble Protocol phone endpoint otherwise (see Phone endpoint). The service consumes PEBBLE_PHONE_EVENT events, drives the phone call UI, and routes answer and decline actions to the right transport.


Data Structure Documentation

◆ PebblePhoneCaller

struct PebblePhoneCaller

Caller identity carried by phone events.

Data Fields
char * name Caller name, kernel heap allocated, or NULL.
char * number Phone number, kernel heap allocated, or NULL.

Function Documentation

◆ phone_call_answer()

void phone_call_answer ( void  )

Answer the current incoming call.

On iOS the call is considered over for the watch once answered, as no ongoing call UI is shown.

◆ phone_call_decline()

void phone_call_decline ( void  )

Decline or hang up the current call.

◆ phone_call_service_init()

void phone_call_service_init ( void  )

Initialize the service and subscribe to the events it handles.

◆ phone_call_util_create_caller()

PebblePhoneCaller * phone_call_util_create_caller ( const char *  number,
const char *  name 
)

Create a caller to pass in a phone event.

The strings are copied to the kernel heap. When both are NULL or empty, the name is set to the localized "Unknown".

Parameters
numberPhone number, or NULL.
nameCaller name, or NULL.
Returns
New caller, or NULL if out of memory.

◆ phone_call_util_destroy_caller()

void phone_call_util_destroy_caller ( PebblePhoneCaller *  caller)

Free a caller created with phone_call_util_create_caller().

Parameters
callerCaller to free, or NULL.