59 lines
2.0 KiB
C
59 lines
2.0 KiB
C
#pragma once
|
|||
|
|
/*************************************************
|
||
|
|
History:
|
||
|
|
Jimmy Chan 2022/1/25 3.0.0.0 build this moudle
|
||
|
|
Jimmy Chan 2022/3/9 3.0.0.1 add function "Send_s" and "Receive_s"
|
||
|
|
*************************************************/
|
||
|
|
|
||
|
|
#ifndef __COMMONTOOLDLL_H__
|
||
|
|
#define __COMMONTOOLDLL_H__
|
||
|
|
|
||
|
|
#ifdef _WIN64
|
||
|
|
typedef long long ControllerHandle;
|
||
|
|
#else
|
||
|
|
typedef long ControllerHandle;
|
||
|
|
#endif
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct HOST_PRM //Controller information
|
||
|
|
{
|
||
|
|
char cSn[21];
|
||
|
|
char cIp[16];
|
||
|
|
char cMac[100];
|
||
|
|
}Host_prm;
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct CON_PRM //Controller information
|
||
|
|
{
|
||
|
|
char cSn[21];
|
||
|
|
char cIp[16];
|
||
|
|
char cSm[16];
|
||
|
|
char cGw[16];
|
||
|
|
char DHCP;
|
||
|
|
}Controller_prm;
|
||
|
|
|
||
|
|
|
||
|
|
typedef struct ADAPDER_PRM //network card
|
||
|
|
{
|
||
|
|
char cSn[132];
|
||
|
|
char cIp[16];
|
||
|
|
}Adapter_prm;
|
||
|
|
|
||
|
|
extern "C"
|
||
|
|
{
|
||
|
|
_declspec(dllexport) int GetAdapter(int* AdatterCnt, Adapter_prm *mAdapterPrm);
|
||
|
|
_declspec(dllexport) int GetHost(int *controllerCnt, Host_prm *mHostPrm, char *AdapterIP);
|
||
|
|
_declspec(dllexport) int GetConfigure(char *mMAC, Controller_prm *mConPrm, char *AdapterIP);
|
||
|
|
_declspec(dllexport) int SetConfigure(char *mMAC, Controller_prm *mConPrm, char *AdapterIP);
|
||
|
|
_declspec(dllexport) int ConnectIP(char *ipAddress, int mTimeOut, ControllerHandle* controllerHandle);
|
||
|
|
_declspec(dllexport) int DestroyIpConnection(ControllerHandle controllerHandle);
|
||
|
|
_declspec(dllexport) int CreateSerialPort(int serialPortIndex, ControllerHandle* controllerHandle);
|
||
|
|
_declspec(dllexport) int CreateSerialPort_Baud(int serialPortIndex, int baud, ControllerHandle* controllerHandle);
|
||
|
|
_declspec(dllexport) int ReleaseSerialPort(ControllerHandle controllerHandle);
|
||
|
|
_declspec(dllexport) int Send_s(char* ResponseValue, char* RegisterAddress, char* RegisterValue, ControllerHandle controllerHandle);
|
||
|
|
_declspec(dllexport) int Receive_s(char* ResponseValue, char* RegisterAddress, char* RegisterValue, ControllerHandle controllerHandle);
|
||
|
|
_declspec(dllexport) int Transceiver(char *m_Data, unsigned long slen, char* m_RecvBuf, unsigned long rlen, ControllerHandle controllerHandle);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif
|