PebbleOS
Loading...
Searching...
No Matches
Data Fields
SessionSendJobImpl Struct Reference

Callbacks implementing a send queue job. More...

#include <session_send_queue.h>

Data Fields

size_t(* get_length )(const SessionSendQueueJob *send_job)
 Get the remaining length of the job.
 
size_t(* copy )(const SessionSendQueueJob *send_job, int start_offset, size_t length, uint8_t *data_out)
 Copy message data out of the job.
 
size_t(* get_read_pointer )(const SessionSendQueueJob *send_job, const uint8_t **data_out)
 Get a pointer to the next contiguous chunk of data.
 
void(* consume )(const SessionSendQueueJob *send_job, size_t length)
 Mark data as sent by the transport.
 
void(* free )(SessionSendQueueJob *send_job)
 Release the job.
 

Detailed Description

Callbacks implementing a send queue job.

All callbacks are called with bt_lock() held.

Field Documentation

◆ consume

void(* SessionSendJobImpl::consume) (const SessionSendQueueJob *send_job, size_t length)

Mark data as sent by the transport.

Parameters
send_jobThe job.
lengthNumber of bytes consumed.

◆ copy

size_t(* SessionSendJobImpl::copy) (const SessionSendQueueJob *send_job, int start_offset, size_t length, uint8_t *data_out)

Copy message data out of the job.

The caller ensures enough data is available.

Parameters
send_jobThe job.
start_offsetOffset into the unconsumed data.
lengthNumber of bytes to copy.
[out]data_outDestination buffer.
Returns
Number of bytes copied.

◆ free

void(* SessionSendJobImpl::free) (SessionSendQueueJob *send_job)

Release the job.

Called when the job has been fully consumed or the session is closed.

Parameters
send_jobThe job.

◆ get_length

size_t(* SessionSendJobImpl::get_length) (const SessionSendQueueJob *send_job)

Get the remaining length of the job.

Parameters
send_jobThe job.
Returns
Length of the unconsumed message data in bytes.

◆ get_read_pointer

size_t(* SessionSendJobImpl::get_read_pointer) (const SessionSendQueueJob *send_job, const uint8_t **data_out)

Get a pointer to the next contiguous chunk of data.

The data may be non-contiguous: call this and consume() repeatedly until it returns 0 to access all of it.

Parameters
send_jobThe job.
[out]data_outRead pointer.
Returns
Number of bytes readable at data_out.

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