|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "uavcan/uavcan.h"#include "uavcan/uavcan_allocator.h"#include "uavcan.protocol.dynamic_node_id.Allocation.h"#include "uavcan.protocol.GetNodeInfo.h"Go to the source code of this file.
Macros | |
| #define | UAVCAN_MAX_NODES 50 |
| Dynamic node ID allocation. | |
| #define | INVALID_STAGE -1 |
Functions | |
| static int | detectRequestStage (struct uavcan_protocol_dynamic_node_id_Allocation *msg) |
| static int | getExpectedStage (void) |
| static int | findFreeNodeID (const uint8_t preferred) |
| static bool | unique_id_identical (int index) |
| static void | handleAllocationRequest (struct uavcan_iface_t *iface, uint8_t preferred_node_id) |
| static void | id_alloc_uavcan_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer) |
| struct uavcan_node_mapping_t * | uavcan_get_node_id_mapping (const uint8_t id) |
| static struct uavcan_node_mapping_t * | get_free_id_mapping (void) |
| static void | node_info_resp_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer) |
| void | request_node_info (struct uavcan_iface_t *iface, uint8_t destination_node_id) |
| void | uavcan_allocator_init (void) |
Variables | |
| static uavcan_event | id_alloc_ev |
| static uavcan_event | node_info_ev |
| static struct uavcan_node_mapping_t | uavcan_node_ids [UAVCAN_MAX_NODES] = {0} |
| struct uavcan_unique_id_t | current_unique_id = {0} |
| uint32_t | last_message_timestamp = 0 |
| #define INVALID_STAGE -1 |
Definition at line 20 of file uavcan_allocator.c.
Referenced by detectRequestStage(), getExpectedStage(), and id_alloc_uavcan_cb().
| #define UAVCAN_MAX_NODES 50 |
Dynamic node ID allocation.
See https://dronecan.github.io/Specification/6._Application_level_functions/#dynamic-node-id-allocation
Definition at line 17 of file uavcan_allocator.c.
Referenced by handleAllocationRequest(), and uavcan_get_node_id_mapping().
|
static |
Definition at line 79 of file uavcan_allocator.c.
References INVALID_STAGE.
Referenced by id_alloc_uavcan_cb().
|
static |
Definition at line 56 of file uavcan_allocator.c.
References uavcan_get_node_id_mapping().
Referenced by handleAllocationRequest().
|
static |
Definition at line 51 of file uavcan_allocator.c.
References uavcan_get_node_id_mapping().
Referenced by node_info_resp_cb().
|
static |
Definition at line 92 of file uavcan_allocator.c.
References current_unique_id, and INVALID_STAGE.
Referenced by id_alloc_uavcan_cb().
|
static |
Definition at line 110 of file uavcan_allocator.c.
References uavcan_node_mapping_t::allocated_id, current_unique_id, findFreeNodeID(), uavcan_broadcast(), UAVCAN_MAX_NODES, uavcan_node_ids, and unique_id_identical().
Referenced by id_alloc_uavcan_cb().
|
static |
Definition at line 163 of file uavcan_allocator.c.
References current_unique_id, detectRequestStage(), getExpectedStage(), handleAllocationRequest(), INVALID_STAGE, last_message_timestamp, uavcan_iface_t::node_id, transfer(), and uavcan_broadcast().
Referenced by uavcan_allocator_init().
|
static |
Definition at line 222 of file uavcan_allocator.c.
References uavcan_node_mapping_t::allocated_id, uavcan_unique_id_t::data, get_free_id_mapping(), uavcan_unique_id_t::len, transfer(), uavcan_get_node_id_mapping(), and uavcan_node_mapping_t::unique_id.
Referenced by uavcan_allocator_init().
| void request_node_info | ( | struct uavcan_iface_t * | iface, |
| uint8_t | destination_node_id ) |
Definition at line 244 of file uavcan_allocator.c.
References transfer(), and uavcan_request().
Referenced by node_status_cb().
| void uavcan_allocator_init | ( | void | ) |
Definition at line 256 of file uavcan_allocator.c.
References id_alloc_ev, id_alloc_uavcan_cb(), node_info_ev, node_info_resp_cb(), and uavcan_bind().
Referenced by uavcan_init().
| struct uavcan_node_mapping_t * uavcan_get_node_id_mapping | ( | const uint8_t | id | ) |
Definition at line 42 of file uavcan_allocator.c.
References uavcan_node_mapping_t::allocated_id, UAVCAN_MAX_NODES, and uavcan_node_ids.
Referenced by findFreeNodeID(), get_free_id_mapping(), node_info_resp_cb(), and node_status_cb().
|
static |
Definition at line 105 of file uavcan_allocator.c.
References current_unique_id, and uavcan_node_ids.
Referenced by handleAllocationRequest().
| struct uavcan_unique_id_t current_unique_id = {0} |
Definition at line 38 of file uavcan_allocator.c.
Referenced by getExpectedStage(), handleAllocationRequest(), id_alloc_uavcan_cb(), and unique_id_identical().
|
static |
Definition at line 30 of file uavcan_allocator.c.
Referenced by uavcan_allocator_init().
| uint32_t last_message_timestamp = 0 |
Definition at line 39 of file uavcan_allocator.c.
Referenced by id_alloc_uavcan_cb().
|
static |
Definition at line 31 of file uavcan_allocator.c.
Referenced by uavcan_allocator_init(), and uavcan_init_reporting().
|
static |
Definition at line 35 of file uavcan_allocator.c.
Referenced by handleAllocationRequest(), uavcan_get_node_id_mapping(), and unique_id_identical().