Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
François Revol
firmware
Commits
21492497
Commit
21492497
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
doc(ble): Update when OSErrors are raised
parent
bd31fa5c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/pycardium/ble_hid.rst
+3
-2
3 additions, 2 deletions
Documentation/pycardium/ble_hid.rst
pycardium/modules/py/ble_hid.py
+2
-2
2 additions, 2 deletions
pycardium/modules/py/ble_hid.py
with
5 additions
and
4 deletions
Documentation/pycardium/ble_hid.rst
+
3
−
2
View file @
21492497
...
...
@@ -15,7 +15,6 @@ The ``ble_hid`` module provides access to the BLE Human Interface Device functio
paired to the host computer. If you want to connect your card10 to a phone again,
you might have to temporarily turn off Bluetooth on your computer.
An example application can be found in the preload directory (named ``HID Demo``). It provides
examples how to use the card10 as keyboard, mouse or volume control.
...
...
@@ -80,7 +79,9 @@ A more complete version of this example can be found in the HID Demo app on your
elif b_new == buttons.BOTTOM_LEFT:
m.click(Mouse.LEFT_BUTTON)
.. note::
Make sure to catch ``OSError`` exceptions in real applications. The exception will be thrown if
there is connection to the host (or if it is lost) and you want to send an event.
.. automodule:: ble_hid
...
...
This diff is collapsed.
Click to expand it.
pycardium/modules/py/ble_hid.py
+
2
−
2
View file @
21492497
...
...
@@ -59,8 +59,8 @@ class Report:
:param data: The data to be sent. Must not exceed the configured length of the report.
:rtype: bool
:returns: `True` if the report was sent, `False` if the report was queued for sending.
:raises OSError: if there is no connection to a host
:raises MemoryError: if there was no space in the queue (only raised if ``blocking`` was set to `False`)
:raises OSError: if there is no connection to a host
or BLE HID is not enabled.
:raises MemoryError: if there was no space in the queue (only raised if ``blocking`` was set to `False`)
.
"""
if
self
.
blocking
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment