aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Transport/ITransportEncoder.cs
blob: c0e4debbe801f077402f05ef1c3f653de79abdb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PMR;
using Tango.PMR.Common;

namespace Tango.Transport
{
    /// <summary>
    /// Represents a Transport message encoder capable of encoding or decoding <see cref="ITangoMessage">Tango Messages</see>.
    /// </summary>
    public interface ITransportEncoder
    {
        /// <summary>
        /// Encodes the specified tango message.
        /// </summary>
        /// <param name="tangoMessage">The tango message.</param>
        /// <returns></returns>
        byte[] Encode(ITangoMessage tangoMessage);

        /// <summary>
        /// Decodes the specified data to an <see cref="ITangoMessage"/>.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        ITangoMessage Decode(byte[] data);

        /// <summary>
        /// Decodes only the <see cref="MessageContainer"/> part of the message.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <returns></returns>
        MessageContainer DecodeContainer(byte[] data);
    }
}
<Grid controls:NavigationControl.NavigationName="FirmwareCompletedView"> <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> <touch:TouchIcon Icon="Check" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="70" Height="70" /> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 10 0 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoHeaderFontSize}">Machine is ready!</TextBlock> <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding CompleteCommand}">RESTART</touch:TouchButton> </StackPanel> </Grid> <Grid controls:NavigationControl.NavigationName="FirmwareFailedView"> <StackPanel HorizontalAlignment="Center" Margin="0 50 0 0"> <touch:TouchIcon Icon="AlertOctagon" Foreground="{StaticResource TangoErrorBrush}" Width="70" Height="70" /> <TextBlock TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 10 0 0" FontSize="{StaticResource TangoTitleFontSize}"> <Run>Firmware upgrade failed.</Run> <LineBreak/> <Run Text="{Binding Status,Mode=OneWay}"></Run> <LineBreak/> <Run>Tap 'try again' to restart the process.</Run> </TextBlock> <touch:TouchButton Margin="0 200 0 0" Padding="20" Width="300" CornerRadius="35" Command="{Binding TryAgainCommand}">TRY AGAIN</touch:TouchButton> </StackPanel> </Grid> </controls:NavigationControl> </DockPanel> </Grid> </Grid> </UserControl>