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()); }
public int BytesToRead(byte segmentLength) { _bytesToRead = _dcs.GetCodingScheme() == DCS.Default ? (((segmentLength * 7) >> 3) + ((segmentLength * 7) % 8 > 0 ? 1 : 0)) : segmentLength; return(_bytesToRead); }