Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions ShimmerBLE/ShimmerBLEAPI/Communications/RadioPluginBLE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,27 @@ private void Adapter_DeviceConnected(object sender, DeviceEventArgs e)

private async void Adapter_DeviceDisconnected(object sender, DeviceEventArgs e)
{
if (CommunicationEvent != null && e.Device.Id == ConnectedASM.Id)
if (ConnectedASM != null)
{
CommunicationEvent.Invoke(null, new ByteLevelCommunicationEvent { Event = Communications.ByteLevelCommunicationEvent.CommEvent.Disconnected });
if (ConnectedASM != null)
if (CommunicationEvent != null && e.Device.Id == ConnectedASM.Id)
{
await Disconnect();
CommunicationEvent.Invoke(null, new ByteLevelCommunicationEvent { Event = Communications.ByteLevelCommunicationEvent.CommEvent.Disconnected });
if (ConnectedASM != null)
{
await Disconnect();
}
}
}
}

private void Adapter_DeviceConnectionLost(object sender, DeviceEventArgs e)
{
if (CommunicationEvent != null && e.Device.Id == ConnectedASM.Id)
if (ConnectedASM != null)
{
CommunicationEvent.Invoke(null, new ByteLevelCommunicationEvent { Event = Communications.ByteLevelCommunicationEvent.CommEvent.Disconnected });
if (CommunicationEvent != null && e.Device.Id == ConnectedASM.Id)
{
CommunicationEvent.Invoke(null, new ByteLevelCommunicationEvent { Event = Communications.ByteLevelCommunicationEvent.CommEvent.Disconnected });
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion ShimmerBLE/ShimmerBLEAPI/PlotManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ private void PlotOjc(ObjectCluster ojc)
lineSeries.Points.RemoveAt(0);
lineSeries.Points.Add(new DataPoint(ts, yData));
}
count++;
}
count++;
}
PlotModel.InvalidatePlot(true);
Thread.Sleep(25);
Expand Down