Skip to content

Commit

Permalink
MAVLink2: updated docs for 24 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed May 16, 2016
1 parent b970e5a commit 56f454e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions doc/MAVLink2.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ In the signing structure there is an optional accept_unsigned_callback
function pointer. The C prototype for this function is:

```
bool accept_unsigned_callback(const mavlink_status_t *status,
uint8_t dialect, uint16_t msgId);
bool accept_unsigned_callback(const mavlink_status_t *status, uint32_t msgId);
```

If set in the signing structure then this function will be called on
Expand All @@ -221,24 +220,19 @@ considered:
For example:

```
static const struct {
uint8_t dialect;
uint16_t msgId;
} accept_list[] = {
{ MAVLINK_MSG_ID_RADIO_STATUS_TUPLE }
static const uint32_t accept_list[] = {
MAVLINK_MSG_ID_RADIO_STATUS
};
static bool accept_unsigned_callback(const mavlink_status_t *status,
uint8_t dialect, uint16_t msgId)
static bool accept_unsigned_callback(const mavlink_status_t *status, uint32_t msgId)
{
if (status == mavlink_get_channel_status(MAVLINK_COMM_0)) {
// always accept channel 0, assumed to be secure channel. This
// is USB on PX4 boards
return true;
}
for (uint8_t i=0; i<ARRAY_SIZE(accept_list); i++) {
if (accept_list[i].dialect == dialect &&
accept_list[i].msgId == msgId) {
if (accept_list[i] == msgId) {
return true;
}
}
Expand Down

0 comments on commit 56f454e

Please sign in to comment.