/**@file TYApi.h * @brief TYApi.h includes camera control and data receiving interface, * which supports configuration for image resolution, frame rate, exposure * time, gain, working mode,etc. * */ /**@mainpage * * Copyright(C)2016-2023 Percipio All Rights Reserved * * * * @section Note * Depth camera, called "device", consists of several components. Each component * is a hardware module or virtual module, such as RGB sensor, depth sensor. * Each component has its own features, such as image width, exposure time, etc.. * * NOTE: The component TY_COMPONENT_DEVICE is a virtual component that contains * all features related to the whole device, such as trigger mode, device IP. * * Each frame consists of several images. Normally, all the images have identical * timestamp, means they are captured at the same time. * * */ #ifndef TY_API_H_ #define TY_API_H_ #include #include #ifdef WIN32 # ifndef _WIN32 # define _WIN32 # endif #endif #ifdef _WIN32 # ifndef _STDINT_H # if defined(_MSC_VER) && _MSC_VER < 1600 typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; # else # include # endif # endif #else # include #endif // copy stdbool.h here in case bool not defined or cant be found #ifndef _STDBOOL_H # define _STDBOOL_H # define __bool_true_false_are_defined 1 # ifndef __cplusplus # define bool _Bool # define true 1 # define false 0 # endif #endif #ifdef _WIN32 # include # include # ifdef TY_STATIC_LIB # define TY_DLLIMPORT # define TY_DLLEXPORT # else # define TY_DLLIMPORT __declspec(dllimport) # define TY_DLLEXPORT __declspec(dllexport) # endif # define TY_STDC __stdcall # define TY_CDEC __cdecl # ifdef RGB # undef RGB # endif #else # ifdef TY_STATIC_LIB # define TY_DLLIMPORT # define TY_DLLEXPORT # else # define TY_DLLIMPORT __attribute__((visibility("default"))) # define TY_DLLEXPORT __attribute__((visibility("default"))) # endif # if defined(__i386__) # define TY_STDC __attribute__((stdcall)) # define TY_CDEC __attribute__((cdecl)) # else # define TY_STDC # define TY_CDEC # endif #endif #ifdef TY_BUILDING_LIB # define TY_EXPORT TY_DLLEXPORT #else # define TY_EXPORT TY_DLLIMPORT #endif #if !defined(TY_EXTC) # if defined(__cplusplus) # define TY_EXTC extern "C" # else # define TY_EXTC # endif #endif #include "TYVer.h" //------------------------------------------------------------------------------ ///@brief API call return status typedef enum TY_STATUS_LIST :int32_t { TY_STATUS_OK = 0, TY_STATUS_ERROR = -1001, TY_STATUS_NOT_INITED = -1002, TY_STATUS_NOT_IMPLEMENTED = -1003, TY_STATUS_NOT_PERMITTED = -1004, TY_STATUS_DEVICE_ERROR = -1005, TY_STATUS_INVALID_PARAMETER = -1006, TY_STATUS_INVALID_HANDLE = -1007, TY_STATUS_INVALID_COMPONENT = -1008, TY_STATUS_INVALID_FEATURE = -1009, TY_STATUS_WRONG_TYPE = -1010, TY_STATUS_WRONG_SIZE = -1011, TY_STATUS_OUT_OF_MEMORY = -1012, TY_STATUS_OUT_OF_RANGE = -1013, TY_STATUS_TIMEOUT = -1014, TY_STATUS_WRONG_MODE = -1015, TY_STATUS_BUSY = -1016, TY_STATUS_IDLE = -1017, TY_STATUS_NO_DATA = -1018, TY_STATUS_NO_BUFFER = -1019, TY_STATUS_NULL_POINTER = -1020, TY_STATUS_READONLY_FEATURE = -1021, TY_STATUS_INVALID_DESCRIPTOR= -1022, TY_STATUS_INVALID_INTERFACE = -1023, TY_STATUS_FIRMWARE_ERROR = -1024, /* ret_code from remote device */ TY_STATUS_DEV_EPERM = -1, TY_STATUS_DEV_EIO = -5, TY_STATUS_DEV_ENOMEM = -12, TY_STATUS_DEV_EBUSY = -16, TY_STATUS_DEV_EINVAL = -22, /* endof ret_code from remote device */ }TY_STATUS_LIST; typedef int32_t TY_STATUS; typedef enum TY_FW_ERRORCODE_LIST:uint32_t { TY_FW_ERRORCODE_CAM0_NOT_DETECTED = 0x00000001, TY_FW_ERRORCODE_CAM1_NOT_DETECTED = 0x00000002, TY_FW_ERRORCODE_CAM2_NOT_DETECTED = 0x00000004, TY_FW_ERRORCODE_POE_NOT_INIT = 0x00000008, TY_FW_ERRORCODE_RECMAP_NOT_CORRECT = 0x00000010, TY_FW_ERRORCODE_LOOKUPTABLE_NOT_CORRECT = 0x00000020, TY_FW_ERRORCODE_DRV8899_NOT_INIT = 0x00000040, TY_FW_ERRORCODE_CONFIG_NOT_FOUND = 0x00010000, TY_FW_ERRORCODE_CONFIG_NOT_CORRECT = 0x00020000, TY_FW_ERRORCODE_XML_NOT_FOUND = 0x00040000, TY_FW_ERRORCODE_XML_NOT_CORRECT = 0x00080000, TY_FW_ERRORCODE_XML_OVERRIDE_FAILED = 0x00100000, TY_FW_ERRORCODE_CAM_INIT_FAILED = 0x00200000, TY_FW_ERRORCODE_LASER_INIT_FAILED = 0x00400000, }TY_FW_ERRORCODE_LIST; typedef uint32_t TY_FW_ERRORCODE; typedef enum TY_EVENT_LIST :int32_t { TY_EVENT_DEVICE_OFFLINE = -2001, TY_EVENT_LICENSE_ERROR = -2002, TY_EVENT_FW_INIT_ERROR = -2003, }TY_ENENT_LIST; typedef int32_t TY_EVENT; typedef void* TY_INTERFACE_HANDLE; ///>24) & 0xff; out[1] = (addr>>16) & 0xff; out[2] = (addr>>8) & 0xff; out[3] = (addr>>0) & 0xff; } static inline uint32_t TYIPv4ToInt(uint8_t ip[4]) { return (ip[0] << 24) | (ip[1] << 16) | (ip[2] << 8) | ip[3]; } ///init a TY_IMAGE_DATA struct static inline TY_IMAGE_DATA TYInitImageData(size_t size, void* buffer , size_t width, size_t height) { TY_IMAGE_DATA out; out.timestamp = 0; out.imageIndex = 0; out.status = 0; out.componentID = 0; out.size = size; out.buffer = buffer; out.width = width; out.height = height; out.pixelFormat = 0; return out; } ///get feature format type from feature id static inline TY_FEATURE_TYPE TYFeatureType(TY_FEATURE_ID id) { return id & 0xf000; } ///deprecated: get pixel size in byte, Invalid for 10/12/14bit mode static inline int32_t TYPixelSize(TY_IMAGE_MODE imageMode) { return ((imageMode >> 28) & 0xf); } ///get pixel size in bits static inline int32_t TYBitsPerPixel(TY_IMAGE_MODE imageMode) { TY_PIXEL_BITS bits = imageMode & (0xf << 28); switch(bits){ case TY_PIXEL_16BIT: return 16; case TY_PIXEL_24BIT: return 24; case TY_PIXEL_32BIT: return 32; case TY_PIXEL_48BIT: return 48; case TY_PIXEL_64BIT: return 64; case TY_PIXEL_10BIT: return 10; case TY_PIXEL_12BIT: return 12; case TY_PIXEL_8BIT: default: return 8; } } ///get line size in bytes static inline int32_t TYPixelLineSize(int width, TY_IMAGE_MODE imageMode) { return (width * TYBitsPerPixel(imageMode)) >> 3; } ///make a image mode from pixel format & resolution mode static inline TY_IMAGE_MODE TYImageMode(TY_PIXEL_FORMAT pix, TY_RESOLUTION_MODE res) { return pix | res; } ///get a resoltuion mode from width & height static inline TY_RESOLUTION_MODE TYResolutionMode2(int width, int height){ return (TY_RESOLUTION_MODE)((width << 12) + height); } ///create a image mode from pixel format , width & height static inline TY_IMAGE_MODE TYImageMode2(TY_PIXEL_FORMAT pix, int width,int height) { return pix | TYResolutionMode2(width, height); } ///get pixel format from image mode static inline TY_PIXEL_FORMAT TYPixelFormat(TY_IMAGE_MODE imageMode) { return imageMode & 0xff000000; } ///get a resoltuion mode from image mode static inline TY_RESOLUTION_MODE TYResolutionMode(TY_IMAGE_MODE imageMode) { return imageMode & 0x00ffffff; } ///get image width from image mode static inline int32_t TYImageWidth(TY_IMAGE_MODE imageMode) { return TYResolutionMode(imageMode) >> 12; } ///get image height from image mode static inline int32_t TYImageHeight(TY_IMAGE_MODE imageMode) { return TYResolutionMode(imageMode) & 0x0fff; } //------------------------------------------------------------------------------ // C API //------------------------------------------------------------------------------ #define TY_CAPI TY_EXTC TY_EXPORT TY_STATUS TY_STDC /// @brief Get error information. /// @param [in] errorID Error id. /// @return Error string. TY_EXTC TY_EXPORT const char* TY_STDC TYErrorString (TY_STATUS errorID); /// @brief Init this library. /// /// We make this function to be static inline, because we do a version check here. /// Some user may use the mismatched header file and dynamic library, and /// that's quite difficult to locate the error. /// /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_ERROR Has been inited. static inline TY_STATUS TYInitLib (void); /// @brief Deinit this library. /// @retval TY_STATUS_OK Succeed. TY_CAPI TYDeinitLib (void); /// @brief Get current library version. /// @param [out] version Version infomation to be filled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NULL_POINTER buffer is NULL. TY_CAPI TYLibVersion (TY_VERSION_INFO* version); /// @brief Update current interfaces. /// call before TYGetInterfaceList /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. TY_CAPI TYUpdateInterfaceList (); /// @brief Get number of current interfaces. /// @param [out] pNumIfaces Number of interfaces. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_NULL_POINTER deviceNumber is NULL. TY_CAPI TYGetInterfaceNumber (uint32_t* pNumIfaces); /// @brief Get interface info list. /// @param [out] pIfaceInfos Array of interface infos to be filled. /// @param [in] bufferCount Array size of interface infos. /// @param [out] filledCount Number of filled TY_INTERFACE_INFO. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_NULL_POINTER pIfaceInfos or filledCount is NULL. TY_CAPI TYGetInterfaceList (TY_INTERFACE_INFO* pIfaceInfos, uint32_t bufferCount, uint32_t* filledCount); /// @brief Check if has interface. /// @param [in] ifaceID Interface ID string, can be get from TY_INTERFACE_INFO. /// @param [out] value True if the interface exists. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_NULL_POINTER ifaceID or outHandle is NULL. /// @see TYGetInterfaceList TY_CAPI TYHasInterface (const char* ifaceID, bool* value); /// @brief Open specified interface. /// @param [in] ifaceID Interface ID string, can be get from TY_INTERFACE_INFO. /// @param [out] outHandle Handle of opened interface. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_NULL_POINTER ifaceID or outHandle is NULL. /// @retval TY_STATUS_INVALID_INTERFACE Interface not found. /// @see TYGetInterfaceList TY_CAPI TYOpenInterface (const char* ifaceID, TY_INTERFACE_HANDLE* outHandle); /// @brief Close interface. /// @param [in] ifaceHandle Interface to be closed. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Interface not found. TY_CAPI TYCloseInterface (TY_INTERFACE_HANDLE ifaceHandle); /// @brief Update current connected devices. /// @param [in] ifaceHandle Interface handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. TY_CAPI TYUpdateDeviceList (TY_INTERFACE_HANDLE ifaceHandle); /// @brief Update current connected devices. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. TY_CAPI TYUpdateAllDeviceList(); /// @brief Get number of current connected devices. /// @param [in] ifaceHandle Interface handle. /// @param [out] deviceNumber Number of connected devices. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_NULL_POINTER deviceNumber is NULL. TY_CAPI TYGetDeviceNumber (TY_INTERFACE_HANDLE ifaceHandle, uint32_t* deviceNumber); /// @brief Get device info list. /// @param [in] ifaceHandle Interface handle. /// @param [out] deviceInfos Device info array to be filled. /// @param [in] bufferCount Array size of deviceInfos. /// @param [out] filledDeviceCount Number of filled TY_DEVICE_BASE_INFO. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_NULL_POINTER deviceInfos or filledDeviceCount is NULL. TY_CAPI TYGetDeviceList (TY_INTERFACE_HANDLE ifaceHandle, TY_DEVICE_BASE_INFO* deviceInfos, uint32_t bufferCount, uint32_t* filledDeviceCount); /// @brief Check whether the interface has the specified device. /// @param [in] ifaceHandle Interface handle. /// @param [in] deviceID Device ID string, can be get from TY_DEVICE_BASE_INFO. /// @param [out] value True if the device exists. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_NULL_POINTER deviceID or value is NULL. TY_CAPI TYHasDevice (TY_INTERFACE_HANDLE ifaceHandle, const char* deviceID, bool* value); /// @brief Open device by device ID. /// @param [in] ifaceHandle Interface handle. /// @param [in] deviceID Device ID string, can be get from TY_DEVICE_BASE_INFO. /// @param [out] deviceHandle Handle of opened device. Valid only if TY_STATUS_OK or TY_FW_ERRORCODE returned. /// @param [out] outFwErrorcode Firmware errorcode. Valid only if TY_FW_ERRORCODE returned. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_NULL_POINTER deviceID or deviceHandle is NULL. /// @retval TY_STATUS_INVALID_PARAMETER Device not found. /// @retval TY_STATUS_BUSY Device has been opened. /// @retval TY_STATUS_DEVICE_ERROR Open device failed. TY_CAPI TYOpenDevice (TY_INTERFACE_HANDLE ifaceHandle, const char* deviceID, TY_DEV_HANDLE* outDeviceHandle, TY_FW_ERRORCODE* outFwErrorcode=NULL); /// @brief Open device by device IP, useful when a device is not listed. /// @param [in] ifaceHandle Interface handle. /// @param [in] IP Device IP. /// @param [out] deviceHandle Handle of opened device. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_NULL_POINTER IP or deviceHandle is NULL. /// @retval TY_STATUS_INVALID_PARAMETER Device not found. /// @retval TY_STATUS_BUSY Device has been opened, may occupied somewhere else. /// @retval TY_STATUS_DEVICE_ERROR Open device failed. TY_CAPI TYOpenDeviceWithIP (TY_INTERFACE_HANDLE ifaceHandle, const char* IP, TY_DEV_HANDLE* deviceHandle); /// @brief Get interface handle by device handle. /// @param [in] hDevice Device handle. /// @param [out] pIface Interface handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER pIface is NULL. TY_CAPI TYGetDeviceInterface (TY_DEV_HANDLE hDevice, TY_INTERFACE_HANDLE* pIface); /// @brief Force a ethernet device to use new IP address, useful when device use persistent IP and cannot be found. /// @param [in] ifaceHandle Interface handle. /// @param [in] MAC Device MAC, should be "xx:xx:xx:xx:xx:xx". /// @param [in] newIP New IP. /// @param [in] newNetMask New subnet mask. /// @param [in] newGateway New gateway. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_NOT_INITED TYInitLib not called. /// @retval TY_STATUS_INVALID_INTERFACE Invalid interface handle. /// @retval TY_STATUS_WRONG_TYPE Wrong interface type, should be network. /// @retval TY_STATUS_NULL_POINTER MAC or newIP/newNetMask/newGateway is NULL. /// @retval TY_STATUS_INVALID_PARAMETER MAC is not valid. /// @retval TY_STATUS_TIMEOUT No device found. /// @retval TY_STATUS_DEVICE_ERROR Set new IP failed. TY_CAPI TYForceDeviceIP (TY_INTERFACE_HANDLE ifaceHandle, const char* MAC, const char* newIP, const char* newNetMask, const char* newGateway); /// @brief Close device by device handle. /// @param [in] hDevice Device handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_IDLE Device has been closed. TY_CAPI TYCloseDevice (TY_DEV_HANDLE hDevice, bool reboot=false); /// @brief Get base info of the open device. /// @param [in] hDevice Device handle. /// @param [out] info Base info out. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER componentIDs is NULL. TY_CAPI TYGetDeviceInfo (TY_DEV_HANDLE hDevice, TY_DEVICE_BASE_INFO* info); /// @brief Get all components IDs. /// @param [in] hDevice Device handle. /// @param [out] componentIDs All component IDs this device has. (bit flag). /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER componentIDs is NULL. /// @see TY_DEVICE_COMPONENT_LIST TY_CAPI TYGetComponentIDs (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID* componentIDs); /// @brief Get all enabled components IDs. /// @param [in] hDevice Device handle. /// @param [out] componentIDs Enabled component IDs.(bit flag) /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER componentIDs is NULL. /// @see TY_DEVICE_COMPONENT_LIST TY_CAPI TYGetEnabledComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID* componentIDs); /// @brief Enable components. /// @param [in] hDevice Device handle. /// @param [in] componentIDs Components to be enabled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Some components specified by componentIDs are invalid. /// @retval TY_STATUS_BUSY Device is capturing. TY_CAPI TYEnableComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentIDs); /// @brief Disable components. /// @param [in] hDevice Device handle. /// @param [in] componentIDs Components to be disabled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Some components specified by componentIDs are invalid. /// @retval TY_STATUS_BUSY Device is capturing. /// @see TY_DEVICE_COMPONENT_LIST TY_CAPI TYDisableComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentIDs); /// @brief Get total buffer size of one frame in current configuration. /// @param [in] hDevice Device handle. /// @param [out] bufferSize Buffer size per frame. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER bufferSize is NULL. TY_CAPI TYGetFrameBufferSize (TY_DEV_HANDLE hDevice, uint32_t* bufferSize); /// @brief Enqueue a user allocated buffer. /// @param [in] hDevice Device handle. /// @param [in] buffer Buffer to be enqueued. /// @param [in] bufferSize Size of the input buffer. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER buffer is NULL. /// @retval TY_STATUS_WRONG_SIZE The input buffer is not large enough. TY_CAPI TYEnqueueBuffer (TY_DEV_HANDLE hDevice, void* buffer, uint32_t bufferSize); /// @brief Clear the internal buffer queue, so that user can release all the buffer. /// @param [in] hDevice Device handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_BUSY Device is capturing. TY_CAPI TYClearBufferQueue (TY_DEV_HANDLE hDevice); /// @brief Start capture. /// @param [in] hDevice Device handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT No components enabled. /// @retval TY_STATUS_BUSY Device has been started. /// @retval TY_STATUS_DEVICE_ERROR Start capture failed. TY_CAPI TYStartCapture (TY_DEV_HANDLE hDevice); /// @brief Stop capture. /// @param [in] hDevice Device handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_IDLE Device is not capturing. /// @retval TY_STATUS_DEVICE_ERROR Stop capture failed. TY_CAPI TYStopCapture (TY_DEV_HANDLE hDevice); /// @brief Send a software trigger to capture a frame when device works in trigger mode. /// @param [in] hDevice Device handle. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_FEATURE Not support soft trigger. /// @retval TY_STATUS_IDLE Device has not started capture. /// @retval TY_STATUS_WRONG_MODE Not in trigger mode. TY_CAPI TYSendSoftTrigger (TY_DEV_HANDLE hDevice); /// @brief Register device status callback. Register NULL to clean callback. /// @param [in] hDevice Device handle. /// @param [in] callback Callback function. /// @param [in] userdata User private data. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_BUSY Device is capturing. TY_CAPI TYRegisterEventCallback (TY_DEV_HANDLE hDevice, TY_EVENT_CALLBACK callback, void* userdata); /// @brief Register imu callback. Register NULL to clean callback. /// @param [in] hDevice Device handle. /// @param [in] callback Callback function. /// @param [in] userdata User private data. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_BUSY Device is capturing. TY_CAPI TYRegisterImuCallback (TY_DEV_HANDLE hDevice, TY_IMU_CALLBACK callback, void* userdata); /// @brief Fetch one frame. /// @param [in] hDevice Device handle. /// @param [out] frame Frame data to be filled. /// @param [in] timeout Timeout in milliseconds. <0 for infinite. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_NULL_POINTER frame is NULL. /// @retval TY_STATUS_IDLE Device capturing is not started. /// @retval TY_STATUS_WRONG_MODE Callback has been registered, this function is disabled. /// @retval TY_STATUS_TIMEOUT Timeout. TY_CAPI TYFetchFrame (TY_DEV_HANDLE hDevice, TY_FRAME_DATA* frame, int32_t timeout); /// @brief Check whether a component has a specific feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] value Whether has feature. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_NULL_POINTER value is NULL. TY_CAPI TYHasFeature (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool* value); /// @brief Get feature info. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] featureInfo Feature info. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_NULL_POINTER featureInfo is NULL. TY_CAPI TYGetFeatureInfo (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_FEATURE_INFO* featureInfo); /// @brief Get value range of integer feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] intRange Integer range to be filled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_INT. /// @retval TY_STATUS_NULL_POINTER intRange is NULL. TY_CAPI TYGetIntRange (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_INT_RANGE* intRange); /// @brief Get value of integer feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] value Integer value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_INT. /// @retval TY_STATUS_NULL_POINTER value is NULL. TY_CAPI TYGetInt (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, int32_t* value); /// @brief Set value of integer feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] value Integer value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_INT. /// @retval TY_STATUS_OUT_OF_RANGE value is out of range. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetInt (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, int32_t value); /// @brief Get value range of float feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] floatRange Float range to be filled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_FLOAT. /// @retval TY_STATUS_NULL_POINTER floatRange is NULL. TY_CAPI TYGetFloatRange (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_FLOAT_RANGE* floatRange); /// @brief Get value of float feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] value Float value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_FLOAT. /// @retval TY_STATUS_NULL_POINTER value is NULL. TY_CAPI TYGetFloat (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, float* value); /// @brief Set value of float feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] value Float value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_FLOAT. /// @retval TY_STATUS_OUT_OF_RANGE value is out of range. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetFloat (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, float value); /// @brief Get number of enum entries. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] entryCount Entry count. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_ENUM. /// @retval TY_STATUS_NULL_POINTER entryCount is NULL. TY_CAPI TYGetEnumEntryCount (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* entryCount); /// @brief Get list of enum entries. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] entries Output entries. /// @param [in] entryCount Array size of input parameter "entries". /// @param [out] filledEntryCount Number of filled entries. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_ENUM. /// @retval TY_STATUS_NULL_POINTER entries or filledEntryCount is NULL. TY_CAPI TYGetEnumEntryInfo (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_ENUM_ENTRY* entries, uint32_t entryCount, uint32_t* filledEntryCount); /// @brief Get current value of enum feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] value Enum value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_ENUM. /// @retval TY_STATUS_NULL_POINTER value is NULL. TY_CAPI TYGetEnum (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* value); /// @brief Set value of enum feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] value Enum value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_ENUM. /// @retval TY_STATUS_INVALID_PARAMETER value is invalid. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetEnum (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t value); /// @brief Get value of bool feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] value Bool value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BOOL. /// @retval TY_STATUS_NULL_POINTER value is NULL. TY_CAPI TYGetBool (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool* value); /// @brief Set value of bool feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] value Bool value. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BOOL. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetBool (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool value); /// @brief Get internal buffer size of string feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] size String length including '\0'. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_STRING. /// @retval TY_STATUS_NULL_POINTER size is NULL. /// @see TYGetString TY_CAPI TYGetStringLength (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* size); /// @brief Get value of string feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] buffer String buffer. /// @param [in] bufferSize Size of buffer. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_STRING. /// @retval TY_STATUS_NULL_POINTER buffer is NULL. /// @see TYGetStringLength TY_CAPI TYGetString (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, char* buffer, uint32_t bufferSize); /// @brief Set value of string feature. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] buffer String buffer. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_STRING. /// @retval TY_STATUS_NULL_POINTER buffer is NULL. /// @retval TY_STATUS_OUT_OF_RANGE Input string is too long. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetString (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, const char* buffer); /// @brief Get value of struct. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] pStruct Pointer of struct. /// @param [in] structSize Size of input buffer pStruct.. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_STRUCT. /// @retval TY_STATUS_NULL_POINTER pStruct is NULL. /// @retval TY_STATUS_WRONG_SIZE structSize incorrect. TY_CAPI TYGetStruct (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, void* pStruct, uint32_t structSize); /// @brief Set value of struct. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [in] pStruct Pointer of struct. /// @param [in] structSize Size of struct. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_STRUCT. /// @retval TY_STATUS_NULL_POINTER pStruct is NULL. /// @retval TY_STATUS_WRONG_SIZE structSize incorrect. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetStruct (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, void* pStruct, uint32_t structSize); /// @brief Get the size of specified byte array zone . /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] pSize size of specified byte array zone. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BYTEARRAY. /// @retval TY_STATUS_NULL_POINTER pSize is NULL. TY_CAPI TYGetByteArraySize (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* pSize); /// @brief Get the size of device features . /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [out] pSize size of all feature cnt. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_NULL_POINTER pSize is NULL. TY_CAPI TYGetDeviceFeatureNumber (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, uint32_t* size); /// @brief Get the all features by comp id. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [out] featureInfo Output feature info. /// @param [in] entryCount Array size of input parameter "featureInfo". /// @param [out] filledEntryCount Number of filled featureInfo. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_NULL_POINTER featureInfo or filledEntryCount is NULL. TY_CAPI TYGetDeviceFeatureInfo (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID , TY_FEATURE_INFO* featureInfo, uint32_t entryCount, uint32_t* filledEntryCount); /// @brief Read byte array from device. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] pbuffer byte buffer. /// @param [in] bufferSize Size of buffer. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BYTEARRAY. /// @retval TY_STATUS_NULL_POINTER pbuffer is NULL. /// @retval TY_STATUS_WRONG_SIZE bufferSize incorrect. TY_CAPI TYGetByteArray (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint8_t* pBuffer, uint32_t bufferSize); /// @brief Write byte array to device. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] pbuffer byte buffer. /// @param [in] bufferSize Size of buffer. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BYTEARRAY. /// @retval TY_STATUS_NULL_POINTER pbuffer is NULL. /// @retval TY_STATUS_WRONG_SIZE bufferSize incorrect. /// @retval TY_STATUS_BUSY Device is capturing, the feature is locked. TY_CAPI TYSetByteArray (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, const uint8_t* pBuffer, uint32_t bufferSize); /// @brief Write byte array to device. /// @param [in] hDevice Device handle. /// @param [in] componentID Component ID. /// @param [in] featureID Feature ID. /// @param [out] pAttr byte array attribute to be filled. /// @retval TY_STATUS_OK Succeed. /// @retval TY_STATUS_INVALID_HANDLE Invalid device handle. /// @retval TY_STATUS_INVALID_COMPONENT Invalid component ID. /// @retval TY_STATUS_INVALID_FEATURE Invalid feature ID. /// @retval TY_STATUS_NOT_PERMITTED The feature is not writable. /// @retval TY_STATUS_WRONG_TYPE The feature's type is not TY_FEATURE_BYTEARRAY. /// @retval TY_STATUS_NULL_POINTER pbuffer is NULL. TY_CAPI TYGetByteArrayAttr (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_BYTEARRAY_ATTR* pAttr); //------------------------------------------------------------------------------ // Version check //------------------------------------------------------------------------------ TY_CAPI _TYInitLib(void); static inline TY_STATUS TYInitLib(void) { TY_VERSION_INFO soVersion; TYLibVersion(&soVersion); if(!(soVersion.major == TY_LIB_VERSION_MAJOR && soVersion.minor >= TY_LIB_VERSION_MINOR)){ abort(); // generate fault directly } return _TYInitLib(); } //------------------------------------------------------------------------------ // Summary //------------------------------------------------------------------------------ TY_EXTC TY_EXPORT const char* TY_STDC TYErrorString (TY_STATUS errorID); inline TY_STATUS TYInitLib (void); TY_CAPI TYDeinitLib (void); TY_CAPI TYLibVersion (TY_VERSION_INFO* version); TY_CAPI TYUpdateInterfaceList (); TY_CAPI TYGetInterfaceNumber (uint32_t* pNumIfaces); TY_CAPI TYGetInterfaceList (TY_INTERFACE_INFO* pIfaceInfos, uint32_t bufferCount, uint32_t* filledCount); TY_CAPI TYHasInterface (const char* ifaceID, bool* value); TY_CAPI TYOpenInterface (const char* ifaceID, TY_INTERFACE_HANDLE* outHandle); TY_CAPI TYCloseInterface (TY_INTERFACE_HANDLE ifaceHandle); TY_CAPI TYUpdateDeviceList (TY_INTERFACE_HANDLE ifaceHandle); TY_CAPI TYGetDeviceNumber (TY_INTERFACE_HANDLE ifaceHandle, uint32_t* deviceNumber); TY_CAPI TYGetDeviceList (TY_INTERFACE_HANDLE ifaceHandle, TY_DEVICE_BASE_INFO* deviceInfos, uint32_t bufferCount, uint32_t* filledDeviceCount); TY_CAPI TYHasDevice (TY_INTERFACE_HANDLE ifaceHandle, const char* deviceID, bool* value); TY_CAPI TYOpenDevice (TY_INTERFACE_HANDLE ifaceHandle, const char* deviceID, TY_DEV_HANDLE* outDeviceHandle, TY_FW_ERRORCODE* outFwErrorcode); TY_CAPI TYOpenDeviceWithIP (TY_INTERFACE_HANDLE ifaceHandle, const char* IP, TY_DEV_HANDLE* deviceHandle); TY_CAPI TYGetDeviceInterface (TY_DEV_HANDLE hDevice, TY_INTERFACE_HANDLE* pIface); TY_CAPI TYForceDeviceIP (TY_INTERFACE_HANDLE ifaceHandle, const char* MAC, const char* newIP, const char* newNetMask, const char* newGateway); TY_CAPI TYCloseDevice (TY_DEV_HANDLE hDevice, bool reboot); TY_CAPI TYGetDeviceInfo (TY_DEV_HANDLE hDevice, TY_DEVICE_BASE_INFO* info); TY_CAPI TYGetComponentIDs (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID* componentIDs); TY_CAPI TYGetEnabledComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID* componentIDs); TY_CAPI TYEnableComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentIDs); TY_CAPI TYDisableComponents (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentIDs); TY_CAPI TYGetFrameBufferSize (TY_DEV_HANDLE hDevice, uint32_t* outSize); TY_CAPI TYEnqueueBuffer (TY_DEV_HANDLE hDevice, void* buffer, uint32_t bufferSize); TY_CAPI TYClearBufferQueue (TY_DEV_HANDLE hDevice); TY_CAPI TYStartCapture (TY_DEV_HANDLE hDevice); TY_CAPI TYStopCapture (TY_DEV_HANDLE hDevice); TY_CAPI TYSendSoftTrigger (TY_DEV_HANDLE hDevice); TY_CAPI TYRegisterEventCallback (TY_DEV_HANDLE hDevice, TY_EVENT_CALLBACK callback, void* userdata); TY_CAPI TYRegisterImuCallback (TY_DEV_HANDLE hDevice, TY_IMU_CALLBACK callback, void* userdata); TY_CAPI TYFetchFrame (TY_DEV_HANDLE hDevice, TY_FRAME_DATA* frame, int32_t timeout); TY_CAPI TYHasFeature (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool* value); TY_CAPI TYGetFeatureInfo (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_FEATURE_INFO* featureInfo); TY_CAPI TYGetIntRange (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_INT_RANGE* intRange); TY_CAPI TYGetInt (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, int32_t* value); TY_CAPI TYSetInt (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, int32_t value); TY_CAPI TYGetFloatRange (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_FLOAT_RANGE* floatRange); TY_CAPI TYGetFloat (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, float* value); TY_CAPI TYSetFloat (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, float value); TY_CAPI TYGetEnumEntryCount (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* entryCount); TY_CAPI TYGetEnumEntryInfo (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_ENUM_ENTRY* entries, uint32_t entryCount, uint32_t* filledEntryCount); TY_CAPI TYGetEnum (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* value); TY_CAPI TYSetEnum (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t value); TY_CAPI TYGetBool (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool* value); TY_CAPI TYSetBool (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, bool value); TY_CAPI TYGetStringLength (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* length); TY_CAPI TYGetString (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, char* buffer, uint32_t bufferSize); TY_CAPI TYSetString (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, const char* buffer); TY_CAPI TYGetStruct (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, void* pStruct, uint32_t structSize); TY_CAPI TYSetStruct (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, void* pStruct, uint32_t structSize); TY_CAPI TYGetByteArraySize (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint32_t* pSize); TY_CAPI TYGetByteArray (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, uint8_t* pBuffer, uint32_t bufferSize); TY_CAPI TYSetByteArray (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, const uint8_t* pBuffer, uint32_t bufferSize); TY_CAPI TYGetByteArrayAttr (TY_DEV_HANDLE hDevice, TY_COMPONENT_ID componentID, TY_FEATURE_ID featureID, TY_BYTEARRAY_ATTR* pAttr); #endif // TY_API_H_