예제 #1
0
        public PduUdSegment(IPduProfileSettings settings, PduDcsSegment dcs)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("Profile settings not specified.");
            }

            if (dcs == null || dcs.GetCodingScheme() == DCS.Other)
            {
                throw new NotSupportedException("Data coding scheme not supported.");
            }

            _dcs    = dcs;
            _source = settings?.UserData?.Value ?? string.Empty;

            encode(_source, dcs.GetCoder());
        }
예제 #2
0
 public int BytesToRead(byte segmentLength)
 {
     _bytesToRead = _dcs.GetCodingScheme() == DCS.Default ? (((segmentLength * 7) >> 3) + ((segmentLength * 7) % 8 > 0 ? 1 : 0)) : segmentLength;
     return(_bytesToRead);
 }