system/custom_commands/nvm_defaults.c

/*******************************************************************************
* # License
* Copyright 2019 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
#include "nvm_settings.h"
#define DEFAULT_HUMIDITY_SENSOR_SETTINGS \
{ \
.polling_period = 1000, \
.enabled = false \
}
#define DEFAULT_TEMPERATURE_SENSOR_SETTINGS \
{ \
.polling_period = 1000, \
.enabled = false \
}
#define DEFAULT_CLOUD_URL "https://my-cloud.com"
#define DEFAULT_CLOUD_SETTINGS \
{ \
.update_interval = 6000 \
}
#define DEFAULT_DEVICE_KEY { 0 }
// These values will automatically be loaded into NVM on startup
GOS_NVM_CREATE_DEFAULT_ENTRY(SENSOR, HUMIDITY, humidity_sensor_settings_t, DEFAULT_HUMIDITY_SENSOR_SETTINGS);
GOS_NVM_CREATE_DEFAULT_ENTRY(SENSOR, TEMPERATURE, temperature_sensor_settings_t, DEFAULT_TEMPERATURE_SENSOR_SETTINGS);
GOS_NVM_CREATE_DEFAULT_ARRAY(CLOUD, URL, char, MAX_CLOUD_URL_LENGTH, DEFAULT_CLOUD_URL);
GOS_NVM_CREATE_DEFAULT_ENTRY(CLOUD, SETTINGS, cloud_settings_t, DEFAULT_CLOUD_SETTINGS);
GOS_NVM_CREATE_DEFAULT_ARRAY(DEVICE, KEY, uint8_t, DEVICE_KEY_LENGTH, DEFAULT_DEVICE_KEY);