• 明华 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);
      /// <summary>
      ///鸣叫
      /// </summary>
      /// <param name="icdev"></param>
      /// <param name="banben"></param>
      /// <returns></returns>
      [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);
      /// <summary>
      ///射频读写模式复位
      /// </summary>
      /// <param name="icdev"></param>
      /// <param name="banben"></param>
      /// <returns></returns>
      [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);
      /// <summary>
      /// 寻卡
      /// </summary>
      /// <param name="icdev"></param>
      /// <param name="m"></param>
      /// <param name="kahao"></param>
      /// <returns></returns>
      [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);

      /*----------------------卡操作-----------------------------------*/

  • 相关阅读:
    通过盘古分词自定义规则功能实现软件版本号的提取
    Js event事件在IE、FF兼容性问题
    Android动画效果 translate、scale、alpha、rotate 切换Activity动画 控件位置调整
    iPhone代码片段收集(持续更新)
    Activity之间的相互调用与传递参数
    android如何拍照以及返回拍的图片(经过验证的实际例子)
    Android API :SMS短信服务处理和获取联系人
    实现Android的消息通知栏
    iPhone开发 调用摄像头进行拍照等操作
    Android模拟 HTTP multipart/formdata 请求协议信息实现图片上传
  • 原文地址:https://www.cnblogs.com/hehexiaoxia/p/3108107.html
Copyright © 2020-2023  润新知