-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCubeFactory.cs
More file actions
28 lines (25 loc) · 1.15 KB
/
CubeFactory.cs
File metadata and controls
28 lines (25 loc) · 1.15 KB
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
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Devices.Bluetooth.Advertisement;
namespace virtual_cube
{
class CubeFactory
{
public static Cube CreateCube(BluetoothLEAdvertisementReceivedEventArgs bluetoothLEAdvertisementReceived) {
//if(bluetoothLEAdvertisementReceived.Advertisement.ServiceUuids.Contains(RubiksConnectedCube.SERVICE_UUID))
if(bluetoothLEAdvertisementReceived.Advertisement.LocalName.StartsWith("Rubiks") ||
bluetoothLEAdvertisementReceived.Advertisement.LocalName.StartsWith("GoCube"))
{
Debug.WriteLine($"Adding {bluetoothLEAdvertisementReceived.Advertisement.LocalName} | {Cube.MAC802DOT3(bluetoothLEAdvertisementReceived.BluetoothAddress)} {bluetoothLEAdvertisementReceived.AdvertisementType}");
return new RubiksConnectedCube(
bluetoothLEAdvertisementReceived.Advertisement.LocalName,
bluetoothLEAdvertisementReceived.BluetoothAddress);
}
return null;
}
}
}