dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
radiocombridge.c File Reference
#include <openpilot.h>
#include <eventdispatcher.h>
#include <objectpersistence.h>
#include <radiocombridgestats.h>
#include "hwtaulink.h"
#include <uavtalk.h>
#include <uavtalk_priv.h>
#include "flightbatterystate.h"
#include "flightstatus.h"
#include "positionactual.h"
#include "velocityactual.h"
#include "baroaltitude.h"
#include "modulesettings.h"
#include "pios_thread.h"
#include "pios_queue.h"
#include <pios_hal.h>
#include <uavtalkreceiver.h>

Go to the source code of this file.

Data Structures

struct  RadioComBridgeData
 

Macros

#define STACK_SIZE_BYTES   600
 
#define TASK_PRIORITY   PIOS_THREAD_PRIO_LOW
 
#define MAX_RETRIES   2
 
#define MAX_PORT_DELAY   200
 
#define COMSTATS_INJECT   400
 
#define RETRY_TIMEOUT_MS   150
 
#define USB_ACTIVITY_TIMEOUT_MS   6000
 
#define MetaObjectId(x)   (x+1)
 

Functions

static void telemetryRxTask (void *parameters)
 
static void radioRxTask (void *parameters)
 
static int32_t UAVTalkSendHandler (void *ctx, uint8_t *buf, int32_t length)
 Transmit data buffer to the com port. More...
 
static int32_t RadioSendHandler (void *ctx, uint8_t *buf, int32_t length)
 
static void ProcessLocalStream (UAVTalkConnection inConnectionHandle, UAVTalkConnection outConnectionHandle, uint8_t rxbyte)
 Process a byte of data received on the telemetry stream. More...
 
static void ProcessRadioStream (UAVTalkConnection inConnectionHandle, UAVTalkConnection outConnectionHandle, uint8_t rxbyte)
 Process a byte of data received on the radio data stream. More...
 
static void NewReceiverData (const UAVObjEvent *ev, void *ctx, void *obj, int len)
 
static uintptr_t getComPort ()
 
static int32_t RadioComBridgeStart (void)
 Start the module. More...
 
static int32_t RadioComBridgeInitialize (void)
 Initialise the module. More...
 
 MODULE_INITCALL (RadioComBridgeInitialize, RadioComBridgeStart)
 
static void updateRadioComBridgeStats ()
 
static void radioRxTask (__attribute__((unused)) void *parameters)
 Radio rx task. Receive data packets from the radio and pass them on. More...
 
static void telemetryRxTask (__attribute__((unused)) void *parameters)
 Receive telemetry from the USB/COM port. More...
 

Variables

static RadioComBridgeDatadata