On this page Phone theme and batteryShow Android notificationsShow iPhone notificationsIntegrate call controlsWhere music plays
SDK / FreeRTOS

Notifications & calls

Sync themes, display notifications and connect call controls.

Integrate theme, notifications and calls separately. Complete each driver and UI before enabling its SDK setting.

Phone theme and battery

phone_state is enabled by default. Handle MOTO_EVENT_PHONE_STATE:

Field Use
e.data.phone.theme MOTO_THEME_DAY / MOTO_THEME_NIGHT; switch the instrument theme
e.data.phone.battery_percent Phone battery from 0–100; -1 means unavailable
e.data.phone.charging Show whether the phone is charging

These values describe the phone. Report vehicle battery through vehicle data.

Show Android notifications

Set c.notifications = true before creating the SDK. The user must also enable notification sharing in the APP and grant Android notification access.

On MOTO_EVENT_NOTIFICATION, display e.data.notification.app, title and text. Remove the notification after ttl_ms milliseconds. On MOTO_EVENT_NOTIFICATION_REMOVE, remove the item identified by e.data.object.id.

Show notification buttons only when allowed by actions. When pressed, call moto_terminal_notification_action(t, &saved_event, action): 0 is the positive action and 1 the negative action. Pass the saved original notification event, then check MOTO_EVENT_ACTION_RESULT for the result.

Check: new phone notifications appear on the instrument. Expired notifications or withdrawn sharing do not leave old content on screen.

Show iPhone notifications

iPhone shares notifications through ANCS, Apple’s Bluetooth notification service. Your terminal Bluetooth driver must handle service discovery, authorization and subscription. An SDK switch alone does not implement this.

After that integration, set c.ancs = true and provide ancs_ready, returning the actual encrypted-connection and subscription readiness. The package’s moto_ancs_* APIs handle attribute requests and parsing; call them sequentially from a dedicated Bluetooth integration task.

MOTO_EVENT_ANCS_SHARING expresses the user’s sharing preference. It does not confirm iOS subscription authorization.

Integrate call controls

The board needs HFP, the Bluetooth hands-free calling profile, or an agreed call driver. After integration, set c.calls = true. The SDK does not provide audio transport or an HFP Bluetooth stack.

Direction API or event
Call driver has a new state moto_terminal_report_call(t, call_id, state, actions)
Instrument user selects answer, reject or hang up moto_terminal_call_action(t, &saved_call_event, action)
Receive MOTO_EVENT_CALL_ACTION Run the call-driver operation, then report with moto_terminal_complete and the original event

call_id is nonzero. state: 0 unknown, 1 ringing, 2 active, 3 held, 4 ended. Allowed actions bits: 1 answer, 2 reject, 4 hang up. A single action uses different values: 0 answer, 1 reject, 2 hang up.

When a MOTO_EVENT_CALL has valid=false, remove the stale buttons. After submitting an answer request, use subsequent call-driver reports to determine the actual call state.

Where music plays

Music and call audio play through the phone, helmet or vehicle Bluetooth audio device. The SDK’s BLE data connection carries controls and state, not music audio. For vehicle audio, provide your Bluetooth chip and audio-stack details when selecting the platform.

Clear temporary notification and call UI on disconnect. Keep notification content, phone numbers and PINs out of ordinary logs.