Commit 03270050 authored by Sonja Happ's avatar Sonja Happ

make adaptions for new VILLASnode version in villas_interface class

parent c8ca22b0
......@@ -94,18 +94,18 @@ Villas_interface::Villas_interface(villas_node_config *_config, IO_object *_IO,
if(vn_config.with_node) {
//set several states of node internal objects to STATE_DESTROYED
n = (struct node*) malloc(sizeof(struct node));
n->state = state::STATE_DESTROYED;
n->in.state = state::STATE_DESTROYED;
n->out.state = state::STATE_DESTROYED;
n->in.signals.state = state::STATE_DESTROYED;
n->out.signals.state = state::STATE_DESTROYED;
n->in.hooks.state = state::STATE_DESTROYED;
n->out.hooks.state = state::STATE_DESTROYED;
n->state = State::DESTROYED;
n->in.state = State::DESTROYED;
n->out.state = State::DESTROYED;
n->in.signals.state = State::DESTROYED;
n->out.signals.state = State::DESTROYED;
n->in.hooks.state = State::DESTROYED;
n->out.hooks.state = State::DESTROYED;
//Init memory pool for this node (used to get memory for sample in send_message)
p = (struct pool*) malloc(sizeof(struct pool));
p->state = state::STATE_DESTROYED;
p->queue.state = state::STATE_DESTROYED;
p->state = State::DESTROYED;
p->queue.state = State::DESTROYED;
//Allocate 1MB of pool memory for sent and received messages
//200 kiByte = 204800
//1 MiB = 1048576
......@@ -184,8 +184,8 @@ int Villas_interface::init() {
}
//set in and out node directions to PARSED
n->in.state = state::STATE_PARSED;
n->out.state = state::STATE_PARSED;
n->in.state = State::PARSED;
n->out.state = State::PARSED;
//check node
ret = node_check(n);
......@@ -331,14 +331,14 @@ void Villas_interface::configure_node_mqtt() {
m->keepalive = vn_config.type_config.mqtt_conf->keepalive;
m->qos = vn_config.type_config.mqtt_conf->qos;
m->ssl.enabled = vn_config.type_config.mqtt_conf->ssl_enabled;
m->queue.queue.state = state::STATE_DESTROYED;
m->pool.state = state::STATE_DESTROYED;
m->queue.queue.state = State::DESTROYED;
m->pool.state = State::DESTROYED;
//lookup the format type for this mqtt node
m->format = format_type_lookup(vn_config.format_name.c_str());
//set state to parsed to be able to continue with this node
n->state = state::STATE_PARSED;
n->state = State::PARSED;
#endif
}
......@@ -376,7 +376,7 @@ void Villas_interface::configure_node_nanomsg() {
m->format = format_type_lookup(vn_config.format_name.c_str());
// set state to parsed to be able to continue with this node
n->state = state::STATE_PARSED;
n->state = State::PARSED;
#endif
}
......@@ -391,16 +391,16 @@ void Villas_interface::set_signals() {
sig_out->enabled = 1;
if(meta[i].type == VILLAS_DATA_TYPE_INT64){
sig_in->type = SIGNAL_TYPE_INTEGER;
sig_out->type = SIGNAL_TYPE_INTEGER;
sig_in->type = SignalType::INTEGER;
sig_out->type = SignalType::INTEGER;
}
else if(meta[i].type == VILLAS_DATA_TYPE_DOUBLE){
sig_in->type = SIGNAL_TYPE_FLOAT;
sig_out->type = SIGNAL_TYPE_FLOAT;
sig_in->type = SignalType::FLOAT;
sig_out->type = SignalType::FLOAT;
}
else if(meta[i].type == VILLAS_DATA_TYPE_BOOLEAN){
sig_in->type = SIGNAL_TYPE_BOOLEAN;
sig_out->type = SIGNAL_TYPE_BOOLEAN;
sig_in->type = SignalType::BOOLEAN;
sig_out->type = SignalType::BOOLEAN;
}
sig_in->name = strdup(meta[i].name.c_str());
......@@ -456,7 +456,7 @@ void Villas_interface::send_message(Villas_message &msg) {
//set flags of sample
new_sample[0]->flags = 0;
new_sample[0]->flags |= sample_flags::SAMPLE_HAS_DATA;
new_sample[0]->flags |= (unsigned int) SampleFlags::HAS_DATA;
// send sample
unsigned int release=allocated;
......
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