The following ifdef block is the standard way of creating macros which make exporting
from a DLL simpler. All files within this DLL are compiled with the DLL_API
symbol defined on the command line. this symbol should not be defined on any project
that uses this DLL. This way any other project whose source files include this file see
DLL_API functions as being imported from a DLL, wheras this DLL sees symbols
defined with this macro as being exported.
#ifndef DLL_API
#define DLL_API extern "C" __declspec(dllimport)
#endif
Define __stdcall:
#define WIN_API __stdcall
WORD: unsigned short
BOOL: bool
ULONG: unsigned long
1. Set the device network parameters under USB communication
DLL_API WORD WINAPI dsoUSBModeSetIPAddr(WORD DeviceIndex,
Return Value: If the function succeeds, the return value is 1.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
ULONG nIP, IP address,Example: 192.168.1.1 , IP = 0xC0A80101
ULONG nSubnetMask, subnetmask, Example : 255.255.255.0, nSubnetMask = 0xFFFFFF00
ULONG nGateway, gateway, Example 192.168.1.1, nGateway = 0Xc0A80101
USHORT nPort, the port , Range: 1 ~ 65535
BYTE* pMac, MAC address , MAC[6] = {FC,EF,A8,11,1F,5}
Remarks:Set the device network parameters under USB communication
2. Get the device network parameters under USB communication
DLL_API WORD WINAPI dsoUSBModeGetIPAddr(WORD DeviceIndex,
ULONG* pIP,
ULONG* pSubMask,
ULONG* pGateway,
WORD* pPort,
BYTE* pMac);
Return Value: If the function succeeds, the return value is 1.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
ULONG* pIP, IP address,Example: 192.168.1.1, *pIP = 0xC0A80101
ULONG* pSubnetMask, Example: 255.255.255.0, *pSubnetMask = 0xFFFFFF00
ULONG* pGateway, Example: 192.168.1.1, *pGateway = 0Xc0A80101
USHORT* pPort, the port , Example: 1 ~ 65535
BYTE* pMac, MAC address
Remarks: Get the device network parameters under USB communication
3. Change USB communication to NETWORK communication
DLL_API WORD WINAPI dsoOpenLan(WORD DeviceIndex,
WORD nMode);
Return Value: If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
WORD nMode, LAN or WIFI, if LAN, nMode = 0, if WIFI , nMode = 1
Remarks: When switch to network mode, please invoke this function to notify the device to switch
communication mode first. If switching to WIFI mode, please wait for about 90 seconds after
invoke this function to ensure WIFI start –up already.
4. Set the device network parameters under network communication
DLL_API WORD WINAPI dsoLANModeSetIPAddr(WORD DeviceIndex,
6. When LAN and WIFI mode switching with each other, need to invoke the following function:
DLL_API WORD WINAPI dsoLANOpenConnet(WORD DeviceIndex,
WORD nMode);
Return Value:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
WORD nMode, LAN or WIFI, if LAN, nMode = 0, if WIFI , nMode = 1
Remarks: When the communication mode switching, please invoke this function to notify the
device to switch communication mode first. If switching to WIFI mode, please wait for about 90
seconds after invoke this function to ensure WIFI start –up already.
7. In network mode, judge network connection is workable or not, please use following method:
DLL_API WORD WINAPI dsoLANGetRestartLANStatus(WORD DeviceIndex);
Return Value:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
Remarks: In network mode, can invoke this function to judge the network connection work or not.
8. In network mode, invoke following function to initialize the network connection.
DLL_API WORD WINAPI dsoLANInitSocket(WORD DeviceIndex,
USHORT* pIP,
USHORT iPort);
Return Value:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
USHORT* pIP, IP address, Example: IP = {192,168,1,1}
USHORT iPort, The port
Remarks: In network mode, can invoke this function to judge the network connection work or not.
9. Close network connection
DLL_API WORD WINAPI dsoLANClose(WORD DeviceIndex);
Return Value:
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Parameters: WORD DeviceIndex, The current device index
Remarks: To close network connection under LAN communication
Other:
The other hardware functions settings in the USB communication mode and network mode, except
the function name different, all the others (like Parameters and Return Value) are same. Please
refer to HTHardDll.h and HTLANDll.h. Usage details please refer to Demo examples.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.