#ifndef __LIBDLL_H__
#define __LIBDLL_H__

//#define  EXPORT  extern "C" __declspec (dllexport)
#define  EXPORTFUNCTION  extern "C" __declspec (dllexport)

#define ALLERROR                      0xFFFFFFFF
#define ALLNOERROR                    0x00000000
#define ERRORSTEP(x)                  (0x1<<x)
#define ERROR_NORESOURCE              0x00000001                     
#define ERROR_NOSPACE                 0x00000002                     
#define ERROR_PARAMETER	              0x00000004                     
#define ERROR_API_FUNCTION            0x00000005
#define ERROR_WLAN_QUIRY_INTERFACE    0x00000008                     
#define ERROR_WLAN_SSID_REPEAT        0x00000010                     
#define ERROR_WLAN_NO_PRSSID_LIST     0x00000011                     
#define ERROR_WLAN_NO_ASSOCIATED      0X00000012                     
#define ERROR_WLAN_NO_AVAILABLE_LIST  0x00000013                     
#define ERROR_WLAN_NO_CONNECTED	      0x00000014                     
#define ERROR_WLAN_SSID_UNKNOWN	      0x00000018                     
#define ERROR_WLAN_QUIRY_FAILED	      0x00000021                     
#define ERROR_BT_SERVICE              0x00000020

//========== GPS Error Code =====================
#define ERROR_INCORRECT_BAUDRATE       21
#define ERROR_INCORRECT_SERIAL_PORT    22
#define ERROR_FAIL_TO_START_CLM        23
#define ERROR_FAIL_TO_IMPORT_FILE      24 

//========== Bluetooth Error Code =====================
#define ERROR_NO_DEVICE_INFO          21
#define ERROR_NO_SERVICE_INFO         22
#define ERROR_WRONG_DEVICE_INFO       23
#define ERROR_WRONG_SERVICE_INFO      24
#define ERROR_NOT_DEVICEINFO_OBJ      25
#define ERROR_NOT_SERVICEINFO_OBJ     26
#define ERROR_WRONG_SERVICE_TYPE      27
#define ERROR_DEVICE_NOT_HAS_SERVICE  28
#define ERROR_SERVICE_NOT_CONNECTED   29
#define ERROR_NO_STARTFINDING         30
#define ERROR_WRONG_ARG               31
#define ERROR_OPPERATION_FAIL         32
#define ERROR_MACHINE_NOT_SUPPORTED   33

#define ERROR_NO_DEVICE               0xff
//========== Bluetooth service type =====================
#define UNDEFINED_BT_SERVICE          0
#define BT_HID_SERVICE                1
#define BT_DUN_SERVICE                2
#define BT_SPP_SERVICE                3
#define BT_OPP_SERVICE                4
#define BT_PAN_SERVICE                5
#define BT_HEADSET_SERVICE            6
#define BT_HANDSFREE_SERVICE          7
#define BT_FTP_SERVICE                8

//============== Key define =============================
#define KEY_GENERAL 0x1
#define KEY_ALPHA   0x2
#define KEY_FN      0x4
#define KEY_CTRL    0x8
#define KEY_ALT     0x10
#define KEY_SCAN    0x20
#define KEY_POWER   0x40
#define KEY_SHIFT   0x200
#define KEY_LSTRIGGER 0x80//#define KEY_LSTRIGGER 0x100
#define KEY_RSTRIGGER 0x100//#define KEY_RSTRIGGER 0x200
#define KEY_ALL     0xFFFFFFFF


#ifdef __cplusplus
extern "C" {
#endif

#ifdef LIBDLL_EXPORTS
#define LIBDLL_API __declspec(dllexport)
#else
#define LIBDLL_API __declspec(dllimport)
#endif

typedef struct {
    INT     fileType;
    WCHAR   filePath[1024];
    WCHAR   fileName[200];
    INT     fileSize;
} FTP_FILE_INFO;

typedef struct
{
    BOOL    FullKey;
    BOOL    TaskKey;
    BOOL    FuncKey;
    BOOL    AlphaKey;
}KEYPADLOCK, *PKEYPADLOCK;

typedef struct
{
    TCHAR   szClass[64];
}KEYPADBIND, *PKEYPADBIND;


typedef struct
{
    BOOL    CardInserted;
    BOOL    CardPowered;
    TCHAR   VENDER[32];
    TCHAR   PRODUCT[32];
}CARDINFO, *PCARDINFO;

typedef struct
{
    TCHAR   PIN[12];
}PINNUM, *PPINNUM;

typedef struct
{
    TCHAR   MANUIDENNUM[100];
}MANUINFO, *PMANUINFO;

typedef struct
{
    TCHAR   APINUM[16];
}APIVER, *PAPIVER;

typedef struct
{
    UINT    Color;
    UINT    ONOFF;
}LEDSET, *PLEDSET;

typedef struct _SYSINFO {
    TCHAR   DevDesc[16];
    TCHAR   DevCFG[16];
    TCHAR   SerialNum[16];
    TCHAR   SerialNumReadOnly[16];
    TCHAR   SerialNumPCBA[16];
    TCHAR   Manufactory[32];
    TCHAR   ManuDate[16];
    UCHAR   OsVer[32];
    UCHAR   BootloaderVer[32];
    TCHAR   MicroPVer[32];
    UCHAR   BTAddress[32];
    UCHAR   WiFiAddress[32];
    TCHAR   IMEI[32];
} SYSINFO, *PSYSINFO;

typedef struct _DEVCFGINFO {
    BYTE    DevCFG[16];
} DEVCFGINFO, *PDEVCFGINFO;

typedef struct _PBINFO {
    BYTE    PBCFG[16];
} PBINFO,  *PPBINFO;


typedef struct _BKLCTL {
    DWORD   batttimeout;
    DWORD   lightlevel;
    DWORD   actimeout;
    DWORD   aclightlevel;
    DWORD   backlightontap;
    DWORD   acbacklightontap;
    DWORD   usebattery;
    DWORD   useext;
} BKLCTL, *PBKLCTL;

typedef struct{
    UINT    uDeviceId;
    UINT    uMsg;
    DWORD   dwUser;
    DWORD   dwParam1;
    DWORD   dwParam2;
}AUDIO_MESSAGE_PARAMS;


typedef struct _WLANCTL {
    CHAR    SSID[32];                 
    DWORD   authentication;          
    DWORD   encryption;              
    DWORD   adhoc;                   
    DWORD   eap;                     
    WCHAR   key[80];
} WLANCTL, *PWLANCTL;

typedef struct _WLANCONNECTEDST {
    CHAR    SSID[32];                  
    DWORD   SSIDLength;
    BYTE    BSSID[6];
} WLANCONNECTEDST, *PWLANCONNECTEDST;

typedef struct _WLANADPTINFO {
    DWORD   fUseDHCP;
    DWORD   IPAddr;
    DWORD   SubnetMask;
    DWORD   Gateway;
    DWORD   DNSAddr;
    DWORD   DNSAltAddr;
    DWORD   WINSAddr;
    DWORD   WINSAltAddr;
} WLANADPTINFO, *PWLANADPTINFO;

#ifndef _WZCAPI_H_
typedef struct
{
    DWORD   dwDataLen;
    BYTE*   pData;
} RAW_DATA, *PRAW_DATA;
#endif

//Camera Struct
typedef struct
{
    DWORD   PreviewFlash;
    DWORD   CaptureFlash;  
}FLASH, *PFLASH;


typedef struct
{   
    INT     AutoExposure;
    INT     AutoWhiteBalance;
    INT     ImageFormat;  
    //LPWSTR  lpPathName;
    WCHAR   lpPathName[500]; 
    INT     PathSize;
    //LPWSTR  lpFileName;
    WCHAR   lpFileName[500];
    INT     FileSize;
} PICSTATE;

typedef struct  {
    BOOL    bDevMode;
    DWORD   dwCurrentScenario;
    DWORD   dwCurrentDevice;
}WAVE_DRIVER_PARAMETER,*PWAVE_DRIVER_PARAMETER;

typedef struct
{
    TCHAR   IMEI[16];
}GSMIMEI, *PGSMIMEI;

#define DBG_API                     1
#define AUDIO_MUTEON                0x2222
#define AUDIO_MUTEOFF               0x3333
#define LED_ONOFF                   0x1122
#define BLUETOOTHON                 0x5555
#define BLUETOOTHOFF                0x6666
#define BUZZERON                    0x7777
#define BUZZEROFF                   0x8888
#define SET_VIBRATOR                0x1598
#define SET_LED	                    0x1698
#define GetMCUinfo	                0x1798
#define AC97SET                     0x9999
#define SetGPIO103                  0x1799

#define AUDIOGSMOUT                 0x1001
#define AUDIOGSMIN                  0x1002
#define BTVOIPON                    0x1011
#define BTVOIPOFF                   0x1022
#define BTGSMON                     0x1033
#define BTGSMOFF                    0x1044
//for audio path switch
#define WPDM_SWITCH_AUDIO_PATH      0x1048
#define WPDM_PRIVATE_PARAMETER_DUMP 0x1049
#define SCENARIO_CE                 0x00
#define SCENARIO_GSM                0x10
#define SCENARIO_VOIP               0x20
#define AUDIODEVICE_EARPHONE        0x00
#define AUDIODEVICE_BT              0x01
#define AUDIODEVICE_BOARD           0x02   
#define AUDIODEVICE_UNDEFINE        0xFFFF



#define DATA_MEM_MIN    32
#define DATA_MEM_MAX    65536

//  API prototypes


//GPS
DWORD WINAPI ImportInstantFixFile(CHAR *filePath, INT comPort, INT baudrate);

// System
//DWORD WINAPI GetAPIVersion(APIVER *apiVer);
//DWORD WINAPI GetHALUUID(GUID *guid);
//DWORD WINAPI GetSysInfo (SYSINFO *sysInfo);
//DWORD WINAPI GetSysDevName (WCHAR *devName,BYTE nameSize);
//DWORD WINAPI SetInitLoaderBind(KEYPADBIND *KeypadBind);
//DWORD WINAPI SetSysDevName (WCHAR *devName,BYTE nameSize);
//DWORD WINAPI SystemSoftReset(void);
DWORD WINAPI SetSystemColdBoot(BYTE CleanFlag,BYTE RemoteUpdate);

DWORD WINAPI GetCipherlabPlatformName (DWORD *devName);
DWORD WINAPI GetCipherlabDeviceID (CHAR *devName,BYTE nameSize);

// Backlight
//DWORD GetBacklightCTL (BKLCTL *bklCtl);
//DWORD SetBacklightCTL (BKLCTL *bklCtl);
//DWORD GetBacklightLV (BYTE byFromAC, BYTE *byLevel);
//DWORD SetBacklightLV (BYTE byFromAC, BYTE byLevel);
//DWORD GetBacklightST (BYTE *state);
//DWORD SetBacklightST (BYTE state);
//DWORD SetBacklightDefault ();
//DWORD SetBacklightMax ();
//DWORD SetBacklightMin ();

// TouchPanel
//DWORD WINAPI SetTchLock(BYTE lockState);
//DWORD WINAPI GetTchLock(BYTE *lockState);
DWORD WINAPI GetDisplayType (BYTE *panelMode);
DWORD WINAPI SetDisplayType (BYTE panelMode);

// Taskbar
DWORD WINAPI SetTaskBarAlwaysHide(BYTE hide);
DWORD WINAPI SetTaskBarAutoHide(BYTE hide);

// Keypad
//DWORD WINAPI SetKeypadSensitivity(DWORD value);
//DWORD WINAPI GetKeypadSensitivity(DWORD *value);
DWORD WINAPI SetKeyPadFullKeyLock(BYTE lockState);
DWORD WINAPI GetKeyPadFullKeyState(BYTE *state);
DWORD WINAPI SetKeyAlphaState(BYTE state);
DWORD WINAPI GetKeyAlphaState(BYTE *state);
DWORD WINAPI GetKeyPadKeyLock(KEYPADLOCK *keyLock);
DWORD WINAPI SetKeyPadFuncKeyLock(BYTE lockState);
DWORD WINAPI SetKeyPadAlphaKeyLock(BYTE lockState);
//DWORD WINAPI GetKeypadType (BYTE *keypadLayout);
DWORD WINAPI GetKeyFuncKeyState(BYTE *state);
DWORD WINAPI SetKeyFuncKeyState(BYTE state);
DWORD WINAPI GetKeyPadFuncKeyLock(BYTE lockState);
DWORD WINAPI SetKeyPadTestMode(BYTE state);
//DWORD WINAPI GetKeypadLock(DWORD key, DWORD *lockState);
//DWORD WINAPI SetKeypadLock(DWORD key, DWORD lockState);
//DWORD WINAPI GetKeypadMode(DWORD key, DWORD *mode);
//DWORD WINAPI SetKeypadMode(DWORD key, DWORD mode);
//DWORD WINAPI GetKeypadState(DWORD key, DWORD *state);
//DWORD WINAPI SetKeypadState(DWORD key, DWORD state);

// Keylight
//DWORD WINAPI GetKeylightOnOff (BYTE *onOff);
//DWORD WINAPI SetKeylightOnOff (BYTE onOff);

// Trigger
DWORD WINAPI GetTriggerState(BYTE *state);
DWORD WINAPI SetTriggerLockON(VOID);
DWORD WINAPI SetTriggerLockOFF(VOID);

// Audio
DWORD WINAPI SetBTAudioState(BOOL state);
DWORD WINAPI SetAudioPath(DWORD uiPath);
//DWORD WINAPI GetHeadsetState (BYTE *state);

// Vibartor
//DWORD SetVibratorPower  (BYTE onOff);
//DWORD GetVibratorPower  (BYTE *onOff);

// Wireless
/*
DWORD WINAPI SetWiFiPower(BYTE onOff);
DWORD WINAPI GetWiFiPower(BYTE *onOff);
DWORD SetWlanIpInfo(WLANADPTINFO *adpt);
DWORD GetWlanIpInfo(WLANADPTINFO *adpt);
DWORD AddWlanSsidToPreferredList (WLANCTL &wlanCtl) ;
DWORD GetWlanPreferredList (RAW_DATA *preferredList);
DWORD GetWlanAvailableList (RAW_DATA *availableList);
DWORD GetWlanConnectedStatus(WLANCONNECTEDST *wlanConnSt);
DWORD ResetWlanPreferredList (VOID) ;
DWORD ReconnectWlanPreferredList (VOID) ;
DWORD GetWiFiMac(ULONGLONG *wifiMac);
DWORD ScanWiFiBSSID(void);
DWORD GetWiFiBSSIDList(BYTE *buffer);
*/
// Bluetooth
//DWORD WINAPI StartBluetooth(VOID);
//DWORD WINAPI StopBluetooth(VOID);
//DWORD WINAPI StartFindingDevice(VOID);
//DWORD WINAPI FindNextBTDevice(INT *deviceInfo);
//DWORD WINAPI FindService(INT targetService, INT deviceInfo, INT *serviceInfo);
//DWORD WINAPI GetBTConnStatus(INT serviceInfo, INT *status);
//DWORD WINAPI SetBTConnStatus(INT serviceType, INT onOff, INT deviceInfo, INT serviceInfo);
//DWORD WINAPI StartBrowse(INT serviceInfo, CHAR *targetPath);
//DWORD WINAPI GetNextFile(INT serviceInfo, FTP_FILE_INFO *fileInfo);
//DWORD WINAPI PutFile(INT serviceInfo, CHAR *filePath, HWND progressBar);
//DWORD WINAPI GetFile(INT serviceInfo, FTP_FILE_INFO *fileInfo, HWND progressBar);
//DWORD WINAPI GetDeviceName(INT deviceInfo, CHAR *outBuf, INT bufSize);
//DWORD WINAPI GetServiceType(INT serviceInfo, INT *serviceType);
//DWORD WINAPI GetDeviceAddress(INT deviceInfo, ULONGLONG *btAddr);
//DWORD WINAPI StartPairing(INT deviceInfo, CHAR *pinCode, INT pinCodeLen);
//DWORD WINAPI StartUnpairing(INT deviceInfo);
//DWORD WINAPI GetSppComPort(INT serviceInfo, INT *comPort);
DWORD WINAPI SetSppComport(INT serviceInfo, INT comPort);
//DWORD WINAPI GetSppChannel(INT serviceInfo, INT *channel);
//DWORD WINAPI GetDeviceType(INT deviceInfo, INT *deviceType);
//DWORD WINAPI CreateSppServiceInfo(ULONGLONG deviceMacAddr, WCHAR *deviceName, INT deviceType, INT comPort, INT channel, INT *deviceInfo, INT *serviceInfo);
//DWORD WINAPI ConnectByMacAddr(ULONGLONG deviceMacAddr, INT targetService, CHAR *pinCode, INT sppComPort, INT *devinfo, INT *servInfo);


// Status Indication
DWORD WINAPI SetBuzzerOFF(VOID);
DWORD WINAPI SetBuzzerON(DWORD hz);
//DWORD WINAPI SetLEDLight(BYTE color,BOOL onOff);

// Button Assignment
//DWORD WINAPI SetButtonAssignment (INT buttonID, INT keyCode, TCHAR *program);
//DWORD WINAPI GetButtonAssignment (INT buttonID, INT *keyCode, TCHAR *program);

// Headset
DWORD WINAPI EnableBTAudio(BOOL onOff);
DWORD WINAPI EnableGsmBTHeadset(BOOL state);
DWORD WINAPI EnableGsmAudioIn(BOOL onOff);
DWORD WINAPI EnableGsmAudioOut(BOOL onOff);

// GPRS Check
DWORD WINAPI SetGprsPower(BYTE onOff);
DWORD WINAPI GetGprsPower(BYTE *onOff);
DWORD WINAPI SetPINCode(PINNUM *pinCode, BYTE *result);
DWORD WINAPI GetPINCode(PINNUM *pinCode, BYTE *result);
DWORD WINAPI CheckPINCode(PINNUM *pinCode, BYTE *result);
DWORD WINAPI CheckPINNeed(BYTE *state);
DWORD WINAPI GetGPRSManufacturer(MANUINFO *manuInfo);
DWORD WINAPI GetPINChecked(BYTE *checked);
DWORD WINAPI GPRSPowerOnAutoCheckPIN(BYTE *result);
DWORD WINAPI SetPINCodeToSave(BYTE *result);
DWORD WINAPI SetGPRSConnStatus(INT onOff, 
                               WCHAR *entryName,
                               WCHAR *phoneNumber,
                               WCHAR *userName,
                               WCHAR *password,
                               WCHAR *apName,
                               WCHAR *callbackNumber,
                               WCHAR *domain);
DWORD WINAPI GetGPRSConnStatus(INT *status);
DWORD WINAPI ChangePINCode(PINNUM *oldPinCode, PINNUM *newPinCode);
DWORD WINAPI SetPINCodeLock(PINNUM *pinCode, BYTE onOff);
DWORD WINAPI GetGPRSIMEI(GSMIMEI *gsmIMEI);
DWORD WINAPI SetGSMService(BYTE OnOff);
DWORD WINAPI GetGSMService(PBYTE OnOff);

// Camera
//DWORD EnableCamera(HWND wnd, BOOL onOff);
//DWORD EnablePreviewWindow(BOOL onOff);
//VOID  SetPreviewLocation(int posX, int posY);
//DWORD GetPreviewLocation(int *posX, int *posY);
//DWORD StartStillCapture(INT playSound);   
//DWORD SetStillCaptureState(PICSTATE *picInfo);
//DWORD GetStillCaptureState(PICSTATE *picInfo);
DWORD SetCameraExposureValue(DWORD level);
DWORD GetCameraExposureValue(DWORD *level);
DWORD SetFlashLight(FLASH *flash);
DWORD GetFlashLight(FLASH *flash);
//DWORD SetFeature(DWORD level);
//DWORD GetFeature(DWORD *level);
//DWORD SetCameraResolution(DWORD resValue);
//DWORD GetCameraResolution(DWORD *resValue);
//DWORD TerminateGraph();
//DWORD StartGraph();
//DWORD HaltGraph();




// Dynamic**********************************
// GPS
typedef DWORD (WINAPI *PFN_ImportInstantFixFile)(CHAR *filePath, INT comPort, INT baudrate);


// System
typedef DWORD (WINAPI *PFN_GetAPIVersion)(APIVER *apiVer);
typedef DWORD (WINAPI *PFN_GetHALUUID)(GUID *guid);
typedef DWORD (WINAPI *PFN_GetSysInfo)(SYSINFO *sysInfo);
typedef DWORD (WINAPI *PFN_GetSysDevName)(WCHAR *devName, BYTE nameSize);
typedef DWORD (WINAPI *PFN_SetInitLoaderBind)(KEYPADBIND *keypadBind);
typedef DWORD (WINAPI *PFN_SetSysDevName)(WCHAR *devName, BYTE nameSize);
typedef DWORD (WINAPI *PFN_SystemSoftReset)(VOID);
typedef DWORD (WINAPI *PFN_SetSystemColdBoot)(BYTE CleanFlag,BYTE RemoteUpdate);

typedef DWORD (WINAPI *PFN_GetCipherlabPlatformName) (DWORD *devName);
typedef DWORD (WINAPI *PFN_GetCipherlabDeviceID) (CHAR *devName,BYTE nameSize);

// Backlight
typedef DWORD (WINAPI *PFN_GetBacklightCTL)(BKLCTL *bklCtl);
typedef DWORD (WINAPI *PFN_SetBacklightCTL)(BKLCTL *bklCtl);
typedef DWORD (WINAPI *PFN_GetBacklightLV) (BYTE byFromAC, BYTE *byLevel);
typedef DWORD (WINAPI *PFN_SetBacklightLV) (BYTE byFromAC, BYTE byLevel);
typedef DWORD (WINAPI *PFN_GetBacklightST) (BYTE *state);
typedef DWORD (WINAPI *PFN_SetBacklightST) (BYTE state);
typedef DWORD (WINAPI *PFN_SetBacklightDefault)();
typedef DWORD (WINAPI *PFN_SetBacklightMax)();
typedef DWORD (WINAPI *PFN_SetBacklightMin)();

// TouchPanel
typedef DWORD (WINAPI *PFN_SetTchLock)(BYTE lockState);
typedef DWORD (WINAPI *PFN_GetTchLock)(BYTE *lockState);
typedef DWORD (WINAPI *PFN_GetDisplayType) (BYTE *panelMode);
typedef DWORD (WINAPI *PFN_SetDisplayType) (BYTE panelMode);

// Taskbar
typedef DWORD (WINAPI *PFN_SetTaskBarAlwaysHide)(BYTE hide);
typedef DWORD (WINAPI *PFN_SetTaskBarAutoHide)(BYTE hide);

// Keypad
typedef DWORD (WINAPI *PFN_SetKeypadSensitivity)(DWORD value);
typedef DWORD (WINAPI *PFN_GetKeypadSensitivity)(DWORD *value);
typedef DWORD (WINAPI *PFN_SetKeyPadFullKeyLock)(BYTE lockState);
typedef DWORD (WINAPI *PFN_GetKeyPadFullKeyState)(BYTE *lockState);
typedef DWORD (WINAPI *PFN_SetKeyAlphaState)(BYTE state);
typedef DWORD (WINAPI *PFN_GetKeyAlphaState)(BYTE *state);
typedef DWORD (WINAPI *PFN_GetKeyPadKeyLock)(KEYPADLOCK *keyLock);
typedef DWORD (WINAPI *PFN_SetKeyPadFuncKeyLock)(BYTE lockState);
typedef DWORD (WINAPI *PFN_SetKeyPadAlphaKeyLock)(BYTE lockState);
typedef DWORD (WINAPI *PFN_GetKeypadType) (BYTE *keypadLayout);
typedef DWORD (WINAPI *PFN_GetKeyFuncKeyState)  (BYTE *State);
typedef DWORD (WINAPI *PFN_SetKeyFuncKeyState)  (BYTE state);
typedef DWORD (WINAPI *PFN_GetKeyPadFuncKeyLock)(BYTE *lockState);
typedef DWORD (WINAPI *PFN_SetKeyPadTestMode)(BYTE state);
typedef DWORD (WINAPI *PFN_GetKeypadLock)(DWORD Key, DWORD *lockState);
typedef DWORD (WINAPI *PFN_SetKeypadLock)(DWORD Key, DWORD lockState);
typedef DWORD (WINAPI *PFN_GetKeypadMode)(DWORD Key, DWORD *mode);
typedef DWORD (WINAPI *PFN_SetKeypadMode)(DWORD Key, DWORD mode);
typedef DWORD (WINAPI *PFN_GetKeypadState)(DWORD Key, DWORD *state);
typedef DWORD (WINAPI *PFN_SetKeypadState)(DWORD Key, DWORD state);

// Keylight
typedef DWORD (WINAPI *PFN_GetKeylightOnOff) (BYTE *onOff);
typedef DWORD (WINAPI *PFN_SetKeylightOnOff) (BYTE onOff);

// Trigger
typedef DWORD (WINAPI *PFN_GetTriggerState)(BYTE *state);
typedef DWORD (WINAPI *PFN_SetTriggerLockON)(VOID);
typedef DWORD (WINAPI *PFN_SetTriggerLockOFF)(VOID);

// Audio
typedef DWORD (WINAPI *PFN_SetBTAudioState)(BOOL state);
typedef DWORD (WINAPI *PFN_SetAudioPath)(DWORD uiPath);
typedef DWORD (WINAPI *PFN_GetHeadsetState)(BYTE *state);

// Vibartor
typedef DWORD (WINAPI *PFN_SetVibratorPower) (BYTE onOff);
typedef DWORD (WINAPI *PFN_GetVibratorPower) (BYTE *onOff);

// Wireless
typedef DWORD (WINAPI *PFN_SetWiFiPower)(BYTE onOff);
typedef DWORD (WINAPI *PFN_GetWiFiPower)(BYTE *onOff);
typedef DWORD (WINAPI *PFN_GetWlanIpInfo) (WLANADPTINFO *adpt);
typedef DWORD (WINAPI *PFN_SetWlanIpInfo) (WLANADPTINFO *adpt);
typedef DWORD (WINAPI *PFN_AddWlanSsidToPreferredList) (WLANCTL &wlanCtl1) ;
typedef DWORD (WINAPI *PFN_GetWlanPreferredList) (RAW_DATA *preferredList);
typedef DWORD (WINAPI *PFN_GetWlanAvailableList) (RAW_DATA *availableList);
typedef DWORD (WINAPI *PFN_GetWlanConnectedStatus) (WLANCONNECTEDST *wlanConnSt);
typedef DWORD (WINAPI *PFN_ResetWlanPreferredList) (VOID) ;
typedef DWORD (WINAPI *PFN_ReconnectWlanPreferredList) (VOID) ;
typedef DWORD (WINAPI *PFN_GetWiFiMac) (ULONGLONG *wifiMac);
typedef DWORD (WINAPI *PFN_GetWiFiBSSIDList)(BYTE *buffer);
typedef DWORD (WINAPI *PFN_ScanWiFiBSSID)(void);


// Bluetooth
typedef DWORD (WINAPI *PFN_StartBluetooth)(VOID);
typedef DWORD (WINAPI *PFN_StopBluetooth) (VOID);
typedef DWORD (WINAPI *PFN_StartFindingDevice)(VOID);
typedef DWORD (WINAPI *PFN_FindNextBTDevice)(INT *deviceInfo);
typedef DWORD (WINAPI *PFN_FindService)(INT targetService, INT deviceInfo, INT *serviceInfo);
typedef DWORD (WINAPI *PFN_GetBTConnStatus)(INT serviceInfo, INT *status);
typedef DWORD (WINAPI *PFN_SetBTConnStatus)(INT serviceType, INT onOff, INT deviceInfo, INT serviceInfo);
typedef DWORD (WINAPI *PFN_StartBrowse)(INT serviceInfo, CHAR *targetPath);
typedef DWORD (WINAPI *PFN_GetNextFile)(INT serviceInfo, FTP_FILE_INFO *fileInfo);
typedef DWORD (WINAPI *PFN_PutFile)(INT serviceInfo, CHAR *filePath, HWND progressBar);
typedef DWORD (WINAPI *PFN_GetFile)(INT serviceInfo, FTP_FILE_INFO *fileInfo, HWND progressBar);
typedef DWORD (WINAPI *PFN_GetDeviceName)(INT deviceInfo, CHAR *outBuf, INT bufSize);
typedef DWORD (WINAPI *PFN_GetServiceType)(INT serviceInfo, INT *serviceType);
typedef DWORD (WINAPI *PFN_GetDeviceAddress)(INT deviceInfo, ULONGLONG *btAddr);
typedef DWORD (WINAPI *PFN_StartPairing)(INT deviceInfo, CHAR *pinCode, INT pinCodeLen);
typedef DWORD (WINAPI *PFN_StartUnpairing)(INT deviceInfo);
typedef DWORD (WINAPI *PFN_GetSppComPort)(INT serviceInfo, INT *comPort);
typedef DWORD (WINAPI *PFN_SetSppComport)(INT serviceInfo, INT comPort);
typedef DWORD (WINAPI *PFN_GetSppChannel)(INT serviceInfo, INT *channel);
typedef DWORD (WINAPI *PFN_GetDeviceType)(INT deviceInfo, INT *deviceType);
typedef DWORD (WINAPI *PFN_CreateSppServiceInfo)(ULONGLONG deviceMacAddr, WCHAR *deviceName, INT deviceType, INT comPort, INT channel, INT *deviceInfo, INT *serviceInfo);
typedef DWORD (WINAPI *PFN_ConnectByMacAddr)(ULONGLONG deviceMacAddr, INT targetService, CHAR *pinCode, INT sppComPort, INT *devinfo, INT *servInfo);


// Status Indication
typedef DWORD (WINAPI *PFN_SetBuzzerON)(DWORD hz);
typedef DWORD (WINAPI *PFN_SetBuzzerOFF)(VOID);
typedef DWORD (WINAPI *PFN_SetLEDLight)(BYTE color,BOOL onOff);

// Button Assignment
typedef DWORD (WINAPI *PFN_SetButtonAssignment) (INT buttonID, INT keyCode, TCHAR *program);
typedef DWORD (WINAPI *PFN_GetButtonAssignment) (INT buttonID, INT *keyCode, TCHAR *program);

// Headset
typedef DWORD (WINAPI *PFN_EnableBTAudio)(BOOL onOff);
typedef DWORD (WINAPI *PFN_EnableGsmBTHeadset)(BOOL state);
typedef DWORD (WINAPI *PFN_EnableGsmAudioIn)(BOOL onOff);
typedef DWORD (WINAPI *PFN_EnableGsmAudioOut)(BOOL onOff);

// GPRS Check
typedef DWORD (WINAPI *PFN_SetGprsPower)(BYTE onOff);
typedef DWORD (WINAPI *PFN_GetGprsPower)(BYTE *onOff);
typedef DWORD (WINAPI *PFN_SetPINCode)(PINNUM *pinCode, BYTE *result);
typedef DWORD (WINAPI *PFN_GetPINCode)(PINNUM *pinCode, BYTE *result);
typedef DWORD (WINAPI *PFN_CheckPINCode)(PINNUM *pinCode, BYTE *result);
typedef DWORD (WINAPI *PFN_CheckPINNeed)(BYTE *state);
typedef DWORD (WINAPI *PFN_GetGPRSManufacturer)(MANUINFO *manuInfo);
typedef DWORD (WINAPI *PFN_GetPINChecked)(BYTE *checked);
typedef DWORD (WINAPI *PFN_GPRSPOWERONAUTOCHECKPIN)(BYTE *result);
typedef DWORD (WINAPI *PFN_SetPINCodeToSave)(BYTE *result);
typedef DWORD (WINAPI *PFN_SetGPRSConnStatus)(INT onOff,
                                              WCHAR *entryName,
                                              WCHAR *phoneNumber,
                                              WCHAR *userName, 
                                              WCHAR *password, 
                                              WCHAR *apName,
                                              WCHAR *callbackNumber,
                                              WCHAR *domain);
typedef DWORD (WINAPI *PFN_GetGPRSConnStatus)(INT *status);
typedef DWORD (WINAPI *PFN_ChangePINCode)(PINNUM *oldPinCode, PINNUM *newPinCode);
typedef DWORD (WINAPI *PFN_SetPINCodeLock)(PINNUM *pinCode, BYTE onOff);
typedef DWORD (WINAPI *PFN_GetGPRSIMEI)(GSMIMEI *gsmIMEI);
typedef DWORD (WINAPI *PFN_SetGSMService)(BYTE OnOff);
typedef DWORD (WINAPI *PFN_GetGSMService)(PBYTE OnOff);

//Camera
//typedef DWORD (WINAPI * PFN_EnableCamera) (HWND wnd, BOOL onOff);
typedef DWORD (WINAPI * PFN_EnablePreviewWindow)(BOOL onOff);
typedef VOID  (WINAPI * PFN_SetPreviewLocation)(int posX, int posY);
typedef DWORD (WINAPI * PFN_GetPreviewLocation)(int *posX, int *posY);
typedef DWORD (WINAPI * PFN_StartStillCapture)(INT playSound);   
typedef DWORD (WINAPI * PFN_SetStillCaptureState)(PICSTATE *picInfo);
typedef DWORD (WINAPI * PFN_GetStillCaptureState)(PICSTATE *picInfo);
typedef DWORD (WINAPI * PFN_SetCameraExposureValue)(DWORD level);
typedef DWORD (WINAPI * PFN_GetCameraExposureValue)(DWORD *level);
typedef DWORD (WINAPI * PFN_SetFlashLight)(FLASH *flash);
typedef DWORD (WINAPI * PFN_GetFlashLight)(FLASH *flash);
typedef DWORD (WINAPI * PFN_SetFeature)(DWORD level);
typedef DWORD (WINAPI * PFN_GetFeature)(DWORD *level);
typedef DWORD (WINAPI * PFN_SetCameraResolution)(DWORD resValue);
typedef DWORD (WINAPI * PFN_GetCameraResolution)(DWORD *resValue);
typedef DWORD (WINAPI * PFN_TerminateGraph)();
typedef DWORD (WINAPI * PFN_StartGraph)();
typedef DWORD (WINAPI * PFN_HaltGraph)();



#ifdef __cplusplus
}
#endif

#endif // __LIBDLLH__
