Commit d8f69d01 authored by Sonja Happ's avatar Sonja Happ

remove mqtt_unthreaded VILLAS node type and use revised mqtt type instead

parent 2d7d7aa3
Subproject commit 6f860af9d13999938786081f3e981c140eb3644c
Subproject commit d76bcdbb076a0a5d342e1e2defcab328db5a3b00
......@@ -396,7 +396,7 @@ void Model::read_villas_config() {
IO->log_info("Reading VILLAS config for MQTT");
villas_config_model->type_name = "mqtt_unthreaded";
villas_config_model->type_name = "mqtt";
//parse the properties of the node type configuration for the agents
villas_config_agents = new villas_node_config();
......
......@@ -115,7 +115,7 @@ Villas_interface::Villas_interface(villas_node_config *_config, IO_object *_IO,
//parse configuration of node
IO->log_info("Villas_interface: node configuration");
if (_config->type_name == "mqtt" || _config->type_name == "mqtt_unthreaded") {
if (_config->type_name == "mqtt") {
vn_config.type_config.mqtt_conf = new mqtt_data();
vn_config.type_config.mqtt_conf->enabled = _config->type_config.mqtt_conf->enabled;
vn_config.type_config.mqtt_conf->ssl_enabled = _config->type_config.mqtt_conf->ssl_enabled;
......@@ -176,7 +176,7 @@ int Villas_interface::init() {
" and node type " + vn_config.type_name);
return ret;
}
if(vn_config.type_name == "mqtt" || vn_config.type_name == "mqtt_unthreaded") {
if(vn_config.type_name == "mqtt") {
configure_node_mqtt(); //configure the node for mqtt
}
else if (vn_config.type_name == "nanomsg") {
......@@ -555,13 +555,9 @@ void Villas_interface::receive_messages(std::list<Villas_message> &messages) {
unsigned long number_of_messages;
// Check which villas node type is used and create corresponding struct
if(vn_config.type_name == "mqtt" || vn_config.type_name == "mqtt_unthreaded") {
if(vn_config.type_name == "mqtt") {
struct mqtt * m = (struct mqtt*) n->_vd;
if(vn_config.type_name == "mqtt_unthreaded"){
//call node_read with 0 as number of messages to receive to execute MQTT networking operations
node_read(n, nullptr, 0, nullptr);
}
//determine number of messages in the queue
unsigned long queue_tail = m->queue.queue.tail;
unsigned long queue_head = m->queue.queue.head;
......@@ -570,9 +566,9 @@ void Villas_interface::receive_messages(std::list<Villas_message> &messages) {
// + " samples are in the queue");
// call allocate and receive for number_of_messages samples
if(number_of_messages > 0){
allocate_and_receive(number_of_messages, messages);
}
if(number_of_messages > 0){
allocate_and_receive(number_of_messages, messages);
}
}
else if(vn_config.type_name == "nanomsg") {
struct nanomsg * m = (struct nanomsg*) n->_vd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment