Adapter Life Cycle Functions

All adapters follow a set of adapter life cycle events.

API Description
bool reset(void* adapters); Initializes both input and output adapters.
void start(void* adapter); Processes data that is specific to the adapter implementation. Call this API immediately after resetting both input and output adapters.
void* getNext(void* adapter); Reads data and returns a pointer to the data in a format the ESP Server understands. The adapter shared utility library provides data conversion functions. Call this API for input adapters only.
void putNext(void* adapter,void* stream); Converts presented data into a format the ESP Server understands, and writes it according to the specified adapter implementation. The adapter shared utility library provides data conversion functions. Call this API for output adapters only.
void stopRequested(void* adapter); Sets a flag to indicate that a request has been sent to stop the adapter. Call this API for both input and output adapters.
void stop(void* adapter); Stops an adapter. Call this API for both input and output adapters.
void cleanup(void* adapter); Performs cleanup activities after an adapter is stopped.
void commitTransaction(void* adapter); Notifies an output adapter when a transaction ends and pushes any buffered data into the target. Call this API for output adapters only.
void putStartSync(void* adapter); Notifies the adapter implementation that the base data is being sent. Call this API for output adapters only.
void putEndSync(void* adapter); Notifies the adapter implementation that the base data has been sent. Call this API for output adapters only.
void purgePending)void* adapter); Instructs an output adapter to purge pending data. Call this API for output adapters only.
bool isOutBase(void* adapter); Determines whether the adapter expects to receive the output for the base contents of the stream. Call this API for output adapters only.