Skip to content

Commit

Permalink
Merge pull request #93 from UAVCAN/84
Browse files Browse the repository at this point in the history
Update the port introspection service per discussion on the forum
  • Loading branch information
pavel-kirienko authored Oct 27, 2020
2 parents 2eea7e6 + 6a05625 commit cb22a90
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 121 deletions.
1 change: 1 addition & 0 deletions .vscode/spellright.dict
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,4 @@ sha256
pitot
CAS
OOP
alignee
43 changes: 0 additions & 43 deletions uavcan/node/port/431.List.0.1.uavcan

This file was deleted.

44 changes: 0 additions & 44 deletions uavcan/node/port/432.GetInfo.0.1.uavcan

This file was deleted.

30 changes: 0 additions & 30 deletions uavcan/node/port/433.GetStatistics.0.1.uavcan

This file was deleted.

22 changes: 22 additions & 0 deletions uavcan/node/port/7510.List.0.1.uavcan
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# A list of ports that this node is using:
# - Subjects published by this node (whether periodically or ad-hoc).
# - Subjects that this node is subscribed to (a datalogger or a debugger would typically subscribe to all subjects).
# - RPC services consumed by this node (i.e., service clients).
# - RPC services provided by this node (i.e., service servers).
#
# All nodes should implement this capability to provide network introspection and diagnostic capabilities.
# This message should be published using the fixed subject-ID as follows:
# - At the OPTIONAL priority level at least every MAX_PUBLICATION_PERIOD seconds.
# - At the OPTIONAL or SLOW priority level within MAX_PUBLICATION_PERIOD after the port configuration is changed.
#
# pragma: no-bit-length-limit

uint8 MAX_PUBLICATION_PERIOD = 10 # [seconds]
# If the port configuration is not updated in this amount of time, the node should publish this message anyway.

SubjectIDList.0.1 publishers
SubjectIDList.0.1 subscribers
ServiceIDList.0.1 clients
ServiceIDList.0.1 servers

@sealed
4 changes: 2 additions & 2 deletions uavcan/node/port/ServiceID.1.0.uavcan
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Service-ID. The ranges are defined by the specification.

uint9 MAX = 511

uint9 value
void7

@sealed
@assert _offset_ == {16}
13 changes: 13 additions & 0 deletions uavcan/node/port/ServiceIDList.0.1.uavcan
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# A list of service identifiers.
# This is a trivial constant-size bitmask with some reserved space in case the range of service-ID is increased
# in a future revision of the protocol.

uint16 CAPACITY = ServiceID.1.0.MAX + 1

bool[CAPACITY] mask
# The index represents the identifier value. True -- present/used. False -- absent/unused.

@extent 1024 # Reserve space in case the range is extended in the future.

@assert CAPACITY % 8 == 0
@assert _offset_ == {CAPACITY}
4 changes: 2 additions & 2 deletions uavcan/node/port/SubjectID.1.0.uavcan
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Subject-ID. The ranges are defined by the specification.

uint13 MAX = 8191

uint13 value
void3

@sealed
@assert _offset_ == {16}
21 changes: 21 additions & 0 deletions uavcan/node/port/SubjectIDList.0.1.uavcan
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# A list of subject identifiers.
# The range of subject-ID is large, so using a fixed-size bitmask would make this type difficult to handle on
# resource-constrained systems. To address that, we provide two extra options: a simple variable-length list,
# and a special case that indicates that every subject-ID is in use.
#
# pragma: no-bit-length-limit

@union

uint16 CAPACITY = SubjectID.1.0.MAX + 1

bool[CAPACITY] mask
# The index represents the identifier value. True -- present/used. False -- absent/unused.

SubjectID.1.0[<256] sparse_list
# A list of identifiers that can be used instead of the mask if most of the identifiers are unused.

uavcan.primitive.Empty.1.0 total
# A special case indicating that all identifiers are in use.

@extent 8 + 2 ** 15 # Reserve space in case the range is extended in the future.

0 comments on commit cb22a90

Please sign in to comment.