Skip to content

Commit 8d3bb72

Browse files
committed
Fix plugin compilation errors and some minor changes
1 parent daf4620 commit 8d3bb72

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535
with:
3636
github_token: ${{ secrets.GITHUB_TOKEN }}
3737
# Default Doxyfile build documentation to html directory.
38-
# Change the directory if changes in Doxyfile
38+
# Overrides the directory specified in Doxyfile
3939
publish_dir: ./doc/html

Assets/Systemic/Examples/Scripts/BleConsole.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ IEnumerator Start()
3737
yield return null;
3838

3939
Debug.Log("Waiting for Central to be ready...");
40-
while (!Central.IsReady)
40+
while (Central.Status != BluetoothStatus.Ready)
4141
{
4242
yield return null;
4343
}
@@ -49,15 +49,15 @@ IEnumerator Start()
4949
Debug.Log("Scanning for Pixels...");
5050

5151
// Filter peripherals with the Pixel service UUID
52-
Central.ScanForPeripheralsWithServices(new[] { PixelBleUuids.Service });
52+
Central.StartScanning(new[] { PixelBleUuids.Service });
5353

5454
// Wait until a Pixel is found
5555
while (Central.ScannedPeripherals.Length == 0)
5656
{
5757
yield return null;
5858
}
5959

60-
Central.StopScan();
60+
Central.StopScanning();
6161

6262
Debug.Log($"Found {Central.ScannedPeripherals.Length} Pixels");
6363

Assets/Systemic/Examples/Scripts/BleController.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,18 @@ void OnDisable()
8282
void Update()
8383
{
8484
// Update buttons intractability based on Bluetooth state
85-
_startScanBtn.interactable = Central.IsReady && !Central.IsScanning;
86-
_stopScanBtn.interactable = Central.IsReady && Central.IsScanning;
87-
_connectBtn.interactable = Central.IsReady && (Central.ScannedPeripherals.Length > 0) && (!_peripheralIsConnected);
88-
_shutdownBtn.interactable = Central.IsReady;
85+
bool isReady = Central.Status == BluetoothStatus.Ready;
86+
_startScanBtn.interactable = isReady && !Central.IsScanning;
87+
_stopScanBtn.interactable = isReady && Central.IsScanning;
88+
_connectBtn.interactable = isReady && (Central.ScannedPeripherals.Length > 0) && (!_peripheralIsConnected);
89+
_shutdownBtn.interactable = isReady;
8990
foreach (var btn in _operationsBtn)
9091
{
91-
btn.interactable = Central.IsReady && (_peripheral != null) && _peripheralIsConnected;
92+
btn.interactable = isReady && (_peripheral != null) && _peripheralIsConnected;
9293
}
9394

9495
// Update status text
95-
_statusText.text = Central.IsReady ? (Central.IsScanning ? "Scanning" : "Ready") : "Unavailable";
96+
_statusText.text = isReady ? (Central.IsScanning ? "Scanning" : "Ready") : "Unavailable";
9697
if (Central.ScannedPeripherals.Length > 0)
9798
{
9899
_statusText.text += $"- Found {Central.ScannedPeripherals.Length} Pixel(s)";
@@ -115,15 +116,15 @@ void Update()
115116
public void StartScan()
116117
{
117118
// Filter peripherals with the Pixel service UUID
118-
Central.ScanForPeripheralsWithServices(new[] { PixelBleUuids.Service });
119+
Central.StartScanning(new[] { PixelBleUuids.Service });
119120
}
120121

121122
/// <summary>
122123
/// Stops an on-going scan, if any.
123124
/// </summary>
124125
public void StopScan()
125126
{
126-
Central.StopScan();
127+
Central.StopScanning();
127128
}
128129

129130
/// <summary>

Assets/Systemic/Examples/Scripts/UIPixelPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void AttachToPixel(Pixel pixel)
9797
if (Pixel != pixel)
9898
{
9999
Pixel = pixel;
100-
Pixel.ConnectionStateChanged += (pixel, oldState, newState) =>
100+
Pixel.ConnectionStateChanged += (pixel, newState) =>
101101
{
102102
if (newState == PixelConnectionState.Ready)
103103
{

Assets/Systemic/Tests/CentralTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ IEnumerator WaitUntilWithTimeout(Func<bool> condition, float timeoutSec = 5)
2525

2626
IEnumerator WaitCentralReady()
2727
{
28-
yield return WaitUntilWithTimeout(() => Central.IsReady);
29-
Assert.IsTrue(Central.IsReady, "Central not ready");
28+
yield return WaitUntilWithTimeout(() => Central.Status == BluetoothStatus.Ready);
29+
Assert.IsTrue(Central.Status == BluetoothStatus.Ready, "Central not ready");
3030
}
3131

3232
IEnumerator SelectPeripheral()
3333
{
34-
Central.ScanForPeripheralsWithServices(new[] { PixelBleUuids.Service });
34+
Central.StartScanning(new[] { PixelBleUuids.Service });
3535
yield return WaitUntilWithTimeout(() =>
3636
{
3737
_peripheral = Central.ScannedPeripherals.FirstOrDefault(p => p.Services.Contains(PixelBleUuids.Service));
3838
return _peripheral != null;
3939
});
40-
Central.StopScan();
40+
Central.StopScanning();
4141
Assert.NotNull(_peripheral, "No Pixel peripheral found");
4242
}
4343

WinRTBle/src/LibWinRTBle/Systemic/BluetoothLE/Scanner.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Systemic::BluetoothLE
2626
using BluetoothLEAdvertisementWatcherStoppedEventArgs = winrt::Windows::Devices::Bluetooth::Advertisement::BluetoothLEAdvertisementWatcherStoppedEventArgs;
2727

2828
// Watcher and its event tokens
29-
BluetoothLEAdvertisementWatcher _watcher{ nullptr };
29+
BluetoothLEAdvertisementWatcher _watcher{};
3030
winrt::event_token _receivedToken{};
3131
winrt::event_token _stoppedToken{};
3232

@@ -55,7 +55,6 @@ namespace Systemic::BluetoothLE
5555
std::function<void(std::shared_ptr<ScannedPeripheral>)> peripheralDiscovered,
5656
std::vector<winrt::guid> services = std::vector<winrt::guid>{})
5757
:
58-
_watcher{},
5958
_requestedServices{ services },
6059
_onPeripheralDiscovered{ peripheralDiscovered }
6160
{

0 commit comments

Comments
 (0)