Пример #1
0
        /// <summary>
        /// Write a single 16-bit register.
        /// </summary>
        /// <param name="rtReg">Register to write, <seealso cref="RTRegs"/>.</param>
        /// <param name="wValue">Value to write.</param>
        /// <remarks>
        /// <para>See also: <seealso cref="Secured"/>, <seealso cref="Password"/></para>
        /// <para>The data to write is internally converted to the tag's big-endian format so there is no need for additional conversions.</para>
        /// </remarks>
        /// <exception cref="NurApiException">
        /// <para>This exception is thrown when the underlying physical write fails.</para>
        /// <para>Exception can also be thrown if the tag reports an error e.g. "out of range"</para>
        /// </exception>
        public void WriteShortReg(uint rtReg, ushort wValue)
        {
            RTConst.RegRangeCheck(rtReg, "WriteShortReg", RTConst.RW_16BIT);

            byte[] b;

            b = RTConverters.UInt16ToBytes(wValue);

            WriteTag(mPassword, mSecured, NurApi.BANK_USER, rtReg, b);
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="offset"></param>
 /// <param name="wData"></param>
 public void SetReservedExtra(uint offset, ushort wData)
 {
     byte[] bData = RTConverters.UInt16ToBytes(wData);
     WriteTag(mPassword, mSecured, NurApi.BANK_PASSWD, RTConst.PASSWD_EXTRA_ADDR + offset, bData);
 }