mqtt port config changes
1. update example shairport-sync.conf file 2. update config file mqtt port parsing Signed-off-by: David Crook <idcrook@users.noreply.github.com>
This commit is contained in:
@@ -199,7 +199,7 @@ mqtt =
|
|||||||
{
|
{
|
||||||
// enabled = "no"; // set this to yes to enable the mqtt-metadata-service
|
// enabled = "no"; // set this to yes to enable the mqtt-metadata-service
|
||||||
// hostname = "iot.eclipse.org"; // Hostname of the MQTT Broker
|
// hostname = "iot.eclipse.org"; // Hostname of the MQTT Broker
|
||||||
// port = "1883";
|
// port = 1883; // Port on the MQTT Broker to connect to
|
||||||
// username = NULL; //set this to a string with your username, to enable username authentication
|
// username = NULL; //set this to a string with your username, to enable username authentication
|
||||||
// password = NULL; //set this to a string with your password, to enable username & password authentication
|
// password = NULL; //set this to a string with your password, to enable username & password authentication
|
||||||
// capath = NULL; //set this to the folder with the CA-Certificates to be accepted for the server certificate. If not set, TLS is not used
|
// capath = NULL; //set this to the folder with the CA-Certificates to be accepted for the server certificate. If not set, TLS is not used
|
||||||
|
|||||||
+7
-6
@@ -992,7 +992,6 @@ int parse_options(int argc, char **argv) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MQTT
|
#ifdef CONFIG_MQTT
|
||||||
int tmpval = 0;
|
|
||||||
config_set_lookup_bool(config.cfg, "mqtt.enabled", &config.mqtt_enabled);
|
config_set_lookup_bool(config.cfg, "mqtt.enabled", &config.mqtt_enabled);
|
||||||
if (config.mqtt_enabled && !config.metadata_enabled) {
|
if (config.mqtt_enabled && !config.metadata_enabled) {
|
||||||
die("You need to have metadata enabled in order to use mqtt");
|
die("You need to have metadata enabled in order to use mqtt");
|
||||||
@@ -1001,11 +1000,13 @@ int parse_options(int argc, char **argv) {
|
|||||||
config.mqtt_hostname = (char *)str;
|
config.mqtt_hostname = (char *)str;
|
||||||
// TODO: Document that, if this is false, whole mqtt func is disabled
|
// TODO: Document that, if this is false, whole mqtt func is disabled
|
||||||
}
|
}
|
||||||
if (config_lookup_int(config.cfg, "mqtt.port", &tmpval)) {
|
config.mqtt_port = 1883;
|
||||||
config.mqtt_port = tmpval;
|
if (config_lookup_int(config.cfg, "mqtt.port", &value)) {
|
||||||
} else {
|
if ((value < 0) || (value > 65535))
|
||||||
// TODO: Is this the correct way to set a default value?
|
die("Invalid mqtt port number \"%sd\". It should be between 0 and 65535, default is 1883",
|
||||||
config.mqtt_port = 1883;
|
value);
|
||||||
|
else
|
||||||
|
config.mqtt_port = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config_lookup_string(config.cfg, "mqtt.username", &str)) {
|
if (config_lookup_string(config.cfg, "mqtt.username", &str)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user