dRonin
adbada4
dRonin firmware
|
Files | |
file | eventdispatcher.h |
Event dispatcher, distributes object events as callbacks. Alternative to using tasks and queues. All callbacks are invoked from the event task. | |
file | uavobjectmanager.c |
Object manager library. This library holds a collection of all objects. It can be used by all modules/libraries to find an object reference. | |
Data Structures | |
struct | EventStats |
struct | ObjectEventEntry |
struct | ObjectEventEntryThrottled |
struct | UAVOBase |
struct | UAVOMeta |
struct | UAVOData |
struct | UAVOSingle |
struct | UAVOMultiInst |
struct | UAVOMulti |
Macros | |
#define | SET_BITS(var, shift, value, mask) var = (var & ~(mask << shift)) | (value << shift); |
#define | MetaNumBytes sizeof(UAVObjMetadata) |
#define | MetaBaseObjectPtr(obj) ((struct UAVOData *)((obj)-offsetof(struct UAVOData, metaObj))) |
#define | MetaObjectPtr(obj) (&((obj)->metaObj.base)) |
#define | MetaDataPtr(obj) ((UAVObjMetadata*)&((obj)->instance0)) |
#define | LinkedMetaDataPtr(obj) ((UAVObjMetadata*)&((obj)->metaObj.instance0)) |
#define | MetaObjectId(id) ((id)+1) |
#define | ObjSingleInstanceDataOffset(obj) ((void*)(&(( (struct UAVOSingle*)obj )->instance0))) |
#define | InstanceDataOffset(inst) ((void*)&(( (struct UAVOMultiInst*)inst )->instance)) |
#define | InstanceData(instance) (void*)instance |
#define | UAVO_CB_STACK_SIZE 512 |
#define | INSTANCE_COPY_ALL 0xffffffff |
#define | invokeCallback realInvokeCallback |
Typedefs | |
typedef void * | InstanceHandle |
Functions | |
void | EventGetStats (EventStats *statsOut) |
void | EventClearStats () |
int32_t | EventPeriodicCallbackCreate (UAVObjEvent *ev, UAVObjEventCallback cb, uint16_t periodMs) |
int32_t | EventPeriodicCallbackUpdate (UAVObjEvent *ev, UAVObjEventCallback cb, uint16_t periodMs) |
int32_t | EventPeriodicQueueCreate (UAVObjEvent *ev, struct pios_queue *queue, uint16_t periodMs) |
int32_t | EventPeriodicQueueUpdate (UAVObjEvent *ev, struct pios_queue *queue, uint16_t periodMs) |
struct UAVOBase | __attribute__ ((packed)) |
static int32_t | sendEvent (struct UAVOBase *obj, uint16_t instId, UAVObjEventType event, void *obj_data, int len) |
static InstanceHandle | createInstance (struct UAVOData *obj, uint16_t instId) |
static InstanceHandle | getInstance (struct UAVOData *obj, uint16_t instId) |
static int32_t | connectObj (UAVObjHandle obj_handle, struct pios_queue *queue, UAVObjEventCallback cb, void *cbCtx, uint8_t eventMask, uint16_t interval) |
static int32_t | disconnectObj (UAVObjHandle obj_handle, struct pios_queue *queue, UAVObjEventCallback cb, void *cbCtx) |
int32_t | UAVObjInitialize () |
void | UAVObjGetStats (UAVObjStats *statsOut) |
void | UAVObjClearStats () |
static void | UAVObjInitMetaData (struct UAVOMeta *obj_meta) |
static struct UAVOData * | UAVObjAllocSingle (uint32_t num_bytes) |
static struct UAVOData * | UAVObjAllocMulti (uint32_t num_bytes) |
UAVObjHandle | UAVObjRegister (uint32_t id, int32_t isSingleInstance, int32_t isSettings, uint32_t num_bytes, UAVObjInitializeCallback initCb) |
UAVObjHandle | UAVObjGetByID (uint32_t id) |
uint32_t | UAVObjGetID (UAVObjHandle obj_handle) |
uint32_t | UAVObjGetNumBytes (UAVObjHandle obj) |
UAVObjHandle | UAVObjGetLinkedObj (UAVObjHandle obj_handle) |
uint16_t | UAVObjGetNumInstances (UAVObjHandle obj_handle) |
uint16_t | UAVObjCreateInstance (UAVObjHandle obj_handle, UAVObjInitializeCallback initCb) |
bool | UAVObjIsSingleInstance (UAVObjHandle obj_handle) |
bool | UAVObjIsMetaobject (UAVObjHandle obj_handle) |
bool | UAVObjIsSettings (UAVObjHandle obj_handle) |
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) |
UAVObjAccessType | UAVObjGetAccess (const UAVObjMetadata *metadata) |
void | UAVObjSetAccess (UAVObjMetadata *metadata, UAVObjAccessType mode) |
UAVObjAccessType | UAVObjGetGcsAccess (const UAVObjMetadata *metadata) |
void | UAVObjSetGcsAccess (UAVObjMetadata *metadata, UAVObjAccessType mode) |
uint8_t | UAVObjGetTelemetryAcked (const UAVObjMetadata *metadata) |
void | UAVObjSetTelemetryAcked (UAVObjMetadata *metadata, uint8_t val) |
uint8_t | UAVObjGetGcsTelemetryAcked (const UAVObjMetadata *metadata) |
void | UAVObjSetGcsTelemetryAcked (UAVObjMetadata *metadata, uint8_t val) |
UAVObjUpdateMode | UAVObjGetTelemetryUpdateMode (const UAVObjMetadata *metadata) |
void | UAVObjSetTelemetryUpdateMode (UAVObjMetadata *metadata, UAVObjUpdateMode val) |
UAVObjUpdateMode | UAVObjGetGcsTelemetryUpdateMode (const UAVObjMetadata *metadata) |
void | UAVObjSetGcsTelemetryUpdateMode (UAVObjMetadata *metadata, UAVObjUpdateMode val) |
int8_t | UAVObjReadOnly (UAVObjHandle obj_handle) |
int32_t | UAVObjConnectQueueThrottled (UAVObjHandle obj_handle, struct pios_queue *queue, uint8_t eventMask, uint16_t interval) |
int32_t | UAVObjConnectQueue (UAVObjHandle obj_handle, struct pios_queue *queue, uint8_t eventMask) |
int32_t | UAVObjDisconnectQueue (UAVObjHandle obj_handle, struct pios_queue *queue) |
void | UAVObjCbSetFlag (const UAVObjEvent *objEv, void *ctx, void *obj, int len) |
void | UAVObjCbCopyData (const UAVObjEvent *objEv, void *ctx, void *obj, int len) |
int32_t | UAVObjConnectCallbackThrottled (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx, uint8_t eventMask, uint16_t interval) |
int32_t | UAVObjConnectCallback (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx, uint8_t eventMask) |
int32_t | UAVObjDisconnectCallback (UAVObjHandle obj_handle, UAVObjEventCallback cb, void *cbCtx) |
void | UAVObjUpdated (UAVObjHandle obj_handle) |
void | UAVObjInstanceUpdated (UAVObjHandle obj_handle, uint16_t instId) |
void | UAVObjIterate (void(*iterator)(UAVObjHandle obj)) |
static void | __attribute__ ((used)) |
static int32_t | pumpOneEvent (UAVObjEvent *msg, void *obj_data, int len) |
int32_t | getEventMask (UAVObjHandle obj_handle, struct pios_queue *queue) |
uint8_t | UAVObjCount () |
uint32_t | UAVObjIDByIndex (uint8_t index) |
void | UAVObjUnblockThrottle (struct ObjectEventEntryThrottled *throttled) |
void | UAVObjRegisterNewInstanceCB (new_uavo_instance_cb_t callback) |
Variables | |
uintptr_t | pios_uavo_settings_fs_id |
static struct UAVOData * | uavo_list |
static struct ObjectEventEntry * | events_unused |
static struct ObjectEventEntry * | events_unused_throttled |
static struct pios_recursive_mutex * | mutex |
static const UAVObjMetadata | defMetadata |
static UAVObjStats | stats |
static new_uavo_instance_cb_t | newUavObjInstanceCB |
static void * | cb_stack |
#define INSTANCE_COPY_ALL 0xffffffff |
Definition at line 1114 of file uavobjectmanager.c.
Definition at line 176 of file uavobjectmanager.c.
#define InstanceDataOffset | ( | inst | ) | ((void*)&(( (struct UAVOMultiInst*)inst )->instance)) |
Definition at line 175 of file uavobjectmanager.c.
#define invokeCallback realInvokeCallback |
Definition at line 1722 of file uavobjectmanager.c.
#define LinkedMetaDataPtr | ( | obj | ) | ((UAVObjMetadata*)&((obj)->metaObj.instance0)) |
Definition at line 170 of file uavobjectmanager.c.
Definition at line 166 of file uavobjectmanager.c.
#define MetaDataPtr | ( | obj | ) | ((UAVObjMetadata*)&((obj)->instance0)) |
Definition at line 169 of file uavobjectmanager.c.
#define MetaNumBytes sizeof(UAVObjMetadata) |
all information about a metaobject are hardcoded constants
Definition at line 163 of file uavobjectmanager.c.
Definition at line 171 of file uavobjectmanager.c.
#define MetaObjectPtr | ( | obj | ) | (&((obj)->metaObj.base)) |
Definition at line 168 of file uavobjectmanager.c.
#define ObjSingleInstanceDataOffset | ( | obj | ) | ((void*)(&(( (struct UAVOSingle*)obj )->instance0))) |
all information about instances are dependant on object type
Definition at line 174 of file uavobjectmanager.c.
Definition at line 53 of file uavobjectmanager.c.
#define UAVO_CB_STACK_SIZE 512 |
Definition at line 209 of file uavobjectmanager.c.
typedef void* InstanceHandle |
List of event queues and the eventmask associated with the queue.opaque type for instances
Definition at line 60 of file uavobjectmanager.c.
struct UAVOBase __attribute__ | ( | (packed) | ) |
Definition at line 38 of file serial_4way.h.
|
static |
Definition at line 1674 of file uavobjectmanager.c.
|
static |
Connect an event queue to the object, if the queue is already connected then the event mask is only updated.
[in] | obj | The object handle |
[in] | queue | The event queue |
[in] | cb | The event callback |
[in] | eventMask | The event mask, if EV_MASK_ALL_UPDATES then all events are enabled (e.g. EV_UPDATED | EV_UPDATED_MANUAL) |
[in] | interval | The interval at which to throttle updates; 0 is unthrottled |
Definition at line 1976 of file uavobjectmanager.c.
|
static |
Create a new object instance, return the instance info or NULL if failure.
Definition at line 1876 of file uavobjectmanager.c.
|
static |
Disconnect an event queue from the object
[in] | obj | The object handle |
[in] | queue | The event queue |
[in] | cb | The event callback |
Definition at line 2076 of file uavobjectmanager.c.
void EventClearStats | ( | ) |
Clear the statistics counters
Definition at line 869 of file systemmod.c.
void EventGetStats | ( | EventStats * | statsOut | ) |
Get the statistics counters
[out] | statsOut | The statistics counters will be copied there |
Definition at line 859 of file systemmod.c.
int32_t EventPeriodicCallbackCreate | ( | UAVObjEvent * | ev, |
UAVObjEventCallback | cb, | ||
uint16_t | periodMs | ||
) |
Dispatch an event at periodic intervals.
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked |
[in] | periodMs | The period the event is generated |
Definition at line 884 of file systemmod.c.
int32_t EventPeriodicCallbackUpdate | ( | UAVObjEvent * | ev, |
UAVObjEventCallback | cb, | ||
uint16_t | periodMs | ||
) |
Update the period of a periodic event.
[in] | ev | The event to be dispatched |
[in] | cb | The callback to be invoked |
[in] | periodMs | The period the event is generated |
Definition at line 896 of file systemmod.c.
int32_t EventPeriodicQueueCreate | ( | UAVObjEvent * | ev, |
struct pios_queue * | queue, | ||
uint16_t | periodMs | ||
) |
Dispatch an event at periodic intervals.
[in] | ev | The event to be dispatched |
[in] | queue | The queue that the event will be pushed in |
[in] | periodMs | The period the event is generated |
Definition at line 908 of file systemmod.c.
int32_t EventPeriodicQueueUpdate | ( | UAVObjEvent * | ev, |
struct pios_queue * | queue, | ||
uint16_t | periodMs | ||
) |
Update the period of a periodic event.
[in] | ev | The event to be dispatched |
[in] | queue | The queue |
[in] | periodMs | The period the event is generated |
Definition at line 920 of file systemmod.c.
int32_t getEventMask | ( | UAVObjHandle | obj_handle, |
struct pios_queue * | queue | ||
) |
getEventMask Iterates through the connections and returns the event mask
[in] | obj | The object handle |
[in] | queue | The event queue |
Definition at line 2112 of file uavobjectmanager.c.
|
static |
Get the instance information or NULL if the instance does not exist
Definition at line 1925 of file uavobjectmanager.c.
|
static |
Definition at line 1725 of file uavobjectmanager.c.
|
static |
Send a triggered event to all event queues registered on the object.
Definition at line 1787 of file uavobjectmanager.c.
|
static |
Definition at line 308 of file uavobjectmanager.c.
|
static |
Definition at line 285 of file uavobjectmanager.c.
void UAVObjCbCopyData | ( | const UAVObjEvent * | objEv, |
void * | ctx, | ||
void * | obj, | ||
int | len | ||
) |
Copies the passed in object to the ctx pointer. Conforms to the UAVObjConnectCallback* signature.
Using UAVObjCbSetFlag is preferred. This should only be used via the wrapper in the individual UAV objects to ensure that objects are not mismatched (wrong registration type -> ctx mapping).
[in] | ctx | The event callback context. |
[in] | obj | The pointer to the raw object data. |
[in] | len | The length of data to copy. |
Definition at line 1579 of file uavobjectmanager.c.
void UAVObjCbSetFlag | ( | const UAVObjEvent * | objEv, |
void * | ctx, | ||
void * | obj, | ||
int | len | ||
) |
Sets a flag passed in the ctx parameter to true. Conforms to the UAVObjConnectCallback* signature.
Using this is a best practice to listen for configuration changes. This sets a volatile flag that you can check at the top of the task main function, and update configuration as appropriate.
Note that the flag is considered a uint8_t, but the width doesn't really matter– it will be "set" as long as it is at least 8 bits wide.
[in] | ctx | The event callback context |
Definition at line 1560 of file uavobjectmanager.c.
void UAVObjClearStats | ( | ) |
Clear the statistics counters
Definition at line 261 of file uavobjectmanager.c.
int32_t UAVObjConnectCallback | ( | UAVObjHandle | obj_handle, |
UAVObjEventCallback | cb, | ||
void * | cbCtx, | ||
uint8_t | eventMask | ||
) |
Definition at line 1604 of file uavobjectmanager.c.
int32_t UAVObjConnectCallbackThrottled | ( | UAVObjHandle | obj_handle, |
UAVObjEventCallback | cb, | ||
void * | cbCtx, | ||
uint8_t | eventMask, | ||
uint16_t | interval | ||
) |
Connect an event callback to the object, if the callback is already connected then the event mask is only updated. The supplied callback will be invoked on all events matching the event mask.
[in] | obj | The object handle |
[in] | cb | The event callback |
[in] | eventMask | The event mask, if EV_MASK_ALL_UPDATES then all events are enabled (e.g. EV_UPDATED | EV_UPDATED_MANUAL) |
[in] | interval | The interval at which to throttle updates; 0 is unthrottled |
Definition at line 1593 of file uavobjectmanager.c.
int32_t UAVObjConnectQueue | ( | UAVObjHandle | obj_handle, |
struct pios_queue * | queue, | ||
uint8_t | eventMask | ||
) |
Definition at line 1524 of file uavobjectmanager.c.
int32_t UAVObjConnectQueueThrottled | ( | UAVObjHandle | obj_handle, |
struct pios_queue * | queue, | ||
uint8_t | eventMask, | ||
uint16_t | interval | ||
) |
Connect an event queue to the object, if the queue is already connected then the event mask is only updated. All events matching the event mask will be pushed to the event queue.
[in] | obj | The object handle |
[in] | queue | The event queue |
[in] | eventMask | The event mask, if EV_MASK_ALL_UPDATES then all events are enabled (e.g. EV_UPDATED | EV_UPDATED_MANUAL) |
[in] | interval | The interval at which to throttle updates; 0 is unthrottled |
Definition at line 1512 of file uavobjectmanager.c.
uint8_t UAVObjCount | ( | ) |
UAVObjCount returns the registered uav objects count
Definition at line 2136 of file uavobjectmanager.c.
uint16_t UAVObjCreateInstance | ( | UAVObjHandle | obj_handle, |
UAVObjInitializeCallback | initCb | ||
) |
Create a new instance in the object.
[in] | obj | The object handle |
Definition at line 538 of file uavobjectmanager.c.
int32_t UAVObjDeleteById | ( | uint32_t | obj_id, |
uint16_t | inst_id | ||
) |
Delete an object from the file system (SD card).
[in] | obj_id | The object id |
[in] | inst_id | The object instance |
Definition at line 880 of file uavobjectmanager.c.
int32_t UAVObjDeleteMetaobjects | ( | ) |
Delete all metaobjects from the SD card.
Definition at line 1045 of file uavobjectmanager.c.
int32_t UAVObjDeleteSettings | ( | ) |
Delete all settings objects from the SD card.
Definition at line 955 of file uavobjectmanager.c.
int32_t UAVObjDisconnectCallback | ( | UAVObjHandle | obj_handle, |
UAVObjEventCallback | cb, | ||
void * | cbCtx | ||
) |
Disconnect an event callback from the object.
[in] | obj | The object handle |
[in] | cb | The event callback |
Definition at line 1616 of file uavobjectmanager.c.
int32_t UAVObjDisconnectQueue | ( | UAVObjHandle | obj_handle, |
struct pios_queue * | queue | ||
) |
Disconnect an event queue from the object.
[in] | obj | The object handle |
[in] | queue | The event queue |
Definition at line 1536 of file uavobjectmanager.c.
UAVObjAccessType UAVObjGetAccess | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata access member
[in] | metadata | The metadata object |
Definition at line 1367 of file uavobjectmanager.c.
UAVObjHandle UAVObjGetByID | ( | uint32_t | id | ) |
Retrieve an object from the list given its id
[in] | The | object ID |
Definition at line 410 of file uavobjectmanager.c.
int32_t UAVObjGetData | ( | UAVObjHandle | obj_handle, |
void * | dataOut | ||
) |
Get the object data
[in] | obj | The object handle |
[out] | dataOut | The object's data structure |
Definition at line 1098 of file uavobjectmanager.c.
int32_t UAVObjGetDataField | ( | UAVObjHandle | obj_handle, |
void * | dataOut, | ||
uint32_t | offset, | ||
uint32_t | size | ||
) |
Get the object data
[in] | obj | The object handle |
[out] | dataOut | The object's data structure |
Definition at line 1109 of file uavobjectmanager.c.
UAVObjAccessType UAVObjGetGcsAccess | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata GCS access member
[in] | metadata | The metadata object |
Definition at line 1389 of file uavobjectmanager.c.
uint8_t UAVObjGetGcsTelemetryAcked | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata GCS telemetry acked member
[in] | metadata | The metadata object |
Definition at line 1430 of file uavobjectmanager.c.
UAVObjUpdateMode UAVObjGetGcsTelemetryUpdateMode | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata GCS telemetry update mode
[in] | metadata | The metadata object |
Definition at line 1470 of file uavobjectmanager.c.
uint32_t UAVObjGetID | ( | UAVObjHandle | obj_handle | ) |
Get the object's ID
[in] | obj | The object handle |
Definition at line 440 of file uavobjectmanager.c.
int32_t UAVObjGetInstanceData | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
void * | dataOut | ||
) |
Get the data of a specific object instance
[in] | obj | The object handle |
[in] | instId | The object instance ID |
[out] | dataOut | The object's data structure |
Definition at line 1211 of file uavobjectmanager.c.
int32_t UAVObjGetInstanceDataField | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
void * | dataOut, | ||
uint32_t | offset, | ||
uint32_t | size | ||
) |
Get the data of a specific object instance
[in] | obj | The object handle |
[in] | instId | The object instance ID |
[out] | dataOut | The object's data structure |
Definition at line 1258 of file uavobjectmanager.c.
UAVObjHandle UAVObjGetLinkedObj | ( | UAVObjHandle | obj_handle | ) |
Get the object this object is linked to. For regular objects, the linked object is the metaobject. For metaobjects the linked object is the parent object. This function is normally only needed by the telemetry module.
[in] | obj | The object handle |
Definition at line 493 of file uavobjectmanager.c.
int32_t UAVObjGetMetadata | ( | UAVObjHandle | obj_handle, |
UAVObjMetadata * | dataOut | ||
) |
Get the object metadata
[in] | obj | The object handle |
[out] | dataOut | The object's metadata structure |
Definition at line 1338 of file uavobjectmanager.c.
uint32_t UAVObjGetNumBytes | ( | UAVObjHandle | obj | ) |
Get the number of bytes of the object's data (for one instance)
[in] | obj | The object handle |
Definition at line 465 of file uavobjectmanager.c.
uint16_t UAVObjGetNumInstances | ( | UAVObjHandle | obj_handle | ) |
Get the number of instances contained in the object.
[in] | obj | The object handle |
Definition at line 518 of file uavobjectmanager.c.
void UAVObjGetStats | ( | UAVObjStats * | statsOut | ) |
Get the statistics counters
[out] | statsOut | The statistics counters will be copied there |
Definition at line 251 of file uavobjectmanager.c.
uint8_t UAVObjGetTelemetryAcked | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata telemetry acked member
[in] | metadata | The metadata object |
Definition at line 1410 of file uavobjectmanager.c.
UAVObjUpdateMode UAVObjGetTelemetryUpdateMode | ( | const UAVObjMetadata * | metadata | ) |
Get the UAVObject metadata telemetry update mode
[in] | metadata | The metadata object |
Definition at line 1450 of file uavobjectmanager.c.
uint32_t UAVObjIDByIndex | ( | uint8_t | index | ) |
UAVObjIDByIndex returns the ID of the object with index index
Definition at line 2157 of file uavobjectmanager.c.
int32_t UAVObjInitialize | ( | ) |
Initialize the object manager
Definition at line 218 of file uavobjectmanager.c.
|
static |
Definition at line 272 of file uavobjectmanager.c.
void UAVObjInstanceUpdated | ( | UAVObjHandle | obj_handle, |
uint16_t | instId | ||
) |
Send the object's data to the GCS (triggers a EV_UPDATED_MANUAL event on this object).
[in] | obj | The object handle |
[in] | instId | The object instance ID |
Definition at line 1641 of file uavobjectmanager.c.
bool UAVObjIsMetaobject | ( | UAVObjHandle | obj_handle | ) |
Is this a metaobject?
[in] | obj | The object handle |
Definition at line 586 of file uavobjectmanager.c.
bool UAVObjIsSettings | ( | UAVObjHandle | obj_handle | ) |
Is this a settings object?
[in] | obj | The object handle |
Definition at line 601 of file uavobjectmanager.c.
bool UAVObjIsSingleInstance | ( | UAVObjHandle | obj_handle | ) |
Does this object contains a single instance or multiple instances?
[in] | obj | The object handle |
Definition at line 574 of file uavobjectmanager.c.
void UAVObjIterate | ( | void(*)(UAVObjHandle obj) | iterator | ) |
Iterate through all objects in the list.
iterator | This function will be called once for each object, the object will be passed as a parameter |
Definition at line 1655 of file uavobjectmanager.c.
int32_t UAVObjLoad | ( | UAVObjHandle | obj_handle, |
uint16_t | instId | ||
) |
Load an object from the file system (SD card). A file with the name of the object will be opened. The object data can be saved using the UAVObjSave function.
[in] | obj | The object handle. |
[in] | instId | The object instance |
Definition at line 823 of file uavobjectmanager.c.
int32_t UAVObjLoadMetaobjects | ( | ) |
Load all metaobjects from the SD card.
Definition at line 1016 of file uavobjectmanager.c.
int32_t UAVObjLoadSettings | ( | ) |
Load all settings objects from the SD card.
Definition at line 923 of file uavobjectmanager.c.
int32_t UAVObjPack | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
uint8_t * | dataOut | ||
) |
Pack an object to a byte array
[in] | obj | The object handle |
[in] | instId | The instance ID |
[out] | dataOut | The byte array |
Definition at line 682 of file uavobjectmanager.c.
int8_t UAVObjReadOnly | ( | UAVObjHandle | obj_handle | ) |
Check if an object is read only
[in] | obj | The object handle |
Definition at line 1494 of file uavobjectmanager.c.
UAVObjHandle UAVObjRegister | ( | uint32_t | id, |
int32_t | isSingleInstance, | ||
int32_t | isSettings, | ||
uint32_t | num_bytes, | ||
UAVObjInitializeCallback | initCb | ||
) |
Register and new object in the object manager.
[in] | id | Unique object ID |
[in] | isSingleInstance | Is this a single instance or multi-instance object |
[in] | isSettings | Is this a settings object |
[in] | numBytes | Number of bytes of object data (for one instance) |
[in] | initCb | Default field and metadata initialization function |
Definition at line 349 of file uavobjectmanager.c.
void UAVObjRegisterNewInstanceCB | ( | new_uavo_instance_cb_t | callback | ) |
Registers a new UAVO instance created callback
Definition at line 2194 of file uavobjectmanager.c.
int32_t UAVObjSave | ( | UAVObjHandle | obj_handle, |
uint16_t | instId | ||
) |
Save the data of the specified object to the file system (SD card). If the object contains multiple instances, all of them will be saved. A new file with the name of the object will be created. The object data can be restored using the UAVObjLoad function.
[in] | obj | The object handle. |
[in] | instId | The instance ID |
[in] | file | File to append to |
Definition at line 739 of file uavobjectmanager.c.
int32_t UAVObjSaveMetaobjects | ( | ) |
Save all metaobjects to the SD card.
Definition at line 987 of file uavobjectmanager.c.
int32_t UAVObjSaveSettings | ( | ) |
Save all settings objects to the SD card.
Definition at line 891 of file uavobjectmanager.c.
void UAVObjSetAccess | ( | UAVObjMetadata * | metadata, |
UAVObjAccessType | mode | ||
) |
Set the UAVObject metadata access member
[in] | metadata | The metadata object |
[in] | mode | The access mode |
Definition at line 1378 of file uavobjectmanager.c.
int32_t UAVObjSetData | ( | UAVObjHandle | obj_handle, |
const void * | dataIn | ||
) |
Set the object data
[in] | obj | The object handle |
[in] | dataIn | The object's data structure |
Definition at line 1076 of file uavobjectmanager.c.
int32_t UAVObjSetDataField | ( | UAVObjHandle | obj_handle, |
const void * | dataIn, | ||
uint32_t | offset, | ||
uint32_t | size | ||
) |
Set the object data
[in] | obj | The object handle |
[in] | dataIn | The object's data structure |
Definition at line 1087 of file uavobjectmanager.c.
void UAVObjSetGcsAccess | ( | UAVObjMetadata * | metadata, |
UAVObjAccessType | mode | ||
) |
Set the UAVObject metadata GCS access member
[in] | metadata | The metadata object |
[in] | mode | The access mode |
Definition at line 1400 of file uavobjectmanager.c.
void UAVObjSetGcsTelemetryAcked | ( | UAVObjMetadata * | metadata, |
uint8_t | val | ||
) |
Set the UAVObject metadata GCS telemetry acked member
[in] | metadata | The metadata object |
[in] | val | The GCS telemetry acked boolean |
Definition at line 1440 of file uavobjectmanager.c.
void UAVObjSetGcsTelemetryUpdateMode | ( | UAVObjMetadata * | metadata, |
UAVObjUpdateMode | val | ||
) |
Set the UAVObject metadata GCS telemetry update mode member
[in] | metadata | The metadata object |
[in] | val | The GCS telemetry update mode |
Definition at line 1480 of file uavobjectmanager.c.
int32_t UAVObjSetInstanceData | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
const void * | dataIn | ||
) |
Set the data of a specific object instance
[in] | obj | The object handle |
[in] | instId | The object instance ID |
[in] | dataIn | The object's data structure |
Definition at line 1123 of file uavobjectmanager.c.
int32_t UAVObjSetInstanceDataField | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
const void * | dataIn, | ||
uint32_t | offset, | ||
uint32_t | size | ||
) |
Set the data of a specific object instance
[in] | obj | The object handle |
[in] | instId | The object instance ID |
[in] | dataIn | The object's data structure |
Definition at line 1137 of file uavobjectmanager.c.
int32_t UAVObjSetMetadata | ( | UAVObjHandle | obj_handle, |
const UAVObjMetadata * | dataIn | ||
) |
Set the object metadata
[in] | obj | The object handle |
[in] | dataIn | The object's metadata structure |
Definition at line 1315 of file uavobjectmanager.c.
void UAVObjSetTelemetryAcked | ( | UAVObjMetadata * | metadata, |
uint8_t | val | ||
) |
Set the UAVObject metadata telemetry acked member
[in] | metadata | The metadata object |
[in] | val | The telemetry acked boolean |
Definition at line 1420 of file uavobjectmanager.c.
void UAVObjSetTelemetryUpdateMode | ( | UAVObjMetadata * | metadata, |
UAVObjUpdateMode | val | ||
) |
Set the UAVObject metadata telemetry update mode member
[in] | metadata | The metadata object |
[in] | val | The telemetry update mode |
Definition at line 1460 of file uavobjectmanager.c.
void UAVObjUnblockThrottle | ( | struct ObjectEventEntryThrottled * | throttled | ) |
Unblocks a throttled event– allows it to be inserted into queues once again.
Definition at line 2184 of file uavobjectmanager.c.
int32_t UAVObjUnpack | ( | UAVObjHandle | obj_handle, |
uint16_t | instId, | ||
const uint8_t * | dataIn | ||
) |
Unpack an object from a byte array
[in] | obj | The object handle |
[in] | instId | The instance ID |
[in] | dataIn | The byte array |
Definition at line 618 of file uavobjectmanager.c.
void UAVObjUpdated | ( | UAVObjHandle | obj_handle | ) |
Send the object's data to the GCS (triggers a EV_UPDATED_MANUAL event on this object).
[in] | obj | The object handle |
Definition at line 1631 of file uavobjectmanager.c.
|
static |
Definition at line 211 of file uavobjectmanager.c.
|
static |
Definition at line 194 of file uavobjectmanager.c.
|
static |
Definition at line 191 of file uavobjectmanager.c.
|
static |
Definition at line 192 of file uavobjectmanager.c.
|
static |
Definition at line 193 of file uavobjectmanager.c.
|
static |
Definition at line 207 of file uavobjectmanager.c.
uintptr_t pios_uavo_settings_fs_id |
Simulation of the flash filesystem
Definition at line 50 of file pios_board.c.
|
static |
Definition at line 206 of file uavobjectmanager.c.
|
static |
Definition at line 190 of file uavobjectmanager.c.