Skip to content

Commit

Permalink
add notification to CurrentTimeService (#21)
Browse files Browse the repository at this point in the history
* add notifications to service

* add cmakelists to libraries
  • Loading branch information
paul-szczepanek-arm authored Dec 30, 2020
1 parent 4b16d4b commit 3bd3783
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
24 changes: 24 additions & 0 deletions services/CurrentTime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_library(ble-service-current-time INTERFACE)

target_include_directories(ble-service-current-time
INTERFACE
.
include
)

target_sources(ble-service-current-time
INTERFACE
source/CurrentTimeService.cpp
)

target_link_libraries(ble-service-current-time
INTERFACE
mbed-ble
mbed-events
mbed-core
)


8 changes: 6 additions & 2 deletions services/CurrentTime/source/CurrentTimeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

#include "CurrentTimeService.h"
#include "ble-service-current-time/CurrentTimeService.h"

#define CURRENT_TIME_CHAR_VALUE_SIZE 10
#define DATA_FIELD_IGNORED 0x80
Expand All @@ -27,7 +27,11 @@ constexpr std::chrono::seconds CurrentTimeService::UPDATE_TIME_PERIOD;
CurrentTimeService::CurrentTimeService(BLE &ble, events::EventQueue &event_queue) :
_ble(ble),
_event_queue(event_queue),
_current_time_char(GattCharacteristic::UUID_CURRENT_TIME_CHAR, &_current_time)
_current_time_char(
GattCharacteristic::UUID_CURRENT_TIME_CHAR,
&_current_time,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY
)
{
}

Expand Down
21 changes: 21 additions & 0 deletions services/LinkLoss/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_library(ble-service-link-loss INTERFACE)

target_include_directories(ble-service-link-loss
INTERFACE
.
include
)

target_sources(ble-service-link-loss
INTERFACE
source/LinkLossService.cpp
)

target_link_libraries(ble-service-link-loss
INTERFACE
mbed-ble
mbed-events
)

0 comments on commit 3bd3783

Please sign in to comment.