dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
uavobjectmanager.h File Reference
#include "pios_queue.h"

Go to the source code of this file.

Data Structures

struct  __attribute__
 
struct  UAVObjEvent
 
struct  UAVObjStats
 

Macros

#define UAVOBJ_ALL_INSTANCES   0xFFFF
 
#define UAVOBJ_MAX_INSTANCES   1000
 
#define UAVOBJ_ACCESS_SHIFT   0
 
#define UAVOBJ_GCS_ACCESS_SHIFT   1
 
#define UAVOBJ_TELEMETRY_ACKED_SHIFT   2
 
#define UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT   3
 
#define UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT   4
 
#define UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT   6
 
#define UAVOBJ_UPDATE_MODE_MASK   0x3
 
#define EV_MASK_ALL   0
 
#define EV_MASK_ALL_UPDATES   (EV_UNPACKED | EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATED_PERIODIC)
 

Typedefs

typedef struct UAVOBaseUAVObjHandle
 
typedef void(* UAVObjEventCallback )(const UAVObjEvent *ev, void *cb_ctx, void *uavo_data, int uavo_len)
 
typedef void(* UAVObjInitializeCallback )(UAVObjHandle obj_handle, uint16_t instId)
 
typedef void(* new_uavo_instance_cb_t )(uint32_t, uint32_t)
 

Enumerations

enum  UAVObjUpdateMode { UPDATEMODE_MANUAL = 0, UPDATEMODE_PERIODIC = 1, UPDATEMODE_ONCHANGE = 2, UPDATEMODE_THROTTLED = 3 }
 
enum  UAVObjEventType {
  EV_NONE = 0x00, EV_UNPACKED = 0x01, EV_UPDATED = 0x02, EV_UPDATED_MANUAL = 0x04,
  EV_UPDATED_PERIODIC = 0x08
}
 
enum  UAVObjAccessType { ACCESS_READWRITE = 0, ACCESS_READONLY = 1 }
 

Functions

void UAVObjRegisterNewInstanceCB (new_uavo_instance_cb_t callback)
 
int32_t UAVObjInitialize ()
 
void UAVObjGetStats (UAVObjStats *statsOut)
 
void UAVObjClearStats ()
 
UAVObjHandle UAVObjRegister (uint32_t id, int32_t isSingleInstance, int32_t isSettings, uint32_t numBytes, UAVObjInitializeCallback initCb)
 
UAVObjHandle UAVObjGetByID (uint32_t id)
 
uint32_t UAVObjGetID (UAVObjHandle obj)
 
uint32_t UAVObjGetNumBytes (UAVObjHandle obj)
 
uint16_t UAVObjGetNumInstances (UAVObjHandle obj)
 
UAVObjHandle UAVObjGetLinkedObj (UAVObjHandle obj)
 
uint16_t UAVObjCreateInstance (UAVObjHandle obj_handle, UAVObjInitializeCallback initCb)
 
bool UAVObjIsSingleInstance (UAVObjHandle obj)
 
bool UAVObjIsMetaobject (UAVObjHandle obj)
 
bool UAVObjIsSettings (UAVObjHandle obj)
 
int32_t UAVObjUnpack (UAVObjHandle obj_handle, uint16_t instId, const uint8_t *dataIn)
 
int32_t UAVObjPack (UAVObjHandle obj_handle, uint16_t instId, uint8_t *dataOut)
 
int32_t UAVObjSave (UAVObjHandle obj_handle, uint16_t instId)
 
int32_t UAVObjLoad (UAVObjHandle obj_handle, uint16_t instId)
 
int32_t UAVObjDeleteById (uint32_t obj_id, uint16_t inst_id)
 
int32_t UAVObjSaveSettings ()
 
int32_t UAVObjLoadSettings ()
 
int32_t UAVObjDeleteSettings ()
 
int32_t UAVObjSaveMetaobjects ()
 
int32_t UAVObjLoadMetaobjects ()
 
int32_t UAVObjDeleteMetaobjects ()
 
int32_t UAVObjSetData (UAVObjHandle obj_handle, const void *dataIn)
 
int32_t UAVObjSetDataField (UAVObjHandle obj_handle, const void *dataIn, uint32_t offset, uint32_t size)
 
int32_t UAVObjGetData (UAVObjHandle obj_handle, void *dataOut)
 
int32_t UAVObjGetDataField (UAVObjHandle obj_handle, void *dataOut, uint32_t offset, uint32_t size)
 
int32_t UAVObjSetInstanceData (UAVObjHandle obj_handle, uint16_t instId, const void *dataIn)
 
int32_t UAVObjSetInstanceDataField (UAVObjHandle obj_handle, uint16_t instId, const void *dataIn, uint32_t offset, uint32_t size)
 
int32_t UAVObjGetInstanceData (UAVObjHandle obj_handle, uint16_t instId, void *dataOut)
 
int32_t UAVObjGetInstanceDataField (UAVObjHandle obj_handle, uint16_t instId, void *dataOut, uint32_t offset, uint32_t size)
 
int32_t UAVObjSetMetadata (UAVObjHandle obj_handle, const UAVObjMetadata *dataIn)
 
int32_t UAVObjGetMetadata (UAVObjHandle obj_handle, UAVObjMetadata *dataOut)
 
uint8_t UAVObjGetMetadataAccess (const UAVObjMetadata *dataOut)
 
UAVObjAccessType UAVObjGetAccess (const UAVObjMetadata *dataOut)
 
void UAVObjSetAccess (UAVObjMetadata *dataOut, UAVObjAccessType mode)
 
UAVObjAccessType UAVObjGetGcsAccess (const UAVObjMetadata *dataOut)
 
void UAVObjSetGcsAccess (UAVObjMetadata *dataOut, UAVObjAccessType mode)
 
uint8_t UAVObjGetTelemetryAcked (const UAVObjMetadata *dataOut)
 
void UAVObjSetTelemetryAcked (UAVObjMetadata *dataOut, uint8_t val)
 
uint8_t UAVObjGetGcsTelemetryAcked (const UAVObjMetadata *dataOut)
 
void UAVObjSetGcsTelemetryAcked (UAVObjMetadata *dataOut, uint8_t val)
 
UAVObjUpdateMode UAVObjGetTelemetryUpdateMode (const UAVObjMetadata *dataOut)
 
void UAVObjSetTelemetryUpdateMode (UAVObjMetadata *dataOut, UAVObjUpdateMode val)
 
UAVObjUpdateMode UAVObjGetGcsTelemetryUpdateMode (const UAVObjMetadata *dataOut)
 
void UAVObjSetTelemetryGcsUpdateMode (UAVObjMetadata *dataOut, UAVObjUpdateMode val)
 
int8_t UAVObjReadOnly (UAVObjHandle obj)
 
int32_t UAVObjConnectQueue (UAVObjHandle obj_handle, struct pios_queue *queue, uint8_t eventMask)
 
int32_t UAVObjDisconnectQueue (UAVObjHandle obj_handle, struct pios_queue *queue)
 
int32_t UAVObjConnectQueueThrottled (UAVObjHandle obj_handle, struct pios_queue *queue, uint8_t eventMask, uint16_t interval)
 
int32_t UAVObjConnectCallback (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx, uint8_t eventMask)
 
int32_t UAVObjConnectCallbackThrottled (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx, uint8_t eventMask, uint16_t interval)
 
void UAVObjUnblockThrottle (struct ObjectEventEntryThrottled *throttled)
 
int32_t UAVObjDisconnectCallback (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx)
 
void UAVObjUpdated (UAVObjHandle obj)
 
void UAVObjInstanceUpdated (UAVObjHandle obj_handle, uint16_t instId)
 
void UAVObjIterate (void(*iterator)(UAVObjHandle obj))
 
int32_t getEventMask (UAVObjHandle obj_handle, struct pios_queue *queue)
 
uint8_t UAVObjCount ()
 
uint32_t UAVObjIDByIndex (uint8_t index)
 
void UAVObjCbSetFlag (const UAVObjEvent *objEv, void *ctx, void *obj, int len)
 
void UAVObjCbCopyData (const UAVObjEvent *objEv, void *ctx, void *obj, int len)
 

Macro Definition Documentation

#define EV_MASK_ALL   0

Helper macros for event masks

Definition at line 103 of file uavobjectmanager.h.

#define EV_MASK_ALL_UPDATES   (EV_UNPACKED | EV_UPDATED | EV_UPDATED_MANUAL | EV_UPDATED_PERIODIC)

Definition at line 104 of file uavobjectmanager.h.

#define UAVOBJ_ACCESS_SHIFT   0

Definition at line 46 of file uavobjectmanager.h.

#define UAVOBJ_ALL_INSTANCES   0xFFFF

Definition at line 40 of file uavobjectmanager.h.

#define UAVOBJ_GCS_ACCESS_SHIFT   1

Definition at line 47 of file uavobjectmanager.h.

#define UAVOBJ_GCS_TELEMETRY_ACKED_SHIFT   3

Definition at line 49 of file uavobjectmanager.h.

#define UAVOBJ_GCS_TELEMETRY_UPDATE_MODE_SHIFT   6

Definition at line 51 of file uavobjectmanager.h.

#define UAVOBJ_MAX_INSTANCES   1000

Definition at line 41 of file uavobjectmanager.h.

#define UAVOBJ_TELEMETRY_ACKED_SHIFT   2

Definition at line 48 of file uavobjectmanager.h.

#define UAVOBJ_TELEMETRY_UPDATE_MODE_SHIFT   4

Definition at line 50 of file uavobjectmanager.h.

#define UAVOBJ_UPDATE_MODE_MASK   0x3

Definition at line 52 of file uavobjectmanager.h.

Typedef Documentation

typedef void(* new_uavo_instance_cb_t)(uint32_t, uint32_t)

Definition at line 148 of file uavobjectmanager.h.

typedef void(* UAVObjEventCallback)(const UAVObjEvent *ev, void *cb_ctx, void *uavo_data, int uavo_len)

Event callback, this function is called when an event is invoked. The function will be executed in the event task. The ev parameter should be copied if needed after the function returns.

Definition at line 130 of file uavobjectmanager.h.

typedef struct UAVOBase* UAVObjHandle

Definition at line 54 of file uavobjectmanager.h.

typedef void(* UAVObjInitializeCallback)(UAVObjHandle obj_handle, uint16_t instId)

Callback used to initialize the object fields to their default values.

Definition at line 136 of file uavobjectmanager.h.

Enumeration Type Documentation

Access types

Enumerator
ACCESS_READWRITE 
ACCESS_READONLY 

Definition at line 109 of file uavobjectmanager.h.

Event types generated by the objects.

Enumerator
EV_NONE 
EV_UNPACKED 

No event

EV_UPDATED 

Object data updated by unpacking

EV_UPDATED_MANUAL 

Object data updated by changing the data structure

EV_UPDATED_PERIODIC 

Object update event manually generated

Definition at line 92 of file uavobjectmanager.h.

Object update mode, used by multiple modules (e.g. telemetry and logger)

Enumerator
UPDATEMODE_MANUAL 
UPDATEMODE_PERIODIC 

Manually update object, by calling the updated() function

UPDATEMODE_ONCHANGE 

Automatically update object at periodic intervals

UPDATEMODE_THROTTLED 

Only update object when its data changes

Definition at line 59 of file uavobjectmanager.h.

Function Documentation

uint8_t UAVObjGetMetadataAccess ( const UAVObjMetadata *  dataOut)
void UAVObjSetTelemetryGcsUpdateMode ( UAVObjMetadata *  dataOut,
UAVObjUpdateMode  val 
)