Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
uavcan_reporting.c File Reference
#include "uavcan.h"
#include "mcu_periph/can.h"
#include "modules/core/threads.h"
#include "uavcan.protocol.NodeStatus.h"
#include "uavcan.protocol.GetNodeInfo_req.h"
#include "uavcan.protocol.GetNodeInfo_res.h"
#include "mcu_periph/sys_time.h"
#include "generated/airframe.h"
#include "uavcan_reporting.h"
#include "uavcan/uavcan_allocator.h"
+ Include dependency graph for uavcan_reporting.c:

Go to the source code of this file.

Macros

#define AC_CAN_NAME_PREFIX   "org.pprz."
 

Functions

static void node_info_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 
static void node_status_cb (struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 request uniq_id of all nodes on the bus.
 
static void get_uavcan_status (struct uavcan_protocol_NodeStatus *status)
 
static void get_uavcan_software_version (struct uavcan_protocol_SoftwareVersion *software_version)
 
static void get_uavcan_hardware_version (struct uavcan_protocol_HardwareVersion *hardware_version)
 
void uavcan_init_reporting ()
 
void uavcan_reporting (void)
 

Variables

static uavcan_event node_info_ev
 
static uavcan_event node_status_ev
 
char ac_can_name [50] = {0}
 
uint8_t ac_can_name_len = 0
 

Macro Definition Documentation

◆ AC_CAN_NAME_PREFIX

#define AC_CAN_NAME_PREFIX   "org.pprz."

Definition at line 12 of file uavcan_reporting.c.

Function Documentation

◆ get_uavcan_hardware_version()

static void get_uavcan_hardware_version ( struct uavcan_protocol_HardwareVersion hardware_version)
static

Definition at line 79 of file uavcan_reporting.c.

References foo.

Referenced by node_info_cb().

+ Here is the caller graph for this function:

◆ get_uavcan_software_version()

static void get_uavcan_software_version ( struct uavcan_protocol_SoftwareVersion software_version)
static

Definition at line 71 of file uavcan_reporting.c.

References foo.

Referenced by node_info_cb().

+ Here is the caller graph for this function:

◆ get_uavcan_status()

static void get_uavcan_status ( struct uavcan_protocol_NodeStatus status)
static

Definition at line 63 of file uavcan_reporting.c.

References foo, get_sys_time_float(), and status.

Referenced by node_info_cb(), and uavcan_reporting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ node_info_cb()

static void node_info_cb ( struct uavcan_iface_t iface,
CanardRxTransfer transfer 
)
static

Definition at line 88 of file uavcan_reporting.c.

References ac_can_name, ac_can_name_len, foo, get_uavcan_hardware_version(), get_uavcan_software_version(), get_uavcan_status(), Min, msg, transfer(), and uavcan_response().

Referenced by uavcan_init_reporting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ node_status_cb()

static void node_status_cb ( struct uavcan_iface_t iface,
CanardRxTransfer transfer 
)
static

request uniq_id of all nodes on the bus.

Since nodes must periodicaly send a NodeStatus message, its a good place to do it.

Definition at line 41 of file uavcan_reporting.c.

References request_node_info(), transfer(), and uavcan_get_node_id_mapping().

Referenced by uavcan_init_reporting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uavcan_init_reporting()

void uavcan_init_reporting ( void  )

Definition at line 27 of file uavcan_reporting.c.

References ac_can_name, ac_can_name_len, AC_CAN_NAME_PREFIX, foo, node_info_cb(), node_info_ev, node_status_cb(), node_status_ev, and uavcan_bind().

Referenced by uavcan_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uavcan_reporting()

void uavcan_reporting ( void  )

Definition at line 47 of file uavcan_reporting.c.

References foo, get_uavcan_status(), and uavcan_broadcast().

+ Here is the call graph for this function:

Variable Documentation

◆ ac_can_name

char ac_can_name[50] = {0}

Definition at line 17 of file uavcan_reporting.c.

Referenced by node_info_cb(), and uavcan_init_reporting().

◆ ac_can_name_len

uint8_t ac_can_name_len = 0

Definition at line 18 of file uavcan_reporting.c.

Referenced by node_info_cb(), and uavcan_init_reporting().

◆ node_info_ev

uavcan_event node_info_ev
static

Definition at line 14 of file uavcan_reporting.c.

Referenced by uavcan_init_reporting().

◆ node_status_ev

uavcan_event node_status_ev
static

Definition at line 15 of file uavcan_reporting.c.

Referenced by uavcan_init_reporting().