# Modem configuration

**Detailed Description**

This section contains APIs related to Modem Config operations.

- *group* Telematics\_config\_manager

    - Typedefs

- using ConfigId = std::string

    - 

- using ConfigListCallback = std::function&lt;void(std::vector&lt;ConfigInfo&gt; configList, telux::common::ErrorCode error)&gt;

    - This function is called as a response to requestConfigList().

- Param configList:

    - **[in]** - Contains the list of config files in modem’s storage.

- Param error:

    - **[in]** - Return code which indicates whether the operation succeeded or not. ErrorCode

- using GetAutoSelectionModeCallback = std::function&lt;void(AutoSelectionMode mode, telux::common::ErrorCode error)&gt;

    - This function is called as a response to getAutoSelectionMode().

- Param mode:

    - **[in]** - contains status of auto selection for configs.

- Param error:

    - **[in]** - Return code which indicates whether the operation succeeded or not. ErrorCode

- using GetActiveConfigCallback = std::function&lt;void(ConfigInfo configInfo, telux::common::ErrorCode error)&gt;

    - This function is called as a response to getActiveConfig().

- Param configInfo:

    - **[in]** - Information of active config file for specified slot id.

- Param error:

    - **[in]** - Return code which indicates whether the operation succeeded or not. ErrorCode

Enums

- enum ConfigType

    - *Values:*

- enumerator HARDWARE

    - For hardware or platform related configuration files

- enumerator SOFTWARE

    - For software or carrier related configuration files

- enum AutoSelectionMode

    - Selection Mode defines status of auto selection mode for configs.

*Values:*

- enumerator DISABLED

    - Auto selection disabled

- enumerator ENABLED

    - Auto selection enabled

- enum ConfigUpdateStatus

    - ConfigUpdateStatus represent status of config update, a update of config happens when a software config is activated and all segments using the config are updated with new config.

*Values:*

- enumerator START

    - start of updation process

- enumerator COMPLETE

    - end of updation process

- class ConfigFactory

    - ConfigFactory allows creation of config related classes.

Public Functions

- virtual std::shared\_ptr&lt;IModemConfigManager&gt; getModemConfigManager(telux::common::InitResponseCb callback = nullptr) = 0

    - Get instance of ModemConfig manager

On platforms with Access control enabled, Caller needs to have TELUX\_CONFIG\_MODEM\_CONFIG permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response of Modem Config Manager initialization.

- Returns:

    - pointer of IModemConfigManager object.

- virtual std::shared\_ptr&lt;IConfigManager&gt; getConfigManager(telux::common::InitResponseCb callback = nullptr) = 0

    - Get instance of the Config manager

On platforms with Access control enabled, Caller needs to have TELUX\_CONFIG\_APPS\_CONFIG permission to invoke this API successfully.

- Parameters:

    - **callback** – **[in]** Optional callback to get the response of Config Manager initialization.

- Returns:

    - pointer of IConfigManager object.

Public Static Functions

- static ConfigFactory &getInstance()

    - Get instance of Config Factory

Private Functions

- ConfigFactory(const ConfigFactory&) = delete

    - 

- ConfigFactory &operator=(const ConfigFactory&) = delete

    -

- class IConfigListener : public telux::common::IServiceStatusListener

    - IConfigListener interface is used to receive notifications related to any updates in the configurations dynamically.

Public Functions

- inline virtual void onConfigUpdate(std::string key, std::string value)

    - This API is invoked when there is any update in the configurations dynamically.

- Parameters:

    - - **key** – **[in]** - The key updated in the configurations.
- **value** – **[in]** - The corresponding value for the key that was updated in the configurations.

- inline virtual ~IConfigListener()

    -

- class IConfigManager

    - IConfigManager provides APIs to retrieve an instance of the manager, APIs for processes to update and retrieve configurations dynamically.

Public Functions

- virtual telux::common::ServiceStatus getServiceStatus() = 0

    - This status indicates whether the manager object is in a usable state or not.

- Returns:

    - SERVICE\_AVAILABLE - if apps config manager is ready to use. SERVICE\_UNAVAILABLE - if apps config manager is temporarily unavailable to use. SERVICE\_FAILED - if apps config manager encountered an irrecoverable failure and can not be used.

- virtual telux::common::Status registerListener(std::weak\_ptr&lt;IConfigListener&gt; listener) = 0

    - This API is used to register a listener for getting the updates when the configurations are updated dynamically.

- Parameters:

    - **listener** – **[in]** - Pointer of object that processes the notification.

- Returns:

    - Status of registerForUpdates i.e success or suitable status code.

- virtual telux::common::Status deregisterListener(std::weak\_ptr&lt;IConfigListener&gt; listener) = 0

    - This API is used to deregister a listener from getting the updates when the configurations are updated dynamically.

- Parameters:

    - **listener** – **[in]** - Pointer of object that processes the notification.

- Returns:

    - Status of registerForUpdates i.e success or suitable status code.

- virtual telux::common::Status setConfig(const std::string key, const std::string value) = 0

    - This API is used to update the key and the corresponding value in the configurations dynamically.

On platforms with Access control enabled, if -

1. /etc/tel.conf needs to be updated - caller needs to have TELUX\_SET\_GLOBAL\_CONFIG permission to invoke this API successfully.
2. App specific conf needs to be updated - caller needs to have TELUX\_SET\_LOCAL\_CONFIG permission to invoke this API successfully.

In order to update any configuration onto the file, all the permissions needed - DAC permissions and sepolicy requirements, should be taken care by the application.

The API does not perform any strict checking for the value being set. Please refer to tel.conf for valid values for configuration items.

- Parameters:

    - - **key** – **[in]** - The key that needs to be updated in the configurations.
- **value** – **[in]** - The corresponding value for the key that needs the update in the configurations.

- Returns:

    - Status of setConfig i.e success or suitable status code.

- virtual const std::string getConfig(const std::string key) = 0

    - This API is used to retrieve the value for the corresponding key from the configurations dynamically.

- Parameters:

    - **key** – **[in]** - The key whose value is to be retrieved from the configurations.

- Returns:

    - The value for the key passed.

- virtual const std::map&lt;std::string, std::string&gt; getAllConfigs() = 0

    - This API is used to retrieve all the configurations for the application at present.

- Returns:

    - A map of key-value pairs depicting all the application’s configurations at present.

- inline virtual ~IConfigManager()

    - Destructor of IConfigManager

- struct ConfigInfo

    - Public Members

- ConfigId id

    - stores the id of the configuration

- ConfigType type

    - stores config type

- uint32\_t size

    - stores the size of the configuration

- std::string desc

    - stores the configuration description

- uint32\_t version

    - stores version of the config file

- class IModemConfigListener : public telux::common::IServiceStatusListener

    - Listener class for getting notifications related to configuration change detection. The client needs to implement these methods as briefly as possible and avoid blocking calls in it. The methods in this class can be invoked from multiple different threads. Client needs to make sure that the implementation is thread-safe.

Public Functions

- inline virtual void onConfigUpdateStatus(ConfigUpdateStatus status, int slotId)

    - This function is called when a configuration update is detected. It is applicable only to SOFTWARE config.

- Parameters:

    - - **status** – **[in]** update status of config.
- **slotId** – **[in]** slotId where update is detected.

- inline virtual ~IModemConfigListener()

    - Destructor of IModemConfigListener

- class IModemConfigManager

    - IModemConfigManager provides interface to list config files present in modem’s storage. load a new config file in modem, activate a config file, get active config file information, deactivate a config file, delete config file from the modem’s storage, get and set mode of config auto selection, register and deregister listener for config update in modem. The config files are also referred to as MBNs.

Public Functions

- virtual bool isSubsystemReady() = 0

    - Checks the status of modem config subsystem and returns the result.

Deprecated Use getServiceStatus API

- Returns:

    - If true that means ModemConfigManager is ready for performing config operations.

- virtual telux::common::ServiceStatus getServiceStatus() = 0

    - This status indicates whether the manager object is in a usable state or not.

- Returns:

    - SERVICE\_AVAILABLE - if modem config manager is ready to use. SERVICE\_UNAVAILABLE - if modem config manager is temporarily unavailable to use. SERVICE\_FAILED - if modem config manager encountered an irrecoverable failure and can not be used.

- virtual std::future&lt;bool&gt; onSubsystemReady() = 0

    - Wait for modem config subsystem to be ready.

Deprecated Use InitResponseCb callback in factory API ConfigFactory::getModemConfigManager.

- Returns:

    - A future that caller can wait on to be notified when modem config subsystem is ready.

- virtual telux::common::Status requestConfigList(ConfigListCallback cb) = 0

    - Fetching the list of config files present in modem’s storage.

returns SUCCESS if the request to get config list is sent successfully.

- Parameters:

    - **cb** – **[in]** - callback to the Response function.

- virtual telux::common::Status loadConfigFile(std::string filePath, ConfigType configType, telux::common::ResponseCallback cb = nullptr) = 0

    - Loads a new config file into the modem’s storage. This is a persistent operation. Only the config files loaded into the modem’s storage can be activated.

returns SUCCESS if the request to load config file is sent successfully.

- Parameters:

    - - **filePath** – **[in]** - it defines the path to the config file.
- **configType** – **[in]** - type of the config file.
- **cb** – **[in]** - callback to the response function.

- virtual telux::common::Status activateConfig(ConfigType configType, ConfigId configId, int slotId = DEFAULT\_SLOT\_ID, telux::common::ResponseCallback cb = nullptr) = 0

    - Activates the config file on specified slot id. A file for activation must be loaded or should already be present in modem’s storage.

- Parameters:

    - - **configType** – **[in]** - type of the config file.
- **configId** – **[in]** - id of the config file.
- **slotId** – **[in]** - it defines the slot id to be selected.
- **cb** – **[in]** - callback to the response function.

- Returns:

    - SUCCESS if the request to activate config file is sent successfully.

- virtual telux::common::Status getActiveConfig(ConfigType configType, GetActiveConfigCallback cb, int slotId = DEFAULT\_SLOT\_ID) = 0

    - Get the currently active config file information for the specified slot id. In case default config files are activated, would return error.

- Parameters:

    - - **configType** – **[in]** - type of the config file.
- **cb** – **[in]** - callback to the response function.
- **slotId** – **[in]** - it defines the slot id to be selected.

- Returns:

    - SUCCESS if the request to get active config information is sent successfully.

- virtual telux::common::Status deactivateConfig(ConfigType configType, int slotId = DEFAULT\_SLOT\_ID, telux::common::ResponseCallback cb = nullptr) = 0

    - Deactivates the config file for the specified slot id.

- Parameters:

    - - **configType** – **[in]** - type of the config file.
- **slotId** – **[in]** - slot id to be selected for deactivation of config.
- **cb** – **[in]** - callback to the response function.

- Returns:

    - SUCCESS if the request to deactivate config file is sent successfully

- virtual telux::common::Status deleteConfig(ConfigType configType, ConfigId configId = "", telux::common::ResponseCallback cb = nullptr) = 0

    - Deletes the config file from the modem’s storage.

- Parameters:

    - - **configType** – **[in]** - type of the config file.
- **configId** – **[in]** - id of the config file. This parameter is optional if not provided all the config files of the given config type are deleted from modem’s storage.
- **cb** – **[in]** - callback to the Response function.

- Returns:

    - SUCCESS if the request to delete config file is sent successfully

- virtual telux::common::Status getAutoSelectionMode(GetAutoSelectionModeCallback cb, int slotId = DEFAULT\_SLOT\_ID) = 0

    - Fetching the mode of config auto selection for specified slot id.

- Parameters:

    - - **cb** – **[in]** - callback to the response function.
- **slotId** – **[in]** - slot id of config.

- Returns:

    - SUCCESS if the request to get selection mode is sent successfully

- virtual telux::common::Status setAutoSelectionMode(AutoSelectionMode mode, int slotId = DEFAULT\_SLOT\_ID, telux::common::ResponseCallback cb = nullptr) = 0

    - Setting the mode of config auto selection for specified slot id.

- Parameters:

    - - **mode** – **[in]** - auto selection mode status.
- **slotId** – **[in]** - slot id of the config.
- **cb** – **[in]** - callback to the response function.

- Returns:

    - SUCCESS if the request to set selection mode is sent successfully.

- virtual telux::common::Status registerListener(std::weak\_ptr&lt;IModemConfigListener&gt; listener) = 0

    - Registeres the listener for indications.

- Parameters:

    - **listener** – **[in]** - pointer to implemented listener.

- Returns:

    - SUCCESS if the request to register listener is sent successfully.

- virtual telux::common::Status deregisterListener(std::weak\_ptr&lt;IModemConfigListener&gt; listener) = 0

    - Deregisteres the listener from indications.

- Parameters:

    - **listener** – **[in]** - pointer to registered listener.

- Returns:

    - SUCCESS if the request to deregister listener is sent successfully.

- inline virtual ~IModemConfigManager()

    - Destructor of IModemConfigManager

Last Published: Mar 31, 2026

Previous Topic
 
Modem Next Topic

Platform