Commit graph

7 commits

Author SHA1 Message Date
Christopher Willis-Ford
7daf7143fe style(Win): apply automatic code cleanup 2023-06-01 14:52:19 -07:00
Christopher Willis-Ford
907ea9158e chore: add logging to help debug macOS 10/11 issues 2023-01-13 08:21:38 -08:00
Christopher Willis-Ford
9032a013c8 fix(common): remove EventAwaiter(EventHandler<T>, ...
Turns out that C# doesn't actually let you do this. It compiles and
runs, but just silently fails to hook the event. Something to do with
the EventHandler delegate magic... maybe a "+= on a struct" kind of
thing?
2023-01-13 08:21:37 -08:00
Christopher Willis-Ford
953144379d Mac: misc reliability improvements
An `EventAwaiter` timeout now throws a `TimeoutException` instead of a
`TaskCanceledException`.

Disconnecting a micro:bit while subscribed for change notifications was
causing an exception because a notification was being triggered after
the socket closed. Fixing that led to an attempt to close the socket
after it was closed and set to `null`. That one was solved with a null
check.

For BT, connection is still not reliable but it's a step in the right
direction... I think. The socket lock is now held while opening the
RFCOMM channel, which is an awful long time to hold a lock, but really
no other thread should be messing with the socket during that time so I
guess it's the right thing to do. I also added debug printouts on the
RFCOMM event delegate.
2023-01-13 08:21:37 -08:00
Christopher Willis-Ford
5312199e6b Mac BT: implement 'connect', remove 'ouiPrefix' 2023-01-13 08:21:36 -08:00
Christopher Willis-Ford
2c9e4c600a fixed usings and namespaces 2023-01-13 08:21:36 -08:00
Christopher Willis-Ford
2897e2d16f begin splitting scratch-link into scratch-link-{common,mac}
Note that this currently doesn't build since the files have not yet been
adapted to the new framework.
2023-01-13 08:21:36 -08:00
Renamed from scratch-link/EventAwaiter.cs (Browse further)