Skip to content

Commit

Permalink
add messages for events interface (mavlink#1531)
Browse files Browse the repository at this point in the history
* common.xml: add messages for events interface
* COMPONENT_INFORMATION: add events metadata
  • Loading branch information
bkueng authored Apr 28, 2021
1 parent 6652031 commit a9be309
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions message_definitions/v1.0/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@
<entry value="3" name="COMP_METADATA_TYPE_PERIPHERALS">
<description>Meta data which specifies potential external peripherals that do not talk MAVLink</description>
</entry>
<entry value="4" name="COMP_METADATA_TYPE_EVENTS">
<description>Meta data for events interface</description>
</entry>
</enum>
<enum name="PARAM_TRANSACTION_TRANSPORT">
<description>Possible transport layers to set and get parameters via mavlink during a parameter transaction.</description>
Expand Down Expand Up @@ -4312,6 +4315,18 @@
<entry value="6" name="MAG_CAL_BAD_ORIENTATION"/>
<entry value="7" name="MAG_CAL_BAD_RADIUS"/>
</enum>
<enum name="MAV_EVENT_ERROR_REASON">
<description>Reason for an event error response.</description>
<entry value="0" name="MAV_EVENT_ERROR_REASON_UNAVAILABLE">
<description>The requested event is not available (anymore).</description>
</entry>
</enum>
<enum name="MAV_EVENT_CURRENT_SEQUENCE_FLAGS">
<description>Flags for CURRENT_EVENT_SEQUENCE.</description>
<entry value="1" name="MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET">
<description>A sequence reset has happened (e.g. vehicle reboot).</description>
</entry>
</enum>
</enums>
<messages>
<message id="1" name="SYS_STATUS">
Expand Down Expand Up @@ -6695,6 +6710,45 @@
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint32_t" name="format" enum="TUNE_FORMAT" display="bitmask">Bitfield of supported tune formats.</field>
</message>
<!-- Events Protocol -->
<message id="410" name="EVENT">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
<description>Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component).</description>
<field type="uint8_t" name="destination_component">Component ID</field>
<field type="uint8_t" name="destination_system">System ID</field>
<field type="uint32_t" name="id">Event ID (as defined in the component metadata)</field>
<field type="uint32_t" name="event_time_boot_ms" units="ms">Timestamp (time since system boot when the event happened).</field>
<field type="uint16_t" name="sequence">Sequence number.</field>
<field type="uint8_t" name="log_levels">Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9</field>
<field type="uint8_t[40]" name="arguments">Arguments (depend on event ID).</field>
</message>
<message id="411" name="CURRENT_EVENT_SEQUENCE">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
<description>Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events.</description>
<field type="uint16_t" name="sequence">Sequence number.</field>
<field type="uint8_t" name="flags" enum="MAV_EVENT_CURRENT_SEQUENCE_FLAGS" display="bitmask">Flag bitset.</field>
</message>
<message id="412" name="REQUEST_EVENT">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
<description>Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response.</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="first_sequence">First sequence number of the requested event.</field>
<field type="uint16_t" name="last_sequence">Last sequence number of the requested event.</field>
</message>
<message id="413" name="RESPONSE_EVENT_ERROR">
<wip/>
<!-- This message is work-in-progress and it can therefore change. It should NOT be used in stable production environments. -->
<description>Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore).</description>
<field type="uint8_t" name="target_system">System ID</field>
<field type="uint8_t" name="target_component">Component ID</field>
<field type="uint16_t" name="sequence">Sequence number.</field>
<field type="uint16_t" name="sequence_oldest_available">Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT.</field>
<field type="uint8_t" name="reason" enum="MAV_EVENT_ERROR_REASON">Error reason.</field>
</message>
<!-- Rover specific messages -->
<message id="9000" name="WHEEL_DISTANCE">
<description>Cumulative distance traveled for each reported wheel.</description>
Expand Down

0 comments on commit a9be309

Please sign in to comment.