Exemple #1
0
        async Task MakeResponseAndSend(Message request, CancellationToken cancellationToken)
        {
            var response = new Message
            {
                Destination = request.Source,
                Source      = MyAddress,
                Command     = request.Command,
                Data        = new byte[] { UpFreq, DnFreq, StokeLength, StokeRate, Status.Byte },
            };

            Story.Add(new MessageStoryItem(MessageStoryItem.Direction.Tx, response));
            var stream = await streamSource.GetStreamAsync();

            await stream.WriteAsync(response.Buffer, 0, response.FullLengthWithCrc, cancellationToken);
        }