Things
This commit is contained in:
@@ -1,11 +1,37 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace Hardware.Simulators
|
namespace Hardware.Simulators
|
||||||
{
|
{
|
||||||
class BikeSimulator
|
class BikeSimulator
|
||||||
{
|
{
|
||||||
IDataConverter dataConverter;
|
IDataConverter dataConverter;
|
||||||
|
|
||||||
|
public BikeSimulator(IDataConverter dataConverter)
|
||||||
|
{
|
||||||
|
this.dataConverter = dataConverter;
|
||||||
|
}
|
||||||
|
public void StartSimulation()
|
||||||
|
{
|
||||||
|
//4A-09-4E-05-19-16-00-FF-28-00-00-20-F0
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
byte[] array = { 0x19, 0x16, 0x00, 0xFF, 0x28, 0x00, 0x00, 0x20, 0xF0 };
|
||||||
|
|
||||||
|
//0x10 message
|
||||||
|
dataConverter.Bike(array);
|
||||||
|
//0x19 message
|
||||||
|
dataConverter.Bike(array);
|
||||||
|
//Heartbeat message
|
||||||
|
dataConverter.BPM(array);
|
||||||
|
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace FietsDemo
|
|||||||
{
|
{
|
||||||
internal class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
/*static void Main(string[] args)
|
||||||
{
|
{
|
||||||
foo foo = new foo();
|
foo foo = new foo();
|
||||||
//BLEReceiver bLEReceiver = new BLEReceiver(foo);
|
//BLEReceiver bLEReceiver = new BLEReceiver(foo);
|
||||||
@@ -19,7 +19,7 @@ namespace FietsDemo
|
|||||||
|
|
||||||
//bLEReceiver.ConnectToBLE();
|
//bLEReceiver.ConnectToBLE();
|
||||||
Console.Read();
|
Console.Read();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
interface IFoo
|
interface IFoo
|
||||||
{
|
{
|
||||||
@@ -79,6 +79,13 @@ namespace FietsDemo
|
|||||||
Console.Read();
|
Console.Read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* public async void ConnectToSimulation()
|
||||||
|
{
|
||||||
|
BikeSimulator bikeSimulator = new BikeSimulator();
|
||||||
|
bikeSimulator.StartSimulation(foo);
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
private void BleBike_SubscriptionValueChanged(object sender, BLESubscriptionValueChangedEventArgs e)
|
private void BleBike_SubscriptionValueChanged(object sender, BLESubscriptionValueChangedEventArgs e)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Received from {0}: {1}, {2}", e.ServiceName,
|
//Console.WriteLine("Received from {0}: {1}, {2}", e.ServiceName,
|
||||||
|
|||||||
@@ -1,10 +1,19 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Hardware;
|
||||||
|
using Hardware.Simulators;
|
||||||
|
|
||||||
namespace ProftaakRH
|
namespace ProftaakRH
|
||||||
{
|
{
|
||||||
class Main
|
class Program
|
||||||
{
|
{
|
||||||
|
static void Main(string[] agrs)
|
||||||
|
{
|
||||||
|
IDataConverter dataConverter = new DataConverter();
|
||||||
|
BikeSimulator bikeSimulator = new BikeSimulator(dataConverter);
|
||||||
|
bikeSimulator.StartSimulation();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user