Storage Backed Queue

  • This is the Storage Backed Queue implementation with fixed size of user initialization.

  • The main buffer structure variable and the internal data buffer both should be declared on the application side and the pointers of the variables are used in the module.

Usage

  1. All API functions have the first argument as the buffer instance.

  2. Internal data buffer size and pointer are initialized with module init function.

  3. Module read and module write functions are used to read/write data bytes.

  4. Other API functions to return the status of buffer whether empty or full.

  5. Return codes of API functions are defined in header file.

Storage backed Queue calls

Function

Description

rs_sb_queue_init

Function to initialize the storage backed queue

rs_sb_queue_push_data

Function to push the data into the storage backed queue

rs_sb_queue_pull_data

Function to pull the data from the storage backed queue

rs_sb_queue_peek_data

Function to get top of the data from the storage backed queue

rs_sb_queue_get_available_messages

Function to get remaining messages

rs_remove_invalid_file_from_sb_queue

Function to remove invalid file from the storage backed queue

sb_queue_is_file_exist

Function to find the file exist or not

sb_queue_backup_to_file

Function to store the data to the file

rs_sb_queue_flush

Function to reset the elements of the storage backed queue structure

Error Code

  • Every API’s for the message queue module returns some success or failure values. Please refer below section,

Example Demo

Please refer below section,

Message Queue Header Details

Documentation from the relevant header as follows:

Warning

doxygenfile: Cannot find file “rs_sb_queue.h