Beispiel #1
0
        public static string DecodePageDataAndVerifyTagID(this byte[] rawPageData, TagContentDecodeMode tagContentDecodeMode, out string tagIDOut)
        {
            tagIDOut = ByteArrayTranscoders.ByteStringTranscoder.Encode(rawPageData);

            switch (tagContentDecodeMode)
            {
            case TagContentDecodeMode.AutoTrimAscii:
                tagIDOut = tagIDOut.Trim(' ', '\0');
                if (!tagIDOut.IsBasicAscii())
                {
                    return("read TagID contains non-Ascii contents");
                }
                break;

            case TagContentDecodeMode.Ascii:
                tagIDOut = tagIDOut.TrimEnd('\0');
                if (!tagIDOut.IsBasicAscii())
                {
                    return("read TagID contains non-Ascii contents");
                }
                break;

            case TagContentDecodeMode.Binary:
                break;

            default:
                return("Unsupported TagContentDecodeMode:{0}".CheckedFormat(tagContentDecodeMode));
            }

            return(string.Empty);
        }
Beispiel #2
0
 public TagRWPartConfig(TagRWPartConfig rhs)
 {
     PartID                  = rhs.PartID;
     DriverType              = rhs.DriverType;
     NumPages                = rhs.NumPages;
     PageDataSize            = rhs.PageDataSize;
     DefaultTagIDStartOffset = rhs.DefaultTagIDStartOffset;
     DefaultTagIDSize        = rhs.DefaultTagIDSize;
     DefaultTagDecodeMode    = rhs.DefaultTagDecodeMode;
 }