BSB Developer Docs
Loading...
Searching...
No Matches
sl_info.h File Reference

Wireless co-processor (Si917) information service API. More...

#include <toolbox/property.h>

Go to the source code of this file.

Macros

#define RECORD_SL_INFO   "sl_info"
 The string key for SlInfo instance access.
 

Typedefs

typedef struct SlInfo SlInfo
 Opaque data type for the SlInfo service instance.
 

Enumerations

enum  SlInfoStatus { SlInfoStatusOk , SlInfoStatusNotReady , SlInfoStatusNotFound }
 Enumeration of possible return statuses used in getter functions. More...
 

Functions

SlInfoStatus sl_info_get_value (const SlInfo *instance, const char *key, const char **value)
 Get a string value by key.
 
SlInfoStatus sl_info_get_values (const SlInfo *instance, PropertyValueCallback value_callback, void *context)
 Get all available key-value pairs via the Property callback API.
 

Detailed Description

Wireless co-processor (Si917) information service API.

The SlInfo service keeps the static copy of the device_info output in a searchable form, allowing key-value lookups for particular values or outputting them all at once via the Property callback API.

Macro Definition Documentation

◆ RECORD_SL_INFO

#define RECORD_SL_INFO   "sl_info"

The string key for SlInfo instance access.

Get the instance pointer by calling furi_record_open(RECORD_SL_INFO);

Typedef Documentation

◆ SlInfo

typedef struct SlInfo SlInfo

Opaque data type for the SlInfo service instance.

Get the instance pointer by calling furi_record_open(RECORD_SL_INFO);

Enumeration Type Documentation

◆ SlInfoStatus

Enumeration of possible return statuses used in getter functions.

Enumerator
SlInfoStatusOk 

Success, data was found and/or is valid.

SlInfoStatusNotReady 

Data is not ready (too early or Intercom failure)

SlInfoStatusNotFound 

Value was not found (wrong key)

Function Documentation

◆ sl_info_get_value()

SlInfoStatus sl_info_get_value ( const SlInfo * instance,
const char * key,
const char ** value )

Get a string value by key.

On success, the value pointer is guaranteed to be valid during the entire run time of the firmware and the data itself will never change.

Note
To get the list of available keys, run device_info inside sl_cli.
Parameters
[in]instancePointer to the SlInfo service instance
[in]keyPointer to a C-string containing the key
[out]valuePointer to a pointer to a C-string to contain the value (no allocation needed)
Returns
SlInfoStatusOk on success, any other value from SlInfoStatus otherwise

◆ sl_info_get_values()

SlInfoStatus sl_info_get_values ( const SlInfo * instance,
PropertyValueCallback value_callback,
void * context )

Get all available key-value pairs via the Property callback API.

Parameters
[in]instancePointer to the SlInfo service instance
[in]value_callbackPointer to the output callback function
[in,out]contextPointer to a user-specific object (will be passed to the value callback)
Returns
SlInfoStatusOk on success, any other value from SlInfoStatus otherwise