mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 06:53:35 +08:00
Simplified structures in uavcan.protocol.*
This commit is contained in:
@@ -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
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# Full data type name.
|
||||
#
|
||||
|
||||
uint8[<=80] value
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# Data type signature value, 64 bit.
|
||||
#
|
||||
|
||||
uint64 value
|
||||
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user