Skip to content

Commit

Permalink
v1.6.0
Browse files Browse the repository at this point in the history
- 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)
  • Loading branch information
fbiego committed Jan 4, 2025
1 parent e06f950 commit 091c8c0
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

*.py

.pio
.vscode

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ void loop(); // handles routine functions
bool isRunning(); // check whether BLE server is inited and running
void setName(String name); // set the BLE name (call before begin)
void setScreen(ChronosScreen screen); // set the screen config (call before begin)
void setChunkedTransfer(bool chunked);
bool isSubscribed();
// watch
bool isConnected();
Expand Down
7 changes: 7 additions & 0 deletions examples/watch/watch.ino
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ void configCallback(Config config, uint32_t a, uint32_t b)
Serial.print("\tLow:");
Serial.print(w.low);
Serial.println("°C");
if (i == 0)
{
Serial.print("Pressure: ");
Serial.print(w.pressure);
Serial.print("\tUV: ");
Serial.println(w.uv);
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ChronosESP32",
"version": "1.5.1",
"version": "1.6.0",
"keywords": "Arduino, ESP32, Time, BLE, Watch",
"description": "A library for ESP32 to interface with Chronos app over BLE",
"repository":
Expand All @@ -19,8 +19,8 @@
"frameworks": "arduino",
"platforms": "espressif32",
"dependencies": {
"h2zero/NimBLE-Arduino": "*",
"fbiego/ESP32Time": "*"
"h2zero/NimBLE-Arduino": "^2.1.0",
"fbiego/ESP32Time": "^2.0.6"
},
"headers": "ChronosESP32.h"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ChronosESP32
version=1.5.1
version=1.6.0
author=fbiego
maintainer=fbiego
sentence=Setup your ESP32 as a smartwatch and connect to Chronos app over BLE.
Expand Down
3 changes: 2 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ src_dir = examples/watch
[env]
platform = espressif32
framework = arduino
extra_scripts = post:scripts/copy.py

lib_deps =
; use src folder as library
file://./src
; external library dependencies
fbiego/ESP32Time@^2.0.6
h2zero/NimBLE-Arduino@^1.4.1
h2zero/NimBLE-Arduino@^2.1.0

[env:esp32dev]
board = esp32dev
Expand Down
34 changes: 34 additions & 0 deletions scripts/copy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

import shutil
import os

Import("env")

def copy_files_recursive(src_dir, dest_dir):
"""Recursively copies files and directories from the source to the destination.
Args:
src_dir: The source directory.
dest_dir: The destination directory.
"""
print(f"Updating source files to {dest_dir}")

for item in os.listdir(src_dir):
src_item = os.path.join(src_dir, item)
dst_item = os.path.join(dest_dir, item)

if os.path.isdir(src_item):
shutil.copytree(src_item, dst_item, dirs_exist_ok=True)
else:
shutil.copy2(src_item, dst_item)

try:
pioenv = env._dict['PIOENV']
print(f"PlatformIO environment: {pioenv}")
except (KeyError, AttributeError):
print("PlatformIO environment not found in the SCons Environment.")
pioenv = "devkit"

sep = os.sep
copy_files_recursive(f"src{sep}", f".pio{sep}libdeps{sep}{pioenv}{sep}src{sep}")

Loading

0 comments on commit 091c8c0

Please sign in to comment.