コード例 #1
0
        private void buttonRead_Click(object sender, EventArgs e)
        {
            textBoxReadValue.Text = "";
            textBoxSc.Text        = "";
            textBoxIDm.Text       = "";

            bool ret;

            ret = mFNS.pollingF();
            if (!ret)
            {
                MessageBox.Show("Polling fail");
                return;
            }
            textBoxIDm.Text = BitConverter.ToString(mFNS.NfcId);
            textBoxSc.Text  = mLite.SystemCode.ToString("x4");

            UInt16 block;

            if (comboBoxReadBlock.SelectedIndex <= 14)
            {
                // 0~14
                block = (UInt16)comboBoxReadBlock.SelectedIndex;
            }
            else if (comboBoxReadBlock.SelectedIndex <= 23)
            {
                // 15~23
                block = (UInt16)(NfcStarterKitWrap.FelicaLite.BLOCK_RC + comboBoxReadBlock.SelectedIndex - 15);
            }
            else if (comboBoxReadBlock.SelectedIndex <= 26)
            {
                // 24~26
                block = (UInt16)(NfcStarterKitWrap.FelicaLite.BLOCK_WCNT + comboBoxReadBlock.SelectedIndex - 24);
            }
            else
            {
                block = NfcStarterKitWrap.FelicaLite.BLOCK_CRC_CHECK;
            }

            byte[] rbuf = null;
            ret = mLite.Read(ref rbuf, block);
            mFNS.unpoll();
            if (!ret)
            {
                MessageBox.Show("Read fail");
                return;
            }
            textBoxReadValue.Text = BitConverter.ToString(rbuf);
        }
コード例 #2
0
        private bool polling()
        {
            bool b = mFNS.pollingF();

            if (b)
            {
                if ((mFNS.NfcId[0] == 0x03) &&
                    (mFNS.NfcId[1] == 0xfe) &&
                    (mFNS.NfcId[2] == 0x00) &&
                    (mFNS.NfcId[3] == 0x1d))
                {
                    // OK
                }
                else
                {
                    b = false;
                }
            }
            if (!b)
            {
                mFNS.unpoll();
            }
            return(b);
        }
コード例 #3
0
        /// <summary>
        /// 事前処理
        /// </summary>
        /// <returns></returns>
        private bool prevProc()
        {
            bool ret = mFNS.pollingF();

            return(ret);
        }