private void ByteArrToUshort(byte[] src, ushort[] dest, int destOffset) { int i; for (i = 0; i < src.Length; i += 2) { dest[destOffset++] = RTConverters.BytesToUInt16(src, i); } }
/// <summary> /// Read a 16-bit register. /// </summary> /// <param name="rtReg">Register value to read, <seealso cref="RTRegs"/>.</param> /// <returns>This call returns the 16-bit value of the register.</returns> /// <remarks>NOTE: this result is internally converted to little-endian format; no need to re-convert.</remarks> /// <exception cref="NurApiException"> /// <para>This exception is thrown when the underlying physical read fails.</para> /// <para>Exception can also be thrown if the tag reports an error e.g. "out of range"</para> /// </exception> public ushort ReadShortReg(uint rtReg) { RTConst.RegRangeCheck(rtReg, "ReadShortReg", RTConst.RW_16BIT); byte[] b; b = ReadTag(mPassword, mSecured, NurApi.BANK_USER, rtReg, 2); return(RTConverters.BytesToUInt16(b)); }
/// <summary> /// /// </summary> /// <param name="offset"></param> /// <returns></returns> public ushort GetReservedExtra(uint offset) { byte [] bData = ReadTag(mPassword, mSecured, NurApi.BANK_PASSWD, RTConst.PASSWD_EXTRA_ADDR + offset, 2); return(RTConverters.BytesToUInt16(bData)); }