You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
designPattern/DesignPattern/Bridge/_4GImplementor.cs

40 lines
644 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bridge
{
class _4GImplementor : INetworkImplementor
{
private byte[] data;
public bool Connect()
{
Console.WriteLine("4G: Connect");
return true;
}
public bool Disconnect()
{
Console.WriteLine("4G: Disconnect");
return true;
}
public byte[] Receive()
{
return data;
}
public void Send(byte[] data)
{
this.data = data;
Console.WriteLine($"4G: Send");
foreach (byte b in data)
{
Console.Write($"{b.ToString("X2")} ");
}
Console.WriteLine();
}
}
}