diff options
author | uvok | 2025-07-20 11:16:11 +0200 |
---|---|---|
committer | uvok | 2025-07-20 12:41:58 +0200 |
commit | 7791f43fb1b328e470ed14facc064f4252ce636e (patch) | |
tree | 4d6c3647e3d8c4933d53f8f1031aa8bcf30446e9 /src/main.cpp | |
parent | f5794c6f8b8a1f736ea7a524e72aed46baba4bd6 (diff) |
Handle r/w/notify properly
signal back bluetooth selection
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index b5afe53..31d1047 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,12 +44,16 @@ void loop() uint16_t pressDuration = de::uvok::badge::gpio_poll(); if (pressDuration < 64) { + uint8_t newNum = UINT8_MAX; if (pressDuration == NEXT_KEY) de::uvok::badge::display_next(); if (pressDuration == PRV_KEY) de::uvok::badge::display_prev(); if (pressDuration == OK_KEY) - de::uvok::badge::display_refresh(); + newNum = de::uvok::badge::display_refresh(); + + if (newNum != UINT8_MAX) + de::uvok::badge::ble_set_image(newNum); } else if (pressDuration > PRESS_TIME_BLE_ADV) { @@ -61,6 +65,14 @@ void loop() de::uvok::badge::display_demo(); } + { + de::uvok::badge::ble_poll_result_t pollres = de::uvok::badge::ble_poll(); + if (pollres.has_data) + { + de::uvok::badge::display_direct(pollres.new_template); + } + } + // if (millis() - releasedTime > SLEEP_TIME && !pAdvertising->isAdvertising()) // { // Serial.println("Go to sleep..."); |