diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingData.cpp b/libraries/ble/nordic_native/GapAdvertisingData.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingData.cpp rename to libraries/ble/nordic_native/GapAdvertisingData.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingData.h b/libraries/ble/nordic_native/GapAdvertisingData.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingData.h rename to libraries/ble/nordic_native/GapAdvertisingData.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingParams.cpp b/libraries/ble/nordic_native/GapAdvertisingParams.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingParams.cpp rename to libraries/ble/nordic_native/GapAdvertisingParams.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingParams.h b/libraries/ble/nordic_native/GapAdvertisingParams.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GapAdvertisingParams.h rename to libraries/ble/nordic_native/GapAdvertisingParams.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattCharacteristic.cpp b/libraries/ble/nordic_native/GattCharacteristic.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattCharacteristic.cpp rename to libraries/ble/nordic_native/GattCharacteristic.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattCharacteristic.h b/libraries/ble/nordic_native/GattCharacteristic.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattCharacteristic.h rename to libraries/ble/nordic_native/GattCharacteristic.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattService.cpp b/libraries/ble/nordic_native/GattService.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattService.cpp rename to libraries/ble/nordic_native/GattService.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattService.h b/libraries/ble/nordic_native/GattService.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/GattService.h rename to libraries/ble/nordic_native/GattService.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/UUID.cpp b/libraries/ble/nordic_native/UUID.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/UUID.cpp rename to libraries/ble/nordic_native/UUID.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/UUID.h b/libraries/ble/nordic_native/UUID.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/UUID.h rename to libraries/ble/nordic_native/UUID.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/blecommon.h b/libraries/ble/nordic_native/blecommon.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/blecommon.h rename to libraries/ble/nordic_native/blecommon.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/BLEDevice.h b/libraries/ble/nordic_native/hw/BLEDevice.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/BLEDevice.h rename to libraries/ble/nordic_native/hw/BLEDevice.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/Gap.h b/libraries/ble/nordic_native/hw/Gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/Gap.h rename to libraries/ble/nordic_native/hw/Gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GapEvents.h b/libraries/ble/nordic_native/hw/GapEvents.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GapEvents.h rename to libraries/ble/nordic_native/hw/GapEvents.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GattServer.h b/libraries/ble/nordic_native/hw/GattServer.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GattServer.h rename to libraries/ble/nordic_native/hw/GattServer.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GattServerEvents.h b/libraries/ble/nordic_native/hw/GattServerEvents.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/GattServerEvents.h rename to libraries/ble/nordic_native/hw/GattServerEvents.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle.cpp b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle.h b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle.h rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_advertising.cpp b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle_advertising.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_advertising.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle_advertising.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_advertising.h b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle_advertising.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_advertising.h rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle_advertising.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_gap.cpp b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle_gap.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_gap.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle_gap.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_gap.h b/libraries/ble/nordic_native/hw/nRF51822n/btle/btle_gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/btle_gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/btle/btle_gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/custom/custom_helper.cpp b/libraries/ble/nordic_native/hw/nRF51822n/btle/custom/custom_helper.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/custom/custom_helper.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/btle/custom/custom_helper.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/custom/custom_helper.h b/libraries/ble/nordic_native/hw/nRF51822n/btle/custom/custom_helper.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/btle/custom/custom_helper.h rename to libraries/ble/nordic_native/hw/nRF51822n/btle/custom/custom_helper.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/ansi_escape.h b/libraries/ble/nordic_native/hw/nRF51822n/common/ansi_escape.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/ansi_escape.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/ansi_escape.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/assertion.h b/libraries/ble/nordic_native/hw/nRF51822n/common/assertion.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/assertion.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/assertion.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/binary.h b/libraries/ble/nordic_native/hw/nRF51822n/common/binary.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/binary.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/binary.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/ble_error.h b/libraries/ble/nordic_native/hw/nRF51822n/common/ble_error.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/ble_error.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/ble_error.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/common.h b/libraries/ble/nordic_native/hw/nRF51822n/common/common.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/common.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/common.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/compiler.h b/libraries/ble/nordic_native/hw/nRF51822n/common/compiler.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/common/compiler.h rename to libraries/ble/nordic_native/hw/nRF51822n/common/compiler.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51822n.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nRF51822n.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51822n.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51822n.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51822n.h b/libraries/ble/nordic_native/hw/nRF51822n/nRF51822n.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51822n.h rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51822n.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51Gap.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nRF51Gap.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51Gap.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51Gap.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51Gap.h b/libraries/ble/nordic_native/hw/nRF51822n/nRF51Gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51Gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51Gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51GattServer.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nRF51GattServer.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51GattServer.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51GattServer.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51GattServer.h b/libraries/ble/nordic_native/hw/nRF51822n/nRF51GattServer.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nRF51GattServer.h rename to libraries/ble/nordic_native/hw/nRF51822n/nRF51GattServer.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/app_timer.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/app_timer.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/app_timer.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/app_timer.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/crc16.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/crc16.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/crc16.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/crc16.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/pstorage.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/pstorage.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/app_common/pstorage.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/app_common/pstorage.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_advdata.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_advdata.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_advdata.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_advdata.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_advdata_parser.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_advdata_parser.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_advdata_parser.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_advdata_parser.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_bondmngr.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_bondmngr.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_bondmngr.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_bondmngr.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_conn_params.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_conn_params.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_conn_params.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_conn_params.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_debug_assert_handler.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_debug_assert_handler.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_debug_assert_handler.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_debug_assert_handler.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_error_log.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_error_log.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_error_log.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_error_log.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_services/ble_srv_common.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_services/ble_srv_common.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble/ble_services/ble_srv_common.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble/ble_services/ble_srv_common.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble_bondmngr_cfg.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/ble_bondmngr_cfg.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/ble_bondmngr_cfg.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/ble_bondmngr_cfg.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nordic_global.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nordic_global.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nordic_global.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nordic_global.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_button.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_button.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_button.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_button.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_error.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_error.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_error.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_error.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_fifo.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_fifo.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_fifo.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_fifo.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_gpiote.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_gpiote.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_gpiote.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_gpiote.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_scheduler.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_scheduler.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_scheduler.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_scheduler.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_timer.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_timer.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_timer.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_timer.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_uart.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_uart.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_uart.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_uart.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_util.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_util.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_util.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/app_util.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/crc16.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/crc16.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/crc16.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/crc16.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool_internal.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool_internal.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool_internal.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_mem_pool_internal.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_slip.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_slip.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_slip.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_slip.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_transport.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_transport.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_transport.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/hci_transport.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/pstorage.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/pstorage.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/app_common/pstorage.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/app_common/pstorage.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata_parser.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata_parser.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata_parser.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_advdata_parser.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_bondmngr.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_bondmngr.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_bondmngr.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_bondmngr.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_central_bondmngr.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_central_bondmngr.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_central_bondmngr.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_central_bondmngr.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_conn_params.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_conn_params.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_conn_params.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_conn_params.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_date_time.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_date_time.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_date_time.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_date_time.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_debug_assert_handler.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_debug_assert_handler.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_debug_assert_handler.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_debug_assert_handler.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_dtm.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_dtm.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_dtm.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_dtm.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_error_log.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_error_log.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_error_log.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_error_log.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_flash.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_flash.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_flash.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_flash.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_racp.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_racp.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_racp.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_racp.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_radio_notification.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_radio_notification.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_radio_notification.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_radio_notification.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_sensorsim.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_sensorsim.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_sensorsim.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_sensorsim.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_services/ble_srv_common.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_services/ble_srv_common.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_services/ble_srv_common.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/ble_services/ble_srv_common.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gap.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gatts.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gatts.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gatts.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_decoder_gatts.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_encoder.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_encoder.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_encoder.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_cmd_encoder.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_defines.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_defines.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_defines.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_defines.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gap.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gatts.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gatts.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gatts.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_decoder_gatts.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gap.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gatts.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gatts.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gatts.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_event_encoder_gatts.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_pkt_receiver.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_pkt_receiver.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_pkt_receiver.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_pkt_receiver.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nordic_common.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nordic_common.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nordic_common.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nordic_common.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_assert.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_assert.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_assert.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_assert.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_ecb.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_ecb.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_ecb.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_ecb.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_gpio.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_gpio.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_gpio.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_gpio.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_nvmc.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_nvmc.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_nvmc.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_nvmc.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_temp.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_temp.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/nrf_temp.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/nrf_temp.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_err.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_err.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_err.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_err.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gap.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatt.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatt.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatt.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatt.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gattc.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gattc.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gattc.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gattc.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatts.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatts.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatts.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_gatts.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_hci.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_hci.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_hci.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_hci.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_l2cap.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_l2cap.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_l2cap.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_l2cap.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_ranges.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_ranges.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_ranges.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_ranges.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_types.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_types.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_types.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/ble_types.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_sdm.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_sdm.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_sdm.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_sdm.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_soc.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_soc.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_soc.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_error_soc.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_sdm.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_sdm.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_sdm.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_sdm.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_soc.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_soc.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_soc.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_soc.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_svc.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_svc.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_svc.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/nrf_svc.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/softdevice_assert.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/softdevice_assert.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/s110/softdevice_assert.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/s110/softdevice_assert.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ant_stack_handler_types.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ant_stack_handler_types.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ant_stack_handler_types.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ant_stack_handler_types.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/softdevice_handler.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/softdevice_handler.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/sd_common/softdevice_handler.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/sd_common/softdevice_handler.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/system_nrf51.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/system_nrf51.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/nrf-sdk/system_nrf51.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/nrf-sdk/system_nrf51.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/pstorage_platform.h b/libraries/ble/nordic_native/hw/nRF51822n/nordic/pstorage_platform.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/pstorage_platform.h rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/pstorage_platform.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/softdevice_handler.cpp b/libraries/ble/nordic_native/hw/nRF51822n/nordic/softdevice_handler.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/nordic/softdevice_handler.cpp rename to libraries/ble/nordic_native/hw/nRF51822n/nordic/softdevice_handler.cpp diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/projectconfig.h b/libraries/ble/nordic_native/hw/nRF51822n/projectconfig.h similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/BLE_API_Native/hw/nRF51822n/projectconfig.h rename to libraries/ble/nordic_native/hw/nRF51822n/projectconfig.h diff --git a/libraries/tests/nordic/BLE_Health_Thermometer_full/main.cpp b/libraries/tests/ble/Health_Thermometer/main.cpp similarity index 100% rename from libraries/tests/nordic/BLE_Health_Thermometer_full/main.cpp rename to libraries/tests/ble/Health_Thermometer/main.cpp diff --git a/libraries/tests/ble/HeartRate/main.cpp b/libraries/tests/ble/HeartRate/main.cpp new file mode 100644 index 0000000000..3f64c94d67 --- /dev/null +++ b/libraries/tests/ble/HeartRate/main.cpp @@ -0,0 +1,243 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mbed.h" +#include "nRF51822n.h" + +nRF51822n nrf; /* BLE radio driver */ + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +Ticker flipper; +Serial pc(USBTX,USBRX); + +/* Battery Level Service */ +uint8_t batt = 72; /* Battery level */ +uint8_t read_batt = 0; /* Variable to hold battery level reads */ +GattService battService ( GattService::UUID_BATTERY_SERVICE ); +GattCharacteristic battLevel ( GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, 1, 1, + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY | + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ); + +/* Heart Rate Service */ +/* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml */ +/* HRM Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */ +/* Location: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml */ +GattService hrmService ( GattService::UUID_HEART_RATE_SERVICE ); +GattCharacteristic hrmRate ( GattCharacteristic::UUID_HEART_RATE_MEASUREMENT_CHAR, 2, 3, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY ); +GattCharacteristic hrmLocation ( GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR, 1, 1, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ ); + +/* Device Information service */ +uint8_t deviceName[4] = { 'm', 'b', 'e', 'd' }; +GattService deviceInformationService ( GattService::UUID_DEVICE_INFORMATION_SERVICE ); +GattCharacteristic deviceManufacturer ( GattCharacteristic::UUID_MANUFACTURER_NAME_STRING_CHAR, + sizeof(deviceName), sizeof(deviceName), + GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ); + +/* Health Thermometer Service */ +uint32_t temp_ieee11073 = 0xFF00016C; // 36.4C in IEEE-11073 32-bit float! +uint8_t thermTempPayload[5] = { 0, 0, 0, 0, 0 }; +GattService thermService (GattService::UUID_HEALTH_THERMOMETER_SERVICE); +GattCharacteristic thermTemp (GattCharacteristic::UUID_TEMPERATURE_MEASUREMENT_CHAR, + 5, 5, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE); + +/* Advertising data and parameters */ +GapAdvertisingData advData; +GapAdvertisingData scanResponse; +GapAdvertisingParams advParams ( GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED ); +uint16_t uuid16_list[] = { GattService::UUID_BATTERY_SERVICE, + GattService::UUID_DEVICE_INFORMATION_SERVICE, + GattService::UUID_HEART_RATE_SERVICE, + GattService::UUID_HEALTH_THERMOMETER_SERVICE }; + +void tickerCallback(void); + +/**************************************************************************/ +/*! + @brief This custom class can be used to override any GapEvents + that you are interested in handling on an application level. +*/ +/**************************************************************************/ +class GapEventHandler : public GapEvents +{ + virtual void onTimeout(void) + { + pc.printf("Advertising Timeout!\n\r"); + // Restart the advertising process with a much slower interval, + // only start advertising again after a button press, etc. + } + + virtual void onConnected(void) + { + pc.printf("Connected!\n\r"); + } + + virtual void onDisconnected(void) + { + pc.printf("Disconnected!\n\r"); + pc.printf("Restarting the advertising process\n\r"); + nrf.getGap().startAdvertising(advParams); + } +}; + +/**************************************************************************/ +/*! + @brief This custom class can be used to override any GattServerEvents + that you are interested in handling on an application level. +*/ +/**************************************************************************/ +class GattServerEventHandler : public GattServerEvents +{ + //virtual void onDataSent(uint16_t charHandle) {} + //virtual void onDataWritten(uint16_t charHandle) {} + + virtual void onUpdatesEnabled(uint16_t charHandle) + { + if (charHandle == thermTemp.handle) + { + pc.printf("Temperature indication enabled\n\r"); + } + if (charHandle == hrmRate.handle) + { + pc.printf("Heart rate notify enabled\n\r"); + } + } + + virtual void onUpdatesDisabled(uint16_t charHandle) + { + if (charHandle == thermTemp.handle) + { + pc.printf("Temperature indication disabled\n\r"); + } + if (charHandle == hrmRate.handle) + { + pc.printf("Heart rate notify disabled\n\r"); + } + } + + virtual void onConfirmationReceived(uint16_t charHandle) + { + if (charHandle == thermTemp.handle) + { + pc.printf("Temperature indication received\n\r"); + } + } +}; + +/**************************************************************************/ +/*! + @brief Program entry point +*/ +/**************************************************************************/ +int main(void) +{ + *(uint32_t *)0x40000504 = 0xC007FFDF; + *(uint32_t *)0x40006C18 = 0x00008000; + + /* Setup blinky: led1 is toggled in main, led2 is toggled via Ticker */ + led1=1; + led2=1; + flipper.attach(&tickerCallback, 1.0); + + /* Setup the local GAP/GATT event handlers */ + nrf.getGap().setEventHandler(new GapEventHandler()); + nrf.getGattServer().setEventHandler(new GattServerEventHandler()); + + /* Initialise the nRF51822 */ + pc.printf("Initialising the nRF51822\n\r"); + nrf.init(); + + /* Make sure we get a clean start */ + nrf.reset(); + + /* Add BLE-Only flag and complete service list to the advertising data */ + advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED); + advData.addData(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, + (uint8_t*)uuid16_list, sizeof(uuid16_list)); + advData.addAppearance(GapAdvertisingData::HEART_RATE_SENSOR_HEART_RATE_BELT); + nrf.getGap().setAdvertisingData(advData, scanResponse); + + /* Add the Battery Level service */ + battService.addCharacteristic(battLevel); + nrf.getGattServer().addService(battService); + + /* Add the Device Information service */ + deviceInformationService.addCharacteristic(deviceManufacturer); + nrf.getGattServer().addService(deviceInformationService); + + /* Add the Heart Rate service */ + hrmService.addCharacteristic(hrmRate); + hrmService.addCharacteristic(hrmLocation); + nrf.getGattServer().addService(hrmService); + + /* Health Thermometer Service */ + thermService.addCharacteristic(thermTemp); + nrf.getGattServer().addService(thermService); + + /* Start advertising (make sure you've added all your data first) */ + nrf.getGap().startAdvertising(advParams); + + /* Now that we're live, update the battery level characteristic, and */ + /* change the device manufacturer characteristic to 'mbed' */ + nrf.getGattServer().updateValue(battLevel.handle, (uint8_t*)&batt, sizeof(batt)); + nrf.getGattServer().updateValue(deviceManufacturer.handle, deviceName, sizeof(deviceName)); + nrf.getGattServer().updateValue(thermTemp.handle, thermTempPayload, sizeof(thermTempPayload)); + + /* Set the heart rate monitor location (one time only) */ + /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.body_sensor_location.xml */ + uint8_t location = 0x03; /* Finger */ + uint8_t hrmCounter = 100; + nrf.getGattServer().updateValue(hrmLocation.handle, (uint8_t*)&location, sizeof(location)); + + /* Do blinky on LED1 while we're waiting for BLE events */ + for (;;) + { + led1 = !led1; + wait(1); + + //nrf.getGattServer().readValue(battLevel.handle, (uint8_t*)&read_batt, sizeof(read_batt)); + //pc.printf("Battery Level = %d\n\r", read_batt); + + /* Update battery level */ + batt++; + if (batt > 100) batt = 72; + nrf.getGattServer().updateValue(battLevel.handle, (uint8_t*)&batt, sizeof(batt)); + + /* Update the HRM measurement */ + /* First byte = 8-bit values, no extra info, Second byte = uint8_t HRM value */ + /* See --> https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */ + hrmCounter++; + if (hrmCounter == 175) hrmCounter = 100; + uint8_t bpm[2] = { 0x00, hrmCounter }; + nrf.getGattServer().updateValue(hrmRate.handle, bpm, sizeof(bpm)); + + /* Update the temperature */ + memcpy(thermTempPayload+1, &temp_ieee11073, 4); + nrf.getGattServer().updateValue(thermTemp.handle, thermTempPayload, sizeof(thermTempPayload)); + temp_ieee11073++; + if (temp_ieee11073 > 0xFF000200) temp_ieee11073 = 0xFF00016C; + } +} + +/**************************************************************************/ +/*! + @brief Ticker callback to switch led2 state +*/ +/**************************************************************************/ +void tickerCallback(void) +{ + led2 = !led2; +} diff --git a/libraries/tests/ble/iBeacon/main.cpp b/libraries/tests/ble/iBeacon/main.cpp new file mode 100644 index 0000000000..3f71ea90a9 --- /dev/null +++ b/libraries/tests/ble/iBeacon/main.cpp @@ -0,0 +1,87 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mbed.h" +#include "nRF51822n.h" + +nRF51822n nrf; /* BLE radio driver */ + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +Ticker flipper; +Serial pc(USBTX,USBRX); + +void tickerCallback(void); + +/**************************************************************************/ +/*! + @brief Program entry point +*/ +/**************************************************************************/ +int main(void) +{ + *(uint32_t *)0x40000504 = 0xC007FFDF; + *(uint32_t *)0x40006C18 = 0x00008000; + + /* Setup blinky: led1 is toggled in main, led2 is toggled via Ticker */ + led1=1; + led2=1; + flipper.attach(&tickerCallback, 1.0); + + /* Initialise the nRF51822 */ + pc.printf("Initialising the nRF51822\n\r"); + nrf.init(); + + GapAdvertisingParams advParams ( GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED ); + GapAdvertisingData advData; + GapAdvertisingData scanResponse; + + /* Define an iBeacon payload + -------------------------------------------------------------- + 128-Bit UUID = E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61 + Major/Minor = 0000 / 0000 + Tx Power = C8 + */ + uint8_t iBeaconPayload[25] = { 0x4C, 0x00, 0x02, 0x15, 0xE2, 0x0A, 0x39, 0xF4, 0x73, 0xF5, 0x4B, 0xC4, 0xA1, 0x2F, 0x17, 0xD1, 0xAD, 0x07, 0xA9, 0x61, 0x00, 0x00, 0x00, 0x00, 0xC8 }; + + /* Make sure we get a clean start */ + nrf.reset(); + + /* iBeacon includes the FLAG and MSD fields */ + advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED); + advData.addData(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, iBeaconPayload, sizeof(iBeaconPayload)); + + /* Start advertising! */ + nrf.getGap().setAdvertisingData(advData, scanResponse); + nrf.getGap().startAdvertising(advParams); + + /* Do blinky on LED1 while we're waiting for BLE events */ + for (;;) + { + led1 = !led1; + wait(1); + } +} + +/**************************************************************************/ +/*! + @brief Ticker callback to switch led2 state +*/ +/**************************************************************************/ +void tickerCallback(void) +{ + led2 = !led2; +} diff --git a/workspace_tools/tests.py b/workspace_tools/tests.py index 33f7b4a44c..ce05b852d1 100644 --- a/workspace_tools/tests.py +++ b/workspace_tools/tests.py @@ -22,7 +22,10 @@ TEST_MBED_LIB = join(TEST_DIR, "mbed", "env") PERIPHERALS = join(TEST_DIR, "peripherals") BENCHMARKS_DIR = join(TEST_DIR, "benchmarks") + SD = join(TEST_DIR, "sd") +TMP102 = join(PERIPHERALS, 'TMP102') +BLE_NORDIC_NATIVE = join(LIB_DIR, "ble", "nordic_native") """ Wiring: @@ -90,7 +93,7 @@ TESTS = [ { "id": "MBED_A4", "description": "I2C TMP102", "source_dir": join(TEST_DIR, "mbed", "i2c_TMP102"), - "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, join(PERIPHERALS, 'TMP102')], + "dependencies": [MBED_LIBRARIES, TEST_MBED_LIB, TMP102], "automated": True, "peripherals": ["TMP102"] }, @@ -738,9 +741,19 @@ TESTS = [ "dependencies": [MBED_LIBRARIES, RTOS_LIBRARIES, TEST_MBED_LIB, SD_FS, FAT_FS], }, { - "id": "NORDIC_1", "description": "BLE Health Thermometer full", - "source_dir": join(TEST_DIR, "nordic", "BLE_Health_Thermometer_full"), - "dependencies": [MBED_LIBRARIES, join(PERIPHERALS, 'TMP102')], + "id": "NORDIC_1", "description": "BLE Health Thermometer", + "source_dir": join(TEST_DIR, "ble", "Health_Thermometer"), + "dependencies": [MBED_LIBRARIES, TMP102, BLE_NORDIC_NATIVE], + }, + { + "id": "NORDIC_2", "description": "BLE Heart Rate Monitor", + "source_dir": join(TEST_DIR, "ble", "HeartRate"), + "dependencies": [MBED_LIBRARIES, BLE_NORDIC_NATIVE], + }, + { + "id": "NORDIC_3", "description": "BLE iBeacon", + "source_dir": join(TEST_DIR, "ble", "iBeacon"), + "dependencies": [MBED_LIBRARIES, BLE_NORDIC_NATIVE], }, ]