diff --git a/lib/hooks/dft.cpp b/lib/hooks/dft.cpp index 03fa1fb31..eb73acda4 100644 --- a/lib/hooks/dft.cpp +++ b/lib/hooks/dft.cpp @@ -377,7 +377,7 @@ public: } } - /** mem size needs to be equal to window size **/ + /* mem size needs to be equal to window size */ void calcDft(paddingType padding, double *ringBuffer, uint ringBufferPos) { //prepare sample window The following parts can be combined @@ -423,8 +423,9 @@ public: + 0.006947368 * cos(8 * M_PI * i / (window_size)); window_corretion_factor += filterWindowCoefficents[i]; } - }else if (window_type_in == windowType::HAMMING || window_type_in == windowType::HANN) { - double a_0 = 0.5;//this is the hann window + } + else if (window_type_in == windowType::HAMMING || window_type_in == windowType::HANN) { + double a_0 = 0.5; //this is the hann window if (window_type_in == windowType::HAMMING) a_0 = 25./46; diff --git a/lib/nodes/mqtt.cpp b/lib/nodes/mqtt.cpp index 89f8b0664..d6428c9cf 100644 --- a/lib/nodes/mqtt.cpp +++ b/lib/nodes/mqtt.cpp @@ -217,47 +217,6 @@ mosquitto_error: return ret; } -int mqtt_prepare(struct vnode *n){ - - int ret; - struct mqtt *m = (struct mqtt *) n->_vd; - - if (m->username && m->password) { - ret = mosquitto_username_pw_set(m->client, m->username, m->password); - if (ret != MOSQ_ERR_SUCCESS) - goto mosquitto_error; - } - - if (m->ssl.enabled) { - ret = mosquitto_tls_set(m->client, m->ssl.cafile, m->ssl.capath, m->ssl.certfile, m->ssl.keyfile, nullptr); - if (ret != MOSQ_ERR_SUCCESS) - goto mosquitto_error; - - ret = mosquitto_tls_insecure_set(m->client, m->ssl.insecure); - if (ret != MOSQ_ERR_SUCCESS) - goto mosquitto_error; - } - - ret = io_init(&m->io, m->format, &n->in.signals, (int) SampleFlags::HAS_ALL & ~(int) SampleFlags::HAS_OFFSET); - if (ret) - return ret; - - ret = pool_init(&m->pool, 1024, SAMPLE_LENGTH(vlist_length(&n->in.signals))); - if (ret) - return ret; - - ret = queue_signalled_init(&m->queue, 1024); - if (ret) - return ret; - - return 0; - -mosquitto_error: - warning("MQTT: %s", mosquitto_strerror(ret)); - - return ret; -} - int mqtt_parse(struct vnode *n, json_t *cfg) { int ret;