OMAPI  1.8
Open Movement Public API
omapi.h File Reference

Go to the source code of this file.

Data Structures

struct  OM_READER_HEADER_PACKET
 
struct  OM_READER_DATA_PACKET
 

Macros

#define OM_VERSION   108
 
#define OM_MEMORY_HEALTH_ERROR   1
 
#define OM_MEMORY_HEALTH_WARNING   8
 
#define OM_METADATA_SIZE   448
 
#define OmClearDataAndCommit(_deviceId)   OmEraseDataAndCommit((_deviceId), OM_ERASE_QUICKFORMAT)
 
#define OmCommit(_deviceId)   OmEraseDataAndCommit((_deviceId), OM_ERASE_NONE)
 
#define OM_ACCEL_DEFAULT_RATE   100
 
#define OM_ACCEL_DEFAULT_RANGE   8
 
#define OM_MAX_PATH   (256)
 
#define OM_TRUE   1
 
#define OM_FALSE   0
 
#define OM_OK   0
 
#define OM_E_FAIL   -1
 
#define OM_E_UNEXPECTED   -2
 
#define OM_E_NOT_VALID_STATE   -3
 
#define OM_E_OUT_OF_MEMORY   -4
 
#define OM_E_INVALID_ARG   -5
 
#define OM_E_POINTER   -6
 
#define OM_E_NOT_IMPLEMENTED   -7
 
#define OM_E_ABORT   -8
 
#define OM_E_ACCESS_DENIED   -9
 
#define OM_E_INVALID_DEVICE   -10
 
#define OM_E_UNEXPECTED_RESPONSE   -11
 
#define OM_E_LOCKED   -12
 
#define OM_SUCCEEDED(value)   ((value) >= 0)
 
#define OM_FAILED(value)   ((value) < 0)
 
#define OM_DATETIME_FROM_YMDHMS(year, month, day, hours, minutes, seconds)
 
#define OM_DATETIME_YEAR(dateTime)
 
#define OM_DATETIME_MONTH(dateTime)
 
#define OM_DATETIME_DAY(dateTime)
 
#define OM_DATETIME_HOURS(dateTime)
 
#define OM_DATETIME_MINUTES(dateTime)
 
#define OM_DATETIME_SECONDS(dateTime)
 
#define OM_DATETIME_MIN_VALID
 
#define OM_DATETIME_MAX_VALID
 
#define OM_DATETIME_ZERO
 
#define OM_DATETIME_INFINITE
 
#define OM_DATETIME_BUFFER_SIZE   (20)
 
#define OM_MAX_SAMPLES   (120)
 
#define OM_MAX_HEADER_SIZE   (2 * 512)
 
#define OM_MAX_DATA_SIZE   (512)
 

Typedefs

typedef void(* OmLogCallback) (void *, const char *)
 
typedef void(* OmDeviceCallback) (void *, int, OM_DEVICE_STATUS)
 
typedef unsigned long OM_DATETIME
 
typedef void(* OmDownloadCallback) (void *, int, OM_DOWNLOAD_STATUS, int)
 
typedef void(* OmDownloadChunkCallback) (void *, int, void *, int, int)
 
typedef void * OmReaderHandle
 

Enumerations

enum  OM_DEVICE_STATUS { OM_DEVICE_REMOVED, OM_DEVICE_CONNECTED }
 
enum  OM_LED_STATE {
  OM_LED_AUTO = -1, OM_LED_OFF = 0, OM_LED_BLUE = 1, OM_LED_GREEN = 2,
  OM_LED_CYAN = 3, OM_LED_RED = 4, OM_LED_MAGENTA = 5, OM_LED_YELLOW = 6,
  OM_LED_WHITE = 7
}
 
enum  OM_ERASE_LEVEL { OM_ERASE_NONE = 0, OM_ERASE_DELETE = 1, OM_ERASE_QUICKFORMAT = 2, OM_ERASE_WIPE = 3 }
 
enum  OM_DOWNLOAD_STATUS {
  OM_DOWNLOAD_NONE, OM_DOWNLOAD_ERROR, OM_DOWNLOAD_PROGRESS, OM_DOWNLOAD_COMPLETE,
  OM_DOWNLOAD_CANCELLED
}
 
enum  OM_READER_VALUE_TYPE {
  OM_VALUE_LIGHT = 7, OM_VALUE_TEMPERATURE_MC = 108, OM_VALUE_AXES = 12, OM_VALUE_SCALE_ACCEL = 13,
  OM_VALUE_SCALE_GYRO = 14, OM_VALUE_SCALE_MAG = 15, OM_VALUE_ACCEL_AXIS = 16, OM_VALUE_GYRO_AXIS = 17,
  OM_VALUE_MAG_AXIS = 18
}
 

Functions

int OmStartup (int version)
 
int OmShutdown (void)
 
int OmSetLogStream (int fd)
 
int OmSetLogCallback (OmLogCallback logCallback, void *reference)
 
int OmSetDeviceCallback (OmDeviceCallback deviceCallback, void *reference)
 
int OmGetDeviceIds (int *deviceIds, int maxDevices)
 
int OmGetVersion (int deviceId, int *firmwareVersion, int *hardwareVersion)
 
int OmGetDeviceSerial (int deviceId, char *serialBuffer)
 
int OmGetDevicePort (int deviceId, char *portBuffer)
 
int OmGetDevicePath (int deviceId, char *pathBuffer)
 
int OmGetBatteryLevel (int deviceId)
 
int OmSelfTest (int deviceId)
 
int OmGetMemoryHealth (int deviceId)
 
int OmGetBatteryHealth (int deviceId)
 
int OmGetAccelerometer (int deviceId, int *x, int *y, int *z)
 
int OmGetTime (int deviceId, OM_DATETIME *time)
 
int OmSetTime (int deviceId, OM_DATETIME time)
 
int OmSetLed (int deviceId, OM_LED_STATE ledState)
 
int OmIsLocked (int deviceId, int *hasLockCode)
 
int OmSetLock (int deviceId, unsigned short code)
 
int OmUnlock (int deviceId, unsigned short code)
 
int OmSetEcc (int deviceId, int state)
 
int OmGetEcc (int deviceId)
 
int OmCommand (int deviceId, const char *command, char *buffer, size_t bufferSize, const char *expected, unsigned int timeoutMs, char **parseParts, int parseMax)
 
int OmGetDelays (int deviceId, OM_DATETIME *startTime, OM_DATETIME *stopTime)
 
int OmSetDelays (int deviceId, OM_DATETIME startTime, OM_DATETIME stopTime)
 
int OmGetSessionId (int deviceId, unsigned int *sessionId)
 
int OmSetSessionId (int deviceId, unsigned int sessionId)
 
int OmGetMetadata (int deviceId, char *metadata)
 
int OmSetMetadata (int deviceId, const char *metadata, int size)
 
int OmGetLastConfigTime (int deviceId, OM_DATETIME *time)
 
int OmEraseDataAndCommit (int deviceId, OM_ERASE_LEVEL eraseLevel)
 
int OmGetAccelConfig (int deviceId, int *rate, int *range)
 
int OmSetAccelConfig (int deviceId, int rate, int range)
 
int OmGetMaxSamples (int deviceId, int *value)
 
int OmSetMaxSamples (int deviceId, int value)
 
int OmSetDownloadCallback (OmDownloadCallback downloadCallback, void *reference)
 
int OmSetDownloadChunkCallback (OmDownloadChunkCallback downloadChunkCallback, void *reference)
 
int OmGetDataFileSize (int deviceId)
 
int OmGetDataFilename (int deviceId, char *filenameBuffer)
 
int OmGetDataRange (int deviceId, int *dataBlockSize, int *dataOffsetBlocks, int *dataNumBlocks, OM_DATETIME *startTime, OM_DATETIME *endTime)
 
int OmBeginDownloading (int deviceId, int dataOffsetBlocks, int dataLengthBlocks, const char *destinationFile)
 
int OmBeginDownloadingReference (int deviceId, int dataOffsetBlocks, int dataLengthBlocks, const char *destinationFile, void *reference)
 
int OmQueryDownload (int deviceId, OM_DOWNLOAD_STATUS *downloadStatus, int *downloadValue)
 
int OmWaitForDownload (int deviceId, OM_DOWNLOAD_STATUS *downloadStatus, int *downloadValue)
 
int OmCancelDownload (int deviceId)
 
const char * OmErrorString (int status)
 
OmReaderHandle OmReaderOpen (const char *binaryFilename)
 
int OmReaderDataRange (OmReaderHandle reader, int *dataBlockSize, int *dataOffsetBlocks, int *dataNumBlocks, OM_DATETIME *startTime, OM_DATETIME *endTime)
 
const char * OmReaderMetadata (OmReaderHandle reader, int *deviceId, unsigned int *sessionId)
 
int OmReaderDataBlockPosition (OmReaderHandle reader)
 
int OmReaderDataBlockSeek (OmReaderHandle reader, int dataBlockNumber)
 
int OmReaderNextBlock (OmReaderHandle reader)
 
short * OmReaderBuffer (OmReaderHandle reader)
 
OM_DATETIME OmReaderTimestamp (OmReaderHandle reader, int index, unsigned short *fractional)
 
int OmReaderGetValue (OmReaderHandle reader, OM_READER_VALUE_TYPE valueType)
 
OM_READER_HEADER_PACKETOmReaderRawHeaderPacket (OmReaderHandle reader)
 
OM_READER_DATA_PACKETOmReaderRawDataPacket (OmReaderHandle reader)
 
void OmReaderClose (OmReaderHandle reader)
 

Detailed Description

Open Movement API.

Author
Dan Jackson
Version
1.8.0
Date
2011-

Open Movement API header file.

See the documentation:

Definition in file omapi.h.