This repository was archived by the owner on Apr 5, 2020. It is now read-only.
WinRT -> BlueTooth, USB allowing multiple Brick connections, any name. New event when brick disconnected#14
Open
BananaScheriff wants to merge 9 commits intoBrianPeek:masterfrom
Open
Conversation
Added:
private readonly string _deviceName;
private readonly string _deviceId;
ConnectAsyncInternal():
DeviceInformation brick = (from d in devices where d.Id == _deviceId select d).FirstOrDefault();
making possible connecting to selected USB device, not first one.
Added: public event EventHandler<BrickDisconnectedEventArgs> BrickDisconnected; implementing changed version of ICommunication allowing to detecd when brick disconnected, not used in USB
Added:
private readonly string _deviceName;
private readonly string _deviceId;
public event EventHandler<BrickDisconnectedEventArgs> BrickDisconnected;
ConnectAsyncInternal():
DeviceInformation device = (from d in devices where d.Id == _deviceId select d).FirstOrDefault()
PollInput(IAsyncAction operation):
catch(System.Exception)
{
if (BrickDisconnected != null)
BrickDisconnected.Invoke(this, new BrickDisconnectedEventArgs() {Details = "Brick disconnected due to unexpected behavior" });
}
Allowing connecting to selected BT device, not only with name "EV3".
Added event fired, when connected brick is disconnected, allowing to make back-up plan in case of disconnecting instead of app crashing bug.
Same as with BT, wasnt using, so dont know if it can connect to multiple bricks at one, note made it work that way.
public ICommunication _comm { get; set; }
its now public!
You can get my events to fire in Your app! Rejoice!
added my event args, dont know why, they feel useless
Added:
event EventHandler<BrickDisconnectedEventArgs> BrickDisconnected;
Event allowing developer to handle unexpected disconnection of brick.
GetDevices returning all devices capable of connecting(not implemented everywhere, BT,USB in WinRT)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Well see my changes and rate ^_^ Needed these changes for my engineer app, so thought about sharing now that I know they work.
Instead of choosing only first device in USB/BT, let user choose what device to connect by selecting it with known ID and Name. Also enable to connect to same named bricks as ID is always different .
Made _comm public, for easier access to event placed in Communations.
Enabling with BrickDosconnected to handle disconnection. For example, reconnecting or moving to mainPage instead of crashing - what often happened.