diff --git a/.travis.yml b/.travis.yml index abb43697..0ac07cee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,9 +68,9 @@ after_success: before_install: - sudo apt-get update -qq - - wget https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.sh + - wget https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.sh - mkdir /opt/cmake - - sh cmake-3.11.4-Linux-x86_64.sh --prefix=/opt/cmake --skip-license + - sh cmake-3.14.2-Linux-x86_64.sh --prefix=/opt/cmake --skip-license - wget https://launchpad.net/%7Eboost-latest/+archive/ubuntu/ppa/+files/libboost1.55-dev_1.55.0-1ppa1%7Esaucy1_amd64.deb - sudo dpkg --install libboost1.55-dev_1.55.0-1ppa1~saucy1_amd64.deb # - openssl aes-256-cbc -K $encrypted_eb6359394db6_key -iv $encrypted_eb6359394db6_iv -in config/travisci_rsa.enc -out config/travisci_rsa -d diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c3cbaa4..db2d6d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.14) # Prevent in source build, add this options before project keyword set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) @@ -7,15 +7,21 @@ project(lib_bluetoe CXX) add_library(bluetoe_iface INTERFACE) add_library(bluetoe::iface ALIAS bluetoe_iface) target_include_directories(bluetoe_iface INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_features(bluetoe_iface INTERFACE cxx_std_11) + add_subdirectory(bluetoe/link_layer) +add_subdirectory(bluetoe/scheduled_radio) +add_subdirectory(bluetoe/hci) add_subdirectory(bluetoe/utility) add_subdirectory(bluetoe/sm) add_subdirectory(bluetoe/services) if (CMAKE_CROSSCOMPILING) add_subdirectory(bluetoe/bindings/nrf51) -endif () +endif() + +add_subdirectory(bluetoe/bindings/hci) if (NOT CMAKE_CROSSCOMPILING) enable_testing() diff --git a/bluetoe/bindings/hci/CMakeLists.txt b/bluetoe/bindings/hci/CMakeLists.txt new file mode 100644 index 00000000..b66e4662 --- /dev/null +++ b/bluetoe/bindings/hci/CMakeLists.txt @@ -0,0 +1,13 @@ +add_library(bluetoe_bindings_hci_libusb STATIC libusb.cpp) +add_library(bluetoe::bindings::hci_libusb ALIAS bluetoe_bindings_hci_libusb) + +target_include_directories(bluetoe_bindings_hci_libusb + INTERFACE + include_libusb) + +target_link_libraries(bluetoe_bindings_hci_libusb + PUBLIC + bluetoe::hci + bluetoe::utility + bluetoe::linklayer +) diff --git a/bluetoe/bindings/hci/include_libusb/bluetoe/device.hpp b/bluetoe/bindings/hci/include_libusb/bluetoe/device.hpp new file mode 100644 index 00000000..3cc5eea5 --- /dev/null +++ b/bluetoe/bindings/hci/include_libusb/bluetoe/device.hpp @@ -0,0 +1,14 @@ +#ifndef BLUETOE_BINDINGS_HCI_DEVICE_HPP +#define BLUETOE_BINDINGS_HCI_DEVICE_HPP + +#include +#include + +namespace bluetoe +{ + template < class Server, typename ... Options > + using device = bluetoe::hci::link_layer< Server, hci_details::libsub_transport, Options... >; +} + +#endif + diff --git a/bluetoe/bindings/hci/include_libusb/bluetoe/libsub.hpp b/bluetoe/bindings/hci/include_libusb/bluetoe/libsub.hpp new file mode 100644 index 00000000..8721cc31 --- /dev/null +++ b/bluetoe/bindings/hci/include_libusb/bluetoe/libsub.hpp @@ -0,0 +1,14 @@ +#ifndef BLUETOE_BINDINGS_HCI_LIBUSB_HPP +#define BLUETOE_BINDINGS_HCI_LIBUSB_HPP + +namespace bluetoe { + + namespace hci_details { + template < typename LinkLayer > + class libsub_transport { + + }; + } +} + +#endif diff --git a/bluetoe/bindings/hci/libusb.cpp b/bluetoe/bindings/hci/libusb.cpp new file mode 100644 index 00000000..e69de29b diff --git a/bluetoe/bindings/nrf51/CMakeLists.txt b/bluetoe/bindings/nrf51/CMakeLists.txt index 242934f6..1c76e66e 100644 --- a/bluetoe/bindings/nrf51/CMakeLists.txt +++ b/bluetoe/bindings/nrf51/CMakeLists.txt @@ -2,8 +2,21 @@ add_library(bluetoe_bindings_nrf51 STATIC nrf51.cpp) add_library(bluetoe::bindings::nrf51 ALIAS bluetoe_bindings_nrf51) +# Currently nrf52 is equal to nrf51, which is wrong if one looks at the details +add_library(bluetoe::bindings::nrf52 ALIAS bluetoe_bindings_nrf51) + target_include_directories(bluetoe_bindings_nrf51 PUBLIC include) -target_link_libraries(bluetoe_bindings_nrf51 PUBLIC bluetoe::utility bluetoe::sm bluetoe::iface bluetoe::linklayer PRIVATE toolchain::${BINDING}) +target_link_libraries(bluetoe_bindings_nrf51 + PUBLIC + bluetoe::utility + bluetoe::sm + bluetoe::iface + bluetoe::linklayer + bluetoe::scheduled_radio + PRIVATE + toolchain::${BINDING} +) + target_compile_features(bluetoe_bindings_nrf51 PRIVATE cxx_std_11) target_compile_options(bluetoe_bindings_nrf51 PRIVATE -Wall -pedantic -Wextra -Wfatal-errors -Wno-parentheses) diff --git a/bluetoe/hci/CMakeLists.txt b/bluetoe/hci/CMakeLists.txt new file mode 100644 index 00000000..1e1ff61c --- /dev/null +++ b/bluetoe/hci/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0079 NEW) + +add_library(bluetoe_hci INTERFACE) +add_library(bluetoe::hci ALIAS bluetoe_hci) + +target_include_directories(bluetoe_hci INTERFACE include) +target_link_libraries(bluetoe_hci INTERFACE bluetoe::sm bluetoe::iface) diff --git a/bluetoe/hci/include/bluetoe/link_layer.hpp b/bluetoe/hci/include/bluetoe/link_layer.hpp new file mode 100644 index 00000000..da3a6677 --- /dev/null +++ b/bluetoe/hci/include/bluetoe/link_layer.hpp @@ -0,0 +1,64 @@ +#ifndef BLUETOE_HCI_LINK_LAYER_HPP +#define BLUETOE_HCI_LINK_LAYER_HPP + +#include + +namespace bluetoe { +namespace hci { + + /** + * @brief link layer implementation based on HCI + */ + template < + class Server, + template < typename > + class Transport, + typename ... Options + > + class link_layer : Transport< link_layer< Server, Transport, Options... > > + { + public: + /** + * @brief this function passes the CPU to the link layer implementation + * + * This function should return on certain events to alow user code to do + * usefull things. Details depend on the ScheduleRadio implemention. + */ + void run( Server& ); + + /** + * @brief initiating the change of communication parameters of an established connection + * + * If it was not possible to initiate the connection parameter update, the function returns false. + * @todo Add parameter that identifies the connection. + */ + bool connection_parameter_update_request( std::uint16_t interval_min, std::uint16_t interval_max, std::uint16_t latency, std::uint16_t timeout ); + + /** + * @brief terminates the give connection + * + * @todo Add parameter that identifies the connection. + */ + void disconnect(); + + /** + * @brief fills the given buffer with l2cap advertising payload + */ + std::size_t fill_l2cap_advertising_data( std::uint8_t* buffer, std::size_t buffer_size ) const; + + /** + * @brief returns the own local device address + */ + const bluetoe::link_layer::device_address& local_address() const; + private: + }; + + // implementation + template < class Server, template < typename > class Transport, typename ... Options > + void link_layer< Server, Transport, Options... >::run( Server& ) + { + } +} +} + +#endif diff --git a/bluetoe/link_layer/CMakeLists.txt b/bluetoe/link_layer/CMakeLists.txt index b40e40b2..73652128 100644 --- a/bluetoe/link_layer/CMakeLists.txt +++ b/bluetoe/link_layer/CMakeLists.txt @@ -6,6 +6,5 @@ add_library(bluetoe_linklayer STATIC add_library(bluetoe::linklayer ALIAS bluetoe_linklayer) target_include_directories(bluetoe_linklayer PUBLIC include) -target_link_libraries(bluetoe_linklayer PRIVATE bluetoe::sm bluetoe::iface) target_compile_features(bluetoe_linklayer PRIVATE cxx_std_11) target_compile_options(bluetoe_linklayer PRIVATE -Wall -pedantic -Wextra -Wfatal-errors) diff --git a/bluetoe/scheduled_radio/CMakeLists.txt b/bluetoe/scheduled_radio/CMakeLists.txt new file mode 100644 index 00000000..0c3b827e --- /dev/null +++ b/bluetoe/scheduled_radio/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(bluetoe_scheduled_radio INTERFACE) +add_library(bluetoe::scheduled_radio ALIAS bluetoe_scheduled_radio) + +target_include_directories(bluetoe_scheduled_radio INTERFACE include) +target_compile_features(bluetoe_linklayer PRIVATE cxx_std_11) diff --git a/bluetoe/link_layer/include/bluetoe/advertising.hpp b/bluetoe/scheduled_radio/include/bluetoe/advertising.hpp similarity index 99% rename from bluetoe/link_layer/include/bluetoe/advertising.hpp rename to bluetoe/scheduled_radio/include/bluetoe/advertising.hpp index 12641c93..649759cc 100644 --- a/bluetoe/link_layer/include/bluetoe/advertising.hpp +++ b/bluetoe/scheduled_radio/include/bluetoe/advertising.hpp @@ -2,10 +2,10 @@ #define BLUETOE_LINK_LAYER_ADVERTISING_HPP #include -#include "address.hpp" -#include "buffer.hpp" -#include "delta_time.hpp" -#include "ll_meta_types.hpp" +#include +#include +#include +#include /** * @file bluetoe/link_layer/advertising.hpp diff --git a/bluetoe/link_layer/include/bluetoe/link_layer.hpp b/bluetoe/scheduled_radio/include/bluetoe/link_layer.hpp similarity index 99% rename from bluetoe/link_layer/include/bluetoe/link_layer.hpp rename to bluetoe/scheduled_radio/include/bluetoe/link_layer.hpp index 7045454a..46477c73 100644 --- a/bluetoe/link_layer/include/bluetoe/link_layer.hpp +++ b/bluetoe/scheduled_radio/include/bluetoe/link_layer.hpp @@ -1,17 +1,17 @@ #ifndef BLUETOE_LINK_LAYER_LINK_LAYER_HPP #define BLUETOE_LINK_LAYER_LINK_LAYER_HPP -#include "buffer.hpp" -#include "delta_time.hpp" -#include "ll_options.hpp" -#include "address.hpp" -#include "channel_map.hpp" -#include "notification_queue.hpp" -#include "connection_callbacks.hpp" -#include "connection_event_callback.hpp" -#include "l2cap_signaling_channel.hpp" -#include "white_list.hpp" -#include "advertising.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/bluetoe/link_layer/include/bluetoe/ll_data_pdu_buffer.hpp b/bluetoe/scheduled_radio/include/bluetoe/ll_data_pdu_buffer.hpp similarity index 100% rename from bluetoe/link_layer/include/bluetoe/ll_data_pdu_buffer.hpp rename to bluetoe/scheduled_radio/include/bluetoe/ll_data_pdu_buffer.hpp diff --git a/bluetoe/link_layer/include/bluetoe/ring_buffer.hpp b/bluetoe/scheduled_radio/include/bluetoe/ring_buffer.hpp similarity index 99% rename from bluetoe/link_layer/include/bluetoe/ring_buffer.hpp rename to bluetoe/scheduled_radio/include/bluetoe/ring_buffer.hpp index eb525957..9d0a61b0 100644 --- a/bluetoe/link_layer/include/bluetoe/ring_buffer.hpp +++ b/bluetoe/scheduled_radio/include/bluetoe/ring_buffer.hpp @@ -5,7 +5,7 @@ #include #include -#include "buffer.hpp" +#include namespace bluetoe { namespace link_layer { diff --git a/bluetoe/link_layer/scheduled_radio.hpp b/bluetoe/scheduled_radio/scheduled_radio.hpp similarity index 100% rename from bluetoe/link_layer/scheduled_radio.hpp rename to bluetoe/scheduled_radio/scheduled_radio.hpp diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2f94bc20..94518fea 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,55 +1,96 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.14) + # Prevent in source build, add this options before project keyword set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) + project(bluetoe_examples CXX C) -if (NOT CMAKE_CROSSCOMPILING) - message(ERROR " examples can only be cross compiled to arm cortex-m, missing -Dtoolchain_file on cmake invocation?") - return() -endif() if (NOT BINDING) - message(ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are nrf51, nrf52") - return() + message(FATAL_ERROR " A binding must be defined. Use -DBINDING=nrf51. Current available bindings are nrf51, nrf52") +endif() + +set(supported_bindings nrf51 nrf52 hci_libusb) +set(cross_compile_bindings nrf51 nrf52) + +list(FIND supported_bindings "${BINDING}" binding_pos) + +if (${binding_pos} EQUAL -1) + message(FATAL_ERROR " not supported binding: ${BINDING}. Please choose one out of ${supported_bindings}") +endif() + +if (NOT CMAKE_CROSSCOMPILING) + list(FIND cross_compile_bindings "${BINDING}" cross_binding_pos) + + if (NOT ${cross_binding_pos} EQUAL -1) + message(FATAL_ERROR " examples can only be cross compiled to arm cortex-m, missing -Dtoolchain_file on cmake invocation?") + endif() endif() -# include hardware specific compile options and definitions that must be apllied to the whole project -include(${BINDING}_toolchain_support/platform.cmake) #set global compile options that are hardware independent, these will be used to build the applications (examples) #and will also be used to build bluetoe library # add global compile options add_compile_options(-ffunction-sections -fdata-sections) -#toolchain support targets, these are C and asm only, dont add cpp flags yet -add_subdirectory(${BINDING}_toolchain_support) + +if (CMAKE_CROSSCOMPILING) + # include hardware specific compile options and definitions that must be apllied to the whole project + include(${BINDING}_toolchain_support/platform.cmake) + + #toolchain support targets, these are C and asm only, dont add cpp flags yet + add_subdirectory(${BINDING}_toolchain_support) +endif() + #add global options to cpp targets add_compile_options(-ftemplate-backtrace-limit=0 -fvisibility-inlines-hidden -fno-rtti -fno-exceptions) + #bluetoe library add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/bluetoe) -function(add_bluetoe_example target_name) - add_executable(${target_name} ${target_name}.cpp runtime.cpp) - set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${target_name}.elf) - add_dependencies(${target_name} linker_script) - target_compile_options(${target_name} PRIVATE ) - target_link_libraries(${target_name} PRIVATE bluetoe::iface - bluetoe::bindings::nrf51 - startup::${BINDING} - toolchain::${BINDING} - -lm -lstdc++ -lsupc++ - -T${CMAKE_CURRENT_BINARY_DIR}/${BINDING}_toolchain_support/linker_script.ld - -Wl,--gc-sections -Wl,--warn-common - -Wl,-Map,${CMAKE_CURRENT_BINARY_DIR}/${target_name}.map -nostdlib - ) - add_custom_target(${target_name}.artifacts ALL - COMMAND ${CMAKE_OBJCOPY} -S -O ihex ${target_name}.elf ${target_name}.hex - COMMAND ${CMAKE_OBJCOPY} -S -O binary --only-section=.text ${target_name}.elf ${target_name}.bin - COMMAND ${CMAKE_OBJDUMP} -hS ${target_name}.elf > ${target_name}.lss - COMMAND ${CMAKE_SIZE} ${target_name}.elf - ) - add_dependencies(${target_name}.artifacts ${target_name}) - add_custom_target(${target_name}.flash - COMMAND nrfjprog --chiperase --program ${target_name}.hex) - add_dependencies(${target_name}.flash ${target_name}.artifacts) -endfunction() + +# Some hardware abstractions, required by the examples +add_subdirectory(hal) + +if (CMAKE_CROSSCOMPILING) + function(add_bluetoe_example target_name) + add_executable(${target_name} ${target_name}.cpp runtime.cpp) + set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${target_name}.elf) + add_dependencies(${target_name} linker_script) + target_compile_options(${target_name} PRIVATE ) + target_link_libraries(${target_name} PRIVATE bluetoe::iface + bluetoe::bindings::${BINDING} + startup::${BINDING} + toolchain::${BINDING} + example_hal + -lm -lstdc++ -lsupc++ + -T${CMAKE_CURRENT_BINARY_DIR}/${BINDING}_toolchain_support/linker_script.ld + -Wl,--gc-sections -Wl,--warn-common + -Wl,-Map,${CMAKE_CURRENT_BINARY_DIR}/${target_name}.map -nostdlib + ) + add_custom_target(${target_name}.artifacts ALL + COMMAND ${CMAKE_OBJCOPY} -S -O ihex ${target_name}.elf ${target_name}.hex + COMMAND ${CMAKE_OBJCOPY} -S -O binary --only-section=.text ${target_name}.elf ${target_name}.bin + COMMAND ${CMAKE_OBJDUMP} -hS ${target_name}.elf > ${target_name}.lss + COMMAND ${CMAKE_SIZE} ${target_name}.elf + ) + add_dependencies(${target_name}.artifacts ${target_name}) + add_custom_target(${target_name}.flash + COMMAND nrfjprog --chiperase --program ${target_name}.hex) + add_dependencies(${target_name}.flash ${target_name}.artifacts) + endfunction() +else() + + # When not building for embedded hardware, things become more simple + function(add_bluetoe_example target_name) + add_executable(${target_name} ${target_name}.cpp) + + target_link_libraries(${target_name} + PRIVATE + bluetoe::bindings::${BINDING} + example_hal + ) + endfunction() + +endif() + add_bluetoe_example(blinky) add_bluetoe_example(thermometer) add_bluetoe_example(cycling_speed_and_cadence) diff --git a/examples/blinky.cpp b/examples/blinky.cpp index 69aa3ee4..04c868fe 100644 --- a/examples/blinky.cpp +++ b/examples/blinky.cpp @@ -1,17 +1,13 @@ #include #include -#include +#include "hal/io.hpp" using namespace bluetoe; -static constexpr int io_pin = 21; - static std::uint8_t io_pin_write_handler( bool state ) { // the GPIO pin according to the received value: 0 = off, 1 = on - NRF_GPIO->OUT = state - ? NRF_GPIO->OUT | ( 1 << io_pin ) - : NRF_GPIO->OUT & ~( 1 << io_pin ); + set_led( state ); return error_codes::success; } @@ -31,10 +27,7 @@ device< blinky_server > gatt_srv; int main() { - // Init GPIO pin - NRF_GPIO->PIN_CNF[ io_pin ] = - ( GPIO_PIN_CNF_DRIVE_S0H1 << GPIO_PIN_CNF_DRIVE_Pos ) | - ( GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos ); + init_led(); for ( ;; ) gatt_srv.run( gatt ); diff --git a/examples/hal/CMakeLists.txt b/examples/hal/CMakeLists.txt new file mode 100644 index 00000000..79ae09cf --- /dev/null +++ b/examples/hal/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_policy(SET CMP0079 NEW) + + +if (CMAKE_CROSSCOMPILING) + add_library(example_hal STATIC ${BINDING}_io.cpp) + + # to get the required include path + target_link_libraries(example_hal PRIVATE toolchain::${BINDING}) +else() + add_library(example_hal STATIC io.cpp) +endif() + +target_include_directories(example_hal PUBLIC ..) \ No newline at end of file diff --git a/examples/hal/io.cpp b/examples/hal/io.cpp new file mode 100644 index 00000000..751a030c --- /dev/null +++ b/examples/hal/io.cpp @@ -0,0 +1,13 @@ +#include "hal/io.hpp" +#include + +void init_led() +{ + std::cout << "init_led()" << std::endl; +} + +void set_led( bool state ) +{ + std::cout << "LED: " << ( state ? "on" : "off" ) << std::endl; +} + diff --git a/examples/hal/io.hpp b/examples/hal/io.hpp new file mode 100644 index 00000000..d0ab21d4 --- /dev/null +++ b/examples/hal/io.hpp @@ -0,0 +1,10 @@ +#ifndef BLUETOE_EXAMPLES_HAL_IO_HPP +#define BLUETOE_EXAMPLES_HAL_IO_HPP + +/** + * @TODO this needs some more work (but not to much!!!) + */ +void init_led(); +void set_led( bool state ); + +#endif diff --git a/examples/hal/nrf51_io.cpp b/examples/hal/nrf51_io.cpp new file mode 100644 index 00000000..6bf3e9b0 --- /dev/null +++ b/examples/hal/nrf51_io.cpp @@ -0,0 +1,19 @@ +#include +#include + +static constexpr int io_pin = 21; + +void init_led() +{ + // Init GPIO pin + NRF_GPIO->PIN_CNF[ io_pin ] = + ( GPIO_PIN_CNF_DRIVE_S0H1 << GPIO_PIN_CNF_DRIVE_Pos ) | + ( GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos ); +} + +void set_led( bool state ) +{ + NRF_GPIO->OUT = state + ? NRF_GPIO->OUT | ( 1 << io_pin ) + : NRF_GPIO->OUT & ~( 1 << io_pin ); +} diff --git a/examples/hal/nrf52_io.cpp b/examples/hal/nrf52_io.cpp new file mode 100644 index 00000000..dd58f0d7 --- /dev/null +++ b/examples/hal/nrf52_io.cpp @@ -0,0 +1 @@ +#include "nrf51.cpp" \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d26d8d9..4f038f24 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -13,7 +13,15 @@ function(add_and_register_test test_runner) add_executable(${test_runner} ${test_runner}.cpp) target_include_directories(${test_runner} PRIVATE ${Boost_INCLUDE_DIR}) - target_link_libraries(${test_runner} PRIVATE bluetoe::iface bluetoe::linklayer bluetoe::sm bluetoe::utility test::tools) + target_link_libraries(${test_runner} + PRIVATE + bluetoe::iface + bluetoe::linklayer + bluetoe::sm + bluetoe::utility + test::tools + ${ARGN} + ) target_compile_features(${test_runner} PRIVATE cxx_std_11) if (BLUETOE_EXCLUDE_SLOW_TESTS) @@ -44,3 +52,4 @@ add_subdirectory(att) add_subdirectory(link_layer) add_subdirectory(services) add_subdirectory(security_manager) +add_subdirectory(scheduled_radio) diff --git a/tests/link_layer/CMakeLists.txt b/tests/link_layer/CMakeLists.txt index 18e78d17..a9f717d1 100644 --- a/tests/link_layer/CMakeLists.txt +++ b/tests/link_layer/CMakeLists.txt @@ -1,17 +1,6 @@ -add_and_register_test(ll_advertising_tests) add_and_register_test(address_tests) add_and_register_test(channel_map_tests) add_and_register_test(delta_time_tests) -add_and_register_test(ll_data_pdu_buffer_tests) -add_and_register_test(ll_connection_tests) -add_and_register_test(ll_connecting_tests) -add_and_register_test(ll_control_tests) -add_and_register_test(ll_data_tests) -add_and_register_test(ring_buffer_tests) add_and_register_test(notification_queue_tests) -add_and_register_test(connection_callbacks_tests) add_and_register_test(signaling_channel_tests) add_and_register_test(white_list_tests) -add_and_register_test(connection_parameter_update_procedure_tests) -add_and_register_test(test_radio_tests) -add_and_register_test(advertiser_tests) diff --git a/tests/scheduled_radio/CMakeLists.txt b/tests/scheduled_radio/CMakeLists.txt new file mode 100644 index 00000000..48adb7f7 --- /dev/null +++ b/tests/scheduled_radio/CMakeLists.txt @@ -0,0 +1,15 @@ +function(add_and_register_ll_test name) + add_and_register_test(${name} bluetoe::scheduled_radio) +endfunction() + +add_and_register_ll_test(ll_advertising_tests) +add_and_register_ll_test(ll_data_pdu_buffer_tests) +add_and_register_ll_test(ll_connection_tests) +add_and_register_ll_test(ll_connecting_tests) +add_and_register_ll_test(ll_control_tests) +add_and_register_ll_test(ll_data_tests) +add_and_register_ll_test(ring_buffer_tests) +add_and_register_ll_test(connection_callbacks_tests) +add_and_register_ll_test(connection_parameter_update_procedure_tests) +add_and_register_ll_test(test_radio_tests) +add_and_register_ll_test(advertiser_tests) diff --git a/tests/link_layer/advertiser_tests.cpp b/tests/scheduled_radio/advertiser_tests.cpp similarity index 100% rename from tests/link_layer/advertiser_tests.cpp rename to tests/scheduled_radio/advertiser_tests.cpp diff --git a/tests/link_layer/connected.hpp b/tests/scheduled_radio/connected.hpp similarity index 100% rename from tests/link_layer/connected.hpp rename to tests/scheduled_radio/connected.hpp diff --git a/tests/link_layer/connection_callbacks_tests.cpp b/tests/scheduled_radio/connection_callbacks_tests.cpp similarity index 100% rename from tests/link_layer/connection_callbacks_tests.cpp rename to tests/scheduled_radio/connection_callbacks_tests.cpp diff --git a/tests/link_layer/connection_parameter_update_procedure_tests.cpp b/tests/scheduled_radio/connection_parameter_update_procedure_tests.cpp similarity index 100% rename from tests/link_layer/connection_parameter_update_procedure_tests.cpp rename to tests/scheduled_radio/connection_parameter_update_procedure_tests.cpp diff --git a/tests/link_layer/ll_advertising_tests.cpp b/tests/scheduled_radio/ll_advertising_tests.cpp similarity index 100% rename from tests/link_layer/ll_advertising_tests.cpp rename to tests/scheduled_radio/ll_advertising_tests.cpp diff --git a/tests/link_layer/ll_connecting_tests.cpp b/tests/scheduled_radio/ll_connecting_tests.cpp similarity index 100% rename from tests/link_layer/ll_connecting_tests.cpp rename to tests/scheduled_radio/ll_connecting_tests.cpp diff --git a/tests/link_layer/ll_connection_tests.cpp b/tests/scheduled_radio/ll_connection_tests.cpp similarity index 100% rename from tests/link_layer/ll_connection_tests.cpp rename to tests/scheduled_radio/ll_connection_tests.cpp diff --git a/tests/link_layer/ll_control_tests.cpp b/tests/scheduled_radio/ll_control_tests.cpp similarity index 100% rename from tests/link_layer/ll_control_tests.cpp rename to tests/scheduled_radio/ll_control_tests.cpp diff --git a/tests/link_layer/ll_data_pdu_buffer_tests.cpp b/tests/scheduled_radio/ll_data_pdu_buffer_tests.cpp similarity index 100% rename from tests/link_layer/ll_data_pdu_buffer_tests.cpp rename to tests/scheduled_radio/ll_data_pdu_buffer_tests.cpp diff --git a/tests/link_layer/ll_data_tests.cpp b/tests/scheduled_radio/ll_data_tests.cpp similarity index 100% rename from tests/link_layer/ll_data_tests.cpp rename to tests/scheduled_radio/ll_data_tests.cpp diff --git a/tests/link_layer/ring_buffer_tests.cpp b/tests/scheduled_radio/ring_buffer_tests.cpp similarity index 100% rename from tests/link_layer/ring_buffer_tests.cpp rename to tests/scheduled_radio/ring_buffer_tests.cpp diff --git a/tests/link_layer/test_radio_tests.cpp b/tests/scheduled_radio/test_radio_tests.cpp similarity index 100% rename from tests/link_layer/test_radio_tests.cpp rename to tests/scheduled_radio/test_radio_tests.cpp diff --git a/tests/test_tools/CMakeLists.txt b/tests/test_tools/CMakeLists.txt index 9f81531b..b486074b 100644 --- a/tests/test_tools/CMakeLists.txt +++ b/tests/test_tools/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(test::tools ALIAS test_tools) target_include_directories(test_tools PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(test_tools PRIVATE ${Boost_INCLUDE_DIR}) -target_link_libraries(test_tools PRIVATE bluetoe::linklayer) +target_link_libraries(test_tools PRIVATE bluetoe::linklayer bluetoe::scheduled_radio) target_compile_features(test_tools PRIVATE cxx_std_11) target_compile_definitions(test_tools PRIVATE "")