|
PebbleOS
|
Inbound message parsing and dispatch to endpoint handlers. More...
Data Structures | |
| struct | PebbleProtocolEndpoint |
| A single Pebble Protocol endpoint. More... | |
| struct | ReceiverImplementation |
| Buffers inbound message payloads and schedules endpoint handlers. More... | |
| struct | ReceiveRouter |
| Pebble Protocol header parsing state of a session. More... | |
Typedefs | |
| typedef void(* | PebbleProtocolEndpointHandler) (CommSession *session, const uint8_t *data, size_t length) |
| Pebble Protocol endpoint handler. | |
| typedef struct Receiver | Receiver |
| Opaque context of the message currently being received. | |
Enumerations | |
| enum | PebbleProtocolAccess { PebbleProtocolAccessPublic = 1 << 0 , PebbleProtocolAccessPrivate = 1 << 1 , PebbleProtocolAccessAny = ~0 , PebbleProtocolAccessNone = 0 } |
| Who may send messages to an endpoint. More... | |
Inbound message parsing and dispatch to endpoint handlers.
Endpoints are declared in fw/services/comm_session/protocol_endpoints_table.json.
| struct PebbleProtocolEndpoint |
A single Pebble Protocol endpoint.
| Data Fields | ||
|---|---|---|
| PebbleProtocolAccess | access_mask | Senders allowed to use the endpoint. |
| uint16_t | endpoint_id | Endpoint ID. |
| PebbleProtocolEndpointHandler | handler | Handler for complete messages. |
| const ReceiverImplementation * | receiver_imp | Receiver that buffers the endpoint's messages. |
| const void * | receiver_opt | Optional receiver configuration, passed to the receiver. |
| struct ReceiveRouter |
Pebble Protocol header parsing state of a session.
Payloads are handed to the endpoint's ReceiverImplementation.
| Data Fields | ||
|---|---|---|
| uint16_t | bytes_received | Bytes received for the current message so far, including the header. |
| uint16_t | bytes_to_ignore | Number of upcoming inbound bytes to ignore. |
| uint8_t | header_buffer[sizeof(PebbleProtocolHeader)] | Partially received header bytes. |
| uint16_t | msg_payload_length | Payload length of the current message in bytes. |
| Receiver * | receiver | Receiver context of the current message. |
| const ReceiverImplementation * | receiver_imp | Receiver implementation of the current message. |
| typedef void(* PebbleProtocolEndpointHandler) (CommSession *session, const uint8_t *data, size_t length) |
Pebble Protocol endpoint handler.
| session | Session the message arrived on. |
| data | Message payload. |
| length | Length of data in bytes. |
Opaque context of the message currently being received.
Its contents are up to the ReceiverImplementation. Messages are not interleaved within one session, so each session has at most one Receiver at a time.
| enum PebbleProtocolAccess |