-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
43 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
/*!***************************************************************** | ||
* Copyright 2023, Victor Chavez | ||
* Copyright 2023-2024, Victor Chavez | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* @file uptime_service.cpp | ||
* @author Victor Chavez ([email protected]) | ||
* @date 13.03.2023 | ||
* | ||
* @brief | ||
* BLE Service implementation | ||
|
@@ -12,9 +11,11 @@ | |
* - language: C++17 | ||
* - OS: Zephyr v3.2.x | ||
********************************************************************/ | ||
|
||
#include <zephyr/logging/log.h> | ||
#include "uptime_service.hpp" | ||
|
||
LOG_MODULE_REGISTER(uptime_svc, CONFIG_LOG_DEFAULT_LEVEL); | ||
|
||
namespace uptime | ||
{ | ||
|
||
|
@@ -50,20 +51,35 @@ Notify::Notify(): | |
{ | ||
} | ||
|
||
void Notify::ccc_changed(CCCValue_e value) | ||
{ | ||
int val = static_cast<int>(value); | ||
LOG_INF("Characteristic Notify Uptime CCC changed %d\n",val); | ||
} | ||
|
||
Indicate::Indicate(): | ||
ble_utils::gatt::CharacteristicIndicate((const bt_uuid*)&uuid::char_indicate) | ||
{ | ||
} | ||
|
||
void Indicate::ccc_changed(CCCValue_e value) | ||
{ | ||
int val = static_cast<int>(value); | ||
LOG_INF("Characteristic Indicate Uptime CCC changed %d\n",val); | ||
} | ||
void Indicate::indicate_rsp() | ||
{ | ||
LOG_INF("Characteristic Indicate Uptime Completed\n"); | ||
} | ||
|
||
} // namespace characteristic | ||
|
||
Service::Service(): | ||
ble_utils::gatt::Service((const bt_uuid*)&uuid::svc_base) | ||
{ | ||
register_char(&m_basic); | ||
|
||
register_char(&m_indicate); | ||
register_char(&m_notify); | ||
register_char(&m_notify); | ||
} | ||
|
||
void Service::update(uint32_t uptime) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters