src/UWP.Samples.AsyncResponseFromSerialDevice/RequestPackage.cs
/// <summary>
/// Gets bytes of the package.
/// </summary>
Gets bytes of the package.
Gets bytes of the package .
public byte[] GetBytes()
        {
            var bytes = new List<byte>();
            bytes.Add(0xfe);             
            bytes.AddRange(BitConverter.GetBytes(this.Id));
            bytes.AddRange(this.Data);
            bytes.Add(0xff); 
            return bytes.ToArray();
        }
public byte [ ] GetBytes ( ) { var bytes = new List < byte > ( ) ; bytes . Add ( 0xfe ) ; bytes . AddRange ( BitConverter . GetBytes ( this . Id ) ) ; bytes . AddRange ( this . Data ) ; bytes . Add ( 0xff ) ; return bytes . ToArray ( ) ; }
Gets bytes of the package.
Gets bytes of the package .
// For example, packages have a following format: // [0xfe][PackageId][Data][0xff]