bleio: API change to create and connect related objects simulatenously: no orphan bleio objects
This commit is contained in:
parent
a72bcab0fd
commit
19c59b41ed
41
locale/ID.po
41
locale/ID.po
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -437,18 +437,6 @@ msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -524,10 +512,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Tidak bisa menyesuaikan data ke dalam paket advertisment"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -565,7 +549,7 @@ msgstr ""
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr ""
|
||||
@ -588,6 +572,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -864,7 +849,7 @@ msgstr "Pin-pin tidak valid"
|
||||
msgid "Invalid polarity"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1705,10 +1690,6 @@ msgstr "tidak dapat melakukan relative import"
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1769,10 +1750,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "'except' standar harus terakhir"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2112,7 +2089,6 @@ msgstr ""
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2131,6 +2107,11 @@ msgstr ""
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "modul tidak ditemukan"
|
||||
@ -2218,10 +2199,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -427,18 +427,6 @@ msgstr ""
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -513,10 +501,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -554,7 +538,7 @@ msgstr ""
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr ""
|
||||
@ -577,6 +561,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -849,7 +834,7 @@ msgstr ""
|
||||
msgid "Invalid polarity"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1671,10 +1656,6 @@ msgstr ""
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1735,10 +1716,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2078,7 +2055,6 @@ msgstr ""
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2097,6 +2073,11 @@ msgstr ""
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr ""
|
||||
@ -2183,10 +2164,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
|
||||
"Last-Translator: Pascal Deneaux\n"
|
||||
"Language-Team: Sebastian Plamauer, Pascal Deneaux\n"
|
||||
@ -431,18 +431,6 @@ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Kann nicht ohne MOSI-Pin schreiben."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "Characteristic UUID stimmt nicht mit der Service-UUID überein"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "Characteristic wird bereits von einem anderen Dienst verwendet."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen"
|
||||
@ -517,10 +505,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Zu vielen Daten für das advertisement packet"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "Die Zielkapazität ist kleiner als destination_length."
|
||||
@ -558,7 +542,7 @@ msgstr "Erwartet ein(e) %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Characteristic wird erwartet"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr "Eine UUID wird erwartet"
|
||||
@ -581,6 +565,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -855,7 +840,7 @@ msgstr "Ungültige Pins"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Ungültige Polarität"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1711,10 +1696,6 @@ msgstr "kann keinen relativen Import durchführen"
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1775,10 +1756,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "Die Standart-Ausnahmebehandlung muss als letztes sein"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2125,7 +2102,6 @@ msgstr "map buffer zu klein"
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2144,6 +2120,11 @@ msgstr "Speicherzuordnung fehlgeschlagen, Zuweisung von %u Bytes"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "Modul nicht gefunden"
|
||||
@ -2230,10 +2211,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2790,6 +2767,12 @@ msgstr ""
|
||||
#~ msgid "Cannot update i/f status"
|
||||
#~ msgstr "Kann i/f Status nicht updaten"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "Characteristic UUID stimmt nicht mit der Service-UUID überein"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "Characteristic wird bereits von einem anderen Dienst verwendet."
|
||||
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Daten sind zu groß für das advertisement packet"
|
||||
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
@ -427,18 +427,6 @@ msgstr ""
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -513,10 +501,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -554,7 +538,7 @@ msgstr ""
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr ""
|
||||
@ -577,6 +561,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -849,7 +834,7 @@ msgstr ""
|
||||
msgid "Invalid polarity"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1671,10 +1656,6 @@ msgstr ""
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1735,10 +1716,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2078,7 +2055,6 @@ msgstr ""
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2097,6 +2073,11 @@ msgstr ""
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr ""
|
||||
@ -2183,10 +2164,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-07-27 11:55-0700\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: @sommersoft, @MrCertainly\n"
|
||||
@ -431,18 +431,6 @@ msgstr ""
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -517,10 +505,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -558,7 +542,7 @@ msgstr ""
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr ""
|
||||
@ -581,6 +565,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -853,7 +838,7 @@ msgstr ""
|
||||
msgid "Invalid polarity"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1675,10 +1660,6 @@ msgstr ""
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1739,10 +1720,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2082,7 +2059,6 @@ msgstr ""
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2101,6 +2077,11 @@ msgstr ""
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr ""
|
||||
@ -2187,10 +2168,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
54
locale/es.po
54
locale/es.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-08-24 22:56-0500\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
@ -435,18 +435,6 @@ msgstr "No se puede obtener inequívocamente sizeof escalar"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "No se puede escribir sin pin MOSI."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "Características UUID no concide con el Service UUID"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "Características ya esta en uso por otro Serivice"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "CharateristicBuffer escritura no proporcionada"
|
||||
@ -521,10 +509,6 @@ msgstr "Trozo de datos debe seguir fmt chunk"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Data es muy grande para el paquete de advertisement."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "Capacidad de destino es mas pequeña que destination_length."
|
||||
@ -562,7 +546,7 @@ msgstr "Se espera un %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Se esperaba una Característica."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr "Se esperaba un UUID"
|
||||
@ -585,6 +569,7 @@ msgstr "Fallo enviando comando"
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "No se puede adquirir el mutex, status: 0x%08lX"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -860,7 +845,7 @@ msgstr "pines inválidos"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Polaridad inválida"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1723,10 +1708,6 @@ msgstr "no se puedo realizar importación relativa"
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr "characteristics incluye un objeto que no es una Characteristica"
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "chars buffer es demasiado pequeño"
|
||||
@ -1787,10 +1768,6 @@ msgstr "números decimales no soportados"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "'except' por defecto deberia estar de último"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2135,7 +2112,6 @@ msgstr "map buffer muy pequeño"
|
||||
msgid "math domain error"
|
||||
msgstr "error de dominio matemático"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2154,6 +2130,11 @@ msgstr "la asignación de memoria falló, asignando %u bytes"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "la asignación de memoria falló, el heap está bloqueado"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "módulo no encontrado"
|
||||
@ -2240,10 +2221,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "no hay tal atributo"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2798,6 +2775,12 @@ msgstr "paso cero"
|
||||
#~ msgid "Cannot update i/f status"
|
||||
#~ msgstr "No se puede actualizar i/f status"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "Características UUID no concide con el Service UUID"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "Características ya esta en uso por otro Serivice"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Los datos no caben en el paquete de anuncio."
|
||||
@ -2905,8 +2888,8 @@ msgstr "paso cero"
|
||||
#~ "Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d "
|
||||
#~ "bpp given"
|
||||
#~ msgstr ""
|
||||
#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:"
|
||||
#~ "% d bppdado"
|
||||
#~ "Solo se admiten BMP monocromos, indexados de 8bpp y 16bpp o superiores:% "
|
||||
#~ "d bppdado"
|
||||
|
||||
#~ msgid "Only true color (24 bpp or higher) BMP supported %x"
|
||||
#~ msgstr "Solo color verdadero (24 bpp o superior) BMP admitido %x"
|
||||
@ -2975,6 +2958,9 @@ msgstr "paso cero"
|
||||
#~ msgid "can't set STA config"
|
||||
#~ msgstr "no se puede establecer STA config"
|
||||
|
||||
#~ msgid "characteristics includes an object that is not a Characteristic"
|
||||
#~ msgstr "characteristics incluye un objeto que no es una Characteristica"
|
||||
|
||||
#~ msgid "either pos or kw args are allowed"
|
||||
#~ msgstr "ya sea pos o kw args son permitidos"
|
||||
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
|
||||
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
|
||||
"Language-Team: fil\n"
|
||||
@ -435,18 +435,6 @@ msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Hindi maaring isulat kapag walang MOSI pin."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -524,10 +512,6 @@ msgstr "Dapat sunurin ng Data chunk ang fmt chunk"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Hindi makasya ang data sa loob ng advertisement packet"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -567,7 +551,7 @@ msgstr "Umasa ng %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Hindi mabasa and Characteristic."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
#, fuzzy
|
||||
msgid "Expected a UUID"
|
||||
@ -591,6 +575,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -869,7 +854,7 @@ msgstr "Mali ang pins"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Mali ang polarity"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1731,10 +1716,6 @@ msgstr "hindi maaring isagawa ang relative import"
|
||||
msgid "casting"
|
||||
msgstr "casting"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "masyadong maliit ang buffer"
|
||||
@ -1795,10 +1776,6 @@ msgstr "decimal numbers hindi sinusuportahan"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "default 'except' ay dapat sa huli"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2148,7 +2125,6 @@ msgstr "masyadong maliit ang buffer map"
|
||||
msgid "math domain error"
|
||||
msgstr "may pagkakamali sa math domain"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2167,6 +2143,11 @@ msgstr "nabigo ang paglalaan ng memorya, paglalaan ng %u bytes"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "module hindi nakita"
|
||||
@ -2254,10 +2235,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "walang ganoon na attribute"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
51
locale/fr.po
51
locale/fr.po
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2019-04-14 20:05+0100\n"
|
||||
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
|
||||
"Language-Team: fr\n"
|
||||
@ -441,18 +441,6 @@ msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Impossible d'écrire sans broche MOSI."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "L'UUID de 'Characteristic' ne correspond pas à l'UUID du Service"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "'Characteristic' déjà en utilisation par un autre service"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "Ecriture sur 'CharacteristicBuffer' non fournie"
|
||||
@ -529,10 +517,6 @@ msgstr "Un bloc de données doit suivre un bloc de format"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Données trop volumineuses pour un paquet de diffusion"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "La capacité de destination est plus petite que 'destination_length'."
|
||||
@ -571,7 +555,7 @@ msgstr "Attendu un %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Une 'Characteristic' est attendue"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
#, fuzzy
|
||||
msgid "Expected a UUID"
|
||||
@ -595,6 +579,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Echec de l'obtention de mutex, err 0x%04x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -877,7 +862,7 @@ msgstr "Broches invalides"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Polarité invalide"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1761,10 +1746,6 @@ msgstr "ne peut pas réaliser un import relatif"
|
||||
msgid "casting"
|
||||
msgstr "typage"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr "'characteristics' inclut un objet qui n'est pas une 'Characteristic'"
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "tampon de caractères trop petit"
|
||||
@ -1830,10 +1811,6 @@ msgstr "nombres décimaux non supportés"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "l''except' par défaut doit être en dernier"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2180,7 +2157,6 @@ msgstr "tampon trop petit"
|
||||
msgid "math domain error"
|
||||
msgstr "erreur de domaine math"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2199,6 +2175,11 @@ msgstr "l'allocation de mémoire a échoué en allouant %u octets"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "module introuvable"
|
||||
@ -2287,10 +2268,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "pas de tel attribut"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2854,6 +2831,12 @@ msgstr "'step' nul"
|
||||
#~ msgid "Cannot update i/f status"
|
||||
#~ msgstr "le status i/f ne peut être mis à jour"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "L'UUID de 'Characteristic' ne correspond pas à l'UUID du Service"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "'Characteristic' déjà en utilisation par un autre service"
|
||||
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Données trop volumineuses pour le paquet de diffusion"
|
||||
|
||||
@ -3027,6 +3010,10 @@ msgstr "'step' nul"
|
||||
#~ msgid "can't set STA config"
|
||||
#~ msgstr "impossible de régler la config de 'STA'"
|
||||
|
||||
#~ msgid "characteristics includes an object that is not a Characteristic"
|
||||
#~ msgstr ""
|
||||
#~ "'characteristics' inclut un objet qui n'est pas une 'Characteristic'"
|
||||
|
||||
#~ msgid "either pos or kw args are allowed"
|
||||
#~ msgstr "soit 'pos', soit 'kw' est permis en argument"
|
||||
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
|
||||
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@ -436,18 +436,6 @@ msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Impossibile scrivere senza pin MOSI."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "caratteristico UUID non assomiglia servizio UUID"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "caratteristico già usato da un altro servizio"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "CharacteristicBuffer scritura non dato"
|
||||
@ -525,10 +513,6 @@ msgstr ""
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Impossibile inserire dati nel pacchetto di advertisement."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "La capacità di destinazione è più piccola di destination_length."
|
||||
@ -567,7 +551,7 @@ msgstr "Atteso un %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Non è possibile aggiungere Characteristic."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
#, fuzzy
|
||||
msgid "Expected a UUID"
|
||||
@ -591,6 +575,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -870,7 +855,7 @@ msgstr "Pin non validi"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Polarità non valida"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1722,10 +1707,6 @@ msgstr "impossibile effettuare l'importazione relativa"
|
||||
msgid "casting"
|
||||
msgstr "casting"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "buffer dei caratteri troppo piccolo"
|
||||
@ -1788,10 +1769,6 @@ msgstr "numeri decimali non supportati"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "'except' predefinito deve essere ultimo"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2141,7 +2118,6 @@ msgstr "map buffer troppo piccolo"
|
||||
msgid "math domain error"
|
||||
msgstr "errore di dominio matematico"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2160,6 +2136,11 @@ msgstr "allocazione di memoria fallita, allocando %u byte"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "allocazione di memoria fallita, l'heap è bloccato"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "modulo non trovato"
|
||||
@ -2248,10 +2229,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "attributo inesistente"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2809,6 +2786,12 @@ msgstr "zero step"
|
||||
#~ msgid "Cannot update i/f status"
|
||||
#~ msgstr "Impossibile aggiornare status di i/f"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "caratteristico UUID non assomiglia servizio UUID"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "caratteristico già usato da un altro servizio"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Impossibile inserire dati nel pacchetto di advertisement."
|
||||
|
51
locale/pl.po
51
locale/pl.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
|
||||
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
|
||||
"Language-Team: pl\n"
|
||||
@ -430,18 +430,6 @@ msgstr "Wielkość skalara jest niejednoznaczna"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Nie można pisać bez nóżki MOSI."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "UUID charakterystyki inny niż UUID serwisu"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "Charakterystyka w użyciu w innym serwisie"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "Pisanie do CharacteristicBuffer niewspierane"
|
||||
@ -516,10 +504,6 @@ msgstr "Fragment danych musi następować po fragmencie fmt"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Zbyt dużo danych pakietu rozgłoszeniowego"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "Pojemność celu mniejsza od destination_length."
|
||||
@ -557,7 +541,7 @@ msgstr "Oczekiwano %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Oczekiwano charakterystyki"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr "Oczekiwano UUID"
|
||||
@ -580,6 +564,7 @@ msgstr ""
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Nie udało się uzyskać blokady, błąd 0x$04x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -854,7 +839,7 @@ msgstr "Złe nóżki"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Zła polaryzacja"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1695,10 +1680,6 @@ msgstr "nie można wykonać relatywnego importu"
|
||||
msgid "casting"
|
||||
msgstr "rzutowanie"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr "charakterystyki zawierają obiekt, który nie jest typu Characteristic"
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "bufor chars zbyt mały"
|
||||
@ -1759,10 +1740,6 @@ msgstr "liczby dziesiętne nieobsługiwane"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "domyślny 'except' musi być ostatni"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2103,7 +2080,6 @@ msgstr "bufor mapy zbyt mały"
|
||||
msgid "math domain error"
|
||||
msgstr "błąd domeny"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2122,6 +2098,11 @@ msgstr "alokacja pamięci nie powiodła się, alokowano %u bajtów"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "alokacja pamięci nie powiodła się, sterta zablokowana"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "brak modułu"
|
||||
@ -2208,10 +2189,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "nie ma takiego atrybutu"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2743,6 +2720,12 @@ msgstr "zerowy krok"
|
||||
#~ msgid "Can't connect in Peripheral mode"
|
||||
#~ msgstr "Nie można się łączyć w trybie Peripheral"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "UUID charakterystyki inny niż UUID serwisu"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "Charakterystyka w użyciu w innym serwisie"
|
||||
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego"
|
||||
|
||||
@ -2799,6 +2782,10 @@ msgstr "zerowy krok"
|
||||
#~ msgid "bad GATT role"
|
||||
#~ msgstr "zła rola GATT"
|
||||
|
||||
#~ msgid "characteristics includes an object that is not a Characteristic"
|
||||
#~ msgstr ""
|
||||
#~ "charakterystyki zawierają obiekt, który nie jest typu Characteristic"
|
||||
|
||||
#~ msgid "interval not in range 0.0020 to 10.24"
|
||||
#~ msgstr "przedział poza zakresem 0.0020 do 10.24"
|
||||
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2018-10-02 21:14-0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
@ -432,18 +432,6 @@ msgstr ""
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Não é possível ler sem um pino MOSI"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr ""
|
||||
@ -520,10 +508,6 @@ msgstr "Pedaço de dados deve seguir o pedaço de cortes"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Não é possível ajustar dados no pacote de anúncios."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr ""
|
||||
@ -562,7 +546,7 @@ msgstr "Esperado um"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Não é possível adicionar Característica."
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
#, fuzzy
|
||||
msgid "Expected a UUID"
|
||||
@ -586,6 +570,7 @@ msgstr "Falha ao enviar comando."
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Não é possível ler o valor do atributo. status: 0x%02x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, fuzzy, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -863,7 +848,7 @@ msgstr "Pinos inválidos"
|
||||
msgid "Invalid polarity"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1695,10 +1680,6 @@ msgstr ""
|
||||
msgid "casting"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr ""
|
||||
@ -1759,10 +1740,6 @@ msgstr ""
|
||||
msgid "default 'except' must be last"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2103,7 +2080,6 @@ msgstr ""
|
||||
msgid "math domain error"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2122,6 +2098,11 @@ msgstr ""
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr ""
|
||||
@ -2209,10 +2190,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
|
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: circuitpython-cn\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-22 14:29-0700\n"
|
||||
"POT-Creation-Date: 2019-08-28 16:09-0400\n"
|
||||
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
|
||||
"Last-Translator: hexthat\n"
|
||||
"Language-Team: Chinese Hanyu Pinyin\n"
|
||||
@ -431,18 +431,6 @@ msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo"
|
||||
msgid "Cannot write without MOSI pin."
|
||||
msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic UUID doesn't match Service UUID"
|
||||
msgstr "Zìfú UUID bù fúhé fúwù UUID"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
msgid "Characteristic already in use by another Service."
|
||||
msgstr "Qítā fúwù bùmén yǐ shǐyòng de gōngnéng."
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Characteristic is already attached to a Service"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/bleio/CharacteristicBuffer.c
|
||||
msgid "CharacteristicBuffer writing not provided"
|
||||
msgstr "Wèi tígōng zìfú huǎncún xiě rù"
|
||||
@ -517,10 +505,6 @@ msgstr "Shùjù kuài bìxū zūnxún fmt qū kuài"
|
||||
msgid "Data too large for advertisement packet"
|
||||
msgstr "Guǎnggào bāo de shùjù tài dà"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "Descriptor is already attached to a Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid "Destination capacity is smaller than destination_length."
|
||||
msgstr "Mùbiāo róngliàng xiǎoyú mùdì de_chángdù."
|
||||
@ -558,7 +542,7 @@ msgstr "Yùqí %q"
|
||||
msgid "Expected a Characteristic"
|
||||
msgstr "Yùqí de tèdiǎn"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c
|
||||
#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Peripheral.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Expected a UUID"
|
||||
msgstr "Yùqí UUID"
|
||||
@ -581,6 +565,7 @@ msgstr "Fāsòng mìnglìng shībài."
|
||||
msgid "Failed to acquire mutex, err 0x%04x"
|
||||
msgstr "Wúfǎ huòdé mutex, err 0x%04x"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Service.c
|
||||
#, c-format
|
||||
msgid "Failed to add characteristic, err 0x%04x"
|
||||
@ -855,7 +840,7 @@ msgstr "Wúxiào de yǐn jiǎo"
|
||||
msgid "Invalid polarity"
|
||||
msgstr "Wúxiào liǎng jí zhí"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "Invalid properties"
|
||||
msgstr ""
|
||||
|
||||
@ -1704,10 +1689,6 @@ msgstr "wúfǎ zhíxíng xiāngguān dǎorù"
|
||||
msgid "casting"
|
||||
msgstr "tóuyǐng"
|
||||
|
||||
#: shared-bindings/bleio/Service.c
|
||||
msgid "characteristics includes an object that is not a Characteristic"
|
||||
msgstr "tèxìng bāokuò bùshì zìfú de wùtǐ"
|
||||
|
||||
#: shared-bindings/_stage/Text.c
|
||||
msgid "chars buffer too small"
|
||||
msgstr "zìfú huǎnchōng qū tài xiǎo"
|
||||
@ -1770,10 +1751,6 @@ msgstr "bù zhīchí xiǎoshù shù"
|
||||
msgid "default 'except' must be last"
|
||||
msgstr "mòrèn 'except' bìxū shì zuìhòu yīgè"
|
||||
|
||||
#: shared-bindings/bleio/Characteristic.c
|
||||
msgid "descriptors includes an object that is not a Descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/audiobusio/PDMIn.c
|
||||
msgid ""
|
||||
"destination buffer must be a bytearray or array of type 'B' for bit_depth = 8"
|
||||
@ -2115,7 +2092,6 @@ msgstr "dìtú huǎnchōng qū tài xiǎo"
|
||||
msgid "math domain error"
|
||||
msgstr "shùxué yù cuòwù"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#: ports/nrf/common-hal/bleio/Descriptor.c
|
||||
#, c-format
|
||||
msgid "max_length must be 0-%d when fixed_length is %s"
|
||||
@ -2134,6 +2110,11 @@ msgstr "nèicún fēnpèi shībài, fēnpèi %u zì jié"
|
||||
msgid "memory allocation failed, heap is locked"
|
||||
msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng"
|
||||
|
||||
#: ports/nrf/common-hal/bleio/Characteristic.c
|
||||
#, c-format
|
||||
msgid "mnax_length must be 0-%d when fixed_length is %s"
|
||||
msgstr ""
|
||||
|
||||
#: py/builtinimport.c
|
||||
msgid "module not found"
|
||||
msgstr "zhǎo bù dào mókuài"
|
||||
@ -2221,10 +2202,6 @@ msgstr ""
|
||||
msgid "no such attribute"
|
||||
msgstr "méiyǒu cǐ shǔxìng"
|
||||
|
||||
#: shared-bindings/bleio/Peripheral.c
|
||||
msgid "non-Service found in services"
|
||||
msgstr ""
|
||||
|
||||
#: ports/nrf/common-hal/bleio/__init__.c
|
||||
msgid "non-UUID found in service_uuids_whitelist"
|
||||
msgstr ""
|
||||
@ -2759,6 +2736,12 @@ msgstr "líng bù"
|
||||
#~ msgid "Can't set CCCD for local Characteristic"
|
||||
#~ msgstr "Wúfǎ wéi běndì tèzhēng shèzhì CCCD"
|
||||
|
||||
#~ msgid "Characteristic UUID doesn't match Service UUID"
|
||||
#~ msgstr "Zìfú UUID bù fúhé fúwù UUID"
|
||||
|
||||
#~ msgid "Characteristic already in use by another Service."
|
||||
#~ msgstr "Qítā fúwù bùmén yǐ shǐyòng de gōngnéng."
|
||||
|
||||
#~ msgid "Data too large for the advertisement packet"
|
||||
#~ msgstr "Guǎnggào bāo de shùjù tài dà"
|
||||
|
||||
@ -2828,6 +2811,9 @@ msgstr "líng bù"
|
||||
#~ msgid "bad GATT role"
|
||||
#~ msgstr "zǒng xiédìng de bùliáng juésè"
|
||||
|
||||
#~ msgid "characteristics includes an object that is not a Characteristic"
|
||||
#~ msgstr "tèxìng bāokuò bùshì zìfú de wùtǐ"
|
||||
|
||||
#~ msgid "expected a DigitalInOut"
|
||||
#~ msgstr "qídài de DigitalInOut"
|
||||
|
||||
|
@ -66,12 +66,14 @@ STATIC uint32_t ble_stack_enable(void) {
|
||||
};
|
||||
|
||||
uint32_t err_code = sd_softdevice_enable(&clock_config, softdevice_assert_handler);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
return err_code;
|
||||
}
|
||||
|
||||
err_code = sd_nvic_EnableIRQ(SD_EVT_IRQn);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
return err_code;
|
||||
}
|
||||
|
||||
// Start with no event handlers, etc.
|
||||
ble_drv_reset();
|
||||
@ -112,8 +114,9 @@ STATIC uint32_t ble_stack_enable(void) {
|
||||
.conn_sup_timeout = BLE_CONN_SUP_TIMEOUT,
|
||||
};
|
||||
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
|
||||
if (err_code != NRF_SUCCESS)
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
return err_code;
|
||||
}
|
||||
|
||||
err_code = sd_ble_gap_appearance_set(BLE_APPEARANCE_UNKNOWN);
|
||||
return err_code;
|
||||
|
@ -76,7 +76,7 @@ STATIC void central_on_ble_evt(ble_evt_t *ble_evt, void *central_in) {
|
||||
void common_hal_bleio_central_construct(bleio_central_obj_t *self) {
|
||||
common_hal_bleio_adapter_set_enabled(true);
|
||||
|
||||
self->remote_services_list = mp_obj_new_list(0, NULL);
|
||||
self->remote_service_list = mp_obj_new_list(0, NULL);
|
||||
self->conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
}
|
||||
|
||||
@ -134,12 +134,12 @@ bool common_hal_bleio_central_get_connected(bleio_central_obj_t *self) {
|
||||
mp_obj_tuple_t *common_hal_bleio_central_discover_remote_services(bleio_central_obj_t *self, mp_obj_t service_uuids_whitelist) {
|
||||
common_hal_bleio_device_discover_remote_services(MP_OBJ_FROM_PTR(self), service_uuids_whitelist);
|
||||
// Convert to a tuple and then clear the list so the callee will take ownership.
|
||||
mp_obj_tuple_t *services_tuple = mp_obj_new_tuple(self->remote_services_list->len,
|
||||
self->remote_services_list->items);
|
||||
mp_obj_list_clear(self->remote_services_list);
|
||||
mp_obj_tuple_t *services_tuple = mp_obj_new_tuple(self->remote_service_list->len,
|
||||
self->remote_service_list->items);
|
||||
mp_obj_list_clear(self->remote_service_list);
|
||||
return services_tuple;
|
||||
}
|
||||
|
||||
mp_obj_list_t *common_hal_bleio_central_get_remote_services(bleio_central_obj_t *self) {
|
||||
return self->remote_services_list;
|
||||
return self->remote_service_list;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ typedef struct {
|
||||
volatile bool waiting_to_connect;
|
||||
volatile uint16_t conn_handle;
|
||||
// Services discovered after connecting to a remote peripheral.
|
||||
mp_obj_list_t *remote_services_list;
|
||||
mp_obj_list_t *remote_service_list;
|
||||
} bleio_central_obj_t;
|
||||
|
||||
#endif // MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CENTRAL_H
|
||||
|
@ -124,29 +124,24 @@ STATIC void characteristic_gattc_read(bleio_characteristic_obj_t *characteristic
|
||||
ble_drv_remove_event_handler(characteristic_on_gattc_read_rsp_evt, characteristic);
|
||||
}
|
||||
|
||||
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_obj_list_t *descriptor_list) {
|
||||
void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
|
||||
self->service = MP_OBJ_NULL;
|
||||
self->uuid = uuid;
|
||||
self->value = mp_const_empty_bytes;
|
||||
self->handle = BLE_GATT_HANDLE_INVALID;
|
||||
self->props = props;
|
||||
self->read_perm = read_perm;
|
||||
self->write_perm = write_perm;
|
||||
self->descriptor_list = descriptor_list;
|
||||
self->descriptor_list = mp_obj_new_list(0, NULL);
|
||||
|
||||
const mp_int_t max_length_max = fixed_length ? BLE_GATTS_FIX_ATTR_LEN_MAX : BLE_GATTS_VAR_ATTR_LEN_MAX;
|
||||
if (max_length < 0 || max_length > max_length_max) {
|
||||
mp_raise_ValueError_varg(translate("max_length must be 0-%d when fixed_length is %s"),
|
||||
mp_raise_ValueError_varg(translate("mnax_length must be 0-%d when fixed_length is %s"),
|
||||
max_length_max, fixed_length ? "True" : "False");
|
||||
}
|
||||
self->max_length = max_length;
|
||||
self->fixed_length = fixed_length;
|
||||
|
||||
for (size_t descriptor_idx = 0; descriptor_idx < descriptor_list->len; ++descriptor_idx) {
|
||||
bleio_descriptor_obj_t *descriptor =
|
||||
MP_OBJ_TO_PTR(descriptor_list->items[descriptor_idx]);
|
||||
descriptor->characteristic = self;
|
||||
}
|
||||
common_hal_bleio_characteristic_set_value(self, initial_value_bufinfo);
|
||||
}
|
||||
|
||||
mp_obj_list_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self) {
|
||||
@ -173,6 +168,15 @@ mp_obj_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *s
|
||||
}
|
||||
|
||||
void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo) {
|
||||
if (self->fixed_length && bufinfo->len != self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length != required fixed length"));
|
||||
}
|
||||
if (bufinfo->len > self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length > max_length"));
|
||||
}
|
||||
|
||||
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
|
||||
|
||||
// Do GATT operations only if this characteristic has been added to a registered service.
|
||||
if (self->handle != BLE_GATT_HANDLE_INVALID) {
|
||||
uint16_t conn_handle = common_hal_bleio_device_get_conn_handle(self->service->device);
|
||||
@ -182,12 +186,6 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self,
|
||||
common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo,
|
||||
(self->props & CHAR_PROP_WRITE_NO_RESPONSE));
|
||||
} else {
|
||||
if (self->fixed_length && bufinfo->len != self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length != required fixed length"));
|
||||
}
|
||||
if (bufinfo->len > self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length > max_length"));
|
||||
}
|
||||
|
||||
bool sent = false;
|
||||
uint16_t cccd = 0;
|
||||
@ -213,8 +211,6 @@ void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
|
||||
}
|
||||
|
||||
bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self) {
|
||||
@ -225,6 +221,43 @@ bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties
|
||||
return self->props;
|
||||
}
|
||||
|
||||
void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor) {
|
||||
// Connect descriptor to parent characteristic.
|
||||
descriptor->characteristic = self;
|
||||
|
||||
ble_uuid_t desc_uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid);
|
||||
|
||||
ble_gatts_attr_md_t desc_attr_md = {
|
||||
// Data passed is not in a permanent location and should be copied.
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
.vlen = !descriptor->fixed_length,
|
||||
};
|
||||
|
||||
bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm);
|
||||
bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm);
|
||||
|
||||
mp_buffer_info_t desc_value_bufinfo;
|
||||
mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
ble_gatts_attr_t desc_attr = {
|
||||
.p_uuid = &desc_uuid,
|
||||
.p_attr_md = &desc_attr_md,
|
||||
.init_len = desc_value_bufinfo.len,
|
||||
.p_value = desc_value_bufinfo.buf,
|
||||
.init_offs = 0,
|
||||
.max_len = descriptor->max_length,
|
||||
};
|
||||
|
||||
uint32_t err_code = sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle);
|
||||
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
mp_raise_OSError_msg_varg(translate("Failed to add characteristic, err 0x%04x"), err_code);
|
||||
}
|
||||
|
||||
mp_obj_list_append(self->descriptor_list, MP_OBJ_FROM_PTR(descriptor));
|
||||
}
|
||||
|
||||
void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) {
|
||||
if (self->cccd_handle == BLE_GATT_HANDLE_INVALID) {
|
||||
mp_raise_ValueError(translate("No CCCD for this Characteristic"));
|
||||
|
@ -35,10 +35,9 @@
|
||||
|
||||
static volatile bleio_descriptor_obj_t *m_read_descriptor;
|
||||
|
||||
void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length) {
|
||||
void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo) {
|
||||
self->characteristic = MP_OBJ_NULL;
|
||||
self->uuid = uuid;
|
||||
self->value = mp_const_empty_bytes;
|
||||
self->handle = BLE_GATT_HANDLE_INVALID;
|
||||
self->read_perm = read_perm;
|
||||
self->write_perm = write_perm;
|
||||
@ -50,6 +49,8 @@ void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_u
|
||||
}
|
||||
self->max_length = max_length;
|
||||
self->fixed_length = fixed_length;
|
||||
|
||||
common_hal_bleio_descriptor_set_value(self, initial_value_bufinfo);
|
||||
}
|
||||
|
||||
bleio_uuid_obj_t *common_hal_bleio_descriptor_get_uuid(bleio_descriptor_obj_t *self) {
|
||||
@ -119,6 +120,15 @@ mp_obj_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self) {
|
||||
}
|
||||
|
||||
void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buffer_info_t *bufinfo) {
|
||||
if (self->fixed_length && bufinfo->len != self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length != required fixed length"));
|
||||
}
|
||||
if (bufinfo->len > self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length > max_length"));
|
||||
}
|
||||
|
||||
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
|
||||
|
||||
// Do GATT operations only if this descriptor has been registered.
|
||||
if (self->handle != BLE_GATT_HANDLE_INVALID) {
|
||||
uint16_t conn_handle = common_hal_bleio_device_get_conn_handle(self->characteristic->service->device);
|
||||
@ -126,16 +136,8 @@ void common_hal_bleio_descriptor_set_value(bleio_descriptor_obj_t *self, mp_buff
|
||||
// false means WRITE_REQ, not write-no-response
|
||||
common_hal_bleio_gattc_write(self->handle, conn_handle, bufinfo, false);
|
||||
} else {
|
||||
if (self->fixed_length && bufinfo->len != self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length != required fixed length"));
|
||||
}
|
||||
if (bufinfo->len > self->max_length) {
|
||||
mp_raise_ValueError(translate("Value length > max_length"));
|
||||
}
|
||||
|
||||
common_hal_bleio_gatts_write(self->handle, conn_handle, bufinfo);
|
||||
}
|
||||
}
|
||||
|
||||
self->value = mp_obj_new_bytes(bufinfo->buf, bufinfo->len);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include "py/obj.h"
|
||||
|
||||
#include "shared-bindings/bleio/Characteristic.h"
|
||||
#include "common-hal/bleio/Characteristic.h"
|
||||
#include "common-hal/bleio/UUID.h"
|
||||
|
||||
typedef struct {
|
||||
|
@ -71,7 +71,7 @@ STATIC void peripheral_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
|
||||
bleio_peripheral_obj_t *self = (bleio_peripheral_obj_t*)self_in;
|
||||
|
||||
// For debugging.
|
||||
mp_printf(&mp_plat_print, "Peripheral event: 0x%04x\n", ble_evt->header.evt_id);
|
||||
// mp_printf(&mp_plat_print, "Peripheral event: 0x%04x\n", ble_evt->header.evt_id);
|
||||
|
||||
switch (ble_evt->header.evt_id) {
|
||||
case BLE_GAP_EVT_CONNECTED: {
|
||||
@ -156,10 +156,8 @@ STATIC void peripheral_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
|
||||
ble_gap_evt_auth_status_t* status = &ble_evt->evt.gap_evt.params.auth_status;
|
||||
if (BLE_GAP_SEC_STATUS_SUCCESS == status->auth_status) {
|
||||
// TODO _ediv = bonding_keys->own_enc.master_id.ediv;
|
||||
mp_printf(&mp_plat_print, "Pairing succeeded, status: 0x%04x\n", status->auth_status);
|
||||
self->pair_status = PAIR_PAIRED;
|
||||
} else {
|
||||
mp_printf(&mp_plat_print, "Pairing failed, status: 0x%04x\n", status->auth_status);
|
||||
self->pair_status = PAIR_NOT_PAIRED;
|
||||
}
|
||||
break;
|
||||
@ -204,17 +202,17 @@ STATIC void peripheral_on_ble_evt(ble_evt_t *ble_evt, void *self_in) {
|
||||
|
||||
default:
|
||||
// For debugging.
|
||||
mp_printf(&mp_plat_print, "Unhandled peripheral event: 0x%04x\n", ble_evt->header.evt_id);
|
||||
// mp_printf(&mp_plat_print, "Unhandled peripheral event: 0x%04x\n", ble_evt->header.evt_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_list_t *services_list, mp_obj_t name) {
|
||||
void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_t name) {
|
||||
common_hal_bleio_adapter_set_enabled(true);
|
||||
|
||||
self->services_list = services_list;
|
||||
self->service_list = mp_obj_new_list(0, NULL);
|
||||
// Used only for discovery when acting as a client.
|
||||
self->remote_services_list = mp_obj_new_list(0, NULL);
|
||||
self->remote_service_list = mp_obj_new_list(0, NULL);
|
||||
self->name = name;
|
||||
|
||||
self->conn_handle = BLE_CONN_HANDLE_INVALID;
|
||||
@ -222,35 +220,30 @@ void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_
|
||||
self->pair_status = PAIR_NOT_PAIRED;
|
||||
|
||||
memset(&self->bonding_keys, 0, sizeof(self->bonding_keys));
|
||||
}
|
||||
|
||||
// Add all the services.
|
||||
void common_hal_bleio_peripheral_add_service(bleio_peripheral_obj_t *self, bleio_service_obj_t *service) {
|
||||
service->device = MP_OBJ_FROM_PTR(self);
|
||||
|
||||
for (size_t service_idx = 0; service_idx < services_list->len; ++service_idx) {
|
||||
bleio_service_obj_t *service = MP_OBJ_TO_PTR(services_list->items[service_idx]);
|
||||
ble_uuid_t uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid);
|
||||
|
||||
service->device = MP_OBJ_FROM_PTR(self);
|
||||
|
||||
ble_uuid_t uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid);
|
||||
|
||||
uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY;
|
||||
if (common_hal_bleio_service_get_is_secondary(service)) {
|
||||
service_type = BLE_GATTS_SRVC_TYPE_SECONDARY;
|
||||
}
|
||||
|
||||
const uint32_t err_code = sd_ble_gatts_service_add(service_type, &uuid, &service->handle);
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
mp_raise_OSError_msg_varg(translate("Failed to add service, err 0x%04x"), err_code);
|
||||
}
|
||||
|
||||
// Once the service has been registered, its characteristics can be added.
|
||||
common_hal_bleio_service_add_all_characteristics(service);
|
||||
uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY;
|
||||
if (common_hal_bleio_service_get_is_secondary(service)) {
|
||||
service_type = BLE_GATTS_SRVC_TYPE_SECONDARY;
|
||||
}
|
||||
|
||||
const uint32_t err_code = sd_ble_gatts_service_add(service_type, &uuid, &service->handle);
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
mp_raise_OSError_msg_varg(translate("Failed to add service, err 0x%04x"), err_code);
|
||||
}
|
||||
|
||||
mp_obj_list_append(self->service_list, MP_OBJ_FROM_PTR(service));
|
||||
}
|
||||
|
||||
|
||||
mp_obj_list_t *common_hal_bleio_peripheral_get_services(bleio_peripheral_obj_t *self) {
|
||||
return self->services_list;
|
||||
return self->service_list;
|
||||
}
|
||||
|
||||
bool common_hal_bleio_peripheral_get_connected(bleio_peripheral_obj_t *self) {
|
||||
@ -344,9 +337,9 @@ void common_hal_bleio_peripheral_disconnect(bleio_peripheral_obj_t *self) {
|
||||
mp_obj_tuple_t *common_hal_bleio_peripheral_discover_remote_services(bleio_peripheral_obj_t *self, mp_obj_t service_uuids_whitelist) {
|
||||
common_hal_bleio_device_discover_remote_services(MP_OBJ_FROM_PTR(self), service_uuids_whitelist);
|
||||
// Convert to a tuple and then clear the list so the callee will take ownership.
|
||||
mp_obj_tuple_t *services_tuple = mp_obj_new_tuple(self->remote_services_list->len,
|
||||
self->remote_services_list->items);
|
||||
mp_obj_list_clear(self->remote_services_list);
|
||||
mp_obj_tuple_t *services_tuple = mp_obj_new_tuple(self->remote_service_list->len,
|
||||
self->remote_service_list->items);
|
||||
mp_obj_list_clear(self->remote_service_list);
|
||||
return services_tuple;
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,9 @@ typedef struct {
|
||||
mp_obj_t name;
|
||||
volatile uint16_t conn_handle;
|
||||
// Services provided by this peripheral.
|
||||
mp_obj_list_t *services_list;
|
||||
mp_obj_list_t *service_list;
|
||||
// Remote services discovered when this peripheral is acting as a client.
|
||||
mp_obj_list_t *remote_services_list;
|
||||
mp_obj_list_t *remote_service_list;
|
||||
// The advertising data and scan response buffers are held by us, not by the SD, so we must
|
||||
// maintain them and not change it. If we need to change the contents during advertising,
|
||||
// there are tricks to get the SD to notice (see DevZone - TBS).
|
||||
|
@ -34,19 +34,13 @@
|
||||
#include "shared-bindings/bleio/Service.h"
|
||||
#include "shared-bindings/bleio/Adapter.h"
|
||||
|
||||
void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, mp_obj_list_t *characteristic_list, bool is_secondary) {
|
||||
self->device = mp_const_none;
|
||||
void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) {
|
||||
self->handle = 0xFFFF;
|
||||
self->uuid = uuid;
|
||||
self->characteristic_list = characteristic_list;
|
||||
self->characteristic_list = mp_obj_new_list(0, NULL);
|
||||
self->is_remote = false;
|
||||
self->is_secondary = is_secondary;
|
||||
|
||||
for (size_t characteristic_idx = 0; characteristic_idx < characteristic_list->len; ++characteristic_idx) {
|
||||
bleio_characteristic_obj_t *characteristic =
|
||||
MP_OBJ_TO_PTR(characteristic_list->items[characteristic_idx]);
|
||||
characteristic->service = self;
|
||||
}
|
||||
self->device = mp_const_none;
|
||||
}
|
||||
|
||||
bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self) {
|
||||
@ -65,106 +59,67 @@ bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self) {
|
||||
return self->is_secondary;
|
||||
}
|
||||
|
||||
// Call this after the Service has been added to the Peripheral.
|
||||
void common_hal_bleio_service_add_all_characteristics(bleio_service_obj_t *self) {
|
||||
// Add all the characteristics.
|
||||
for (size_t characteristic_idx = 0; characteristic_idx < self->characteristic_list->len; ++characteristic_idx) {
|
||||
bleio_characteristic_obj_t *characteristic =
|
||||
MP_OBJ_TO_PTR(self->characteristic_list->items[characteristic_idx]);
|
||||
|
||||
if (characteristic->handle != BLE_GATT_HANDLE_INVALID) {
|
||||
mp_raise_ValueError(translate("Characteristic already in use by another Service."));
|
||||
}
|
||||
void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic) {
|
||||
// Connect characteristic to parent service.
|
||||
characteristic->service = self;
|
||||
|
||||
ble_gatts_char_md_t char_md = {
|
||||
.char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0,
|
||||
.char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0,
|
||||
.char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0,
|
||||
.char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0,
|
||||
.char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0,
|
||||
.char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0,
|
||||
};
|
||||
ble_gatts_char_md_t char_md = {
|
||||
.char_props.broadcast = (characteristic->props & CHAR_PROP_BROADCAST) ? 1 : 0,
|
||||
.char_props.read = (characteristic->props & CHAR_PROP_READ) ? 1 : 0,
|
||||
.char_props.write_wo_resp = (characteristic->props & CHAR_PROP_WRITE_NO_RESPONSE) ? 1 : 0,
|
||||
.char_props.write = (characteristic->props & CHAR_PROP_WRITE) ? 1 : 0,
|
||||
.char_props.notify = (characteristic->props & CHAR_PROP_NOTIFY) ? 1 : 0,
|
||||
.char_props.indicate = (characteristic->props & CHAR_PROP_INDICATE) ? 1 : 0,
|
||||
};
|
||||
|
||||
ble_gatts_attr_md_t cccd_md = {
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
};
|
||||
ble_gatts_attr_md_t cccd_md = {
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
};
|
||||
|
||||
ble_uuid_t char_uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid);
|
||||
ble_uuid_t char_uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(characteristic->uuid, &char_uuid);
|
||||
|
||||
ble_gatts_attr_md_t char_attr_md = {
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
.vlen = !characteristic->fixed_length,
|
||||
};
|
||||
ble_gatts_attr_md_t char_attr_md = {
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
.vlen = !characteristic->fixed_length,
|
||||
};
|
||||
|
||||
if (char_md.char_props.notify || char_md.char_props.indicate) {
|
||||
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm);
|
||||
// Make CCCD write permission match characteristic read permission.
|
||||
bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm);
|
||||
if (char_md.char_props.notify || char_md.char_props.indicate) {
|
||||
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.read_perm);
|
||||
// Make CCCD write permission match characteristic read permission.
|
||||
bleio_attribute_gatts_set_security_mode(&cccd_md.write_perm, characteristic->read_perm);
|
||||
|
||||
char_md.p_cccd_md = &cccd_md;
|
||||
}
|
||||
char_md.p_cccd_md = &cccd_md;
|
||||
}
|
||||
|
||||
bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm);
|
||||
bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm);
|
||||
bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm);
|
||||
bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm);
|
||||
|
||||
mp_buffer_info_t char_value_bufinfo;
|
||||
mp_get_buffer_raise(characteristic->value, &char_value_bufinfo, MP_BUFFER_READ);
|
||||
mp_buffer_info_t char_value_bufinfo;
|
||||
mp_get_buffer_raise(characteristic->value, &char_value_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
ble_gatts_attr_t char_attr = {
|
||||
.p_uuid = &char_uuid,
|
||||
.p_attr_md = &char_attr_md,
|
||||
.init_len = char_value_bufinfo.len,
|
||||
.p_value = char_value_bufinfo.buf,
|
||||
.init_offs = 0,
|
||||
.max_len = characteristic->max_length,
|
||||
};
|
||||
ble_gatts_attr_t char_attr = {
|
||||
.p_uuid = &char_uuid,
|
||||
.p_attr_md = &char_attr_md,
|
||||
.init_len = char_value_bufinfo.len,
|
||||
.p_value = char_value_bufinfo.buf,
|
||||
.init_offs = 0,
|
||||
.max_len = characteristic->max_length,
|
||||
};
|
||||
|
||||
ble_gatts_char_handles_t char_handles;
|
||||
ble_gatts_char_handles_t char_handles;
|
||||
|
||||
uint32_t err_code;
|
||||
err_code = sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles);
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
mp_raise_OSError_msg_varg(translate("Failed to add characteristic, err 0x%04x"), err_code);
|
||||
}
|
||||
uint32_t err_code;
|
||||
err_code = sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles);
|
||||
if (err_code != NRF_SUCCESS) {
|
||||
mp_raise_OSError_msg_varg(translate("Failed to add characteristic, err 0x%04x"), err_code);
|
||||
}
|
||||
|
||||
characteristic->user_desc_handle = char_handles.user_desc_handle;
|
||||
characteristic->cccd_handle = char_handles.cccd_handle;
|
||||
characteristic->sccd_handle = char_handles.sccd_handle;
|
||||
characteristic->handle = char_handles.value_handle;
|
||||
characteristic->user_desc_handle = char_handles.user_desc_handle;
|
||||
characteristic->cccd_handle = char_handles.cccd_handle;
|
||||
characteristic->sccd_handle = char_handles.sccd_handle;
|
||||
characteristic->handle = char_handles.value_handle;
|
||||
|
||||
// Add the descriptors for this characteristic.
|
||||
for (size_t descriptor_idx = 0; descriptor_idx < characteristic->descriptor_list->len; ++descriptor_idx) {
|
||||
bleio_descriptor_obj_t *descriptor =
|
||||
MP_OBJ_TO_PTR(characteristic->descriptor_list->items[descriptor_idx]);
|
||||
|
||||
ble_uuid_t desc_uuid;
|
||||
bleio_uuid_convert_to_nrf_ble_uuid(descriptor->uuid, &desc_uuid);
|
||||
|
||||
ble_gatts_attr_md_t desc_attr_md = {
|
||||
// Data passed is not in a permanent location and should be copied.
|
||||
.vloc = BLE_GATTS_VLOC_STACK,
|
||||
.vlen = !descriptor->fixed_length,
|
||||
};
|
||||
|
||||
bleio_attribute_gatts_set_security_mode(&desc_attr_md.read_perm, descriptor->read_perm);
|
||||
bleio_attribute_gatts_set_security_mode(&desc_attr_md.write_perm, descriptor->write_perm);
|
||||
|
||||
mp_buffer_info_t desc_value_bufinfo;
|
||||
mp_get_buffer_raise(descriptor->value, &desc_value_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
ble_gatts_attr_t desc_attr = {
|
||||
.p_uuid = &desc_uuid,
|
||||
.p_attr_md = &desc_attr_md,
|
||||
.init_len = desc_value_bufinfo.len,
|
||||
.p_value = desc_value_bufinfo.buf,
|
||||
.init_offs = 0,
|
||||
.max_len = descriptor->max_length,
|
||||
};
|
||||
|
||||
err_code = sd_ble_gatts_descriptor_add(characteristic->handle, &desc_attr, &descriptor->handle);
|
||||
|
||||
} // loop over descriptors
|
||||
|
||||
} // loop over characteristics
|
||||
mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic));
|
||||
}
|
||||
|
@ -75,11 +75,11 @@ uint16_t common_hal_bleio_device_get_conn_handle(mp_obj_t device) {
|
||||
}
|
||||
}
|
||||
|
||||
mp_obj_list_t *common_hal_bleio_device_get_remote_services_list(mp_obj_t device) {
|
||||
mp_obj_list_t *common_hal_bleio_device_get_remote_service_list(mp_obj_t device) {
|
||||
if (MP_OBJ_IS_TYPE(device, &bleio_peripheral_type)) {
|
||||
return ((bleio_peripheral_obj_t*) MP_OBJ_TO_PTR(device))->remote_services_list;
|
||||
return ((bleio_peripheral_obj_t*) MP_OBJ_TO_PTR(device))->remote_service_list;
|
||||
} else if (MP_OBJ_IS_TYPE(device, &bleio_central_type)) {
|
||||
return ((bleio_central_obj_t*) MP_OBJ_TO_PTR(device))->remote_services_list;
|
||||
return ((bleio_central_obj_t*) MP_OBJ_TO_PTR(device))->remote_service_list;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
@ -158,7 +158,7 @@ STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *res
|
||||
service->base.type = &bleio_service_type;
|
||||
|
||||
// Initialize several fields at once.
|
||||
common_hal_bleio_service_construct(service, NULL, mp_obj_new_list(0, NULL), false);
|
||||
common_hal_bleio_service_construct(service, NULL, false);
|
||||
|
||||
service->device = device;
|
||||
service->is_remote = true;
|
||||
@ -179,7 +179,7 @@ STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *res
|
||||
service->uuid = NULL;
|
||||
}
|
||||
|
||||
mp_obj_list_append(common_hal_bleio_device_get_remote_services_list(device), service);
|
||||
mp_obj_list_append(common_hal_bleio_device_get_remote_service_list(device), service);
|
||||
}
|
||||
|
||||
if (response->count > 0) {
|
||||
@ -275,7 +275,7 @@ STATIC void on_desc_discovery_rsp(ble_gattc_evt_desc_disc_rsp_t *response, mp_ob
|
||||
}
|
||||
|
||||
common_hal_bleio_descriptor_construct(descriptor, uuid, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN,
|
||||
GATT_MAX_DATA_LENGTH, false);
|
||||
GATT_MAX_DATA_LENGTH, false, mp_const_empty_bytes);
|
||||
descriptor->handle = gattc_desc->handle;
|
||||
descriptor->characteristic = m_desc_discovery_characteristic;
|
||||
|
||||
@ -316,12 +316,12 @@ STATIC void discovery_on_ble_evt(ble_evt_t *ble_evt, mp_obj_t device) {
|
||||
|
||||
|
||||
void common_hal_bleio_device_discover_remote_services(mp_obj_t device, mp_obj_t service_uuids_whitelist) {
|
||||
mp_obj_list_t *remote_services_list = common_hal_bleio_device_get_remote_services_list(device);
|
||||
mp_obj_list_t *remote_services_list = common_hal_bleio_device_get_remote_service_list(device);
|
||||
|
||||
ble_drv_add_event_handler(discovery_on_ble_evt, device);
|
||||
|
||||
// Start over with an empty list.
|
||||
mp_obj_list_clear(MP_OBJ_FROM_PTR(common_hal_bleio_device_get_remote_services_list(device)));
|
||||
mp_obj_list_clear(MP_OBJ_FROM_PTR(common_hal_bleio_device_get_remote_service_list(device)));
|
||||
|
||||
if (service_uuids_whitelist == mp_const_none) {
|
||||
// List of service UUID's not given, so discover all available services.
|
||||
|
1
py/obj.h
1
py/obj.h
@ -647,6 +647,7 @@ mp_obj_t mp_obj_new_str(const char* data, size_t len);
|
||||
mp_obj_t mp_obj_new_str_via_qstr(const char* data, size_t len);
|
||||
mp_obj_t mp_obj_new_str_from_vstr(const mp_obj_type_t *type, vstr_t *vstr);
|
||||
mp_obj_t mp_obj_new_bytes(const byte* data, size_t len);
|
||||
mp_obj_t mp_obj_new_bytes_of_zeros(size_t len);
|
||||
mp_obj_t mp_obj_new_bytearray(size_t n, void *items);
|
||||
mp_obj_t mp_obj_new_bytearray_of_zeros(size_t n);
|
||||
mp_obj_t mp_obj_new_bytearray_by_ref(size_t n, void *items);
|
||||
|
@ -2094,6 +2094,14 @@ mp_obj_t mp_obj_new_bytes(const byte* data, size_t len) {
|
||||
return mp_obj_new_str_copy(&mp_type_bytes, data, len);
|
||||
}
|
||||
|
||||
mp_obj_t mp_obj_new_bytes_of_zeros(size_t len) {
|
||||
vstr_t vstr;
|
||||
vstr_init_len(&vstr, len);
|
||||
memset(vstr.buf, 0, len);
|
||||
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);
|
||||
}
|
||||
|
||||
|
||||
bool mp_obj_str_equal(mp_obj_t s1, mp_obj_t s2) {
|
||||
if (MP_OBJ_IS_QSTR(s1) && MP_OBJ_IS_QSTR(s2)) {
|
||||
return s1 == s2;
|
||||
|
@ -41,101 +41,18 @@
|
||||
//| Stores information about a BLE service characteristic and allows reading
|
||||
//| and writing of the characteristic's value.
|
||||
//|
|
||||
//| A Characteristic cannot be created directly. A new local Characteristic can be created
|
||||
//| and attached to a Service by calling `Service.add_characteristic()`.
|
||||
//| Remote Characteristic objects are created by `Central.discover_remote_services()`
|
||||
//| or `Peripheral.discover_remote_services()` as part of remote Services.
|
||||
//|
|
||||
//| .. class:: Characteristic(uuid, *, properties=0, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, descriptors=None)
|
||||
//|
|
||||
//| Create a new Characteristic object identified by the specified UUID.
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the characteristic
|
||||
//| :param int properties: bitmask of these values bitwise-or'd together: `BROADCAST`, `INDICATE`,
|
||||
//| `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`
|
||||
//| :param int read_perm: Specifies whether the characteristic can be read by a client, and if so, which
|
||||
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
|
||||
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
|
||||
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
|
||||
//| :param int write_perm: Specifies whether the characteristic can be written by a client, and if so, which
|
||||
//| security mode is required. Values allowed are the same as ``read_perm``.
|
||||
//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is
|
||||
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
|
||||
//| number of data bytes that fit in a single BLE 4.x ATT packet.
|
||||
//| :param bool fixed_length: True if the characteristic value is of fixed length.
|
||||
//| :param iterable descriptors: BLE descriptors for this characteristic.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_uuid, ARG_properties, ARG_read_perm, ARG_write_perm,
|
||||
ARG_max_length, ARG_fixed_length, ARG_descriptors };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
{ MP_QSTR_properties, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 0} },
|
||||
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
|
||||
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
|
||||
{ MP_QSTR_descriptors, MP_ARG_KW_ONLY| MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
|
||||
|
||||
const bleio_characteristic_properties_t properties = args[ARG_properties].u_int;
|
||||
if (properties & ~CHAR_PROP_ALL) {
|
||||
mp_raise_ValueError(translate("Invalid properties"));
|
||||
}
|
||||
|
||||
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
|
||||
|
||||
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
|
||||
|
||||
mp_obj_t descriptors = args[ARG_descriptors].u_obj;
|
||||
if (descriptors == mp_const_none) {
|
||||
descriptors = mp_const_empty_tuple;
|
||||
}
|
||||
|
||||
bleio_characteristic_obj_t *self = m_new_obj(bleio_characteristic_obj_t);
|
||||
self->base.type = &bleio_characteristic_type;
|
||||
|
||||
// Copy the descriptors list and validate its items.
|
||||
mp_obj_t desc_list_obj = mp_obj_new_list(0, NULL);
|
||||
mp_obj_list_t *desc_list = MP_OBJ_TO_PTR(desc_list_obj);
|
||||
|
||||
// If descriptors is not an iterable, an exception will be thrown.
|
||||
mp_obj_iter_buf_t iter_buf;
|
||||
mp_obj_t descriptors_iter = mp_getiter(descriptors, &iter_buf);
|
||||
|
||||
mp_obj_t descriptor_obj;
|
||||
while ((descriptor_obj = mp_iternext(descriptors_iter)) != MP_OBJ_STOP_ITERATION) {
|
||||
if (!MP_OBJ_IS_TYPE(descriptor_obj, &bleio_descriptor_type)) {
|
||||
mp_raise_ValueError(translate("descriptors includes an object that is not a Descriptors"));
|
||||
}
|
||||
bleio_descriptor_obj_t *descriptor = MP_OBJ_TO_PTR(descriptor_obj);
|
||||
if (common_hal_bleio_descriptor_get_characteristic(descriptor) != MP_OBJ_NULL) {
|
||||
mp_raise_ValueError(translate("Descriptor is already attached to a Characteristic"));
|
||||
}
|
||||
mp_obj_list_append(desc_list_obj, descriptor_obj);
|
||||
}
|
||||
|
||||
// Range checking on max_length arg is done by the common_hal layer, because
|
||||
// it may vary depending on underlying BLE implementation.
|
||||
common_hal_bleio_characteristic_construct(self, uuid, properties,
|
||||
read_perm, write_perm,
|
||||
args[ARG_max_length].u_int, args[ARG_fixed_length].u_bool,
|
||||
desc_list);
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| .. attribute:: properties
|
||||
//|
|
||||
//| An int bitmask representing which properties are set.
|
||||
//| An int bitmask representing which properties are set, specified as bitwise or'ing of
|
||||
//| of these possible values.
|
||||
//| `~Characteristic.BROADCAST`, `~Characteristic.INDICATE`, `~Characteristic.NOTIFY`,
|
||||
//| `~Characteristic.READ`, `~Characteristic.WRITE`, `~Characteristic.WRITE_NO_RESPONSE`.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_get_properties(mp_obj_t self_in) {
|
||||
bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
@ -222,7 +139,7 @@ const mp_obj_property_t bleio_characteristic_descriptors_obj = {
|
||||
|
||||
//| .. attribute:: service (read-only)
|
||||
//|
|
||||
//| The Service this Characteristic is a part of. None if not yet assigned to a Service.
|
||||
//| The Service this Characteristic is a part of.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) {
|
||||
bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
@ -238,6 +155,84 @@ const mp_obj_property_t bleio_characteristic_service_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| .. method:: add_descriptor(uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=b'')
|
||||
//|
|
||||
//| Create a new `Descriptor` object, and add it to this Service.
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the descriptor
|
||||
//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which
|
||||
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
|
||||
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
|
||||
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
|
||||
//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which
|
||||
//| security mode is required. Values allowed are the same as ``read_perm``.
|
||||
//| :param int max_length: Maximum length in bytes of the descriptor value. The maximum allowed is
|
||||
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
|
||||
//| number of data bytes that fit in a single BLE 4.x ATT packet.
|
||||
//| :param bool fixed_length: True if the descriptor value is of fixed length.
|
||||
//| :param buf initial_value: The initial value for this descriptor.
|
||||
//|
|
||||
//| :return: the new `Descriptor`.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_add_descriptor(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
|
||||
|
||||
enum { ARG_uuid, ARG_read_perm, ARG_write_perm,
|
||||
ARG_max_length, ARG_fixed_length, ARG_initial_value };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
|
||||
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
|
||||
{ MP_QSTR_initial_value, MP_ARG_KW_ONLY| MP_ARG_OBJ, {.u_obj = mp_const_empty_bytes} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
|
||||
|
||||
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
|
||||
|
||||
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
|
||||
|
||||
const mp_int_t max_length = args[ARG_max_length].u_int;
|
||||
const bool fixed_length = args[ARG_fixed_length].u_bool;
|
||||
mp_obj_t initial_value = args[ARG_initial_value].u_obj;
|
||||
|
||||
// Length will be validated in common_hal.
|
||||
mp_buffer_info_t initial_value_bufinfo;
|
||||
if (initial_value == mp_const_none) {
|
||||
if (fixed_length && max_length > 0) {
|
||||
initial_value = mp_obj_new_bytes_of_zeros(max_length);
|
||||
} else {
|
||||
initial_value = mp_const_empty_bytes;
|
||||
}
|
||||
}
|
||||
mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
bleio_descriptor_obj_t *descriptor = m_new_obj(bleio_descriptor_obj_t);
|
||||
descriptor->base.type = &bleio_descriptor_type;
|
||||
|
||||
// Range checking on max_length arg is done by the common_hal layer, because
|
||||
// it may vary depending on underlying BLE implementation.
|
||||
common_hal_bleio_descriptor_construct(
|
||||
descriptor, uuid, read_perm, write_perm, max_length, fixed_length, &initial_value_bufinfo);
|
||||
|
||||
common_hal_bleio_characteristic_add_descriptor(self, descriptor);
|
||||
|
||||
return MP_OBJ_FROM_PTR(descriptor);
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_characteristic_add_descriptor_obj, 2, bleio_characteristic_add_descriptor);
|
||||
|
||||
//| .. method:: set_cccd(*, notify=False, indicate=False)
|
||||
//|
|
||||
//| Set the remote characteristic's CCCD to enable or disable notification and indication.
|
||||
@ -265,10 +260,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_characteristic_set_cccd_obj, 1, bleio_ch
|
||||
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_properties), MP_ROM_PTR(&bleio_characteristic_get_properties) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_uuid), MP_ROM_PTR(&bleio_characteristic_uuid_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&bleio_characteristic_value_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_properties), MP_ROM_PTR(&bleio_characteristic_get_properties) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_uuid), MP_ROM_PTR(&bleio_characteristic_uuid_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_value), MP_ROM_PTR(&bleio_characteristic_value_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_add_descriptor), MP_ROM_PTR(&bleio_characteristic_add_descriptor_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) },
|
||||
|
||||
// Bitmask constants to represent properties
|
||||
//| .. data:: BROADCAST
|
||||
@ -319,7 +315,6 @@ STATIC void bleio_characteristic_print(const mp_print_t *print, mp_obj_t self_in
|
||||
const mp_obj_type_t bleio_characteristic_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_Characteristic,
|
||||
.make_new = bleio_characteristic_make_new,
|
||||
.print = bleio_characteristic_print,
|
||||
.locals_dict = (mp_obj_dict_t*)&bleio_characteristic_locals_dict,
|
||||
};
|
||||
|
@ -29,18 +29,20 @@
|
||||
#define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTIC_H
|
||||
|
||||
#include "shared-bindings/bleio/Attribute.h"
|
||||
#include "shared-bindings/bleio/Descriptor.h"
|
||||
#include "shared-module/bleio/Characteristic.h"
|
||||
#include "common-hal/bleio/Characteristic.h"
|
||||
|
||||
extern const mp_obj_type_t bleio_characteristic_type;
|
||||
|
||||
extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_obj_list_t *descriptor_list);
|
||||
extern void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, bleio_uuid_obj_t *uuid, bleio_characteristic_properties_t props, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo);
|
||||
extern mp_obj_t common_hal_bleio_characteristic_get_value(bleio_characteristic_obj_t *self);
|
||||
extern void common_hal_bleio_characteristic_set_value(bleio_characteristic_obj_t *self, mp_buffer_info_t *bufinfo);
|
||||
extern bleio_characteristic_properties_t common_hal_bleio_characteristic_get_properties(bleio_characteristic_obj_t *self);
|
||||
extern bleio_uuid_obj_t *common_hal_bleio_characteristic_get_uuid(bleio_characteristic_obj_t *self);
|
||||
extern mp_obj_list_t *common_hal_bleio_characteristic_get_descriptor_list(bleio_characteristic_obj_t *self);
|
||||
extern bleio_service_obj_t *common_hal_bleio_characteristic_get_service(bleio_characteristic_obj_t *self);
|
||||
extern void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t *self, bleio_descriptor_obj_t *descriptor);
|
||||
extern void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate);
|
||||
|
||||
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTIC_H
|
||||
|
@ -38,62 +38,14 @@
|
||||
//| =========================================================
|
||||
//|
|
||||
//| Stores information about a BLE descriptor.
|
||||
//| Descriptors are encapsulated by BLE characteristics and provide contextual
|
||||
//| Descriptors are attached to BLE characteristics and provide contextual
|
||||
//| information about the characteristic.
|
||||
//|
|
||||
|
||||
//| .. class:: Descriptor(uuid, *, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`)
|
||||
//|
|
||||
//| Create a new descriptor object with the UUID uuid
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the descriptor
|
||||
//| :param int read_perm: Specifies whether the descriptor can be read by a client, and if so, which
|
||||
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
|
||||
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
|
||||
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
|
||||
//| :param int write_perm: Specifies whether the descriptor can be written by a client, and if so, which
|
||||
//| security mode is required. Values allowed are the same as ``read_perm``.
|
||||
//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is
|
||||
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
|
||||
//| number of data bytes that fit in a single BLE 4.x ATT packet.
|
||||
//| :param bool fixed_length: True if the characteristic value is of fixed length.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_descriptor_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_uuid, ARG_read_perm, ARG_write_perm, ARG_max_length, ARG_fixed_length };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN } },
|
||||
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN } },
|
||||
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
|
||||
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_arg = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_arg, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
|
||||
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
|
||||
|
||||
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
|
||||
|
||||
bleio_descriptor_obj_t *self = m_new_obj(bleio_descriptor_obj_t);
|
||||
self->base.type = type;
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_arg);
|
||||
|
||||
// Range checking on max_length arg is done by the common_hal layer, because
|
||||
// it may vary depending on underlying BLE implementation.
|
||||
common_hal_bleio_descriptor_construct(self, uuid, read_perm, write_perm,
|
||||
args[ARG_max_length].u_int, args[ARG_fixed_length].u_bool);
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
//| A Descriptors cannot be created directly. A new local Descriptors can be created
|
||||
//| and attached to a Descriptors by calling `Service.add_characteristic()`.
|
||||
//| Remote Descriptor objects are created by `Central.discover_remote_services()`
|
||||
//| or `Peripheral.discover_remote_services()` as part of remote Characteristics
|
||||
//| in the remote Services that are discovered.
|
||||
|
||||
//| .. attribute:: uuid
|
||||
//|
|
||||
@ -116,7 +68,7 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = {
|
||||
|
||||
//| .. attribute:: characteristic (read-only)
|
||||
//|
|
||||
//| The Characteristic this Descriptor is a part of. None if not yet assigned to a Characteristic.
|
||||
//| The Characteristic this Descriptor is a part of.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) {
|
||||
bleio_descriptor_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
@ -185,7 +137,6 @@ STATIC void bleio_descriptor_print(const mp_print_t *print, mp_obj_t self_in, mp
|
||||
const mp_obj_type_t bleio_descriptor_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_Descriptor,
|
||||
.make_new = bleio_descriptor_make_new,
|
||||
.print = bleio_descriptor_print,
|
||||
.locals_dict = (mp_obj_dict_t*)&bleio_descriptor_locals_dict
|
||||
};
|
||||
|
@ -29,12 +29,13 @@
|
||||
#define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_DESCRIPTOR_H
|
||||
|
||||
#include "shared-module/bleio/Attribute.h"
|
||||
#include "common-hal/bleio/Characteristic.h"
|
||||
#include "common-hal/bleio/Descriptor.h"
|
||||
#include "common-hal/bleio/UUID.h"
|
||||
|
||||
extern const mp_obj_type_t bleio_descriptor_type;
|
||||
|
||||
extern void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length);
|
||||
extern void common_hal_bleio_descriptor_construct(bleio_descriptor_obj_t *self, bleio_uuid_obj_t *uuid, bleio_attribute_security_mode_t read_perm, bleio_attribute_security_mode_t write_perm, mp_int_t max_length, bool fixed_length, mp_buffer_info_t *initial_value_bufinfo);
|
||||
extern bleio_uuid_obj_t *common_hal_bleio_descriptor_get_uuid(bleio_descriptor_obj_t *self);
|
||||
extern bleio_characteristic_obj_t *common_hal_bleio_descriptor_get_characteristic(bleio_descriptor_obj_t *self);
|
||||
extern mp_obj_t common_hal_bleio_descriptor_get_value(bleio_descriptor_obj_t *self);
|
||||
|
@ -64,71 +64,98 @@
|
||||
//| import bleio
|
||||
//| from adafruit_ble.advertising import ServerAdvertisement
|
||||
//|
|
||||
//| # Create a Characteristic.
|
||||
//| chara = bleio.Characteristic(bleio.UUID(0x2919), read=True, notify=True)
|
||||
//|
|
||||
//| # Create a Service providing that one Characteristic.
|
||||
//| serv = bleio.Service(bleio.UUID(0x180f), [chara])
|
||||
//|
|
||||
//| # Create a peripheral and start it up.
|
||||
//| periph = bleio.Peripheral([serv])
|
||||
//| adv = ServerAdvertisement(periph)
|
||||
//| periph.start_advertising(adv.advertising_data_bytes, adv.scan_response_bytes)
|
||||
//| peripheral = bleio.Peripheral()
|
||||
//|
|
||||
//| while not periph.connected:
|
||||
//| # Create a Service and add it to this Peripheral.
|
||||
//| service = peripheral.addService(bleio.UUID(0x180f))
|
||||
//|
|
||||
//| # Create a Characteristic and add it to the Service.
|
||||
//| characteristic = service.addCharacteristic(
|
||||
//| bleio.UUID(0x2919), properties=Characteristic.READ | Characteristic.NOTIFY)
|
||||
//|
|
||||
//| adv = ServerAdvertisement(peripheral)
|
||||
//| peripheral.start_advertising(adv.advertising_data_bytes, adv.scan_response_bytes)
|
||||
//|
|
||||
//| while not peripheral.connected:
|
||||
//| # Wait for connection.
|
||||
//| pass
|
||||
//|
|
||||
//| .. class:: Peripheral(services=(), \*, name=None)
|
||||
//| .. class:: Peripheral(name=None)
|
||||
//|
|
||||
//| Create a new Peripheral object.
|
||||
//|
|
||||
//| :param iterable services: the Service objects representing services available from this peripheral, if any.
|
||||
//| A non-connectable peripheral will have no services.
|
||||
//| :param str name: The name used when advertising this peripheral. If name is None,
|
||||
//| bleio.adapter.default_name will be used.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_services, ARG_name };
|
||||
enum { ARG_name };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_services, MP_ARG_OBJ, {.u_obj = mp_const_empty_tuple} },
|
||||
{ MP_QSTR_name, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} },
|
||||
{ MP_QSTR_name, MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
// If services is not an iterable, an exception will be thrown.
|
||||
mp_obj_iter_buf_t iter_buf;
|
||||
mp_obj_t iterable = mp_getiter(args[ARG_services].u_obj, &iter_buf);
|
||||
|
||||
bleio_peripheral_obj_t *self = m_new_obj(bleio_peripheral_obj_t);
|
||||
self->base.type = &bleio_peripheral_type;
|
||||
|
||||
// Copy the services list and validate its items.
|
||||
mp_obj_t services_list_obj = mp_obj_new_list(0, NULL);
|
||||
mp_obj_list_t *services_list = MP_OBJ_FROM_PTR(services_list_obj);
|
||||
|
||||
mp_obj_t service;
|
||||
while ((service = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
|
||||
if (!MP_OBJ_IS_TYPE(service, &bleio_service_type)) {
|
||||
mp_raise_ValueError(translate("non-Service found in services"));
|
||||
}
|
||||
mp_obj_list_append(services_list, service);
|
||||
}
|
||||
|
||||
mp_obj_t name = args[ARG_name].u_obj;
|
||||
if (name == MP_OBJ_NULL || name == mp_const_none) {
|
||||
if (name == mp_const_none) {
|
||||
name = common_hal_bleio_adapter_get_default_name();
|
||||
} else if (!MP_OBJ_IS_STR(name)) {
|
||||
mp_raise_ValueError(translate("name must be a string"));
|
||||
}
|
||||
|
||||
common_hal_bleio_peripheral_construct(self, services_list, name);
|
||||
common_hal_bleio_peripheral_construct(self, name);
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| .. method:: add_service(uuid, *, secondary=False)
|
||||
//|
|
||||
//| Create a new `Service` object, identitied by the specified UUID, and add it to this ``Peripheral``.
|
||||
//|
|
||||
//| To mark the service as secondary, pass `True` as :py:data:`secondary`.
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the service
|
||||
//| :param bool secondary: If the service is a secondary one
|
||||
//
|
||||
//| :return: the new `Service`
|
||||
//|
|
||||
STATIC mp_obj_t bleio_peripheral_add_service(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
bleio_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
|
||||
|
||||
enum { ARG_uuid, ARG_secondary };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
{ MP_QSTR_secondary, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
|
||||
const bool is_secondary = args[ARG_secondary].u_bool;
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
|
||||
|
||||
bleio_service_obj_t *service = m_new_obj(bleio_service_obj_t);
|
||||
service->base.type = &bleio_service_type;
|
||||
|
||||
common_hal_bleio_service_construct(service, uuid, is_secondary);
|
||||
|
||||
common_hal_bleio_peripheral_add_service(self, service);
|
||||
|
||||
return MP_OBJ_FROM_PTR(service);
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_peripheral_add_service_obj, 2, bleio_peripheral_add_service);
|
||||
|
||||
|
||||
//| .. attribute:: connected (read-only)
|
||||
//|
|
||||
//| True if connected to a BLE Central device.
|
||||
@ -320,11 +347,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_peripheral_pair_obj, bleio_peripheral_pai
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_peripheral_locals_dict_table[] = {
|
||||
// Methods
|
||||
{ MP_ROM_QSTR(MP_QSTR_add_service), MP_ROM_PTR(&bleio_peripheral_add_service_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_start_advertising), MP_ROM_PTR(&bleio_peripheral_start_advertising_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_stop_advertising), MP_ROM_PTR(&bleio_peripheral_stop_advertising_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&bleio_peripheral_disconnect_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_discover_remote_services), MP_ROM_PTR(&bleio_peripheral_discover_remote_services_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_pair) , MP_ROM_PTR(&bleio_peripheral_pair_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_pair), MP_ROM_PTR(&bleio_peripheral_pair_obj) },
|
||||
|
||||
// Properties
|
||||
{ MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_peripheral_connected_obj) },
|
||||
|
@ -30,10 +30,12 @@
|
||||
|
||||
#include "py/objtuple.h"
|
||||
#include "common-hal/bleio/Peripheral.h"
|
||||
#include "common-hal/bleio/Service.h"
|
||||
|
||||
extern const mp_obj_type_t bleio_peripheral_type;
|
||||
|
||||
extern void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_list_t *service_list, mp_obj_t name);
|
||||
extern void common_hal_bleio_peripheral_construct(bleio_peripheral_obj_t *self, mp_obj_t name);
|
||||
extern void common_hal_bleio_peripheral_add_service(bleio_peripheral_obj_t *self, bleio_service_obj_t *service);
|
||||
extern mp_obj_list_t *common_hal_bleio_peripheral_get_services(bleio_peripheral_obj_t *self);
|
||||
extern bool common_hal_bleio_peripheral_get_connected(bleio_peripheral_obj_t *self);
|
||||
extern mp_obj_t common_hal_bleio_peripheral_get_name(bleio_peripheral_obj_t *self);
|
||||
|
@ -39,73 +39,11 @@
|
||||
//|
|
||||
//| Stores information about a BLE service and its characteristics.
|
||||
//|
|
||||
|
||||
//| .. class:: Service(uuid, characteristics, *, secondary=False)
|
||||
//| A Service cannot be created directly. A new local Service can be created
|
||||
//| and attached to a Peripheral by calling `Peripheral.add_service()`.
|
||||
//| Remote Service objects are created by `Central.discover_remote_services()`
|
||||
//| or `Peripheral.discover_remote_services()`.
|
||||
//|
|
||||
//| Create a new Service object identified by the specified UUID.
|
||||
//|
|
||||
//| To mark the service as secondary, pass `True` as :py:data:`secondary`.
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the service
|
||||
//| :param iterable characteristics: the Characteristic objects for this service
|
||||
//| :param bool secondary: If the service is a secondary one
|
||||
//|
|
||||
//| A Service may be remote (:py:data:`remote` is ``True``), but a remote Service
|
||||
//| cannot be constructed directly. It is created by `Central.discover_remote_services()`
|
||||
//| or `Peripheral.discover_remote_services()`.
|
||||
|
||||
STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
enum { ARG_uuid, ARG_characteristics, ARG_secondary };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
{ MP_QSTR_characteristics, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
{ MP_QSTR_secondary, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
|
||||
bleio_service_obj_t *self = m_new_obj(bleio_service_obj_t);
|
||||
self->base.type = &bleio_service_type;
|
||||
|
||||
const bool is_secondary = args[ARG_secondary].u_bool;
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
|
||||
|
||||
// If characteristics is not an iterable, an exception will be thrown.
|
||||
mp_obj_iter_buf_t iter_buf;
|
||||
mp_obj_t iterable = mp_getiter(args[ARG_characteristics].u_obj, &iter_buf);
|
||||
mp_obj_t characteristic_obj;
|
||||
|
||||
// Copy the characteristics list and validate its items.
|
||||
mp_obj_t char_list_obj = mp_obj_new_list(0, NULL);
|
||||
mp_obj_list_t *char_list = MP_OBJ_TO_PTR(char_list_obj);
|
||||
|
||||
while ((characteristic_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) {
|
||||
if (!MP_OBJ_IS_TYPE(characteristic_obj, &bleio_characteristic_type)) {
|
||||
mp_raise_ValueError(translate("characteristics includes an object that is not a Characteristic"));
|
||||
}
|
||||
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(characteristic_obj);
|
||||
if (common_hal_bleio_uuid_get_uuid128_reference(uuid) !=
|
||||
common_hal_bleio_uuid_get_uuid128_reference(characteristic->uuid)) {
|
||||
// The descriptor base UUID doesn't match the characteristic base UUID.
|
||||
mp_raise_ValueError(translate("Characteristic UUID doesn't match Service UUID"));
|
||||
}
|
||||
if (common_hal_bleio_characteristic_get_service(characteristic) != MP_OBJ_NULL) {
|
||||
mp_raise_ValueError(translate("Characteristic is already attached to a Service"));
|
||||
}
|
||||
mp_obj_list_append(char_list_obj, characteristic_obj);
|
||||
}
|
||||
|
||||
common_hal_bleio_service_construct(self, uuid, char_list, is_secondary);
|
||||
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| .. attribute:: characteristics
|
||||
//|
|
||||
@ -182,10 +120,101 @@ const mp_obj_property_t bleio_service_uuid_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| .. method:: add_characteristic(uuid, *, properties=0, read_perm=`Attribute.OPEN`, write_perm=`Attribute.OPEN`, max_length=20, fixed_length=False, initial_value=None)
|
||||
//|
|
||||
//| Create a new `Characteristic` object, and add it to this Service.
|
||||
//|
|
||||
//| :param bleio.UUID uuid: The uuid of the characteristic
|
||||
//| :param int properties: The properties of the characteristic,
|
||||
//| specified as a bitmask of these values bitwise-or'd together:
|
||||
//| `Characteristic.BROADCAST`, `Characteristic.INDICATE`, `Characteristic.NOTIFY`,
|
||||
//| `Characteristic.READ`, `Characteristic.WRITE`, `Characteristic.WRITE_NO_RESPONSE`.
|
||||
//| :param int read_perm: Specifies whether the characteristic can be read by a client, and if so, which
|
||||
//| security mode is required. Must be one of the integer values `Attribute.NO_ACCESS`, `Attribute.OPEN`,
|
||||
//| `Attribute.ENCRYPT_NO_MITM`, `Attribute.ENCRYPT_WITH_MITM`, `Attribute.LESC_ENCRYPT_WITH_MITM`,
|
||||
//| `Attribute.SIGNED_NO_MITM`, or `Attribute.SIGNED_WITH_MITM`.
|
||||
//| :param int write_perm: Specifies whether the characteristic can be written by a client, and if so, which
|
||||
//| security mode is required. Values allowed are the same as ``read_perm``.
|
||||
//| :param int max_length: Maximum length in bytes of the characteristic value. The maximum allowed is
|
||||
//| is 512, or possibly 510 if ``fixed_length`` is False. The default, 20, is the maximum
|
||||
//| number of data bytes that fit in a single BLE 4.x ATT packet.
|
||||
//| :param bool fixed_length: True if the characteristic value is of fixed length.
|
||||
//| :param buf initial_value: The initial value for this characteristic. If not given, will be
|
||||
//| filled with zeros.
|
||||
//|
|
||||
//| :return: the new `Characteristic`.
|
||||
//|
|
||||
STATIC mp_obj_t bleio_service_add_characteristic(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
|
||||
bleio_service_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
|
||||
|
||||
enum { ARG_uuid, ARG_properties, ARG_read_perm, ARG_write_perm,
|
||||
ARG_max_length, ARG_fixed_length, ARG_initial_value };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_uuid, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||
{ MP_QSTR_properties, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 0} },
|
||||
{ MP_QSTR_read_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_write_perm, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = SECURITY_MODE_OPEN} },
|
||||
{ MP_QSTR_max_length, MP_ARG_KW_ONLY| MP_ARG_INT, {.u_int = 20} },
|
||||
{ MP_QSTR_fixed_length, MP_ARG_KW_ONLY| MP_ARG_BOOL, {.u_bool = false} },
|
||||
{ MP_QSTR_initial_value, MP_ARG_KW_ONLY| MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
||||
};
|
||||
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
const mp_obj_t uuid_obj = args[ARG_uuid].u_obj;
|
||||
|
||||
if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) {
|
||||
mp_raise_ValueError(translate("Expected a UUID"));
|
||||
}
|
||||
bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj);
|
||||
|
||||
const bleio_characteristic_properties_t properties = args[ARG_properties].u_int;
|
||||
if (properties & ~CHAR_PROP_ALL) {
|
||||
mp_raise_ValueError(translate("Invalid properties"));
|
||||
}
|
||||
|
||||
const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(read_perm);
|
||||
|
||||
const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int;
|
||||
common_hal_bleio_attribute_security_mode_check_valid(write_perm);
|
||||
|
||||
const mp_int_t max_length = args[ARG_max_length].u_int;
|
||||
const bool fixed_length = args[ARG_fixed_length].u_bool;
|
||||
mp_obj_t initial_value = args[ARG_initial_value].u_obj;
|
||||
|
||||
// Length will be validated in common_hal.
|
||||
mp_buffer_info_t initial_value_bufinfo;
|
||||
if (initial_value == mp_const_none) {
|
||||
if (fixed_length && max_length > 0) {
|
||||
initial_value = mp_obj_new_bytes_of_zeros(max_length);
|
||||
} else {
|
||||
initial_value = mp_const_empty_bytes;
|
||||
}
|
||||
}
|
||||
mp_get_buffer_raise(initial_value, &initial_value_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t);
|
||||
characteristic->base.type = &bleio_characteristic_type;
|
||||
|
||||
// Range checking on max_length arg is done by the common_hal layer, because
|
||||
// it may vary depending on underlying BLE implementation.
|
||||
common_hal_bleio_characteristic_construct(
|
||||
characteristic, uuid, properties, read_perm, write_perm,
|
||||
max_length, fixed_length, &initial_value_bufinfo);
|
||||
|
||||
common_hal_bleio_service_add_characteristic(self, characteristic);
|
||||
|
||||
return MP_OBJ_FROM_PTR(characteristic);
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_service_add_characteristic_obj, 2, bleio_service_add_characteristic);
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_service_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_characteristics), MP_ROM_PTR(&bleio_service_characteristics_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_secondary), MP_ROM_PTR(&bleio_service_secondary_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_uuid), MP_ROM_PTR(&bleio_service_uuid_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_add_characteristic), MP_ROM_PTR(&bleio_service_add_characteristic_obj) },
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(bleio_service_locals_dict, bleio_service_locals_dict_table);
|
||||
|
||||
@ -203,7 +232,6 @@ STATIC void bleio_service_print(const mp_print_t *print, mp_obj_t self_in, mp_pr
|
||||
const mp_obj_type_t bleio_service_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_Service,
|
||||
.make_new = bleio_service_make_new,
|
||||
.print = bleio_service_print,
|
||||
.locals_dict = (mp_obj_dict_t*)&bleio_service_locals_dict
|
||||
};
|
||||
|
@ -32,11 +32,11 @@
|
||||
|
||||
const mp_obj_type_t bleio_service_type;
|
||||
|
||||
extern void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, mp_obj_list_t *characteristic_list, bool is_secondary);
|
||||
extern void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary);
|
||||
extern bleio_uuid_obj_t *common_hal_bleio_service_get_uuid(bleio_service_obj_t *self);
|
||||
extern mp_obj_list_t *common_hal_bleio_service_get_characteristic_list(bleio_service_obj_t *self);
|
||||
extern bool common_hal_bleio_service_get_is_remote(bleio_service_obj_t *self);
|
||||
extern bool common_hal_bleio_service_get_is_secondary(bleio_service_obj_t *self);
|
||||
extern void common_hal_bleio_service_add_all_characteristics(bleio_service_obj_t *self);
|
||||
extern void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_characteristic_obj_t *characteristic);
|
||||
|
||||
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SERVICE_H
|
||||
|
@ -41,7 +41,7 @@ extern const super_adapter_obj_t common_hal_bleio_adapter_obj;
|
||||
extern void common_hal_bleio_check_connected(uint16_t conn_handle);
|
||||
|
||||
extern uint16_t common_hal_bleio_device_get_conn_handle(mp_obj_t device);
|
||||
extern mp_obj_list_t *common_hal_bleio_device_get_remote_services_list(mp_obj_t device);
|
||||
extern mp_obj_list_t *common_hal_bleio_device_get_remote_service_list(mp_obj_t device);
|
||||
extern void common_hal_bleio_device_discover_remote_services(mp_obj_t device, mp_obj_t service_uuids_whitelist);
|
||||
|
||||
extern mp_obj_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user