Skip to content
Snippets Groups Projects
Commit 21492497 authored by schneider's avatar schneider
Browse files

doc(ble): Update when OSErrors are raised

parent bd31fa5c
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,6 @@ The ``ble_hid`` module provides access to the BLE Human Interface Device functio ...@@ -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, 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. 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 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. 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 ...@@ -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: elif b_new == buttons.BOTTOM_LEFT:
m.click(Mouse.LEFT_BUTTON) 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 .. automodule:: ble_hid
......
...@@ -59,8 +59,8 @@ class Report: ...@@ -59,8 +59,8 @@ class Report:
:param data: The data to be sent. Must not exceed the configured length of the report. :param data: The data to be sent. Must not exceed the configured length of the report.
:rtype: bool :rtype: bool
:returns: `True` if the report was sent, `False` if the report was queued for sending. :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 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`) :raises MemoryError: if there was no space in the queue (only raised if ``blocking`` was set to `False`).
""" """
if self.blocking: if self.blocking:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment