求大神帮忙改写一下C#调用动态库函数

duke222504 2017-11-22 04:09:22
private const string DLLNAME = @"UHF.dll";
[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int OpenNetPort(int Port,
string iPaddr,
ref byte ComAddr,
ref int PortHandle);


[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetChannelMessage(ref byte ConAddr,
byte[] Msg,
ref byte MsgLength ,
ref byte MsgType,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetClock(ref byte ConAddr,
byte[] SetTime,
ref byte IRStatue,
int PortHandle);


[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int ConfigureController(ref byte ConAddr,
byte IREnable,
byte IRTime,
byte TagExistTime,
byte AlarmEn,
byte DelayTime,
byte Pepolemsg,
byte AEn,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetControllerConfig(ref byte ConAddr,
ref byte IREnable,
ref byte IRTime,
ref byte TagExistTime,
ref byte AlarmEn,
ref byte DelayTime,
ref byte Pepolemsg,
ref byte AEn,
ref byte IRStatue,
int PortHandle);


[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetControllerInfo(ref byte ConAddr,
ref byte ProductCode,
ref byte MainVer,
ref byte SubVer,
ref byte IRStatue,
int PortHandle);




[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetControllerAddr(ref byte ConAddr,
byte Flag,
byte NewAddr,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int ModeSwitch(ref byte ConAddr,
ref byte Mode,
ref byte IRStatue,
int PortHandle);




[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetEASMessage(ref byte ConAddr,
byte[] Msg,
ref byte MsgLength ,
ref byte MsgType,
ref byte IRStatue,
int PortHandle);


[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetEASWorkStyle(ref byte ConAddr,
byte EASMode,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetEASWorkStyle(ref byte ConAddr,
ref byte EASMode,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int StatisticalMsg(ref byte ConAddr,
byte[] positive,
byte[] reverse,
byte[] AlarmNum,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int ClearStatisticalMsg(ref byte ConAddr,
ref byte IRStatue,
int PortHandle);


[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetReadParameter(ref byte ConAddr,
byte Qvalue,
byte Session,
byte AdrTID,
byte LenTID,
byte MaskMem,
byte[] MaskAdr,
byte MaskLen,
byte[] MaskData,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetReadParameter(ref byte ConAddr,
ref byte Qvalue,
ref byte Session,
ref byte AdrTID,
ref byte LenTID,
ref byte MaskMem,
byte[] MaskAdr,
ref byte MaskLen,
byte[] MaskData,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetWorkParameter(ref byte ConAddr,
byte Power,
byte MaxFre,
byte MinFre,
byte BeepEn,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int GetWorkParameter(ref byte ConAddr,
ref byte Power,
ref byte MaxFre,
ref byte MinFre,
ref byte BeepEn,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int SetRelay(ref byte ConAddr,
byte RelayTime,
ref byte IRStatue,
int PortHandle);

[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall)]
public static extern int BuzzerAndLEDControl(ref byte ConAddr,
byte BuzzerOnTime,
byte BuzzerOffTime,
byte BuzzerActTimes,
byte LEDOnTime,
byte LEDOffTime,
byte LEDFlashTimes,
ref byte IRStatue,
int PortHandle);

求大神帮忙改写成DELPHI的,不知道数据格式对应的是什么
...全文
278 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧