/** ****************************************************************************** * * @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 2407027612U #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 Objects; } __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 Objects information /* Enumeration options for field Objects */ typedef enum { OBJECTPERSISTENCE_OBJECTS_ALL=0, OBJECTPERSISTENCE_OBJECTS_SETTINGS=1, OBJECTPERSISTENCE_OBJECTS_METAOBJECTS=2, } ObjectPersistenceObjectsOptions; // Generic interface functions int32_t ObjectPersistenceInitialize(); UAVObjHandle ObjectPersistenceHandle(); #endif // OBJECTPERSISTENCE_H