/// <summary> /// Pollingを実行する /// </summary> /// <param name="polling"></param> /// <param name="numOfCard"></param> /// <param name="cardInformation"></param> /// <returns></returns> public static bool PollingAndGetCardInformation( ref StructurePolling polling, ref byte numOfCard, ref StructureCardInformation cardInformation) { return(polling_and_get_card_information( ref polling, ref numOfCard, ref cardInformation) == TRUE); }
/// <summary> /// Idmの読み出し /// </summary> /// <param name="sysCode">システムコード</param> /// <param name="idm">Idm(idm)</param> /// <returns>成功?</returns> public static bool ReadIdm(ushort sysCode, byte[] idm) { HandleContainer hc = new HandleContainer(); try { //取得対象 byte[] sysCodeBuffer = new byte[2]; BigEndian.SetUIntToBytes(sysCode, sysCodeBuffer, 0); StructurePolling polling = new StructurePolling(); polling.TimeSlot = 0x00;//同時に検出できる枚数=1 polling.SystemCode = hc.AddPinnedObject(sysCodeBuffer).AddrOfPinnedObject(); //出力バッファ byte[] idmBuffer = new byte[8]; byte[] pmmBuffer = new byte[8]; StructureCardInformation card = new StructureCardInformation(); card.CardIdm = hc.AddPinnedObject(idmBuffer).AddrOfPinnedObject(); card.CardPmm = hc.AddPinnedObject(pmmBuffer).AddrOfPinnedObject(); //メモリ固定 byte cards = new Byte(); hc.AddPinnedObject(cards); bool res = felica_dll.PollingAndGetCardInformation(ref polling, ref cards, ref card); if (res && cards > 0) { //取得したIdmを返す idmBuffer.CopyTo(idm, 0); return(true); } return(false); } finally { //GC除外メモリの解放 hc.FreeHandle(); } }
protected static extern byte polling_and_get_card_information( [In] ref StructurePolling polling, ref byte num_of_cards, [In, Out] ref StructureCardInformation card_information);