aboutsummaryrefslogtreecommitdiffstats
path: root/o3000.h
diff options
context:
space:
mode:
Diffstat (limited to 'o3000.h')
-rw-r--r--o3000.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/o3000.h b/o3000.h
new file mode 100644
index 0000000..b13b767
--- /dev/null
+++ b/o3000.h
@@ -0,0 +1,101 @@
+/**
+* @file o3000.h
+* @brief O-3000 Camera driver API
+* @author Patrick Brunner - brunner@stettbacher.ch
+* @author Patrick Roth - roth@stettbacher.ch
+* @version 1.1
+* @date 2016-03-01
+* @copyright 2012-2016 Stettbacher Signal Processing AG
+*
+* @remarks
+*
+* <PRE>
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+* </PRE>
+*
+*/
+
+#ifndef _O3000_H
+#define _O3000_H
+
+#include "o3000/o3000_portable.h"
+#include "o3000/image_header.h"
+
+/**
+ * O-3000 library version
+ */
+#define O3000_VERSION "2.0.2"
+
+#define O3000_VID 0x0483 ///< O3000 vendor ID
+#define O3000_PID 0xA098 ///< O3000 product ID
+
+
+/*
+ * All possible error codes
+ */
+#define O3000_SUCCESS 0 ///< success (no error)
+#define O3000_ERROR_NOCALLBACK -1 ///< one or more callback functions are missing
+#define O3000_ERROR_NOMEM -2 ///< failed to allocate memory
+#define O3000_ERROR_NODEV -3 ///< device not found
+#define O3000_ERROR_NO_FREE_SESSION -4 ///< all session are in used
+#define O3000_ERROR_INVALID_SESSION_ID -5 ///< session ID is invalid
+#define O3000_ERROR_ACCESS -6 ///< user has insufficient permissions
+#define O3000_ERROR_BUSY -7 ///< another program or driver has claimed the device
+#define O3000_ERROR_DRV_NOT_CONNECTED -8 ///< O-3000 driver is not running (call o3000_connect() first)
+#define O3000_ERROR_XML_XFER_RUNNING -9 ///< XML transfer to device in progress
+#define O3000_ERROR_USB_TRANSFER_TIMEOUT -10 ///< USB transfer timeout
+#define O3000_ERROR_USB_EP_HALTED -11 ///< USB endpoint halted
+#define O3000_ERROR_LESS_DATA -12 ///< USB received less data than expected
+
+#define O3000_ERROR_OTHER -1000 ///< other (unspecified) error
+
+
+/*
+ * All possible logging levels (don't touch it!!)
+ */
+#define O3000_LOG_NONE 0 ///< nothing is logged
+#define O3000_LOG_ERROR 1 ///< error message (top priority log message)
+#define O3000_LOG_WARNING 2 ///< warning message
+#define O3000_LOG_INFO 3 ///< info message
+#define O3000_LOG_DEBUG 4 ///< debug message
+#define O3000_LOG_VERBOSE 5 ///< verbose debug message, libusb is debugging too (lowest priority log message)
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+
+int __stdcall o3000_init(int vid, int pid, unsigned int video_cache_size,
+ void __stdcall (*xml_cb)(int id, char* buf, int len),
+ void __stdcall (*video_cb)(int id, unsigned char* buf, struct img_header_t* img_header),
+ void __stdcall (*log_cb)(int id, char* msg),
+ int loglevel);
+
+void __stdcall o3000_exit(int id);
+
+int __stdcall o3000_get_num_cam(void);
+int __stdcall o3000_device_discovery(int id);
+int __stdcall o3000_connect(int id, int device_nr, char *config_msg, int config_msg_len);
+int __stdcall o3000_disconnect(int id);
+
+int __stdcall o3000_send_xml(int id, const char *msg, int msg_len);
+
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} // extern "C"
+#endif
+
+#endif // _O3000_H