Skip to content

Commit 091c8c0

Browse files
committed
v1.6.0
- update NimBLE dependency version (2.1.0) - add uv & pressure data - add function to check whether is subscribed to notifications - add chunked data transfer mode (enable/disabled)
1 parent e06f950 commit 091c8c0

File tree

9 files changed

+194
-61
lines changed

9 files changed

+194
-61
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
*.py
2+
33
.pio
44
.vscode
55

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ void loop(); // handles routine functions
3535
bool isRunning(); // check whether BLE server is inited and running
3636
void setName(String name); // set the BLE name (call before begin)
3737
void setScreen(ChronosScreen screen); // set the screen config (call before begin)
38+
void setChunkedTransfer(bool chunked);
39+
bool isSubscribed();
3840
3941
// watch
4042
bool isConnected();

examples/watch/watch.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ void configCallback(Config config, uint32_t a, uint32_t b)
270270
Serial.print("\tLow:");
271271
Serial.print(w.low);
272272
Serial.println("°C");
273+
if (i == 0)
274+
{
275+
Serial.print("Pressure: ");
276+
Serial.print(w.pressure);
277+
Serial.print("\tUV: ");
278+
Serial.println(w.uv);
279+
}
273280
}
274281
}
275282
}

library.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ChronosESP32",
3-
"version": "1.5.1",
3+
"version": "1.6.0",
44
"keywords": "Arduino, ESP32, Time, BLE, Watch",
55
"description": "A library for ESP32 to interface with Chronos app over BLE",
66
"repository":
@@ -19,8 +19,8 @@
1919
"frameworks": "arduino",
2020
"platforms": "espressif32",
2121
"dependencies": {
22-
"h2zero/NimBLE-Arduino": "*",
23-
"fbiego/ESP32Time": "*"
22+
"h2zero/NimBLE-Arduino": "^2.1.0",
23+
"fbiego/ESP32Time": "^2.0.6"
2424
},
2525
"headers": "ChronosESP32.h"
2626
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ChronosESP32
2-
version=1.5.1
2+
version=1.6.0
33
author=fbiego
44
maintainer=fbiego
55
sentence=Setup your ESP32 as a smartwatch and connect to Chronos app over BLE.

platformio.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ src_dir = examples/watch
2222
[env]
2323
platform = espressif32
2424
framework = arduino
25+
extra_scripts = post:scripts/copy.py
2526

2627
lib_deps =
2728
; use src folder as library
2829
file://./src
2930
; external library dependencies
3031
fbiego/ESP32Time@^2.0.6
31-
h2zero/NimBLE-Arduino@^1.4.1
32+
h2zero/NimBLE-Arduino@^2.1.0
3233

3334
[env:esp32dev]
3435
board = esp32dev

scripts/copy.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
import shutil
3+
import os
4+
5+
Import("env")
6+
7+
def copy_files_recursive(src_dir, dest_dir):
8+
"""Recursively copies files and directories from the source to the destination.
9+
10+
Args:
11+
src_dir: The source directory.
12+
dest_dir: The destination directory.
13+
"""
14+
print(f"Updating source files to {dest_dir}")
15+
16+
for item in os.listdir(src_dir):
17+
src_item = os.path.join(src_dir, item)
18+
dst_item = os.path.join(dest_dir, item)
19+
20+
if os.path.isdir(src_item):
21+
shutil.copytree(src_item, dst_item, dirs_exist_ok=True)
22+
else:
23+
shutil.copy2(src_item, dst_item)
24+
25+
try:
26+
pioenv = env._dict['PIOENV']
27+
print(f"PlatformIO environment: {pioenv}")
28+
except (KeyError, AttributeError):
29+
print("PlatformIO environment not found in the SCons Environment.")
30+
pioenv = "devkit"
31+
32+
sep = os.sep
33+
copy_files_recursive(f"src{sep}", f".pio{sep}libdeps{sep}{pioenv}{sep}src{sep}")
34+

0 commit comments

Comments
 (0)