PebbleOS
Loading...
Searching...
No Matches
Functions
Data logging endpoint

Pebble Protocol endpoint exchanging session data with the phone. More...

Functions

void dls_endpoint_init (void)
 Initialize the endpoint state.
 
void dls_endpoint_close_session (uint8_t session_id)
 Tell the phone a session is closed.
 
bool dls_endpoint_send_data (DataLoggingSession *logging_session, const uint8_t *data, unsigned int num_bytes)
 Send a chunk of session data to the phone.
 
bool dls_endpoint_open_session (DataLoggingSession *logging_session)
 Announce a session to the phone.
 

Detailed Description

Pebble Protocol endpoint exchanging session data with the phone.

Messages are sent over the system session; when there is none the functions do nothing.

Function Documentation

◆ dls_endpoint_close_session()

void dls_endpoint_close_session ( uint8_t  session_id)

Tell the phone a session is closed.

Parameters
session_idSession ID.

◆ dls_endpoint_init()

void dls_endpoint_init ( void  )

Initialize the endpoint state.

◆ dls_endpoint_open_session()

bool dls_endpoint_open_session ( DataLoggingSession *  logging_session)

Announce a session to the phone.

Moves the session to the opening state until the phone acks.

Parameters
logging_sessionSession to open.
Returns
true if the open message was sent.

◆ dls_endpoint_send_data()

bool dls_endpoint_send_data ( DataLoggingSession *  logging_session,
const uint8_t *  data,
unsigned int  num_bytes 
)

Send a chunk of session data to the phone.

Moves the session to the sending state until the phone acks. Does nothing if the session is still waiting for an ack.

Parameters
logging_sessionSession the data belongs to.
dataWhole items read from the session storage.
num_bytesLength of data in bytes, at most DLS_ENDPOINT_MAX_PAYLOAD.
Returns
false if there is no system session or no send buffer is available, true otherwise.