PebbleOS v4.45.0-179-g439c45a48
Loading...
Searching...
No Matches
pbl_pp_receiver_api Struct Reference

Buffers inbound payloads and hands complete messages over. More...

#include <endpoint.h>

Data Fields

struct pbl_pp_receiver *(* prepare )(struct pbl_pp_session *session, const struct pbl_pp_endpoint *endpoint, size_t length)
 Prepare a context for a new message.
 
void(* write )(struct pbl_pp_receiver *receiver, const uint8_t *data, size_t length)
 Buffer payload data of the current message.
 
void(* finish )(struct pbl_pp_receiver *receiver)
 Hand the complete message over and release the context.
 
void(* cleanup )(struct pbl_pp_receiver *receiver)
 Drop the current message because the session closed, and release the context.
 

Detailed Description

Buffers inbound payloads and hands complete messages over.

Callbacks run in the context of the transport that received the data. Several sessions may be receiving messages at once. All callbacks are mandatory.

Field Documentation

◆ cleanup

void(* pbl_pp_receiver_api::cleanup) (struct pbl_pp_receiver *receiver)

Drop the current message because the session closed, and release the context.

Parameters
receiverReceiver context.

◆ finish

void(* pbl_pp_receiver_api::finish) (struct pbl_pp_receiver *receiver)

Hand the complete message over and release the context.

Parameters
receiverReceiver context.

◆ prepare

struct pbl_pp_receiver *(* pbl_pp_receiver_api::prepare) (struct pbl_pp_session *session, const struct pbl_pp_endpoint *endpoint, size_t length)

Prepare a context for a new message.

Parameters
sessionSession receiving the message.
endpointDestination endpoint.
lengthPayload length in bytes.
Returns
Receiver context, or NULL to drop the message.

◆ write

void(* pbl_pp_receiver_api::write) (struct pbl_pp_receiver *receiver, const uint8_t *data, size_t length)

Buffer payload data of the current message.

Parameters
receiverReceiver context.
dataPayload data.
lengthLength of data in bytes.

The documentation for this struct was generated from the following file: