From 6b1d20babcae794d443c56fa77c6b2be39afc3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Vadal=C3=A0?= Date: Mon, 19 Feb 2024 19:18:41 +0100 Subject: [PATCH] updates docs --- README.md | 1 + ble-test-device/README.md | 29 +++++++++++++++++++++-------- docs/documentation-testing.md | 9 ++++----- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8f73f7d..96a8335 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ It leverages on Bluez driver, a component supported by the following platforms a - **1.7** - Fixes compatibility issue [#30](https://github.com/chrvadala/node-ble/issues/30); Adds JSdoc; Deprecates NodeJS 10 and 12; Upgrades deps; - **1.8** - Upgrades deps and gh-actions os; Adds `Bluetooth.activeAdapters()` func [#45](https://github.com/chrvadala/node-ble/pull/45); - **1.9** - Upgrades deps; Adds `writeValueWithoutResponse()` and `writeValueWithResponse` methods [#47](https://github.com/chrvadala/node-ble/pull/47); Improves typescript definition [#48](https://github.com/chrvadala/node-ble/pull/48) +- **1.10** - Upgrades deps and gh-actions; Fixes memory leak [#37](https://github.com/chrvadala/node-ble/pull/37); Makes MAC Address case insensitive # Contributors - [chrvadala](https://github.com/chrvadala) (author) diff --git a/ble-test-device/README.md b/ble-test-device/README.md index cc03304..4c4e0be 100644 --- a/ble-test-device/README.md +++ b/ble-test-device/README.md @@ -7,24 +7,37 @@ Read [Testing](https://github.com/chrvadala/node-ble/blob/main/docs/documentatio ### 1. PlatformIO Setup Install PlatformIO Core by following the instructions on the [official PlatformIO website](https://platformio.org/install/cli). -````bash +```bash curl -fsSL -o get-platformio.py https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py python3 get-platformio.py -```` +``` ### 2. Build firmware and flash device -````bash +```bash cd ble-test-device/ pio run -t upload -```` +``` -### 3. Watch logs (Optional) -````bash +### 3. Read MAC Address and watch logs +```bash pio device monitor -```` +``` +When everything works fine, you can see a log like that, generated by your test device. +``` +Boot +Device UUID: 00:00:00:00:00:00 +Ready +Client connected +Notifications and indications are disabled +Characteristic1 value written: hello_world_%{ISO_TS} +Characteristic1 value read: ECHO>hello_world_%{ISO_TS} +Notifications or indications are enabled +Client disconnected +``` + --- -_References_ +_References:_ - https://en.wikipedia.org/wiki/ESP32 - https://github.com/arduino-libraries/ArduinoBLE diff --git a/docs/documentation-testing.md b/docs/documentation-testing.md index 7a0fc26..eb4446f 100644 --- a/docs/documentation-testing.md +++ b/docs/documentation-testing.md @@ -1,8 +1,8 @@ # Running tests This library provides two test suites: -- Unit tests: Their available in the `/test` folder and they test every single component. -- End to end tests: They're available in the `/test-e2e` folder and they test the interaction with a real bluetooth device that you spawn on your own. +- Unit tests: They are available in the `/test` folder and they test every single component. +- End to end tests: They are available in the `/test-e2e` folder and they test the interaction with a real bluetooth device that you spawn on your own. ## Pre-requisite @@ -31,10 +31,9 @@ npm test ## Run end to end (e2e) tests The end to end test will try to connect to a real bluetooth device and read some characteristics. To do that, you need two different devices. -Prior to that, you need to create a test device. [A guide is available -here](https://github.com/chrvadala/node-ble/blob/main/ble-test-device). +Prior to that, you need to create a test device via [installation guide](https://github.com/chrvadala/node-ble/blob/main/ble-test-device). -After you have prepared the device, you have to connect it via bluetooth and read its MAC Address, then launch... +After you have prepared the device, you have to read via USB its mac address, then lunch the test suite. ```shell script TEST_DEVICE=00:00:00:00:00:00 npm run test:e2e