Skip to content

Commit 49e90dd

Browse files
authored
mavlink_system must be declared in global scope (#223)
1 parent d14b07c commit 49e90dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

en/mavgen_c/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ When compiling the project, we recommend that you specify the top-level output d
5252
$ gcc ... -I generated/include -I generated/include/common ...
5353
```
5454

55+
In order to *send messages* you will also need to declare a variable `mavlink_system` in the **global scope**, specifying the system id and component ID of your component:
56+
```cpp
57+
mavlink_system_t mavlink_system = {
58+
1, // System ID (1-255)
59+
1 // Component ID (a MAV_COMPONENT value)
60+
};
61+
```
62+
63+
5564
## Multiple Streams ("channels") {#channels}
5665

5766
The C MAVLink library utilizes a "channel" metaphor to allow for simultaneous processing of multiple, independent MAVLink streams in the same program.
@@ -286,4 +295,4 @@ The following examples show the use of the API.
286295
In addition, the C library is used in numerous open source systems:
287296
- [PX4](https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_receiver.cpp)
288297
- [ArduPilot](https://github.com/ArduPilot/ardupilot/blob/master/libraries/GCS_MAVLink/GCS_Common.cpp)
289-
- [MAVSDK](https://github.com/mavlink/MAVSDK/blob/develop/src/core/mavlink_receiver.cpp#L28-L51)
298+
- [MAVSDK](https://github.com/mavlink/MAVSDK/blob/develop/src/core/mavlink_receiver.cpp#L28-L51)

0 commit comments

Comments
 (0)