明华 mwrf32 相关Api文档
[DllImport("mwrf32.dll", EntryPoint = "rf_init", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_init(Int16 port, long baud);
//取得读写器硬件版本号
[DllImport("mwrf32.dll", EntryPoint = "rf_get_status", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_get_status(Int16 icdev, byte* banben);
///
///鸣叫
///
///
///
///
[DllImport("mwrf32.dll", EntryPoint = "rf_beep", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_beep(Int16 icdev, int m);
///
///射频读写模式复位
///
///
///
///
[DllImport("mwrf32.dll", EntryPoint = "rf_reset", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_reset(Int16 icdev, int m);
//将密码装入读写模块RAM块中
[DllImport("mwrf32.dll", EntryPoint = "rf_load_key", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_load_key(Int16 icdev, byte passordmode, byte sector, byte[] passord);
//向读写器装入十六进制密码
[DllImport("mwrf32.dll", EntryPoint = "rf_load_key_hex", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_load_key_hex(int icdev, byte passordmode, byte sector, string w_passord);
//断开与读卡器的连接
[DllImport("mwrf32.dll", EntryPoint = "rf_exit", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_exit(Int16 icdev);
/*----------------------读写器操作-----------------------------------*/
/*----------------------卡操作-----------------------------------*/
//返回卡的序列号---- 防冲突
[DllImport("mwrf32.dll", EntryPoint = "rf_anticoll", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_anticoll(Int16 icdev, byte m, ulong* kahao);
//返回卡的序列号---- 寻卡
[DllImport("mwrf32.dll", EntryPoint = "rf_card", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_card(Int16 icdev, byte m, out ulong kahao);
///
/// 寻卡
///
///
///
///
///
[DllImport("mwrf32.dll", EntryPoint = "rf_request", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_request(Int16 icdev, Int16 m, uint* kahao);
//初始化块值---在进行值操作时,必须先执行初始化值函数,然后才可以读、减、加的操作
[DllImport("mwrf32.dll", EntryPoint = "rf_initval", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_initval(int icdev, int mode, byte date);
//读块值
[DllImport("mwrf32.dll", EntryPoint = "rf_initval", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_initval(Int16 icdev, Int16 adr, ulong date);
//读取卡中数据
[DllImport("mwrf32.dll", EntryPoint = "rf_read", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_read(Int16 icdev, byte mode, byte[] date);
//向卡中写数据
[DllImport("mwrf32.dll", EntryPoint = "rf_write", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_write(Int16 icdev, byte mode, byte[] date);
//验证卡某一扇区密码
[DllImport("mwrf32.dll", EntryPoint = "rf_authentication", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_authentication(Int16 icdev, byte mode, byte SecNr);
//检测指定数据是否与卡中数据一致
[DllImport("mwrf32.dll", EntryPoint = "rf_check_write", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_check_write(Int16 icdev, int snr, int authmode, int adr, byte date);
//终止该卡操作
[DllImport("mwrf32.dll", EntryPoint = "rf_halt", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern Int16 rf_halt(int icdev);
/*----------------------卡操作-----------------------------------*/
转载于:https://www.cnblogs.com/hehexiaoxia/archive/2013/05/30/3108107.html
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
