diff --git a/include/villas/io/msg_format.h b/include/villas/io/msg_format.h index 92746b548..45930fae8 100644 --- a/include/villas/io/msg_format.h +++ b/include/villas/io/msg_format.h @@ -48,7 +48,6 @@ .type = MSG_TYPE_DATA, \ .length = len, \ .sequence = seq, \ - .id = 0 \ } /** The timestamp of a message in struct timespec format */ @@ -75,7 +74,7 @@ struct msg #error Invalid byte-order #endif - uint8_t id; /**< An id which identifies the source of this sample. */ + uint8_t resv2; /**< An id which identifies the source of this sample. */ uint16_t length; /**< The number of values in msg::data[]. */ uint32_t sequence; /**< The sequence number is incremented by one for consecutive messages. */ diff --git a/include/villas/mapping.h b/include/villas/mapping.h index 67cd8e5e4..498d0e455 100644 --- a/include/villas/mapping.h +++ b/include/villas/mapping.h @@ -70,7 +70,6 @@ struct mapping_entry { enum header_type { MAPPING_HDR_LENGTH, MAPPING_HDR_SEQUENCE, - MAPPING_HDR_ID, MAPPING_HDR_FORMAT } id; } hdr; diff --git a/include/villas/sample.h b/include/villas/sample.h index fd0ad5d37..3d2099251 100644 --- a/include/villas/sample.h +++ b/include/villas/sample.h @@ -78,7 +78,6 @@ struct sample { int capacity; /**< The number of values in sample::values for which memory is reserved. */ int flags; /**< Flags are used to store binary properties of a sample. */ - int id; /**< The id field is usually the same as sample::source::id */ struct node *source; /**< The node from which this sample originates. */ atomic_int refcnt; /**< Reference counter. */ diff --git a/lib/io/msg.c b/lib/io/msg.c index c1db43957..2960fc808 100644 --- a/lib/io/msg.c +++ b/lib/io/msg.c @@ -82,7 +82,6 @@ int msg_to_sample(struct msg *msg, struct sample *smp) smp->flags = SAMPLE_HAS_ORIGIN | SAMPLE_HAS_SEQUENCE | SAMPLE_HAS_VALUES | SAMPLE_HAS_ID; smp->length = MIN(msg->length, smp->capacity); smp->sequence = msg->sequence; - smp->id = msg->id; smp->ts.origin = MSG_TS(msg); smp->format = 0; @@ -102,7 +101,6 @@ int msg_from_sample(struct msg *msg, struct sample *smp) msg->ts.sec = smp->ts.origin.tv_sec; msg->ts.nsec = smp->ts.origin.tv_nsec; - msg->id = smp->id; for (int i = 0; i < smp->length; i++) { switch (sample_get_data_format(smp, i)) { diff --git a/lib/io/protobuf.c b/lib/io/protobuf.c index 8382fe42d..defa8aa1a 100644 --- a/lib/io/protobuf.c +++ b/lib/io/protobuf.c @@ -50,11 +50,6 @@ int protobuf_sprint(char *buf, size_t len, size_t *wbytes, struct sample *smps[] pb_smp->sequence = smp->sequence; } - if (smp->flags & SAMPLE_HAS_ID) { - pb_smp->has_id = 1; - pb_smp->id = smp->id; - } - if (smp->flags & SAMPLE_HAS_ORIGIN) { pb_smp->timestamp = alloc(sizeof(Villas__Node__Timestamp)); villas__node__timestamp__init(pb_smp->timestamp); @@ -121,11 +116,6 @@ int protobuf_sscan(char *buf, size_t len, size_t *rbytes, struct sample *smps[], smp->sequence = pb_smp->sequence; } - if (pb_smp->has_id) { - smp->flags |= SAMPLE_HAS_ID; - smp->id = pb_smp->id; - } - if (pb_smp->timestamp) { smp->flags |= SAMPLE_HAS_ORIGIN; smp->ts.origin.tv_sec = pb_smp->timestamp->sec; diff --git a/lib/io/villas.pb-c.c b/lib/io/villas.pb-c.c index fe4850369..4f86e6e61 100644 --- a/lib/io/villas.pb-c.c +++ b/lib/io/villas.pb-c.c @@ -248,7 +248,7 @@ const ProtobufCEnumDescriptor villas__node__sample__type__descriptor = NULL,NULL,NULL,NULL /* reserved[1234] */ }; static const Villas__Node__Sample__Type villas__node__sample__type__default_value = VILLAS__NODE__SAMPLE__TYPE__DATA; -static const ProtobufCFieldDescriptor villas__node__sample__field_descriptors[5] = +static const ProtobufCFieldDescriptor villas__node__sample__field_descriptors[4] = { { "type", @@ -274,18 +274,6 @@ static const ProtobufCFieldDescriptor villas__node__sample__field_descriptors[5] 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "id", - 3, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, - offsetof(Villas__Node__Sample, has_id), - offsetof(Villas__Node__Sample, id), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, { "timestamp", 4, @@ -312,16 +300,16 @@ static const ProtobufCFieldDescriptor villas__node__sample__field_descriptors[5] }, }; static const unsigned villas__node__sample__field_indices_by_name[] = { - 2, /* field[2] = id */ 1, /* field[1] = sequence */ - 3, /* field[3] = timestamp */ + 2, /* field[2] = timestamp */ 0, /* field[0] = type */ - 4, /* field[4] = values */ + 3, /* field[3] = values */ }; -static const ProtobufCIntRange villas__node__sample__number_ranges[1 + 1] = +static const ProtobufCIntRange villas__node__sample__number_ranges[2 + 1] = { { 1, 0 }, - { 0, 5 } + { 4, 2 }, + { 0, 4 } }; const ProtobufCMessageDescriptor villas__node__sample__descriptor = { @@ -331,10 +319,10 @@ const ProtobufCMessageDescriptor villas__node__sample__descriptor = "Villas__Node__Sample", "villas.node", sizeof(Villas__Node__Sample), - 5, + 4, villas__node__sample__field_descriptors, villas__node__sample__field_indices_by_name, - 1, villas__node__sample__number_ranges, + 2, villas__node__sample__number_ranges, (ProtobufCMessageInit) villas__node__sample__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/lib/io/villas.pb-c.h b/lib/io/villas.pb-c.h index 8b8f1d8de..18c048be2 100644 --- a/lib/io/villas.pb-c.h +++ b/lib/io/villas.pb-c.h @@ -61,18 +61,13 @@ struct _Villas__Node__Sample */ protobuf_c_boolean has_sequence; uint32_t sequence; - /* - * An id which identifies the source of this sample. - */ - protobuf_c_boolean has_id; - uint32_t id; Villas__Node__Timestamp *timestamp; size_t n_values; Villas__Node__Value **values; }; #define VILLAS__NODE__SAMPLE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&villas__node__sample__descriptor) \ - , VILLAS__NODE__SAMPLE__TYPE__DATA, 0,0, 0,0, NULL, 0,NULL } + , VILLAS__NODE__SAMPLE__TYPE__DATA, 0,0, NULL, 0,NULL } struct _Villas__Node__Timestamp diff --git a/lib/io/villas.proto b/lib/io/villas.proto index 16d1ad85c..92d6cc2e7 100644 --- a/lib/io/villas.proto +++ b/lib/io/villas.proto @@ -38,7 +38,6 @@ message Sample { required Type type = 1 [default = DATA]; optional uint32 sequence = 2; // The sequence number is incremented by one for consecutive messages. - optional uint32 id = 3; // An id which identifies the source of this sample. optional Timestamp timestamp = 4; repeated Value values = 5; } diff --git a/lib/mapping.c b/lib/mapping.c index d72ccee56..16424db7c 100644 --- a/lib/mapping.c +++ b/lib/mapping.c @@ -107,8 +107,6 @@ int mapping_parse_str(struct mapping_entry *me, const char *str, struct list *no me->hdr.id = MAPPING_HDR_SEQUENCE; else if (!strcmp(field, "length")) me->hdr.id = MAPPING_HDR_LENGTH; - else if (!strcmp(field, "id")) - me->hdr.id = MAPPING_HDR_ID; else if (!strcmp(field, "format")) me->hdr.id = MAPPING_HDR_FORMAT; else @@ -306,9 +304,6 @@ int mapping_update(struct mapping_entry *me, struct sample *remapped, struct sam case MAPPING_HDR_SEQUENCE: remapped->data[off++].i = original->sequence; break; - case MAPPING_HDR_ID: - remapped->data[off++].i = original->id; - break; case MAPPING_HDR_FORMAT: remapped->data[off++].i = original->format; break; @@ -344,7 +339,6 @@ int mapping_remap(struct list *m, struct sample *remapped, struct sample *origin remapped->sequence = original->sequence; remapped->source = original->source; remapped->ts = original->ts; - remapped->id = original->id; for (size_t i = 0; i < list_length(m); i++) { struct mapping_entry *me = (struct mapping_entry *) list_at(m, i); diff --git a/lib/sample.c b/lib/sample.c index 58c71f9f3..815db7ddd 100644 --- a/lib/sample.c +++ b/lib/sample.c @@ -132,7 +132,6 @@ int sample_copy(struct sample *dst, struct sample *src) dst->sequence = src->sequence; dst->format = src->format; dst->source = src->source; - dst->id = src->id; dst->flags = src->flags; dst->ts = src->ts; @@ -209,14 +208,6 @@ int sample_cmp(struct sample *a, struct sample *b, double epsilon, int flags) } } - /* Compare ID */ - if (flags & SAMPLE_HAS_SOURCE) { - if (a->id != b->id) { - printf("id: %d != %d\n", a->id, b->id); - return 7; - } - } - /* Compare data */ if (flags & SAMPLE_HAS_VALUES) { if (a->length != b->length) {