1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/flight/OpenPilot/UAVObjects/inc/objectpersistence.h
vassilis 7ca10bf5d7 OP-4 Flight/ObjectPersistance Implemented saving/loading of individual objects from the SD card
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@580 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-05-04 02:11:16 +00:00

83 lines
4.0 KiB
C

/**
******************************************************************************
*
* @file objectpersistence.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Implementation of the ObjectPersistence object. This file has been
* automatically generated by the UAVObjectGenerator.
*
* @note Object definition file: objectpersistence.xml.
* This is an automatically generated file.
* DO NOT modify manually.
*
* @see The GNU Public License (GPL) Version 3
*
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef OBJECTPERSISTENCE_H
#define OBJECTPERSISTENCE_H
// Object constants
#define OBJECTPERSISTENCE_OBJID 572614706U
#define OBJECTPERSISTENCE_NAME "ObjectPersistence"
#define OBJECTPERSISTENCE_METANAME "ObjectPersistenceMeta"
#define OBJECTPERSISTENCE_ISSINGLEINST 1
#define OBJECTPERSISTENCE_ISSETTINGS 0
#define OBJECTPERSISTENCE_NUMBYTES sizeof(ObjectPersistenceData)
// Object access macros
#define ObjectPersistenceGet(dataOut) UAVObjGetData(ObjectPersistenceHandle(), dataOut)
#define ObjectPersistenceSet(dataIn) UAVObjSetData(ObjectPersistenceHandle(), dataIn)
#define ObjectPersistenceInstGet(instId, dataOut) UAVObjGetInstanceData(ObjectPersistenceHandle(), instId, dataOut)
#define ObjectPersistenceInstSet(instId, dataIn) UAVObjSetInstanceData(ObjectPersistenceHandle(), instId, dataIn)
#define ObjectPersistenceConnectQueue(queue) UAVObjConnectQueue(ObjectPersistenceHandle(), queue, EV_MASK_ALL_UPDATES)
#define ObjectPersistenceConnectCallback(cb) UAVObjConnectCallback(ObjectPersistenceHandle(), cb, EV_MASK_ALL_UPDATES)
#define ObjectPersistenceCreateInstance() UAVObjCreateInstance(ObjectPersistenceHandle())
#define ObjectPersistenceRequestUpdate() UAVObjRequestUpdate(ObjectPersistenceHandle())
#define ObjectPersistenceRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(ObjectPersistenceHandle(), instId)
#define ObjectPersistenceUpdated() UAVObjUpdated(ObjectPersistenceHandle())
#define ObjectPersistenceInstUpdated(instId) UAVObjUpdated(ObjectPersistenceHandle(), instId)
#define ObjectPersistenceGetMetadata(dataOut) UAVObjGetMetadata(ObjectPersistenceHandle(), dataOut)
#define ObjectPersistenceSetMetadata(dataIn) UAVObjSetMetadata(ObjectPersistenceHandle(), dataIn)
// Object data
typedef struct {
uint8_t Operation;
uint8_t Selection;
uint32_t ObjectID;
uint32_t InstanceID;
} __attribute__((packed)) ObjectPersistenceData;
// Field information
// Field Operation information
/* Enumeration options for field Operation */
typedef enum { OBJECTPERSISTENCE_OPERATION_LOAD=0, OBJECTPERSISTENCE_OPERATION_SAVE=1, OBJECTPERSISTENCE_OPERATION_DELETE=2, } ObjectPersistenceOperationOptions;
// Field Selection information
/* Enumeration options for field Selection */
typedef enum { OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT=0, OBJECTPERSISTENCE_SELECTION_ALLSETTINGS=1, OBJECTPERSISTENCE_SELECTION_ALLMETAOBJECTS=2, OBJECTPERSISTENCE_SELECTION_ALLOBJECTS=3, } ObjectPersistenceSelectionOptions;
// Field ObjectID information
// Field InstanceID information
// Generic interface functions
int32_t ObjectPersistenceInitialize();
UAVObjHandle ObjectPersistenceHandle();
#endif // OBJECTPERSISTENCE_H