zoukankan      html  css  js  c++  java
  • 明华 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);

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

  • 相关阅读:
    hdu 1028 Ignatius and the Princess III (n的划分)
    CodeForces
    poj 3254 Corn Fields (状压DP入门)
    HYSBZ 1040 骑士 (基环外向树DP)
    PAT 1071 Speech Patterns (25)
    PAT 1077 Kuchiguse (20)
    PAT 1043 Is It a Binary Search Tree (25)
    PAT 1053 Path of Equal Weight (30)
    c++ 常用标准库
    常见数学问题
  • 原文地址:https://www.cnblogs.com/hehexiaoxia/p/3108107.html
Copyright © 2011-2022 走看看