PebbleOS
Loading...
Searching...
No Matches
Enumerations | Functions
Firmware update

Tracks a firmware update pushed by the phone. More...

Enumerations

enum  FirmwareUpdateStatus { FirmwareUpdateStopped = 0 , FirmwareUpdateRunning = 1 , FirmwareUpdateCancelled = 2 , FirmwareUpdateFailed = 3 }
 State of the firmware update, also sent to the phone in the start response. More...
 

Functions

void firmware_update_init (void)
 Initialize the firmware update service.
 
unsigned int firmware_update_get_percent_progress (void)
 Get the progress of the running update.
 
void firmware_update_event_handler (PebbleSystemMessageEvent *event)
 Handle a firmware update start, failure or completion system message.
 
void firmware_update_pb_event_handler (PebblePutBytesEvent *event)
 Handle a put_bytes event during an update.
 
FirmwareUpdateStatus firmware_update_current_status (void)
 Get the state of the firmware update.
 
bool firmware_update_is_in_progress (void)
 Check whether a firmware update is running.
 

Detailed Description

Tracks a firmware update pushed by the phone.

A firmware update start system message switches to the firmware update runlevel, launches the progress UI and waits for the phone to send the firmware over put_bytes. The update is refused when the battery is critically low. Progress is tracked from put_bytes events; on failure the normal runlevel is restored, on success the watch reboots into the new firmware.

Enumeration Type Documentation

◆ FirmwareUpdateStatus

State of the firmware update, also sent to the phone in the start response.

Enumerator
FirmwareUpdateStopped 

No update running, or the last one completed.

FirmwareUpdateRunning 

An update is running.

FirmwareUpdateCancelled 

The update was refused because the battery is critically low.

FirmwareUpdateFailed 

The last update failed.

Function Documentation

◆ firmware_update_current_status()

FirmwareUpdateStatus firmware_update_current_status ( void  )

Get the state of the firmware update.

Returns
Current state.

◆ firmware_update_event_handler()

void firmware_update_event_handler ( PebbleSystemMessageEvent *  event)

Handle a firmware update start, failure or completion system message.

Replies to the start message with the resulting FirmwareUpdateStatus.

Parameters
eventSystem message event; other message types are ignored.

◆ firmware_update_get_percent_progress()

unsigned int firmware_update_get_percent_progress ( void  )

Get the progress of the running update.

Returns
Percentage of the update transferred, 0 if no update is running.

◆ firmware_update_init()

void firmware_update_init ( void  )

Initialize the firmware update service.

◆ firmware_update_is_in_progress()

bool firmware_update_is_in_progress ( void  )

Check whether a firmware update is running.

Returns
true if an update is running.

◆ firmware_update_pb_event_handler()

void firmware_update_pb_event_handler ( PebblePutBytesEvent *  event)

Handle a put_bytes event during an update.

Ignored if no update is running.

Parameters
eventPut bytes event.