#ifndef _LJX8_IF_LINUX_H
#define _LJX8_IF_LINUX_H
#define MAX_LJXA_DEVICENUM (6U)
#define MAX_LJXA_XDATANUM (3200U)
#define MAX_LJXA_YDATANUM (42000U)
typedef enum {
LJX8IF_SETTING_DEPTH_WRITE = 0x00, LJX8IF_SETTING_DEPTH_RUNNING = 0x01, LJX8IF_SETTING_DEPTH_SAVE = 0x02, } LJX8IF_SETTING_DEPTH;
typedef enum {
LJX8IF_INIT_SETTING_TARGET_PRG0 = 0x00, LJX8IF_INIT_SETTING_TARGET_PRG1 = 0x01, LJX8IF_INIT_SETTING_TARGET_PRG2 = 0x02, LJX8IF_INIT_SETTING_TARGET_PRG3 = 0x03, LJX8IF_INIT_SETTING_TARGET_PRG4 = 0x04, LJX8IF_INIT_SETTING_TARGET_PRG5 = 0x05, LJX8IF_INIT_SETTING_TARGET_PRG6 = 0x06, LJX8IF_INIT_SETTING_TARGET_PRG7 = 0x07, LJX8IF_INIT_SETTING_TARGET_PRG8 = 0x08, LJX8IF_INIT_SETTING_TARGET_PRG9 = 0x09, LJX8IF_INIT_SETTING_TARGET_PRG10 = 0x0A, LJX8IF_INIT_SETTING_TARGET_PRG11 = 0x0B, LJX8IF_INIT_SETTING_TARGET_PRG12 = 0x0C, LJX8IF_INIT_SETTING_TARGET_PRG13 = 0x0D, LJX8IF_INIT_SETTING_TARGET_PRG14 = 0x0E, LJX8IF_INIT_SETTING_TARGET_PRG15 = 0x0F, } LJX8IF_INIT_SETTING_TARGET;
typedef enum {
LJX8IF_PROFILE_BANK_ACTIVE = 0x00, LJX8IF_PROFILE_BANK_INACTIVE = 0x01, } LJX8IF_PROFILE_BANK;
typedef enum {
LJX8IF_PROFILE_POSITION_CURRENT = 0x00, LJX8IF_PROFILE_POSITION_OLDEST = 0x01, LJX8IF_PROFILE_POSITION_SPEC = 0x02, } LJX8IF_PROFILE_POSITION;
typedef enum {
LJX8IF_BATCH_POSITION_CURRENT = 0x00, LJX8IF_BATCH_POSITION_SPEC = 0x02, LJX8IF_BATCH_POSITION_COMMITED = 0x03, LJX8IF_BATCH_POSITION_CURRENT_ONLY = 0x04, } LJX8IF_BATCH_POSITION;
typedef struct {
int nMajorNumber; int nMinorNumber; int nRevisionNumber; int nBuildNumber; } LJX8IF_VERSION_INFO;
typedef struct {
unsigned char abyIpAddress[4]; unsigned short wPortNo; unsigned char reserve[2]; } LJX8IF_ETHERNET_CONFIG;
typedef struct {
unsigned char byType; unsigned char byCategory; unsigned char byItem; unsigned char reserve; unsigned char byTarget1; unsigned char byTarget2; unsigned char byTarget3; unsigned char byTarget4; } LJX8IF_TARGET_SETTING;
typedef struct {
unsigned char byProfileCount; unsigned char reserve1; unsigned char byLuminanceOutput; unsigned char reserve2; unsigned short wProfileDataCount; unsigned char reserve3[2]; int lXStart; int lXPitch; } LJX8IF_PROFILE_INFO;
typedef struct {
unsigned int reserve; unsigned int dwTriggerCount; int lEncoderCount; unsigned int reserve2[3]; } LJX8IF_PROFILE_HEADER;
typedef struct {
unsigned int reserve; } LJX8IF_PROFILE_FOOTER;
typedef struct {
unsigned char byTargetBank; unsigned char byPositionMode; unsigned char reserve[2]; unsigned int dwGetProfileNo; unsigned char byGetProfileCount; unsigned char byErase; unsigned char reserve2[2]; } LJX8IF_GET_PROFILE_REQUEST;
typedef struct {
unsigned char byTargetBank; unsigned char byPositionMode; unsigned char reserve[2]; unsigned int dwGetBatchNo; unsigned int dwGetProfileNo; unsigned char byGetProfileCount; unsigned char byErase; unsigned char reserve2[2]; } LJX8IF_GET_BATCH_PROFILE_REQUEST;
typedef struct {
unsigned int dwCurrentProfileNo; unsigned int dwOldestProfileNo; unsigned int dwGetTopProfileNo; unsigned char byGetProfileCount; unsigned char reserve[3]; } LJX8IF_GET_PROFILE_RESPONSE;
typedef struct {
unsigned int dwCurrentBatchNo; unsigned int dwCurrentBatchProfileCount; unsigned int dwOldestBatchNo; unsigned int dwOldestBatchProfileCount; unsigned int dwGetBatchNo; unsigned int dwGetBatchProfileCount; unsigned int dwGetBatchTopProfileNo; unsigned char byGetProfileCount; unsigned char byCurrentBatchCommited; unsigned char reserve[2]; } LJX8IF_GET_BATCH_PROFILE_RESPONSE;
typedef struct {
unsigned char bySendPosition; unsigned char reserve[3]; } LJX8IF_HIGH_SPEED_PRE_START_REQ;
typedef void(*LJX8IF_CALLBACK)(unsigned char* pBuffer, unsigned int dwSize, unsigned int dwCount, unsigned int dwNotify, unsigned int dwUser);
typedef void(*LJX8IF_CALLBACK_SIMPLE_ARRAY)(LJX8IF_PROFILE_HEADER* pProfileHeaderArray, unsigned short* pHeightProfileArray, unsigned short* pLuminanceProfileArray, unsigned int dwLuminanceEnable, unsigned int dwProfileDataCount, unsigned int dwCount, unsigned int dwNotify, unsigned int dwUser);
extern "C"
{
long LJX8IF_Initialize(void);
long LJX8IF_Finalize(void);
LJX8IF_VERSION_INFO LJX8IF_GetVersion(void);
int LJX8IF_EthernetOpen(int lDeviceId, LJX8IF_ETHERNET_CONFIG* pEthernetConfig);
int LJX8IF_CommunicationClose(int lDeviceId);
int LJX8IF_RebootController(int lDeviceId);
int LJX8IF_ReturnToFactorySetting(int lDeviceId);
int LJX8IF_ControlLaser(int lDeviceId, unsigned char byState);
int LJX8IF_GetError(int lDeviceId, unsigned char byReceivedMax, unsigned char* pbyErrCount, unsigned short* pwErrCode);
int LJX8IF_ClearError(int lDeviceId, unsigned short wErrCode);
int LJX8IF_TrgErrorReset(int lDeviceId);
int LJX8IF_GetTriggerAndPulseCount(int lDeviceId, unsigned int* pdwTriggerCount, int* plEncoderCount);
int LJX8IF_SetTimerCount(int lDeviceId, unsigned int dwTimerCount);
int LJX8IF_GetTimerCount(int lDeviceId, unsigned int* pdwTimerCount);
int LJX8IF_GetHeadTemperature(int lDeviceId, short* pnSensorTemperature, short* pnProcessorTemperature, short* pnCaseTemperature);
int LJX8IF_GetHeadModel(int lDeviceId, char* pHeadModel);
int LJX8IF_GetSerialNumber(int lDeviceId, char* pControllerSerialNo, char* pHeadSerialNo);
int LJX8IF_GetAttentionStatus(int lDeviceId, unsigned short* pwAttentionStatus);
int LJX8IF_Trigger(int lDeviceId);
int LJX8IF_StartMeasure(int lDeviceId);
int LJX8IF_StopMeasure(int lDeviceId);
int LJX8IF_ClearMemory(int lDeviceId);
int LJX8IF_SetSetting(int lDeviceId, unsigned char byDepth, LJX8IF_TARGET_SETTING TargetSetting, void* pData, unsigned int dwDataSize, unsigned int* pdwError);
int LJX8IF_GetSetting(int lDeviceId, unsigned char byDepth, LJX8IF_TARGET_SETTING TargetSetting, void* pData, unsigned int dwDataSize);
int LJX8IF_InitializeSetting(int lDeviceId, unsigned char byDepth, unsigned char byTarget);
int LJX8IF_ReflectSetting(int lDeviceId, unsigned char byDepth, unsigned int* pdwError);
int LJX8IF_RewriteTemporarySetting(int lDeviceId, unsigned char byDepth);
int LJX8IF_CheckMemoryAccess(int lDeviceId, unsigned char* pbyBusy);
int LJX8IF_SetXpitch(int lDeviceId, unsigned int dwXpitch);
int LJX8IF_GetXpitch(int lDeviceId, unsigned int* pdwXpitch);
int LJX8IF_ChangeActiveProgram(int lDeviceId, unsigned char byProgramNo);
int LJX8IF_GetActiveProgram(int lDeviceId, unsigned char* pbyProgramNo);
int LJX8IF_GetProfile(int lDeviceId, LJX8IF_GET_PROFILE_REQUEST* pReq, LJX8IF_GET_PROFILE_RESPONSE* pRsp, LJX8IF_PROFILE_INFO* pProfileInfo, unsigned int* pdwProfileData, unsigned int dwDataSize);
int LJX8IF_GetBatchProfile(int lDeviceId, LJX8IF_GET_BATCH_PROFILE_REQUEST* pReq, LJX8IF_GET_BATCH_PROFILE_RESPONSE* pRsp, LJX8IF_PROFILE_INFO * pProfileInfo, unsigned int* pdwBatchData, unsigned int dwDataSize);
int LJX8IF_GetBatchSimpleArray(int lDeviceId, LJX8IF_GET_BATCH_PROFILE_REQUEST* pReq, LJX8IF_GET_BATCH_PROFILE_RESPONSE* pRsp, LJX8IF_PROFILE_INFO* pProfileInfo, LJX8IF_PROFILE_HEADER* pProfileHeaderArray, unsigned short* pHeightProfileArray, unsigned short* pLuminanceProfileArray);
int LJX8IF_InitializeHighSpeedDataCommunication(int lDeviceId, LJX8IF_ETHERNET_CONFIG* pEthernetConfig, unsigned short wHighSpeedPortNo,
LJX8IF_CALLBACK pCallBack, unsigned int dwProfileCount, unsigned int dwThreadId);
int LJX8IF_InitializeHighSpeedDataCommunicationSimpleArray(int lDeviceId, LJX8IF_ETHERNET_CONFIG* pEthernetConfig, unsigned short wHighSpeedPortNo,
LJX8IF_CALLBACK_SIMPLE_ARRAY pCallBackSimpleArray, unsigned int dwProfileCount, unsigned int dwThreadId);
int LJX8IF_PreStartHighSpeedDataCommunication(int lDeviceId, LJX8IF_HIGH_SPEED_PRE_START_REQ* pReq, LJX8IF_PROFILE_INFO* pProfileInfo);
int LJX8IF_StartHighSpeedDataCommunication(int lDeviceId);
int LJX8IF_StopHighSpeedDataCommunication(int lDeviceId);
int LJX8IF_FinalizeHighSpeedDataCommunication(int lDeviceId);
int LJX8IF_GetZUnitSimpleArray(int lDeviceId, unsigned short* pwZUnit);
};
#endif