PebbleOS
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
App message

Sending of app Pebble Protocol messages queued in the app outbox. More...

Data Structures

struct  AppMessageSendJob
 Send job, stored as the consumer_data of the AppOutboxMessage. More...
 
struct  AppMessageAppOutboxData
 Layout of an outbox message's data, in app memory. More...
 

Enumerations

enum  AppMessageSenderError {
  AppMessageSenderErrorSuccess = AppOutboxStatusSuccess , AppMessageSenderErrorDisconnected = AppOutboxStatusConsumerDoesNotExist , AppMessageSenderErrorDataTooShort = AppOutboxStatusUserRangeStart , AppMessageSenderErrorEndpointDisallowed ,
  NumAppMessageSenderError
}
 Sender status, extending AppOutboxStatus with values in its user range. More...
 

Functions

void app_message_sender_init (void)
 Register with the app outbox service; called once at boot.
 

Detailed Description

Sending of app Pebble Protocol messages queued in the app outbox.

Glue between the app outbox service and the session send queue; all state is kept by the app outbox service. Only the app message endpoint is allowed.


Data Structure Documentation

◆ AppMessageSendJob

struct AppMessageSendJob

Send job, stored as the consumer_data of the AppOutboxMessage.

Always contained within the AppOutboxMessage.

Data Fields
size_t consumed_length Bytes of header and payload already sent.
PebbleProtocolHeader header Pebble Protocol header, sent before the payload.
SessionSendQueueJob send_queue_job Send queue job; must be first.
CommSession * session Session the message is sent on.

◆ AppMessageAppOutboxData

struct AppMessageAppOutboxData

Layout of an outbox message's data, in app memory.

Untrusted: every field is sanitized before use. Must not grow beyond 12 bytes, as apps depend on it.

Data Fields
uint16_t endpoint_id Pebble Protocol endpoint.
uint8_t padding[6] Reserved.
uint8_t payload[] Pebble Protocol payload, not empty.
CommSession * session Session to send on, or NULL to select it from the UUID of the running app.

Enumeration Type Documentation

◆ AppMessageSenderError

Sender status, extending AppOutboxStatus with values in its user range.

Enumerator
AppMessageSenderErrorSuccess 

Message sent.

AppMessageSenderErrorDisconnected 

No session to send on, or it disconnected before the message was sent.

AppMessageSenderErrorDataTooShort 

Message shorter than its header or with an empty payload.

AppMessageSenderErrorEndpointDisallowed 

Endpoint not allowed for apps.

NumAppMessageSenderError 

Number of status values.

Function Documentation

◆ app_message_sender_init()

void app_message_sender_init ( void  )

Register with the app outbox service; called once at boot.