![]() |
BSB Developer Docs
|
Device Name service API. More...
Go to the source code of this file.
Data Structures | |
| struct | DeviceNameInfo |
| DeviceName information structure. More... | |
Macros | |
| #define | RECORD_DEVICE_NAME "device_name" |
| The string key for DeviceName instance access. | |
Typedefs | |
| typedef struct DeviceName | DeviceName |
| Opaque data type for the Device Name service instance. | |
Enumerations | |
| enum | DeviceNameError { DeviceNameErrorNone , DeviceNameErrorEmpty , DeviceNameErrorTooLong , DeviceNameErrorIllegalChar , DeviceNameErrorOnlySpaces , DeviceNameErrorSaveFailed , DeviceNameErrorMax } |
| Validation status returned by device_name_set(). More... | |
Functions | |
| void | device_name_get (DeviceName *instance, FuriString *name) |
| Get current device name. | |
| DeviceNameError | device_name_set (DeviceName *instance, const char *name) |
| Set new device name. | |
| FuriState * | device_name_get_state (const DeviceName *instance) |
| Get the DeviceName state object. | |
Device Name service API.
The Device Name service is responsible for storing and managing the device name. It provides API for getting and setting the name, and publishes rename events via FuriPubSub. If device is linked to account, device name service will send name through MQTT each time the name was updated.
The device name is persisted using SettingsProvider.
| typedef struct DeviceName DeviceName |
Opaque data type for the Device Name service instance.
Get the instance pointer by calling furi_record_open(RECORD_DEVICE_NAME);
| enum DeviceNameError |
Validation status returned by device_name_set().
| void device_name_get | ( | DeviceName * | instance, |
| FuriString * | name ) |
Get current device name.
| [in] | instance | Device name service instance |
| [out] | name | Device name returned by function. Default name will be returned if no name has been set. |
| FuriState * device_name_get_state | ( | const DeviceName * | instance | ) |
Get the DeviceName state object.
The return value will be of DeviceNameInfo underlying type.
| [in] | instance | Device name service instance |
| DeviceNameError device_name_set | ( | DeviceName * | instance, |
| const char * | name ) |
Set new device name.
Validates the provided name and, if valid, persists it and publishes it.
| [in] | instance | Device name service instance |
| [in] | name | New device name to set |