cloud/mqtt_demo/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"
#include "mqtt.h"
#define DEFAULT_MQTT_DEMO_CONFIGURATION \
{ \
.mqtt_version = MQTT_VERSION_3_1_1, \
.use_tls = false, \
.clean_session = true, \
.automatic_reconnect = true, \
.network_interface = GOS_INTERFACE_DEFAULT, \
.keep_alive_interval_seconds = 30, \
.rx_buffer_size = NETWORK_DEFAULT_READ_BUFFER_SIZE, \
.tx_buffer_size = NETWORK_DEFAULT_SEND_BUFFER_SIZE, \
.broker_port = MQTT_DEFAULT_PORT, \
.broker_hostname = "test.mosquitto.org", \
.client_id = "", \
.username = "", \
.password = "" \
}
#define DEFAULT_MQTT_DEMO_WILL \
{ \
.qos_level = 2, \
.retained = true, \
.topic = "status", \
.payload = NULL, \
.payload_length = 0 \
}
#define DEFAULT_MQTT_DEMO_SETTINGS \
{ \
.magic = MQTT_DEMO_SETTINGS_MAGIC, \
.configuration = DEFAULT_MQTT_DEMO_CONFIGURATION, \
.will = DEFAULT_MQTT_DEMO_WILL, \
.will_message ="offline" \
}
// these values will automatically be loaded into NVM on startup
GOS_NVM_CREATE_DEFAULT_ENTRY(MQTT, DEMO, mqtt_demo_settings_t, DEFAULT_MQTT_DEMO_SETTINGS);