Skip to content

Commit

Permalink
updates docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrvadala committed Feb 19, 2024
1 parent caeed2c commit 6b1d20b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
29 changes: 21 additions & 8 deletions ble-test-device/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

9 changes: 4 additions & 5 deletions docs/documentation-testing.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b1d20b

Please sign in to comment.