From a1b5d800f30418a08a39e73ba4b3e276ca6c7241 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 19 Jun 2019 10:42:36 -0400 Subject: [PATCH] Update copyrights; get ready for Central --- locale/ID.po | 69 +- locale/circuitpython.pot | 65 +- locale/de_DE.po | 82 ++- locale/en_US.po | 65 +- locale/en_x_pirate.po | 65 +- locale/es.po | 82 ++- locale/fil.po | 69 +- locale/fr.po | 82 ++- locale/it_IT.po | 69 +- locale/pl.po | 82 ++- locale/pt_BR.po | 69 +- locale/zh_Latn_pinyin.po | 82 ++- ports/nrf/Makefile | 1 - ports/nrf/bluetooth/ble_drv.c | 3 +- ports/nrf/bluetooth/ble_drv.h | 3 +- ports/nrf/bluetooth/ble_uart.c | 3 +- ports/nrf/common-hal/analogio/AnalogIn.c | 2 +- ports/nrf/common-hal/bleio/Adapter.c | 1 + ports/nrf/common-hal/bleio/Adapter.h | 3 +- ports/nrf/common-hal/bleio/Broadcaster.h | 47 -- ports/nrf/common-hal/bleio/Characteristic.c | 2 +- ports/nrf/common-hal/bleio/Characteristic.h | 3 +- .../common-hal/bleio/CharacteristicBuffer.h | 2 +- ports/nrf/common-hal/bleio/Descriptor.c | 3 +- ports/nrf/common-hal/bleio/Descriptor.h | 3 +- ports/nrf/common-hal/bleio/Device.c | 601 ------------------ ports/nrf/common-hal/bleio/Peripheral.c | 2 +- ports/nrf/common-hal/bleio/Peripheral.h | 2 +- ports/nrf/common-hal/bleio/Scanner.c | 3 +- ports/nrf/common-hal/bleio/Service.c | 1 + ports/nrf/common-hal/bleio/Service.h | 1 + ports/nrf/common-hal/bleio/UUID.c | 3 +- ports/nrf/common-hal/bleio/UUID.h | 3 +- ports/nrf/common-hal/bleio/__init__.c | 3 +- ports/nrf/common-hal/busio/I2C.c | 5 +- ports/nrf/common-hal/busio/SPI.c | 8 +- ports/nrf/mphalport.c | 3 +- shared-bindings/bleio/Adapter.c | 1 + shared-bindings/bleio/Adapter.h | 1 + shared-bindings/bleio/Address.h | 1 + shared-bindings/bleio/AdvertisementData.h | 1 + shared-bindings/bleio/Characteristic.c | 3 +- shared-bindings/bleio/Characteristic.h | 2 + shared-bindings/bleio/CharacteristicBuffer.h | 2 +- shared-bindings/bleio/Descriptor.c | 3 +- shared-bindings/bleio/Descriptor.h | 1 + shared-bindings/bleio/Device.c | 362 ----------- shared-bindings/bleio/Device.h | 1 + shared-bindings/bleio/Peripheral.c | 3 +- shared-bindings/bleio/Peripheral.h | 2 +- shared-bindings/bleio/ScanEntry.h | 1 + shared-bindings/bleio/Service.c | 3 +- shared-bindings/bleio/Service.h | 4 +- shared-bindings/bleio/UUID.c | 4 +- shared-bindings/bleio/UUID.h | 1 + shared-bindings/bleio/__init__.c | 7 +- shared-bindings/bleio/__init__.h | 3 +- shared-module/bleio/Address.h | 1 + shared-module/bleio/AdvertisementData.h | 1 + shared-module/bleio/Characteristic.h | 42 -- shared-module/bleio/Device.h | 45 -- shared-module/bleio/ScanEntry.h | 1 + 62 files changed, 602 insertions(+), 1486 deletions(-) delete mode 100644 ports/nrf/common-hal/bleio/Broadcaster.h delete mode 100644 ports/nrf/common-hal/bleio/Device.c delete mode 100644 shared-bindings/bleio/Device.c delete mode 100644 shared-module/bleio/Characteristic.h delete mode 100644 shared-module/bleio/Device.h diff --git a/locale/ID.po b/locale/ID.po index c1760e6b49..7017631095 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -218,16 +218,15 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "buffers harus mempunyai panjang yang sama" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" @@ -354,19 +353,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "" @@ -494,13 +493,12 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy msgid "Data too large for advertisement packet" msgstr "Tidak bisa menyesuaikan data ke dalam paket advertisment" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Data too large for the advertisement packet" msgstr "Tidak bisa menyesuaikan data ke dalam paket advertisment" @@ -551,7 +549,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" @@ -566,7 +564,7 @@ msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" msgid "Failed to add characteristic, err 0x%04x" msgstr "Gagal untuk menambahkan karakteristik, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "Gagal untuk menambahkan layanan, status: 0x%08lX" @@ -591,12 +589,17 @@ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" msgid "Failed to change softdevice state" msgstr "Gagal untuk merubah status softdevice, error: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to connect:" msgstr "Gagal untuk menyambungkan, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to continue scanning" msgstr "Gagal untuk melanjutkan scanning, status: 0x%08lX" @@ -606,12 +609,12 @@ msgstr "Gagal untuk melanjutkan scanning, status: 0x%08lX" msgid "Failed to continue scanning, err 0x%04x" msgstr "Gagal untuk melanjutkan scanning, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "Gagal untuk membuat mutex, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "Gagal untuk menemukan layanan, status: 0x%08lX" @@ -651,7 +654,7 @@ msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Gagal untuk menambahkan Vendor Spesific UUID, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" @@ -661,18 +664,22 @@ msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" msgid "Failed to release mutex, err 0x%04x" msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "Gagal untuk memulai advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Gagal untuk memulai advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" @@ -682,12 +689,11 @@ msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" msgid "Failed to start scanning, err 0x%04x" msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1221,7 +1227,7 @@ msgid "USB Error" msgstr "" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1366,8 +1372,8 @@ msgstr "" msgid "argument has wrong type" msgstr "" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "argumen num/types tidak cocok" @@ -1920,8 +1926,9 @@ msgstr "" msgid "integer required" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2616,6 +2623,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index d32502e181..bbf77887ae 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-12 00:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -219,12 +219,11 @@ msgstr "" #: shared-bindings/bleio/Address.c #, c-format -msgid "Address is not %d bytes long or is in wrong format" +msgid "Address must be %d bytes long" msgstr "" #: shared-bindings/bleio/Address.c -#, c-format -msgid "Address must be %d bytes long" +msgid "Address type out of range" msgstr "" #: ports/nrf/common-hal/busio/I2C.c @@ -349,19 +348,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "" @@ -484,12 +483,11 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "" @@ -539,7 +537,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "" @@ -553,7 +551,7 @@ msgstr "" msgid "Failed to add characteristic, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "" @@ -576,11 +574,16 @@ msgstr "" msgid "Failed to change softdevice state" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "" @@ -589,11 +592,11 @@ msgstr "" msgid "Failed to continue scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "" @@ -630,7 +633,7 @@ msgstr "" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "" @@ -639,17 +642,21 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "" @@ -658,11 +665,10 @@ msgstr "" msgid "Failed to start scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1188,7 +1194,7 @@ msgid "USB Error" msgstr "" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1323,8 +1329,8 @@ msgstr "" msgid "argument has wrong type" msgstr "" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "" @@ -1876,8 +1882,9 @@ msgstr "" msgid "integer required" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2569,6 +2576,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 2bdaaf7126..8b559edab7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -219,16 +219,15 @@ msgstr "3-arg pow() wird nicht unterstützt" msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "Die Adresse ist nicht %d Bytes lang oder das Format ist falsch" - #: shared-bindings/bleio/Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Die Adresse muss %d Bytes lang sein" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" @@ -353,19 +352,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "Kann dotstar nicht mit %s verwenden" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "Im Central mode können Dienste nicht hinzugefügt werden" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "Im Central mode kann advertise nicht gemacht werden" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "Im Central mode kann name nicht geändert werden" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "Im Peripheral mode kann keine Verbindung hergestellt werden" @@ -488,12 +487,11 @@ msgstr "Data 0 pin muss am Byte ausgerichtet sein" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "Zu vielen Daten für das advertisement packet" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "Daten sind zu groß für das advertisement packet" @@ -543,7 +541,7 @@ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "Akquirieren des Mutex gescheitert" @@ -557,7 +555,7 @@ msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Hinzufügen des Characteristic ist gescheitert. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "Dienst konnte nicht hinzugefügt werden" @@ -580,11 +578,16 @@ msgstr "Konnte keine RX Buffer mit %d allozieren" msgid "Failed to change softdevice state" msgstr "Fehler beim Ändern des Softdevice-Status" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "Verbindung fehlgeschlagen:" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "Der Scanvorgang kann nicht fortgesetzt werden" @@ -593,11 +596,11 @@ msgstr "Der Scanvorgang kann nicht fortgesetzt werden" msgid "Failed to continue scanning, err 0x%04x" msgstr "Der Scanvorgang kann nicht fortgesetzt werden. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "Erstellen des Mutex ist fehlgeschlagen" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "Es konnten keine Dienste gefunden werden" @@ -634,7 +637,7 @@ msgstr "gatts value konnte nicht gelesen werden. Status: 0x%04x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Kann keine herstellerspezifische UUID hinzufügen. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "Loslassen des Mutex gescheitert" @@ -643,17 +646,21 @@ msgstr "Loslassen des Mutex gescheitert" msgid "Failed to release mutex, err 0x%04x" msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "Kann advertisement nicht starten" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Kann advertisement nicht starten. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "Der Scanvorgang kann nicht gestartet werden" @@ -662,11 +669,10 @@ msgstr "Der Scanvorgang kann nicht gestartet werden" msgid "Failed to start scanning, err 0x%04x" msgstr "Der Scanvorgang kann nicht gestartet werden. Status: 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "Kann advertisement nicht stoppen" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1217,8 +1223,8 @@ msgid "USB Error" msgstr "USB Fehler" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" -msgstr "UUID-Integer nicht im Bereich 0 bis 0xffff" +msgid "UUID integer value must be 0-0xffff" +msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1363,8 +1369,8 @@ msgstr "arg ist eine leere Sequenz" msgid "argument has wrong type" msgstr "Argument hat falschen Typ" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "Anzahl/Type der Argumente passen nicht" @@ -1917,9 +1923,10 @@ msgstr "int() arg 2 muss >= 2 und <= 36 sein" msgid "integer required" msgstr "integer erforderlich" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" -msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2625,6 +2632,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "write_args muss eine Liste, ein Tupel oder None sein" @@ -2656,6 +2667,9 @@ msgstr "" #~ msgid "AP required" #~ msgstr "AP erforderlich" +#~ msgid "Address is not %d bytes long or is in wrong format" +#~ msgstr "Die Adresse ist nicht %d Bytes lang oder das Format ist falsch" + #~ msgid "C-level assert" #~ msgstr "C-Level Assert" @@ -2761,6 +2775,9 @@ msgstr "" #~ msgid "UART(1) can't read" #~ msgstr "UART(1) kann nicht lesen" +#~ msgid "UUID integer value not in range 0 to 0xffff" +#~ msgstr "UUID-Integer nicht im Bereich 0 bis 0xffff" + #~ msgid "Unable to remount filesystem" #~ msgstr "Dateisystem konnte nicht wieder eingebunden werden." @@ -2792,6 +2809,9 @@ msgstr "" #~ msgid "impossible baudrate" #~ msgstr "Unmögliche Baudrate" +#~ msgid "interval not in range 0.0020 to 10.24" +#~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" + #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" diff --git a/locale/en_US.po b/locale/en_US.po index 152ece4327..616e89630a 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -219,12 +219,11 @@ msgstr "" #: shared-bindings/bleio/Address.c #, c-format -msgid "Address is not %d bytes long or is in wrong format" +msgid "Address must be %d bytes long" msgstr "" #: shared-bindings/bleio/Address.c -#, c-format -msgid "Address must be %d bytes long" +msgid "Address type out of range" msgstr "" #: ports/nrf/common-hal/busio/I2C.c @@ -349,19 +348,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "" @@ -484,12 +483,11 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "" @@ -539,7 +537,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "" @@ -553,7 +551,7 @@ msgstr "" msgid "Failed to add characteristic, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "" @@ -576,11 +574,16 @@ msgstr "" msgid "Failed to change softdevice state" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "" @@ -589,11 +592,11 @@ msgstr "" msgid "Failed to continue scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "" @@ -630,7 +633,7 @@ msgstr "" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "" @@ -639,17 +642,21 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "" @@ -658,11 +665,10 @@ msgstr "" msgid "Failed to start scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1188,7 +1194,7 @@ msgid "USB Error" msgstr "" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1323,8 +1329,8 @@ msgstr "" msgid "argument has wrong type" msgstr "" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "" @@ -1876,8 +1882,9 @@ msgstr "" msgid "integer required" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2569,6 +2576,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index d91dc95cad..44db050456 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -221,12 +221,11 @@ msgstr "Avast! A hardware interrupt channel be used already" #: shared-bindings/bleio/Address.c #, c-format -msgid "Address is not %d bytes long or is in wrong format" +msgid "Address must be %d bytes long" msgstr "" #: shared-bindings/bleio/Address.c -#, c-format -msgid "Address must be %d bytes long" +msgid "Address type out of range" msgstr "" #: ports/nrf/common-hal/busio/I2C.c @@ -353,19 +352,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "" @@ -488,12 +487,11 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "" @@ -543,7 +541,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "" @@ -557,7 +555,7 @@ msgstr "" msgid "Failed to add characteristic, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "" @@ -580,11 +578,16 @@ msgstr "" msgid "Failed to change softdevice state" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "" @@ -593,11 +596,11 @@ msgstr "" msgid "Failed to continue scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "" @@ -634,7 +637,7 @@ msgstr "" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "" @@ -643,17 +646,21 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "" @@ -662,11 +669,10 @@ msgstr "" msgid "Failed to start scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1192,7 +1198,7 @@ msgid "USB Error" msgstr "" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1327,8 +1333,8 @@ msgstr "" msgid "argument has wrong type" msgstr "" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "" @@ -1880,8 +1886,9 @@ msgstr "" msgid "integer required" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2573,6 +2580,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/es.po b/locale/es.po index d954d574c3..194dea86ba 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -223,16 +223,15 @@ msgstr "pow() con 3 argumentos no soportado" msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "Direción no es %d bytes largo o esta en el formato incorrecto" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "Direción debe ser %d bytes de largo" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" @@ -363,19 +362,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "No se puede usar dotstar con %s" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "No se pueden agregar servicio en modo Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "No se puede anunciar en modo Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "No se puede cambiar el nombre en modo Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "No se puede conectar en modo Peripheral" @@ -500,13 +499,12 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "El Data Chunk debe seguir el fmt chunk" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy msgid "Data too large for advertisement packet" msgstr "Los datos no caben en el paquete de anuncio." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Data too large for the advertisement packet" msgstr "Los datos no caben en el paquete de anuncio." @@ -559,7 +557,7 @@ msgstr "Se esperaba un tuple de %d, se obtuvo %d" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "No se puede adquirir el mutex, status: 0x%08lX" @@ -574,7 +572,7 @@ msgstr "No se puede adquirir el mutex, status: 0x%08lX" msgid "Failed to add characteristic, err 0x%04x" msgstr "No se puede añadir caracteristica, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "No se puede detener el anuncio. status: 0x%02x" @@ -599,12 +597,17 @@ msgstr "Falló la asignación del buffer RX de %d bytes" msgid "Failed to change softdevice state" msgstr "No se puede cambiar el estado del softdevice, error: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to connect:" msgstr "No se puede conectar. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to continue scanning" msgstr "No se puede iniciar el escaneo. status: 0x%02x" @@ -614,12 +617,12 @@ msgstr "No se puede iniciar el escaneo. status: 0x%02x" msgid "Failed to continue scanning, err 0x%04x" msgstr "No se puede iniciar el escaneo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "No se puede leer el valor del atributo. status 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "No se puede descubrir servicios, status: 0x%08lX" @@ -659,7 +662,7 @@ msgstr "No se puede escribir el valor del atributo. status: 0x%02x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "No se puede agregar el Vendor Specific 128-bit UUID." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "No se puede liberar el mutex, status: 0x%08lX" @@ -669,18 +672,22 @@ msgstr "No se puede liberar el mutex, status: 0x%08lX" msgid "Failed to release mutex, err 0x%04x" msgstr "No se puede liberar el mutex, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "No se puede inicar el anuncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "No se puede inicar el anuncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "No se puede iniciar el escaneo. status: 0x%02x" @@ -690,12 +697,11 @@ msgstr "No se puede iniciar el escaneo. status: 0x%02x" msgid "Failed to start scanning, err 0x%04x" msgstr "No se puede iniciar el escaneo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "No se puede detener el anuncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1244,8 +1250,8 @@ msgid "USB Error" msgstr "Error USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" -msgstr "El valor integer UUID no está en el rango 0 a 0xffff" +msgid "UUID integer value must be 0-0xffff" +msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1389,8 +1395,8 @@ msgstr "argumento es una secuencia vacía" msgid "argument has wrong type" msgstr "el argumento tiene un tipo erroneo" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "argumento número/tipos no coinciden" @@ -1951,9 +1957,10 @@ msgstr "int() arg 2 debe ser >= 2 y <= 36" msgid "integer required" msgstr "Entero requerido" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" -msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2658,6 +2665,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count debe ser > 0" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "write_args debe ser lista, tuple, o None" @@ -2691,6 +2702,9 @@ msgstr "paso cero" #~ msgid "AP required" #~ msgstr "AP requerido" +#~ msgid "Address is not %d bytes long or is in wrong format" +#~ msgstr "Direción no es %d bytes largo o esta en el formato incorrecto" + #~ msgid "Cannot connect to AP" #~ msgstr "No se puede conectar a AP" @@ -2803,6 +2817,9 @@ msgstr "paso cero" #~ msgid "UART(1) can't read" #~ msgstr "UART(1) no puede leer" +#~ msgid "UUID integer value not in range 0 to 0xffff" +#~ msgstr "El valor integer UUID no está en el rango 0 a 0xffff" + #~ msgid "Unable to remount filesystem" #~ msgstr "Incapaz de montar de nuevo el sistema de archivos" @@ -2852,6 +2869,9 @@ msgstr "paso cero" #~ msgid "impossible baudrate" #~ msgstr "baudrate imposible" +#~ msgid "interval not in range 0.0020 to 10.24" +#~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" + #~ msgid "invalid alarm" #~ msgstr "alarma inválida" diff --git a/locale/fil.po b/locale/fil.po index b6ad3643c8..9c688ec14b 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -220,16 +220,15 @@ msgstr "3-arg pow() hindi suportado" msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" @@ -356,19 +355,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "Hindi maarang maglagay ng service sa Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "Hindi ma advertise habang nasa Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "Hindi mapalitan ang pangalan sa Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "Hindi maconnect sa Peripheral mode" @@ -494,13 +493,12 @@ msgstr "graphic ay dapat 2048 bytes ang haba" msgid "Data chunk must follow fmt chunk" msgstr "Dapat sunurin ng Data chunk ang fmt chunk" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy msgid "Data too large for advertisement packet" msgstr "Hindi makasya ang data sa loob ng advertisement packet" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Data too large for the advertisement packet" msgstr "Hindi makasya ang data sa loob ng advertisement packet" @@ -554,7 +552,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" @@ -569,7 +567,7 @@ msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" msgid "Failed to add characteristic, err 0x%04x" msgstr "Nabigo sa paglagay ng characteristic, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "Hindi matagumpay ang paglagay ng service, status: 0x%08lX" @@ -594,12 +592,17 @@ msgstr "Nabigong ilaan ang RX buffer ng %d bytes" msgid "Failed to change softdevice state" msgstr "Nabigo sa pagbago ng softdevice state, error: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to connect:" msgstr "Hindi makaconnect, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to continue scanning" msgstr "Hindi maituloy ang pag scan, status: 0x%0xlX" @@ -609,12 +612,12 @@ msgstr "Hindi maituloy ang pag scan, status: 0x%0xlX" msgid "Failed to continue scanning, err 0x%04x" msgstr "Hindi maituloy ang pag scan, status: 0x%0xlX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "Hindi matagumpay ang pagbuo ng mutex, status: 0x%0xlX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "Nabigo sa pagdiscover ng services, status: 0x%08lX" @@ -654,7 +657,7 @@ msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Hindi matagumpay ang paglagay ng Vender Specific UUID, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" @@ -664,18 +667,22 @@ msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" msgid "Failed to release mutex, err 0x%04x" msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "Hindi masimulaan ang advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Hindi masimulaan ang advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" @@ -685,12 +692,11 @@ msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" msgid "Failed to start scanning, err 0x%04x" msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1241,7 +1247,7 @@ msgid "USB Error" msgstr "May pagkakamali ang USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1386,8 +1392,8 @@ msgstr "arg ay walang laman na sequence" msgid "argument has wrong type" msgstr "may maling type ang argument" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "hindi tugma ang argument num/types" @@ -1952,8 +1958,9 @@ msgstr "int() arg 2 ay dapat >=2 at <= 36" msgid "integer required" msgstr "kailangan ng int" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2657,6 +2664,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/fr.po b/locale/fr.po index 6fd6e90157..60122a5d0b 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -221,16 +221,15 @@ msgstr "pow() non supporté avec 3 arguments" msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matérielles est déjà utilisé" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "L'adresse n'est pas longue de %d octets ou est d'un format erroné" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c #, fuzzy msgid "All I2C peripherals are in use" @@ -361,19 +360,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "Impossible d'utiliser 'dotstar' avec %s" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "Impossible d'ajouter des services en mode Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "Impossible de publier en mode Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "Modification du nom impossible en mode Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "Impossible de se connecter en mode 'Peripheral'" @@ -500,12 +499,11 @@ msgstr "La broche 'Data 0' doit être aligné sur l'octet" msgid "Data chunk must follow fmt chunk" msgstr "Un bloc de données doit suivre un bloc de format" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "Données trop volumineuses pour un paquet de diffusion" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "Données trop volumineuses pour le paquet de diffusion" @@ -557,7 +555,7 @@ msgstr "Tuple de longueur %d attendu, obtenu %d" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "Echec de l'obtention de mutex" @@ -572,7 +570,7 @@ msgstr "Echec de l'obtention de mutex, err 0x%04x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Echec de l'ajout de caractéristique, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "Echec de l'ajout de service" @@ -597,12 +595,17 @@ msgstr "Echec de l'allocation de %d octets du tampon RX" msgid "Failed to change softdevice state" msgstr "Echec de la modification de l'état du périphérique" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to connect:" msgstr "Echec de connection:" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to continue scanning" msgstr "Impossible de poursuivre le scan" @@ -612,12 +615,12 @@ msgstr "Impossible de poursuivre le scan" msgid "Failed to continue scanning, err 0x%04x" msgstr "Impossible de poursuivre le scan, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "Echec de la création de mutex" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "Echec de la découverte de services" @@ -658,7 +661,7 @@ msgstr "Impossible de lire la valeur de 'gatts', err 0x%04x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Echec de l'ajout de l'UUID du fournisseur, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "Impossible de libérer mutex" @@ -668,18 +671,22 @@ msgstr "Impossible de libérer mutex" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossible de libérer mutex, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "Echec du démarrage de la diffusion" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Impossible de commencer à diffuser, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "Impossible de commencer à scanner" @@ -689,12 +696,11 @@ msgstr "Impossible de commencer à scanner" msgid "Failed to start scanning, err 0x%04x" msgstr "Impossible de commencer à scanner, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "Echec de l'arrêt de diffusion" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1261,8 +1267,8 @@ msgid "USB Error" msgstr "Erreur USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" -msgstr "valeur de l'entier UUID est hors-bornes 0 à 0xffff" +msgid "UUID integer value must be 0-0xffff" +msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1410,8 +1416,8 @@ msgstr "l'argument est une séquence vide" msgid "argument has wrong type" msgstr "l'argument est d'un mauvais type" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "argument num/types ne correspond pas" @@ -1984,9 +1990,10 @@ msgstr "l'argument 2 de int() doit être >=2 et <=36" msgid "integer required" msgstr "entier requis" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" -msgstr "intervalle hors bornes 0.0020 à 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2699,6 +2706,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "'value_count' doit être > 0" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "'write_args' doit être une liste, un tuple ou 'None'" @@ -2733,6 +2744,9 @@ msgstr "'step' nul" #~ msgid "AP required" #~ msgstr "'AP' requis" +#~ msgid "Address is not %d bytes long or is in wrong format" +#~ msgstr "L'adresse n'est pas longue de %d octets ou est d'un format erroné" + #~ msgid "Cannot connect to AP" #~ msgstr "Impossible de se connecter à 'AP'" @@ -2835,6 +2849,9 @@ msgstr "'step' nul" #~ msgid "UART(1) can't read" #~ msgstr "UART(1) ne peut pas lire" +#~ msgid "UUID integer value not in range 0 to 0xffff" +#~ msgstr "valeur de l'entier UUID est hors-bornes 0 à 0xffff" + #~ msgid "Unable to remount filesystem" #~ msgstr "Impossible de remonter le système de fichiers" @@ -2881,6 +2898,9 @@ msgstr "'step' nul" #~ msgid "impossible baudrate" #~ msgstr "débit impossible" +#~ msgid "interval not in range 0.0020 to 10.24" +#~ msgstr "intervalle hors bornes 0.0020 à 10.24" + #~ msgid "invalid alarm" #~ msgstr "alarme invalide" diff --git a/locale/it_IT.po b/locale/it_IT.po index d89d4ae07b..6f0e90e176 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -219,16 +219,15 @@ msgstr "pow() con tre argmomenti non supportata" msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interrupt hardware è già in uso" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "la palette deve essere lunga 32 byte" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" @@ -356,19 +355,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "dotstar non può essere usato con %s" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "non si può aggiungere servizi in Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "non si può pubblicizzare in Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "non si può cambiare il nome in Central mode" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "non si può connettere in Periferal mode" @@ -495,13 +494,12 @@ msgstr "graphic deve essere lunga 2048 byte" msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy msgid "Data too large for advertisement packet" msgstr "Impossibile inserire dati nel pacchetto di advertisement." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Data too large for the advertisement packet" msgstr "Impossibile inserire dati nel pacchetto di advertisement." @@ -554,7 +552,7 @@ msgstr "" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "Impossibile allocare buffer RX" @@ -569,7 +567,7 @@ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Impossibile fermare advertisement. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "Impossibile fermare advertisement. status: 0x%02x" @@ -594,12 +592,17 @@ msgstr "Fallita allocazione del buffer RX di %d byte" msgid "Failed to change softdevice state" msgstr "Impossibile fermare advertisement. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to connect:" msgstr "Impossibile connettersi. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to continue scanning" msgstr "Impossible iniziare la scansione. status: 0x%02x" @@ -609,12 +612,12 @@ msgstr "Impossible iniziare la scansione. status: 0x%02x" msgid "Failed to continue scanning, err 0x%04x" msgstr "Impossible iniziare la scansione. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "Impossibile fermare advertisement. status: 0x%02x" @@ -653,7 +656,7 @@ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Non è possibile aggiungere l'UUID del vendor specifico da 128-bit" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" @@ -663,18 +666,22 @@ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "Impossibile avviare advertisement. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Impossibile avviare advertisement. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "Impossible iniziare la scansione. status: 0x%02x" @@ -684,12 +691,11 @@ msgstr "Impossible iniziare la scansione. status: 0x%02x" msgid "Failed to start scanning, err 0x%04x" msgstr "Impossible iniziare la scansione. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "Impossibile fermare advertisement. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1240,7 +1246,7 @@ msgid "USB Error" msgstr "Errore USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1380,8 +1386,8 @@ msgstr "l'argomento è una sequenza vuota" msgid "argument has wrong type" msgstr "il tipo dell'argomento è errato" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "discrepanza di numero/tipo di argomenti" @@ -1944,8 +1950,9 @@ msgstr "il secondo argomanto di int() deve essere >= 2 e <= 36" msgid "integer required" msgstr "intero richiesto" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2655,6 +2662,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index e7dc248be9..a7155e0c8d 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -218,16 +218,15 @@ msgstr "3-argumentowy pow() jest niewspierany" msgid "A hardware interrupt channel is already in use" msgstr "Kanał przerwań sprzętowych w użyciu" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "Adres nie ma długości %d bajtów lub zły format" - #: shared-bindings/bleio/Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Adres musi mieć %d bajtów" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" @@ -352,19 +351,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "Nie można używać dotstar z %s" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "Nie można dodać serwisów w trybie Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "Nie można rozgłaszać w trybie Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "Nie można zmienić nazwy w trybie Central" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "Nie można się łączyć w trybie Peripheral" @@ -487,12 +486,11 @@ msgstr "Nóżka data 0 musi być wyrównana do bajtu" msgid "Data chunk must follow fmt chunk" msgstr "Fragment danych musi następować po fragmencie fmt" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" @@ -542,7 +540,7 @@ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "Nie udało się uzyskać blokady" @@ -556,7 +554,7 @@ msgstr "Nie udało się uzyskać blokady, błąd 0x$04x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Nie udało się dodać charakterystyki, błąd 0x$04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "Nie udało się dodać serwisu" @@ -579,11 +577,16 @@ msgstr "Nie udała się alokacja %d bajtów na bufor RX" msgid "Failed to change softdevice state" msgstr "Nie udało się zmienić stanu softdevice" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "Nie udało się połączenie:" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "Nie udała się kontynuacja skanowania" @@ -592,11 +595,11 @@ msgstr "Nie udała się kontynuacja skanowania" msgid "Failed to continue scanning, err 0x%04x" msgstr "Nie udała się kontynuacja skanowania, błąd 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "Nie udało się stworzyć blokady" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "Nie udało się odkryć serwisów" @@ -633,7 +636,7 @@ msgstr "Nie udało się odczytać gatts, błąd 0x%04x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Nie udało się zarejestrować UUID dostawcy, błąd 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "Nie udało się zwolnić blokady" @@ -642,17 +645,21 @@ msgstr "Nie udało się zwolnić blokady" msgid "Failed to release mutex, err 0x%04x" msgstr "Nie udało się zwolnić blokady, błąd 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "Nie udało się rozpocząć rozgłaszania" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Nie udało się rozpocząć rozgłaszania, błąd 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "Nie udało się rozpocząć skanowania" @@ -661,11 +668,10 @@ msgstr "Nie udało się rozpocząć skanowania" msgid "Failed to start scanning, err 0x%04x" msgstr "Nie udało się rozpocząć skanowania, błąd 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "Nie udało się zatrzymać rozgłaszania" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1208,8 +1214,8 @@ msgid "USB Error" msgstr "Błąd USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" -msgstr "Wartość UUID poza zakresem 0 do 0xffff" +msgid "UUID integer value must be 0-0xffff" +msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1347,8 +1353,8 @@ msgstr "arg jest puste" msgid "argument has wrong type" msgstr "argument ma zły typ" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "zła liczba lub typ argumentów" @@ -1901,9 +1907,10 @@ msgstr "argument 2 do int() busi być pomiędzy 2 a 36" msgid "integer required" msgstr "wymagana liczba całkowita" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" -msgstr "przedział poza zakresem 0.0020 do 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2596,6 +2603,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "value_count musi być > 0" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "write_args musi być listą, krotką lub None" @@ -2624,6 +2635,9 @@ msgstr "y poza zakresem" msgid "zero step" msgstr "zerowy krok" +#~ msgid "Address is not %d bytes long or is in wrong format" +#~ msgstr "Adres nie ma długości %d bajtów lub zły format" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -2635,3 +2649,9 @@ msgstr "zerowy krok" #~ msgid "Must be a Group subclass." #~ msgstr "Musi dziedziczyć z Group." + +#~ msgid "UUID integer value not in range 0 to 0xffff" +#~ msgstr "Wartość UUID poza zakresem 0 do 0xffff" + +#~ msgid "interval not in range 0.0020 to 10.24" +#~ msgstr "przedział poza zakresem 0.0020 do 10.24" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f086191870..01eda181f5 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -219,16 +219,15 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "" - #: shared-bindings/bleio/Address.c #, fuzzy, c-format msgid "Address must be %d bytes long" msgstr "buffers devem ser o mesmo tamanho" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" @@ -353,19 +352,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "" @@ -490,13 +489,12 @@ msgstr "" msgid "Data chunk must follow fmt chunk" msgstr "Pedaço de dados deve seguir o pedaço de cortes" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy msgid "Data too large for advertisement packet" msgstr "Não é possível ajustar dados no pacote de anúncios." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Data too large for the advertisement packet" msgstr "Não é possível ajustar dados no pacote de anúncios." @@ -549,7 +547,7 @@ msgstr "" msgid "Failed sending command." msgstr "Falha ao enviar comando." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to acquire mutex" msgstr "Falha ao alocar buffer RX" @@ -564,7 +562,7 @@ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Não pode parar propaganda. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to add service" msgstr "Não pode parar propaganda. status: 0x%02x" @@ -589,11 +587,16 @@ msgstr "Falha ao alocar buffer RX de %d bytes" msgid "Failed to change softdevice state" msgstr "Não pode parar propaganda. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "" @@ -602,12 +605,12 @@ msgstr "" msgid "Failed to continue scanning, err 0x%04x" msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to create mutex" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to discover services" msgstr "Não pode parar propaganda. status: 0x%02x" @@ -646,7 +649,7 @@ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Não é possível adicionar o UUID de 128 bits específico do fornecedor." -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to release mutex" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" @@ -656,18 +659,22 @@ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" msgid "Failed to release mutex, err 0x%04x" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start advertising" msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to start scanning" msgstr "Não é possível iniciar o anúncio. status: 0x%02x" @@ -677,12 +684,11 @@ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" msgid "Failed to start scanning, err 0x%04x" msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c #, fuzzy msgid "Failed to stop advertising" msgstr "Não pode parar propaganda. status: 0x%02x" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, fuzzy, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1216,7 +1222,7 @@ msgid "USB Error" msgstr "Erro na USB" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +msgid "UUID integer value must be 0-0xffff" msgstr "" #: shared-bindings/bleio/UUID.c @@ -1352,8 +1358,8 @@ msgstr "" msgid "argument has wrong type" msgstr "argumento tem tipo errado" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "" @@ -1909,8 +1915,9 @@ msgstr "" msgid "integer required" msgstr "inteiro requerido" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" #: extmod/machine_i2c.c @@ -2606,6 +2613,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index dd61f13628..79d803d674 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-11 14:59-0700\n" +"POT-Creation-Date: 2019-06-19 09:49-0400\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -219,16 +219,15 @@ msgstr "bù zhīchí 3-arg pow ()" msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhōngduàn tōngdào yǐ zài shǐyòng zhōng" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" - #: shared-bindings/bleio/Address.c #, c-format msgid "Address must be %d bytes long" msgstr "Dìzhǐ bìxū shì %d zì jié zhǎng" +#: shared-bindings/bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng" @@ -353,19 +352,19 @@ msgstr "" msgid "Can not use dotstar with %s" msgstr "Wúfǎ yǔ dotstar yīqǐ shǐyòng %s" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't add services in Central mode" msgstr "Wúfǎ zài zhōngyāng móshì xià tiānjiā fúwù" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't advertise in Central mode" msgstr "Wúfǎ zài zhōngyāng móshì zhōng guǎnggào" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't change the name in Central mode" msgstr "Wúfǎ gēnggǎi zhōngyāng móshì de míngchēng" -#: shared-bindings/bleio/Device.c +#: shared-bindings/bleio/Central.c msgid "Can't connect in Peripheral mode" msgstr "Wúfǎ zài biānyuán móshì zhōng liánjiē" @@ -488,12 +487,11 @@ msgstr "Shùjù 0 de yǐn jiǎo bìxū shì zì jié duìqí" msgid "Data chunk must follow fmt chunk" msgstr "Shùjù kuài bìxū zūnxún fmt qū kuài" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" msgstr "Guǎnggào bāo de shùjù tài dà" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Data too large for the advertisement packet" msgstr "Guǎnggào bāo de shùjù tài dà" @@ -543,7 +541,7 @@ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" msgid "Failed sending command." msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to acquire mutex" msgstr "Wúfǎ huòdé mutex" @@ -557,7 +555,7 @@ msgstr "Wúfǎ huòdé mutex, err 0x%04x" msgid "Failed to add characteristic, err 0x%04x" msgstr "Tiānjiā tèxìng shībài, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to add service" msgstr "Tiānjiā fúwù shībài" @@ -580,11 +578,16 @@ msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" msgid "Failed to change softdevice state" msgstr "Gēnggǎi ruǎn shèbèi zhuàngtài shībài" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to configure advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to connect:" msgstr "Liánjiē shībài:" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to continue scanning" msgstr "Jìxù sǎomiáo shībài" @@ -593,11 +596,11 @@ msgstr "Jìxù sǎomiáo shībài" msgid "Failed to continue scanning, err 0x%04x" msgstr "Jìxù sǎomiáo shībài, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to create mutex" msgstr "Wúfǎ chuàngjiàn hù chì suǒ" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to discover services" msgstr "Fāxiàn fúwù shībài" @@ -634,7 +637,7 @@ msgstr "Wúfǎ dòu qǔ gatts zhí, err 0x%04x" msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "Wúfǎ zhùcè màizhǔ tèdìng de UUID, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to release mutex" msgstr "Wúfǎ shìfàng mutex" @@ -643,17 +646,21 @@ msgstr "Wúfǎ shìfàng mutex" msgid "Failed to release mutex, err 0x%04x" msgstr "Wúfǎ shìfàng mutex, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to set device name, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start advertising" msgstr "Qǐdòng guǎnggào shībài" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to start advertising, err 0x%04x" msgstr "Qǐdòng guǎnggào shībài, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to start scanning" msgstr "Qǐdòng sǎomiáo shībài" @@ -662,11 +669,10 @@ msgstr "Qǐdòng sǎomiáo shībài" msgid "Failed to start scanning, err 0x%04x" msgstr "Qǐdòng sǎomiáo shībài, err 0x%04x" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/bleio/Central.c msgid "Failed to stop advertising" msgstr "Wúfǎ tíngzhǐ guǎnggào" -#: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to stop advertising, err 0x%04x" @@ -1213,8 +1219,8 @@ msgid "USB Error" msgstr "USB Cuòwù" #: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" -msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" +msgid "UUID integer value must be 0-0xffff" +msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1355,8 +1361,8 @@ msgstr "cānshù shì yīgè kōng de xùliè" msgid "argument has wrong type" msgstr "cānshù lèixíng cuòwù" -#: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: shared-bindings/gamepad/GamePad.c shared-bindings/_stage/__init__.c msgid "argument num/types mismatch" msgstr "cānshù biānhào/lèixíng bù pǐpèi" @@ -1911,9 +1917,10 @@ msgstr "zhěngshù() cānshù 2 bìxū > = 2 qiě <= 36" msgid "integer required" msgstr "xūyào zhěngshù" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" -msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" +#: shared-bindings/bleio/Peripheral.c shared-bindings/bleio/Scanner.c +#, c-format +msgid "interval must be in range %s-%s" +msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" @@ -2608,6 +2615,10 @@ msgstr "" msgid "value_count must be > 0" msgstr "zhí jìshù bìxū wèi > 0" +#: shared-bindings/bleio/Scanner.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "xiě cānshù bìxū shì yuán zǔ, lièbiǎo huò None" @@ -2636,6 +2647,9 @@ msgstr "y zhí chāochū biānjiè" msgid "zero step" msgstr "líng bù" +#~ msgid "Address is not %d bytes long or is in wrong format" +#~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -2660,9 +2674,15 @@ msgstr "líng bù" #~ msgid "Only bit maps of 8 bit color or less are supported" #~ msgstr "Jǐn zhīchí 8 wèi yánsè huò xiǎoyú" +#~ msgid "UUID integer value not in range 0 to 0xffff" +#~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" + #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" +#~ msgid "interval not in range 0.0020 to 10.24" +#~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" + #~ msgid "row must be packed and word aligned" #~ msgstr "xíng bìxū dǎbāo bìngqiě zì duìqí" diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index b7ff2fcbaa..18990485b4 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -159,7 +159,6 @@ SRC_C += \ boards/$(BOARD)/pins.c \ device/$(MCU_VARIANT)/startup_$(MCU_SUB_VARIANT).c \ bluetooth/ble_drv.c \ - bluetooth/ble_uart.c \ lib/libc/string0.c \ lib/mp-readline/readline.c \ lib/oofatfs/ff.c \ diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index f6e575a8c2..6b17e7af29 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index 133d77b48d..d349fa4e07 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c index 7faaafb0ef..91d10cff15 100644 --- a/ports/nrf/bluetooth/ble_uart.c +++ b/ports/nrf/bluetooth/ble_uart.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 1e572f7cb9..f20802ac98 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -3,8 +3,8 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries - * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Adapter.c b/ports/nrf/common-hal/bleio/Adapter.c index 120fcf0559..9d0912930b 100644 --- a/ports/nrf/common-hal/bleio/Adapter.c +++ b/ports/nrf/common-hal/bleio/Adapter.c @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2016 Glenn Ruben Bakke * Copyright (c) 2018 Artur Pacholec * diff --git a/ports/nrf/common-hal/bleio/Adapter.h b/ports/nrf/common-hal/bleio/Adapter.h index 0497f9ac9c..5dcc625406 100644 --- a/ports/nrf/common-hal/bleio/Adapter.h +++ b/ports/nrf/common-hal/bleio/Adapter.h @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Broadcaster.h b/ports/nrf/common-hal/bleio/Broadcaster.h deleted file mode 100644 index 2d1ae69a12..0000000000 --- a/ports/nrf/common-hal/bleio/Broadcaster.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2018 Dan Halbert for Adafruit Industries - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_BROADCASTER_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_BROADCASTER_H - -#include "ble.h" - -#include "shared-module/bleio/__init__.h" -#include "shared-module/bleio/Address.h" - -typedef struct { - mp_obj_base_t base; - // In seconds. - mp_float_t interval; - // The advertising data buffer is held by us, not by the SD, so we must - // maintain it and not change it. If we need to change its contents during advertising, - // there are tricks to get the SD to notice (see DevZone - TBS). - uint8_t adv_data[BLE_GAP_ADV_SET_DATA_SIZE_MAX]; - -} bleio_broadcaster_obj_t; - -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_BROADCASTER_H diff --git a/ports/nrf/common-hal/bleio/Characteristic.c b/ports/nrf/common-hal/bleio/Characteristic.c index 45fb1d092a..346cfefbc5 100644 --- a/ports/nrf/common-hal/bleio/Characteristic.c +++ b/ports/nrf/common-hal/bleio/Characteristic.c @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -34,7 +35,6 @@ #include "py/runtime.h" #include "common-hal/bleio/__init__.h" #include "common-hal/bleio/Characteristic.h" -#include "shared-module/bleio/Characteristic.h" STATIC volatile bleio_characteristic_obj_t *m_read_characteristic; STATIC volatile uint8_t m_tx_in_progress; diff --git a/ports/nrf/common-hal/bleio/Characteristic.h b/ports/nrf/common-hal/bleio/Characteristic.h index 662485bad5..451bae4712 100644 --- a/ports/nrf/common-hal/bleio/Characteristic.h +++ b/ports/nrf/common-hal/bleio/Characteristic.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -27,9 +28,9 @@ #ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_CHARACTERISTIC_H #define MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_CHARACTERISTIC_H -#include "shared-module/bleio/Characteristic.h" #include "common-hal/bleio/Service.h" #include "common-hal/bleio/UUID.h" +#include "shared-module/bleio/Characteristic.h" typedef struct { mp_obj_base_t base; diff --git a/ports/nrf/common-hal/bleio/CharacteristicBuffer.h b/ports/nrf/common-hal/bleio/CharacteristicBuffer.h index 6a44229f7a..db8fd2fade 100644 --- a/ports/nrf/common-hal/bleio/CharacteristicBuffer.h +++ b/ports/nrf/common-hal/bleio/CharacteristicBuffer.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Descriptor.c b/ports/nrf/common-hal/bleio/Descriptor.c index 8282be8f2d..418cc07c17 100644 --- a/ports/nrf/common-hal/bleio/Descriptor.c +++ b/ports/nrf/common-hal/bleio/Descriptor.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Descriptor.h b/ports/nrf/common-hal/bleio/Descriptor.h index ee0886c22f..47552f39d8 100644 --- a/ports/nrf/common-hal/bleio/Descriptor.h +++ b/ports/nrf/common-hal/bleio/Descriptor.h @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Device.c b/ports/nrf/common-hal/bleio/Device.c deleted file mode 100644 index b1ac72e754..0000000000 --- a/ports/nrf/common-hal/bleio/Device.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -#include "ble.h" -#include "ble_drv.h" -#include "ble_hci.h" -#include "nrf_soc.h" -#include "py/objstr.h" -#include "py/runtime.h" -#include "shared-bindings/bleio/Adapter.h" -#include "shared-bindings/bleio/Characteristic.h" -#include "shared-bindings/bleio/Device.h" -#include "shared-bindings/bleio/Service.h" -#include "shared-bindings/bleio/UUID.h" - -#define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) -#define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(300, UNIT_0_625_MS) -#define BLE_SLAVE_LATENCY 0 -#define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) - -#define BLE_ADV_LENGTH_FIELD_SIZE 1 -#define BLE_ADV_AD_TYPE_FIELD_SIZE 1 -#define BLE_AD_TYPE_FLAGS_DATA_SIZE 1 - -#ifndef BLE_GAP_ADV_MAX_SIZE -#define BLE_GAP_ADV_MAX_SIZE 31 -#endif - -static bleio_service_obj_t *m_char_discovery_service; -static volatile bool m_discovery_successful; -static nrf_mutex_t *m_discovery_mutex; - -#if (BLUETOOTH_SD == 140) -static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; - -static uint8_t m_scan_buffer_data[BLE_GAP_SCAN_BUFFER_MIN]; - -static ble_data_t m_scan_buffer = { - .p_data = m_scan_buffer_data, - .len = BLE_GAP_SCAN_BUFFER_MIN -}; -#endif - -STATIC uint32_t set_advertisement_data(bleio_device_obj_t *device, bool connectable, mp_buffer_info_t *raw_data) { - common_hal_bleio_adapter_set_enabled(true); - - uint8_t adv_data[BLE_GAP_ADV_MAX_SIZE]; - uint8_t byte_pos = 0; - uint32_t err_code; - -#define ADD_FIELD(field, len) \ - do { \ - if (byte_pos + (len) > BLE_GAP_ADV_MAX_SIZE) { \ - mp_raise_ValueError(translate("Data too large for the advertisement packet")); \ - } \ - adv_data[byte_pos] = (field); \ - byte_pos += (len); \ - } while (0) - - GET_STR_DATA_LEN(device->name, name_data, name_len); - if (name_len > 0) { - ble_gap_conn_sec_mode_t sec_mode; - BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); - - err_code = sd_ble_gap_device_name_set(&sec_mode, name_data, name_len); - if (err_code != NRF_SUCCESS) { - return err_code; - } - - // TODO: Shorten if too long - - ADD_FIELD(BLE_ADV_AD_TYPE_FIELD_SIZE + name_len, BLE_ADV_LENGTH_FIELD_SIZE); - ADD_FIELD(BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME, BLE_ADV_AD_TYPE_FIELD_SIZE); - - memcpy(&adv_data[byte_pos], name_data, name_len); - byte_pos += name_len; - } - - // set flags, default to disc mode - if (raw_data->len == 0) { - ADD_FIELD(BLE_ADV_AD_TYPE_FIELD_SIZE + BLE_AD_TYPE_FLAGS_DATA_SIZE, BLE_ADV_LENGTH_FIELD_SIZE); - ADD_FIELD(BLE_GAP_AD_TYPE_FLAGS, BLE_AD_TYPE_FLAGS_DATA_SIZE); - ADD_FIELD(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE, BLE_AD_TYPE_FLAGS_DATA_SIZE); - } else { - if (byte_pos + raw_data->len > BLE_GAP_ADV_MAX_SIZE) { - mp_raise_ValueError(translate("Data too large for the advertisement packet")); - } - - memcpy(&adv_data[byte_pos], raw_data->buf, raw_data->len); - byte_pos += raw_data->len; - } - - const mp_obj_list_t *service_list = MP_OBJ_TO_PTR(device->service_list); - if (service_list->len > 0) { - bool has_128bit_services = false; - bool has_16bit_services = false; - - for (size_t i = 0; i < service_list->len; ++i) { - const bleio_service_obj_t *service = MP_OBJ_TO_PTR(service_list->items[i]); - - if (service->is_secondary) { - continue; - } - - switch (common_hal_bleio_uuid_get_size(service->uuid)) { - case 16: - has_16bit_services = true; - break; - case 128: - has_128bit_services = true; - break; - } - } - - if (has_16bit_services) { - const uint8_t size_byte_pos = byte_pos; - uint8_t uuid_total_size = 0; - - // skip length byte for now, apply total length post calculation - byte_pos += BLE_ADV_LENGTH_FIELD_SIZE; - - ADD_FIELD(BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_COMPLETE, BLE_ADV_AD_TYPE_FIELD_SIZE); - - for (size_t i = 0; i < service_list->len; ++i) { - const bleio_service_obj_t *service = MP_OBJ_TO_PTR(service_list->items[i]); - uint8_t encoded_size = 0; - - if (common_hal_bleio_uuid_get_size(service->uuid) != 16 || service->is_secondary) { - continue; - } - - ble_uuid_t uuid; - bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid); - - err_code = sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]); - if (err_code != NRF_SUCCESS) { - return err_code; - } - - uuid_total_size += encoded_size; - byte_pos += encoded_size; - } - - adv_data[size_byte_pos] = (BLE_ADV_AD_TYPE_FIELD_SIZE + uuid_total_size); - } - - if (has_128bit_services) { - const uint8_t size_byte_pos = byte_pos; - uint8_t uuid_total_size = 0; - - // skip length byte for now, apply total length post calculation - byte_pos += BLE_ADV_LENGTH_FIELD_SIZE; - - ADD_FIELD(BLE_GAP_AD_TYPE_128BIT_SERVICE_UUID_COMPLETE, BLE_ADV_AD_TYPE_FIELD_SIZE); - - for (size_t i = 0; i < service_list->len; ++i) { - const bleio_service_obj_t *service = MP_OBJ_TO_PTR(service_list->items[i]); - uint8_t encoded_size = 0; - - if (common_hal_bleio_uuid_get_size(service->uuid) != 16 || service->is_secondary) { - continue; - } - - ble_uuid_t uuid; - bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid); - - err_code = sd_ble_uuid_encode(&uuid, &encoded_size, &adv_data[byte_pos]); - if (err_code != NRF_SUCCESS) { - return err_code; - } - - uuid_total_size += encoded_size; - byte_pos += encoded_size; - } - - adv_data[size_byte_pos] = (BLE_ADV_AD_TYPE_FIELD_SIZE + uuid_total_size); - } - } - -#if (BLUETOOTH_SD == 132) - err_code = sd_ble_gap_adv_data_set(adv_data, byte_pos, NULL, 0); - if (err_code != NRF_SUCCESS) { - return err_code; - } -#endif - - static ble_gap_adv_params_t m_adv_params = { - .interval = MSEC_TO_UNITS(100, UNIT_0_625_MS), -#if (BLUETOOTH_SD == 140) - .properties.type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED, - .duration = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED, - .filter_policy = BLE_GAP_ADV_FP_ANY, - .primary_phy = BLE_GAP_PHY_1MBPS, -#else - .type = BLE_GAP_ADV_TYPE_ADV_IND, - .fp = BLE_GAP_ADV_FP_ANY, -#endif - }; - - if (!connectable) { -#if (BLUETOOTH_SD == 140) - m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; -#else - m_adv_params.type = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND; -#endif - } - - common_hal_bleio_device_stop_advertising(device); - -#if (BLUETOOTH_SD == 140) - const ble_gap_adv_data_t ble_gap_adv_data = { - .adv_data.p_data = adv_data, - .adv_data.len = byte_pos, - }; - - err_code = sd_ble_gap_adv_set_configure(&m_adv_handle, &ble_gap_adv_data, &m_adv_params); - if (err_code != NRF_SUCCESS) { - return err_code; - } - - err_code = sd_ble_gap_adv_start(m_adv_handle, BLE_CONN_CFG_TAG_CUSTOM); -#elif (BLUETOOTH_SD == 132 && BLE_API_VERSION == 4) - err_code = sd_ble_gap_adv_start(&m_adv_params, BLE_CONN_CFG_TAG_CUSTOM); -#else - err_code = sd_ble_gap_adv_start(&m_adv_params); -#endif - - return err_code; -} - -STATIC bool discover_services(bleio_device_obj_t *device, uint16_t start_handle) { - m_discovery_successful = false; - - uint32_t err_code = sd_ble_gattc_primary_services_discover(device->conn_handle, start_handle, NULL); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to discover services")); - } - - // Serialize discovery. - err_code = sd_mutex_acquire(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to acquire mutex")); - } - - // Wait for someone else to release m_discovery_mutex. - while (sd_mutex_acquire(m_discovery_mutex) == NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN) { -#ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP -#endif - } - - err_code = sd_mutex_release(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to release mutex")); - } - - return m_discovery_successful; -} - -STATIC bool discover_characteristics(bleio_device_obj_t *device, bleio_service_obj_t *service, uint16_t start_handle) { - m_char_discovery_service = service; - - ble_gattc_handle_range_t handle_range; - handle_range.start_handle = start_handle; - handle_range.end_handle = service->end_handle; - - m_discovery_successful = false; - - uint32_t err_code = sd_ble_gattc_characteristics_discover(device->conn_handle, &handle_range); - if (err_code != NRF_SUCCESS) { - return false; - } - - err_code = sd_mutex_acquire(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to acquire mutex")); - } - - while (sd_mutex_acquire(m_discovery_mutex) == NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN) { -#ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP -#endif - } - - err_code = sd_mutex_release(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to release mutex")); - } - - return m_discovery_successful; -} - -STATIC void on_primary_srv_discovery_rsp(ble_gattc_evt_prim_srvc_disc_rsp_t *response, bleio_device_obj_t *device) { - for (size_t i = 0; i < response->count; ++i) { - ble_gattc_service_t *gattc_service = &response->services[i]; - - bleio_service_obj_t *service = m_new_obj(bleio_service_obj_t); - service->base.type = &bleio_service_type; - service->device = device; - service->characteristic_list = mp_obj_new_list(0, NULL); - service->start_handle = gattc_service->handle_range.start_handle; - service->end_handle = gattc_service->handle_range.end_handle; - service->handle = gattc_service->handle_range.start_handle; - - bleio_uuid_obj_t *uuid = m_new_obj(bleio_uuid_obj_t); - bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_service->uuid); - service->uuid = uuid; - - mp_obj_list_append(device->service_list, service); - } - - if (response->count > 0) { - m_discovery_successful = true; - } - - const uint32_t err_code = sd_mutex_release(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to release mutex")); - } -} - -STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio_device_obj_t *device) { - for (size_t i = 0; i < response->count; ++i) { - ble_gattc_char_t *gattc_char = &response->chars[i]; - - bleio_characteristic_obj_t *characteristic = m_new_obj(bleio_characteristic_obj_t); - characteristic->base.type = &bleio_characteristic_type; - - bleio_uuid_obj_t *uuid = m_new_obj(bleio_uuid_obj_t); - uuid->base.type = &bleio_uuid_type; - bleio_uuid_construct_from_nrf_ble_uuid(uuid, &gattc_char->uuid); - characteristic->uuid = uuid; - - characteristic->props.broadcast = gattc_char->char_props.broadcast; - characteristic->props.indicate = gattc_char->char_props.indicate; - characteristic->props.notify = gattc_char->char_props.notify; - characteristic->props.read = gattc_char->char_props.read; - characteristic->props.write = gattc_char->char_props.write; - characteristic->props.write_no_response = gattc_char->char_props.write_wo_resp; - characteristic->handle = gattc_char->handle_value; - characteristic->service = m_char_discovery_service; - - mp_obj_list_append(m_char_discovery_service->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); - } - - if (response->count > 0) { - m_discovery_successful = true; - } - - const uint32_t err_code = sd_mutex_release(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to release mutex")); - } -} - -STATIC void on_adv_report(ble_gap_evt_adv_report_t *report, bleio_device_obj_t *device) { - uint32_t err_code; - - if (memcmp(report->peer_addr.addr, device->address.value, BLEIO_ADDRESS_BYTES) != 0) { -#if (BLUETOOTH_SD == 140) - err_code = sd_ble_gap_scan_start(NULL, &m_scan_buffer); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to continue scanning")); - } -#endif - return; - } - - ble_gap_scan_params_t scan_params = { - .active = 1, - .interval = MSEC_TO_UNITS(100, UNIT_0_625_MS), - .window = MSEC_TO_UNITS(100, UNIT_0_625_MS), - }; - - ble_gap_addr_t addr; - memset(&addr, 0, sizeof(addr)); - - addr.addr_type = report->peer_addr.addr_type; - memcpy(addr.addr, report->peer_addr.addr, BLEIO_ADDRESS_BYTES); - - ble_gap_conn_params_t conn_params = { - .min_conn_interval = BLE_MIN_CONN_INTERVAL, - .max_conn_interval = BLE_MAX_CONN_INTERVAL, - .conn_sup_timeout = BLE_CONN_SUP_TIMEOUT, - .slave_latency = BLE_SLAVE_LATENCY, - }; - -#if (BLE_API_VERSION == 2) - err_code = sd_ble_gap_connect(&addr, &scan_params, &conn_params); -#else - err_code = sd_ble_gap_connect(&addr, &scan_params, &conn_params, BLE_CONN_CFG_TAG_CUSTOM); -#endif - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to connect:")); - } -} - -STATIC void on_ble_evt(ble_evt_t *ble_evt, void *device_in) { - bleio_device_obj_t *device = (bleio_device_obj_t*)device_in; - - switch (ble_evt->header.evt_id) { - case BLE_GAP_EVT_CONNECTED: - { - ble_gap_conn_params_t conn_params; - device->conn_handle = ble_evt->evt.gap_evt.conn_handle; - - sd_ble_gap_ppcp_get(&conn_params); - sd_ble_gap_conn_param_update(ble_evt->evt.gap_evt.conn_handle, &conn_params); - break; - } - - case BLE_GAP_EVT_DISCONNECTED: - device->conn_handle = BLE_CONN_HANDLE_INVALID; - break; - - case BLE_GAP_EVT_ADV_REPORT: - on_adv_report(&ble_evt->evt.gap_evt.params.adv_report, device); - break; - - case BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP: - on_primary_srv_discovery_rsp(&ble_evt->evt.gattc_evt.params.prim_srvc_disc_rsp, device); - break; - - case BLE_GATTC_EVT_CHAR_DISC_RSP: - on_char_discovery_rsp(&ble_evt->evt.gattc_evt.params.char_disc_rsp, device); - break; - - case BLE_GATTS_EVT_SYS_ATTR_MISSING: - sd_ble_gatts_sys_attr_set(ble_evt->evt.gatts_evt.conn_handle, NULL, 0, 0); - break; - -#if (BLE_API_VERSION == 4) - case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST: - sd_ble_gatts_exchange_mtu_reply(device->conn_handle, BLE_GATT_ATT_MTU_DEFAULT); - break; -#endif - - case BLE_GAP_EVT_SEC_PARAMS_REQUEST: - sd_ble_gap_sec_params_reply(device->conn_handle, BLE_GAP_SEC_STATUS_PAIRING_NOT_SUPP, NULL, NULL); - break; - - case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: - { - ble_gap_evt_conn_param_update_request_t *request = &ble_evt->evt.gap_evt.params.conn_param_update_request; - sd_ble_gap_conn_param_update(device->conn_handle, &request->conn_params); - break; - } - } -} - -void common_hal_bleio_device_add_service(bleio_device_obj_t *device, bleio_service_obj_t *service) { - ble_uuid_t uuid; - bleio_uuid_convert_to_nrf_ble_uuid(service->uuid, &uuid); - - uint8_t service_type = BLE_GATTS_SRVC_TYPE_PRIMARY; - if (service->is_secondary) { - service_type = BLE_GATTS_SRVC_TYPE_SECONDARY; - } - - common_hal_bleio_adapter_set_enabled(true); - - const uint32_t err_code = sd_ble_gatts_service_add(service_type, &uuid, &service->handle); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to add service")); - } - - const mp_obj_list_t *characteristic_list = MP_OBJ_TO_PTR(service->characteristic_list); - for (size_t i = 0; i < characteristic_list->len; ++i) { - bleio_characteristic_obj_t *characteristic = characteristic_list->items[i]; - common_hal_bleio_service_add_characteristic(service, characteristic); - } -} - -void common_hal_bleio_device_start_advertising(bleio_device_obj_t *device, bool connectable, mp_buffer_info_t *raw_data) { - if (connectable) { - ble_drv_add_event_handler(on_ble_evt, device); - } - - const uint32_t err_code = set_advertisement_data(device, connectable, raw_data); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to start advertising")); - } -} - -void common_hal_bleio_device_stop_advertising(bleio_device_obj_t *device) { - uint32_t err_code; - -#if (BLUETOOTH_SD == 140) - if (m_adv_handle == BLE_GAP_ADV_SET_HANDLE_NOT_SET) - return; - - err_code = sd_ble_gap_adv_stop(m_adv_handle); -#else - err_code = sd_ble_gap_adv_stop(); -#endif - - if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE)) { - mp_raise_OSError_msg(translate("Failed to stop advertising")); - } -} - -void common_hal_bleio_device_connect(bleio_device_obj_t *device) { - ble_drv_add_event_handler(on_ble_evt, device); - - ble_gap_scan_params_t scan_params = { - .interval = MSEC_TO_UNITS(100, UNIT_0_625_MS), - .window = MSEC_TO_UNITS(100, UNIT_0_625_MS), -#if (BLUETOOTH_SD == 140) - .scan_phys = BLE_GAP_PHY_1MBPS, -#endif - }; - - common_hal_bleio_adapter_set_enabled(true); - - uint32_t err_code; -#if (BLUETOOTH_SD == 140) - err_code = sd_ble_gap_scan_start(&scan_params, &m_scan_buffer); -#else - err_code = sd_ble_gap_scan_start(&scan_params); -#endif - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to start scanning")); - } - - while (device->conn_handle == BLE_CONN_HANDLE_INVALID) { -#ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP -#endif - } - - // TODO: read name - - if (m_discovery_mutex == NULL) { - m_discovery_mutex = m_new_ll(nrf_mutex_t, 1); - - err_code = sd_mutex_new(m_discovery_mutex); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to create mutex")); - } - } - - // find services - bool found_service = discover_services(device, BLE_GATT_HANDLE_START); - while (found_service) { - const mp_obj_list_t *service_list = MP_OBJ_TO_PTR(device->service_list); - const bleio_service_obj_t *service = service_list->items[service_list->len - 1]; - - found_service = discover_services(device, service->end_handle + 1); - } - - // find characteristics in each service - const mp_obj_list_t *service_list = MP_OBJ_TO_PTR(device->service_list); - for (size_t i = 0; i < service_list->len; ++i) { - bleio_service_obj_t *service = service_list->items[i]; - - bool found_char = discover_characteristics(device, service, service->start_handle); - while (found_char) { - const mp_obj_list_t *characteristic_list = MP_OBJ_TO_PTR(service->characteristic_list); - const bleio_characteristic_obj_t *characteristic = characteristic_list->items[characteristic_list->len - 1]; - - const uint16_t next_handle = characteristic->handle + 1; - if (next_handle >= service->end_handle) { - break; - } - - found_char = discover_characteristics(device, service, next_handle); - } - } -} - -void common_hal_bleio_device_disconnect(bleio_device_obj_t *device) { - sd_ble_gap_disconnect(device->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); -} diff --git a/ports/nrf/common-hal/bleio/Peripheral.c b/ports/nrf/common-hal/bleio/Peripheral.c index 36c20373d3..69e75ff27d 100644 --- a/ports/nrf/common-hal/bleio/Peripheral.c +++ b/ports/nrf/common-hal/bleio/Peripheral.c @@ -3,8 +3,8 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Artur Pacholec * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Peripheral.h b/ports/nrf/common-hal/bleio/Peripheral.h index 9103fcf943..725bc14314 100644 --- a/ports/nrf/common-hal/bleio/Peripheral.h +++ b/ports/nrf/common-hal/bleio/Peripheral.h @@ -3,8 +3,8 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2018 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Scanner.c b/ports/nrf/common-hal/bleio/Scanner.c index 64f7decad2..6715bd7a28 100644 --- a/ports/nrf/common-hal/bleio/Scanner.c +++ b/ports/nrf/common-hal/bleio/Scanner.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/Service.c b/ports/nrf/common-hal/bleio/Service.c index 77d3f02599..55193c5cb0 100644 --- a/ports/nrf/common-hal/bleio/Service.c +++ b/ports/nrf/common-hal/bleio/Service.c @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/nrf/common-hal/bleio/Service.h b/ports/nrf/common-hal/bleio/Service.h index 7998cc862a..b5acf39ae0 100644 --- a/ports/nrf/common-hal/bleio/Service.h +++ b/ports/nrf/common-hal/bleio/Service.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/ports/nrf/common-hal/bleio/UUID.c b/ports/nrf/common-hal/bleio/UUID.c index 23e643433f..ebd6b6d1fb 100644 --- a/ports/nrf/common-hal/bleio/UUID.c +++ b/ports/nrf/common-hal/bleio/UUID.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/UUID.h b/ports/nrf/common-hal/bleio/UUID.h index b464093ea1..7d3a6204ec 100644 --- a/ports/nrf/common-hal/bleio/UUID.h +++ b/ports/nrf/common-hal/bleio/UUID.h @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/bleio/__init__.c b/ports/nrf/common-hal/bleio/__init__.c index cfb701019d..58b81f066d 100644 --- a/ports/nrf/common-hal/bleio/__init__.c +++ b/ports/nrf/common-hal/bleio/__init__.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index 05106d4905..538c87f2da 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -3,9 +3,10 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Sandeep Mistry All right reserved. - * Copyright (c) 2017 hathach + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 hathach + * Copyright (c) 2016 Sandeep Mistry All right reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index 8881bdc6b3..6ab6d9493b 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -1,9 +1,11 @@ /* * SPI Master library for nRF5x. - * Copyright (c) 2015 Arduino LLC - * Copyright (c) 2016 Sandeep Mistry All right reserved. - * Copyright (c) 2017 hathach + * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 hathach + * Copyright (c) 2016 Sandeep Mistry All right reserved. + * Copyright (c) 2015 Arduino LLC * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c index ea864e7ceb..7d9463d0be 100644 --- a/ports/nrf/mphalport.c +++ b/ports/nrf/mphalport.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2015 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2015 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Adapter.c b/shared-bindings/bleio/Adapter.c index d9449d3ab0..7b8df51034 100644 --- a/shared-bindings/bleio/Adapter.c +++ b/shared-bindings/bleio/Adapter.c @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/Adapter.h b/shared-bindings/bleio/Adapter.h index fe3886e59e..de9d1d6db1 100644 --- a/shared-bindings/bleio/Adapter.h +++ b/shared-bindings/bleio/Adapter.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2018 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/Address.h b/shared-bindings/bleio/Address.h index 9652a9841a..bff1542cf0 100644 --- a/shared-bindings/bleio/Address.h +++ b/shared-bindings/bleio/Address.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/AdvertisementData.h b/shared-bindings/bleio/AdvertisementData.h index 05b5a2c8da..3313cde3b2 100644 --- a/shared-bindings/bleio/AdvertisementData.h +++ b/shared-bindings/bleio/AdvertisementData.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/Characteristic.c b/shared-bindings/bleio/Characteristic.c index e48cfd433b..859611f91a 100644 --- a/shared-bindings/bleio/Characteristic.c +++ b/shared-bindings/bleio/Characteristic.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Characteristic.h b/shared-bindings/bleio/Characteristic.h index ffee6bdbc7..1938845a9a 100644 --- a/shared-bindings/bleio/Characteristic.h +++ b/shared-bindings/bleio/Characteristic.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -27,6 +28,7 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTIC_H #define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CHARACTERISTIC_H +#include "shared-module/bleio/Characteristic.h" #include "common-hal/bleio/Characteristic.h" extern const mp_obj_type_t bleio_characteristic_type; diff --git a/shared-bindings/bleio/CharacteristicBuffer.h b/shared-bindings/bleio/CharacteristicBuffer.h index f25017c19e..b45835ff39 100644 --- a/shared-bindings/bleio/CharacteristicBuffer.h +++ b/shared-bindings/bleio/CharacteristicBuffer.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Descriptor.c b/shared-bindings/bleio/Descriptor.c index b32f4f08ec..9e051c89e3 100644 --- a/shared-bindings/bleio/Descriptor.c +++ b/shared-bindings/bleio/Descriptor.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Descriptor.h b/shared-bindings/bleio/Descriptor.h index f47378ee16..f4634d3933 100644 --- a/shared-bindings/bleio/Descriptor.h +++ b/shared-bindings/bleio/Descriptor.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/Device.c b/shared-bindings/bleio/Device.c deleted file mode 100644 index fcdc84d270..0000000000 --- a/shared-bindings/bleio/Device.c +++ /dev/null @@ -1,362 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Glenn Ruben Bakke - * Copyright (c) 2018 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -#include "ble_drv.h" -#include "py/objarray.h" -#include "py/objproperty.h" -#include "py/objstr.h" -#include "py/runtime.h" -#include "shared-bindings/bleio/Adapter.h" -#include "shared-bindings/bleio/AddressType.h" -#include "shared-bindings/bleio/Characteristic.h" -#include "shared-bindings/bleio/Device.h" -#include "shared-bindings/bleio/Service.h" -#include "shared-bindings/bleio/UUID.h" -#include "shared-module/bleio/Device.h" -#include "shared-module/bleio/ScanEntry.h" - -// Work-in-progress: orphaned for now. -//| :orphan: -//| -//| .. currentmodule:: bleio -//| -//| :class:`Device` -- BLE device -//| ========================================================= -//| -//| **IGNORE ``Device`` and all its documentation. -//| It is being replaced by `Peripheral` and other classes.** -//| -//| Provides access a to BLE device, either in a Peripheral or Central role. -//| When a device is created without any parameter passed to the constructor, -//| it will be set to the Peripheral role. If a address is passed, the device -//| will be a Central. For a Peripheral you can set the `name`, add services -//| via `add_service` and then start and stop advertising via `bleio.Device.start_advertising` -//| and `bleio.Device.stop_advertising`. For the Central, you can `bleio.Device.connect` and `bleio.Device.disconnect` -//| to the device, once a connection is established, the device's services can -//| be accessed using `bleio.Device.services`. -//| -//| Usage:: -//| -//| import bleio -//| -//| # Peripheral -//| periph = bleio.Device() -//| -//| serv = bleio.Service(bleio.UUID(0x180f)) -//| p.add_service(serv) -//| -//| chara = bleio.Characteristic(bleio.UUID(0x2919)) -//| chara.read = True -//| chara.notify = True -//| serv.add_characteristic(chara) -//| -//| periph.start_advertising() -//| -//| # Central -//| scanner = bleio.Scanner() -//| entries = scanner.scan(2500) -//| -//| my_entry = None -//| for entry in entries: -//| if entry.name is not None and entry.name == 'MyDevice': -//| my_entry = entry -//| break -//| -//| central = bleio.Device(my_entry.address) -//| central.connect() -//| - -//| .. class:: Device(address=None, scan_entry=None) -//| -//| Create a new Device object. If the `address` or :py:data:`scan_entry` parameters are not `None`, -//| the role is set to Central, otherwise it's set to Peripheral. -//| -//| :param bleio.Address address: The address of the device to connect to -//| :param bleio.ScanEntry scan_entry: The scan entry returned from `bleio.Scanner` -//| - -//| .. attribute:: name -//| -//| For the Peripheral role, this property can be used to read and write the device's name. -//| For the Central role, this property will equal the name of the remote device, if one was -//| advertised by the device. In the Central role this property is read-only. -//| - -//| .. attribute:: services -//| -//| A `list` of `bleio.Service` that are offered by this device. (read-only) -//| For a Peripheral device, this list will contain services added using `add_service`, -//| for a Central, this list will be empty until a connection is established, at which point -//| it will be filled with the remote device's services. -//| - -//| .. method:: add_service(service) -//| -//| Appends the :py:data:`service` to the list of this devices's services. -//| This method can only be called for Peripheral devices. -//| -//| :param bleio.Service service: the service to append -//| - -//| .. method:: connect() -//| -//| Attempts a connection to the remote device. If the connection is successful, -//| the device's services are available via `services`. -//| This method can only be called for Central devices. -//| - -//| .. method:: disconnect() -//| -//| Disconnects from the remote device. -//| This method can only be called for Central devices. -//| - -//| .. method:: start_advertising(connectable=True) -//| -//| Starts advertising the device. The device's name and -//| services are put into the advertisement packets. -//| If :py:data:`connectable` is `True` then other devices are allowed to conncet to this device. -//| This method can only be called for Peripheral devices. -//| - -//| .. method:: stop_advertising() -//| -//| Disconnects from the remote device. -//| This method can only be called for Peripheral devices. -//| - -// TODO: Add unique MAC address part to name -static const char default_name[] = "CIRCUITPY"; - -STATIC void bleio_device_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - mp_printf(print, "Device(role: %s)", self->is_peripheral ? "Peripheral" : "Central"); -} - -STATIC mp_obj_t bleio_device_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) { - mp_arg_check_num(n_args, n_kw, 0, 1, true); - bleio_device_obj_t *self = m_new_obj(bleio_device_obj_t); - self->base.type = &bleio_device_type; - self->service_list = mp_obj_new_list(0, NULL); - self->notif_handler = mp_const_none; - self->conn_handler = mp_const_none; - self->conn_handle = 0xFFFF; - self->is_peripheral = true; - - mp_map_t kw_args; - mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args); - - enum { ARG_address, ARG_scan_entry }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_address, MP_ARG_OBJ, {.u_obj = mp_const_none} }, - { MP_QSTR_scan_entry, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.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 address_obj = args[ARG_address].u_obj; - const mp_obj_t scan_entry_obj = args[ARG_scan_entry].u_obj; - - if (address_obj != mp_const_none) { - bleio_address_obj_t *address = MP_OBJ_TO_PTR(address_obj); - - self->is_peripheral = false; - self->address.type = address->type; - memcpy(self->address.value, address->value, BLEIO_ADDRESS_BYTES); - } else if (scan_entry_obj != mp_const_none) { - bleio_scanentry_obj_t *scan_entry = MP_OBJ_TO_PTR(scan_entry_obj); - - self->is_peripheral = false; - self->address.type = scan_entry->address.type; - memcpy(self->address.value, scan_entry->address.value, BLEIO_ADDRESS_BYTES); - } else { - self->name = mp_obj_new_str(default_name, strlen(default_name)); - common_hal_bleio_adapter_get_address(&self->address); - } - - return MP_OBJ_FROM_PTR(self); -} - -STATIC mp_obj_t bleio_device_add_service(mp_obj_t self_in, mp_obj_t service_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - bleio_service_obj_t *service = MP_OBJ_TO_PTR(service_in); - - if (!self->is_peripheral) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, - translate("Can't add services in Central mode"))); - } - - service->device = self; - - mp_obj_list_append(self->service_list, service); - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_device_add_service_obj, bleio_device_add_service); - -STATIC mp_obj_t bleio_device_connect(mp_obj_t self_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (self->is_peripheral) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, - translate("Can't connect in Peripheral mode"))); - } - - common_hal_bleio_device_connect(self); - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_device_connect_obj, bleio_device_connect); - -STATIC mp_obj_t bleio_device_disconnect(mp_obj_t self_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - common_hal_bleio_device_disconnect(self); - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_device_disconnect_obj, bleio_device_disconnect); - -STATIC mp_obj_t bleio_device_get_name(mp_obj_t self_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - return self->name; -} -MP_DEFINE_CONST_FUN_OBJ_1(bleio_device_get_name_obj, bleio_device_get_name); - -static mp_obj_t bleio_device_set_name(mp_obj_t self_in, mp_obj_t value) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (!self->is_peripheral) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, - translate("Can't change the name in Central mode"))); - } - - self->name = value; - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_device_set_name_obj, bleio_device_set_name); - -const mp_obj_property_t bleio_device_name_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_device_get_name_obj, - (mp_obj_t)&bleio_device_set_name_obj, - (mp_obj_t)&mp_const_none_obj }, -}; - -STATIC mp_obj_t bleio_device_start_advertising(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - - if (!self->is_peripheral) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, - translate("Can't advertise in Central mode"))); - } - - enum { ARG_connectable, ARG_data }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_connectable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, - { MP_QSTR_data, 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); - - mp_buffer_info_t bufinfo = { 0 }; - if (args[ARG_data].u_obj != mp_const_none) { - mp_get_buffer_raise(args[ARG_data].u_obj, &bufinfo, MP_BUFFER_READ); - } - - const mp_obj_list_t *service_list = MP_OBJ_TO_PTR(self->service_list); - for (size_t i = 0; i < service_list->len; ++i) { - bleio_service_obj_t *service = service_list->items[i]; - if (service->handle == 0xFFFF) { - common_hal_bleio_device_add_service(self, service); - } - } - - common_hal_bleio_device_start_advertising(self, args[ARG_connectable].u_bool, &bufinfo); - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_device_start_advertising_obj, 0, bleio_device_start_advertising); - -STATIC mp_obj_t bleio_device_stop_advertising(mp_obj_t self_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - if (!self->is_peripheral) { - nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, - translate("Can't advertise in Central mode"))); - } - - common_hal_bleio_device_stop_advertising(self); - - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_device_stop_advertising_obj, bleio_device_stop_advertising); - -STATIC mp_obj_t bleio_device_get_services(mp_obj_t self_in) { - bleio_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - return self->service_list; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_device_get_services_obj, bleio_device_get_services); - -const mp_obj_property_t bleio_device_services_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_device_get_services_obj, - (mp_obj_t)&mp_const_none_obj, - (mp_obj_t)&mp_const_none_obj }, -}; - -STATIC const mp_rom_map_elem_t bleio_device_locals_dict_table[] = { - // Methods - { MP_ROM_QSTR(MP_QSTR_add_service), MP_ROM_PTR(&bleio_device_add_service_obj) }, - { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&bleio_device_connect_obj) }, - { MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&bleio_device_disconnect_obj) }, - { MP_ROM_QSTR(MP_QSTR_start_advertising), MP_ROM_PTR(&bleio_device_start_advertising_obj) }, - { MP_ROM_QSTR(MP_QSTR_stop_advertising), MP_ROM_PTR(&bleio_device_stop_advertising_obj) }, - - // Properties - { MP_ROM_QSTR(MP_QSTR_name), MP_ROM_PTR(&bleio_device_name_obj) }, - { MP_ROM_QSTR(MP_QSTR_services), MP_ROM_PTR(&bleio_device_services_obj) }, -}; - -STATIC MP_DEFINE_CONST_DICT(bleio_device_locals_dict, bleio_device_locals_dict_table); - -const mp_obj_type_t bleio_device_type = { - { &mp_type_type }, - .name = MP_QSTR_Device, - .print = bleio_device_print, - .make_new = bleio_device_make_new, - .locals_dict = (mp_obj_dict_t*)&bleio_device_locals_dict -}; diff --git a/shared-bindings/bleio/Device.h b/shared-bindings/bleio/Device.h index e452a8ad6c..d19b8c886b 100644 --- a/shared-bindings/bleio/Device.h +++ b/shared-bindings/bleio/Device.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/Peripheral.c b/shared-bindings/bleio/Peripheral.c index 5397f4c3ab..e270c599c6 100644 --- a/shared-bindings/bleio/Peripheral.c +++ b/shared-bindings/bleio/Peripheral.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Peripheral.h b/shared-bindings/bleio/Peripheral.h index 6468325c27..16438bba6d 100644 --- a/shared-bindings/bleio/Peripheral.h +++ b/shared-bindings/bleio/Peripheral.h @@ -3,8 +3,8 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2018 Dan Halbert for Adafruit Industries * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/ScanEntry.h b/shared-bindings/bleio/ScanEntry.h index c1b52e6b4e..3a02f2facf 100644 --- a/shared-bindings/bleio/ScanEntry.h +++ b/shared-bindings/bleio/ScanEntry.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * Copyright (c) 2017 Glenn Ruben Bakke * diff --git a/shared-bindings/bleio/Service.c b/shared-bindings/bleio/Service.c index 352ef8d6a8..2719164d88 100644 --- a/shared-bindings/bleio/Service.c +++ b/shared-bindings/bleio/Service.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2017 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/Service.h b/shared-bindings/bleio/Service.h index 27d79f9539..6693cc3bb3 100644 --- a/shared-bindings/bleio/Service.h +++ b/shared-bindings/bleio/Service.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -27,12 +28,11 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SERVICE_H #define MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_SERVICE_H -#include "shared-module/bleio/Characteristic.h" #include "common-hal/bleio/Service.h" 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 *char_list, bool is_secondary); +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 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_secondary(bleio_service_obj_t *self); diff --git a/shared-bindings/bleio/UUID.c b/shared-bindings/bleio/UUID.c index f79dfa6752..9725050586 100644 --- a/shared-bindings/bleio/UUID.c +++ b/shared-bindings/bleio/UUID.c @@ -3,9 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2017 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec - * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * Copyright (c) 2017 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-bindings/bleio/UUID.h b/shared-bindings/bleio/UUID.h index aef2c1e29e..caf039aecb 100644 --- a/shared-bindings/bleio/UUID.h +++ b/shared-bindings/bleio/UUID.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-bindings/bleio/__init__.c b/shared-bindings/bleio/__init__.c index 06c00d5880..ca45a846ec 100644 --- a/shared-bindings/bleio/__init__.c +++ b/shared-bindings/bleio/__init__.c @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,11 +54,10 @@ //| Address //| AdvertisementData //| Adapter +//| Central //| Characteristic //| CharacteristicBuffer -// Work-in-progress classes are omitted, and marked as :orphan: in their files. // Descriptor -// Device //| Peripheral //| ScanEntry //| Scanner @@ -74,6 +74,7 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bleio) }, { MP_ROM_QSTR(MP_QSTR_Address), MP_ROM_PTR(&bleio_address_type) }, +// { MP_ROM_QSTR(MP_QSTR_Central), MP_ROM_PTR(&bleio_central_type) }, { MP_ROM_QSTR(MP_QSTR_Characteristic), MP_ROM_PTR(&bleio_characteristic_type) }, { MP_ROM_QSTR(MP_QSTR_CharacteristicBuffer), MP_ROM_PTR(&bleio_characteristic_buffer_type) }, // { MP_ROM_QSTR(MP_QSTR_Descriptor), MP_ROM_PTR(&bleio_descriptor_type) }, diff --git a/shared-bindings/bleio/__init__.h b/shared-bindings/bleio/__init__.h index 1f4e0a66ff..4aa6dd45b7 100644 --- a/shared-bindings/bleio/__init__.h +++ b/shared-bindings/bleio/__init__.h @@ -3,8 +3,9 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec + * Copyright (c) 2016 Glenn Ruben Bakke * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/shared-module/bleio/Address.h b/shared-module/bleio/Address.h index f66e97d640..eb1aab2581 100644 --- a/shared-module/bleio/Address.h +++ b/shared-module/bleio/Address.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-module/bleio/AdvertisementData.h b/shared-module/bleio/AdvertisementData.h index 66855172ab..89cdfb0700 100644 --- a/shared-module/bleio/AdvertisementData.h +++ b/shared-module/bleio/AdvertisementData.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/shared-module/bleio/Characteristic.h b/shared-module/bleio/Characteristic.h deleted file mode 100644 index 3132fd47b4..0000000000 --- a/shared-module/bleio/Characteristic.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H -#define MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H - -// Flags for each characteristic property. Common across ports. -typedef struct { - bool broadcast : 1; - bool read : 1; - bool write_no_response : 1; - bool write : 1; - bool notify : 1; - bool indicate : 1; -} bleio_characteristic_properties_t; - -// bleio_characteristic_obj_t is defined in ports/*/common-hal. - -#endif // MICROPY_INCLUDED_SHARED_MODULE_BLEIO_CHARACTERISTIC_H diff --git a/shared-module/bleio/Device.h b/shared-module/bleio/Device.h deleted file mode 100644 index 8d9ece5ef0..0000000000 --- a/shared-module/bleio/Device.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2018 Artur Pacholec - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MICROPY_INCLUDED_SHARED_MODULE_BLEIO_DEVICE_H -#define MICROPY_INCLUDED_SHARED_MODULE_BLEIO_DEVICE_H - -#include - -#include "shared-module/bleio/Address.h" - -typedef struct { - mp_obj_base_t base; - bool is_peripheral; - mp_obj_t name; - bleio_address_obj_t address; - volatile uint16_t conn_handle; - mp_obj_t service_list; - mp_obj_t notif_handler; - mp_obj_t conn_handler; -} bleio_device_obj_t; - -#endif // MICROPY_INCLUDED_SHARED_MODULE_BLEIO_DEVICE_H diff --git a/shared-module/bleio/ScanEntry.h b/shared-module/bleio/ScanEntry.h index 40e02f9fa0..4e7028ba2a 100644 --- a/shared-module/bleio/ScanEntry.h +++ b/shared-module/bleio/ScanEntry.h @@ -3,6 +3,7 @@ * * The MIT License (MIT) * + * Copyright (c) 2019 Dan Halbert for Adafruit Industries * Copyright (c) 2018 Artur Pacholec * * Permission is hereby granted, free of charge, to any person obtaining a copy