- cp() copies a file. If the target is a directory, the file is copied
into that directory. It uses a small buffer, so it's not fast.
- ls uses ilistdir and creates a sorted output with directories listed as
the first group.
- rm optionally deletes recursive, if the target is a directory.
Allows `await channel.disconnected()`.
This also fixes a bug where connection._l2cap_channel wasn't being set to
None on disconnect.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This replicates the failure described in #453 (which is fixed by #459.
Also adds a test for subscription.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This allows a server to write a characteristic and automatically
notify/indicate all subscribed clients.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
After a client does a successful `await char.notified()`, then before the
next call to `notified()` a notification arrives, then they call
`notified()` twice before the _next_ notification, the second call will
return None rather than waiting.
This applies the same fix as in 5a86aa5866
which solved a similar problem for server-side `char.written()`. Using
a deque is slightly overkill here, but it's consistent with the server
side, and also makes it very easy to support having a notification queue
in the future.
Also makes the client characteristic properly flags/properties-aware (i.e.
explicitly fail operations that aren't supported).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This fixes a bug where an incoming write before `written` is awaited causes
`written` to return None. It also introduces a mechanism for a server to
"capture" all incoming written values (instead of only having access to the
most recent value).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>