Simplified structures in uavcan.protocol.*

This commit is contained in:
Pavel Kirienko
2014-03-06 17:22:18 +04:00
parent 5345dd794f
commit c08aa34645
6 changed files with 8 additions and 20 deletions
@@ -7,8 +7,8 @@ DataTypeKind kind
---
DataTypeSignature signature # Data type hash as computed by DSDL compiler (type name + each field)
DataTypeName name # Full data type name, e.g. "std.node.GetDataTypeInfo"
uint64 signature # Data type signature
uint8[<=80] name # Full data type name, e.g. "uavcan.protocol.GetDataTypeInfo"
uint8 MASK_KNOWN = 1 # This data type is defined
uint8 MASK_SUBSCRIBED = 2 # Subscribed to messages of this type
@@ -2,10 +2,10 @@
# This service allows to detect type compatibility between two nodes in one request.
#
DataTypeIDMask known_ids
bool[1024] known_ids
DataTypeKind kind
---
DataTypeIDMask mutually_known_ids
DataTypeSignature aggregate_signature
bool[1024] mutually_known_ids
uint64 aggregate_signature
@@ -1,5 +0,0 @@
#
# Data type ID mask; 1 - known, 0 - unknown.
#
bool[1024] value
-5
View File
@@ -1,5 +0,0 @@
#
# Full data type name.
#
uint8[<=80] value
@@ -1,5 +0,0 @@
#
# Data type signature value, 64 bit.
#
uint64 value
+3
View File
@@ -5,6 +5,7 @@
#pragma once
#include <cassert>
#include <cstring>
#include <stdint.h>
#include <algorithm>
#include <uavcan/internal/transport/crc.hpp>
@@ -92,6 +93,7 @@ class DataTypeDescriptor
public:
enum { MaxDataTypeID = Frame::MaxDataTypeID };
enum { MaxFullNameLen = 80 };
DataTypeDescriptor()
: kind_(DataTypeKind(0))
@@ -108,6 +110,7 @@ public:
assert(id <= MaxDataTypeID);
assert(kind < NumDataTypeKinds);
assert(name);
assert(std::strlen(name) <= MaxFullNameLen);
}
DataTypeKind getKind() const { return kind_; }