MXOS System Core Data Management
To efficiently manage system core data, mxos defines a system core data structure: mxos_Context_t,
which is used to store system core data and provides a set of core data management API functions.
⊕ mxos-demos SDK를 참조한다.
1. Core Data Managment API List
Core Data Managment API | Description |
mxos_system_context_init | Initialize the core data used by the mxos system framework, and the system and application configuration is read from FLASH. |
mxos_system_context_get | Read core data address |
mxos_system_context_get_user_data | Get the application configuration data address |
mxos_system_context_restore | Restore to the default configuration, the callback function will assign a default value to the application configuration data |
appRestoreDefault_callback | The application sets a default value for the configuration parameters |
mxos_system_context_update | Write configuration data managed by core data to FLASH |
The main structure definition and function API interfaces are described below:
2. mxos_Context_t
typedef struct _mxos_Context_t
{
/*Flash content*/
system_config_t flashContentInRam;
mxos_mutex_t flashContentInRam_mutex;
void * user_config_data;
uint32_t user_config_data_size;
/*Running status*/
system_status_wlan_t mxosStatus;
} system_context_t;
Among them:
- flashContentInRam:System flash configuration parameter structure, please refer to: system_config_t
- flashContentInRam_mutex: Flash operation mutex structure
- user_config_data:User configuration data
- user_config_data_size:User configuration data length
- mxosStatus: mxos running state structure, please refer to : system_status_wlan_t
3. system_config_t
The structure definition:
typedef struct {
/*OTA options*/
boot_table_t bootTable;
/*mxos system core configuration*/
mxos_sys_config_t mxosSystemConfig;
#ifdef mxos_BLUETOOTH_ENABLE
mxos_bt_config_t bt_config;
#endif
} system_config_t;
Among them:
- boot_table_t bootTable:bootloader Mode table information
- mxosSystemConfig:System core configuration structure
4. system_status_wlan_t
The structure definition:
typedef struct
{
system_state_t current_sys_state;
mxos_semaphore_t sys_state_change_sem;
/*mxos system Running status*/
char localIp[maxIpLen];
char netMask[maxIpLen];
char gateWay[maxIpLen];
char dnsServer[maxIpLen];
char mac[18];
char rf_version[50];
} system_status_wlan_t;`
Among them:
- current_sys_state: current system state
- sys_state_change_sem: system status semaphore
- char localIp[maxIpLen]: system local IP address
- char netMask[maxIpLen]: Subnet mask of the system device
- char gateWay[maxIpLen]: Gateway information for system devices
- char dnsServer[maxIpLen]: dns server
- char mac[18]: MAC address of the system device
- char rf_version[50]: RF driver firmware version of the system device
이상 끝 —