diff --git a/.gitignore b/.gitignore
index 504f8df..508e75f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -78,7 +78,7 @@ Keil/Objects/*
# To explicitly override the above, define any exceptions here; e.g.:
# !my_customized_scatter_file.sct
-!/components/softdevice/*/hex/*.hex
+!SDK/*/components/softdevice/*/hex/*.hex
_build/
RTE_Components.h
EventRecorderStub.scvd
diff --git a/Keil/EPD.uvprojx b/Keil/EPD-nRF51.uvprojx
similarity index 85%
rename from Keil/EPD.uvprojx
rename to Keil/EPD-nRF51.uvprojx
index 991ea0f..bc9f20c 100644
--- a/Keil/EPD.uvprojx
+++ b/Keil/EPD-nRF51.uvprojx
@@ -49,7 +49,7 @@
1
.\Objects\
- EPD
+ EPD-nRF51
1
0
1
@@ -340,7 +340,7 @@
BLE_STACK_SUPPORT_REQD NRF51822 NRF_SD_BLE_API_VERSION=2 S130 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0
- ..\config;..\EPD;..\GUI;..\components\toolchain;..\components\toolchain\cmsis\include;..\components\drivers_nrf\clock;..\components\drivers_nrf\common;..\components\drivers_nrf\delay;..\components\drivers_nrf\gpiote;..\components\drivers_nrf\hal;..\components\drivers_nrf\spi_master;..\components\drivers_nrf\twi_master;..\components\drivers_ext\segger_rtt;..\components\libraries\fstorage;..\components\libraries\experimental_section_vars;..\components\libraries\log;..\components\libraries\log\src;..\components\libraries\scheduler;..\components\libraries\trace;..\components\libraries\timer;..\components\libraries\util;..\components\ble\common;..\components\ble\ble_advertising;..\components\softdevice\common\softdevice_handler;..\components\softdevice\s130\headers;..\components\softdevice\s130\headers\nrf51
+ ..\config;..\EPD;..\GUI;..\SDK\12.3.0_d7731ad;..\SDK\12.3.0_d7731ad\components\toolchain;..\SDK\12.3.0_d7731ad\components\toolchain\cmsis\include;..\SDK\12.3.0_d7731ad\components\drivers_nrf\clock;..\SDK\12.3.0_d7731ad\components\drivers_nrf\common;..\SDK\12.3.0_d7731ad\components\drivers_nrf\delay;..\SDK\12.3.0_d7731ad\components\drivers_nrf\gpiote;..\SDK\12.3.0_d7731ad\components\drivers_nrf\hal;..\SDK\12.3.0_d7731ad\components\drivers_nrf\spi_master;..\SDK\12.3.0_d7731ad\components\drivers_nrf\twi_master;..\SDK\12.3.0_d7731ad\external\segger_rtt;..\SDK\12.3.0_d7731ad\components\libraries\fstorage;..\SDK\12.3.0_d7731ad\components\libraries\experimental_section_vars;..\SDK\12.3.0_d7731ad\components\libraries\log;..\SDK\12.3.0_d7731ad\components\libraries\log\src;..\SDK\12.3.0_d7731ad\components\libraries\scheduler;..\SDK\12.3.0_d7731ad\components\libraries\trace;..\SDK\12.3.0_d7731ad\components\libraries\timer;..\SDK\12.3.0_d7731ad\components\libraries\util;..\SDK\12.3.0_d7731ad\components\ble\common;..\SDK\12.3.0_d7731ad\components\ble\ble_advertising;..\SDK\12.3.0_d7731ad\components\softdevice\common\softdevice_handler;..\SDK\12.3.0_d7731ad\components\softdevice\s130\headers;..\SDK\12.3.0_d7731ad\components\softdevice\s130\headers\nrf51
@@ -358,7 +358,7 @@
BLE_STACK_SUPPORT_REQD NRF51822 NRF_SD_BLE_API_VERSION=2 S130 NRF51 SOFTDEVICE_PRESENT SWI_DISABLE0
- ..\config;..\EPD;..\GUI;..\components\toolchain;..\components\toolchain\cmsis\include;..\components\drivers_nrf\clock;..\components\drivers_nrf\common;..\components\drivers_nrf\delay;..\components\drivers_nrf\gpiote;..\components\drivers_nrf\hal;..\components\drivers_nrf\spi_master;..\components\drivers_nrf\twi_master;..\components\drivers_ext\segger_rtt;..\components\libraries\fstorage;..\components\libraries\experimental_section_vars;..\components\libraries\log;..\components\libraries\log\src;..\components\libraries\scheduler;..\components\libraries\trace;..\components\libraries\timer;..\components\libraries\util;..\components\ble\common;..\components\ble\ble_advertising;..\components\softdevice\common\softdevice_handler;..\components\softdevice\s130\headers;..\components\softdevice\s130\headers\nrf51
+ ..\config;..\EPD;..\GUI;..\SDK\12.3.0_d7731ad\components\toolchain;..\SDK\12.3.0_d7731ad\components\toolchain\cmsis\include;..\SDK\12.3.0_d7731ad\components\drivers_nrf\clock;..\SDK\12.3.0_d7731ad\components\drivers_nrf\common;..\SDK\12.3.0_d7731ad\components\drivers_nrf\delay;..\SDK\12.3.0_d7731ad\components\drivers_nrf\gpiote;..\SDK\12.3.0_d7731ad\components\drivers_nrf\hal;..\SDK\12.3.0_d7731ad\components\drivers_nrf\spi_master;..\SDK\12.3.0_d7731ad\components\drivers_nrf\twi_master;..\SDK\12.3.0_d7731ad\external\segger_rtt;..\SDK\12.3.0_d7731ad\components\libraries\fstorage;..\SDK\12.3.0_d7731ad\components\libraries\experimental_section_vars;..\SDK\12.3.0_d7731ad\components\libraries\log;..\SDK\12.3.0_d7731ad\components\libraries\log\src;..\SDK\12.3.0_d7731ad\components\libraries\scheduler;..\SDK\12.3.0_d7731ad\components\libraries\trace;..\SDK\12.3.0_d7731ad\components\libraries\timer;..\SDK\12.3.0_d7731ad\components\libraries\util;..\SDK\12.3.0_d7731ad\components\ble\common;..\SDK\12.3.0_d7731ad\components\ble\ble_advertising;..\SDK\12.3.0_d7731ad\components\softdevice\common\softdevice_handler;..\SDK\12.3.0_d7731ad\components\softdevice\s130\headers;..\SDK\12.3.0_d7731ad\components\softdevice\s130\headers\nrf51
@@ -392,7 +392,7 @@
sdk_config.h
5
- ..\config\sdk_config.h
+ ..\SDK\12.3.0_d7731ad\sdk_config.h
@@ -452,22 +452,22 @@
ble_advertising.c
1
- ..\components\ble\ble_advertising\ble_advertising.c
+ ..\SDK\12.3.0_d7731ad\components\ble\ble_advertising\ble_advertising.c
ble_advdata.c
1
- ..\components\ble\common\ble_advdata.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_advdata.c
ble_conn_params.c
1
- ..\components\ble\common\ble_conn_params.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_conn_params.c
ble_srv_common.c
1
- ..\components\ble\common\ble_srv_common.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_srv_common.c
@@ -477,22 +477,22 @@
nrf_drv_clock.c
1
- ..\components\drivers_nrf\clock\nrf_drv_clock.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\clock\nrf_drv_clock.c
nrf_drv_common.c
1
- ..\components\drivers_nrf\common\nrf_drv_common.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\common\nrf_drv_common.c
nrf_drv_gpiote.c
1
- ..\components\drivers_nrf\gpiote\nrf_drv_gpiote.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\gpiote\nrf_drv_gpiote.c
nrf_drv_spi.c
1
- ..\components\drivers_nrf\spi_master\nrf_drv_spi.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\spi_master\nrf_drv_spi.c
@@ -502,32 +502,32 @@
app_error.c
1
- ..\components\libraries\util\app_error.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_error.c
app_error_weak.c
1
- ..\components\libraries\util\app_error_weak.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_error_weak.c
app_scheduler.c
1
- ..\components\libraries\scheduler\app_scheduler.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\scheduler\app_scheduler.c
app_timer.c
1
- ..\components\libraries\timer\app_timer.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\timer\app_timer.c
app_util_platform.c
1
- ..\components\libraries\util\app_util_platform.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_util_platform.c
fstorage.c
1
- ..\components\libraries\fstorage\fstorage.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\fstorage\fstorage.c
@@ -537,12 +537,12 @@
nrf_log_backend_serial.c
1
- ..\components\libraries\log\src\nrf_log_backend_serial.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\log\src\nrf_log_backend_serial.c
nrf_log_frontend.c
1
- ..\components\libraries\log\src\nrf_log_frontend.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\log\src\nrf_log_frontend.c
@@ -552,17 +552,17 @@
RTT_Syscalls_KEIL.c
1
- ..\components\drivers_ext\segger_rtt\RTT_Syscalls_KEIL.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\RTT_Syscalls_KEIL.c
SEGGER_RTT.c
1
- ..\components\drivers_ext\segger_rtt\SEGGER_RTT.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\SEGGER_RTT.c
SEGGER_RTT_printf.c
1
- ..\components\drivers_ext\segger_rtt\SEGGER_RTT_printf.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\SEGGER_RTT_printf.c
@@ -572,7 +572,7 @@
softdevice_handler.c
1
- ..\components\softdevice\common\softdevice_handler\softdevice_handler.c
+ ..\SDK\12.3.0_d7731ad\components\softdevice\common\softdevice_handler\softdevice_handler.c
@@ -582,12 +582,12 @@
arm_startup_nrf51.s
2
- ..\components\toolchain\arm\arm_startup_nrf51.s
+ ..\SDK\12.3.0_d7731ad\components\toolchain\arm\arm_startup_nrf51.s
system_nrf51.c
1
- ..\components\toolchain\system_nrf51.c
+ ..\SDK\12.3.0_d7731ad\components\toolchain\system_nrf51.c
@@ -635,7 +635,7 @@
0
1
- ..\components\softdevice\s130\hex\
+ ..\SDK\12.3.0_d7731ad\components\softdevice\s130\hex\
s130_nrf51_2.0.1_softdevice.hex
1
0
@@ -979,7 +979,7 @@
sdk_config.h
5
- ..\config\sdk_config.h
+ ..\SDK\12.3.0_d7731ad\sdk_config.h
@@ -1039,22 +1039,22 @@
ble_advertising.c
1
- ..\components\ble\ble_advertising\ble_advertising.c
+ ..\SDK\12.3.0_d7731ad\components\ble\ble_advertising\ble_advertising.c
ble_advdata.c
1
- ..\components\ble\common\ble_advdata.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_advdata.c
ble_conn_params.c
1
- ..\components\ble\common\ble_conn_params.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_conn_params.c
ble_srv_common.c
1
- ..\components\ble\common\ble_srv_common.c
+ ..\SDK\12.3.0_d7731ad\components\ble\common\ble_srv_common.c
@@ -1064,22 +1064,22 @@
nrf_drv_clock.c
1
- ..\components\drivers_nrf\clock\nrf_drv_clock.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\clock\nrf_drv_clock.c
nrf_drv_common.c
1
- ..\components\drivers_nrf\common\nrf_drv_common.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\common\nrf_drv_common.c
nrf_drv_gpiote.c
1
- ..\components\drivers_nrf\gpiote\nrf_drv_gpiote.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\gpiote\nrf_drv_gpiote.c
nrf_drv_spi.c
1
- ..\components\drivers_nrf\spi_master\nrf_drv_spi.c
+ ..\SDK\12.3.0_d7731ad\components\drivers_nrf\spi_master\nrf_drv_spi.c
@@ -1089,32 +1089,32 @@
app_error.c
1
- ..\components\libraries\util\app_error.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_error.c
app_error_weak.c
1
- ..\components\libraries\util\app_error_weak.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_error_weak.c
app_scheduler.c
1
- ..\components\libraries\scheduler\app_scheduler.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\scheduler\app_scheduler.c
app_timer.c
1
- ..\components\libraries\timer\app_timer.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\timer\app_timer.c
app_util_platform.c
1
- ..\components\libraries\util\app_util_platform.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\util\app_util_platform.c
fstorage.c
1
- ..\components\libraries\fstorage\fstorage.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\fstorage\fstorage.c
@@ -1124,12 +1124,12 @@
nrf_log_backend_serial.c
1
- ..\components\libraries\log\src\nrf_log_backend_serial.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\log\src\nrf_log_backend_serial.c
nrf_log_frontend.c
1
- ..\components\libraries\log\src\nrf_log_frontend.c
+ ..\SDK\12.3.0_d7731ad\components\libraries\log\src\nrf_log_frontend.c
@@ -1139,17 +1139,17 @@
RTT_Syscalls_KEIL.c
1
- ..\components\drivers_ext\segger_rtt\RTT_Syscalls_KEIL.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\RTT_Syscalls_KEIL.c
SEGGER_RTT.c
1
- ..\components\drivers_ext\segger_rtt\SEGGER_RTT.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\SEGGER_RTT.c
SEGGER_RTT_printf.c
1
- ..\components\drivers_ext\segger_rtt\SEGGER_RTT_printf.c
+ ..\SDK\12.3.0_d7731ad\external\segger_rtt\SEGGER_RTT_printf.c
@@ -1159,7 +1159,7 @@
softdevice_handler.c
1
- ..\components\softdevice\common\softdevice_handler\softdevice_handler.c
+ ..\SDK\12.3.0_d7731ad\components\softdevice\common\softdevice_handler\softdevice_handler.c
@@ -1169,12 +1169,12 @@
arm_startup_nrf51.s
2
- ..\components\toolchain\arm\arm_startup_nrf51.s
+ ..\SDK\12.3.0_d7731ad\components\toolchain\arm\arm_startup_nrf51.s
system_nrf51.c
1
- ..\components\toolchain\system_nrf51.c
+ ..\SDK\12.3.0_d7731ad\components\toolchain\system_nrf51.c
diff --git a/Makefile b/Makefile
index b776210..2063171 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ TARGETS := nrf51822_xxaa
OUTPUT_DIRECTORY := _build
PROJ_DIR := $(CURDIR)
-SDK_ROOT := $(PROJ_DIR)
+SDK_ROOT := $(PROJ_DIR)/SDK/12.3.0_d7731ad
SD_PATH := $(SDK_ROOT)/components/softdevice/s130
$(OUTPUT_DIRECTORY)/nrf51822_xxaa.out: \
@@ -11,6 +11,9 @@ $(OUTPUT_DIRECTORY)/nrf51822_xxaa.out: \
# Source files common to all targets
SRC_FILES += \
+ $(SDK_ROOT)/external/segger_rtt/RTT_Syscalls_GCC.c \
+ $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
+ $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \
$(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
$(SDK_ROOT)/components/libraries/util/app_error.c \
@@ -23,9 +26,6 @@ SRC_FILES += \
$(SDK_ROOT)/components/drivers_nrf/clock/nrf_drv_clock.c \
$(SDK_ROOT)/components/drivers_nrf/gpiote/nrf_drv_gpiote.c \
$(SDK_ROOT)/components/drivers_nrf/spi_master/nrf_drv_spi.c \
- $(SDK_ROOT)/components/drivers_ext/segger_rtt/RTT_Syscalls_GCC.c \
- $(SDK_ROOT)/components/drivers_ext/segger_rtt/SEGGER_RTT.c \
- $(SDK_ROOT)/components/drivers_ext/segger_rtt/SEGGER_RTT_printf.c \
$(SDK_ROOT)/components/ble/common/ble_advdata.c \
$(SDK_ROOT)/components/ble/ble_advertising/ble_advertising.c \
$(SDK_ROOT)/components/ble/common/ble_conn_params.c \
@@ -34,9 +34,9 @@ SRC_FILES += \
$(SDK_ROOT)/components/toolchain/system_nrf51.c \
$(SDK_ROOT)/components/softdevice/common/softdevice_handler/softdevice_handler.c \
$(PROJ_DIR)/main.c \
- $(PROJ_DIR)/EPD/UC8176.c \
$(PROJ_DIR)/EPD/EPD_driver.c \
$(PROJ_DIR)/EPD/EPD_ble.c \
+ $(PROJ_DIR)/EPD/UC8176.c \
$(PROJ_DIR)/GUI/Calendar.c \
$(PROJ_DIR)/GUI/Lunar.c \
$(PROJ_DIR)/GUI/fonts.c \
@@ -48,6 +48,8 @@ INC_FOLDERS += \
$(PROJ_DIR)/config \
$(PROJ_DIR)/EPD \
$(PROJ_DIR)/GUI \
+ $(SDK_ROOT) \
+ $(SDK_ROOT)/external/segger_rtt \
$(SDK_ROOT)/components/toolchain \
$(SDK_ROOT)/components/drivers_nrf/clock \
$(SDK_ROOT)/components/drivers_nrf/hal \
@@ -55,7 +57,6 @@ INC_FOLDERS += \
$(SDK_ROOT)/components/drivers_nrf/delay \
$(SDK_ROOT)/components/drivers_nrf/gpiote \
$(SDK_ROOT)/components/drivers_nrf/spi_master \
- $(SDK_ROOT)/components/drivers_ext/segger_rtt \
$(SDK_ROOT)/components/libraries/fstorage \
$(SDK_ROOT)/components/libraries/experimental_section_vars \
$(SDK_ROOT)/components/libraries/log \
diff --git a/components/ble/ble_advertising/ble_advertising.c b/SDK/12.3.0_d7731ad/components/ble/ble_advertising/ble_advertising.c
similarity index 100%
rename from components/ble/ble_advertising/ble_advertising.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_advertising/ble_advertising.c
diff --git a/components/ble/ble_advertising/ble_advertising.h b/SDK/12.3.0_d7731ad/components/ble/ble_advertising/ble_advertising.h
similarity index 100%
rename from components/ble/ble_advertising/ble_advertising.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_advertising/ble_advertising.h
diff --git a/components/ble/ble_db_discovery/ble_db_discovery.c b/SDK/12.3.0_d7731ad/components/ble/ble_db_discovery/ble_db_discovery.c
similarity index 100%
rename from components/ble/ble_db_discovery/ble_db_discovery.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_db_discovery/ble_db_discovery.c
diff --git a/components/ble/ble_db_discovery/ble_db_discovery.h b/SDK/12.3.0_d7731ad/components/ble/ble_db_discovery/ble_db_discovery.h
similarity index 100%
rename from components/ble/ble_db_discovery/ble_db_discovery.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_db_discovery/ble_db_discovery.h
diff --git a/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.c b/SDK/12.3.0_d7731ad/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.c
similarity index 100%
rename from components/ble/ble_debug_assert_handler/ble_debug_assert_handler.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.c
diff --git a/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.h b/SDK/12.3.0_d7731ad/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.h
similarity index 100%
rename from components/ble/ble_debug_assert_handler/ble_debug_assert_handler.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_debug_assert_handler/ble_debug_assert_handler.h
diff --git a/components/ble/ble_dtm/ble_dtm.c b/SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm.c
similarity index 100%
rename from components/ble/ble_dtm/ble_dtm.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm.c
diff --git a/components/ble/ble_dtm/ble_dtm.h b/SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm.h
similarity index 100%
rename from components/ble/ble_dtm/ble_dtm.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm.h
diff --git a/components/ble/ble_dtm/ble_dtm_hw.h b/SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw.h
similarity index 100%
rename from components/ble/ble_dtm/ble_dtm_hw.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw.h
diff --git a/components/ble/ble_dtm/ble_dtm_hw_nrf51.c b/SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw_nrf51.c
similarity index 100%
rename from components/ble/ble_dtm/ble_dtm_hw_nrf51.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw_nrf51.c
diff --git a/components/ble/ble_dtm/ble_dtm_hw_nrf52.c b/SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw_nrf52.c
similarity index 100%
rename from components/ble/ble_dtm/ble_dtm_hw_nrf52.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_dtm/ble_dtm_hw_nrf52.c
diff --git a/components/ble/ble_error_log/ble_error_log.c b/SDK/12.3.0_d7731ad/components/ble/ble_error_log/ble_error_log.c
similarity index 100%
rename from components/ble/ble_error_log/ble_error_log.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_error_log/ble_error_log.c
diff --git a/components/ble/ble_error_log/ble_error_log.h b/SDK/12.3.0_d7731ad/components/ble/ble_error_log/ble_error_log.h
similarity index 100%
rename from components/ble/ble_error_log/ble_error_log.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_error_log/ble_error_log.h
diff --git a/components/ble/ble_racp/ble_racp.c b/SDK/12.3.0_d7731ad/components/ble/ble_racp/ble_racp.c
similarity index 100%
rename from components/ble/ble_racp/ble_racp.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_racp/ble_racp.c
diff --git a/components/ble/ble_racp/ble_racp.h b/SDK/12.3.0_d7731ad/components/ble/ble_racp/ble_racp.h
similarity index 100%
rename from components/ble/ble_racp/ble_racp.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_racp/ble_racp.h
diff --git a/components/ble/ble_radio_notification/ble_radio_notification.c b/SDK/12.3.0_d7731ad/components/ble/ble_radio_notification/ble_radio_notification.c
similarity index 100%
rename from components/ble/ble_radio_notification/ble_radio_notification.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_radio_notification/ble_radio_notification.c
diff --git a/components/ble/ble_radio_notification/ble_radio_notification.h b/SDK/12.3.0_d7731ad/components/ble/ble_radio_notification/ble_radio_notification.h
similarity index 100%
rename from components/ble/ble_radio_notification/ble_radio_notification.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_radio_notification/ble_radio_notification.h
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.c
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.c
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.h
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_app_attr_get.h
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.c
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_attr_parser.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.c
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.h
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_attr_parser.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_attr_parser.h
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.c
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.c
diff --git a/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.h
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/ancs_tx_buffer.h
diff --git a/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.c
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.c
diff --git a/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.h
similarity index 100%
rename from components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ancs_c/nrf_ble_ancs_c.h
diff --git a/components/ble/ble_services/ble_ans_c/ble_ans_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ans_c/ble_ans_c.c
similarity index 100%
rename from components/ble/ble_services/ble_ans_c/ble_ans_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ans_c/ble_ans_c.c
diff --git a/components/ble/ble_services/ble_ans_c/ble_ans_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ans_c/ble_ans_c.h
similarity index 100%
rename from components/ble/ble_services/ble_ans_c/ble_ans_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ans_c/ble_ans_c.h
diff --git a/components/ble/ble_services/ble_bas/ble_bas.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas/ble_bas.c
similarity index 100%
rename from components/ble/ble_services/ble_bas/ble_bas.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas/ble_bas.c
diff --git a/components/ble/ble_services/ble_bas/ble_bas.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas/ble_bas.h
similarity index 100%
rename from components/ble/ble_services/ble_bas/ble_bas.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas/ble_bas.h
diff --git a/components/ble/ble_services/ble_bas_c/ble_bas_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas_c/ble_bas_c.c
similarity index 100%
rename from components/ble/ble_services/ble_bas_c/ble_bas_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas_c/ble_bas_c.c
diff --git a/components/ble/ble_services/ble_bas_c/ble_bas_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas_c/ble_bas_c.h
similarity index 100%
rename from components/ble/ble_services/ble_bas_c/ble_bas_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bas_c/ble_bas_c.h
diff --git a/components/ble/ble_services/ble_bps/ble_bps.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bps/ble_bps.c
similarity index 100%
rename from components/ble/ble_services/ble_bps/ble_bps.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bps/ble_bps.c
diff --git a/components/ble/ble_services/ble_bps/ble_bps.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bps/ble_bps.h
similarity index 100%
rename from components/ble/ble_services/ble_bps/ble_bps.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_bps/ble_bps.h
diff --git a/components/ble/ble_services/ble_cscs/ble_cscs.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_cscs.c
similarity index 100%
rename from components/ble/ble_services/ble_cscs/ble_cscs.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_cscs.c
diff --git a/components/ble/ble_services/ble_cscs/ble_cscs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_cscs.h
similarity index 100%
rename from components/ble/ble_services/ble_cscs/ble_cscs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_cscs.h
diff --git a/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.c
similarity index 100%
rename from components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.c
diff --git a/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.h
similarity index 100%
rename from components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cscs/ble_sc_ctrlpt.h
diff --git a/components/ble/ble_services/ble_cts_c/ble_cts_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cts_c/ble_cts_c.c
similarity index 100%
rename from components/ble/ble_services/ble_cts_c/ble_cts_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cts_c/ble_cts_c.c
diff --git a/components/ble/ble_services/ble_cts_c/ble_cts_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cts_c/ble_cts_c.h
similarity index 100%
rename from components/ble/ble_services/ble_cts_c/ble_cts_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_cts_c/ble_cts_c.h
diff --git a/components/ble/ble_services/ble_dfu/ble_dfu.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dfu/ble_dfu.c
similarity index 100%
rename from components/ble/ble_services/ble_dfu/ble_dfu.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dfu/ble_dfu.c
diff --git a/components/ble/ble_services/ble_dfu/ble_dfu.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dfu/ble_dfu.h
similarity index 100%
rename from components/ble/ble_services/ble_dfu/ble_dfu.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dfu/ble_dfu.h
diff --git a/components/ble/ble_services/ble_dis/ble_dis.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dis/ble_dis.c
similarity index 100%
rename from components/ble/ble_services/ble_dis/ble_dis.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dis/ble_dis.c
diff --git a/components/ble/ble_services/ble_dis/ble_dis.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dis/ble_dis.h
similarity index 100%
rename from components/ble/ble_services/ble_dis/ble_dis.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_dis/ble_dis.h
diff --git a/components/ble/ble_services/ble_escs/escs_defs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/escs_defs.h
similarity index 100%
rename from components/ble/ble_services/ble_escs/escs_defs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/escs_defs.h
diff --git a/components/ble/ble_services/ble_escs/nrf_ble_escs.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/nrf_ble_escs.c
similarity index 100%
rename from components/ble/ble_services/ble_escs/nrf_ble_escs.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/nrf_ble_escs.c
diff --git a/components/ble/ble_services/ble_escs/nrf_ble_escs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/nrf_ble_escs.h
similarity index 100%
rename from components/ble/ble_services/ble_escs/nrf_ble_escs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_escs/nrf_ble_escs.h
diff --git a/components/ble/ble_services/ble_gls/ble_gls.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls.c
similarity index 100%
rename from components/ble/ble_services/ble_gls/ble_gls.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls.c
diff --git a/components/ble/ble_services/ble_gls/ble_gls.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls.h
similarity index 100%
rename from components/ble/ble_services/ble_gls/ble_gls.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls.h
diff --git a/components/ble/ble_services/ble_gls/ble_gls_db.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls_db.c
similarity index 100%
rename from components/ble/ble_services/ble_gls/ble_gls_db.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls_db.c
diff --git a/components/ble/ble_services/ble_gls/ble_gls_db.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls_db.h
similarity index 100%
rename from components/ble/ble_services/ble_gls/ble_gls_db.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_gls/ble_gls_db.h
diff --git a/components/ble/ble_services/ble_hids/ble_hids.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hids/ble_hids.c
similarity index 100%
rename from components/ble/ble_services/ble_hids/ble_hids.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hids/ble_hids.c
diff --git a/components/ble/ble_services/ble_hids/ble_hids.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hids/ble_hids.h
similarity index 100%
rename from components/ble/ble_services/ble_hids/ble_hids.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hids/ble_hids.h
diff --git a/components/ble/ble_services/ble_hrs/ble_hrs.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs/ble_hrs.c
similarity index 100%
rename from components/ble/ble_services/ble_hrs/ble_hrs.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs/ble_hrs.c
diff --git a/components/ble/ble_services/ble_hrs/ble_hrs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs/ble_hrs.h
similarity index 100%
rename from components/ble/ble_services/ble_hrs/ble_hrs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs/ble_hrs.h
diff --git a/components/ble/ble_services/ble_hrs_c/ble_hrs_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs_c/ble_hrs_c.c
similarity index 100%
rename from components/ble/ble_services/ble_hrs_c/ble_hrs_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs_c/ble_hrs_c.c
diff --git a/components/ble/ble_services/ble_hrs_c/ble_hrs_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs_c/ble_hrs_c.h
similarity index 100%
rename from components/ble/ble_services/ble_hrs_c/ble_hrs_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hrs_c/ble_hrs_c.h
diff --git a/components/ble/ble_services/ble_hts/ble_hts.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hts/ble_hts.c
similarity index 100%
rename from components/ble/ble_services/ble_hts/ble_hts.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hts/ble_hts.c
diff --git a/components/ble/ble_services/ble_hts/ble_hts.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hts/ble_hts.h
similarity index 100%
rename from components/ble/ble_services/ble_hts/ble_hts.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_hts/ble_hts.h
diff --git a/components/ble/ble_services/ble_ias/ble_ias.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias/ble_ias.c
similarity index 100%
rename from components/ble/ble_services/ble_ias/ble_ias.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias/ble_ias.c
diff --git a/components/ble/ble_services/ble_ias/ble_ias.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias/ble_ias.h
similarity index 100%
rename from components/ble/ble_services/ble_ias/ble_ias.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias/ble_ias.h
diff --git a/components/ble/ble_services/ble_ias_c/ble_ias_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias_c/ble_ias_c.c
similarity index 100%
rename from components/ble/ble_services/ble_ias_c/ble_ias_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias_c/ble_ias_c.c
diff --git a/components/ble/ble_services/ble_ias_c/ble_ias_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias_c/ble_ias_c.h
similarity index 100%
rename from components/ble/ble_services/ble_ias_c/ble_ias_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_ias_c/ble_ias_c.h
diff --git a/components/ble/ble_services/ble_lbs/ble_lbs.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs/ble_lbs.c
similarity index 100%
rename from components/ble/ble_services/ble_lbs/ble_lbs.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs/ble_lbs.c
diff --git a/components/ble/ble_services/ble_lbs/ble_lbs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs/ble_lbs.h
similarity index 100%
rename from components/ble/ble_services/ble_lbs/ble_lbs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs/ble_lbs.h
diff --git a/components/ble/ble_services/ble_lbs_c/ble_lbs_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs_c/ble_lbs_c.c
similarity index 100%
rename from components/ble/ble_services/ble_lbs_c/ble_lbs_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs_c/ble_lbs_c.c
diff --git a/components/ble/ble_services/ble_lbs_c/ble_lbs_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs_c/ble_lbs_c.h
similarity index 100%
rename from components/ble/ble_services/ble_lbs_c/ble_lbs_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lbs_c/ble_lbs_c.h
diff --git a/components/ble/ble_services/ble_lls/ble_lls.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lls/ble_lls.c
similarity index 100%
rename from components/ble/ble_services/ble_lls/ble_lls.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lls/ble_lls.c
diff --git a/components/ble/ble_services/ble_lls/ble_lls.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lls/ble_lls.h
similarity index 100%
rename from components/ble/ble_services/ble_lls/ble_lls.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_lls/ble_lls.h
diff --git a/components/ble/ble_services/ble_nus/ble_nus.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus/ble_nus.c
similarity index 100%
rename from components/ble/ble_services/ble_nus/ble_nus.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus/ble_nus.c
diff --git a/components/ble/ble_services/ble_nus/ble_nus.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus/ble_nus.h
similarity index 100%
rename from components/ble/ble_services/ble_nus/ble_nus.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus/ble_nus.h
diff --git a/components/ble/ble_services/ble_nus_c/ble_nus_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus_c/ble_nus_c.c
similarity index 100%
rename from components/ble/ble_services/ble_nus_c/ble_nus_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus_c/ble_nus_c.c
diff --git a/components/ble/ble_services/ble_nus_c/ble_nus_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus_c/ble_nus_c.h
similarity index 100%
rename from components/ble/ble_services/ble_nus_c/ble_nus_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_nus_c/ble_nus_c.h
diff --git a/components/ble/ble_services/ble_rscs/ble_rscs.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs/ble_rscs.c
similarity index 100%
rename from components/ble/ble_services/ble_rscs/ble_rscs.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs/ble_rscs.c
diff --git a/components/ble/ble_services/ble_rscs/ble_rscs.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs/ble_rscs.h
similarity index 100%
rename from components/ble/ble_services/ble_rscs/ble_rscs.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs/ble_rscs.h
diff --git a/components/ble/ble_services/ble_rscs_c/ble_rscs_c.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs_c/ble_rscs_c.c
similarity index 100%
rename from components/ble/ble_services/ble_rscs_c/ble_rscs_c.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs_c/ble_rscs_c.c
diff --git a/components/ble/ble_services/ble_rscs_c/ble_rscs_c.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs_c/ble_rscs_c.h
similarity index 100%
rename from components/ble/ble_services/ble_rscs_c/ble_rscs_c.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_rscs_c/ble_rscs_c.h
diff --git a/components/ble/ble_services/ble_tps/ble_tps.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_tps/ble_tps.c
similarity index 100%
rename from components/ble/ble_services/ble_tps/ble_tps.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_tps/ble_tps.c
diff --git a/components/ble/ble_services/ble_tps/ble_tps.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/ble_tps/ble_tps.h
similarity index 100%
rename from components/ble/ble_services/ble_tps/ble_tps.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/ble_tps/ble_tps.h
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_ln_common.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_common.h
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_ln_common.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_common.h
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.c
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_ln_cp.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.c
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.h
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_ln_cp.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_cp.h
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_ln_db.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_db.c
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_ln_db.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_db.c
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_ln_db.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_db.h
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_ln_db.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_ln_db.h
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_lns.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_lns.c
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_lns.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_lns.c
diff --git a/components/ble/ble_services/experimental_ble_lns/ble_lns.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_lns.h
similarity index 100%
rename from components/ble/ble_services/experimental_ble_lns/ble_lns.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_ble_lns/ble_lns.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_bms/nrf_ble_bms.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_db.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_meas.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_racp.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_socp.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/cgms_sst.h
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.c b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.c
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.c
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.c
diff --git a/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.h b/SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.h
similarity index 100%
rename from components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.h
rename to SDK/12.3.0_d7731ad/components/ble/ble_services/experimental_nrf_ble_cgms/nrf_ble_cgms.h
diff --git a/components/ble/common/ble_advdata.c b/SDK/12.3.0_d7731ad/components/ble/common/ble_advdata.c
similarity index 100%
rename from components/ble/common/ble_advdata.c
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_advdata.c
diff --git a/components/ble/common/ble_advdata.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_advdata.h
similarity index 100%
rename from components/ble/common/ble_advdata.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_advdata.h
diff --git a/components/ble/common/ble_conn_params.c b/SDK/12.3.0_d7731ad/components/ble/common/ble_conn_params.c
similarity index 100%
rename from components/ble/common/ble_conn_params.c
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_conn_params.c
diff --git a/components/ble/common/ble_conn_params.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_conn_params.h
similarity index 100%
rename from components/ble/common/ble_conn_params.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_conn_params.h
diff --git a/components/ble/common/ble_conn_state.c b/SDK/12.3.0_d7731ad/components/ble/common/ble_conn_state.c
similarity index 100%
rename from components/ble/common/ble_conn_state.c
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_conn_state.c
diff --git a/components/ble/common/ble_conn_state.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_conn_state.h
similarity index 100%
rename from components/ble/common/ble_conn_state.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_conn_state.h
diff --git a/components/ble/common/ble_date_time.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_date_time.h
similarity index 100%
rename from components/ble/common/ble_date_time.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_date_time.h
diff --git a/components/ble/common/ble_gatt_db.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_gatt_db.h
similarity index 100%
rename from components/ble/common/ble_gatt_db.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_gatt_db.h
diff --git a/components/ble/common/ble_sensor_location.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_sensor_location.h
similarity index 100%
rename from components/ble/common/ble_sensor_location.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_sensor_location.h
diff --git a/components/ble/common/ble_srv_common.c b/SDK/12.3.0_d7731ad/components/ble/common/ble_srv_common.c
similarity index 100%
rename from components/ble/common/ble_srv_common.c
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_srv_common.c
diff --git a/components/ble/common/ble_srv_common.h b/SDK/12.3.0_d7731ad/components/ble/common/ble_srv_common.h
similarity index 100%
rename from components/ble/common/ble_srv_common.h
rename to SDK/12.3.0_d7731ad/components/ble/common/ble_srv_common.h
diff --git a/components/ble/nrf_ble_gatt/nrf_ble_gatt.c b/SDK/12.3.0_d7731ad/components/ble/nrf_ble_gatt/nrf_ble_gatt.c
similarity index 100%
rename from components/ble/nrf_ble_gatt/nrf_ble_gatt.c
rename to SDK/12.3.0_d7731ad/components/ble/nrf_ble_gatt/nrf_ble_gatt.c
diff --git a/components/ble/nrf_ble_gatt/nrf_ble_gatt.h b/SDK/12.3.0_d7731ad/components/ble/nrf_ble_gatt/nrf_ble_gatt.h
similarity index 100%
rename from components/ble/nrf_ble_gatt/nrf_ble_gatt.h
rename to SDK/12.3.0_d7731ad/components/ble/nrf_ble_gatt/nrf_ble_gatt.h
diff --git a/components/ble/nrf_ble_qwr/nrf_ble_qwr.c b/SDK/12.3.0_d7731ad/components/ble/nrf_ble_qwr/nrf_ble_qwr.c
similarity index 100%
rename from components/ble/nrf_ble_qwr/nrf_ble_qwr.c
rename to SDK/12.3.0_d7731ad/components/ble/nrf_ble_qwr/nrf_ble_qwr.c
diff --git a/components/ble/nrf_ble_qwr/nrf_ble_qwr.h b/SDK/12.3.0_d7731ad/components/ble/nrf_ble_qwr/nrf_ble_qwr.h
similarity index 100%
rename from components/ble/nrf_ble_qwr/nrf_ble_qwr.h
rename to SDK/12.3.0_d7731ad/components/ble/nrf_ble_qwr/nrf_ble_qwr.h
diff --git a/components/ble/peer_manager/gatt_cache_manager.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/gatt_cache_manager.c
similarity index 100%
rename from components/ble/peer_manager/gatt_cache_manager.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/gatt_cache_manager.c
diff --git a/components/ble/peer_manager/gatt_cache_manager.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/gatt_cache_manager.h
similarity index 100%
rename from components/ble/peer_manager/gatt_cache_manager.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/gatt_cache_manager.h
diff --git a/components/ble/peer_manager/gatts_cache_manager.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/gatts_cache_manager.c
similarity index 100%
rename from components/ble/peer_manager/gatts_cache_manager.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/gatts_cache_manager.c
diff --git a/components/ble/peer_manager/gatts_cache_manager.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/gatts_cache_manager.h
similarity index 100%
rename from components/ble/peer_manager/gatts_cache_manager.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/gatts_cache_manager.h
diff --git a/components/ble/peer_manager/id_manager.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/id_manager.c
similarity index 100%
rename from components/ble/peer_manager/id_manager.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/id_manager.c
diff --git a/components/ble/peer_manager/id_manager.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/id_manager.h
similarity index 100%
rename from components/ble/peer_manager/id_manager.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/id_manager.h
diff --git a/components/ble/peer_manager/peer_data.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data.c
similarity index 100%
rename from components/ble/peer_manager/peer_data.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data.c
diff --git a/components/ble/peer_manager/peer_data.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data.h
similarity index 100%
rename from components/ble/peer_manager/peer_data.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data.h
diff --git a/components/ble/peer_manager/peer_data_storage.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data_storage.c
similarity index 100%
rename from components/ble/peer_manager/peer_data_storage.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data_storage.c
diff --git a/components/ble/peer_manager/peer_data_storage.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data_storage.h
similarity index 100%
rename from components/ble/peer_manager/peer_data_storage.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_data_storage.h
diff --git a/components/ble/peer_manager/peer_database.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_database.c
similarity index 100%
rename from components/ble/peer_manager/peer_database.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_database.c
diff --git a/components/ble/peer_manager/peer_database.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_database.h
similarity index 100%
rename from components/ble/peer_manager/peer_database.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_database.h
diff --git a/components/ble/peer_manager/peer_id.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_id.c
similarity index 100%
rename from components/ble/peer_manager/peer_id.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_id.c
diff --git a/components/ble/peer_manager/peer_id.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_id.h
similarity index 100%
rename from components/ble/peer_manager/peer_id.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_id.h
diff --git a/components/ble/peer_manager/peer_manager.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager.c
similarity index 100%
rename from components/ble/peer_manager/peer_manager.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager.c
diff --git a/components/ble/peer_manager/peer_manager.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager.h
similarity index 100%
rename from components/ble/peer_manager/peer_manager.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager.h
diff --git a/components/ble/peer_manager/peer_manager_internal.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager_internal.h
similarity index 100%
rename from components/ble/peer_manager/peer_manager_internal.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager_internal.h
diff --git a/components/ble/peer_manager/peer_manager_types.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager_types.h
similarity index 100%
rename from components/ble/peer_manager/peer_manager_types.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/peer_manager_types.h
diff --git a/components/ble/peer_manager/pm_buffer.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_buffer.c
similarity index 100%
rename from components/ble/peer_manager/pm_buffer.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_buffer.c
diff --git a/components/ble/peer_manager/pm_buffer.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_buffer.h
similarity index 100%
rename from components/ble/peer_manager/pm_buffer.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_buffer.h
diff --git a/components/ble/peer_manager/pm_mutex.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_mutex.c
similarity index 100%
rename from components/ble/peer_manager/pm_mutex.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_mutex.c
diff --git a/components/ble/peer_manager/pm_mutex.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_mutex.h
similarity index 100%
rename from components/ble/peer_manager/pm_mutex.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/pm_mutex.h
diff --git a/components/ble/peer_manager/security_dispatcher.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/security_dispatcher.c
similarity index 100%
rename from components/ble/peer_manager/security_dispatcher.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/security_dispatcher.c
diff --git a/components/ble/peer_manager/security_dispatcher.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/security_dispatcher.h
similarity index 100%
rename from components/ble/peer_manager/security_dispatcher.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/security_dispatcher.h
diff --git a/components/ble/peer_manager/security_manager.c b/SDK/12.3.0_d7731ad/components/ble/peer_manager/security_manager.c
similarity index 100%
rename from components/ble/peer_manager/security_manager.c
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/security_manager.c
diff --git a/components/ble/peer_manager/security_manager.h b/SDK/12.3.0_d7731ad/components/ble/peer_manager/security_manager.h
similarity index 100%
rename from components/ble/peer_manager/security_manager.h
rename to SDK/12.3.0_d7731ad/components/ble/peer_manager/security_manager.h
diff --git a/components/boards/arduino_primo.h b/SDK/12.3.0_d7731ad/components/boards/arduino_primo.h
similarity index 100%
rename from components/boards/arduino_primo.h
rename to SDK/12.3.0_d7731ad/components/boards/arduino_primo.h
diff --git a/components/boards/boards.c b/SDK/12.3.0_d7731ad/components/boards/boards.c
similarity index 100%
rename from components/boards/boards.c
rename to SDK/12.3.0_d7731ad/components/boards/boards.c
diff --git a/components/boards/boards.h b/SDK/12.3.0_d7731ad/components/boards/boards.h
similarity index 100%
rename from components/boards/boards.h
rename to SDK/12.3.0_d7731ad/components/boards/boards.h
diff --git a/components/boards/d52_starterkit.h b/SDK/12.3.0_d7731ad/components/boards/d52_starterkit.h
similarity index 100%
rename from components/boards/d52_starterkit.h
rename to SDK/12.3.0_d7731ad/components/boards/d52_starterkit.h
diff --git a/components/boards/n5_starterkit.h b/SDK/12.3.0_d7731ad/components/boards/n5_starterkit.h
similarity index 100%
rename from components/boards/n5_starterkit.h
rename to SDK/12.3.0_d7731ad/components/boards/n5_starterkit.h
diff --git a/components/boards/nrf6310.h b/SDK/12.3.0_d7731ad/components/boards/nrf6310.h
similarity index 100%
rename from components/boards/nrf6310.h
rename to SDK/12.3.0_d7731ad/components/boards/nrf6310.h
diff --git a/components/boards/pca10000.h b/SDK/12.3.0_d7731ad/components/boards/pca10000.h
similarity index 100%
rename from components/boards/pca10000.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10000.h
diff --git a/components/boards/pca10001.h b/SDK/12.3.0_d7731ad/components/boards/pca10001.h
similarity index 100%
rename from components/boards/pca10001.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10001.h
diff --git a/components/boards/pca10003.h b/SDK/12.3.0_d7731ad/components/boards/pca10003.h
similarity index 100%
rename from components/boards/pca10003.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10003.h
diff --git a/components/boards/pca10028.h b/SDK/12.3.0_d7731ad/components/boards/pca10028.h
similarity index 100%
rename from components/boards/pca10028.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10028.h
diff --git a/components/boards/pca10031.h b/SDK/12.3.0_d7731ad/components/boards/pca10031.h
similarity index 100%
rename from components/boards/pca10031.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10031.h
diff --git a/components/boards/pca10036.h b/SDK/12.3.0_d7731ad/components/boards/pca10036.h
similarity index 100%
rename from components/boards/pca10036.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10036.h
diff --git a/components/boards/pca10040.h b/SDK/12.3.0_d7731ad/components/boards/pca10040.h
similarity index 100%
rename from components/boards/pca10040.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10040.h
diff --git a/components/boards/pca10056.h b/SDK/12.3.0_d7731ad/components/boards/pca10056.h
similarity index 100%
rename from components/boards/pca10056.h
rename to SDK/12.3.0_d7731ad/components/boards/pca10056.h
diff --git a/components/boards/pca20006.h b/SDK/12.3.0_d7731ad/components/boards/pca20006.h
similarity index 100%
rename from components/boards/pca20006.h
rename to SDK/12.3.0_d7731ad/components/boards/pca20006.h
diff --git a/components/boards/wt51822.h b/SDK/12.3.0_d7731ad/components/boards/wt51822.h
similarity index 100%
rename from components/boards/wt51822.h
rename to SDK/12.3.0_d7731ad/components/boards/wt51822.h
diff --git a/components/device/compiler_abstraction.h b/SDK/12.3.0_d7731ad/components/device/compiler_abstraction.h
similarity index 100%
rename from components/device/compiler_abstraction.h
rename to SDK/12.3.0_d7731ad/components/device/compiler_abstraction.h
diff --git a/components/device/nrf.h b/SDK/12.3.0_d7731ad/components/device/nrf.h
similarity index 100%
rename from components/device/nrf.h
rename to SDK/12.3.0_d7731ad/components/device/nrf.h
diff --git a/components/device/nrf51.h b/SDK/12.3.0_d7731ad/components/device/nrf51.h
similarity index 100%
rename from components/device/nrf51.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51.h
diff --git a/components/device/nrf51422_peripherals.h b/SDK/12.3.0_d7731ad/components/device/nrf51422_peripherals.h
similarity index 100%
rename from components/device/nrf51422_peripherals.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51422_peripherals.h
diff --git a/components/device/nrf51802_peripherals.h b/SDK/12.3.0_d7731ad/components/device/nrf51802_peripherals.h
similarity index 100%
rename from components/device/nrf51802_peripherals.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51802_peripherals.h
diff --git a/components/device/nrf51822_peripherals.h b/SDK/12.3.0_d7731ad/components/device/nrf51822_peripherals.h
similarity index 100%
rename from components/device/nrf51822_peripherals.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51822_peripherals.h
diff --git a/components/device/nrf51_bitfields.h b/SDK/12.3.0_d7731ad/components/device/nrf51_bitfields.h
similarity index 100%
rename from components/device/nrf51_bitfields.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51_bitfields.h
diff --git a/components/device/nrf51_deprecated.h b/SDK/12.3.0_d7731ad/components/device/nrf51_deprecated.h
similarity index 100%
rename from components/device/nrf51_deprecated.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51_deprecated.h
diff --git a/components/device/nrf51_to_nrf52.h b/SDK/12.3.0_d7731ad/components/device/nrf51_to_nrf52.h
similarity index 100%
rename from components/device/nrf51_to_nrf52.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51_to_nrf52.h
diff --git a/components/device/nrf51_to_nrf52840.h b/SDK/12.3.0_d7731ad/components/device/nrf51_to_nrf52840.h
similarity index 100%
rename from components/device/nrf51_to_nrf52840.h
rename to SDK/12.3.0_d7731ad/components/device/nrf51_to_nrf52840.h
diff --git a/components/device/nrf52.h b/SDK/12.3.0_d7731ad/components/device/nrf52.h
similarity index 100%
rename from components/device/nrf52.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52.h
diff --git a/components/device/nrf52832_peripherals.h b/SDK/12.3.0_d7731ad/components/device/nrf52832_peripherals.h
similarity index 100%
rename from components/device/nrf52832_peripherals.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52832_peripherals.h
diff --git a/components/device/nrf52840.h b/SDK/12.3.0_d7731ad/components/device/nrf52840.h
similarity index 100%
rename from components/device/nrf52840.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52840.h
diff --git a/components/device/nrf52840_bitfields.h b/SDK/12.3.0_d7731ad/components/device/nrf52840_bitfields.h
similarity index 100%
rename from components/device/nrf52840_bitfields.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52840_bitfields.h
diff --git a/components/device/nrf52840_peripherals.h b/SDK/12.3.0_d7731ad/components/device/nrf52840_peripherals.h
similarity index 100%
rename from components/device/nrf52840_peripherals.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52840_peripherals.h
diff --git a/components/device/nrf52_bitfields.h b/SDK/12.3.0_d7731ad/components/device/nrf52_bitfields.h
similarity index 100%
rename from components/device/nrf52_bitfields.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52_bitfields.h
diff --git a/components/device/nrf52_name_change.h b/SDK/12.3.0_d7731ad/components/device/nrf52_name_change.h
similarity index 100%
rename from components/device/nrf52_name_change.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52_name_change.h
diff --git a/components/device/nrf52_to_nrf52840.h b/SDK/12.3.0_d7731ad/components/device/nrf52_to_nrf52840.h
similarity index 100%
rename from components/device/nrf52_to_nrf52840.h
rename to SDK/12.3.0_d7731ad/components/device/nrf52_to_nrf52840.h
diff --git a/components/drivers_ext/adns2080/adns2080.c b/SDK/12.3.0_d7731ad/components/drivers_ext/adns2080/adns2080.c
similarity index 100%
rename from components/drivers_ext/adns2080/adns2080.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/adns2080/adns2080.c
diff --git a/components/drivers_ext/adns2080/adns2080.h b/SDK/12.3.0_d7731ad/components/drivers_ext/adns2080/adns2080.h
similarity index 100%
rename from components/drivers_ext/adns2080/adns2080.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/adns2080/adns2080.h
diff --git a/components/drivers_ext/cherry8x16/cherry8x16.c b/SDK/12.3.0_d7731ad/components/drivers_ext/cherry8x16/cherry8x16.c
similarity index 100%
rename from components/drivers_ext/cherry8x16/cherry8x16.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/cherry8x16/cherry8x16.c
diff --git a/components/drivers_ext/cherry8x16/cherry8x16.h b/SDK/12.3.0_d7731ad/components/drivers_ext/cherry8x16/cherry8x16.h
similarity index 100%
rename from components/drivers_ext/cherry8x16/cherry8x16.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/cherry8x16/cherry8x16.h
diff --git a/components/drivers_ext/ds1624/ds1624.c b/SDK/12.3.0_d7731ad/components/drivers_ext/ds1624/ds1624.c
similarity index 100%
rename from components/drivers_ext/ds1624/ds1624.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/ds1624/ds1624.c
diff --git a/components/drivers_ext/ds1624/ds1624.h b/SDK/12.3.0_d7731ad/components/drivers_ext/ds1624/ds1624.h
similarity index 100%
rename from components/drivers_ext/ds1624/ds1624.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/ds1624/ds1624.h
diff --git a/components/drivers_ext/max9850/max9850.c b/SDK/12.3.0_d7731ad/components/drivers_ext/max9850/max9850.c
similarity index 100%
rename from components/drivers_ext/max9850/max9850.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/max9850/max9850.c
diff --git a/components/drivers_ext/max9850/max9850.h b/SDK/12.3.0_d7731ad/components/drivers_ext/max9850/max9850.h
similarity index 100%
rename from components/drivers_ext/max9850/max9850.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/max9850/max9850.h
diff --git a/components/drivers_ext/mcp4725/mcp4725.c b/SDK/12.3.0_d7731ad/components/drivers_ext/mcp4725/mcp4725.c
similarity index 100%
rename from components/drivers_ext/mcp4725/mcp4725.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/mcp4725/mcp4725.c
diff --git a/components/drivers_ext/mcp4725/mcp4725.h b/SDK/12.3.0_d7731ad/components/drivers_ext/mcp4725/mcp4725.h
similarity index 100%
rename from components/drivers_ext/mcp4725/mcp4725.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/mcp4725/mcp4725.h
diff --git a/components/drivers_ext/mpu6050/mpu6050.c b/SDK/12.3.0_d7731ad/components/drivers_ext/mpu6050/mpu6050.c
similarity index 100%
rename from components/drivers_ext/mpu6050/mpu6050.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/mpu6050/mpu6050.c
diff --git a/components/drivers_ext/mpu6050/mpu6050.h b/SDK/12.3.0_d7731ad/components/drivers_ext/mpu6050/mpu6050.h
similarity index 100%
rename from components/drivers_ext/mpu6050/mpu6050.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/mpu6050/mpu6050.h
diff --git a/components/drivers_ext/nrf6350/nrf6350.c b/SDK/12.3.0_d7731ad/components/drivers_ext/nrf6350/nrf6350.c
similarity index 100%
rename from components/drivers_ext/nrf6350/nrf6350.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/nrf6350/nrf6350.c
diff --git a/components/drivers_ext/nrf6350/nrf6350.h b/SDK/12.3.0_d7731ad/components/drivers_ext/nrf6350/nrf6350.h
similarity index 100%
rename from components/drivers_ext/nrf6350/nrf6350.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/nrf6350/nrf6350.h
diff --git a/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.c b/SDK/12.3.0_d7731ad/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.c
similarity index 100%
rename from components/drivers_ext/synaptics_touchpad/synaptics_touchpad.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.c
diff --git a/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.h b/SDK/12.3.0_d7731ad/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.h
similarity index 100%
rename from components/drivers_ext/synaptics_touchpad/synaptics_touchpad.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/synaptics_touchpad/synaptics_touchpad.h
diff --git a/components/drivers_ext/uda1380/uda1380.c b/SDK/12.3.0_d7731ad/components/drivers_ext/uda1380/uda1380.c
similarity index 100%
rename from components/drivers_ext/uda1380/uda1380.c
rename to SDK/12.3.0_d7731ad/components/drivers_ext/uda1380/uda1380.c
diff --git a/components/drivers_ext/uda1380/uda1380.h b/SDK/12.3.0_d7731ad/components/drivers_ext/uda1380/uda1380.h
similarity index 100%
rename from components/drivers_ext/uda1380/uda1380.h
rename to SDK/12.3.0_d7731ad/components/drivers_ext/uda1380/uda1380.h
diff --git a/components/drivers_nrf/adc/nrf_drv_adc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/adc/nrf_drv_adc.c
similarity index 100%
rename from components/drivers_nrf/adc/nrf_drv_adc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/adc/nrf_drv_adc.c
diff --git a/components/drivers_nrf/adc/nrf_drv_adc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/adc/nrf_drv_adc.h
similarity index 100%
rename from components/drivers_nrf/adc/nrf_drv_adc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/adc/nrf_drv_adc.h
diff --git a/components/drivers_nrf/ble_flash/ble_flash.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/ble_flash/ble_flash.c
similarity index 100%
rename from components/drivers_nrf/ble_flash/ble_flash.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/ble_flash/ble_flash.c
diff --git a/components/drivers_nrf/ble_flash/ble_flash.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/ble_flash/ble_flash.h
similarity index 100%
rename from components/drivers_nrf/ble_flash/ble_flash.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/ble_flash/ble_flash.h
diff --git a/components/drivers_nrf/clock/nrf_drv_clock.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/clock/nrf_drv_clock.c
similarity index 100%
rename from components/drivers_nrf/clock/nrf_drv_clock.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/clock/nrf_drv_clock.c
diff --git a/components/drivers_nrf/clock/nrf_drv_clock.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/clock/nrf_drv_clock.h
similarity index 100%
rename from components/drivers_nrf/clock/nrf_drv_clock.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/clock/nrf_drv_clock.h
diff --git a/components/drivers_nrf/common/nrf_drv_common.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/common/nrf_drv_common.c
similarity index 100%
rename from components/drivers_nrf/common/nrf_drv_common.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/common/nrf_drv_common.c
diff --git a/components/drivers_nrf/common/nrf_drv_common.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/common/nrf_drv_common.h
similarity index 100%
rename from components/drivers_nrf/common/nrf_drv_common.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/common/nrf_drv_common.h
diff --git a/components/drivers_nrf/comp/nrf_drv_comp.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/comp/nrf_drv_comp.c
similarity index 100%
rename from components/drivers_nrf/comp/nrf_drv_comp.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/comp/nrf_drv_comp.c
diff --git a/components/drivers_nrf/comp/nrf_drv_comp.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/comp/nrf_drv_comp.h
similarity index 100%
rename from components/drivers_nrf/comp/nrf_drv_comp.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/comp/nrf_drv_comp.h
diff --git a/components/drivers_nrf/delay/nrf_delay.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/delay/nrf_delay.h
similarity index 100%
rename from components/drivers_nrf/delay/nrf_delay.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/delay/nrf_delay.h
diff --git a/components/drivers_nrf/gpiote/nrf_drv_gpiote.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/gpiote/nrf_drv_gpiote.c
similarity index 100%
rename from components/drivers_nrf/gpiote/nrf_drv_gpiote.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/gpiote/nrf_drv_gpiote.c
diff --git a/components/drivers_nrf/gpiote/nrf_drv_gpiote.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/gpiote/nrf_drv_gpiote.h
similarity index 100%
rename from components/drivers_nrf/gpiote/nrf_drv_gpiote.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/gpiote/nrf_drv_gpiote.h
diff --git a/components/drivers_nrf/hal/nrf_adc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_adc.c
similarity index 100%
rename from components/drivers_nrf/hal/nrf_adc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_adc.c
diff --git a/components/drivers_nrf/hal/nrf_adc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_adc.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_adc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_adc.h
diff --git a/components/drivers_nrf/hal/nrf_clock.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_clock.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_clock.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_clock.h
diff --git a/components/drivers_nrf/hal/nrf_comp.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_comp.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_comp.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_comp.h
diff --git a/components/drivers_nrf/hal/nrf_ecb.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ecb.c
similarity index 100%
rename from components/drivers_nrf/hal/nrf_ecb.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ecb.c
diff --git a/components/drivers_nrf/hal/nrf_ecb.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ecb.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_ecb.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ecb.h
diff --git a/components/drivers_nrf/hal/nrf_egu.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_egu.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_egu.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_egu.h
diff --git a/components/drivers_nrf/hal/nrf_gpio.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_gpio.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_gpio.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_gpio.h
diff --git a/components/drivers_nrf/hal/nrf_gpiote.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_gpiote.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_gpiote.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_gpiote.h
diff --git a/components/drivers_nrf/hal/nrf_i2s.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_i2s.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_i2s.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_i2s.h
diff --git a/components/drivers_nrf/hal/nrf_lpcomp.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_lpcomp.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_lpcomp.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_lpcomp.h
diff --git a/components/drivers_nrf/hal/nrf_nvmc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_nvmc.c
similarity index 100%
rename from components/drivers_nrf/hal/nrf_nvmc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_nvmc.c
diff --git a/components/drivers_nrf/hal/nrf_nvmc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_nvmc.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_nvmc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_nvmc.h
diff --git a/components/drivers_nrf/hal/nrf_pdm.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_pdm.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_pdm.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_pdm.h
diff --git a/components/drivers_nrf/hal/nrf_peripherals.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_peripherals.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_peripherals.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_peripherals.h
diff --git a/components/drivers_nrf/hal/nrf_power.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_power.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_power.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_power.h
diff --git a/components/drivers_nrf/hal/nrf_ppi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ppi.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_ppi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_ppi.h
diff --git a/components/drivers_nrf/hal/nrf_pwm.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_pwm.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_pwm.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_pwm.h
diff --git a/components/drivers_nrf/hal/nrf_qdec.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_qdec.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_qdec.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_qdec.h
diff --git a/components/drivers_nrf/hal/nrf_qspi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_qspi.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_qspi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_qspi.h
diff --git a/components/drivers_nrf/hal/nrf_rng.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_rng.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_rng.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_rng.h
diff --git a/components/drivers_nrf/hal/nrf_rtc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_rtc.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_rtc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_rtc.h
diff --git a/components/drivers_nrf/hal/nrf_saadc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_saadc.c
similarity index 100%
rename from components/drivers_nrf/hal/nrf_saadc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_saadc.c
diff --git a/components/drivers_nrf/hal/nrf_saadc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_saadc.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_saadc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_saadc.h
diff --git a/components/drivers_nrf/hal/nrf_spi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spi.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_spi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spi.h
diff --git a/components/drivers_nrf/hal/nrf_spim.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spim.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_spim.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spim.h
diff --git a/components/drivers_nrf/hal/nrf_spis.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spis.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_spis.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_spis.h
diff --git a/components/drivers_nrf/hal/nrf_systick.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_systick.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_systick.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_systick.h
diff --git a/components/drivers_nrf/hal/nrf_temp.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_temp.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_temp.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_temp.h
diff --git a/components/drivers_nrf/hal/nrf_timer.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_timer.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_timer.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_timer.h
diff --git a/components/drivers_nrf/hal/nrf_twi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twi.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_twi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twi.h
diff --git a/components/drivers_nrf/hal/nrf_twim.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twim.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_twim.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twim.h
diff --git a/components/drivers_nrf/hal/nrf_twis.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twis.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_twis.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_twis.h
diff --git a/components/drivers_nrf/hal/nrf_uart.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_uart.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_uart.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_uart.h
diff --git a/components/drivers_nrf/hal/nrf_uarte.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_uarte.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_uarte.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_uarte.h
diff --git a/components/drivers_nrf/hal/nrf_usbd.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_usbd.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_usbd.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_usbd.h
diff --git a/components/drivers_nrf/hal/nrf_wdt.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_wdt.h
similarity index 100%
rename from components/drivers_nrf/hal/nrf_wdt.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/hal/nrf_wdt.h
diff --git a/components/drivers_nrf/i2s/nrf_drv_i2s.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/i2s/nrf_drv_i2s.c
similarity index 100%
rename from components/drivers_nrf/i2s/nrf_drv_i2s.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/i2s/nrf_drv_i2s.c
diff --git a/components/drivers_nrf/i2s/nrf_drv_i2s.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/i2s/nrf_drv_i2s.h
similarity index 100%
rename from components/drivers_nrf/i2s/nrf_drv_i2s.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/i2s/nrf_drv_i2s.h
diff --git a/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.c
similarity index 100%
rename from components/drivers_nrf/lpcomp/nrf_drv_lpcomp.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.c
diff --git a/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.h
similarity index 100%
rename from components/drivers_nrf/lpcomp/nrf_drv_lpcomp.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/lpcomp/nrf_drv_lpcomp.h
diff --git a/components/drivers_nrf/nrf_soc_nosd/nrf_error.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_error.h
similarity index 100%
rename from components/drivers_nrf/nrf_soc_nosd/nrf_error.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_error.h
diff --git a/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c
similarity index 100%
rename from components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c
diff --git a/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.h
similarity index 100%
rename from components/drivers_nrf/nrf_soc_nosd/nrf_nvic.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_nvic.h
diff --git a/components/drivers_nrf/nrf_soc_nosd/nrf_soc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_soc.c
similarity index 100%
rename from components/drivers_nrf/nrf_soc_nosd/nrf_soc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_soc.c
diff --git a/components/drivers_nrf/nrf_soc_nosd/nrf_soc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_soc.h
similarity index 100%
rename from components/drivers_nrf/nrf_soc_nosd/nrf_soc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/nrf_soc_nosd/nrf_soc.h
diff --git a/components/drivers_nrf/pdm/nrf_drv_pdm.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/pdm/nrf_drv_pdm.c
similarity index 100%
rename from components/drivers_nrf/pdm/nrf_drv_pdm.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/pdm/nrf_drv_pdm.c
diff --git a/components/drivers_nrf/pdm/nrf_drv_pdm.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/pdm/nrf_drv_pdm.h
similarity index 100%
rename from components/drivers_nrf/pdm/nrf_drv_pdm.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/pdm/nrf_drv_pdm.h
diff --git a/components/drivers_nrf/power/nrf_drv_power.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/power/nrf_drv_power.c
similarity index 100%
rename from components/drivers_nrf/power/nrf_drv_power.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/power/nrf_drv_power.c
diff --git a/components/drivers_nrf/power/nrf_drv_power.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/power/nrf_drv_power.h
similarity index 100%
rename from components/drivers_nrf/power/nrf_drv_power.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/power/nrf_drv_power.h
diff --git a/components/drivers_nrf/ppi/nrf_drv_ppi.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/ppi/nrf_drv_ppi.c
similarity index 100%
rename from components/drivers_nrf/ppi/nrf_drv_ppi.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/ppi/nrf_drv_ppi.c
diff --git a/components/drivers_nrf/ppi/nrf_drv_ppi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/ppi/nrf_drv_ppi.h
similarity index 100%
rename from components/drivers_nrf/ppi/nrf_drv_ppi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/ppi/nrf_drv_ppi.h
diff --git a/components/drivers_nrf/pwm/nrf_drv_pwm.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/pwm/nrf_drv_pwm.c
similarity index 100%
rename from components/drivers_nrf/pwm/nrf_drv_pwm.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/pwm/nrf_drv_pwm.c
diff --git a/components/drivers_nrf/pwm/nrf_drv_pwm.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/pwm/nrf_drv_pwm.h
similarity index 100%
rename from components/drivers_nrf/pwm/nrf_drv_pwm.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/pwm/nrf_drv_pwm.h
diff --git a/components/drivers_nrf/qdec/nrf_drv_qdec.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/qdec/nrf_drv_qdec.c
similarity index 100%
rename from components/drivers_nrf/qdec/nrf_drv_qdec.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/qdec/nrf_drv_qdec.c
diff --git a/components/drivers_nrf/qdec/nrf_drv_qdec.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/qdec/nrf_drv_qdec.h
similarity index 100%
rename from components/drivers_nrf/qdec/nrf_drv_qdec.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/qdec/nrf_drv_qdec.h
diff --git a/components/drivers_nrf/qspi/nrf_drv_qspi.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/qspi/nrf_drv_qspi.c
similarity index 100%
rename from components/drivers_nrf/qspi/nrf_drv_qspi.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/qspi/nrf_drv_qspi.c
diff --git a/components/drivers_nrf/qspi/nrf_drv_qspi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/qspi/nrf_drv_qspi.h
similarity index 100%
rename from components/drivers_nrf/qspi/nrf_drv_qspi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/qspi/nrf_drv_qspi.h
diff --git a/components/drivers_nrf/radio_config/radio_config.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/radio_config/radio_config.c
similarity index 100%
rename from components/drivers_nrf/radio_config/radio_config.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/radio_config/radio_config.c
diff --git a/components/drivers_nrf/radio_config/radio_config.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/radio_config/radio_config.h
similarity index 100%
rename from components/drivers_nrf/radio_config/radio_config.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/radio_config/radio_config.h
diff --git a/components/drivers_nrf/rng/nrf_drv_rng.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/rng/nrf_drv_rng.c
similarity index 100%
rename from components/drivers_nrf/rng/nrf_drv_rng.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/rng/nrf_drv_rng.c
diff --git a/components/drivers_nrf/rng/nrf_drv_rng.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/rng/nrf_drv_rng.h
similarity index 100%
rename from components/drivers_nrf/rng/nrf_drv_rng.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/rng/nrf_drv_rng.h
diff --git a/components/drivers_nrf/rtc/nrf_drv_rtc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/rtc/nrf_drv_rtc.c
similarity index 100%
rename from components/drivers_nrf/rtc/nrf_drv_rtc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/rtc/nrf_drv_rtc.c
diff --git a/components/drivers_nrf/rtc/nrf_drv_rtc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/rtc/nrf_drv_rtc.h
similarity index 100%
rename from components/drivers_nrf/rtc/nrf_drv_rtc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/rtc/nrf_drv_rtc.h
diff --git a/components/drivers_nrf/saadc/nrf_drv_saadc.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/saadc/nrf_drv_saadc.c
similarity index 100%
rename from components/drivers_nrf/saadc/nrf_drv_saadc.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/saadc/nrf_drv_saadc.c
diff --git a/components/drivers_nrf/saadc/nrf_drv_saadc.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/saadc/nrf_drv_saadc.h
similarity index 100%
rename from components/drivers_nrf/saadc/nrf_drv_saadc.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/saadc/nrf_drv_saadc.h
diff --git a/components/drivers_nrf/sdio/config/sdio_config.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/config/sdio_config.h
similarity index 100%
rename from components/drivers_nrf/sdio/config/sdio_config.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/config/sdio_config.h
diff --git a/components/drivers_nrf/sdio/sdio.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/sdio.c
similarity index 100%
rename from components/drivers_nrf/sdio/sdio.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/sdio.c
diff --git a/components/drivers_nrf/sdio/sdio.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/sdio.h
similarity index 100%
rename from components/drivers_nrf/sdio/sdio.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/sdio/sdio.h
diff --git a/components/drivers_nrf/spi_master/nrf_drv_spi.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/nrf_drv_spi.c
similarity index 100%
rename from components/drivers_nrf/spi_master/nrf_drv_spi.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/nrf_drv_spi.c
diff --git a/components/drivers_nrf/spi_master/nrf_drv_spi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/nrf_drv_spi.h
similarity index 100%
rename from components/drivers_nrf/spi_master/nrf_drv_spi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/nrf_drv_spi.h
diff --git a/components/drivers_nrf/spi_master/spi_5W_master.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/spi_5W_master.c
similarity index 100%
rename from components/drivers_nrf/spi_master/spi_5W_master.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/spi_5W_master.c
diff --git a/components/drivers_nrf/spi_master/spi_5W_master.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/spi_5W_master.h
similarity index 100%
rename from components/drivers_nrf/spi_master/spi_5W_master.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_master/spi_5W_master.h
diff --git a/components/drivers_nrf/spi_slave/nrf_drv_spis.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_slave/nrf_drv_spis.c
similarity index 100%
rename from components/drivers_nrf/spi_slave/nrf_drv_spis.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_slave/nrf_drv_spis.c
diff --git a/components/drivers_nrf/spi_slave/nrf_drv_spis.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/spi_slave/nrf_drv_spis.h
similarity index 100%
rename from components/drivers_nrf/spi_slave/nrf_drv_spis.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/spi_slave/nrf_drv_spis.h
diff --git a/components/drivers_nrf/swi/nrf_drv_swi.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/swi/nrf_drv_swi.c
similarity index 100%
rename from components/drivers_nrf/swi/nrf_drv_swi.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/swi/nrf_drv_swi.c
diff --git a/components/drivers_nrf/swi/nrf_drv_swi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/swi/nrf_drv_swi.h
similarity index 100%
rename from components/drivers_nrf/swi/nrf_drv_swi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/swi/nrf_drv_swi.h
diff --git a/components/drivers_nrf/systick/nrf_drv_systick.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/systick/nrf_drv_systick.c
similarity index 100%
rename from components/drivers_nrf/systick/nrf_drv_systick.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/systick/nrf_drv_systick.c
diff --git a/components/drivers_nrf/systick/nrf_drv_systick.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/systick/nrf_drv_systick.h
similarity index 100%
rename from components/drivers_nrf/systick/nrf_drv_systick.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/systick/nrf_drv_systick.h
diff --git a/components/drivers_nrf/timer/nrf_drv_timer.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/timer/nrf_drv_timer.c
similarity index 100%
rename from components/drivers_nrf/timer/nrf_drv_timer.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/timer/nrf_drv_timer.c
diff --git a/components/drivers_nrf/timer/nrf_drv_timer.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/timer/nrf_drv_timer.h
similarity index 100%
rename from components/drivers_nrf/timer/nrf_drv_timer.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/timer/nrf_drv_timer.h
diff --git a/components/drivers_nrf/twi_master/deprecated/config/twi_master_config.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/config/twi_master_config.h
similarity index 100%
rename from components/drivers_nrf/twi_master/deprecated/config/twi_master_config.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/config/twi_master_config.h
diff --git a/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c
similarity index 100%
rename from components/drivers_nrf/twi_master/deprecated/twi_hw_master.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c
diff --git a/components/drivers_nrf/twi_master/deprecated/twi_master.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_master.h
similarity index 100%
rename from components/drivers_nrf/twi_master/deprecated/twi_master.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_master.h
diff --git a/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c
similarity index 100%
rename from components/drivers_nrf/twi_master/deprecated/twi_sw_master.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c
diff --git a/components/drivers_nrf/twi_master/nrf_drv_twi.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/nrf_drv_twi.c
similarity index 100%
rename from components/drivers_nrf/twi_master/nrf_drv_twi.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/nrf_drv_twi.c
diff --git a/components/drivers_nrf/twi_master/nrf_drv_twi.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/nrf_drv_twi.h
similarity index 100%
rename from components/drivers_nrf/twi_master/nrf_drv_twi.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twi_master/nrf_drv_twi.h
diff --git a/components/drivers_nrf/twis_slave/nrf_drv_twis.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis.c
similarity index 100%
rename from components/drivers_nrf/twis_slave/nrf_drv_twis.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis.c
diff --git a/components/drivers_nrf/twis_slave/nrf_drv_twis.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis.h
similarity index 100%
rename from components/drivers_nrf/twis_slave/nrf_drv_twis.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis.h
diff --git a/components/drivers_nrf/twis_slave/nrf_drv_twis_inst.def b/SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis_inst.def
similarity index 100%
rename from components/drivers_nrf/twis_slave/nrf_drv_twis_inst.def
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/twis_slave/nrf_drv_twis_inst.def
diff --git a/components/drivers_nrf/uart/nrf_drv_uart.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/uart/nrf_drv_uart.c
similarity index 100%
rename from components/drivers_nrf/uart/nrf_drv_uart.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/uart/nrf_drv_uart.c
diff --git a/components/drivers_nrf/uart/nrf_drv_uart.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/uart/nrf_drv_uart.h
similarity index 100%
rename from components/drivers_nrf/uart/nrf_drv_uart.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/uart/nrf_drv_uart.h
diff --git a/components/drivers_nrf/usbd/nrf_drv_usbd.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/usbd/nrf_drv_usbd.c
similarity index 100%
rename from components/drivers_nrf/usbd/nrf_drv_usbd.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/usbd/nrf_drv_usbd.c
diff --git a/components/drivers_nrf/usbd/nrf_drv_usbd.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/usbd/nrf_drv_usbd.h
similarity index 100%
rename from components/drivers_nrf/usbd/nrf_drv_usbd.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/usbd/nrf_drv_usbd.h
diff --git a/components/drivers_nrf/wdt/nrf_drv_wdt.c b/SDK/12.3.0_d7731ad/components/drivers_nrf/wdt/nrf_drv_wdt.c
similarity index 100%
rename from components/drivers_nrf/wdt/nrf_drv_wdt.c
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/wdt/nrf_drv_wdt.c
diff --git a/components/drivers_nrf/wdt/nrf_drv_wdt.h b/SDK/12.3.0_d7731ad/components/drivers_nrf/wdt/nrf_drv_wdt.h
similarity index 100%
rename from components/drivers_nrf/wdt/nrf_drv_wdt.h
rename to SDK/12.3.0_d7731ad/components/drivers_nrf/wdt/nrf_drv_wdt.h
diff --git a/components/libraries/atomic/nrf_atomic.h b/SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic.h
similarity index 100%
rename from components/libraries/atomic/nrf_atomic.h
rename to SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic.h
diff --git a/components/libraries/atomic/nrf_atomic_internal.h b/SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic_internal.h
similarity index 100%
rename from components/libraries/atomic/nrf_atomic_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic_internal.h
diff --git a/components/libraries/atomic/nrf_atomic_sanity_check.h b/SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic_sanity_check.h
similarity index 100%
rename from components/libraries/atomic/nrf_atomic_sanity_check.h
rename to SDK/12.3.0_d7731ad/components/libraries/atomic/nrf_atomic_sanity_check.h
diff --git a/components/libraries/atomic_fifo/app_atfifo.c b/SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo.c
similarity index 100%
rename from components/libraries/atomic_fifo/app_atfifo.c
rename to SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo.c
diff --git a/components/libraries/atomic_fifo/app_atfifo.h b/SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo.h
similarity index 100%
rename from components/libraries/atomic_fifo/app_atfifo.h
rename to SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo.h
diff --git a/components/libraries/atomic_fifo/app_atfifo_internal.h b/SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo_internal.h
similarity index 100%
rename from components/libraries/atomic_fifo/app_atfifo_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/atomic_fifo/app_atfifo_internal.h
diff --git a/components/libraries/balloc/nrf_balloc.c b/SDK/12.3.0_d7731ad/components/libraries/balloc/nrf_balloc.c
similarity index 100%
rename from components/libraries/balloc/nrf_balloc.c
rename to SDK/12.3.0_d7731ad/components/libraries/balloc/nrf_balloc.c
diff --git a/components/libraries/balloc/nrf_balloc.h b/SDK/12.3.0_d7731ad/components/libraries/balloc/nrf_balloc.h
similarity index 100%
rename from components/libraries/balloc/nrf_balloc.h
rename to SDK/12.3.0_d7731ad/components/libraries/balloc/nrf_balloc.h
diff --git a/components/libraries/block_dev/empty/nrf_block_dev_empty.c b/SDK/12.3.0_d7731ad/components/libraries/block_dev/empty/nrf_block_dev_empty.c
similarity index 100%
rename from components/libraries/block_dev/empty/nrf_block_dev_empty.c
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/empty/nrf_block_dev_empty.c
diff --git a/components/libraries/block_dev/empty/nrf_block_dev_empty.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/empty/nrf_block_dev_empty.h
similarity index 100%
rename from components/libraries/block_dev/empty/nrf_block_dev_empty.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/empty/nrf_block_dev_empty.h
diff --git a/components/libraries/block_dev/nrf_block_dev.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/nrf_block_dev.h
similarity index 100%
rename from components/libraries/block_dev/nrf_block_dev.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/nrf_block_dev.h
diff --git a/components/libraries/block_dev/qspi/nrf_block_dev_qspi.c b/SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_block_dev_qspi.c
similarity index 100%
rename from components/libraries/block_dev/qspi/nrf_block_dev_qspi.c
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_block_dev_qspi.c
diff --git a/components/libraries/block_dev/qspi/nrf_block_dev_qspi.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_block_dev_qspi.h
similarity index 100%
rename from components/libraries/block_dev/qspi/nrf_block_dev_qspi.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_block_dev_qspi.h
diff --git a/components/libraries/block_dev/qspi/nrf_serial_flash_params.c b/SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_serial_flash_params.c
similarity index 100%
rename from components/libraries/block_dev/qspi/nrf_serial_flash_params.c
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_serial_flash_params.c
diff --git a/components/libraries/block_dev/qspi/nrf_serial_flash_params.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_serial_flash_params.h
similarity index 100%
rename from components/libraries/block_dev/qspi/nrf_serial_flash_params.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/qspi/nrf_serial_flash_params.h
diff --git a/components/libraries/block_dev/ram/nrf_block_dev_ram.c b/SDK/12.3.0_d7731ad/components/libraries/block_dev/ram/nrf_block_dev_ram.c
similarity index 100%
rename from components/libraries/block_dev/ram/nrf_block_dev_ram.c
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/ram/nrf_block_dev_ram.c
diff --git a/components/libraries/block_dev/ram/nrf_block_dev_ram.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/ram/nrf_block_dev_ram.h
similarity index 100%
rename from components/libraries/block_dev/ram/nrf_block_dev_ram.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/ram/nrf_block_dev_ram.h
diff --git a/components/libraries/block_dev/sdc/nrf_block_dev_sdc.c b/SDK/12.3.0_d7731ad/components/libraries/block_dev/sdc/nrf_block_dev_sdc.c
similarity index 100%
rename from components/libraries/block_dev/sdc/nrf_block_dev_sdc.c
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/sdc/nrf_block_dev_sdc.c
diff --git a/components/libraries/block_dev/sdc/nrf_block_dev_sdc.h b/SDK/12.3.0_d7731ad/components/libraries/block_dev/sdc/nrf_block_dev_sdc.h
similarity index 100%
rename from components/libraries/block_dev/sdc/nrf_block_dev_sdc.h
rename to SDK/12.3.0_d7731ad/components/libraries/block_dev/sdc/nrf_block_dev_sdc.h
diff --git a/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.c
similarity index 100%
rename from components/libraries/bootloader/ble_dfu/nrf_ble_dfu.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.c
diff --git a/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.h
similarity index 100%
rename from components/libraries/bootloader/ble_dfu/nrf_ble_dfu.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/ble_dfu/nrf_ble_dfu.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_flash.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_flash.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_flash.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_flash.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_flash.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_flash.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_flash.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_flash.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_mbr.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_mbr.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_mbr.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_mbr.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_mbr.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_mbr.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_mbr.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_mbr.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_req_handler.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_req_handler.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_req_handler.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_req_handler.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_settings.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_settings.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_settings.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_settings.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_settings.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_settings.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_settings.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_settings.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_transport.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_transport.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_transport.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_transport.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_transport.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_transport.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_transport.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_transport.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_types.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_types.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_types.h
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_utils.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_utils.c
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_utils.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_utils.c
diff --git a/components/libraries/bootloader/dfu/nrf_dfu_utils.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_utils.h
similarity index 100%
rename from components/libraries/bootloader/dfu/nrf_dfu_utils.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/dfu/nrf_dfu_utils.h
diff --git a/components/libraries/bootloader/nrf_bootloader.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader.c
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader.c
diff --git a/components/libraries/bootloader/nrf_bootloader.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader.h
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader.h
diff --git a/components/libraries/bootloader/nrf_bootloader_app_start.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_app_start.c
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader_app_start.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_app_start.c
diff --git a/components/libraries/bootloader/nrf_bootloader_app_start.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_app_start.h
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader_app_start.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_app_start.h
diff --git a/components/libraries/bootloader/nrf_bootloader_info.c b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_info.c
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader_info.c
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_info.c
diff --git a/components/libraries/bootloader/nrf_bootloader_info.h b/SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_info.h
similarity index 100%
rename from components/libraries/bootloader/nrf_bootloader_info.h
rename to SDK/12.3.0_d7731ad/components/libraries/bootloader/nrf_bootloader_info.h
diff --git a/components/libraries/bsp/bsp.c b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp.c
similarity index 100%
rename from components/libraries/bsp/bsp.c
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp.c
diff --git a/components/libraries/bsp/bsp.h b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp.h
similarity index 100%
rename from components/libraries/bsp/bsp.h
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp.h
diff --git a/components/libraries/bsp/bsp_btn_ant.c b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ant.c
similarity index 100%
rename from components/libraries/bsp/bsp_btn_ant.c
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ant.c
diff --git a/components/libraries/bsp/bsp_btn_ant.h b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ant.h
similarity index 100%
rename from components/libraries/bsp/bsp_btn_ant.h
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ant.h
diff --git a/components/libraries/bsp/bsp_btn_ble.c b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ble.c
similarity index 100%
rename from components/libraries/bsp/bsp_btn_ble.c
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ble.c
diff --git a/components/libraries/bsp/bsp_btn_ble.h b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ble.h
similarity index 100%
rename from components/libraries/bsp/bsp_btn_ble.h
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_btn_ble.h
diff --git a/components/libraries/bsp/bsp_config.h b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_config.h
similarity index 100%
rename from components/libraries/bsp/bsp_config.h
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_config.h
diff --git a/components/libraries/bsp/bsp_nfc.c b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_nfc.c
similarity index 100%
rename from components/libraries/bsp/bsp_nfc.c
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_nfc.c
diff --git a/components/libraries/bsp/bsp_nfc.h b/SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_nfc.h
similarity index 100%
rename from components/libraries/bsp/bsp_nfc.h
rename to SDK/12.3.0_d7731ad/components/libraries/bsp/bsp_nfc.h
diff --git a/components/libraries/button/app_button.c b/SDK/12.3.0_d7731ad/components/libraries/button/app_button.c
similarity index 100%
rename from components/libraries/button/app_button.c
rename to SDK/12.3.0_d7731ad/components/libraries/button/app_button.c
diff --git a/components/libraries/button/app_button.h b/SDK/12.3.0_d7731ad/components/libraries/button/app_button.h
similarity index 100%
rename from components/libraries/button/app_button.h
rename to SDK/12.3.0_d7731ad/components/libraries/button/app_button.h
diff --git a/components/libraries/crc16/crc16.c b/SDK/12.3.0_d7731ad/components/libraries/crc16/crc16.c
similarity index 100%
rename from components/libraries/crc16/crc16.c
rename to SDK/12.3.0_d7731ad/components/libraries/crc16/crc16.c
diff --git a/components/libraries/crc16/crc16.h b/SDK/12.3.0_d7731ad/components/libraries/crc16/crc16.h
similarity index 100%
rename from components/libraries/crc16/crc16.h
rename to SDK/12.3.0_d7731ad/components/libraries/crc16/crc16.h
diff --git a/components/libraries/crc32/crc32.c b/SDK/12.3.0_d7731ad/components/libraries/crc32/crc32.c
similarity index 100%
rename from components/libraries/crc32/crc32.c
rename to SDK/12.3.0_d7731ad/components/libraries/crc32/crc32.c
diff --git a/components/libraries/crc32/crc32.h b/SDK/12.3.0_d7731ad/components/libraries/crc32/crc32.h
similarity index 100%
rename from components/libraries/crc32/crc32.h
rename to SDK/12.3.0_d7731ad/components/libraries/crc32/crc32.h
diff --git a/components/libraries/crypto/nrf_crypto.c b/SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto.c
similarity index 100%
rename from components/libraries/crypto/nrf_crypto.c
rename to SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto.c
diff --git a/components/libraries/crypto/nrf_crypto.h b/SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto.h
similarity index 100%
rename from components/libraries/crypto/nrf_crypto.h
rename to SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto.h
diff --git a/components/libraries/crypto/nrf_crypto_svc.c b/SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto_svc.c
similarity index 100%
rename from components/libraries/crypto/nrf_crypto_svc.c
rename to SDK/12.3.0_d7731ad/components/libraries/crypto/nrf_crypto_svc.c
diff --git a/components/libraries/csense/nrf_csense.c b/SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense.c
similarity index 100%
rename from components/libraries/csense/nrf_csense.c
rename to SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense.c
diff --git a/components/libraries/csense/nrf_csense.h b/SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense.h
similarity index 100%
rename from components/libraries/csense/nrf_csense.h
rename to SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense.h
diff --git a/components/libraries/csense/nrf_csense_macros.h b/SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense_macros.h
similarity index 100%
rename from components/libraries/csense/nrf_csense_macros.h
rename to SDK/12.3.0_d7731ad/components/libraries/csense/nrf_csense_macros.h
diff --git a/components/libraries/csense_drv/nrf_drv_csense.c b/SDK/12.3.0_d7731ad/components/libraries/csense_drv/nrf_drv_csense.c
similarity index 100%
rename from components/libraries/csense_drv/nrf_drv_csense.c
rename to SDK/12.3.0_d7731ad/components/libraries/csense_drv/nrf_drv_csense.c
diff --git a/components/libraries/csense_drv/nrf_drv_csense.h b/SDK/12.3.0_d7731ad/components/libraries/csense_drv/nrf_drv_csense.h
similarity index 100%
rename from components/libraries/csense_drv/nrf_drv_csense.h
rename to SDK/12.3.0_d7731ad/components/libraries/csense_drv/nrf_drv_csense.h
diff --git a/components/libraries/ecc/ecc.c b/SDK/12.3.0_d7731ad/components/libraries/ecc/ecc.c
similarity index 100%
rename from components/libraries/ecc/ecc.c
rename to SDK/12.3.0_d7731ad/components/libraries/ecc/ecc.c
diff --git a/components/libraries/ecc/ecc.h b/SDK/12.3.0_d7731ad/components/libraries/ecc/ecc.h
similarity index 100%
rename from components/libraries/ecc/ecc.h
rename to SDK/12.3.0_d7731ad/components/libraries/ecc/ecc.h
diff --git a/components/libraries/eddystone/es.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es.h
similarity index 100%
rename from components/libraries/eddystone/es.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es.h
diff --git a/components/libraries/eddystone/es_adv.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv.c
similarity index 100%
rename from components/libraries/eddystone/es_adv.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv.c
diff --git a/components/libraries/eddystone/es_adv.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv.h
similarity index 100%
rename from components/libraries/eddystone/es_adv.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv.h
diff --git a/components/libraries/eddystone/es_adv_frame.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_frame.c
similarity index 100%
rename from components/libraries/eddystone/es_adv_frame.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_frame.c
diff --git a/components/libraries/eddystone/es_adv_frame.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_frame.h
similarity index 100%
rename from components/libraries/eddystone/es_adv_frame.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_frame.h
diff --git a/components/libraries/eddystone/es_adv_timing.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing.c
similarity index 100%
rename from components/libraries/eddystone/es_adv_timing.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing.c
diff --git a/components/libraries/eddystone/es_adv_timing.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing.h
similarity index 100%
rename from components/libraries/eddystone/es_adv_timing.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing.h
diff --git a/components/libraries/eddystone/es_adv_timing_resolver.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing_resolver.c
similarity index 100%
rename from components/libraries/eddystone/es_adv_timing_resolver.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing_resolver.c
diff --git a/components/libraries/eddystone/es_adv_timing_resolver.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing_resolver.h
similarity index 100%
rename from components/libraries/eddystone/es_adv_timing_resolver.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_adv_timing_resolver.h
diff --git a/components/libraries/eddystone/es_battery_voltage.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage.h
similarity index 100%
rename from components/libraries/eddystone/es_battery_voltage.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage.h
diff --git a/components/libraries/eddystone/es_battery_voltage_adc.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage_adc.c
similarity index 100%
rename from components/libraries/eddystone/es_battery_voltage_adc.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage_adc.c
diff --git a/components/libraries/eddystone/es_battery_voltage_saadc.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage_saadc.c
similarity index 100%
rename from components/libraries/eddystone/es_battery_voltage_saadc.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_battery_voltage_saadc.c
diff --git a/components/libraries/eddystone/es_flash.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_flash.c
similarity index 100%
rename from components/libraries/eddystone/es_flash.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_flash.c
diff --git a/components/libraries/eddystone/es_flash.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_flash.h
similarity index 100%
rename from components/libraries/eddystone/es_flash.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_flash.h
diff --git a/components/libraries/eddystone/es_gatts.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts.c
similarity index 100%
rename from components/libraries/eddystone/es_gatts.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts.c
diff --git a/components/libraries/eddystone/es_gatts.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts.h
similarity index 100%
rename from components/libraries/eddystone/es_gatts.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts.h
diff --git a/components/libraries/eddystone/es_gatts_read.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_read.c
similarity index 100%
rename from components/libraries/eddystone/es_gatts_read.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_read.c
diff --git a/components/libraries/eddystone/es_gatts_read.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_read.h
similarity index 100%
rename from components/libraries/eddystone/es_gatts_read.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_read.h
diff --git a/components/libraries/eddystone/es_gatts_write.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_write.c
similarity index 100%
rename from components/libraries/eddystone/es_gatts_write.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_write.c
diff --git a/components/libraries/eddystone/es_gatts_write.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_write.h
similarity index 100%
rename from components/libraries/eddystone/es_gatts_write.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_gatts_write.h
diff --git a/components/libraries/eddystone/es_security.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security.c
similarity index 100%
rename from components/libraries/eddystone/es_security.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security.c
diff --git a/components/libraries/eddystone/es_security.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security.h
similarity index 100%
rename from components/libraries/eddystone/es_security.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security.h
diff --git a/components/libraries/eddystone/es_security_timing.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security_timing.c
similarity index 100%
rename from components/libraries/eddystone/es_security_timing.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security_timing.c
diff --git a/components/libraries/eddystone/es_security_timing.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security_timing.h
similarity index 100%
rename from components/libraries/eddystone/es_security_timing.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_security_timing.h
diff --git a/components/libraries/eddystone/es_slot.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot.c
similarity index 100%
rename from components/libraries/eddystone/es_slot.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot.c
diff --git a/components/libraries/eddystone/es_slot.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot.h
similarity index 100%
rename from components/libraries/eddystone/es_slot.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot.h
diff --git a/components/libraries/eddystone/es_slot_reg.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot_reg.c
similarity index 100%
rename from components/libraries/eddystone/es_slot_reg.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot_reg.c
diff --git a/components/libraries/eddystone/es_slot_reg.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot_reg.h
similarity index 100%
rename from components/libraries/eddystone/es_slot_reg.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_slot_reg.h
diff --git a/components/libraries/eddystone/es_stopwatch.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_stopwatch.c
similarity index 100%
rename from components/libraries/eddystone/es_stopwatch.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_stopwatch.c
diff --git a/components/libraries/eddystone/es_stopwatch.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_stopwatch.h
similarity index 100%
rename from components/libraries/eddystone/es_stopwatch.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_stopwatch.h
diff --git a/components/libraries/eddystone/es_tlm.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_tlm.c
similarity index 100%
rename from components/libraries/eddystone/es_tlm.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_tlm.c
diff --git a/components/libraries/eddystone/es_tlm.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_tlm.h
similarity index 100%
rename from components/libraries/eddystone/es_tlm.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_tlm.h
diff --git a/components/libraries/eddystone/es_util.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/es_util.h
similarity index 100%
rename from components/libraries/eddystone/es_util.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/es_util.h
diff --git a/components/libraries/eddystone/nrf_ble_es.c b/SDK/12.3.0_d7731ad/components/libraries/eddystone/nrf_ble_es.c
similarity index 100%
rename from components/libraries/eddystone/nrf_ble_es.c
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/nrf_ble_es.c
diff --git a/components/libraries/eddystone/nrf_ble_es.h b/SDK/12.3.0_d7731ad/components/libraries/eddystone/nrf_ble_es.h
similarity index 100%
rename from components/libraries/eddystone/nrf_ble_es.h
rename to SDK/12.3.0_d7731ad/components/libraries/eddystone/nrf_ble_es.h
diff --git a/components/libraries/experimental_section_vars/section_vars.h b/SDK/12.3.0_d7731ad/components/libraries/experimental_section_vars/section_vars.h
similarity index 100%
rename from components/libraries/experimental_section_vars/section_vars.h
rename to SDK/12.3.0_d7731ad/components/libraries/experimental_section_vars/section_vars.h
diff --git a/components/libraries/fds/fds.c b/SDK/12.3.0_d7731ad/components/libraries/fds/fds.c
similarity index 100%
rename from components/libraries/fds/fds.c
rename to SDK/12.3.0_d7731ad/components/libraries/fds/fds.c
diff --git a/components/libraries/fds/fds.h b/SDK/12.3.0_d7731ad/components/libraries/fds/fds.h
similarity index 100%
rename from components/libraries/fds/fds.h
rename to SDK/12.3.0_d7731ad/components/libraries/fds/fds.h
diff --git a/components/libraries/fds/fds_internal_defs.h b/SDK/12.3.0_d7731ad/components/libraries/fds/fds_internal_defs.h
similarity index 100%
rename from components/libraries/fds/fds_internal_defs.h
rename to SDK/12.3.0_d7731ad/components/libraries/fds/fds_internal_defs.h
diff --git a/components/libraries/fifo/app_fifo.c b/SDK/12.3.0_d7731ad/components/libraries/fifo/app_fifo.c
similarity index 100%
rename from components/libraries/fifo/app_fifo.c
rename to SDK/12.3.0_d7731ad/components/libraries/fifo/app_fifo.c
diff --git a/components/libraries/fifo/app_fifo.h b/SDK/12.3.0_d7731ad/components/libraries/fifo/app_fifo.h
similarity index 100%
rename from components/libraries/fifo/app_fifo.h
rename to SDK/12.3.0_d7731ad/components/libraries/fifo/app_fifo.h
diff --git a/components/libraries/fstorage/fstorage.c b/SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage.c
similarity index 100%
rename from components/libraries/fstorage/fstorage.c
rename to SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage.c
diff --git a/components/libraries/fstorage/fstorage.h b/SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage.h
similarity index 100%
rename from components/libraries/fstorage/fstorage.h
rename to SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage.h
diff --git a/components/libraries/fstorage/fstorage_internal_defs.h b/SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage_internal_defs.h
similarity index 100%
rename from components/libraries/fstorage/fstorage_internal_defs.h
rename to SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage_internal_defs.h
diff --git a/components/libraries/fstorage/fstorage_nosd.c b/SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage_nosd.c
similarity index 100%
rename from components/libraries/fstorage/fstorage_nosd.c
rename to SDK/12.3.0_d7731ad/components/libraries/fstorage/fstorage_nosd.c
diff --git a/components/libraries/gpiote/app_gpiote.c b/SDK/12.3.0_d7731ad/components/libraries/gpiote/app_gpiote.c
similarity index 100%
rename from components/libraries/gpiote/app_gpiote.c
rename to SDK/12.3.0_d7731ad/components/libraries/gpiote/app_gpiote.c
diff --git a/components/libraries/gpiote/app_gpiote.h b/SDK/12.3.0_d7731ad/components/libraries/gpiote/app_gpiote.h
similarity index 100%
rename from components/libraries/gpiote/app_gpiote.h
rename to SDK/12.3.0_d7731ad/components/libraries/gpiote/app_gpiote.h
diff --git a/components/libraries/hardfault/hardfault.h b/SDK/12.3.0_d7731ad/components/libraries/hardfault/hardfault.h
similarity index 100%
rename from components/libraries/hardfault/hardfault.h
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/hardfault.h
diff --git a/components/libraries/hardfault/hardfault_implementation.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/hardfault_implementation.c
similarity index 100%
rename from components/libraries/hardfault/hardfault_implementation.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/hardfault_implementation.c
diff --git a/components/libraries/hardfault/nrf51/handler/hardfault_handler_gcc.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_gcc.c
similarity index 100%
rename from components/libraries/hardfault/nrf51/handler/hardfault_handler_gcc.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_gcc.c
diff --git a/components/libraries/hardfault/nrf51/handler/hardfault_handler_iar.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_iar.c
similarity index 100%
rename from components/libraries/hardfault/nrf51/handler/hardfault_handler_iar.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_iar.c
diff --git a/components/libraries/hardfault/nrf51/handler/hardfault_handler_keil.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_keil.c
similarity index 100%
rename from components/libraries/hardfault/nrf51/handler/hardfault_handler_keil.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf51/handler/hardfault_handler_keil.c
diff --git a/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c
similarity index 100%
rename from components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c
diff --git a/components/libraries/hardfault/nrf52/handler/hardfault_handler_iar.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_iar.c
similarity index 100%
rename from components/libraries/hardfault/nrf52/handler/hardfault_handler_iar.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_iar.c
diff --git a/components/libraries/hardfault/nrf52/handler/hardfault_handler_keil.c b/SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_keil.c
similarity index 100%
rename from components/libraries/hardfault/nrf52/handler/hardfault_handler_keil.c
rename to SDK/12.3.0_d7731ad/components/libraries/hardfault/nrf52/handler/hardfault_handler_keil.c
diff --git a/components/libraries/hci/hci_mem_pool.c b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_mem_pool.c
similarity index 100%
rename from components/libraries/hci/hci_mem_pool.c
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_mem_pool.c
diff --git a/components/libraries/hci/hci_mem_pool.h b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_mem_pool.h
similarity index 100%
rename from components/libraries/hci/hci_mem_pool.h
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_mem_pool.h
diff --git a/components/libraries/hci/hci_slip.c b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_slip.c
similarity index 100%
rename from components/libraries/hci/hci_slip.c
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_slip.c
diff --git a/components/libraries/hci/hci_slip.h b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_slip.h
similarity index 100%
rename from components/libraries/hci/hci_slip.h
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_slip.h
diff --git a/components/libraries/hci/hci_transport.c b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_transport.c
similarity index 100%
rename from components/libraries/hci/hci_transport.c
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_transport.c
diff --git a/components/libraries/hci/hci_transport.h b/SDK/12.3.0_d7731ad/components/libraries/hci/hci_transport.h
similarity index 100%
rename from components/libraries/hci/hci_transport.h
rename to SDK/12.3.0_d7731ad/components/libraries/hci/hci_transport.h
diff --git a/components/libraries/ic_info/nrf_ic_info.c b/SDK/12.3.0_d7731ad/components/libraries/ic_info/nrf_ic_info.c
similarity index 100%
rename from components/libraries/ic_info/nrf_ic_info.c
rename to SDK/12.3.0_d7731ad/components/libraries/ic_info/nrf_ic_info.c
diff --git a/components/libraries/ic_info/nrf_ic_info.h b/SDK/12.3.0_d7731ad/components/libraries/ic_info/nrf_ic_info.h
similarity index 100%
rename from components/libraries/ic_info/nrf_ic_info.h
rename to SDK/12.3.0_d7731ad/components/libraries/ic_info/nrf_ic_info.h
diff --git a/components/libraries/led_softblink/led_softblink.c b/SDK/12.3.0_d7731ad/components/libraries/led_softblink/led_softblink.c
similarity index 100%
rename from components/libraries/led_softblink/led_softblink.c
rename to SDK/12.3.0_d7731ad/components/libraries/led_softblink/led_softblink.c
diff --git a/components/libraries/led_softblink/led_softblink.h b/SDK/12.3.0_d7731ad/components/libraries/led_softblink/led_softblink.h
similarity index 100%
rename from components/libraries/led_softblink/led_softblink.h
rename to SDK/12.3.0_d7731ad/components/libraries/led_softblink/led_softblink.h
diff --git a/components/libraries/log/nrf_log.h b/SDK/12.3.0_d7731ad/components/libraries/log/nrf_log.h
similarity index 100%
rename from components/libraries/log/nrf_log.h
rename to SDK/12.3.0_d7731ad/components/libraries/log/nrf_log.h
diff --git a/components/libraries/log/nrf_log_backend.h b/SDK/12.3.0_d7731ad/components/libraries/log/nrf_log_backend.h
similarity index 100%
rename from components/libraries/log/nrf_log_backend.h
rename to SDK/12.3.0_d7731ad/components/libraries/log/nrf_log_backend.h
diff --git a/components/libraries/log/nrf_log_ctrl.h b/SDK/12.3.0_d7731ad/components/libraries/log/nrf_log_ctrl.h
similarity index 100%
rename from components/libraries/log/nrf_log_ctrl.h
rename to SDK/12.3.0_d7731ad/components/libraries/log/nrf_log_ctrl.h
diff --git a/components/libraries/log/src/nrf_log_backend_serial.c b/SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_backend_serial.c
similarity index 100%
rename from components/libraries/log/src/nrf_log_backend_serial.c
rename to SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_backend_serial.c
diff --git a/components/libraries/log/src/nrf_log_ctrl_internal.h b/SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_ctrl_internal.h
similarity index 100%
rename from components/libraries/log/src/nrf_log_ctrl_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_ctrl_internal.h
diff --git a/components/libraries/log/src/nrf_log_frontend.c b/SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_frontend.c
similarity index 100%
rename from components/libraries/log/src/nrf_log_frontend.c
rename to SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_frontend.c
diff --git a/components/libraries/log/src/nrf_log_internal.h b/SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_internal.h
similarity index 100%
rename from components/libraries/log/src/nrf_log_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/log/src/nrf_log_internal.h
diff --git a/components/libraries/low_power_pwm/low_power_pwm.c b/SDK/12.3.0_d7731ad/components/libraries/low_power_pwm/low_power_pwm.c
similarity index 100%
rename from components/libraries/low_power_pwm/low_power_pwm.c
rename to SDK/12.3.0_d7731ad/components/libraries/low_power_pwm/low_power_pwm.c
diff --git a/components/libraries/low_power_pwm/low_power_pwm.h b/SDK/12.3.0_d7731ad/components/libraries/low_power_pwm/low_power_pwm.h
similarity index 100%
rename from components/libraries/low_power_pwm/low_power_pwm.h
rename to SDK/12.3.0_d7731ad/components/libraries/low_power_pwm/low_power_pwm.h
diff --git a/components/libraries/mailbox/app_mailbox.c b/SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox.c
similarity index 100%
rename from components/libraries/mailbox/app_mailbox.c
rename to SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox.c
diff --git a/components/libraries/mailbox/app_mailbox.h b/SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox.h
similarity index 100%
rename from components/libraries/mailbox/app_mailbox.h
rename to SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox.h
diff --git a/components/libraries/mailbox/app_mailbox_local.h b/SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox_local.h
similarity index 100%
rename from components/libraries/mailbox/app_mailbox_local.h
rename to SDK/12.3.0_d7731ad/components/libraries/mailbox/app_mailbox_local.h
diff --git a/components/libraries/mem_manager/mem_manager.c b/SDK/12.3.0_d7731ad/components/libraries/mem_manager/mem_manager.c
similarity index 100%
rename from components/libraries/mem_manager/mem_manager.c
rename to SDK/12.3.0_d7731ad/components/libraries/mem_manager/mem_manager.c
diff --git a/components/libraries/mem_manager/mem_manager.h b/SDK/12.3.0_d7731ad/components/libraries/mem_manager/mem_manager.h
similarity index 100%
rename from components/libraries/mem_manager/mem_manager.h
rename to SDK/12.3.0_d7731ad/components/libraries/mem_manager/mem_manager.h
diff --git a/components/libraries/pwm/app_pwm.c b/SDK/12.3.0_d7731ad/components/libraries/pwm/app_pwm.c
similarity index 100%
rename from components/libraries/pwm/app_pwm.c
rename to SDK/12.3.0_d7731ad/components/libraries/pwm/app_pwm.c
diff --git a/components/libraries/pwm/app_pwm.h b/SDK/12.3.0_d7731ad/components/libraries/pwm/app_pwm.h
similarity index 100%
rename from components/libraries/pwm/app_pwm.h
rename to SDK/12.3.0_d7731ad/components/libraries/pwm/app_pwm.h
diff --git a/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c b/SDK/12.3.0_d7731ad/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c
similarity index 100%
rename from components/libraries/pwr_mgmt/nrf_pwr_mgmt.c
rename to SDK/12.3.0_d7731ad/components/libraries/pwr_mgmt/nrf_pwr_mgmt.c
diff --git a/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h b/SDK/12.3.0_d7731ad/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h
similarity index 100%
rename from components/libraries/pwr_mgmt/nrf_pwr_mgmt.h
rename to SDK/12.3.0_d7731ad/components/libraries/pwr_mgmt/nrf_pwr_mgmt.h
diff --git a/components/libraries/queue/nrf_queue.c b/SDK/12.3.0_d7731ad/components/libraries/queue/nrf_queue.c
similarity index 100%
rename from components/libraries/queue/nrf_queue.c
rename to SDK/12.3.0_d7731ad/components/libraries/queue/nrf_queue.c
diff --git a/components/libraries/queue/nrf_queue.h b/SDK/12.3.0_d7731ad/components/libraries/queue/nrf_queue.h
similarity index 100%
rename from components/libraries/queue/nrf_queue.h
rename to SDK/12.3.0_d7731ad/components/libraries/queue/nrf_queue.h
diff --git a/components/libraries/scheduler/app_scheduler.c b/SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler.c
similarity index 100%
rename from components/libraries/scheduler/app_scheduler.c
rename to SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler.c
diff --git a/components/libraries/scheduler/app_scheduler.h b/SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler.h
similarity index 100%
rename from components/libraries/scheduler/app_scheduler.h
rename to SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler.h
diff --git a/components/libraries/scheduler/app_scheduler_serconn.c b/SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler_serconn.c
similarity index 100%
rename from components/libraries/scheduler/app_scheduler_serconn.c
rename to SDK/12.3.0_d7731ad/components/libraries/scheduler/app_scheduler_serconn.c
diff --git a/components/libraries/sdcard/app_sdcard.c b/SDK/12.3.0_d7731ad/components/libraries/sdcard/app_sdcard.c
similarity index 100%
rename from components/libraries/sdcard/app_sdcard.c
rename to SDK/12.3.0_d7731ad/components/libraries/sdcard/app_sdcard.c
diff --git a/components/libraries/sdcard/app_sdcard.h b/SDK/12.3.0_d7731ad/components/libraries/sdcard/app_sdcard.h
similarity index 100%
rename from components/libraries/sdcard/app_sdcard.h
rename to SDK/12.3.0_d7731ad/components/libraries/sdcard/app_sdcard.h
diff --git a/components/libraries/sensorsim/sensorsim.c b/SDK/12.3.0_d7731ad/components/libraries/sensorsim/sensorsim.c
similarity index 100%
rename from components/libraries/sensorsim/sensorsim.c
rename to SDK/12.3.0_d7731ad/components/libraries/sensorsim/sensorsim.c
diff --git a/components/libraries/sensorsim/sensorsim.h b/SDK/12.3.0_d7731ad/components/libraries/sensorsim/sensorsim.h
similarity index 100%
rename from components/libraries/sensorsim/sensorsim.h
rename to SDK/12.3.0_d7731ad/components/libraries/sensorsim/sensorsim.h
diff --git a/components/libraries/sha256/sha256.c b/SDK/12.3.0_d7731ad/components/libraries/sha256/sha256.c
similarity index 100%
rename from components/libraries/sha256/sha256.c
rename to SDK/12.3.0_d7731ad/components/libraries/sha256/sha256.c
diff --git a/components/libraries/sha256/sha256.h b/SDK/12.3.0_d7731ad/components/libraries/sha256/sha256.h
similarity index 100%
rename from components/libraries/sha256/sha256.h
rename to SDK/12.3.0_d7731ad/components/libraries/sha256/sha256.h
diff --git a/components/libraries/simple_timer/app_simple_timer.c b/SDK/12.3.0_d7731ad/components/libraries/simple_timer/app_simple_timer.c
similarity index 100%
rename from components/libraries/simple_timer/app_simple_timer.c
rename to SDK/12.3.0_d7731ad/components/libraries/simple_timer/app_simple_timer.c
diff --git a/components/libraries/simple_timer/app_simple_timer.h b/SDK/12.3.0_d7731ad/components/libraries/simple_timer/app_simple_timer.h
similarity index 100%
rename from components/libraries/simple_timer/app_simple_timer.h
rename to SDK/12.3.0_d7731ad/components/libraries/simple_timer/app_simple_timer.h
diff --git a/components/libraries/slip/slip.c b/SDK/12.3.0_d7731ad/components/libraries/slip/slip.c
similarity index 100%
rename from components/libraries/slip/slip.c
rename to SDK/12.3.0_d7731ad/components/libraries/slip/slip.c
diff --git a/components/libraries/slip/slip.h b/SDK/12.3.0_d7731ad/components/libraries/slip/slip.h
similarity index 100%
rename from components/libraries/slip/slip.h
rename to SDK/12.3.0_d7731ad/components/libraries/slip/slip.h
diff --git a/components/libraries/svc/nrf_svc_function.h b/SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svc_function.h
similarity index 100%
rename from components/libraries/svc/nrf_svc_function.h
rename to SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svc_function.h
diff --git a/components/libraries/svc/nrf_svc_handler.c b/SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svc_handler.c
similarity index 100%
rename from components/libraries/svc/nrf_svc_handler.c
rename to SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svc_handler.c
diff --git a/components/libraries/svc/nrf_svci.h b/SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svci.h
similarity index 100%
rename from components/libraries/svc/nrf_svci.h
rename to SDK/12.3.0_d7731ad/components/libraries/svc/nrf_svci.h
diff --git a/components/libraries/timer/app_timer.c b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer.c
similarity index 100%
rename from components/libraries/timer/app_timer.c
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer.c
diff --git a/components/libraries/timer/app_timer.h b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer.h
similarity index 100%
rename from components/libraries/timer/app_timer.h
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer.h
diff --git a/components/libraries/timer/app_timer_appsh.c b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_appsh.c
similarity index 100%
rename from components/libraries/timer/app_timer_appsh.c
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_appsh.c
diff --git a/components/libraries/timer/app_timer_appsh.h b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_appsh.h
similarity index 100%
rename from components/libraries/timer/app_timer_appsh.h
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_appsh.h
diff --git a/components/libraries/timer/app_timer_ble_gzll.c b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_ble_gzll.c
similarity index 100%
rename from components/libraries/timer/app_timer_ble_gzll.c
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_ble_gzll.c
diff --git a/components/libraries/timer/app_timer_freertos.c b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_freertos.c
similarity index 100%
rename from components/libraries/timer/app_timer_freertos.c
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_freertos.c
diff --git a/components/libraries/timer/app_timer_rtx.c b/SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_rtx.c
similarity index 100%
rename from components/libraries/timer/app_timer_rtx.c
rename to SDK/12.3.0_d7731ad/components/libraries/timer/app_timer_rtx.c
diff --git a/components/libraries/twi/app_twi.c b/SDK/12.3.0_d7731ad/components/libraries/twi/app_twi.c
similarity index 100%
rename from components/libraries/twi/app_twi.c
rename to SDK/12.3.0_d7731ad/components/libraries/twi/app_twi.c
diff --git a/components/libraries/twi/app_twi.h b/SDK/12.3.0_d7731ad/components/libraries/twi/app_twi.h
similarity index 100%
rename from components/libraries/twi/app_twi.h
rename to SDK/12.3.0_d7731ad/components/libraries/twi/app_twi.h
diff --git a/components/libraries/uart/app_uart.c b/SDK/12.3.0_d7731ad/components/libraries/uart/app_uart.c
similarity index 100%
rename from components/libraries/uart/app_uart.c
rename to SDK/12.3.0_d7731ad/components/libraries/uart/app_uart.c
diff --git a/components/libraries/uart/app_uart.h b/SDK/12.3.0_d7731ad/components/libraries/uart/app_uart.h
similarity index 100%
rename from components/libraries/uart/app_uart.h
rename to SDK/12.3.0_d7731ad/components/libraries/uart/app_uart.h
diff --git a/components/libraries/uart/app_uart_fifo.c b/SDK/12.3.0_d7731ad/components/libraries/uart/app_uart_fifo.c
similarity index 100%
rename from components/libraries/uart/app_uart_fifo.c
rename to SDK/12.3.0_d7731ad/components/libraries/uart/app_uart_fifo.c
diff --git a/components/libraries/uart/retarget.c b/SDK/12.3.0_d7731ad/components/libraries/uart/retarget.c
similarity index 100%
rename from components/libraries/uart/retarget.c
rename to SDK/12.3.0_d7731ad/components/libraries/uart/retarget.c
diff --git a/components/libraries/usbd/app_usbd.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd.c
similarity index 100%
rename from components/libraries/usbd/app_usbd.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd.c
diff --git a/components/libraries/usbd/app_usbd.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd.h
similarity index 100%
rename from components/libraries/usbd/app_usbd.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd.h
diff --git a/components/libraries/usbd/app_usbd_class_base.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_class_base.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_class_base.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_class_base.h
diff --git a/components/libraries/usbd/app_usbd_core.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_core.c
similarity index 100%
rename from components/libraries/usbd/app_usbd_core.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_core.c
diff --git a/components/libraries/usbd/app_usbd_core.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_core.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_core.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_core.h
diff --git a/components/libraries/usbd/app_usbd_descriptor.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_descriptor.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_descriptor.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_descriptor.h
diff --git a/components/libraries/usbd/app_usbd_langid.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_langid.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_langid.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_langid.h
diff --git a/components/libraries/usbd/app_usbd_request.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_request.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_request.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_request.h
diff --git a/components/libraries/usbd/app_usbd_string_desc.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_string_desc.c
similarity index 100%
rename from components/libraries/usbd/app_usbd_string_desc.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_string_desc.c
diff --git a/components/libraries/usbd/app_usbd_string_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_string_desc.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_string_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_string_desc.h
diff --git a/components/libraries/usbd/app_usbd_types.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_types.h
similarity index 100%
rename from components/libraries/usbd/app_usbd_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/app_usbd_types.h
diff --git a/components/libraries/usbd/class/audio/app_usbd_audio.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio.c
similarity index 100%
rename from components/libraries/usbd/class/audio/app_usbd_audio.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio.c
diff --git a/components/libraries/usbd/class/audio/app_usbd_audio.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio.h
similarity index 100%
rename from components/libraries/usbd/class/audio/app_usbd_audio.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio.h
diff --git a/components/libraries/usbd/class/audio/app_usbd_audio_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_desc.h
similarity index 100%
rename from components/libraries/usbd/class/audio/app_usbd_audio_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_desc.h
diff --git a/components/libraries/usbd/class/audio/app_usbd_audio_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_internal.h
similarity index 100%
rename from components/libraries/usbd/class/audio/app_usbd_audio_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_internal.h
diff --git a/components/libraries/usbd/class/audio/app_usbd_audio_types.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_types.h
similarity index 100%
rename from components/libraries/usbd/class/audio/app_usbd_audio_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/audio/app_usbd_audio_types.h
diff --git a/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.c
similarity index 100%
rename from components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.c
diff --git a/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.h
similarity index 100%
rename from components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm.h
diff --git a/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm_internal.h
similarity index 100%
rename from components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/acm/app_usbd_cdc_acm_internal.h
diff --git a/components/libraries/usbd/class/cdc/app_usbd_cdc_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/app_usbd_cdc_desc.h
similarity index 100%
rename from components/libraries/usbd/class/cdc/app_usbd_cdc_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/app_usbd_cdc_desc.h
diff --git a/components/libraries/usbd/class/cdc/app_usbd_cdc_types.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/app_usbd_cdc_types.h
similarity index 100%
rename from components/libraries/usbd/class/cdc/app_usbd_cdc_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/cdc/app_usbd_cdc_types.h
diff --git a/components/libraries/usbd/class/hid/app_usbd_hid.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid.c
similarity index 100%
rename from components/libraries/usbd/class/hid/app_usbd_hid.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid.c
diff --git a/components/libraries/usbd/class/hid/app_usbd_hid.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid.h
similarity index 100%
rename from components/libraries/usbd/class/hid/app_usbd_hid.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid.h
diff --git a/components/libraries/usbd/class/hid/app_usbd_hid_types.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid_types.h
similarity index 100%
rename from components/libraries/usbd/class/hid/app_usbd_hid_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/app_usbd_hid_types.h
diff --git a/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.c
similarity index 100%
rename from components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.c
diff --git a/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.h
similarity index 100%
rename from components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic.h
diff --git a/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_desc.h
similarity index 100%
rename from components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_desc.h
diff --git a/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_internal.h
similarity index 100%
rename from components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/generic/app_usbd_hid_generic_internal.h
diff --git a/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.c
similarity index 100%
rename from components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.c
diff --git a/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.h
similarity index 100%
rename from components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd.h
diff --git a/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_desc.h
similarity index 100%
rename from components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_desc.h
diff --git a/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_internal.h
similarity index 100%
rename from components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/kbd/app_usbd_hid_kbd_internal.h
diff --git a/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.c
similarity index 100%
rename from components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.c
diff --git a/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.h
similarity index 100%
rename from components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse.h
diff --git a/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_desc.h
similarity index 100%
rename from components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_desc.h
diff --git a/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_internal.h
similarity index 100%
rename from components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/hid/mouse/app_usbd_hid_mouse_internal.h
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc.c b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc.c
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc.c
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc.c
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc.h
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc.h
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc_desc.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_desc.h
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc_desc.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_desc.h
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc_internal.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_internal.h
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc_internal.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_internal.h
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc_scsi.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_scsi.h
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc_scsi.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_scsi.h
diff --git a/components/libraries/usbd/class/msc/app_usbd_msc_types.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_types.h
similarity index 100%
rename from components/libraries/usbd/class/msc/app_usbd_msc_types.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/class/msc/app_usbd_msc_types.h
diff --git a/components/libraries/usbd/config/app_usbd_string_config.h b/SDK/12.3.0_d7731ad/components/libraries/usbd/config/app_usbd_string_config.h
similarity index 100%
rename from components/libraries/usbd/config/app_usbd_string_config.h
rename to SDK/12.3.0_d7731ad/components/libraries/usbd/config/app_usbd_string_config.h
diff --git a/components/libraries/util/app_error.c b/SDK/12.3.0_d7731ad/components/libraries/util/app_error.c
similarity index 100%
rename from components/libraries/util/app_error.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_error.c
diff --git a/components/libraries/util/app_error.h b/SDK/12.3.0_d7731ad/components/libraries/util/app_error.h
similarity index 100%
rename from components/libraries/util/app_error.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_error.h
diff --git a/components/libraries/util/app_error_weak.c b/SDK/12.3.0_d7731ad/components/libraries/util/app_error_weak.c
similarity index 100%
rename from components/libraries/util/app_error_weak.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_error_weak.c
diff --git a/components/libraries/util/app_error_weak.h b/SDK/12.3.0_d7731ad/components/libraries/util/app_error_weak.h
similarity index 100%
rename from components/libraries/util/app_error_weak.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_error_weak.h
diff --git a/components/libraries/util/app_util.h b/SDK/12.3.0_d7731ad/components/libraries/util/app_util.h
similarity index 100%
rename from components/libraries/util/app_util.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_util.h
diff --git a/components/libraries/util/app_util_bds.h b/SDK/12.3.0_d7731ad/components/libraries/util/app_util_bds.h
similarity index 100%
rename from components/libraries/util/app_util_bds.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_util_bds.h
diff --git a/components/libraries/util/app_util_platform.c b/SDK/12.3.0_d7731ad/components/libraries/util/app_util_platform.c
similarity index 100%
rename from components/libraries/util/app_util_platform.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_util_platform.c
diff --git a/components/libraries/util/app_util_platform.h b/SDK/12.3.0_d7731ad/components/libraries/util/app_util_platform.h
similarity index 100%
rename from components/libraries/util/app_util_platform.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/app_util_platform.h
diff --git a/components/libraries/util/nordic_common.h b/SDK/12.3.0_d7731ad/components/libraries/util/nordic_common.h
similarity index 100%
rename from components/libraries/util/nordic_common.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/nordic_common.h
diff --git a/components/libraries/util/nrf_assert.c b/SDK/12.3.0_d7731ad/components/libraries/util/nrf_assert.c
similarity index 100%
rename from components/libraries/util/nrf_assert.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/nrf_assert.c
diff --git a/components/libraries/util/nrf_assert.h b/SDK/12.3.0_d7731ad/components/libraries/util/nrf_assert.h
similarity index 100%
rename from components/libraries/util/nrf_assert.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/nrf_assert.h
diff --git a/components/libraries/util/nrf_bitmask.h b/SDK/12.3.0_d7731ad/components/libraries/util/nrf_bitmask.h
similarity index 100%
rename from components/libraries/util/nrf_bitmask.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/nrf_bitmask.h
diff --git a/components/libraries/util/sdk_common.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_common.h
similarity index 100%
rename from components/libraries/util/sdk_common.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_common.h
diff --git a/components/libraries/util/sdk_errors.c b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_errors.c
similarity index 100%
rename from components/libraries/util/sdk_errors.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_errors.c
diff --git a/components/libraries/util/sdk_errors.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_errors.h
similarity index 100%
rename from components/libraries/util/sdk_errors.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_errors.h
diff --git a/components/libraries/util/sdk_macros.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_macros.h
similarity index 100%
rename from components/libraries/util/sdk_macros.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_macros.h
diff --git a/components/libraries/util/sdk_mapped_flags.c b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_mapped_flags.c
similarity index 100%
rename from components/libraries/util/sdk_mapped_flags.c
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_mapped_flags.c
diff --git a/components/libraries/util/sdk_mapped_flags.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_mapped_flags.h
similarity index 100%
rename from components/libraries/util/sdk_mapped_flags.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_mapped_flags.h
diff --git a/components/libraries/util/sdk_os.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_os.h
similarity index 100%
rename from components/libraries/util/sdk_os.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_os.h
diff --git a/components/libraries/util/sdk_resources.h b/SDK/12.3.0_d7731ad/components/libraries/util/sdk_resources.h
similarity index 100%
rename from components/libraries/util/sdk_resources.h
rename to SDK/12.3.0_d7731ad/components/libraries/util/sdk_resources.h
diff --git a/components/sdk_validation.h b/SDK/12.3.0_d7731ad/components/sdk_validation.h
similarity index 100%
rename from components/sdk_validation.h
rename to SDK/12.3.0_d7731ad/components/sdk_validation.h
diff --git a/components/serialization/application/codecs/common/ble_dtm_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_app.c
similarity index 100%
rename from components/serialization/application/codecs/common/ble_dtm_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_app.c
diff --git a/components/serialization/application/codecs/common/ble_dtm_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_app.h
similarity index 100%
rename from components/serialization/application/codecs/common/ble_dtm_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_app.h
diff --git a/components/serialization/application/codecs/common/ble_dtm_init.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_init.c
similarity index 100%
rename from components/serialization/application/codecs/common/ble_dtm_init.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/ble_dtm_init.c
diff --git a/components/serialization/application/codecs/common/conn_systemreset.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/conn_systemreset.c
similarity index 100%
rename from components/serialization/application/codecs/common/conn_systemreset.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/conn_systemreset.c
diff --git a/components/serialization/application/codecs/common/conn_systemreset.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/conn_systemreset.h
similarity index 100%
rename from components/serialization/application/codecs/common/conn_systemreset.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/common/conn_systemreset.h
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_ble.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_ble.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble.c
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_ble_gap.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gap.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_ble_gap.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gap.c
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_ble_gattc.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gattc.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_ble_gattc.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gattc.c
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_ble_gatts.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gatts.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_ble_gatts.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_gatts.c
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_ble_l2cap.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_l2cap.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_ble_l2cap.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_ble_l2cap.c
diff --git a/components/serialization/application/codecs/s132/middleware/app_mw_nrf_soc.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_nrf_soc.c
similarity index 100%
rename from components/serialization/application/codecs/s132/middleware/app_mw_nrf_soc.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/middleware/app_mw_nrf_soc.c
diff --git a/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.c
diff --git a/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_gap_sec_keys.h
diff --git a/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/app_ble_user_mem.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.c
diff --git a/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/app_ble_user_mem.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/app_ble_user_mem.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_event.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_event.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_event.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_event.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_evt_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_evt_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_evt_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_evt_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_evt_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_evt_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_evt_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_evt_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gap_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gap_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gap_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gap_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gap_evt_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gattc_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gattc_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gattc_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gattc_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gattc_evt_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gatts_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gatts_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gatts_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gatts_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_gatts_evt_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_l2cap_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_l2cap_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/ble_l2cap_evt_app.h
diff --git a/components/serialization/application/codecs/s132/serializers/nrf_soc_app.c b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/nrf_soc_app.c
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/nrf_soc_app.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/nrf_soc_app.c
diff --git a/components/serialization/application/codecs/s132/serializers/nrf_soc_app.h b/SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/nrf_soc_app.h
similarity index 100%
rename from components/serialization/application/codecs/s132/serializers/nrf_soc_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/codecs/s132/serializers/nrf_soc_app.h
diff --git a/components/serialization/application/hal/arm_startup_nrf51.s b/SDK/12.3.0_d7731ad/components/serialization/application/hal/arm_startup_nrf51.s
similarity index 100%
rename from components/serialization/application/hal/arm_startup_nrf51.s
rename to SDK/12.3.0_d7731ad/components/serialization/application/hal/arm_startup_nrf51.s
diff --git a/components/serialization/application/hal/ser_app_hal.h b/SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_hal.h
similarity index 100%
rename from components/serialization/application/hal/ser_app_hal.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_hal.h
diff --git a/components/serialization/application/hal/ser_app_hal_nrf5x.c b/SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_hal_nrf5x.c
similarity index 100%
rename from components/serialization/application/hal/ser_app_hal_nrf5x.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_hal_nrf5x.c
diff --git a/components/serialization/application/hal/ser_app_power_system_off.c b/SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_power_system_off.c
similarity index 100%
rename from components/serialization/application/hal/ser_app_power_system_off.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_power_system_off.c
diff --git a/components/serialization/application/hal/ser_app_power_system_off.h b/SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_power_system_off.h
similarity index 100%
rename from components/serialization/application/hal/ser_app_power_system_off.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/hal/ser_app_power_system_off.h
diff --git a/components/serialization/application/transport/ser_sd_transport.c b/SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_sd_transport.c
similarity index 100%
rename from components/serialization/application/transport/ser_sd_transport.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_sd_transport.c
diff --git a/components/serialization/application/transport/ser_sd_transport.h b/SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_sd_transport.h
similarity index 100%
rename from components/serialization/application/transport/ser_sd_transport.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_sd_transport.h
diff --git a/components/serialization/application/transport/ser_softdevice_handler.c b/SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_softdevice_handler.c
similarity index 100%
rename from components/serialization/application/transport/ser_softdevice_handler.c
rename to SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_softdevice_handler.c
diff --git a/components/serialization/application/transport/ser_softdevice_handler.h b/SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_softdevice_handler.h
similarity index 100%
rename from components/serialization/application/transport/ser_softdevice_handler.h
rename to SDK/12.3.0_d7731ad/components/serialization/application/transport/ser_softdevice_handler.h
diff --git a/components/serialization/common/ble_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/ble_serialization.c
similarity index 100%
rename from components/serialization/common/ble_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/ble_serialization.c
diff --git a/components/serialization/common/ble_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/ble_serialization.h
similarity index 100%
rename from components/serialization/common/ble_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/ble_serialization.h
diff --git a/components/serialization/common/cond_field_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/cond_field_serialization.c
similarity index 100%
rename from components/serialization/common/cond_field_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/cond_field_serialization.c
diff --git a/components/serialization/common/cond_field_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/cond_field_serialization.h
similarity index 100%
rename from components/serialization/common/cond_field_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/cond_field_serialization.h
diff --git a/components/serialization/common/ser_config.h b/SDK/12.3.0_d7731ad/components/serialization/common/ser_config.h
similarity index 100%
rename from components/serialization/common/ser_config.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/ser_config.h
diff --git a/components/serialization/common/ser_dbg_sd_str.c b/SDK/12.3.0_d7731ad/components/serialization/common/ser_dbg_sd_str.c
similarity index 100%
rename from components/serialization/common/ser_dbg_sd_str.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/ser_dbg_sd_str.c
diff --git a/components/serialization/common/ser_dbg_sd_str.h b/SDK/12.3.0_d7731ad/components/serialization/common/ser_dbg_sd_str.h
similarity index 100%
rename from components/serialization/common/ser_dbg_sd_str.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/ser_dbg_sd_str.h
diff --git a/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gap_struct_serialization.h
diff --git a/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatt_struct_serialization.h
diff --git a/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gattc_struct_serialization.h
diff --git a/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_gatts_struct_serialization.h
diff --git a/components/serialization/common/struct_ser/s132/ble_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/ble_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/ble_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/ble_struct_serialization.h
diff --git a/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.c b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.c
similarity index 100%
rename from components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.c
diff --git a/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.h b/SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.h
similarity index 100%
rename from components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/struct_ser/s132/nrf_soc_struct_serialization.h
diff --git a/components/serialization/common/transport/dtm_uart_params.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/dtm_uart_params.h
similarity index 100%
rename from components/serialization/common/transport/dtm_uart_params.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/dtm_uart_params.h
diff --git a/components/serialization/common/transport/ser_hal_transport.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_hal_transport.c
similarity index 100%
rename from components/serialization/common/transport/ser_hal_transport.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_hal_transport.c
diff --git a/components/serialization/common/transport/ser_hal_transport.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_hal_transport.h
similarity index 100%
rename from components/serialization/common/transport/ser_hal_transport.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_hal_transport.h
diff --git a/components/serialization/common/transport/ser_phy/config/ser_config_5W_app.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_config_5W_app.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/config/ser_config_5W_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_config_5W_app.h
diff --git a/components/serialization/common/transport/ser_phy/config/ser_phy_config_app.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_config_app.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/config/ser_phy_config_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_config_app.h
diff --git a/components/serialization/common/transport/ser_phy/config/ser_phy_config_conn.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_config_conn.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/config/ser_phy_config_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_config_conn.h
diff --git a/components/serialization/common/transport/ser_phy/config/ser_phy_debug_app.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_debug_app.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/config/ser_phy_debug_app.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_debug_app.h
diff --git a/components/serialization/common/transport/ser_phy/config/ser_phy_debug_conn.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_debug_conn.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/config/ser_phy_debug_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/config/ser_phy_debug_conn.h
diff --git a/components/serialization/common/transport/ser_phy/ser_phy.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy.h
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_hci.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_hci.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_hci.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_hci.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci.h
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_hci_slip.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci_slip.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_hci_slip.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_hci_slip.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_nohci.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_nohci.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_nohci.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_nohci.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_master.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_master.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_spi_5W_master.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_master.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_slave.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_slave.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_spi_5W_slave.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_5W_slave.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_spi_master.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_master.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_spi_master.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_master.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_spi_slave.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_slave.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_spi_slave.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_spi_slave.c
diff --git a/components/serialization/common/transport/ser_phy/ser_phy_uart.c b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_uart.c
similarity index 100%
rename from components/serialization/common/transport/ser_phy/ser_phy_uart.c
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy/ser_phy_uart.c
diff --git a/components/serialization/common/transport/ser_phy_debug_comm.h b/SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy_debug_comm.h
similarity index 100%
rename from components/serialization/common/transport/ser_phy_debug_comm.h
rename to SDK/12.3.0_d7731ad/components/serialization/common/transport/ser_phy_debug_comm.h
diff --git a/components/serialization/connectivity/codecs/common/ble_dtm_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/ble_dtm_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/common/ble_dtm_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/ble_dtm_conn.h
diff --git a/components/serialization/connectivity/codecs/common/ble_dtm_init.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/ble_dtm_init.c
similarity index 100%
rename from components/serialization/connectivity/codecs/common/ble_dtm_init.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/ble_dtm_init.c
diff --git a/components/serialization/connectivity/codecs/common/conn_mw.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/conn_mw.c
similarity index 100%
rename from components/serialization/connectivity/codecs/common/conn_mw.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/conn_mw.c
diff --git a/components/serialization/connectivity/codecs/common/conn_mw.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/conn_mw.h
similarity index 100%
rename from components/serialization/connectivity/codecs/common/conn_mw.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/common/conn_mw.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gap.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gattc.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_gatts.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_ble_l2cap.h
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_items.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_items.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_items.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_items.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.c
diff --git a/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/middleware/conn_mw_nrf_soc.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_event_enc.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_event_enc.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_event_enc.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_event_enc.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_evt_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gap_evt_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gattc_evt_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_gatts_evt_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/ble_l2cap_evt_conn.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_gap_sec_keys.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/conn_ble_user_mem.h
diff --git a/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.c
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.c
diff --git a/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.h
similarity index 100%
rename from components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/codecs/s132/serializers/nrf_soc_conn.h
diff --git a/components/serialization/connectivity/hal/dtm_uart.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/hal/dtm_uart.c
similarity index 100%
rename from components/serialization/connectivity/hal/dtm_uart.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/hal/dtm_uart.c
diff --git a/components/serialization/connectivity/hal/dtm_uart.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/hal/dtm_uart.h
similarity index 100%
rename from components/serialization/connectivity/hal/dtm_uart.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/hal/dtm_uart.h
diff --git a/components/serialization/connectivity/pstorage_platform.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/pstorage_platform.h
similarity index 100%
rename from components/serialization/connectivity/pstorage_platform.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/pstorage_platform.h
diff --git a/components/serialization/connectivity/ser_conn_cmd_decoder.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_cmd_decoder.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_cmd_decoder.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_cmd_decoder.c
diff --git a/components/serialization/connectivity/ser_conn_cmd_decoder.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_cmd_decoder.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_cmd_decoder.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_cmd_decoder.h
diff --git a/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_dtm_cmd_decoder.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.c
diff --git a/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_dtm_cmd_decoder.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_dtm_cmd_decoder.h
diff --git a/components/serialization/connectivity/ser_conn_error_handling.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_error_handling.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_error_handling.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_error_handling.c
diff --git a/components/serialization/connectivity/ser_conn_event_encoder.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_event_encoder.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_event_encoder.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_event_encoder.c
diff --git a/components/serialization/connectivity/ser_conn_event_encoder.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_event_encoder.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_event_encoder.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_event_encoder.h
diff --git a/components/serialization/connectivity/ser_conn_handlers.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_handlers.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_handlers.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_handlers.c
diff --git a/components/serialization/connectivity/ser_conn_handlers.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_handlers.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_handlers.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_handlers.h
diff --git a/components/serialization/connectivity/ser_conn_pkt_decoder.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_pkt_decoder.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_pkt_decoder.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_pkt_decoder.c
diff --git a/components/serialization/connectivity/ser_conn_pkt_decoder.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_pkt_decoder.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_pkt_decoder.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_pkt_decoder.h
diff --git a/components/serialization/connectivity/ser_conn_reset_cmd_decoder.c b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_reset_cmd_decoder.c
similarity index 100%
rename from components/serialization/connectivity/ser_conn_reset_cmd_decoder.c
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_reset_cmd_decoder.c
diff --git a/components/serialization/connectivity/ser_conn_reset_cmd_decoder.h b/SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_reset_cmd_decoder.h
similarity index 100%
rename from components/serialization/connectivity/ser_conn_reset_cmd_decoder.h
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/ser_conn_reset_cmd_decoder.h
diff --git a/components/serialization/connectivity/startup/arm/arm_startup_nrf51.s b/SDK/12.3.0_d7731ad/components/serialization/connectivity/startup/arm/arm_startup_nrf51.s
similarity index 100%
rename from components/serialization/connectivity/startup/arm/arm_startup_nrf51.s
rename to SDK/12.3.0_d7731ad/components/serialization/connectivity/startup/arm/arm_startup_nrf51.s
diff --git a/components/softdevice/common/softdevice_handler/ant_stack_handler_types.h b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/ant_stack_handler_types.h
similarity index 100%
rename from components/softdevice/common/softdevice_handler/ant_stack_handler_types.h
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/ant_stack_handler_types.h
diff --git a/components/softdevice/common/softdevice_handler/app_ram_base.h b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/app_ram_base.h
similarity index 100%
rename from components/softdevice/common/softdevice_handler/app_ram_base.h
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/app_ram_base.h
diff --git a/components/softdevice/common/softdevice_handler/ble_stack_handler_types.h b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/ble_stack_handler_types.h
similarity index 100%
rename from components/softdevice/common/softdevice_handler/ble_stack_handler_types.h
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/ble_stack_handler_types.h
diff --git a/components/softdevice/common/softdevice_handler/softdevice_handler.c b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler.c
similarity index 100%
rename from components/softdevice/common/softdevice_handler/softdevice_handler.c
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler.c
diff --git a/components/softdevice/common/softdevice_handler/softdevice_handler.h b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler.h
similarity index 100%
rename from components/softdevice/common/softdevice_handler/softdevice_handler.h
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler.h
diff --git a/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c
similarity index 100%
rename from components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.c
diff --git a/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.h b/SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.h
similarity index 100%
rename from components/softdevice/common/softdevice_handler/softdevice_handler_appsh.h
rename to SDK/12.3.0_d7731ad/components/softdevice/common/softdevice_handler/softdevice_handler_appsh.h
diff --git a/components/softdevice/s130/doc/s130_nrf51822_2.0.1_licence_agreement.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_licence_agreement.pdf
similarity index 100%
rename from components/softdevice/s130/doc/s130_nrf51822_2.0.1_licence_agreement.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_licence_agreement.pdf
diff --git a/components/softdevice/s130/doc/s130_nrf51822_2.0.1_readme.txt b/SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_readme.txt
similarity index 100%
rename from components/softdevice/s130/doc/s130_nrf51822_2.0.1_readme.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_readme.txt
diff --git a/components/softdevice/s130/doc/s130_nrf51822_2.0.1_releasenotes.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_releasenotes.pdf
similarity index 100%
rename from components/softdevice/s130/doc/s130_nrf51822_2.0.1_releasenotes.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51822_2.0.1_releasenotes.pdf
diff --git a/components/softdevice/s130/doc/s130_nrf51_2.0.1_licence_agreement.txt b/SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51_2.0.1_licence_agreement.txt
similarity index 100%
rename from components/softdevice/s130/doc/s130_nrf51_2.0.1_licence_agreement.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s130_nrf51_2.0.1_licence_agreement.txt
diff --git a/components/softdevice/s130/doc/s13x_nrf5x_2.0.1_migration_document.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s13x_nrf5x_2.0.1_migration_document.pdf
similarity index 100%
rename from components/softdevice/s130/doc/s13x_nrf5x_2.0.1_migration_document.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/doc/s13x_nrf5x_2.0.1_migration_document.pdf
diff --git a/components/softdevice/s130/headers/ble.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble.h
similarity index 100%
rename from components/softdevice/s130/headers/ble.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble.h
diff --git a/components/softdevice/s130/headers/ble_err.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_err.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_err.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_err.h
diff --git a/components/softdevice/s130/headers/ble_gap.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gap.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_gap.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gap.h
diff --git a/components/softdevice/s130/headers/ble_gatt.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gatt.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_gatt.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gatt.h
diff --git a/components/softdevice/s130/headers/ble_gattc.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gattc.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_gattc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gattc.h
diff --git a/components/softdevice/s130/headers/ble_gatts.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gatts.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_gatts.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_gatts.h
diff --git a/components/softdevice/s130/headers/ble_hci.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_hci.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_hci.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_hci.h
diff --git a/components/softdevice/s130/headers/ble_l2cap.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_l2cap.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_l2cap.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_l2cap.h
diff --git a/components/softdevice/s130/headers/ble_ranges.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_ranges.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_ranges.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_ranges.h
diff --git a/components/softdevice/s130/headers/ble_types.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_types.h
similarity index 100%
rename from components/softdevice/s130/headers/ble_types.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/ble_types.h
diff --git a/components/softdevice/s130/headers/nrf51/nrf_mbr.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf51/nrf_mbr.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf51/nrf_mbr.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf51/nrf_mbr.h
diff --git a/components/softdevice/s130/headers/nrf_error.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_error.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error.h
diff --git a/components/softdevice/s130/headers/nrf_error_sdm.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error_sdm.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_error_sdm.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error_sdm.h
diff --git a/components/softdevice/s130/headers/nrf_error_soc.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error_soc.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_error_soc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_error_soc.h
diff --git a/components/softdevice/s130/headers/nrf_nvic.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_nvic.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_nvic.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_nvic.h
diff --git a/components/softdevice/s130/headers/nrf_sd_def.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_sd_def.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_sd_def.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_sd_def.h
diff --git a/components/softdevice/s130/headers/nrf_sdm.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_sdm.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_sdm.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_sdm.h
diff --git a/components/softdevice/s130/headers/nrf_soc.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_soc.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_soc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_soc.h
diff --git a/components/softdevice/s130/headers/nrf_svc.h b/SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_svc.h
similarity index 100%
rename from components/softdevice/s130/headers/nrf_svc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/headers/nrf_svc.h
diff --git a/components/softdevice/s130/hex/s130_nrf51_2.0.1_licence-agreement.txt b/SDK/12.3.0_d7731ad/components/softdevice/s130/hex/s130_nrf51_2.0.1_licence-agreement.txt
similarity index 100%
rename from components/softdevice/s130/hex/s130_nrf51_2.0.1_licence-agreement.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/hex/s130_nrf51_2.0.1_licence-agreement.txt
diff --git a/components/softdevice/s130/hex/s130_nrf51_2.0.1_softdevice.hex b/SDK/12.3.0_d7731ad/components/softdevice/s130/hex/s130_nrf51_2.0.1_softdevice.hex
similarity index 100%
rename from components/softdevice/s130/hex/s130_nrf51_2.0.1_softdevice.hex
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/hex/s130_nrf51_2.0.1_softdevice.hex
diff --git a/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxaa.ld b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxaa.ld
similarity index 100%
rename from components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxaa.ld
diff --git a/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxac.ld b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxac.ld
similarity index 100%
rename from components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxac.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxac.ld
diff --git a/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld
similarity index 100%
rename from components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld
diff --git a/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxab.ld b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxab.ld
similarity index 100%
rename from components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxab.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxab.ld
diff --git a/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxaa.icf b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxaa.icf
similarity index 100%
rename from components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxaa.icf
diff --git a/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxac.icf b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxac.icf
similarity index 100%
rename from components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxac.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51422_xxac.icf
diff --git a/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxaa.icf b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxaa.icf
similarity index 100%
rename from components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxaa.icf
diff --git a/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxab.icf b/SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxab.icf
similarity index 100%
rename from components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxab.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s130/toolchain/iar/iar_s130_nrf51822_xxab.icf
diff --git a/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.pdf
similarity index 100%
rename from components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.pdf
diff --git a/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.txt b/SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.txt
similarity index 100%
rename from components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_licence_agreement.txt
diff --git a/components/softdevice/s132/doc/s132_nrf52_3.0.0_migration_document.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_migration_document.pdf
similarity index 100%
rename from components/softdevice/s132/doc/s132_nrf52_3.0.0_migration_document.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_migration_document.pdf
diff --git a/components/softdevice/s132/doc/s132_nrf52_3.0.0_readme.txt b/SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_readme.txt
similarity index 100%
rename from components/softdevice/s132/doc/s132_nrf52_3.0.0_readme.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_readme.txt
diff --git a/components/softdevice/s132/doc/s132_nrf52_3.0.0_releasenotes.pdf b/SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_releasenotes.pdf
similarity index 100%
rename from components/softdevice/s132/doc/s132_nrf52_3.0.0_releasenotes.pdf
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/doc/s132_nrf52_3.0.0_releasenotes.pdf
diff --git a/components/softdevice/s132/headers/ble.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble.h
similarity index 100%
rename from components/softdevice/s132/headers/ble.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble.h
diff --git a/components/softdevice/s132/headers/ble_err.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_err.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_err.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_err.h
diff --git a/components/softdevice/s132/headers/ble_gap.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gap.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_gap.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gap.h
diff --git a/components/softdevice/s132/headers/ble_gatt.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gatt.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_gatt.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gatt.h
diff --git a/components/softdevice/s132/headers/ble_gattc.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gattc.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_gattc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gattc.h
diff --git a/components/softdevice/s132/headers/ble_gatts.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gatts.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_gatts.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_gatts.h
diff --git a/components/softdevice/s132/headers/ble_hci.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_hci.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_hci.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_hci.h
diff --git a/components/softdevice/s132/headers/ble_l2cap.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_l2cap.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_l2cap.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_l2cap.h
diff --git a/components/softdevice/s132/headers/ble_ranges.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_ranges.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_ranges.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_ranges.h
diff --git a/components/softdevice/s132/headers/ble_types.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_types.h
similarity index 100%
rename from components/softdevice/s132/headers/ble_types.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/ble_types.h
diff --git a/components/softdevice/s132/headers/nrf52/nrf_mbr.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf52/nrf_mbr.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf52/nrf_mbr.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf52/nrf_mbr.h
diff --git a/components/softdevice/s132/headers/nrf_error.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_error.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error.h
diff --git a/components/softdevice/s132/headers/nrf_error_sdm.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error_sdm.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_error_sdm.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error_sdm.h
diff --git a/components/softdevice/s132/headers/nrf_error_soc.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error_soc.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_error_soc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_error_soc.h
diff --git a/components/softdevice/s132/headers/nrf_nvic.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_nvic.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_nvic.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_nvic.h
diff --git a/components/softdevice/s132/headers/nrf_sd_def.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_sd_def.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_sd_def.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_sd_def.h
diff --git a/components/softdevice/s132/headers/nrf_sdm.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_sdm.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_sdm.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_sdm.h
diff --git a/components/softdevice/s132/headers/nrf_soc.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_soc.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_soc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_soc.h
diff --git a/components/softdevice/s132/headers/nrf_svc.h b/SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_svc.h
similarity index 100%
rename from components/softdevice/s132/headers/nrf_svc.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/headers/nrf_svc.h
diff --git a/components/softdevice/s132/hex/s132_nrf52_3.0.0_licence-agreement.txt b/SDK/12.3.0_d7731ad/components/softdevice/s132/hex/s132_nrf52_3.0.0_licence-agreement.txt
similarity index 100%
rename from components/softdevice/s132/hex/s132_nrf52_3.0.0_licence-agreement.txt
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/hex/s132_nrf52_3.0.0_licence-agreement.txt
diff --git a/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex b/SDK/12.3.0_d7731ad/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex
similarity index 100%
rename from components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex
diff --git a/components/softdevice/s132/toolchain/armgcc/armgcc_s132_nrf52832_xxaa.ld b/SDK/12.3.0_d7731ad/components/softdevice/s132/toolchain/armgcc/armgcc_s132_nrf52832_xxaa.ld
similarity index 100%
rename from components/softdevice/s132/toolchain/armgcc/armgcc_s132_nrf52832_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/toolchain/armgcc/armgcc_s132_nrf52832_xxaa.ld
diff --git a/components/softdevice/s132/toolchain/iar/iar_s132_nrf52832_xxaa.icf b/SDK/12.3.0_d7731ad/components/softdevice/s132/toolchain/iar/iar_s132_nrf52832_xxaa.icf
similarity index 100%
rename from components/softdevice/s132/toolchain/iar/iar_s132_nrf52832_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s132/toolchain/iar/iar_s132_nrf52832_xxaa.icf
diff --git a/components/softdevice/s212/headers/nrf_sd_def.h b/SDK/12.3.0_d7731ad/components/softdevice/s212/headers/nrf_sd_def.h
similarity index 100%
rename from components/softdevice/s212/headers/nrf_sd_def.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s212/headers/nrf_sd_def.h
diff --git a/components/softdevice/s212/toolchain/armgcc/armgcc_s212_nrf52832_xxaa.ld b/SDK/12.3.0_d7731ad/components/softdevice/s212/toolchain/armgcc/armgcc_s212_nrf52832_xxaa.ld
similarity index 100%
rename from components/softdevice/s212/toolchain/armgcc/armgcc_s212_nrf52832_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s212/toolchain/armgcc/armgcc_s212_nrf52832_xxaa.ld
diff --git a/components/softdevice/s212/toolchain/iar/iar_s212_nrf52832_xxaa.icf b/SDK/12.3.0_d7731ad/components/softdevice/s212/toolchain/iar/iar_s212_nrf52832_xxaa.icf
similarity index 100%
rename from components/softdevice/s212/toolchain/iar/iar_s212_nrf52832_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s212/toolchain/iar/iar_s212_nrf52832_xxaa.icf
diff --git a/components/softdevice/s332/headers/nrf_sd_def.h b/SDK/12.3.0_d7731ad/components/softdevice/s332/headers/nrf_sd_def.h
similarity index 100%
rename from components/softdevice/s332/headers/nrf_sd_def.h
rename to SDK/12.3.0_d7731ad/components/softdevice/s332/headers/nrf_sd_def.h
diff --git a/components/softdevice/s332/toolchain/armgcc/armgcc_s332_nrf52832_xxaa.ld b/SDK/12.3.0_d7731ad/components/softdevice/s332/toolchain/armgcc/armgcc_s332_nrf52832_xxaa.ld
similarity index 100%
rename from components/softdevice/s332/toolchain/armgcc/armgcc_s332_nrf52832_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/softdevice/s332/toolchain/armgcc/armgcc_s332_nrf52832_xxaa.ld
diff --git a/components/softdevice/s332/toolchain/iar/iar_s332_nrf52832_xxaa.icf b/SDK/12.3.0_d7731ad/components/softdevice/s332/toolchain/iar/iar_s332_nrf52832_xxaa.icf
similarity index 100%
rename from components/softdevice/s332/toolchain/iar/iar_s332_nrf52832_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/softdevice/s332/toolchain/iar/iar_s332_nrf52832_xxaa.icf
diff --git a/components/toolchain/arm/arm_startup_nrf51.s b/SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf51.s
similarity index 100%
rename from components/toolchain/arm/arm_startup_nrf51.s
rename to SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf51.s
diff --git a/components/toolchain/arm/arm_startup_nrf52.s b/SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf52.s
similarity index 100%
rename from components/toolchain/arm/arm_startup_nrf52.s
rename to SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf52.s
diff --git a/components/toolchain/arm/arm_startup_nrf52840.s b/SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf52840.s
similarity index 100%
rename from components/toolchain/arm/arm_startup_nrf52840.s
rename to SDK/12.3.0_d7731ad/components/toolchain/arm/arm_startup_nrf52840.s
diff --git a/components/toolchain/arm/uicr_config.h b/SDK/12.3.0_d7731ad/components/toolchain/arm/uicr_config.h
similarity index 100%
rename from components/toolchain/arm/uicr_config.h
rename to SDK/12.3.0_d7731ad/components/toolchain/arm/uicr_config.h
diff --git a/components/toolchain/cmsis/include/arm_common_tables.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_common_tables.h
similarity index 100%
rename from components/toolchain/cmsis/include/arm_common_tables.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_common_tables.h
diff --git a/components/toolchain/cmsis/include/arm_const_structs.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_const_structs.h
similarity index 100%
rename from components/toolchain/cmsis/include/arm_const_structs.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_const_structs.h
diff --git a/components/toolchain/cmsis/include/arm_math.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_math.h
similarity index 100%
rename from components/toolchain/cmsis/include/arm_math.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/arm_math.h
diff --git a/components/toolchain/cmsis/include/cmsis_armcc.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_armcc.h
similarity index 100%
rename from components/toolchain/cmsis/include/cmsis_armcc.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_armcc.h
diff --git a/components/toolchain/cmsis/include/cmsis_armcc_V6.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_armcc_V6.h
similarity index 100%
rename from components/toolchain/cmsis/include/cmsis_armcc_V6.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_armcc_V6.h
diff --git a/components/toolchain/cmsis/include/cmsis_gcc.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_gcc.h
similarity index 100%
rename from components/toolchain/cmsis/include/cmsis_gcc.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/cmsis_gcc.h
diff --git a/components/toolchain/cmsis/include/core_cm0.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm0.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cm0.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm0.h
diff --git a/components/toolchain/cmsis/include/core_cm0plus.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm0plus.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cm0plus.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm0plus.h
diff --git a/components/toolchain/cmsis/include/core_cm3.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm3.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cm3.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm3.h
diff --git a/components/toolchain/cmsis/include/core_cm4.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm4.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cm4.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm4.h
diff --git a/components/toolchain/cmsis/include/core_cm7.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm7.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cm7.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cm7.h
diff --git a/components/toolchain/cmsis/include/core_cmFunc.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmFunc.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cmFunc.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmFunc.h
diff --git a/components/toolchain/cmsis/include/core_cmInstr.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmInstr.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cmInstr.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmInstr.h
diff --git a/components/toolchain/cmsis/include/core_cmSimd.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmSimd.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_cmSimd.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_cmSimd.h
diff --git a/components/toolchain/cmsis/include/core_sc000.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_sc000.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_sc000.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_sc000.h
diff --git a/components/toolchain/cmsis/include/core_sc300.h b/SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_sc300.h
similarity index 100%
rename from components/toolchain/cmsis/include/core_sc300.h
rename to SDK/12.3.0_d7731ad/components/toolchain/cmsis/include/core_sc300.h
diff --git a/components/toolchain/gcc/Makefile.common b/SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.common
similarity index 100%
rename from components/toolchain/gcc/Makefile.common
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.common
diff --git a/components/toolchain/gcc/Makefile.posix b/SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.posix
similarity index 100%
rename from components/toolchain/gcc/Makefile.posix
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.posix
diff --git a/components/toolchain/gcc/Makefile.windows b/SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.windows
similarity index 100%
rename from components/toolchain/gcc/Makefile.windows
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/Makefile.windows
diff --git a/components/toolchain/gcc/file_list.mk b/SDK/12.3.0_d7731ad/components/toolchain/gcc/file_list.mk
similarity index 100%
rename from components/toolchain/gcc/file_list.mk
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/file_list.mk
diff --git a/components/toolchain/gcc/gcc_nrf51_common.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_nrf51_common.ld
similarity index 100%
rename from components/toolchain/gcc/gcc_nrf51_common.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_nrf51_common.ld
diff --git a/components/toolchain/gcc/gcc_startup_nrf51.s b/SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf51.s
similarity index 100%
rename from components/toolchain/gcc/gcc_startup_nrf51.s
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf51.s
diff --git a/components/toolchain/gcc/gcc_startup_nrf52.s b/SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf52.s
similarity index 100%
rename from components/toolchain/gcc/gcc_startup_nrf52.s
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf52.s
diff --git a/components/toolchain/gcc/gcc_startup_nrf52840.S b/SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf52840.S
similarity index 100%
rename from components/toolchain/gcc/gcc_startup_nrf52840.S
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/gcc_startup_nrf52840.S
diff --git a/components/toolchain/gcc/nrf51_common.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_common.ld
similarity index 100%
rename from components/toolchain/gcc/nrf51_common.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_common.ld
diff --git a/components/toolchain/gcc/nrf51_xxaa.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxaa.ld
similarity index 100%
rename from components/toolchain/gcc/nrf51_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxaa.ld
diff --git a/components/toolchain/gcc/nrf51_xxab.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxab.ld
similarity index 100%
rename from components/toolchain/gcc/nrf51_xxab.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxab.ld
diff --git a/components/toolchain/gcc/nrf51_xxac.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxac.ld
similarity index 100%
rename from components/toolchain/gcc/nrf51_xxac.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf51_xxac.ld
diff --git a/components/toolchain/gcc/nrf52840_xxaa.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52840_xxaa.ld
similarity index 100%
rename from components/toolchain/gcc/nrf52840_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52840_xxaa.ld
diff --git a/components/toolchain/gcc/nrf52_common.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52_common.ld
similarity index 100%
rename from components/toolchain/gcc/nrf52_common.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52_common.ld
diff --git a/components/toolchain/gcc/nrf52_xxaa.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52_xxaa.ld
similarity index 100%
rename from components/toolchain/gcc/nrf52_xxaa.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf52_xxaa.ld
diff --git a/components/toolchain/gcc/nrf5x_common.ld b/SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf5x_common.ld
similarity index 100%
rename from components/toolchain/gcc/nrf5x_common.ld
rename to SDK/12.3.0_d7731ad/components/toolchain/gcc/nrf5x_common.ld
diff --git a/components/toolchain/iar/iar_nrf51_blank_xxaa.icf b/SDK/12.3.0_d7731ad/components/toolchain/iar/iar_nrf51_blank_xxaa.icf
similarity index 100%
rename from components/toolchain/iar/iar_nrf51_blank_xxaa.icf
rename to SDK/12.3.0_d7731ad/components/toolchain/iar/iar_nrf51_blank_xxaa.icf
diff --git a/components/toolchain/iar/iar_nrf51_blank_xxac.icf b/SDK/12.3.0_d7731ad/components/toolchain/iar/iar_nrf51_blank_xxac.icf
similarity index 100%
rename from components/toolchain/iar/iar_nrf51_blank_xxac.icf
rename to SDK/12.3.0_d7731ad/components/toolchain/iar/iar_nrf51_blank_xxac.icf
diff --git a/components/toolchain/iar/iar_startup_nrf51.s b/SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf51.s
similarity index 100%
rename from components/toolchain/iar/iar_startup_nrf51.s
rename to SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf51.s
diff --git a/components/toolchain/iar/iar_startup_nrf52.s b/SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf52.s
similarity index 100%
rename from components/toolchain/iar/iar_startup_nrf52.s
rename to SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf52.s
diff --git a/components/toolchain/iar/iar_startup_nrf52840.s b/SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf52840.s
similarity index 100%
rename from components/toolchain/iar/iar_startup_nrf52840.s
rename to SDK/12.3.0_d7731ad/components/toolchain/iar/iar_startup_nrf52840.s
diff --git a/components/toolchain/system_nrf51.c b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf51.c
similarity index 100%
rename from components/toolchain/system_nrf51.c
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf51.c
diff --git a/components/toolchain/system_nrf51.h b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf51.h
similarity index 100%
rename from components/toolchain/system_nrf51.h
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf51.h
diff --git a/components/toolchain/system_nrf51422.c b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf51422.c
similarity index 100%
rename from components/toolchain/system_nrf51422.c
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf51422.c
diff --git a/components/toolchain/system_nrf52.c b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf52.c
similarity index 100%
rename from components/toolchain/system_nrf52.c
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf52.c
diff --git a/components/toolchain/system_nrf52.h b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf52.h
similarity index 100%
rename from components/toolchain/system_nrf52.h
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf52.h
diff --git a/components/toolchain/system_nrf52840.c b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf52840.c
similarity index 100%
rename from components/toolchain/system_nrf52840.c
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf52840.c
diff --git a/components/toolchain/system_nrf52840.h b/SDK/12.3.0_d7731ad/components/toolchain/system_nrf52840.h
similarity index 100%
rename from components/toolchain/system_nrf52840.h
rename to SDK/12.3.0_d7731ad/components/toolchain/system_nrf52840.h
diff --git a/components/drivers_ext/segger_rtt/RTT_Syscalls_GCC.c b/SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_GCC.c
similarity index 100%
rename from components/drivers_ext/segger_rtt/RTT_Syscalls_GCC.c
rename to SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_GCC.c
diff --git a/components/drivers_ext/segger_rtt/RTT_Syscalls_IAR.c b/SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_IAR.c
similarity index 100%
rename from components/drivers_ext/segger_rtt/RTT_Syscalls_IAR.c
rename to SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_IAR.c
diff --git a/components/drivers_ext/segger_rtt/RTT_Syscalls_KEIL.c b/SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_KEIL.c
similarity index 100%
rename from components/drivers_ext/segger_rtt/RTT_Syscalls_KEIL.c
rename to SDK/12.3.0_d7731ad/external/segger_rtt/RTT_Syscalls_KEIL.c
diff --git a/components/drivers_ext/segger_rtt/SEGGER_RTT.c b/SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT.c
similarity index 100%
rename from components/drivers_ext/segger_rtt/SEGGER_RTT.c
rename to SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT.c
diff --git a/components/drivers_ext/segger_rtt/SEGGER_RTT.h b/SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT.h
similarity index 100%
rename from components/drivers_ext/segger_rtt/SEGGER_RTT.h
rename to SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT.h
diff --git a/components/drivers_ext/segger_rtt/SEGGER_RTT_Conf.h b/SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT_Conf.h
similarity index 100%
rename from components/drivers_ext/segger_rtt/SEGGER_RTT_Conf.h
rename to SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT_Conf.h
diff --git a/components/drivers_ext/segger_rtt/SEGGER_RTT_printf.c b/SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT_printf.c
similarity index 100%
rename from components/drivers_ext/segger_rtt/SEGGER_RTT_printf.c
rename to SDK/12.3.0_d7731ad/external/segger_rtt/SEGGER_RTT_printf.c
diff --git a/components/drivers_ext/segger_rtt/license/license.txt b/SDK/12.3.0_d7731ad/external/segger_rtt/license/license.txt
similarity index 100%
rename from components/drivers_ext/segger_rtt/license/license.txt
rename to SDK/12.3.0_d7731ad/external/segger_rtt/license/license.txt
diff --git a/config/sdk_config.h b/SDK/12.3.0_d7731ad/sdk_config.h
similarity index 100%
rename from config/sdk_config.h
rename to SDK/12.3.0_d7731ad/sdk_config.h
diff --git a/components/ant/ant_channel_config/ant_channel_config.c b/components/ant/ant_channel_config/ant_channel_config.c
deleted file mode 100644
index a8116c0..0000000
--- a/components/ant/ant_channel_config/ant_channel_config.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_CHANNEL_CONFIG)
-#include "nrf_error.h"
-#include "ant_channel_config.h"
-#include "ant_interface.h"
-#include "ant_parameters.h"
-
-uint32_t ant_channel_init(ant_channel_config_t const * p_config)
-{
- uint32_t err_code;
- // Set Channel Number.
- err_code = sd_ant_channel_assign(p_config->channel_number,
- p_config->channel_type,
- p_config->network_number,
- p_config->ext_assign);
-
- VERIFY_SUCCESS(err_code);
-
- // Set Channel ID.
- err_code = sd_ant_channel_id_set(p_config->channel_number,
- p_config->device_number,
- p_config->device_type,
- p_config->transmission_type);
-
- VERIFY_SUCCESS(err_code);
-
- // Set Channel RF frequency.
- err_code = sd_ant_channel_radio_freq_set(p_config->channel_number, p_config->rf_freq);
- VERIFY_SUCCESS(err_code);
-
- // Set Channel period.
- if (!(p_config->ext_assign & EXT_PARAM_ALWAYS_SEARCH))
- {
- err_code = sd_ant_channel_period_set(p_config->channel_number, p_config->channel_period);
- }
-
-
-#if ANT_CONFIG_ENCRYPTED_CHANNELS > 0
- VERIFY_SUCCESS(err_code);
-
- err_code = ant_channel_encrypt_config(p_config->channel_type , p_config->channel_number, p_config->p_crypto_settings);
-#endif
-
- return err_code;
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_CHANNEL_CONFIG)
diff --git a/components/ant/ant_channel_config/ant_channel_config.h b/components/ant/ant_channel_config/ant_channel_config.h
deleted file mode 100644
index 9a1f9c5..0000000
--- a/components/ant/ant_channel_config/ant_channel_config.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_CHANNEL_CONFIG_H__
-#define ANT_CHANNEL_CONFIG_H__
-
-/** @file
- *
- * @defgroup ant_channel_config ANT channel configuration
- * @{
- * @ingroup ant_sdk_utils
- * @brief ANT channel configuration module.
- */
-
-#include
-#include "sdk_config.h"
-
-
-#ifndef ANT_CONFIG_ENCRYPTED_CHANNELS
- #error Undefined ANT_CONFIG_ENCRYPTED_CHANNELS. It should be defined in sdk_config.h file.
-#elif ANT_CONFIG_ENCRYPTED_CHANNELS > 0
- #include "ant_encrypt_config.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief ANT channel configuration structure. */
-typedef struct
-{
- uint8_t channel_number; ///< Assigned channel number.
- uint8_t channel_type; ///< Channel type (see Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
- uint8_t ext_assign; ///< Extended assign (see Ext. Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
- uint8_t rf_freq; ///< Radio frequency offset from 2400 MHz (for example, 2466 MHz, rf_freq = 66).
- uint8_t transmission_type; ///< Transmission type.
- uint8_t device_type; ///< Device type.
- uint16_t device_number; ///< Device number.
- uint16_t channel_period; ///< The period in 32 kHz counts.
- uint8_t network_number; ///< Network number denoting the network key.
-
-#if ANT_CONFIG_ENCRYPTED_CHANNELS > 0
- ant_encrypt_channel_settings_t * p_crypto_settings; ///< Pointer to cryptographic settings, NULL if this configuration have to be omitted.
-#endif
-
-} ant_channel_config_t;
-
-/**@brief Function for configuring the ANT channel.
- *
- * @param[in] p_config Pointer to the channel configuration structure.
- *
- * @retval NRF_SUCCESS If the channel was successfully configured. Otherwise, an error code is returned.
- */
-uint32_t ant_channel_init(ant_channel_config_t const * p_config);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_CHANNEL_CONFIG_H__
-/** @} */
diff --git a/components/ant/ant_encryption/ant_encrypt_config.c b/components/ant/ant_encryption/ant_encrypt_config.c
deleted file mode 100644
index 498c81e..0000000
--- a/components/ant/ant_encryption/ant_encrypt_config.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_ENCRYPT_CONFIG)
-#include
-#include "ant_encrypt_config.h"
-#include "ant_interface.h"
-#include "ant_parameters.h"
-
-#ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- #include "ant_encrypt_negotiation_slave.h"
-#endif
-
- /*lint -e551 -save*/
-/** Flag for checking if stack was configured for encryption. */
-static bool m_stack_encryption_configured = false;
- /*lint -restore */
-
- /** Pointer to handler of module's events. */
-static ant_encryp_user_handler_t m_ant_enc_evt_handler = NULL;
-
-static ret_code_t ant_enc_advance_burs_config_apply(
- ant_encrypt_adv_burst_settings_t const * const p_adv_burst_set);
-
-ret_code_t ant_stack_encryption_config(ant_encrypt_stack_settings_t const * const p_crypto_set)
-{
- ret_code_t err_code;
-
- for ( uint32_t i = 0; i < p_crypto_set->key_number; i++)
- {
- err_code = sd_ant_crypto_key_set(i, p_crypto_set->pp_key[i]);
- VERIFY_SUCCESS(err_code);
- }
-
- if (p_crypto_set->p_adv_burst_config != NULL)
- {
- err_code = ant_enc_advance_burs_config_apply(p_crypto_set->p_adv_burst_config);
- VERIFY_SUCCESS(err_code);
- }
-
- // subcomands LUT for @ref sd_ant_crypto_info_set calls
- const uint8_t set_enc_info_param_lut[] =
- {
- ENCRYPTION_INFO_SET_CRYPTO_ID,
- ENCRYPTION_INFO_SET_CUSTOM_USER_DATA,
- ENCRYPTION_INFO_SET_RNG_SEED
- };
-
- for ( uint32_t i = 0; i < sizeof(set_enc_info_param_lut); i++)
- {
- if ( p_crypto_set->info.pp_array[i] != NULL)
- {
- err_code = sd_ant_crypto_info_set(set_enc_info_param_lut[i],
- p_crypto_set->info.pp_array[i]);
-
- VERIFY_SUCCESS(err_code);
- }
- }
-
- #ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- // all ANT channels have unsupported slave encryption tracking (even master's channel)
- ant_channel_encryp_negotiation_slave_init();
- #endif
-
- m_ant_enc_evt_handler = NULL;
-
- m_stack_encryption_configured = true;
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for configuring advanced burst settings according to encryption requirements.
- *
- * @param p_adv_burst_set Pointer to ANT advanced burst settings.
- *
- * @retval Value returned by @ref sd_ant_adv_burst_config_set.
- */
-static ret_code_t ant_enc_advance_burs_config_apply(
- ant_encrypt_adv_burst_settings_t const * const p_adv_burst_set)
-{
- uint8_t adv_burst_conf_str[ADV_BURST_CFG_MIN_SIZE] =
- { ADV_BURST_MODE_ENABLE, 0, 0, 0, 0, 0, 0, 0 };
-
- adv_burst_conf_str[ADV_BURST_CFG_PACKET_SIZE_INDEX] = p_adv_burst_set->packet_length;
- adv_burst_conf_str[ADV_BURST_CFG_REQUIRED_FEATURES] = p_adv_burst_set->required_feature;
- adv_burst_conf_str[ADV_BURST_CFG_OPTIONAL_FEATURES] = p_adv_burst_set->optional_feature;
-
- return sd_ant_adv_burst_config_set(adv_burst_conf_str, sizeof(adv_burst_conf_str));
-}
-
-
-ret_code_t ant_channel_encrypt_config_perform(uint8_t channel_number,
- ant_encrypt_channel_settings_t * p_crypto_config)
-{
- return sd_ant_crypto_channel_enable(channel_number,
- p_crypto_config->mode,
- p_crypto_config->key_index,
- p_crypto_config->decimation_rate);
-}
-
-
-ret_code_t ant_channel_encrypt_config(uint8_t channel_type,
- uint8_t channel_number,
- ant_encrypt_channel_settings_t * p_crypto_config)
-{
- ret_code_t err_code;
-
- if (p_crypto_config != NULL)
- {
- // encryption of the stack should be initialized previously
- if (m_stack_encryption_configured == false)
- {
- return NRF_ERROR_MODULE_NOT_INITIALZED;
- }
-
- switch (channel_type)
- {
- case CHANNEL_TYPE_MASTER:
- err_code = ant_channel_encrypt_config_perform(channel_number, p_crypto_config);
-#ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- ant_channel_encryp_tracking_state_set(channel_number,
- ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED);
-#endif
- break;
-
-#ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- case CHANNEL_TYPE_SLAVE:
- ant_slave_channel_encrypt_config(channel_number, p_crypto_config);
-
- if (p_crypto_config->mode == ENCRYPTION_DISABLED_MODE)
- {
- err_code = ant_channel_encrypt_config_perform(channel_number, p_crypto_config);
- ant_channel_encryp_tracking_state_set(channel_number,
- ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED);
- }
- else
- {
- ant_channel_encryp_tracking_state_set(channel_number,
- ANT_ENC_CHANNEL_STAT_NOT_TRACKING);
- err_code = NRF_SUCCESS;
- }
- break;
-#endif
-
- default:
- err_code = NRF_ERROR_INVALID_PARAM;
- break;
- }
- }
- else
- {
-#ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- ant_channel_encryp_tracking_state_set(channel_number,
- ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED);
-#endif
- err_code = NRF_SUCCESS;
- }
-
- return err_code;
-}
-
-/** @brief Function for calling the handler of module events.*/
-static void ant_encrypt_user_handler_try_to_run(uint8_t ant_channel, ant_encrypt_user_evt_t event)
-{
- if (m_ant_enc_evt_handler != NULL)
- {
- m_ant_enc_evt_handler(ant_channel, event);
- }
-}
-
-void ant_encrypt_event_handler(ant_evt_t * p_ant_evt)
-{
- uint8_t const ant_channel = p_ant_evt->channel;
-
-#ifdef ANT_ENCRYPT_NEGOTIATION_SLAVE_ENABLED
- ant_slave_encrypt_negotiation(p_ant_evt);
-#endif
-
- switch (p_ant_evt->event)
- {
- case EVENT_RX_FAIL_GO_TO_SEARCH:
- ant_encrypt_user_handler_try_to_run(ant_channel, ANT_ENC_EVT_CHANNEL_LOST);
- break;
-
- case EVENT_ENCRYPT_NEGOTIATION_SUCCESS:
- ant_encrypt_user_handler_try_to_run(ant_channel, ANT_ENC_EVT_NEGOTIATION_SUCCESS);
- break;
-
- case EVENT_ENCRYPT_NEGOTIATION_FAIL:
- ant_encrypt_user_handler_try_to_run(ant_channel, ANT_ENC_EVT_NEGOTIATION_FAIL);
- break;
- }
-}
-
-void ant_enc_event_handler_register(ant_encryp_user_handler_t user_handler_func)
-{
- m_ant_enc_evt_handler = user_handler_func;
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_ENCRYPT_CONFIG)
diff --git a/components/ant/ant_encryption/ant_encrypt_config.h b/components/ant/ant_encryption/ant_encrypt_config.h
deleted file mode 100644
index 1778cb9..0000000
--- a/components/ant/ant_encryption/ant_encrypt_config.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_ENCRYPT_CONFIG__
-#define ANT_ENCRYPT_CONFIG__
-
-/**@file
- *
- * @defgroup ant_encrypt_config ANT encryption configuration
- * @{
- * @ingroup ant_sdk_utils
- *
- * @brief Encryption configuration for the ANT stack and channels.
- *
- */
-
-#include
-
-#include "sdk_errors.h"
-#include "ant_stack_handler_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @name Advanced burst configuration for encryption modules
- * @{
- */
-#define ADV_BURST_CFG_MIN_SIZE 8 ///< Minimum size of the advance burst configuration data.
-#define ADV_BURST_CFG_PACKET_SIZE_INDEX 1 ///< Index of the packet size field in the configuration data.
-#define ADV_BURST_CFG_REQUIRED_FEATURES 2 ///< Index of the required features field in the configuration data.
-#define ADV_BURST_CFG_OPTIONAL_FEATURES 5 ///< Index of the optional features field in the configuration data.
-/**@} */
-
-/** @brief ANT channel cryptographic configuration. */
-typedef struct
-{
- uint8_t mode; ///< Encryption mode. See the encrypted channel defines in ant_parameters.h.
- uint8_t key_index; ///< Index of encryption key.
- uint8_t decimation_rate; ///< Division of the master channel rate by the slave’s tracking channel rate.
-} ant_encrypt_channel_settings_t;
-
-/** @brief ANT encryption information. */
-typedef union
-{
- uint8_t * pp_array[3]; // For array access support.
- struct
- {
- uint8_t * p_encryption_id; ///< Pointer to the encryption ID of the device (4 bytes).
- uint8_t * p_user_info; ///< Pointer to the user information string (19 bytes).
- uint8_t * p_random_num_seed; ///< Pointer to the random number seed (16 bytes).
- } items;
-} ant_encrypt_info_settings_t;
-
-/** @brief Advanced burst settings used by the encrypted channel. */
-typedef struct
-{
- uint8_t packet_length; ///< RF payload size. See the advanced burst configuration defines in ant_parameters.h.
- uint8_t required_feature; ///< Required advanced burst modes. See the advanced burst configuration defines in ant_parameters.h.
- uint8_t optional_feature; ///< Optional advanced burst modes. See the advanced burst configuration defines in ant_parameters.h.
-} ant_encrypt_adv_burst_settings_t;
-
-/**@brief ANT stack cryptographic configuration. */
-typedef struct
-{
- ant_encrypt_info_settings_t info; ///< Pointer to the encryption information structure.
- uint8_t * * pp_key; ///< Pointer to an array for pointers to encryption keys. Each key must have a length of 16 bytes.
- uint8_t key_number; ///< Number of encryption keys.
- ant_encrypt_adv_burst_settings_t * p_adv_burst_config; ///< Advanced burst configuration. If NULL, the advanced burst must be configured externally.
-} ant_encrypt_stack_settings_t;
-
-/**
- * @brief ANT encryption negotiation events.
- */
-typedef enum
-{
- ANT_ENC_EVT_NEGOTIATION_SUCCESS, ///< Negotiation success.
- ANT_ENC_EVT_NEGOTIATION_FAIL, ///< Negotiation failure.
- ANT_ENC_EVT_CHANNEL_LOST ///< Lost a channel. It's relevant only for slave channels.
-} ant_encrypt_user_evt_t;
-
-/**
- * @brief Event handler for ANT encryption user events.
- */
-typedef void (* ant_encryp_user_handler_t)(uint8_t channel, ant_encrypt_user_evt_t event);
-
-/**
- * @brief Macro for initializing an ANT encryption information structure.
- *
- * @param[in] P_ENC_ID Pointer to the encryption ID of the device (4 bytes).
- * @param[in] P_USER_INFO Pointer to the user information string (19 bytes).
- * @param[in] P_RAND_NUM_SEED Pointer to the random number seed (16 bytes).
- */
-#define ANT_CRYPTO_INFO_SETTINGS_INIT(P_ENC_ID, P_USER_INFO, P_RAND_NUM_SEED) \
- { \
- .items = \
- { \
- .p_encryption_id = P_ENC_ID, \
- .p_user_info = P_USER_INFO, \
- .p_random_num_seed = P_RAND_NUM_SEED \
- } \
- }
-
-/**
- * @brief Macro for declaring the basic cryptographic configuration for the ANT stack.
- *
- * This macro configures the following settings:
- * - Cryptographic key
- * - Encryption ID
- * - Advanced burst mode with the maximum RF payload size
- *
- * Use @ref ANT_ENCRYPT_STACK_SETTINGS_BASE to access the created configuration instance.
- *
- * @param[in] NAME Name for the created data instance.
- * @param[in] P_KEY Pointer to the cryptographic key (16 bytes).
- * @param[in] P_ENC_ID Pointer to the encryption ID (4 bytes).
- */
-#define ANT_ENCRYPT_STACK_SETTINGS_BASE_DEF(NAME, P_KEY, P_ENC_ID) \
- ant_encrypt_adv_burst_settings_t NAME##_ant_enc_adv_burst_set = \
- { \
- .packet_length = ADV_BURST_MODES_MAX_SIZE, \
- .required_feature = 0, \
- .optional_feature = 0 \
- }; \
- uint8_t * pp_##NAME##_key[1] = {P_KEY}; \
- ant_encrypt_stack_settings_t NAME ## _ant_crypto_settings = \
- { \
- .info = ANT_CRYPTO_INFO_SETTINGS_INIT(P_ENC_ID, NULL, NULL), \
- .pp_key = pp_##NAME##_key, \
- .key_number = 1, \
- .p_adv_burst_config = &NAME##_ant_enc_adv_burst_set \
- }
-
-
-/** @brief Macro for accessing the configuration instance created
- * by @ref ANT_ENCRYPT_STACK_SETTINGS_BASE_DEF.
- *
- * @param[in] NAME Name of the settings instance.
- */
-#define ANT_ENCRYPT_STACK_SETTINGS_BASE(NAME) (NAME##_ant_crypto_settings)
-
-/**
- * @brief Function for applying an encryption configuration to a slave channel.
- *
- * This function enables encryption on a channel.
- *
- * This function should be used by the @ref ant_encrypt_negotiation_slave module and this module.
- *
- * @param[in] channel_number ANT channel number.
- * @param[in] p_crypto_config Pointer to the encryption configuration.
- *
- * @return Value returned by @ref sd_ant_crypto_channel_enable (for example, NRF_SUCCESS if
- * the configuration was successful).
- */
-ret_code_t ant_channel_encrypt_config_perform(uint8_t channel_number,
- ant_encrypt_channel_settings_t * p_crypto_config);
-
-/**
- * @brief Function for applying an encryption configuration to a master or slave channel.
- *
- * When called for a master channel, this function enables encryption
- * for that channel. When called for a slave channel, it saves
- * the encryption configuration for future use.
- *
- * This function should be used by the @ref ant_channel_config module.
- *
- * @param[in] channel_type ANT channel type: CHANNEL_TYPE_SLAVE or CHANNEL_TYPE_MASTER.
- * @param[in] channel_num ANT channel number.
- * @param[in] p_crypto_config Pointer to the encryption configuration.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_INVALID_PARAM If the channel type is invalid.
- * @retval NRF_ERROR_MODULE_NOT_INITIALZED If the stack is not configured for encryption.
- * @retval Other Otherwise, the error value returned by the @ref
- * ant_channel_encrypt_config_perform function is returned.
- */
-ret_code_t ant_channel_encrypt_config(uint8_t channel_type,
- uint8_t channel_num,
- ant_encrypt_channel_settings_t * p_crypto_config);
-
-/**
- * @brief Function for configuring the cryptographic settings of the ANT stack.
- *
- * @param[in] p_crypto_info_set Pointer to the settings.
- */
-ret_code_t ant_stack_encryption_config(ant_encrypt_stack_settings_t const * const p_crypto_info_set);
-
-
-/**
- * @brief Function for handling ANT encryption events.
- *
- * This function should be used directly in the ANT event dispatching process.
- * It serves the ANT encryption events to the registered event handler.
- * If @ref ant_encrypt_negotiation_slave is used, this function is required.
- *
- * This function should be used by the @ref ant_encrypt_config module.
- *
- * @param[in] p_ant_evt Pointer to the ANT stack event message structure.
- */
-void ant_encrypt_event_handler(ant_evt_t * p_ant_evt);
-
-/**
- * @brief Function for registering an event handler for ANT encryption events.
- *
- * The event handler should support all of the events in @ref ant_encrypt_user_evt_t.
- *
- * @param[in] p_handler Pointer to a handler function.
- */
-void ant_enc_event_handler_register(ant_encryp_user_handler_t p_handler);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_ENCRYPT_CONFIG__
diff --git a/components/ant/ant_encryption/ant_encrypt_negotiation_slave.c b/components/ant/ant_encryption/ant_encrypt_negotiation_slave.c
deleted file mode 100644
index 12d5199..0000000
--- a/components/ant/ant_encryption/ant_encrypt_negotiation_slave.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_ENCRYPT_NEGOTIATION_SLAVE)
-#include
-#include
-#include "ant_encrypt_config.h"
-#include "ant_interface.h"
-#include "ant_parameters.h"
-#include "nrf_error.h"
-#include "app_error.h"
-
-#include "ant_encrypt_negotiation_slave.h"
-
-/** Number of supported channels. */
-#define NUMBER_OF_CHANNELS (ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED)
-
-/** Flag to block other channels from attempting to enable encryption while
- * another encryption is in the process.
- */
-static volatile bool m_can_enable_crypto = true;
-
-/** Array to keep track of which channels are currently tracking. */
-static ant_encrypt_tracking_state_t m_encrypt_channel_states[NUMBER_OF_CHANNELS];
-
-/** Array for the slave channels' encryption settings. */
-static ant_encrypt_channel_settings_t m_slave_channel_conf[MAX_ANT_CHANNELS];
-
-
-
-void ant_channel_encryp_tracking_state_set(uint8_t channel_number,
- ant_encrypt_tracking_state_t state)
-{
- m_encrypt_channel_states[channel_number] = state;
-}
-
-
-void ant_channel_encryp_negotiation_slave_init(void)
-{
- for (uint32_t channel = 0; channel < NUMBER_OF_CHANNELS; channel++)
- {
- ant_channel_encryp_tracking_state_set(channel, ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED);
- }
-
- m_can_enable_crypto = true;
-}
-
-
-ant_encrypt_tracking_state_t ant_channel_encryp_tracking_state_get(uint8_t channel_number)
-{
- return m_encrypt_channel_states[channel_number];
-}
-
-
-void ant_slave_channel_encrypt_config(uint8_t channel_number,
- ant_encrypt_channel_settings_t const * const p_crypto_config)
-{
- memcpy(&m_slave_channel_conf[channel_number], p_crypto_config,
- sizeof(ant_encrypt_channel_settings_t));
-}
-
-
-/**@brief Function for handling ANT RX channel events.
- *
- * @param[in] p_event_message_buffer The ANT event message buffer.
- */
-static void ant_slave_encrypt_try_enable(uint8_t ant_channel,
- uint8_t ant_message_id)
-{
- uint32_t err_code;
- ant_encrypt_tracking_state_t track_stat;
-
-
- switch (ant_message_id)
- {
- // Broadcast data received.
- case MESG_BROADCAST_DATA_ID:
-
- track_stat = ant_channel_encryp_tracking_state_get(ant_channel);
- // If the encryption has not yet been negotiated for this channel and another channel
- // is not currently trying to enable encryption, enable encryption
- if ((track_stat != ANT_ENC_CHANNEL_STAT_TRACKING_DECRYPTED)
- && (track_stat != ANT_ENC_CHANNEL_STAT_NEGOTIATING)
- && m_can_enable_crypto)
- {
- // Block other channels from trying to enable encryption until this channel
- // is finished
- m_can_enable_crypto = false;
- ant_channel_encryp_tracking_state_set(ant_channel,
- ANT_ENC_CHANNEL_STAT_NEGOTIATING);
-
- // Enable encryption on ant_channel
- err_code =
- ant_channel_encrypt_config_perform(ant_channel,
- &m_slave_channel_conf[ant_channel]);
- APP_ERROR_CHECK(err_code);
- }
- break;
-
- default:
- break;
- }
-}
-
-
-void ant_slave_encrypt_negotiation(ant_evt_t * p_ant_evt)
-{
-
- uint8_t const ant_channel = p_ant_evt->channel;
- ANT_MESSAGE * p_ant_msg;
-
- ant_encrypt_tracking_state_t track_state = ant_channel_encryp_tracking_state_get(ant_channel);
-
- if (track_state == ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED)
- return;
-
- switch (p_ant_evt->event)
- {
- case EVENT_RX_FAIL_GO_TO_SEARCH:
- if (track_state == ANT_ENC_CHANNEL_STAT_NEGOTIATING)
- {
- m_can_enable_crypto = true;
- }
-
- ant_channel_encryp_tracking_state_set(ant_channel, ANT_ENC_CHANNEL_STAT_NOT_TRACKING);
- break;
-
- case EVENT_RX:
- /*lint -e545 -save*/
- p_ant_msg = (ANT_MESSAGE *) &(p_ant_evt->msg.evt_buffer);
- /*lint -restore*/
- ant_slave_encrypt_try_enable(ant_channel, p_ant_msg->ANT_MESSAGE_ucMesgID);
- break;
-
- case EVENT_ENCRYPT_NEGOTIATION_SUCCESS:
- m_can_enable_crypto = true;
- ant_channel_encryp_tracking_state_set(ant_channel,
- ANT_ENC_CHANNEL_STAT_TRACKING_DECRYPTED);
- break;
-
- case EVENT_ENCRYPT_NEGOTIATION_FAIL:
- m_can_enable_crypto = true;
- ant_channel_encryp_tracking_state_set(ant_channel,
- ANT_ENC_CHANNEL_STAT_TRACKING_ENCRYPTED);
- break;
-
- default:
- break;
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_ENCRYPT_NEGOTIATION_SLAVE)
diff --git a/components/ant/ant_encryption/ant_encrypt_negotiation_slave.h b/components/ant/ant_encryption/ant_encrypt_negotiation_slave.h
deleted file mode 100644
index e09962e..0000000
--- a/components/ant/ant_encryption/ant_encrypt_negotiation_slave.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_ENCRYPT_NEGOTIATION_SLAVE_H__
-#define ANT_ENCRYPT_NEGOTIATION_SLAVE_H__
-
-/**@file
- *
- * @defgroup ant_encrypt_negotiation_slave ANT encryption negotiation
- * @{
- * @ingroup ant_sdk_utils
- *
- * @brief Encryption negotiation for encrypted ANT slave channels.
- *
- * After pairing, the slave starts negotiating the encryption with the master. After
- * successful negotiation, the slave can decrypt messages from the master, and all
- * future messages are sent encrypted.
- *
- */
-
-#include
-#include "ant_stack_handler_types.h"
-#include "ant_encrypt_config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Encryption negotiation states for a slave channel. */
-typedef enum
-{
- ANT_ENC_CHANNEL_STAT_NOT_TRACKING, ///< Not tracking the master.
- ANT_ENC_CHANNEL_STAT_TRACKING_ENCRYPTED, ///< Tracking the master, but cannot decrypt messages.
- ANT_ENC_CHANNEL_STAT_NEGOTIATING, ///< Encryption has been enabled and negotiation is in progress.
- ANT_ENC_CHANNEL_STAT_TRACKING_DECRYPTED, ///< Tracking the master and can decrypt messages.
- ANT_ENC_CHANNEL_STAT_TRACKING_UNSUPPORTED ///< Tracking unsupported on this channel.
-} ant_encrypt_tracking_state_t;
-
-
-/**
- * @brief Function for setting the encryption negotiation state of a slave ANT channel.
- *
- * This function should be used by the @ref ant_encrypt_config module.
- *
- * @param[in] channel_number ANT channel number.
- * @param[in] state State to set.
- */
-void ant_channel_encryp_tracking_state_set(uint8_t channel_number,
- ant_encrypt_tracking_state_t state);
-
-/**
- * @brief Function for getting the encryption negotiation state of a slave ANT channel.
- *
- * @param[in] channel_number ANT channel number.
- */
-ant_encrypt_tracking_state_t ant_channel_encryp_tracking_state_get(uint8_t channel_number);
-
-/**
- * @brief Function for initializing the module.
- *
- * This function initializes internal states of the module. It should
- * only be used by the @ref ant_encrypt_config module.
- *
- */
-void ant_channel_encryp_negotiation_slave_init(void);
-
-/**
- * @brief Function for setting the configuration for the slave channel.
- *
- * This function saves the channel's encryption configuration to a lookup table (LUT) for
- * future usage. The configuration can then be used to enable encryption.
- *
- * This function is intended to be used by the @ref ant_encrypt_config module.
- *
- * @param[in] channel_number ANT channel number.
- * @param[in] p_crypto_config Pointer to the encryption configuration.
- */
-void ant_slave_channel_encrypt_config(uint8_t channel_number,
- ant_encrypt_channel_settings_t const * const p_crypto_config);
-
-
-/**
- * @brief Function for handling ANT encryption negotiation on slave nodes.
- *
- * This function should be used directly in the ANT event dispatching process. It
- * tries to enable slave channel encryption for all slave channels that are declared
- * as encrypted channels (if appropriate master channels are found).
- *
- * This function should be used by the @ref ant_encrypt_config module.
- *
- * @param[in] p_ant_evt Pointer to the ANT stack event message structure.
- */
-void ant_slave_encrypt_negotiation(ant_evt_t * p_ant_evt);
-
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_ENCRYPT_NEGOTIATION_SLAVE_H__
diff --git a/components/ant/ant_fs/antfs.c b/components/ant/ant_fs/antfs.c
deleted file mode 100644
index 105ece4..0000000
--- a/components/ant/ant_fs/antfs.c
+++ /dev/null
@@ -1,2381 +0,0 @@
-/**
- * This software is subject to the ANT+ Shared Source License
- * www.thisisant.com/swlicenses
- * Copyright (c) Dynastream Innovations, Inc. 2012
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- * 1) Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * 2) Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * 3) Neither the name of Dynastream nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior
- * written permission.
- *
- * The following actions are prohibited:
- * 1) Redistribution of source code containing the ANT+ Network
- * Key. The ANT+ Network Key is available to ANT+ Adopters.
- * Please refer to http://thisisant.com to become an ANT+
- * Adopter and access the key.
- *
- * 2) Reverse engineering, decompilation, and/or disassembly of
- * software provided in binary form under this license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
- * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
- * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANTFS)
-
-#include "antfs.h"
-#include
-#include "defines.h"
-#include "app_error.h"
-#include "app_timer.h"
-#include "ant_error.h"
-#include "ant_parameters.h"
-#include "ant_interface.h"
-#include "ant_key_manager.h"
-#include "crc.h"
-
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- #include "bsp.h"
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
-
-#define BURST_PACKET_SIZE 8u /**< The burst packet size. */
-
-#define ANTFS_CONNECTION_TYPE_OFFSET 0x00u /**< The connection type offset within ANT-FS message. */
-#define ANTFS_COMMAND_OFFSET 0x01u /**< The command offset within ANT-FS message. */
-#define ANTFS_RESPONSE_OFFSET 0x01u /**< The response offset within ANT-FS message. */
-
-#define ANTFS_CONTROL_OFFSET 0x02u /**< The control offset within ANT-FS message. */
-#define ANTFS_DATA_OFFSET 0x03u /**< The data offset within ANT-FS message. */
-
-#define ANTFS_BEACON_ID 0x43u /**< The ANT-FS beacon ID. */
-#define ANTFS_COMMAND_ID 0x44u /**< The ANT-FS command ID. */
-
-// Beacon definitions.
-#define STATUS1_OFFSET 0x01u /**< The beacon status1 field offset. */
-#define STATUS2_OFFSET 0x02u /**< The beacon status2 field offset. */
- #define DEVICE_STATE_SHIFT 0x00u /**< Shift value for device state bitfield. */
- #define DEVICE_STATE_MASK (0x0Fu << DEVICE_STATE_SHIFT) /**< Device state bitmask. */
- #define DEVICE_STATE_LINK (0x00u << DEVICE_STATE_SHIFT) /**< Device is in link state. */
- #define DEVICE_STATE_AUTHENTICATE (0x01u << DEVICE_STATE_SHIFT) /**< Device is in authenticate state. */
- #define DEVICE_STATE_TRANSPORT (0x02u << DEVICE_STATE_SHIFT) /**< Device is in transport state. */
- #define DEVICE_STATE_BUSY (0x03u << DEVICE_STATE_SHIFT) /**< Device is in busy state. */
-
-#define DEVICE_DESCRIPTOR_OFFSET_0 0x04u /**< Beacon ANT-FS device descriptor LSB position. */
-#define DEVICE_DESCRIPTOR_OFFSET_1 0x05u /**< Beacon ANT-FS device descriptor LSB + 1 position. */
-#define DEVICE_DESCRIPTOR_OFFSET_2 0x06u /**< Beacon ANT-FS device descriptor LSB + 2 position. */
-#define DEVICE_DESCRIPTOR_OFFSET_3 0x07u /**< Beacon ANT-FS device descriptor MSB position. */
-
-// Commands.
-#define ANTFS_CMD_NONE 0x00u /**< Used to identify that no ANT-FS command is in progress. */
-#define ANTFS_CMD_LINK_ID 0x02u /**< ANT-FS link command ID. */
-#define ANTFS_CMD_DISCONNECT_ID 0x03u /**< ANT-FS disconnect command ID. */
-#define ANTFS_CMD_AUTHENTICATE_ID 0x04u /**< ANT-FS authenticate command ID. */
-#define ANTFS_CMD_PING_ID 0x05u /**< ANT-FS ping command ID. */
-#define ANTFS_CMD_DOWNLOAD_ID 0x09u /**< ANT-FS download request command ID. */
-#define ANTFS_CMD_UPLOAD_REQUEST_ID 0x0Au /**< ANT-FS upload request command ID. */
-#define ANTFS_CMD_ERASE_ID 0x0Bu /**< ANT-FS erase request command ID. */
-#define ANTFS_CMD_UPLOAD_DATA_ID 0x0Cu /**< ANT-FS upload command ID. */
-
-// Responses.
-#define ANTFS_RSP_AUTHENTICATE_ID 0x84u /**< ANT-FS authenticate response command ID. */
-#define ANTFS_RSP_DOWNLOAD_ID 0x89u /**< ANT-FS download request response command ID. */
-#define ANTFS_RSP_UPLOAD_REQ_ID 0x8Au /**< ANT-FS upload request response command ID. */
-#define ANTFS_RSP_ERASE_ID 0x8Bu /**< ANT-FS erase response command ID. */
-#define ANTFS_RSP_UPLOAD_DATA_ID 0x8Cu /**< ANT-FS upload data response command ID. */
-
-// Link command.
-#define TRANSPORT_CHANNEL_FREQUENCY_OFFSET 0x02u /**< Channel frequency field offset within link command. */
-#define TRANSPORT_MESSAGE_PERIOD_OFFSET 0x03u /**< Channel period field offset within link command. */
-#define HOST_ID_OFFSET_0 0x04u /**< Host serial number period field LSB offset within link command. */
-#define HOST_ID_OFFSET_1 0x05u /**< Host serial number period field LSB + 1 offset within link command. */
-#define HOST_ID_OFFSET_2 0x06u /**< Host serial number period field LSB + 2 offset within link command. */
-#define HOST_ID_OFFSET_3 0x07u /**< Host serial number period field MSB offset within link command. */
-
-// Authenticate command.
-#define COMMAND_TYPE_OFFSET 0x02u /**< Command type field offset within authenticate command. */
- #define COMMAND_TYPE_PROCEED 0x00u /**< Command type proceed to transport in the authenticate command. */
- #define COMMAND_TYPE_REQUEST_SERIAL 0x01u /**< Command type request client device serial number in the authenticate command. */
- #define COMMAND_TYPE_REQUEST_PAIR 0x02u /**< Command type request pairing in the authenticate command. */
- #define COMMAND_TYPE_REQUEST_PASSKEY 0x03u /**< Command type request passkey exchange in the authenticate command. */
-
-// Authenticate response.
-#define RESPONSE_TYPE_OFFSET 0x02u /**< Command type field offset within authenticate response command. */
- #define AUTH_RESPONSE_N_A 0x00u /**< Command response type N/A (response for client serial number request). */
- #define AUTH_RESPONSE_ACCEPT 0x01u /**< Command response type accept. */
- #define AUTH_RESPONSE_REJECT 0x02u /**< Command response type reject. */
-
-// Authenticate command/response.
-#define AUTH_STRING_LENGTH_OFFSET 0x03u /**< Authenticate Command/Response authentication string length offset. */
-#define SERIAL_NUMBER_OFFSET_0 0x04u /**< Authenticate Command/Response client/host serial number LSB offset. */
-#define SERIAL_NUMBER_OFFSET_1 0x05u /**< Authenticate Command/Response client/host serial number LSB + 1 offset. */
-#define SERIAL_NUMBER_OFFSET_2 0x06u /**< Authenticate Command/Response client/host serial number LSB + 2 offset. */
-#define SERIAL_NUMBER_OFFSET_3 0x07u /**< Authenticate Command/Response client/host serial number MSB offset. */
-
-// Download/Upload/Erase commands.
-#define INITIAL_REQUEST_OFFSET 0x01u /**< Download/Upload/Erase command initial request command offset. */
-#define DATA_INDEX_OFFSET_LOW 0x02u /**< Download/Upload/Erase command offset index low. */
-#define DATA_INDEX_OFFSET_HIGH 0x03u /**< Download/Upload/Erase command offset index high. */
-
-#define ADDRESS_PARAMETER_OFFSET_0 0x04u /**< Download/Upload command parameter LSB offset. */
-#define ADDRESS_PARAMETER_OFFSET_1 0x05u /**< Download/Upload command parameter LSB + 1 offset. */
-#define ADDRESS_PARAMETER_OFFSET_2 0x06u /**< Download/Upload command parameter LSB + 2 offset. */
-#define ADDRESS_PARAMETER_OFFSET_3 0x07u /**< Download/Upload command parameter MSB offset. */
-#define UPLOAD_CRC_OFFSET_LOW 0x06u /**< Upload data CRC offset low. */
-#define UPLOAD_CRC_OFFSET_HIGH 0x07u /**< Upload data CRC offset high. */
-
-// Authentication type. The highest level of authentication available is included in the beacon.
-#if ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
- #define AUTHENTICATION_TYPE COMMAND_TYPE_REQUEST_PASSKEY /**< Passkey and pairing only mode set as authentication type in beacon. */
-#elif ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
- #define AUTHENTICATION_TYPE COMMAND_TYPE_REQUEST_PAIR /**< Pairing only mode set as authentication type in beacon. */
-#elif ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED
- #define AUTHENTICATION_TYPE COMMAND_TYPE_PROCEED /**< Pass-through mode set as authentication type in beacon. */
-#else
- #error "No valid auth type defined"
-#endif
-
-#define AUTHENTICATION_RETRIES 0x05u /**< Max number of retries for authentication responses */
-
-#define ANTFS_EVENT_QUEUE_SIZE 0x04u /**< ANT-FS event queue size. */
-#define SAVE_DISTANCE 256u /**< Save distance required because of nRF buffer to line up data offset on retry. */
-
-// Buffer Indices.
-#define BUFFER_INDEX_MESG_SIZE 0x00u /**< ANT message buffer index length offset. */
-#define BUFFER_INDEX_MESG_ID 0x01u /**< ANT message buffer index ID offset. */
-#define BUFFER_INDEX_CHANNEL_NUM 0x02u /**< ANT message buffer index channel number offset. */
-#define BUFFER_INDEX_MESG_DATA 0x03u /**< ANT message buffer index begin of data offset. */
-#define BUFFER_INDEX_RESPONSE_CODE 0x04u /**< ANT message buffer index response code offset. */
-
-typedef struct
-{
- char friendly_name[ANTFS_FRIENDLY_NAME_MAX]; /**< Friendly Name. */
- bool is_name_set; /**< Is the name set. */
- uint32_t index; /**< Current index (for reading the friendly name). */
- uint32_t friendly_name_size; /**< Friendly name size. */
-} friendly_name_t;
-
-typedef union
-{
- antfs_link_substate_t link_sub_state; /**< Sub-state (Link layer). */
- antfs_authenticate_substate_t auth_sub_state; /**< Sub-state (Authentication layer). */
- antfs_transport_substate_t trans_sub_state; /**< Sub-state (Transport layer). */
-} antfs_substate_t;
-
-typedef struct
-{
- antfs_state_t state; /**< ANT-FS state. */
- antfs_substate_t sub_state; /**< ANT-FS sub-state. */
-} antfs_states_t;
-
-typedef struct
-{
- antfs_event_return_t * p_queue; /**< ANT-FS event queue. */
- uint32_t head; /**< ANT-FS event queue head index. */
- uint32_t tail; /**< ANT-FS event queue tail index. */
-} antfs_event_queue_t;
-
-static antfs_params_t m_initial_parameters; /**< Initial parameters. */
-static antfs_beacon_status_byte1_t m_active_beacon_status1_field; /**< Status 1 field in beacon. */
-static uint32_t m_active_beacon_frequency; /**< Active beacon frequency. */
-static antfs_states_t m_current_state; /**< Current state. */
-static friendly_name_t m_friendly_name; /**< Host's friendly name. */
-static ulong_union_t m_link_host_serial_number; /**< Host's serial number. */
-static uint32_t m_link_command_in_progress; /**< ANT-FS command in progress. */
-static uint32_t m_authenticate_command_type; /**< Authenticate command type in progress. */
-static volatile uint8_t m_burst_wait; /**< Polling status flag for data unlock on burst handler input. */
-static uint8_t m_retry; /**< Retry counter */
-APP_TIMER_DEF(m_timer_id); /**< Timer ID used with the timer module. */
-
-#if ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
- static uint32_t m_passkey_index; /**< Current location of Tx block (auth string). */
-#endif // ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
-
-// Download/upload.
-static bool m_is_data_request_pending; /**< Requested data pending. */
-static bool m_is_crc_pending; /**< CRC for data packets pending. */
-static ushort_union_t m_file_index; /**< File index of current upload/download. */
-static ulong_union_t m_file_size; /**< File size of current upload/download (bytes). */
-static ulong_union_t m_max_block_size; /**< Maximum number of bytes expected to be downloaded in a single burst block of data (set by host). */
-static ulong_union_t m_link_burst_index; /**< Current location of Tx block (bytes). */
-static ulong_union_t m_bytes_remaining; /**< Total remaining data length (bytes). */
-static ulong_union_t m_max_transfer_index; /**< Upper limit of the current Tx burst block (bytes). */
-static uint32_t m_bytes_to_write; /**< Number of bytes to write to file (upload). */
-static const uint8_t * mp_upload_data; /**< Address of begin of the buffer that holds data received from upload. */
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- static ulong_union_t m_block_size; /**< Number of bytes the client can receive in a single burst. */
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
-
-// CRC verification.
-static uint32_t m_saved_crc_offset; /**< CRC data offset (bytes) saved at last CRC update (save point). */
-static uint32_t m_saved_buffer_crc_offset; /**< Data offset to track how much data has been buffered into nRF */
-static uint32_t m_temp_crc_offset; /**< Temporary CRC data offset used in CRC calculation. */
-static uint16_t m_compared_crc; /**< 16-bit CRC for all data packets in the block (provided by download request). */
-static uint16_t m_transfer_crc; /**< 16-bit CRC for all data packets in the block (calculated by client). */
-static uint16_t m_saved_transfer_crc; /**< 16-bit CRC saved at last CRC update (save point). */
-static uint16_t m_saved_buffer_crc; /**< 16-bit CRC saved at last CRC update (save point) for buffering the nRF */
-
-// ANT-FS event handling.
-static antfs_event_return_t m_event_queue_buffer[ANTFS_EVENT_QUEUE_SIZE]; /**< Event queue storage. */
-static antfs_event_queue_t m_event_queue; /**< Event queue. */
-
-static antfs_burst_wait_handler_t m_burst_wait_handler = NULL; /**< Burst wait handler */
-
-
-const char * antfs_hostname_get(void)
-{
- if (m_friendly_name.is_name_set)
- {
- return (m_friendly_name.friendly_name);
- }
-
- return NULL;
-}
-
-
-/**@brief Function for waiting for the burst transmission request to complete.
- */
-static void wait_burst_request_to_complete(void)
-{
- while (m_burst_wait != 0)
- {
- if (m_burst_wait_handler != NULL)
- {
- m_burst_wait_handler();
- }
- };
-}
-
-
-/**@brief Function for stopping ANT-FS timeout, which is possibly currently running.
- */
-static void timeout_disable(void)
-{
- m_link_command_in_progress = ANTFS_CMD_NONE;
-
- const uint32_t err_code = app_timer_stop(m_timer_id);
- APP_ERROR_CHECK(err_code);
-}
-
-
-/**@brief Function for transmitting a beacon.
- *
- * Transmits a beacon either using a broadcast or burst transmission mode.
- *
- * @param[in] message_type Defines the used transmission mode.
- */
-static void beacon_transmit(uint32_t message_type)
-{
- uint8_t beacon_status_byte2;
-
- // Set beacon status byte 2.
-
- if (m_link_command_in_progress == ANTFS_CMD_NONE)
- {
- switch (m_current_state.state)
- {
- case ANTFS_STATE_AUTH:
- beacon_status_byte2 = DEVICE_STATE_AUTHENTICATE;
- break;
-
- case ANTFS_STATE_TRANS:
- beacon_status_byte2 = DEVICE_STATE_TRANSPORT;
- break;
-
- default:
- beacon_status_byte2 = DEVICE_STATE_LINK;
- break;
- }
- }
- else
- {
- beacon_status_byte2 = DEVICE_STATE_BUSY;
- }
-
- // Set remaining beacon fields.
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- tx_buffer[0] = ANTFS_BEACON_ID;
- tx_buffer[1] = m_active_beacon_status1_field.status;
- tx_buffer[2] = beacon_status_byte2;
- tx_buffer[3] = AUTHENTICATION_TYPE;
-
- if ((m_current_state.state == ANTFS_STATE_AUTH) ||
- (m_current_state.state == ANTFS_STATE_TRANS))
- {
- tx_buffer[4] = m_link_host_serial_number.bytes.byte0;
- tx_buffer[5] = m_link_host_serial_number.bytes.byte1;
- tx_buffer[6] = m_link_host_serial_number.bytes.byte2;
- tx_buffer[7] = m_link_host_serial_number.bytes.byte3;
- }
- else
- {
- tx_buffer[4] = m_initial_parameters.beacon_device_type;
- tx_buffer[5] = (m_initial_parameters.beacon_device_type >> 8u);
- tx_buffer[6] = m_initial_parameters.beacon_device_manufacturing_id;
- tx_buffer[7] = (m_initial_parameters.beacon_device_manufacturing_id >> 8u);
- }
-
- if (message_type == MESG_BROADCAST_DATA_ID)
- {
- if (sd_ant_broadcast_message_tx(ANTFS_CONFIG_CHANNEL_NUMBER, sizeof(tx_buffer), tx_buffer) != NRF_SUCCESS)
- {
- // @note: No implementation needed, as it is a valid and accepted use case for this call
- // to fail. This call can fail if we are in middle of bursting.
- }
- }
- else if (message_type == MESG_BURST_DATA_ID)
- {
- // Send as the first packet of a burst.
- const uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_START);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- // This is the first packet of a burst response, disable command timeout while bursting.
- timeout_disable();
- }
- else
- {
- // This should not happen.
- APP_ERROR_HANDLER(message_type);
- }
-}
-
-
-/**@brief Function for transmitting a authenticate response message.
- *
- * @param[in] response_type Authenticate response code.
- * @param[in] password_length Length of authentication string.
- * @param[in] p_password Authentication string transmitted.
- */
-static void authenticate_response_transmit(uint8_t response_type,
- uint32_t password_length,
- const uint8_t * p_password)
-{
- ulong_union_t serial_number;
-
- serial_number.data = m_initial_parameters.client_serial_number;
-
- // First packet is beacon.
- beacon_transmit(MESG_BURST_DATA_ID);
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- tx_buffer[ANTFS_CONNECTION_TYPE_OFFSET] = ANTFS_COMMAND_ID;
- tx_buffer[ANTFS_RESPONSE_OFFSET] = ANTFS_RSP_AUTHENTICATE_ID;
- tx_buffer[RESPONSE_TYPE_OFFSET] = response_type;
- tx_buffer[AUTH_STRING_LENGTH_OFFSET] = password_length;
- tx_buffer[SERIAL_NUMBER_OFFSET_0] = serial_number.bytes.byte0;
- tx_buffer[SERIAL_NUMBER_OFFSET_1] = serial_number.bytes.byte1;
- tx_buffer[SERIAL_NUMBER_OFFSET_2] = serial_number.bytes.byte2;
- tx_buffer[SERIAL_NUMBER_OFFSET_3] = serial_number.bytes.byte3;
-
- uint32_t err_code;
- if ((m_current_state.state == ANTFS_STATE_AUTH) &&
- (
- (response_type != AUTH_RESPONSE_REJECT) &&
- password_length &&
- (password_length <= ANTFS_AUTH_STRING_MAX)
- )
- )
- {
- // Send second packet (auth response).
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_CONTINUE);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- // Round size to a multiple of 8 bytes.
- uint8_t tx_buffer_authenticate[ANTFS_AUTH_STRING_MAX + 1u];
-
- memset(tx_buffer_authenticate, 0, ANTFS_AUTH_STRING_MAX + 1u);
- memcpy(tx_buffer_authenticate, p_password, password_length);
-
- // Round up total number bytes to a multiple of 8 to be sent to burst handler.
- if (password_length & (BURST_PACKET_SIZE - 1u))
- {
- password_length &= ~(BURST_PACKET_SIZE - 1u);
- password_length += BURST_PACKET_SIZE;
- }
-
- // Send auth string (last packets of the burst).
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- password_length,
- tx_buffer_authenticate,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- m_link_command_in_progress = ANTFS_RSP_AUTHENTICATE_ID;
- }
- else
- {
- // If the authorization is rejected or there is no valid password, the auth response is the
- // last packet.
-
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
- }
-
- // Switch to appropiate state.
- if (response_type == AUTH_RESPONSE_REJECT)
- {
- m_current_state.sub_state.auth_sub_state = ANTFS_AUTH_SUBSTATE_REJECT;
- }
- else if (response_type == AUTH_RESPONSE_ACCEPT)
- {
- m_current_state.sub_state.auth_sub_state = ANTFS_AUTH_SUBSTATE_ACCEPT;
- }
- else
- {
- // No implementation needed.
- }
-}
-
-
-bool antfs_pairing_resp_transmit(bool accept)
-{
-#if ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
- // This function should only be called when ANT-FS is in PAIRING mode.
- if ((m_current_state.state != ANTFS_STATE_AUTH) ||
- (m_current_state.sub_state.auth_sub_state != ANTFS_AUTH_SUBSTATE_PAIR))
- {
- return false;
- }
-
- m_link_command_in_progress = ANTFS_CMD_AUTHENTICATE_ID;
-
- if (accept)
- {
- // Accept request and send passkey if authentication passed.
- authenticate_response_transmit(AUTH_RESPONSE_ACCEPT,
- ANTFS_PASSKEY_SIZE,
- m_initial_parameters.p_pass_key);
- }
- else
- {
- // Reject authentication request.
- authenticate_response_transmit(AUTH_RESPONSE_REJECT, 0, NULL);
- }
-
- return true;
-#else
- return false;
-#endif // ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
-}
-
-
-/**@brief Function for adding an ANT-FS event to the event queue.
- *
- * @param[in] event_code The event to be added.
- */
-static void event_queue_write(antfs_event_t event_code)
-{
- antfs_event_return_t * p_event = NULL;
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- uint32_t err_code;
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
-
- // Check if there is room in the queue for a new event.
- if (((m_event_queue.head + 1u) & (ANTFS_EVENT_QUEUE_SIZE - 1u)) != m_event_queue.tail)
- {
- p_event = &(m_event_queue.p_queue[m_event_queue.head]);
- }
-
- if (p_event != NULL)
- {
- // Initialize event parameters.
- p_event->event = event_code;
-
- // Set parameters depending on event type.
- switch (event_code)
- {
- case ANTFS_EVENT_ERASE_REQUEST:
- p_event->file_index = m_file_index.data;
- p_event->offset = 0;
- p_event->bytes = 0;
- p_event->crc = 0;
- break;
-
- case ANTFS_EVENT_DOWNLOAD_REQUEST:
- p_event->file_index = m_file_index.data;
- // Requested offset for the download.
- p_event->offset = m_link_burst_index.data;
- p_event->bytes = 0;
- p_event->crc = 0;
- break;
-
- case ANTFS_EVENT_DOWNLOAD_REQUEST_DATA:
- p_event->file_index = m_file_index.data;
- // Current offset.
- p_event->offset = m_link_burst_index.data;
-
- if (m_bytes_remaining.data > (ANTFS_BURST_BLOCK_SIZE * BURST_PACKET_SIZE))
- {
- // If remaining bytes > burst block size then grab one block at a time.
- p_event->bytes = ANTFS_BURST_BLOCK_SIZE * BURST_PACKET_SIZE;
- }
- else
- {
- p_event->bytes = m_bytes_remaining.data;
- }
-
- p_event->crc = 0;
- break;
-
- case ANTFS_EVENT_UPLOAD_REQUEST:
- p_event->file_index = m_file_index.data;
- // Requested offset for the upload.
- p_event->offset = m_link_burst_index.data;
- // Upper limit of the download (offset + remaining bytes).
- p_event->bytes = m_max_transfer_index.data;
- // CRC Seed (from last save point if resuming).
- p_event->crc = m_transfer_crc;
- break;
-
- case ANTFS_EVENT_UPLOAD_DATA:
- p_event->file_index = m_file_index.data;
- // Current offset.
- p_event->offset = m_link_burst_index.data;
- // Current CRC.
- p_event->crc = m_transfer_crc;
- // Number of bytes to write.
- p_event->bytes = m_bytes_to_write;
- // Upload to appication data buffer.
- memcpy(p_event->data, mp_upload_data, m_bytes_to_write);
- break;
-
- case ANTFS_EVENT_PAIRING_REQUEST:
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- err_code = bsp_indication_set(BSP_INDICATE_BONDING);
- APP_ERROR_CHECK(err_code);
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
- break;
-
- default:
- // No parameters need to be set.
-
- p_event->file_index = 0;
- p_event->offset = 0;
- p_event->bytes = 0;
- p_event->crc = 0;
- break;
- }
-
- // Put the event in the queue.
- m_event_queue.head = ((m_event_queue.head + 1u) & (ANTFS_EVENT_QUEUE_SIZE - 1u));
- }
- else
- {
- // No free space left in the queue.
- APP_ERROR_HANDLER(0);
- }
-}
-
-
-/**@brief Function for transmitting download request response message.
- *
- * @param[in] response Download response code.
- */
-static void download_request_response_transmit(uint8_t response)
-{
- // First burst packet is beacon.
- beacon_transmit(MESG_BURST_DATA_ID);
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- // Next send the first part of the download response.
- tx_buffer[0] = ANTFS_COMMAND_ID;
- tx_buffer[1] = ANTFS_RSP_DOWNLOAD_ID;
- tx_buffer[2] = response;
- tx_buffer[3] = 0;
- // Total number of bytes remaining in the data block.
- tx_buffer[4] = m_bytes_remaining.bytes.byte0;
- tx_buffer[5] = m_bytes_remaining.bytes.byte1;
- tx_buffer[6] = m_bytes_remaining.bytes.byte2;
- tx_buffer[7] = m_bytes_remaining.bytes.byte3;
-
- uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_CONTINUE);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- // Second part of the download response.
-
- // The offset the data will start from in this block.
- tx_buffer[0] = m_link_burst_index.bytes.byte0;
- tx_buffer[1] = m_link_burst_index.bytes.byte1;
- tx_buffer[2] = m_link_burst_index.bytes.byte2;
- tx_buffer[3] = m_link_burst_index.bytes.byte3;
- // The file size in the client device.
- tx_buffer[4] = m_file_size.bytes.byte0;
- tx_buffer[5] = m_file_size.bytes.byte1;
- tx_buffer[6] = m_file_size.bytes.byte2;
- tx_buffer[7] = m_file_size.bytes.byte3;
-
- if (response || (m_bytes_remaining.data == 0))
- {
- // If the download was rejected or there is no data to send.
-
- // Set response to end since we're not downloading any data.
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
- }
- else
- {
- // Response will continue (data packets + CRC footer to follow).
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_CONTINUE);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
- }
-
- m_link_command_in_progress = ANTFS_CMD_DOWNLOAD_ID;
-
- if (response == 0)
- {
- // If we are going to download (response OK), enter the downloading substate.
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_DOWNLOADING;
- event_queue_write(ANTFS_EVENT_DOWNLOAD_START);
- }
- else
- {
- // Download rejected.
- event_queue_write(ANTFS_EVENT_DOWNLOAD_FAIL);
- }
-}
-
-
-void antfs_download_req_resp_prepare(uint8_t response,
- const antfs_request_info_t * const p_request_info)
-{
- // This function should only be called after receiving a download request.
- APP_ERROR_CHECK_BOOL((m_current_state.state == ANTFS_STATE_TRANS) &&
- (m_link_command_in_progress == ANTFS_CMD_DOWNLOAD_ID));
-
- if (response == 0)
- {
- // Download request OK.
-
- // File size of the requested download.
- m_file_size.data = p_request_info->file_size.data;
-
- if (m_link_burst_index.data > m_file_size.data)
- {
- // Offset should not exceed file size.
- m_link_burst_index.data = m_file_size.data;
- }
-
- // If the host is not limiting download size or the file size does not exceed the host's
- // download size limit.
- if ((m_max_block_size.data == 0) || (m_file_size.data < m_max_block_size.data))
- {
- // Number of bytes remaining to be downloaded in this block is the file size.
- m_bytes_remaining.data = m_file_size.data;
- }
-
- if ((m_file_size.data - m_link_burst_index.data) < m_bytes_remaining.data)
- {
- // Calculate number of remaining bytes in this block based on the offset.
- m_bytes_remaining.data = m_file_size.data - m_link_burst_index.data;
- }
-
- // If the application is limiting the Tx block size.
- if (m_bytes_remaining.data > p_request_info->max_burst_block_size.data)
- {
- // Number of remaining bytes in this block is the application defined block size.
- m_bytes_remaining.data = p_request_info->max_burst_block_size.data;
- }
-
- // Find upper limit of the burst Tx.
- m_max_transfer_index.data = m_link_burst_index.data + m_bytes_remaining.data;
-
- if (m_saved_crc_offset == ANTFS_MAX_FILE_SIZE)
- {
- // CRC checking was set as invalid. An invalid download was requested, so reject it.
- response = RESPONSE_INVALID_OPERATION;
- }
- }
-
- if ((response != 0) || (m_file_size.data == 0))
- {
- // Send the response right away if the download request was rejected or there is no data to
- // send.
- download_request_response_transmit(response);
- }
- else
- {
- // Proceed to download data.
- if (m_link_burst_index.data != m_saved_crc_offset)
- {
- uint32_t temp;
-
- // If requesting to resume exactly where we left off, we can start from the same block.
- if (m_link_burst_index.data == m_temp_crc_offset)
- {
- // Move last save point to end of last block sent.
- m_saved_crc_offset = m_link_burst_index.data;
- m_saved_transfer_crc = m_transfer_crc;
- }
-
- // To resume the download, request a block of data starting from the last save point.
- // Update the remaining number of bytes per the last save point.
- m_bytes_remaining.data += (m_link_burst_index.data - m_saved_crc_offset);
-
- // Swap the current burst Tx index with the saved CRC index, to make sure we do not
- // start updating the CRC until we get to the requested index.
- temp = m_link_burst_index.data;
- m_link_burst_index.data = m_saved_crc_offset;
- m_saved_crc_offset = temp;
-
- // Set CRC to previous save point, to check the CRC provided by the host.
- m_transfer_crc = m_saved_transfer_crc;
- }
-
- m_temp_crc_offset = m_saved_crc_offset;
-
- m_is_data_request_pending = true;
-
- // Request data from application.
- event_queue_write(ANTFS_EVENT_DOWNLOAD_REQUEST_DATA);
-
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_VERIFY_CRC;
- }
-}
-
-
-uint32_t antfs_input_data_download(uint16_t index,
- uint32_t offset,
- uint32_t num_bytes,
- const uint8_t * const p_message)
-{
- // Verify that this is the requested data.
- APP_ERROR_CHECK_BOOL((offset == m_link_burst_index.data) && (index == m_file_index.data));
-
- // If file offset is greater than the upper limit, this is not data we need.
- APP_ERROR_CHECK_BOOL(offset <= m_max_transfer_index.data);
-
- if ((m_current_state.state == ANTFS_STATE_TRANS) &&
- (
- (m_current_state.sub_state.trans_sub_state == ANTFS_TRANS_SUBSTATE_VERIFY_CRC) ||
- // Only send data if we were processing a download request.
- (m_current_state.sub_state.trans_sub_state == ANTFS_TRANS_SUBSTATE_DOWNLOADING)
- )
- )
- {
- uint32_t block_offset = 0;
-
- if (m_current_state.sub_state.trans_sub_state == ANTFS_TRANS_SUBSTATE_VERIFY_CRC)
- {
- // Make sure download_request_response_transmit defaults to RESPONSE_INVALID_CRC.
- uint32_t response = RESPONSE_MESSAGE_OK;
-
- // Check CRC.
- if (m_link_burst_index.data == m_saved_crc_offset)
- {
- // If indexes match, we can compare CRC directly.
- if (m_transfer_crc != m_compared_crc)
- {
- response = RESPONSE_INVALID_CRC;
- }
- else
- {
- // Set up the save point
- m_temp_crc_offset = m_link_burst_index.data; // Reset save point counter
- m_saved_crc_offset = m_link_burst_index.data;
- m_saved_buffer_crc_offset = m_link_burst_index.data;
-
- // Set up the CRC save points
- m_saved_transfer_crc = m_compared_crc;
- m_saved_buffer_crc = m_compared_crc;
- m_is_crc_pending = true;
- }
- // Start bursting beacon and the download response (3 burst packets).
- download_request_response_transmit(response);
- }
- // If the data is in this block, advance to the requested offset
- else if ((m_link_burst_index.data < m_saved_crc_offset) &&
- ((m_saved_crc_offset - m_link_burst_index.data) < num_bytes))
- {
- // Update the offset within this block for the requested transmission.
- block_offset = m_saved_crc_offset - m_link_burst_index.data;
- // Update the number of bytes that will actually be transmitted.
- num_bytes -= block_offset;
-
- // Update CRC calculation up to requested index.
- m_transfer_crc = crc_crc16_update(m_transfer_crc, p_message, block_offset);
- // Update the remaining number of bytes.
- m_bytes_remaining.data -= block_offset;
-
- // Check CRC
- if (m_transfer_crc != m_compared_crc)
- {
- response = RESPONSE_INVALID_CRC;
- }
- else
- {
- // Move index back to point where transmission will resume.
- m_link_burst_index.data = m_saved_crc_offset;
-
- // Set up the save point
- m_temp_crc_offset = m_link_burst_index.data; // Reset save point counter
- m_saved_buffer_crc_offset = m_link_burst_index.data;
-
- // Set up the CRC save points
- m_saved_transfer_crc = m_compared_crc;
- m_saved_buffer_crc = m_compared_crc;
-
- m_is_crc_pending = true;
- }
- download_request_response_transmit(response);
- }
- // Data index has gone too far and it is not possible to check CRC, fail and let host retry
- else if (m_link_burst_index.data > m_saved_crc_offset)
- {
- response = RESPONSE_INVALID_CRC;
- download_request_response_transmit(response);
- }
- // Keep getting data and recalculate the CRC until the indexes match
- else
- {
- m_is_data_request_pending = false;
-
- // Update the current burst index and bytes remaining
- m_link_burst_index.data += num_bytes;
- m_bytes_remaining.data -= num_bytes;
-
- // Update CRC
- m_transfer_crc = crc_crc16_update(m_transfer_crc, p_message, num_bytes);
-
- // Request more data.
- event_queue_write(ANTFS_EVENT_DOWNLOAD_REQUEST_DATA);
- }
- }
-
- // Append data.
- if (m_current_state.sub_state.trans_sub_state == ANTFS_TRANS_SUBSTATE_DOWNLOADING)
- {
- uint32_t num_of_bytes_to_burst = num_bytes;
-
- if (num_of_bytes_to_burst & (BURST_PACKET_SIZE - 1u))
- {
- // Round up total number bytes to a multiple of BURST_PACKET_SIZE to be sent to
- // burst handler.
- num_of_bytes_to_burst &= ~(BURST_PACKET_SIZE - 1u);
- num_of_bytes_to_burst += BURST_PACKET_SIZE;
- }
-
- uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- num_of_bytes_to_burst,
- (uint8_t*)&(p_message[block_offset]),
- BURST_SEGMENT_CONTINUE);
- if (err_code != NRF_ANT_ERROR_TRANSFER_SEQUENCE_NUMBER_ERROR)
- {
- // If burst failed before we are able to catch it, we will get a TRANSFER_SEQUENCE_NUMBER_ERROR
- // The message processing will send client back to correct state
- APP_ERROR_CHECK(err_code);
- }
-
- wait_burst_request_to_complete();
-
- // Update current burst index.
- m_link_burst_index.data += num_bytes;
- // Update remaining bytes.
- m_bytes_remaining.data -= num_bytes;
-
- m_is_data_request_pending = false;
-
- m_transfer_crc = crc_crc16_update(m_transfer_crc,
- &(p_message[block_offset]),
- num_bytes);
-
- if ((m_link_burst_index.data - m_temp_crc_offset) > SAVE_DISTANCE)
- {
- // Set CRC save point
- m_saved_transfer_crc = m_saved_buffer_crc; // Set CRC at buffer save point (will always be one behind to account for buffering)
- m_saved_buffer_crc = m_transfer_crc; // Set CRC at save point
-
- // Set offset save point
- m_saved_crc_offset = m_saved_buffer_crc_offset; // Set offset at buffer save point (will always be one behind to account for buffering)
- m_saved_buffer_crc_offset = m_link_burst_index.data; // Set buffer offset to current data offset
-
- // Reset save counter offset
- m_temp_crc_offset = m_link_burst_index.data; // Set to current location; next save point will take place after SAVE_DISTANCE bytes
- }
-
- if (!m_is_data_request_pending && (m_link_burst_index.data < m_max_transfer_index.data))
- {
- // If we have not finished the download.
-
- // Request more data.
- event_queue_write(ANTFS_EVENT_DOWNLOAD_REQUEST_DATA);
-
- m_is_data_request_pending = true;
- }
- else if (m_link_burst_index.data >= m_max_transfer_index.data && m_is_crc_pending)
- {
- // We are done, send CRC footer.
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- tx_buffer[0] = 0;
- tx_buffer[1] = 0;
- tx_buffer[2] = 0;
- tx_buffer[3] = 0;
- tx_buffer[4] = 0;
- tx_buffer[5] = 0;
- tx_buffer[6] = (uint8_t)m_transfer_crc;
- tx_buffer[7] = (uint8_t)(m_transfer_crc >> 8u);
-
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- if (err_code != NRF_ANT_ERROR_TRANSFER_SEQUENCE_NUMBER_ERROR)
- {
- // If burst failed before we are able to catch it, we will get a TRANSFER_SEQUENCE_NUMBER_ERROR
- // The message processing will send client back to correct state
- APP_ERROR_CHECK(err_code);
- }
-
- wait_burst_request_to_complete();
-
- m_is_crc_pending = false;
- m_max_transfer_index.data = 0;
- }
-
- // Return the number of bytes we accepted.
- return num_bytes;
- }
- }
-
- // No bytes were accepted.
- return 0;
-}
-
-
-bool antfs_upload_req_resp_transmit(uint8_t response,
- const antfs_request_info_t * const p_request_info)
-{
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- if (m_current_state.state != ANTFS_STATE_TRANS ||
- // Only send the response if we were processing an upload request.
- (m_link_command_in_progress != ANTFS_CMD_UPLOAD_REQUEST_ID))
- {
- return false;
- }
-
- // If the application is sending a response for a different file than requested, the upload
- // will fail.
- if (p_request_info->file_index.data != m_file_index.data)
- {
- event_queue_write(ANTFS_EVENT_UPLOAD_FAIL);
-
- return false;
- }
-
- ulong_union_t max_mem_size;
- // Set maximum number of bytes that can be written to the file.
- max_mem_size.data = p_request_info->max_file_size;
-
- if (p_request_info->max_burst_block_size.data != 0)
- {
- // If the client is limiting the block size set the block size requested by the client.
- m_block_size.data = p_request_info->max_burst_block_size.data;
- }
- else
- {
- // Try to get the entire file in a single block.
- m_block_size.data = max_mem_size.data;
- }
-
- if (response == 0)
- {
- if (m_max_transfer_index.data > max_mem_size.data)
- {
- // Not enough space to write file, reject download.
- response = RESPONSE_MESSAGE_NOT_ENOUGH_SPACE;
- }
- }
-
- // Get last valid CRC and last valid offset.
- m_transfer_crc = p_request_info->file_crc;
- m_link_burst_index.data = p_request_info->file_size.data;
-
- // First packet to transmit is the beacon.
- beacon_transmit(MESG_BURST_DATA_ID);
-
- // Second packet.
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- tx_buffer[0] = ANTFS_COMMAND_ID;
- tx_buffer[1] = ANTFS_RSP_UPLOAD_REQ_ID;
- tx_buffer[2] = response;
- tx_buffer[3] = 0;
- // Last valid data offset written to the file.
- tx_buffer[4] = m_link_burst_index.bytes.byte0;
- tx_buffer[5] = m_link_burst_index.bytes.byte1;
- tx_buffer[6] = m_link_burst_index.bytes.byte2;
- tx_buffer[7] = m_link_burst_index.bytes.byte3;
-
-
- uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_CONTINUE);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- // Third packet.
-
- // Maximum number of bytes that can be written to the file.
- tx_buffer[0] = max_mem_size.bytes.byte0;
- tx_buffer[1] = max_mem_size.bytes.byte1;
- tx_buffer[2] = max_mem_size.bytes.byte2;
- tx_buffer[3] = max_mem_size.bytes.byte3;
- // Maximum upload block size.
- tx_buffer[4] = m_block_size.bytes.byte0;
- tx_buffer[5] = m_block_size.bytes.byte1;
- tx_buffer[6] = m_block_size.bytes.byte2;
- tx_buffer[7] = m_block_size.bytes.byte3;
-
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_CONTINUE);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- // Fourth packet.
-
- tx_buffer[0] = 0;
- tx_buffer[1] = 0;
- tx_buffer[2] = 0;
- tx_buffer[3] = 0;
- tx_buffer[4] = 0;
- tx_buffer[5] = 0;
- // Value of CRC at last data offset.
- tx_buffer[6] = (uint8_t) m_transfer_crc;
- tx_buffer[7] = (uint8_t)(m_transfer_crc >> 8);
-
- err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- m_link_command_in_progress = ANTFS_CMD_UPLOAD_REQUEST_ID;
-
- if (response != 0)
- {
- // Failed upload request. Reset max transfer index to 0 (do not accept any data if the host
- // sends it anyway).
- m_max_transfer_index.data = 0;
- }
- else
- {
- // Wait for upload data request.
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_UPLOAD_WAIT_FOR_DATA;
- }
-
- return true;
-#else
- return false;
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
-}
-
-
-bool antfs_upload_data_resp_transmit(bool data_upload_success)
-{
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- // Should be in TRANSPORT layer to send this response.
- if (m_current_state.state != ANTFS_STATE_TRANS)
- {
- return false;
- }
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- // Response.
- tx_buffer[0] = ANTFS_COMMAND_ID;
- tx_buffer[1] = ANTFS_RSP_UPLOAD_DATA_ID;
- tx_buffer[2] = (data_upload_success) ? RESPONSE_MESSAGE_OK : RESPONSE_MESSAGE_FAIL;
- tx_buffer[3] = 0;
- tx_buffer[4] = 0;
- tx_buffer[5] = 0;
- tx_buffer[6] = 0;
- tx_buffer[7] = 0;
-
- // First packet is beacon.
- beacon_transmit(MESG_BURST_DATA_ID);
-
- // Send last packet.
- uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-
- m_link_command_in_progress = ANTFS_CMD_UPLOAD_REQUEST_ID;
-
- // Reset maximum index.
- m_max_transfer_index.data = 0;
-
- return true;
-#else
- return false;
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
-}
-
-
-void antfs_erase_req_resp_transmit(uint8_t response)
-{
- // This function should only be called after receiving an erase request.
- APP_ERROR_CHECK_BOOL((m_current_state.state == ANTFS_STATE_TRANS) &&
- (m_link_command_in_progress == ANTFS_CMD_ERASE_ID));
-
- beacon_transmit(MESG_BURST_DATA_ID);
-
- uint8_t tx_buffer[BURST_PACKET_SIZE];
-
- // Erase response.
- tx_buffer[0] = ANTFS_COMMAND_ID;
- tx_buffer[1] = ANTFS_RSP_ERASE_ID;
- tx_buffer[2] = response;
- tx_buffer[3] = 0;
- tx_buffer[4] = 0;
- tx_buffer[5] = 0;
- tx_buffer[6] = 0;
- tx_buffer[7] = 0;
-
- uint32_t err_code = sd_ant_burst_handler_request(ANTFS_CONFIG_CHANNEL_NUMBER,
- sizeof(tx_buffer),
- tx_buffer,
- BURST_SEGMENT_END);
- APP_ERROR_CHECK(err_code);
-
- wait_burst_request_to_complete();
-}
-
-
-bool antfs_event_extract(antfs_event_return_t * const p_event)
-{
- bool return_value = false;
-
- if (m_event_queue.head != m_event_queue.tail)
- {
- // Pending events exist. Copy event parameters into return event.
- p_event->event = m_event_queue.p_queue[m_event_queue.tail].event;
- p_event->file_index = m_event_queue.p_queue[m_event_queue.tail].file_index;
- p_event->offset = m_event_queue.p_queue[m_event_queue.tail].offset;
- p_event->bytes = m_event_queue.p_queue[m_event_queue.tail].bytes;
- p_event->crc = m_event_queue.p_queue[m_event_queue.tail].crc;
- memcpy(p_event->data,
- m_event_queue.p_queue[m_event_queue.tail].data,
- sizeof(p_event->data));
-
- // Release the event queue.
- m_event_queue.tail = ((m_event_queue.tail + 1u) & (ANTFS_EVENT_QUEUE_SIZE - 1u));
-
- return_value = true;
- }
-
- return return_value;
-}
-
-
-/**@brief Function for setting the channel period.
- *
- * Sets the channel period. The only allowed frequencies are 0.5, 1, 2, 4 and 8 Hz.
- *
- * @param[in] link_period Link period for the beacon transmission.
- */
-static void channel_period_set(uint32_t link_period)
-{
- uint32_t period;
-
- switch (link_period)
- {
- default:
- // Shouldn't happen, but just in case default to 0,5Hz.
- case BEACON_PERIOD_0_5_HZ:
- period = 65535u;
- break;
-
- case BEACON_PERIOD_1_HZ:
- period = 32768u;
- break;
-
- case BEACON_PERIOD_2_HZ:
- period = 16384u;
- break;
-
- case BEACON_PERIOD_4_HZ:
- period = 8192u;
- break;
-
- case BEACON_PERIOD_8_HZ:
- period = 4096u;
- break;
- }
-
- const uint32_t err_code = sd_ant_channel_period_set(ANTFS_CONFIG_CHANNEL_NUMBER, period);
- APP_ERROR_CHECK(err_code);
-}
-
-
-/**@brief Function for starting ANT-FS timeout.
- *
- * @param[in] timeout_in_secs Timeout requested in unit of seconds.
- */
-static void timeout_start(uint32_t timeout_in_secs)
-{
- uint32_t err_code = app_timer_stop(m_timer_id);
- APP_ERROR_CHECK(err_code);
-
- err_code = app_timer_start(m_timer_id,
- APP_TIMER_TICKS((uint32_t)(timeout_in_secs * 1000u),
- APP_TIMER_PRESCALER),
- NULL);
- APP_ERROR_CHECK(err_code);
-}
-
-
-/**@brief Function for switching to authentication layer.
- */
-static void authenticate_layer_transit(void)
-{
- if (m_current_state.state != ANTFS_STATE_OFF)
- {
- m_current_state.state = ANTFS_STATE_AUTH;
- m_current_state.sub_state.auth_sub_state = ANTFS_AUTH_SUBSTATE_NONE;
- m_link_command_in_progress = ANTFS_CMD_NONE;
-
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
-
- uint32_t err_code = sd_ant_channel_radio_freq_set(ANTFS_CONFIG_CHANNEL_NUMBER, m_active_beacon_frequency);
- APP_ERROR_CHECK(err_code);
-
- event_queue_write(ANTFS_EVENT_AUTH);
- }
-}
-
-
-/**@brief Function for decoding an ANT-FS command received at the link layer.
- *
- * @param[in] p_command_buffer The ANT-FS command buffer.
- */
-static void link_layer_cmd_decode(const uint8_t * p_command_buffer)
-{
- if (p_command_buffer[ANTFS_CONNECTION_TYPE_OFFSET] != ANTFS_COMMAND_ID)
- {
- return;
- }
-
- switch (p_command_buffer[ANTFS_COMMAND_OFFSET])
- {
- case ANTFS_CMD_LINK_ID:
- // Channel frequency.
- m_active_beacon_frequency =
- p_command_buffer[TRANSPORT_CHANNEL_FREQUENCY_OFFSET];
- // Channel message period.
- m_active_beacon_status1_field.parameters.link_period =
- p_command_buffer[TRANSPORT_MESSAGE_PERIOD_OFFSET];
- // Host serial Number.
- m_link_host_serial_number.bytes.byte0 =
- p_command_buffer[HOST_ID_OFFSET_0];
- m_link_host_serial_number.bytes.byte1 =
- p_command_buffer[HOST_ID_OFFSET_1];
- m_link_host_serial_number.bytes.byte2 =
- p_command_buffer[HOST_ID_OFFSET_2];
- m_link_host_serial_number.bytes.byte3 =
- p_command_buffer[HOST_ID_OFFSET_3];
-
- // Move to the channel period issued by the host.
- channel_period_set(m_active_beacon_status1_field.parameters.link_period);
-
- authenticate_layer_transit();
- break;
-
- default:
- break;
- }
-}
-
-
-/**@brief Function for switching to link layer.
- */
-static void link_layer_transit(void)
-{
- if (m_current_state.state != ANTFS_STATE_OFF)
- {
- uint32_t err_code;
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- APP_ERROR_CHECK(err_code);
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
-
- m_current_state.state = ANTFS_STATE_LINK;
- m_current_state.sub_state.link_sub_state = ANTFS_LINK_SUBSTATE_NONE;
- m_link_command_in_progress = ANTFS_CMD_NONE;
- m_active_beacon_status1_field = m_initial_parameters.beacon_status_byte1;
- m_active_beacon_frequency = m_initial_parameters.beacon_frequency;
-
- timeout_disable();
-
- err_code = sd_ant_channel_radio_freq_set(ANTFS_CONFIG_CHANNEL_NUMBER, m_active_beacon_frequency);
- APP_ERROR_CHECK(err_code);
-
- event_queue_write(ANTFS_EVENT_LINK);
- }
-}
-
-
-/**@brief Function for decoding an ANT-FS command received at the authenticate layer.
- *
- * @param[in] control_byte The command control byte.
- * @param[in] p_command_buffer The ANT-FS command buffer.
- */
-static void authenticate_layer_cmd_decode(uint8_t control_byte,
- const uint8_t * p_command_buffer)
-{
- // @note: Response variable must have a static storage allocation as it keeps track of the
- // passkey authentication progress between multiple burst packets.
-#if ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
- static uint32_t response;
-#endif // ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
-
- if ((control_byte & ~SEQUENCE_LAST_MESSAGE) == 0 && m_link_command_in_progress != ANTFS_CMD_NONE)
- {
- // This is something new, and we're busy processing something already, so don't respond
- return;
- }
-
- if (p_command_buffer[ANTFS_CONNECTION_TYPE_OFFSET] == ANTFS_COMMAND_ID &&
- m_link_command_in_progress == ANTFS_CMD_NONE)
- {
- if (p_command_buffer[ANTFS_COMMAND_OFFSET] == ANTFS_CMD_AUTHENTICATE_ID)
- {
- // Make sure it is the correct host
- if (m_link_host_serial_number.bytes.byte0 != p_command_buffer[HOST_ID_OFFSET_0] ||
- m_link_host_serial_number.bytes.byte1 != p_command_buffer[HOST_ID_OFFSET_1] ||
- m_link_host_serial_number.bytes.byte2 != p_command_buffer[HOST_ID_OFFSET_2] ||
- m_link_host_serial_number.bytes.byte3 != p_command_buffer[HOST_ID_OFFSET_3])
- return;
-
- m_link_command_in_progress = ANTFS_CMD_AUTHENTICATE_ID;
- m_authenticate_command_type = p_command_buffer[COMMAND_TYPE_OFFSET];
- m_retry = AUTHENTICATION_RETRIES;
- }
- }
-
- if (m_link_command_in_progress == ANTFS_CMD_AUTHENTICATE_ID)
- {
- switch (m_authenticate_command_type)
- {
- case COMMAND_TYPE_REQUEST_SERIAL:
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Don't do anything before the burst completes (last burst message received).
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- authenticate_response_transmit(AUTH_RESPONSE_N_A,
- ANTFS_REMOTE_FRIENDLY_NAME_MAX,
- // Send device friendly name if it exists.
- m_initial_parameters.p_remote_friendly_name);
- }
- break;
-
-#if ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED
- case COMMAND_TYPE_PROCEED:
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Don't do anything before the burst completes (last burst message received).
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- // Proceed directly to transport layer (no authentication required).
- authenticate_response_transmit(AUTH_RESPONSE_ACCEPT, 0, NULL);
- }
- break;
-
-#endif // ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED
-#if ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
- case COMMAND_TYPE_REQUEST_PAIR:
- if ((control_byte & SEQUENCE_NUMBER_ROLLOVER) == 0)
- {
- // First burst packet.
-
- // Friendly name length.
- m_friendly_name.friendly_name_size =
- p_command_buffer[AUTH_STRING_LENGTH_OFFSET];
-
- if (m_friendly_name.friendly_name_size > 0)
- {
- if (m_friendly_name.friendly_name_size > ANTFS_FRIENDLY_NAME_MAX)
- {
- m_friendly_name.friendly_name_size = ANTFS_FRIENDLY_NAME_MAX;
- }
-
- m_friendly_name.index = 0;
- }
- }
- else
- {
- // Next burst packets: read host friendly name.
-
- if (m_friendly_name.index < ANTFS_FRIENDLY_NAME_MAX)
- {
- uint32_t num_of_bytes = ANTFS_FRIENDLY_NAME_MAX - m_friendly_name.index;
- if (num_of_bytes > 8u)
- {
- num_of_bytes = 8u;
- }
- memcpy((uint8_t*)&m_friendly_name.friendly_name[m_friendly_name.index],
- p_command_buffer,
- num_of_bytes);
- m_friendly_name.index += num_of_bytes;
- }
- }
-
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Last burst packet.
-
- timeout_start(ANTFS_CONFIG_PAIRING_TIMEOUT);
- if (m_friendly_name.friendly_name_size > 0)
- {
- m_friendly_name.is_name_set = true;
- }
-
- m_current_state.sub_state.auth_sub_state = ANTFS_AUTH_SUBSTATE_PAIR;
- // If pairing is supported, send request to UI.
- event_queue_write(ANTFS_EVENT_PAIRING_REQUEST);
- }
- break;
-
-#endif // ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
-#if ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
- case COMMAND_TYPE_REQUEST_PASSKEY:
- if ((control_byte & SEQUENCE_NUMBER_ROLLOVER) == 0)
- {
- // First burst packet.
-
- // Passkey length.
- const uint32_t passkey_size = p_command_buffer[AUTH_STRING_LENGTH_OFFSET];
-
- // Default the algorithm to accept.
- response = AUTH_RESPONSE_ACCEPT;
-
- // Check if the passkey length is valid.
- if (passkey_size == ANTFS_PASSKEY_SIZE)
- {
- m_passkey_index = 0;
- }
- else
- {
- // Invalid lenght supplied - the authentication will be rejected.
- response = AUTH_RESPONSE_REJECT;
- }
- }
- else
- {
- // Next burst packets: read host friendly name.
-
- if ((response == AUTH_RESPONSE_ACCEPT) &&
- // Prevent buffer overrun.
- (m_passkey_index != ANTFS_PASSKEY_SIZE))
- {
- // Passkey length was valid and the host supplied key matches so far.
- uint32_t idx = 0;
-
- // Check the current received burst packet for passkey match.
- do
- {
- if (m_initial_parameters.p_pass_key[m_passkey_index++] !=
- p_command_buffer[idx])
- {
- // Reject the authentication request and further processing of
- // passkey matching if a mismatch is found.
- response = AUTH_RESPONSE_REJECT;
- break;
- }
-
- ++idx;
- }
- while (idx < BURST_PACKET_SIZE);
- }
- }
-
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Last burst packet.
-
- if (m_passkey_index < ANTFS_PASSKEY_SIZE)
- {
- // We did not get the complete passkey, reject authentication request.
- response = AUTH_RESPONSE_REJECT;
- }
-
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_current_state.sub_state.auth_sub_state = ANTFS_AUTH_SUBSTATE_PASSKEY;
- authenticate_response_transmit(response, 0, NULL);
- }
- break;
-
-#endif // ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED
- default:
- break;
- }
- }
- else if (p_command_buffer[ANTFS_COMMAND_OFFSET] == ANTFS_CMD_DISCONNECT_ID)
- {
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Don't do anything before the burst completes (last burst message received).
- link_layer_transit();
- }
- }
- else if (p_command_buffer[ANTFS_COMMAND_OFFSET] == ANTFS_CMD_PING_ID)
- {
- // Reset timeout.
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_link_command_in_progress = ANTFS_CMD_NONE;
- }
- else
- {
- // No implementation needed.
- }
-}
-
-
-/**@brief Function for decoding an ANT-FS command received at the transport layer.
- *
- * @param[in] control_byte The command control byte.
- * @param[in] p_command_buffer The ANT-FS command buffer.
- */
-static void transport_layer_cmd_decode(uint8_t control_byte, const uint8_t * p_command_buffer)
-{
- ulong_union_t host_serial_number = {0};
-
- if (p_command_buffer[ANTFS_CONNECTION_TYPE_OFFSET] == ANTFS_COMMAND_ID)
- {
- m_link_command_in_progress = p_command_buffer[ANTFS_COMMAND_OFFSET];
- }
-
- switch (m_link_command_in_progress)
- {
- case ANTFS_CMD_PING_ID:
- // Reset timeout.
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_link_command_in_progress = ANTFS_CMD_NONE;
- break;
-
- case ANTFS_CMD_DISCONNECT_ID:
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Don't do anything before the burst completes (last burst message received).
- link_layer_transit();
- }
- break;
-
- case ANTFS_CMD_ERASE_ID:
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Don't do anything before the burst completes (last burst message received).
-
- // Requested index.
- m_file_index.bytes.low = p_command_buffer[DATA_INDEX_OFFSET_LOW];
- m_file_index.bytes.high = p_command_buffer[DATA_INDEX_OFFSET_HIGH];
-
- // Send erase request to the application.
- event_queue_write(ANTFS_EVENT_ERASE_REQUEST);
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_link_command_in_progress = ANTFS_CMD_ERASE_ID;
- }
- break;
-
- case ANTFS_CMD_DOWNLOAD_ID:
- if (m_current_state.sub_state.trans_sub_state != ANTFS_TRANS_SUBSTATE_NONE)
- {
- // Ignore the command if we are busy.
- break;
- }
-
- if ((control_byte & ~SEQUENCE_LAST_MESSAGE) == 0x00)
- {
- // First burst packet.
-
- if ((m_file_index.bytes.low != p_command_buffer[DATA_INDEX_OFFSET_LOW]) ||
- (m_file_index.bytes.high != p_command_buffer[DATA_INDEX_OFFSET_HIGH]))
- {
- // This is a new index, so we can not check the CRC against the previous saved
- // CRC.
-
- // CRC seed checking is made invalid by setting the last saved offset to the
- // maximum file size.
- m_saved_crc_offset = ANTFS_MAX_FILE_SIZE;
- }
-
- // Requested data file index.
- m_file_index.bytes.low = p_command_buffer[DATA_INDEX_OFFSET_LOW];
- m_file_index.bytes.high = p_command_buffer[DATA_INDEX_OFFSET_HIGH];
-
- // Initialize current position in the TX burst to the requested offset.
- m_link_burst_index.bytes.byte0 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_0];
- m_link_burst_index.bytes.byte1 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_1];
- m_link_burst_index.bytes.byte2 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_2];
- m_link_burst_index.bytes.byte3 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_3];
- }
- else if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Last burst packet (download command should be two packets long).
-
- // Get CRC seed from host.
- m_compared_crc = (uint16_t)p_command_buffer[DATA_INDEX_OFFSET_LOW];
- m_compared_crc |= ((uint16_t)p_command_buffer[DATA_INDEX_OFFSET_HIGH] << 8u);
-
- // Maximum block size allowed by host.
- m_max_block_size.bytes.byte0 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_0];
- m_max_block_size.bytes.byte1 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_1];
- m_max_block_size.bytes.byte2 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_2];
- m_max_block_size.bytes.byte3 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_3];
-
- // Initialize number of remaining bytes for this block to the maximum block size.
- m_bytes_remaining.data = m_max_block_size.data;
-
- if (p_command_buffer[INITIAL_REQUEST_OFFSET])
- {
- // This request is the start of a new transfer.
-
- // Initialize data offset for CRC calculation to the requested data offset.
- m_saved_crc_offset = m_link_burst_index.data;
- m_saved_buffer_crc_offset = m_link_burst_index.data;
-
- // Use CRC seed provided by host for CRC checking of the data.
- m_transfer_crc = m_compared_crc;
- m_saved_transfer_crc = m_compared_crc;
- m_saved_buffer_crc = m_compared_crc;
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_VERIFY_CRC;
- }
- else
- {
- // This is a request to resume a partially completed transfer.
-
- if (m_saved_crc_offset > m_link_burst_index.data)
- {
- // We can not check the received CRC seed as the requested offset is before
- // our last save point.
-
- // Set CRC checking as invalid.
- m_saved_crc_offset = ANTFS_MAX_FILE_SIZE;
- }
- else
- {
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_VERIFY_CRC;
- }
- }
-
- m_is_data_request_pending = false;
-
- // Send download request to the application for further handling.
- event_queue_write(ANTFS_EVENT_DOWNLOAD_REQUEST);
-
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_link_command_in_progress = ANTFS_CMD_DOWNLOAD_ID;
- }
- break;
-
- case ANTFS_CMD_UPLOAD_REQUEST_ID:
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- if ((control_byte & ~SEQUENCE_LAST_MESSAGE) == 0x00)
- {
- // First burst packet.
-
- if ((m_file_index.bytes.low != p_command_buffer[DATA_INDEX_OFFSET_LOW]) ||
- (
- (m_file_index.bytes.high != p_command_buffer[DATA_INDEX_OFFSET_HIGH]) ||
- (m_current_state.sub_state.trans_sub_state == ANTFS_TRANS_SUBSTATE_NONE)
- )
- )
- {
- // If it is a new index or we completed the last upload.
-
- // Get the file index.
- m_file_index.bytes.low = p_command_buffer[DATA_INDEX_OFFSET_LOW];
- m_file_index.bytes.high = p_command_buffer[DATA_INDEX_OFFSET_HIGH];
-
- // As this is a new upload, reset save point to the beginning of the file.
-
- // Set CRC to zero.
- m_saved_crc_offset = 0;
- m_saved_transfer_crc = 0;
- }
-
- // Get the upper limit of upload from request message.
- m_max_transfer_index.bytes.byte0 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_0];
- m_max_transfer_index.bytes.byte1 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_1];
- m_max_transfer_index.bytes.byte2 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_2];
- m_max_transfer_index.bytes.byte3 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_3];
- }
- else if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Last burst (second) packet.
-
- // Get data offset the requested upload will start at.
- m_link_burst_index.bytes.byte0 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_0];
- m_link_burst_index.bytes.byte1 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_1];
- m_link_burst_index.bytes.byte2 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_2];
- m_link_burst_index.bytes.byte3 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_3];
-
- if (m_link_burst_index.data != ANTFS_MAX_FILE_SIZE)
- {
- // If this is a new upload.
-
- // The data offset specified in the upload request will be used.
- m_saved_crc_offset = m_link_burst_index.data;
-
- m_saved_transfer_crc = 0;
- }
-
- m_transfer_crc = m_saved_transfer_crc;
-
- // Send upload request to the application for further handling.
- event_queue_write(ANTFS_EVENT_UPLOAD_REQUEST);
-
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
- m_link_command_in_progress = ANTFS_CMD_UPLOAD_REQUEST_ID;
- }
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
- break;
-
- case ANTFS_CMD_UPLOAD_DATA_ID:
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- if ((control_byte & ~SEQUENCE_LAST_MESSAGE) == 0x00)
- {
- // First burst packet.
-
- if (m_current_state.sub_state.trans_sub_state ==
- ANTFS_TRANS_SUBSTATE_UPLOAD_WAIT_FOR_DATA)
- {
- antfs_event_t event;
-
- // Get CRC Seed from host.
- m_compared_crc = (uint16_t)p_command_buffer[DATA_INDEX_OFFSET_LOW];
- m_compared_crc |= ((uint16_t)p_command_buffer[DATA_INDEX_OFFSET_HIGH] << 8u);
-
- // Set download offset.
- m_link_burst_index.bytes.byte0 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_0];
- m_link_burst_index.bytes.byte1 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_1];
- m_link_burst_index.bytes.byte2 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_2];
- m_link_burst_index.bytes.byte3 = p_command_buffer[ADDRESS_PARAMETER_OFFSET_3];
-
- if ((m_link_burst_index.data + m_block_size.data) < m_max_transfer_index.data)
- {
- // Adjust block size as set by client.
- m_max_transfer_index.data = m_link_burst_index.data + m_block_size.data;
- }
-
- if (m_compared_crc != m_transfer_crc)
- {
- // Check that the request matches the CRC sent on the upload response.
-
- // Do not accept any data.
- m_max_transfer_index.data = 0;
-
- // Failure will be reported when upload is done.
- event = (antfs_event_t)0;
- }
-
- // Set ready to receive a file.
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_UPLOADING;
-
- event = ANTFS_EVENT_UPLOAD_START;
- m_transfer_crc = m_compared_crc;
-
- if (m_link_burst_index.data > m_max_transfer_index.data)
- {
- // If the requested offset is too high.
-
- // Clear the max transfer index, so we'll report fail when the transfer
- // finishes.
- m_max_transfer_index.data = 0;
- // Clear the event because we normally would not send an event at this point
- // in this case.
- event = (antfs_event_t)0;
- }
-
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // If this upload contains no data.
-
- // Leave the upload state.
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_NONE;
-
- // if it was a valid index, report it as a successful upload, otherwise
- // report it as a failure.
- if (event == 0)
- {
- event = ANTFS_EVENT_UPLOAD_FAIL;
- }
- else
- {
- event = ANTFS_EVENT_UPLOAD_COMPLETE;
- }
- }
-
- if (event != 0)
- {
- event_queue_write(event);
- }
- }
- }
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
- break;
-
- case ANTFS_CMD_LINK_ID:
- host_serial_number.bytes.byte0 = p_command_buffer[HOST_ID_OFFSET_0];
- host_serial_number.bytes.byte1 = p_command_buffer[HOST_ID_OFFSET_1];
- host_serial_number.bytes.byte2 = p_command_buffer[HOST_ID_OFFSET_2];
- host_serial_number.bytes.byte3 = p_command_buffer[HOST_ID_OFFSET_3];
-
- if (m_link_host_serial_number.data == host_serial_number.data)
- {
- m_active_beacon_frequency = p_command_buffer[TRANSPORT_CHANNEL_FREQUENCY_OFFSET];
- m_active_beacon_status1_field.parameters.link_period =
- p_command_buffer[TRANSPORT_MESSAGE_PERIOD_OFFSET];
-
- const uint32_t err_code = sd_ant_channel_radio_freq_set(ANTFS_CONFIG_CHANNEL_NUMBER,
- m_active_beacon_frequency);
- APP_ERROR_CHECK(err_code);
-
- channel_period_set(m_active_beacon_status1_field.parameters.link_period);
- }
-
- m_link_command_in_progress = 0;
- break;
-
- default:
- // Don't do anything, this is an invalid message.
- m_link_command_in_progress = 0;
- break;
- }
-}
-
-
-/**@brief Function for handling data upload.
- *
- * @param[in] control_byte The command control byte.
- * @param[in] p_buffer The data buffer.
- */
-static void upload_data_process(uint8_t control_byte, const uint8_t * p_buffer)
-{
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- if (control_byte & SEQUENCE_LAST_MESSAGE)
- {
- // Last burst packet: upload complete.
-
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_NONE;
-
- // CRC for data packets contained in this upload block.
- m_compared_crc = p_buffer[UPLOAD_CRC_OFFSET_LOW ];
- m_compared_crc |= (p_buffer[UPLOAD_CRC_OFFSET_HIGH] << 8u);
-
- if (m_max_transfer_index.data && (m_compared_crc == m_transfer_crc))
- {
- // CRC OK, upload was completed successfully.
- event_queue_write(ANTFS_EVENT_UPLOAD_COMPLETE);
- }
- else
- {
- // CRC mismatch, upload failed.
- event_queue_write(ANTFS_EVENT_UPLOAD_FAIL);
- }
-
- m_max_transfer_index.data = 0;
- }
- else
- {
- // Not the last burst packet: upload not complete.
-
- // Set initial number of bytes to 8 (size of burst packet).
- m_bytes_to_write = BURST_PACKET_SIZE;
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
-
- if (m_link_burst_index.data > m_max_transfer_index.data)
- {
- // We are past the main index, we do not need to write any more data.
- m_bytes_to_write = 0;
- }
- else
- {
- if ((m_bytes_to_write + m_link_burst_index.data) > m_max_transfer_index.data)
- {
- // if we're less than 8 bytes away from the end, adjust the number of bytes to write
- // in this block.
- m_bytes_to_write = m_max_transfer_index.data - m_link_burst_index.data;
- }
- }
-
- if (m_bytes_to_write != 0)
- {
- APP_ERROR_CHECK_BOOL(m_bytes_to_write <= BURST_PACKET_SIZE);
-
- // Store begin of upload data.
- mp_upload_data = p_buffer;
-
- m_transfer_crc = crc_crc16_update(m_transfer_crc, p_buffer, m_bytes_to_write);
-
- // Send data to application.
- event_queue_write(ANTFS_EVENT_UPLOAD_DATA);
-
- // Update current offset.
- m_link_burst_index.data += m_bytes_to_write;
-
- // Store save point.
- m_saved_crc_offset = m_link_burst_index.data;
- m_saved_transfer_crc = m_transfer_crc;
- }
- }
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
-}
-
-
-/**@brief Function for switching to transport layer.
- */
-static void transport_layer_transit(void)
-{
- if (m_current_state.state != ANTFS_STATE_OFF)
- {
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- APP_ERROR_CHECK(err_code);
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
- m_current_state.state = ANTFS_STATE_TRANS;
- m_current_state.sub_state.trans_sub_state = ANTFS_TRANS_SUBSTATE_NONE;
-
- timeout_start(ANTFS_CONFIG_LINK_COMMAND_TIMEOUT);
-
- beacon_transmit(MESG_BROADCAST_DATA_ID);
-
- event_queue_write(ANTFS_EVENT_TRANS);
- }
-}
-
-
-void antfs_message_process(uint8_t * p_message)
-{
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- uint32_t err_code;
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
-
- if (p_message != NULL)
- {
- if ((p_message[BUFFER_INDEX_CHANNEL_NUM] & CHANNEL_NUMBER_MASK) != ANTFS_CONFIG_CHANNEL_NUMBER)
- {
- // Only process messages corresponding to the ANT-FS channel here.
- return;
- }
-
- if ((m_current_state.state == ANTFS_STATE_OFF) &&
- (
- !(
- (p_message[BUFFER_INDEX_MESG_ID] == MESG_RESPONSE_EVENT_ID) &&
- (p_message[BUFFER_INDEX_RESPONSE_CODE] == NO_EVENT)
- )
- )
- )
- {
- return;
- }
-
- switch (p_message[BUFFER_INDEX_MESG_ID])
- {
- case MESG_BROADCAST_DATA_ID:
- // We are not going to process broadcast messages or pass them to the app to handle.
- break;
-
- case MESG_ACKNOWLEDGED_DATA_ID:
- // Mark it as being the last message if it's an ack message.
- p_message[ANTFS_CONTROL_OFFSET] |= SEQUENCE_LAST_MESSAGE;
-
- /* fall-through */
- case MESG_BURST_DATA_ID:
- switch (m_current_state.state)
- {
- case ANTFS_STATE_LINK:
- link_layer_cmd_decode(&p_message[ANTFS_DATA_OFFSET]);
- break;
-
- case ANTFS_STATE_AUTH:
- authenticate_layer_cmd_decode(p_message[ANTFS_CONTROL_OFFSET],
- &p_message[ANTFS_DATA_OFFSET]);
- break;
-
- case ANTFS_STATE_TRANS:
- if (m_current_state.sub_state.trans_sub_state !=
- ANTFS_TRANS_SUBSTATE_UPLOADING)
- {
- transport_layer_cmd_decode(p_message[ANTFS_CONTROL_OFFSET],
- &p_message[ANTFS_DATA_OFFSET]);
- }
- else
- {
- upload_data_process(p_message[ANTFS_CONTROL_OFFSET],
- &p_message[ANTFS_DATA_OFFSET]);
- }
- break;
-
- default:
- // If in any other state or sub-state, do nothing.
- break;
- }
- break;
-
- case MESG_RESPONSE_EVENT_ID:
- // Branch on event ID.
- switch (p_message[BUFFER_INDEX_RESPONSE_CODE])
- {
- case EVENT_TRANSFER_TX_FAILED:
- m_link_command_in_progress = ANTFS_CMD_NONE;
- // Switch into the appropriate state after the failure. Must be ready for
- // the host to do a retry.
- switch (m_current_state.state)
- {
- case ANTFS_STATE_LINK:
- link_layer_transit();
- break;
-
- case ANTFS_STATE_AUTH:
- // Burst failed, retry sending the response
- if (!m_retry)
- {
- authenticate_layer_transit(); // Reload beacon
- }
- else
- {
- if (m_current_state.sub_state.auth_sub_state == ANTFS_AUTH_SUBSTATE_ACCEPT)
- {
- if (m_authenticate_command_type == COMMAND_TYPE_REQUEST_PAIR)
- {
- authenticate_response_transmit(AUTH_RESPONSE_ACCEPT, ANTFS_PASSKEY_SIZE,
- m_initial_parameters.p_pass_key);
- }
- else
- {
- authenticate_response_transmit(AUTH_RESPONSE_ACCEPT, 0, NULL);
- }
- }
- else if (m_current_state.sub_state.auth_sub_state == ANTFS_AUTH_SUBSTATE_REJECT)
- {
- authenticate_response_transmit(AUTH_RESPONSE_REJECT, 0, NULL);
- }
- else if (m_authenticate_command_type == COMMAND_TYPE_REQUEST_SERIAL)
- {
- authenticate_response_transmit(AUTH_RESPONSE_N_A,
- ANTFS_REMOTE_FRIENDLY_NAME_MAX,
- // Send device friendly name if it exists.
- m_initial_parameters.p_remote_friendly_name);
- }
- else
- {
- // No implementation needed
- }
-
- m_retry--;
- }
-
- break;
-
- case ANTFS_STATE_TRANS:
- if (m_current_state.sub_state.trans_sub_state ==
- ANTFS_TRANS_SUBSTATE_DOWNLOADING)
- {
- event_queue_write(ANTFS_EVENT_DOWNLOAD_FAIL);
- }
- transport_layer_transit();
- break;
-
- default:
- // No implementation needed.
- break;
- }
- break;
-
- case EVENT_TRANSFER_RX_FAILED:
- m_link_command_in_progress = ANTFS_CMD_NONE;
-
- if (m_current_state.sub_state.trans_sub_state ==
- ANTFS_TRANS_SUBSTATE_UPLOADING)
- {
- event_queue_write(ANTFS_EVENT_UPLOAD_FAIL);
-
- m_current_state.sub_state.trans_sub_state =
- ANTFS_TRANS_SUBSTATE_UPLOAD_RESUME;
- }
- else
- {
- // No implementation needed
- }
-
- break;
-
- case EVENT_TRANSFER_TX_COMPLETED:
- m_link_command_in_progress = ANTFS_CMD_NONE;
-
- // Switch into appropiate state after successful command.
- switch (m_current_state.state)
- {
- case ANTFS_STATE_AUTH:
- if (m_current_state.sub_state.auth_sub_state ==
- ANTFS_AUTH_SUBSTATE_ACCEPT)
- {
- // We passed authentication, so go to transport state.
- transport_layer_transit();
- }
- else if (m_current_state.sub_state.auth_sub_state ==
- ANTFS_AUTH_SUBSTATE_REJECT)
- {
- // We failed authentication, so go to link state.
- link_layer_transit();
- }
- else
- {
- // Reload beacon.
- authenticate_layer_transit();
- }
- break;
-
- case ANTFS_STATE_TRANS:
- if (m_current_state.sub_state.trans_sub_state ==
- ANTFS_TRANS_SUBSTATE_DOWNLOADING)
- {
- event_queue_write(ANTFS_EVENT_DOWNLOAD_COMPLETE);
- }
- if (m_current_state.sub_state.trans_sub_state !=
- ANTFS_TRANS_SUBSTATE_UPLOAD_WAIT_FOR_DATA)
- {
- transport_layer_transit(); // Reload beacon.
- }
- break;
-
- default:
- link_layer_transit(); // Reload beacon.
- break;
- }
- break;
-
- case EVENT_TX:
-#if ANTFS_CONFIG_DEBUG_LED_ENABLED
- err_code = bsp_indication_set(BSP_INDICATE_SENT_OK);
- APP_ERROR_CHECK(err_code);
-#endif // ANTFS_CONFIG_DEBUG_LED_ENABLED
- // Load beacon.
- beacon_transmit(MESG_BROADCAST_DATA_ID);
- break;
-
- case EVENT_CHANNEL_CLOSED:
- event_queue_write(ANTFS_EVENT_CLOSE_COMPLETE);
- break;
-
- case NO_EVENT:
- // This shouldn't happen... command responses should not occur.
- APP_ERROR_HANDLER(p_message[BUFFER_INDEX_RESPONSE_CODE]);
- break;
-
- default:
- // No implementation needed.
- return;
- }
- break;
-
- default:
- // No implementation needed.
- return;
- }
- }
-}
-
-
-void antfs_channel_setup(void)
-{
- // Start channel configuration.
- uint32_t err_code = ant_fs_key_set(ANTFS_CONFIG_NETWORK_NUMBER);
- APP_ERROR_CHECK(err_code);
-
- err_code = sd_ant_channel_assign(ANTFS_CONFIG_CHANNEL_NUMBER,
- ANTFS_CHANNEL_TYPE,
- ANTFS_CONFIG_NETWORK_NUMBER,
- 0);
- APP_ERROR_CHECK(err_code);
-
- // Use the lower 2 bytes of the ESN for device number.
- uint16_t device_number = (uint16_t)(m_initial_parameters.client_serial_number & 0x0000FFFFu);
- if (device_number == 0)
- {
- // Device number of 0 is not allowed.
- device_number = 2;
- }
-
- err_code = sd_ant_channel_id_set(ANTFS_CONFIG_CHANNEL_NUMBER,
- device_number,
- ANTFS_CONFIG_DEVICE_TYPE,
- ANTFS_CONFIG_TRANS_TYPE);
- APP_ERROR_CHECK(err_code);
-
- // Remain in initialization state until channel is open.
- m_current_state.state = ANTFS_STATE_INIT;
- // @note: Channel frequency is set by function below.
- link_layer_transit();
- m_current_state.state = ANTFS_STATE_INIT;
-
- channel_period_set(m_active_beacon_status1_field.parameters.link_period);
-
- err_code = sd_ant_channel_open(ANTFS_CONFIG_CHANNEL_NUMBER);
- APP_ERROR_CHECK(err_code);
-
- err_code = sd_ant_channel_radio_tx_power_set(ANTFS_CONFIG_CHANNEL_NUMBER,
- ANTFS_CONFIG_TRANSMIT_POWER,
- ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER);
- APP_ERROR_CHECK(err_code);
-
- m_current_state.state = ANTFS_STATE_LINK;
- m_current_state.sub_state.link_sub_state = ANTFS_LINK_SUBSTATE_NONE;
-
- event_queue_write(ANTFS_EVENT_OPEN_COMPLETE);
-
- // Start beacon broadcast.
- beacon_transmit(MESG_BROADCAST_DATA_ID);
-}
-
-
-/**@brief Function for resetting the ANT-FS state machine.
- */
-static void state_machine_reset(void)
-{
- m_current_state.state = ANTFS_STATE_OFF;
- m_link_command_in_progress = ANTFS_CMD_NONE;
-
- timeout_disable();
-
- // Reset the ANT-FS event queue.
- m_event_queue.p_queue = m_event_queue_buffer;
- m_event_queue.head = 0;
- m_event_queue.tail = 0;
-
- // Set as invalid.
- m_authenticate_command_type = 0xFFu;
- m_retry = 0;
-
- m_saved_crc_offset = 0xFFFFFFFFu;
- m_max_transfer_index.data = 0;
- m_is_crc_pending = false;
- m_is_data_request_pending = false;
-
- m_friendly_name.is_name_set = false;
- m_friendly_name.index = 0;
-
- memset(m_friendly_name.friendly_name, 0, ANTFS_FRIENDLY_NAME_MAX);
-}
-
-
-/**@brief Function for ANT-FS timer event.
- *
- * Handles pairing and command timeouts.
- *
- * @param[in] p_context The callback context.
- */
-static void timeout_handle(void * p_context)
-{
- if (m_current_state.state == ANTFS_STATE_OFF)
- {
- return;
- }
-
- if ((m_current_state.state == ANTFS_STATE_AUTH) &&
- // Pairing timeout.
- (m_current_state.sub_state.auth_sub_state == ANTFS_AUTH_SUBSTATE_PAIR))
- {
- // Reject authentication request and send pairing timeout event.
- authenticate_response_transmit(AUTH_RESPONSE_REJECT, 0, NULL);
- event_queue_write(ANTFS_EVENT_PAIRING_TIMEOUT);
- }
-
- // Fall back to link layer when an ANT-FS event times out.
- link_layer_transit();
-}
-
-
-void antfs_init(const antfs_params_t * const p_params,
- antfs_burst_wait_handler_t burst_wait_handler)
-{
- m_initial_parameters = *p_params;
- m_burst_wait_handler = burst_wait_handler;
- m_active_beacon_status1_field = m_initial_parameters.beacon_status_byte1;
-
- uint32_t err_code = app_timer_create(&m_timer_id, APP_TIMER_MODE_SINGLE_SHOT, timeout_handle);
- APP_ERROR_CHECK(err_code);
-
- state_machine_reset();
-
- err_code = sd_ant_burst_handler_wait_flag_enable((uint8_t *)(&m_burst_wait));
- APP_ERROR_CHECK(err_code);
-}
-#endif // NRF_MODULE_ENABLED(ANTFS)
diff --git a/components/ant/ant_fs/antfs.h b/components/ant/ant_fs/antfs.h
deleted file mode 100644
index d9ba893..0000000
--- a/components/ant/ant_fs/antfs.h
+++ /dev/null
@@ -1,397 +0,0 @@
-/**
- * This software is subject to the ANT+ Shared Source License
- * www.thisisant.com/swlicenses
- * Copyright (c) Dynastream Innovations, Inc. 2012
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- * 1) Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * 2) Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * 3) Neither the name of Dynastream nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior
- * written permission.
- *
- * The following actions are prohibited:
- * 1) Redistribution of source code containing the ANT+ Network
- * Key. The ANT+ Network Key is available to ANT+ Adopters.
- * Please refer to http://thisisant.com to become an ANT+
- * Adopter and access the key.
- *
- * 2) Reverse engineering, decompilation, and/or disassembly of
- * software provided in binary form under this license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
- * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
- * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
- *
- */
-
-/**@file
- * @brief The ANT-FS client protocol interface.
- * This file is based on implementation originally made by Dynastream Innovations Inc. - August 2012
- * @defgroup ant_fs ANT-FS client device simulator
- * @{
- * @ingroup ant_sdk_utils
- *
- * @brief The ANT-FS client device simulator.
- *
- * @note The ANT-FS Network Key is available for ANT+ Adopters. Please refer to http://thisisant.com to become an ANT+ Adopter and access the key.
- */
-
-#ifndef ANTFS_H__
-#define ANTFS_H__
-
-#include
-#include
-#include "defines.h"
-#include "sdk_config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANTFS_VERSION_MAJOR 1u /**< Version major number. */
-#define ANTFS_VERSION_MINOR 0 /**< Version minor number. */
-#define ANTFS_VERSION_ITERATION 0 /**< Version iteration. */
-#define ANTFS_VERSION_TYPE 'R' /**< Version type is release. */
-#define ANTFS_VERSION_SPEC '0.AK' /**< Version of the ANT-FS Technology Specification. */
-#define ANTFS_DIR_STRUCT_VERSION 1u /**< Version of the directory file structure. */
-#define ANTFS_VERSION_DATE 20090522u /**< Version date. */
-
-// ANT-FS options.
-#define ANTFS_LINK_FREQ 50u /**< RF Frequency (+2400MHz). */
-#define ANTFS_CHANNEL_TYPE CHANNEL_TYPE_MASTER /**< ANT-FS Client Channel Type. */
-#define ANTFS_AUTH_STRING_MAX 255u /**< Maximum size of authentication strings (passkey/friendly name). */
-#define ANTFS_PASSKEY_SIZE 16u /**< Passkey size. */
-#define ANTFS_FRIENDLY_NAME_MAX 16u /**< Maximum size of friendly name received from host. */
-#define ANTFS_REMOTE_FRIENDLY_NAME_MAX 16u /**< Maximum size of client's friendly name. */
-
-// Beacon definitions.
-#define BEACON_PERIOD_SHIFT 0x00 /**< Shift value for masking out beacon period. */
-#define BEACON_PERIOD_MASK (0x07u << BEACON_PERIOD_SHIFT) /**< Beacon period bitmask. */
-#define BEACON_PERIOD_0_5_HZ (0x00 << BEACON_PERIOD_SHIFT) /**< Value for 0,5Hz beacon period. */
-#define BEACON_PERIOD_1_HZ (0x01u << BEACON_PERIOD_SHIFT) /**< Value for 1Hz beacon period. */
-#define BEACON_PERIOD_2_HZ (0x02u << BEACON_PERIOD_SHIFT) /**< Value for 2Hz beacon period. */
-#define BEACON_PERIOD_4_HZ (0x03u << BEACON_PERIOD_SHIFT) /**< Value for 4Hz beacon period. */
-#define BEACON_PERIOD_8_HZ (0x04u << BEACON_PERIOD_SHIFT) /**< Value for 8Hz beacon period. */
-#define PAIRING_AVAILABLE_FLAG_SHIFT 0x03u /**< Shift value for masking out pairing enabled bit. */
-#define PAIRING_AVAILABLE_FLAG_MASK (0x01u << PAIRING_AVAILABLE_FLAG_SHIFT) /**< Pairing enabled bitmask. */
-#define UPLOAD_ENABLED_FLAG_SHIFT 0x04u /**< Shift value for masking out upload enabled bit. */
-#define UPLOAD_ENABLED_FLAG_MASK (0x01u << UPLOAD_ENABLED_FLAG_SHIFT) /**< Upload enabled bitmask. */
-#define DATA_AVAILABLE_FLAG_SHIFT 0x05u /**< Shift value for masking out data available bit. */
-#define DATA_AVAILABLE_FLAG_MASK (0x01u << DATA_AVAILABLE_FLAG_SHIFT) /**< Data available bitmask. */
-
-#if ANTFS_ENABLED
-// Build the default beacon settings.
-#if ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
- #define ANTFS_PAIRING_BIT PAIRING_AVAILABLE_FLAG_MASK /**< Build pairing enabled default beacon setting. */
-#else
- #define ANTFS_PAIRING_BIT 0x00u /**< Build pairing disabled default beacon setting. */
-#endif // ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED
-#if ANTFS_CONFIG_UPLOAD_ENABLED
- #define ANTFS_UPLOAD_BIT UPLOAD_ENABLED_FLAG_MASK /**< Build upload enabled default beacon setting. */
-#else
- #define ANTFS_UPLOAD_BIT 0x00u /**< Build upload disabled default beacon setting. */
-#endif // ANTFS_CONFIG_UPLOAD_ENABLED
-
-#define ANTFS_DEFAULT_BEACON (ANTFS_CONFIG_BEACON_STATUS_PERIOD | ANTFS_UPLOAD_BIT | ANTFS_PAIRING_BIT | DATA_AVAILABLE_FLAG_MASK) /**< Define the default beacon setting. */
-#endif // ANTFS_ENABLED
-
-// Download/Upload responses.
-#define RESPONSE_MESSAGE_OK 0x00u /**< Download request ok. */
-#define RESPONSE_MESSAGE_NOT_EXIST 0x01u /**< File does not exist. */
-#define RESPONSE_MESSAGE_NOT_AVAILABLE 0x02u /**< File can not be read/written to (download/upload respectively). */
-#define RESPONSE_INVALID_OPERATION 0x04u /**< Request invalid. */
-// Download responses.
-#define RESPONSE_MESSAGE_NOT_READY 0x03u /**< Not ready to download. */
-#define RESPONSE_INVALID_CRC 0x05u /**< CRC incorrect. */
-// Upload responses.
-#define RESPONSE_MESSAGE_NOT_ENOUGH_SPACE 0x03u /**< Not enough space to to complete write. */
-#define RESPONSE_MESSAGE_UPLOAD_NOT_READY 0x05u /**< Not ready to upload */
-// Upload/Erase responses.
-#define RESPONSE_MESSAGE_FAIL 0x01u /**< Data File Index does not exist / Erase failed. */
-
-// Directory general file flags.
-#define ANTFS_DIR_READ_MASK 0x80u /**< Read (can download). */
-#define ANTFS_DIR_WRITE_MASK 0x40u /**< Write (can upload). */
-#define ANTFS_DIR_ERASE_MASK 0x20u /**< Erase (can erase). */
-#define ANTFS_DIR_ARCHIVE_MASK 0x10u /**< Archive (has been downloaded). */
-#define ANTFS_DIR_APPEND_MASK 0x08u /**< Append (can append to file only). */
-
-#define ANTFS_MAX_FILE_SIZE 0xFFFFFFFFu /**< Maximum file size, as specified by directory structure. */
-#define ANTFS_BURST_BLOCK_SIZE 16u /**< Size of each block of burst data that the client attempts to send when it processes a data request event. */
-
-/**@brief ANT-FS beacon status. */
-typedef union
-{
- uint32_t status; /**< Beacon status byte 1. */
-
- struct
- {
- uint32_t link_period : 3; /**< Beacon period (0.5 - 8 Hz). */
- bool is_pairing_enabled : 1; /**< Pairing is enabled/disabled. */
- bool is_upload_enabled : 1; /**< Upload is enabled/disabled. */
- bool is_data_available : 1; /**< Data is available for download / no data available. */
- bool reserved : 2; /**< Reserved. */
- } parameters;
-} antfs_beacon_status_byte1_t;
-
-// ANT-FS states.
-typedef enum
-{
- ANTFS_STATE_OFF, /**< Off state. */
- ANTFS_STATE_INIT, /**< Init state. */
- ANTFS_STATE_LINK, /**< Link state. */
- ANTFS_STATE_AUTH, /**< Authenticate state. */
- ANTFS_STATE_TRANS /**< Transport state. */
-} antfs_state_t;
-
-// ANT-FS link layer substates.
-typedef enum
-{
- ANTFS_LINK_SUBSTATE_NONE /**< None state. */
-} antfs_link_substate_t;
-
-// ANT-FS authenticate layer substates. */
-typedef enum
-{
- ANTFS_AUTH_SUBSTATE_NONE, /**< None state. */
- ANTFS_AUTH_SUBSTATE_PAIR, /**< Pairing state. */
- ANTFS_AUTH_SUBSTATE_PASSKEY, /**< Passkey state. */
- ANTFS_AUTH_SUBSTATE_ACCEPT, /**< Authenticate accept state. */
- ANTFS_AUTH_SUBSTATE_REJECT /**< Authenticate reject state. */
-} antfs_authenticate_substate_t;
-
-// ANT-FS transport layer substates. */
-typedef enum
-{
- ANTFS_TRANS_SUBSTATE_NONE, /**< None state. */
- ANTFS_TRANS_SUBSTATE_VERIFY_CRC, /**< Verify CRC state. */
- ANTFS_TRANS_SUBSTATE_DOWNLOADING, /**< Downloading state. */
- ANTFS_TRANS_SUBSTATE_UPLOAD_WAIT_FOR_DATA, /**< Wait for upload data request state. */
- ANTFS_TRANS_SUBSTATE_UPLOADING, /**< Ready / receiving upload data state. */
- ANTFS_TRANS_SUBSTATE_UPLOAD_RESUME /**< RX failure upon receiving upload data state. */
-} antfs_transport_substate_t;
-
-// ANT-FS Events.
-typedef enum
-{
- ANTFS_EVENT_PAIRING_REQUEST = 0xB0, /**< Pairing request event. */
- ANTFS_EVENT_PAIRING_TIMEOUT = 0xB1, /**< Pairing timeout event. */
- ANTFS_EVENT_OPEN_COMPLETE = 0xB2, /**< Channel setup complete event. */
- ANTFS_EVENT_CLOSE_COMPLETE = 0xB4, /**< Channel closed event. */
- ANTFS_EVENT_LINK = 0xB6, /**< Enter link layer event. */
- ANTFS_EVENT_AUTH = 0xB7, /**< Enter authenticate layer event. */
- ANTFS_EVENT_TRANS = 0xB8, /**< Enter transport layer event. */
- ANTFS_EVENT_DOWNLOAD_REQUEST = 0xB9, /**< Download request event. */
- ANTFS_EVENT_DOWNLOAD_REQUEST_DATA = 0xBA, /**< Download request data event. */
- ANTFS_EVENT_DOWNLOAD_START = 0xBB, /**< Download started event. */
- ANTFS_EVENT_DOWNLOAD_COMPLETE = 0xBC, /**< Download completed event. */
- ANTFS_EVENT_DOWNLOAD_FAIL = 0xBD, /**< Download failed event. */
- ANTFS_EVENT_UPLOAD_REQUEST = 0xBE, /**< Upload request event. */
- ANTFS_EVENT_UPLOAD_DATA = 0xBF, /**< Upload data available for read event. */
- ANTFS_EVENT_UPLOAD_START = 0xC0, /**< Upload begin event. */
- ANTFS_EVENT_UPLOAD_COMPLETE = 0xC1, /**< Upload completed event. */
- ANTFS_EVENT_UPLOAD_FAIL = 0xC2, /**< Upload process failed event. */
- ANTFS_EVENT_ERASE_REQUEST = 0xC3 /**< Erase request event. */
-} antfs_event_t;
-
-/**@brief ANT-FS <-> application event communication object. */
-typedef struct
-{
- antfs_event_t event; /**< ANT-FS event. */
- uint16_t file_index; /**< File index (download/upload/erase). */
- uint32_t offset; /**< Current offset (download/upload). */
- uint32_t bytes; /**< Number of bytes in block (download/upload). */
- uint16_t crc; /**< Current CRC (upload). */
- uint8_t data[8]; /**< Block of data (upload). */
-} antfs_event_return_t;
-
-/**@brief ANT-FS parameters. */
-typedef struct
-{
- uint32_t client_serial_number; /**< Client serial number. */
- uint16_t beacon_device_type; /**< Client device type. */
- uint16_t beacon_device_manufacturing_id; /**< Client manufacturing ID. */
- uint8_t beacon_frequency; /**< Beacon RF Frequency. */
- antfs_beacon_status_byte1_t beacon_status_byte1; /**< Beacon status byte 1. */
- const uint8_t * p_pass_key; /**< Pass Key. */
- const uint8_t * p_remote_friendly_name; /**< Friendly Name. */
-} antfs_params_t;
-
-/**@brief ANT-FS directory header. */
-typedef struct
-{
- uint8_t version; /**< Version of the directory file structure. */
- uint8_t length; /**< Length of each structure, in bytes. */
- uint8_t time_format; /**< Defines how system keeps track of date/time stamps. */
- uint8_t reserved01;
- uint8_t reserved02;
- uint8_t reserved03;
- uint8_t reserved04;
- uint8_t reserved05;
- uint32_t system_time; /**< Number of seconds elapsed since system power up. */
- uint32_t date; /**< Number of seconds elapsed since 00:00 hrs Dec 31, 1989. If system time is unknown, used as counter. */
-} antfs_dir_header_t;
-
-/**@brief ANT-FS directory entry. */
-typedef struct
-{
- uint16_t data_file_index; /**< Data file index. */
- uint8_t file_data_type; /**< File data type. */
- uint8_t user_defined1; /**< Identifier, first byte (structure defined by data type). */
- uint16_t user_defined2; /**< Identifier, last two bytes (structure defined by data type). */
- uint8_t user_flags; /**< File data type specific flags (bits defined by data type). */
- uint8_t general_flags; /**< Bit mapped flags of flag permissions. */
- uint32_t file_size_in_bytes; /**< File size, in bytes. */
- uint32_t date; /**< Number of seconds elapsed since 00:00 hrs Dec 31, 1980, if supported. */
-} antfs_dir_struct_t;
-
-/**@brief ANT-FS download/upload request context. */
-typedef struct
-{
- ulong_union_t file_size; /**< Size of a file to download when reading, or the size of a partially completed upload when writing. */
- uint32_t max_file_size; /**< The maximum size of the file specified, this is the file size when reading, and the maximum allowed file size when writing. */
- ulong_union_t max_burst_block_size; /**< Maximum burst block size. */
- ushort_union_t file_index; /**< File index. */
- uint16_t file_crc; /**< CRC (uploads). */
-} antfs_request_info_t;
-
-/**@brief The burst wait handler can be configured by the application to customize the code that is
- * executed while waiting for the burst busy flag. */
-typedef void(*antfs_burst_wait_handler_t)(void);
-
-/**@brief Function for setting initial ANT-FS configuration parameters.
- *
- * @param[in] p_params The initial ANT-FS configuration parameters.
- * @param[in] burst_wait_handler Burst wait handler.
- */
-void antfs_init(const antfs_params_t * const p_params,
- antfs_burst_wait_handler_t burst_wait_handler);
-
-/**@brief Function for getting host name if received.
- *
- * @return Pointer to host name buffer if a host name was recieved, NULL otherwise.
- */
-const char * antfs_hostname_get(void);
-
-/**@brief Function for transmitting a response to a pairing request issued by ANT-FS host.
- *
- * @param[in] accept The pairing response, true if pairing accepted.
- *
- * @retval true Operation success. Response to a pairing request was transmitted.
- * @retval false Operation failure. Not in pairing mode or pairing not supported by the
- * implementation.
- */
-bool antfs_pairing_resp_transmit(bool accept);
-
-/**@brief Function for doing calculations prior downloading the data to the ANT-FS host.
- *
- * Function does the necessary pre processing calculations, which are required prior downloading the
- * data, and also transmits the download request response right away in case of the download request
- * was rejected or there is no data to send.
- *
- * @param[in] response The download request response code.
- * @param[in] p_request_info ANT-FS request info structure.
- */
-void antfs_download_req_resp_prepare(uint8_t response,
- const antfs_request_info_t * const p_request_info);
-
-/**@brief Function for downloading requested data.
- *
- * @param[in] index Index of the current file downloaded.
- * @param[in] offset Offset specified by client.
- * @param[in] num_bytes Number of bytes requested to be transmitted from the buffer.
- * @param[in] p_message Data buffer to be transmitted.
- *
- * @return Number of data bytes transmitted.
- */
-uint32_t antfs_input_data_download(uint16_t index,
- uint32_t offset,
- uint32_t num_bytes,
- const uint8_t * const p_message);
-
-/**@brief Function for transmitting upload request response to a upload request command by ANT-FS
- * host.
- *
- * @param[in] response The upload response code.
- * @param[in] p_request_info ANT-FS request info structure.
- *
- * @retval true Operation success. Response to upload request command was transmitted.
- * @retval false Operation failure. Upload not supported by the implementation or not in correct
- * state or application is sending a response for a different file
- * than requested.
- */
-bool antfs_upload_req_resp_transmit(uint8_t response,
- const antfs_request_info_t * const p_request_info);
-
-/**@brief Function for transmitting upload data response to a upload data command by ANT-FS host.
- *
- * @param[in] data_upload_success The upload response code, true for success.
- *
- * @retval true Operation success. Response to upload data command was transmitted.
- * @retval false Operation failure. Upload not supported by the implementation or not in correct
- * state.
- */
-bool antfs_upload_data_resp_transmit(bool data_upload_success);
-
-/**@brief Function for transmitting erase response to a erase request.
- *
- * @param[in] response The erase response code.
- */
-void antfs_erase_req_resp_transmit(uint8_t response);
-
-/**@brief Function for extracting possible pending ANT-FS event.
- *
- * @param[out] p_event The output event structure.
- *
- * @retval true Operation success. Pending ANT-FS event available and it was copied to the output
- * event structure.
- * @retval false Operation failure. No pending ANT-FS event available.
- */
-bool antfs_event_extract(antfs_event_return_t * const p_event);
-
-/**@brief Function for processing ANT events and data received from the ANT-FS channel.
- *
- * @param[in] p_message The message buffer containing the message received from the ANT-FS
- * channel.
- */
-void antfs_message_process(uint8_t * p_message);
-
-/**@brief Function for setting up the ANT-FS channel.
- */
-void antfs_channel_setup(void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANTFS_H__
-
-/**
- *@}
- **/
diff --git a/components/ant/ant_fs/crc.c b/components/ant/ant_fs/crc.c
deleted file mode 100644
index 294d7df..0000000
--- a/components/ant/ant_fs/crc.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * This software is subject to the ANT+ Shared Source License
- * www.thisisant.com/swlicenses
- * Copyright (c) Dynastream Innovations, Inc. 2012
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- * 1) Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * 2) Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * 3) Neither the name of Dynastream nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior
- * written permission.
- *
- * The following actions are prohibited:
- * 1) Redistribution of source code containing the ANT+ Network
- * Key. The ANT+ Network Key is available to ANT+ Adopters.
- * Please refer to http://thisisant.com to become an ANT+
- * Adopter and access the key.
- *
- * 2) Reverse engineering, decompilation, and/or disassembly of
- * software provided in binary form under this license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
- * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
- * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
- *
- */
-
-#include "crc.h"
-#include "compiler_abstraction.h"
-
-
-/**@brief Function for updating the current CRC-16 value for a single byte input.
- *
- * @param[in] current_crc The current calculated CRC-16 value.
- * @param[in] byte The input data byte for the computation.
- *
- * @return The updated CRC-16 value, based on the input supplied.
- */
-static __INLINE uint16_t crc16_get(uint16_t current_crc, uint8_t byte)
-{
- static const uint16_t crc16_table[16] =
- {
- 0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,
- 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400
- };
-
- uint16_t temp;
-
- // Compute checksum of lower four bits of a byte.
- temp = crc16_table[current_crc & 0xF];
- current_crc = (current_crc >> 4u) & 0x0FFFu;
- current_crc = current_crc ^ temp ^ crc16_table[byte & 0xF];
-
- // Now compute checksum of upper four bits of a byte.
- temp = crc16_table[current_crc & 0xF];
- current_crc = (current_crc >> 4u) & 0x0FFFu;
- current_crc = current_crc ^ temp ^ crc16_table[(byte >> 4u) & 0xF];
-
- return current_crc;
-}
-
-
-uint16_t crc_crc16_update(uint16_t current_crc, const volatile void * p_data, uint32_t size)
-{
- uint8_t * p_block = (uint8_t *)p_data;
-
- while (size != 0)
- {
- current_crc = crc16_get(current_crc, *p_block);
- p_block++;
- size--;
- }
-
- return current_crc;
-}
diff --git a/components/ant/ant_fs/crc.h b/components/ant/ant_fs/crc.h
deleted file mode 100644
index e97a45f..0000000
--- a/components/ant/ant_fs/crc.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * This software is subject to the ANT+ Shared Source License
- * www.thisisant.com/swlicenses
- * Copyright (c) Dynastream Innovations, Inc. 2012
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- * 1) Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * 2) Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * 3) Neither the name of Dynastream nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior
- * written permission.
- *
- * The following actions are prohibited:
- * 1) Redistribution of source code containing the ANT+ Network
- * Key. The ANT+ Network Key is available to ANT+ Adopters.
- * Please refer to http://thisisant.com to become an ANT+
- * Adopter and access the key.
- *
- * 2) Reverse engineering, decompilation, and/or disassembly of
- * software provided in binary form under this license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
- * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
- * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
- *
- */
-
-/** @file
- * @brief The CRC-16 interface.
- * This file is based on implementation originally made by Dynastream Innovations Inc. - August 2012
- * @defgroup ant_fs_client_main ANT-FS client device simulator
- * @{
- * @ingroup ant_fs
- *
- * @brief The ANT-FS client device simulator.
- *
- */
-
-#ifndef CRC_H__
-#define CRC_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Function for calculating CRC-16 in blocks.
- *
- * Feed each consecutive data block into this function, along with the current value of current_crc
- * as returned by the previous call of this function. The first call of this function should pass
- * the initial value (usually 0) of the crc in current_crc.
-
- * @param[in] current_crc The current calculated CRC-16 value.
- * @param[in] p_data The input data block for computation.
- * @param[in] size The size of the input data block in bytes.
- *
- * @return The updated CRC-16 value, based on the input supplied.
- */
-uint16_t crc_crc16_update(uint16_t current_crc, const volatile void * p_data, uint32_t size);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // CRC_H__
-
-/**
- *@}
- **/
diff --git a/components/ant/ant_fs/defines.h b/components/ant/ant_fs/defines.h
deleted file mode 100644
index a053f22..0000000
--- a/components/ant/ant_fs/defines.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * This software is subject to the ANT+ Shared Source License
- * www.thisisant.com/swlicenses
- * Copyright (c) Dynastream Innovations, Inc. 2012
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- * 1) Redistributions of source code must retain the above
- * copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * 2) Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * 3) Neither the name of Dynastream nor the names of its
- * contributors may be used to endorse or promote products
- * derived from this software without specific prior
- * written permission.
- *
- * The following actions are prohibited:
- * 1) Redistribution of source code containing the ANT+ Network
- * Key. The ANT+ Network Key is available to ANT+ Adopters.
- * Please refer to http://thisisant.com to become an ANT+
- * Adopter and access the key.
- *
- * 2) Reverse engineering, decompilation, and/or disassembly of
- * software provided in binary form under this license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; DAMAGE TO ANY DEVICE, LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE. SOME STATES DO NOT ALLOW
- * THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE
- * ABOVE LIMITATIONS MAY NOT APPLY TO YOU.
- *
- */
-
-/**@file
- * @brief Definitions.
- * This file is based on implementation originally made by Dynastream Innovations Inc. - August 2012
- * @defgroup ant_fs_client_main ANT-FS client device simulator
- * @{
- * @ingroup nrf_ant_fs_client
- *
- * @brief The ANT-FS client device simulator.
- *
- */
-
-#ifndef DEFINES_H__
-#define DEFINES_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MAX_ULONG 0xFFFFFFFFu /**< The Max value for the type. */
-
-/**@brief uint16_t type presentation as an union. */
-typedef union
-{
- uint16_t data; /**< The data content. */
-
- struct
- {
- uint8_t low; /**< The low byte of the data content. */
- uint8_t high; /**< The high byte of the data content. */
- } bytes;
-} ushort_union_t;
-
-/**@brief uint32_t type presentation as an union. */
-typedef union
-{
- uint32_t data; /**< The data content as a single variable. */
- uint8_t data_bytes[sizeof(uint32_t)]; /**< The data content as a byte array. */
-
- struct
- {
- // The least significant byte of the uint32_t in this structure is referenced by byte0.
- uint8_t byte0; /**< Byte 0 of the data content. */
- uint8_t byte1; /**< Byte 1 of the data content. */
- uint8_t byte2; /**< Byte 2 of the data content. */
- uint8_t byte3; /**< Byte 3 of the data content. */
- } bytes;
-} ulong_union_t;
-
-#define APP_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // DEFINES_H__
-
-/**
- *@}
- **/
diff --git a/components/ant/ant_key_manager/ant_key_manager.c b/components/ant/ant_key_manager/ant_key_manager.c
deleted file mode 100644
index 8051286..0000000
--- a/components/ant/ant_key_manager/ant_key_manager.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_KEY_MANAGER)
-#include
-#include "ant_key_manager.h"
-#include "ant_key_manager_config.h"
-#include "ant_interface.h"
-#include "nrf_assert.h"
-
-static uint8_t m_ant_plus_network_key[] = ANT_PLUS_NETWORK_KEY;
-static uint8_t m_ant_fs_network_key[] = ANT_FS_NETWORK_KEY;
-
-uint32_t ant_custom_key_set(uint8_t network_number, uint8_t * network_key)
-{
- ASSERT(network_key != NULL);
- return sd_ant_network_address_set(network_number, network_key);
-}
-
-uint32_t ant_plus_key_set(uint8_t network_number)
-{
- return sd_ant_network_address_set(network_number, m_ant_plus_network_key);
-}
-
-uint32_t ant_fs_key_set(uint8_t network_number)
-{
- return sd_ant_network_address_set(network_number, m_ant_fs_network_key);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_KEY_MANAGER)
diff --git a/components/ant/ant_key_manager/ant_key_manager.h b/components/ant/ant_key_manager/ant_key_manager.h
deleted file mode 100644
index b763425..0000000
--- a/components/ant/ant_key_manager/ant_key_manager.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_KEY_MANAGER_H__
-#define ANT_KEY_MANAGER_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- */
-/**
- * @defgroup ant_key_manager ANT key manager
- * @{
- * @ingroup ant_sdk_utils
- * @brief Module for registering common and custom ANT network keys.
- */
-
-/**@brief Function for registering a custom network key.
- *
- * @param[in] network_number Network key number.
- * @param[in] p_network_key Pointer to the custom ANT network key.
- *
- * @return A SoftDevice error code.
- */
-uint32_t ant_custom_key_set(uint8_t network_number, uint8_t * p_network_key);
-
-/**@brief Function for registering an ANT+ network key.
- *
- * The key must be defined by @ref ANT_PLUS_NETWORK_KEY.
- *
- * @note The ANT+ Network Key is available for ANT+ Adopters. Go to http://thisisant.com
- * to become an ANT+ Adopter and access the key.
- *
- * @param[in] network_number Network key number.
- *
- * @return A SoftDevice error code.
- */
-uint32_t ant_plus_key_set(uint8_t network_number);
-
-/**@brief Function for registering an ANT-FS network key.
- *
- * The key must be defined by @ref ANT_FS_NETWORK_KEY.
- *
- * @note The ANT+ Network Key is available for ANT+ Adopters. Go to http://thisisant.com
- * to become an ANT+ Adopter and access the key.
- *
- * @param[in] network_number Network key number.
- *
- * @return A SoftDevice error code.
- */
-uint32_t ant_fs_key_set(uint8_t network_number);
-
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_KEY_MANAGER_H__
diff --git a/components/ant/ant_key_manager/config/ant_key_manager_config.h b/components/ant/ant_key_manager/config/ant_key_manager_config.h
deleted file mode 100644
index a071aea..0000000
--- a/components/ant/ant_key_manager/config/ant_key_manager_config.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_KEY_MANAGER_CONFIG_H__
-#define ANT_KEY_MANAGER_CONFIG_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup ant_key_manager
- * @{
- */
-
-#ifndef ANT_PLUS_NETWORK_KEY
- #define ANT_PLUS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT+ network key. */
-#endif //ANT_PLUS_NETWORK_KEY
-
-#ifndef ANT_FS_NETWORK_KEY
- #define ANT_FS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT-FS network key. */
-#endif // ANT_FS_NETWORK_KEY
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_KEY_MANAGER_CONFIG_H__
diff --git a/components/ant/ant_profiles/ant_bpwr/ant_bpwr.c b/components/ant/ant_profiles/ant_bpwr/ant_bpwr.c
deleted file mode 100644
index 7ca766e..0000000
--- a/components/ant/ant_profiles/ant_bpwr/ant_bpwr.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include "nrf_assert.h"
-#include "app_error.h"
-#include "ant_interface.h"
-#include "ant_bpwr.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR"
-#if ANT_BPWR_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_INFO_COLOR
-#else // ANT_BPWR_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_LOG_ENABLED
-#include "nrf_log.h"
-
-#define BPWR_CALIB_INT_TIMEOUT ((ANT_CLOCK_FREQUENCY * BPWR_CALIBRATION_TIMOUT_S) / BPWR_MSG_PERIOD) // calibration timeout in ant message period's unit
-
-// for torque sensor Minimum: Interleave every 9th message
-#define BPWR_PAGE_16_INTERVAL 5 // Preferred: Interleave every 5th message
-#define BPWR_PAGE_16_INTERVAL_OFS 2 // Permissible offset
-#define COMMON_PAGE_80_INTERVAL 119 // Minimum: Interleave every 121 messages
-#define COMMON_PAGE_81_INTERVAL 120 // Minimum: Interleave every 121 messages
-#define AUTO_ZERO_SUPPORT_INTERVAL 120 // Minimum: Interleave every 121 messages
-
-/**@brief Bicycle power message data layout structure. */
-typedef struct
-{
- uint8_t page_number;
- uint8_t page_payload[7];
-} ant_bpwr_message_layout_t;
-
-
-/**@brief Function for initializing the ANT Bicycle Power Profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-static ret_code_t ant_bpwr_init(ant_bpwr_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config)
-{
- p_profile->channel_number = p_channel_config->channel_number;
-
- p_profile->page_1 = DEFAULT_ANT_BPWR_PAGE1();
- p_profile->page_16 = DEFAULT_ANT_BPWR_PAGE16();
- p_profile->page_17 = DEFAULT_ANT_BPWR_PAGE17();
- p_profile->page_18 = DEFAULT_ANT_BPWR_PAGE18();
- p_profile->page_80 = DEFAULT_ANT_COMMON_page80();
- p_profile->page_81 = DEFAULT_ANT_COMMON_page81();
-
- NRF_LOG_INFO("ANT B-PWR channel %u init\r\n", p_profile->channel_number);
- return ant_channel_init(p_channel_config);
-}
-
-
-ret_code_t ant_bpwr_disp_init(ant_bpwr_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bpwr_disp_config_t const * p_disp_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_disp_config != NULL);
- ASSERT(p_disp_config->evt_handler != NULL);
- ASSERT(p_disp_config->p_cb != NULL);
-
- p_profile->evt_handler = p_disp_config->evt_handler;
- p_profile->_cb.p_disp_cb = p_disp_config->p_cb;
-
- p_profile->_cb.p_disp_cb ->calib_timeout = 0;
- p_profile->_cb.p_disp_cb ->calib_stat = BPWR_DISP_CALIB_NONE;
-
- return ant_bpwr_init(p_profile, p_channel_config);
-}
-
-
-ret_code_t ant_bpwr_sens_init(ant_bpwr_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bpwr_sens_config_t const * p_sens_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_sens_config != NULL);
- ASSERT(p_sens_config->p_cb != NULL);
- ASSERT(p_sens_config->evt_handler != NULL);
- ASSERT(p_sens_config->calib_handler != NULL);
-
- p_profile->evt_handler = p_sens_config->evt_handler;
- p_profile->_cb.p_sens_cb = p_sens_config->p_cb;
-
- p_profile->_cb.p_sens_cb->torque_use = p_sens_config->torque_use;
- p_profile->_cb.p_sens_cb->calib_handler = p_sens_config->calib_handler;
- p_profile->_cb.p_sens_cb->calib_stat = BPWR_SENS_CALIB_NONE;
- p_profile->_cb.p_sens_cb->message_counter = 0;
-
- return ant_bpwr_init(p_profile, p_channel_config);
-}
-
-
-
-/**@brief Function for getting next page number to send.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @return Next page number.
- */
-static ant_bpwr_page_t next_page_number_get(ant_bpwr_profile_t * p_profile)
-{
- ant_bpwr_sens_cb_t * p_bpwr_cb = p_profile->_cb.p_sens_cb;
- ant_bpwr_page_t page_number;
-
- if (p_bpwr_cb->calib_stat == BPWR_SENS_CALIB_READY)
- {
- page_number = ANT_BPWR_PAGE_1;
- p_bpwr_cb->calib_stat = BPWR_SENS_CALIB_NONE; // mark event as processed
- }
- else if ((p_profile->BPWR_PROFILE_auto_zero_status != ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED)
- && (p_bpwr_cb->message_counter == AUTO_ZERO_SUPPORT_INTERVAL))
- {
- page_number = ANT_BPWR_PAGE_1;
- p_profile->BPWR_PROFILE_calibration_id = ANT_BPWR_CALIB_ID_AUTO_SUPPORT;
- p_bpwr_cb->message_counter++;
- }
- else if (p_bpwr_cb->message_counter >= COMMON_PAGE_81_INTERVAL)
- {
- page_number = ANT_BPWR_PAGE_81;
- p_bpwr_cb->message_counter = 0;
- }
- else
- {
- if (p_bpwr_cb->message_counter == COMMON_PAGE_80_INTERVAL)
- {
- page_number = ANT_BPWR_PAGE_80;
- }
- else
- {
- if ( p_bpwr_cb->torque_use == TORQUE_NONE)
- {
- page_number = ANT_BPWR_PAGE_16;
- }
- else if ((p_bpwr_cb->message_counter % BPWR_PAGE_16_INTERVAL)
- == BPWR_PAGE_16_INTERVAL_OFS)
- {
- page_number = ANT_BPWR_PAGE_16;
- }
- else if ( p_bpwr_cb->torque_use == TORQUE_WHEEL)
- {
- page_number = ANT_BPWR_PAGE_17;
- }
- else // assumed TORQUE_CRANK
- {
- page_number = ANT_BPWR_PAGE_18;
- }
- }
- p_bpwr_cb->message_counter++;
- }
-
- return page_number;
-}
-
-
-/**@brief Function for encoding Bicycle Power Sensor message.
- *
- * @note Assume to be call each time when Tx window will occur.
- */
-static void sens_message_encode(ant_bpwr_profile_t * p_profile, uint8_t * p_message_payload)
-{
- ant_bpwr_message_layout_t * p_bpwr_message_payload =
- (ant_bpwr_message_layout_t *)p_message_payload;
-
- p_bpwr_message_payload->page_number = next_page_number_get(p_profile);
-
- NRF_LOG_INFO("B-PWR tx page: %u\r\n", p_bpwr_message_payload->page_number);
-
- switch (p_bpwr_message_payload->page_number)
- {
- case ANT_BPWR_PAGE_1:
- ant_bpwr_page_1_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_1));
- break;
-
- case ANT_BPWR_PAGE_16:
- ant_bpwr_page_16_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_16));
- ant_bpwr_cadence_encode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_BPWR_PAGE_17:
- ant_bpwr_page_17_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_17));
- ant_bpwr_cadence_encode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_BPWR_PAGE_18:
- ant_bpwr_page_18_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_18));
- ant_bpwr_cadence_encode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_COMMON_PAGE_80:
- ant_common_page_80_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_80));
- break;
-
- case ANT_COMMON_PAGE_81:
- ant_common_page_81_encode(p_bpwr_message_payload->page_payload, &(p_profile->page_81));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_bpwr_evt_t)p_bpwr_message_payload->page_number);
-
-}
-
-
-/**@brief Function for decoding messages received by Bicycle Power sensor message.
- *
- * @note Assume to be call each time when Rx window will occur.
- */
-static void sens_message_decode(ant_bpwr_profile_t * p_profile, uint8_t * p_message_payload)
-{
- const ant_bpwr_message_layout_t * p_bpwr_message_payload =
- (ant_bpwr_message_layout_t *)p_message_payload;
- ant_bpwr_page1_data_t page1;
-
- switch (p_bpwr_message_payload->page_number)
- {
- case ANT_BPWR_PAGE_1:
- ant_bpwr_page_1_decode(p_bpwr_message_payload->page_payload, &page1);
- p_profile->_cb.p_sens_cb->calib_stat = BPWR_SENS_CALIB_REQUESTED;
- p_profile->_cb.p_sens_cb->calib_handler(p_profile, &page1);
- break;
-
- default:
- break;
- }
-}
-
-
-/**@brief Function for decoding messages received by Bicycle Power display message.
- *
- * @note Assume to be call each time when Rx window will occur.
- */
-static void disp_message_decode(ant_bpwr_profile_t * p_profile, uint8_t * p_message_payload)
-{
- const ant_bpwr_message_layout_t * p_bpwr_message_payload =
- (ant_bpwr_message_layout_t *)p_message_payload;
-
- NRF_LOG_INFO("B-PWR rx page: %u\r\n", p_bpwr_message_payload->page_number);
-
- switch (p_bpwr_message_payload->page_number)
- {
- case ANT_BPWR_PAGE_1:
- ant_bpwr_page_1_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_1));
- p_profile->_cb.p_disp_cb->calib_stat = BPWR_DISP_CALIB_NONE;
- break;
-
- case ANT_BPWR_PAGE_16:
- ant_bpwr_page_16_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_16));
- ant_bpwr_cadence_decode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_BPWR_PAGE_17:
- ant_bpwr_page_17_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_17));
- ant_bpwr_cadence_decode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_BPWR_PAGE_18:
- ant_bpwr_page_18_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_18));
- ant_bpwr_cadence_decode(p_bpwr_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_COMMON_PAGE_80:
- ant_common_page_80_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_80));
- break;
-
- case ANT_COMMON_PAGE_81:
- ant_common_page_81_decode(p_bpwr_message_payload->page_payload, &(p_profile->page_81));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_bpwr_evt_t)p_bpwr_message_payload->page_number);
-}
-
-
-ret_code_t ant_bpwr_calib_request(ant_bpwr_profile_t * p_profile, ant_bpwr_page1_data_t * p_page_1)
-{
- ant_bpwr_message_layout_t bpwr_message_payload;
-
- if (p_profile->_cb.p_disp_cb->calib_stat == BPWR_DISP_CALIB_REQUESTED)
- {
- return NRF_SUCCESS; // calibration in progress, so omit this request
- }
-
- bpwr_message_payload.page_number = ANT_BPWR_PAGE_1;
- ant_bpwr_page_1_encode(bpwr_message_payload.page_payload, p_page_1);
-
- uint32_t err_code = sd_ant_acknowledge_message_tx(p_profile->channel_number,
- sizeof (bpwr_message_payload),
- (uint8_t *) &bpwr_message_payload);
-
- if (err_code == NRF_SUCCESS)
- {
- p_profile->_cb.p_disp_cb->calib_timeout = BPWR_CALIB_INT_TIMEOUT; // initialize watch on calibration's time-out
- p_profile->_cb.p_disp_cb->calib_stat = BPWR_DISP_CALIB_REQUESTED;
- NRF_LOG_INFO("Start calibration process\r\n");
- }
- return err_code;
-}
-
-
-void ant_bpwr_calib_response(ant_bpwr_profile_t * p_profile)
-{
- if (p_profile->_cb.p_sens_cb->calib_stat != BPWR_SENS_CALIB_READY) // abort if callback request is in progress
- {
- p_profile->_cb.p_sens_cb->calib_stat = BPWR_SENS_CALIB_READY; // calibration respond
- }
-}
-
-
-/**@brief Function for hangling calibration events.
- */
-static void service_calib(ant_bpwr_profile_t * p_profile, uint8_t event)
-{
- ant_bpwr_evt_t bpwr_event;
-
- if (p_profile->_cb.p_disp_cb->calib_stat == BPWR_DISP_CALIB_REQUESTED)
- {
- switch (event)
- {
- case EVENT_RX:
- /* fall through */
- case EVENT_RX_FAIL:
-
- if (p_profile->_cb.p_disp_cb->calib_timeout-- == 0)
- {
- bpwr_event = ANT_BPWR_CALIB_TIMEOUT;
- break;
- }
- else
- {
- return;
- }
-
- case EVENT_TRANSFER_TX_FAILED:
- bpwr_event = ANT_BPWR_CALIB_REQUEST_TX_FAILED;
- break;
-
- case EVENT_RX_SEARCH_TIMEOUT:
- bpwr_event = ANT_BPWR_CALIB_TIMEOUT;
- break;
-
- default:
- return;
- }
-
- NRF_LOG_INFO("End calibration process\r\n");
- p_profile->_cb.p_disp_cb->calib_stat = BPWR_DISP_CALIB_NONE;
-
- p_profile->evt_handler(p_profile, bpwr_event);
- }
-}
-
-
-static void ant_message_send(ant_bpwr_profile_t * p_profile)
-{
- uint32_t err_code;
- uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE];
-
- sens_message_encode(p_profile, p_message_payload);
- err_code =
- sd_ant_broadcast_message_tx(p_profile->channel_number,
- sizeof (p_message_payload),
- p_message_payload);
- APP_ERROR_CHECK(err_code);
-}
-
-
-ret_code_t ant_bpwr_disp_open(ant_bpwr_profile_t * p_profile)
-{
- NRF_LOG_INFO("ANT B-PWR %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-
-ret_code_t ant_bpwr_sens_open(ant_bpwr_profile_t * p_profile)
-{
- // Fill tx buffer for the first frame
- ant_message_send(p_profile);
-
- NRF_LOG_INFO("ANT B-PWR %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-
-void ant_bpwr_sens_evt_handler(ant_bpwr_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- ANT_MESSAGE * p_message;
-
- switch (p_ant_event->event)
- {
- case EVENT_TX:
- ant_message_send(p_profile);
- break;
-
- case EVENT_RX:
- p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
-
- if (p_message->ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID)
- {
- sens_message_decode(p_profile, p_message->ANT_MESSAGE_aucPayload);
- }
- break;
-
- default:
- // No implementation needed
- break;
- }
- }
-}
-
-
-void ant_bpwr_disp_evt_handler(ant_bpwr_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- ANT_MESSAGE * p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
-
- switch (p_ant_event->event)
- {
- case EVENT_RX:
-
- if (p_message->ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
- {
- disp_message_decode(p_profile, p_message->ANT_MESSAGE_aucPayload);
- }
- break;
-
- default:
- break;
- }
- service_calib(p_profile, p_ant_event->event);
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/ant_bpwr.h b/components/ant/ant_profiles/ant_bpwr/ant_bpwr.h
deleted file mode 100644
index e9f007f..0000000
--- a/components/ant/ant_profiles/ant_bpwr/ant_bpwr.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/**
- * @file
- * @defgroup ant_bpwr Bicycle Power profile
- * @{
- * @ingroup ant_sdk_profiles
- * @brief This module implements the Bicycle Power profile.
- *
- */
-
- #ifndef ANT_BICYCLE_POWER_H__
- #define ANT_BICYCLE_POWER_H__
-
-#include
-#include
-#include "ant_parameters.h"
-#include "ant_stack_handler_types.h"
-#include "ant_channel_config.h"
-#include "ant_bpwr_pages.h"
-#include "sdk_errors.h"
-
-#define BPWR_DEVICE_TYPE 0x0Bu ///< Device type reserved for ANT+ Bicycle Power.
-#define BPWR_ANTPLUS_RF_FREQ 0x39u ///< Frequency, decimal 57 (2457 MHz).
-#define BPWR_MSG_PERIOD 8182u ///< Message period, decimal 8182 (4.0049 Hz).
-
-#define BPWR_EXT_ASSIGN 0x00 ///< ANT ext assign (see Ext. Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
-#define BPWR_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE ///< Display Bicycle Power channel type.
-#define BPWR_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER ///< Sensor Bicycle Power channel type.
-
-#define BPWR_CALIBRATION_TIMOUT_S 5u ///< Time-out for responding to calibration callback (s).
-
-/**@brief Initialize an ANT channel configuration structure for the Bicycle Power profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- */
-#define BPWR_DISP_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER) \
-static const ant_channel_config_t NAME##_channel_bpwr_disp_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = BPWR_DISP_CHANNEL_TYPE, \
- .ext_assign = BPWR_EXT_ASSIGN, \
- .rf_freq = BPWR_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = BPWR_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = BPWR_MSG_PERIOD, \
- .network_number = (NETWORK_NUMBER), \
- }
-#define BPWR_DISP_CHANNEL_CONFIG(NAME) &NAME##_channel_bpwr_disp_config
-
-/**@brief Initialize an ANT channel configuration structure for the Bicycle Power profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- */
-#define BPWR_SENS_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER) \
-static const ant_channel_config_t NAME##_channel_bpwr_sens_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = BPWR_SENS_CHANNEL_TYPE, \
- .ext_assign = BPWR_EXT_ASSIGN, \
- .rf_freq = BPWR_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = BPWR_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = BPWR_MSG_PERIOD, \
- .network_number = (NETWORK_NUMBER), \
- }
-#define BPWR_SENS_CHANNEL_CONFIG(NAME) &NAME##_channel_bpwr_sens_config
-
-/**@brief Initialize an ANT profile configuration structure for the BPWR profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the BPWR profile.
- */
-#define BPWR_DISP_PROFILE_CONFIG_DEF(NAME, \
- EVT_HANDLER) \
-static ant_bpwr_disp_cb_t NAME##_bpwr_disp_cb; \
-static const ant_bpwr_disp_config_t NAME##_profile_bpwr_disp_config = \
- { \
- .p_cb = &NAME##_bpwr_disp_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define BPWR_DISP_PROFILE_CONFIG(NAME) &NAME##_profile_bpwr_disp_config
-
-/**@brief Initialize an ANT profile configuration structure for the BPWR profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] TORQUE_USED Determines whether the torque page is included.
- * @param[in] CALIB_HANDLER Event handler to be called for handling calibration requests.
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the BPWR profile.
- */
-#define BPWR_SENS_PROFILE_CONFIG_DEF(NAME, \
- TORQUE_USED, \
- CALIB_HANDLER, \
- EVT_HANDLER) \
-static ant_bpwr_sens_cb_t NAME##_bpwr_sens_cb; \
-static const ant_bpwr_sens_config_t NAME##_profile_bpwr_sens_config = \
- { \
- .torque_use = (TORQUE_USED), \
- .calib_handler = (CALIB_HANDLER), \
- .p_cb = &NAME##_bpwr_sens_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define BPWR_SENS_PROFILE_CONFIG(NAME) &NAME##_profile_bpwr_sens_config
-
-/**@brief Configuration values for the Bicycle Power torque page. */
-typedef enum
-{
- TORQUE_NONE = 0,
- TORQUE_WHEEL = 1,
- TORQUE_CRANK = 2,
-} ant_bpwr_torque_t;
-
-/**@brief Bicycle Power page number type. */
-typedef enum
-{
- ANT_BPWR_PAGE_1 = 1, ///< Calibration data page.
- ANT_BPWR_PAGE_16 = 16, ///< Standard power-only main data page.
- ANT_BPWR_PAGE_17 = 17, ///< Standard wheel torque main data page.
- ANT_BPWR_PAGE_18 = 18, ///< Standard crank torque main data page.
- ANT_BPWR_PAGE_80 = ANT_COMMON_PAGE_80,
- ANT_BPWR_PAGE_81 = ANT_COMMON_PAGE_81
-} ant_bpwr_page_t;
-
-/**@brief BPWR profile event type. */
-typedef enum
-{
- ANT_BPWR_PAGE_1_UPDATED = ANT_BPWR_PAGE_1, ///< Data page 1 and speed have been updated (Display) or sent (Sensor).
- ANT_BPWR_PAGE_16_UPDATED = ANT_BPWR_PAGE_16, ///< Data page 16 and speed have been updated (Display) or sent (Sensor).
- ANT_BPWR_PAGE_17_UPDATED = ANT_BPWR_PAGE_17, ///< Data page 17 and speed have been updated (Display) or sent (Sensor).
- ANT_BPWR_PAGE_18_UPDATED = ANT_BPWR_PAGE_18, ///< Data page 18 has been updated (Display) or sent (Sensor).
- ANT_BPWR_PAGE_80_UPDATED = ANT_BPWR_PAGE_80, ///< Data page 80 has been updated (Display) or sent (Sensor).
- ANT_BPWR_PAGE_81_UPDATED = ANT_BPWR_PAGE_81, ///< Data page 81 has been updated (Display) or sent (Sensor).
- ANT_BPWR_CALIB_TIMEOUT, ///< Request of calibration time-out occurred (Display).
- ANT_BPWR_CALIB_REQUEST_TX_FAILED, ///< Calibration request did not reach the destination (Display).
-} ant_bpwr_evt_t;
-
-// Forward declaration of the ant_bpwr_profile_t type.
-typedef struct ant_bpwr_profile_s ant_bpwr_profile_t;
-
-/**@brief BPWR event handler type. */
-typedef void (* ant_bpwr_evt_handler_t) (ant_bpwr_profile_t *, ant_bpwr_evt_t);
-
-/**@brief BPWR Sensor calibration request handler type. */
-typedef void (* ant_bpwr_calib_handler_t) (ant_bpwr_profile_t *, ant_bpwr_page1_data_t *);
-
-#include "ant_bpwr_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Bicycle Power Sensor configuration structure. */
-typedef struct
-{
- ant_bpwr_torque_t torque_use; ///< Determines whether the torque page is included.
- ant_bpwr_sens_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_bpwr_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BPWR profile.
- ant_bpwr_calib_handler_t calib_handler; ///< Event handler to be called for handling calibration requests.
-} ant_bpwr_sens_config_t;
-
-/**@brief Bicycle Power Display configuration structure. */
-typedef struct
-{
- ant_bpwr_disp_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_bpwr_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BPWR profile.
-} ant_bpwr_disp_config_t;
-
-/**@brief Bicycle Power profile structure. */
-struct ant_bpwr_profile_s
-{
- uint8_t channel_number; ///< Channel number assigned to the profile.
- union {
- ant_bpwr_disp_cb_t * p_disp_cb;
- ant_bpwr_sens_cb_t * p_sens_cb;
- } _cb; ///< Pointer to internal control block.
- ant_bpwr_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BPWR profile.
- ant_bpwr_page1_data_t page_1; ///< Page 1.
- ant_bpwr_page16_data_t page_16; ///< Page 16.
- ant_bpwr_page17_data_t page_17; ///< Page 17.
- ant_bpwr_page18_data_t page_18; ///< Page 18.
- ant_common_page80_data_t page_80; ///< Page 80.
- ant_common_page81_data_t page_81; ///< Page 81.
- ant_bpwr_common_data_t common; ///< BPWR common data.
-};
-
-/** @name Defines for accessing ant_bpwr_profile_t member variables
- @{ */
-#define BPWR_PROFILE_calibration_id page_1.calibration_id
-#define BPWR_PROFILE_auto_zero_status page_1.auto_zero_status
-#define BPWR_PROFILE_general_calib_data page_1.data.general_calib
-#define BPWR_PROFILE_custom_calib_data page_1.data.custom_calib
-#define BPWR_PROFILE_instantaneous_cadence common.instantaneous_cadence
-#define BPWR_PROFILE_pedal_power page_16.pedal_power.items
-#define BPWR_PROFILE_power_update_event_count page_16.update_event_count
-#define BPWR_PROFILE_accumulated_power page_16.accumulated_power
-#define BPWR_PROFILE_instantaneous_power page_16.instantaneous_power
-#define BPWR_PROFILE_wheel_update_event_count page_17.update_event_count
-#define BPWR_PROFILE_wheel_tick page_17.tick
-#define BPWR_PROFILE_wheel_period page_17.period
-#define BPWR_PROFILE_wheel_accumulated_torque page_17.accumulated_torque
-#define BPWR_PROFILE_crank_update_event_count page_18.update_event_count
-#define BPWR_PROFILE_crank_tick page_18.tick
-#define BPWR_PROFILE_crank_period page_18.period
-#define BPWR_PROFILE_crank_accumulated_torque page_18.accumulated_torque
-#define BPWR_PROFILE_manuf_id page_80.manuf_id
-#define BPWR_PROFILE_hw_revision page_80.hw_revision
-#define BPWR_PROFILE_manufacturer_id page_80.manufacturer_id
-#define BPWR_PROFILE_model_number page_80.model_number
-#define BPWR_PROFILE_sw_revision_minor page_81.sw_revision_minor
-#define BPWR_PROFILE_sw_revision_major page_81.sw_revision_major
-#define BPWR_PROFILE_serial_number page_81.serial_number
-/** @} */
-
-/**@brief Function for initializing the ANT Bicycle Power Display profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_disp_config Pointer to the Bicycle Power Display configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_bpwr_disp_init(ant_bpwr_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bpwr_disp_config_t const * p_disp_config);
-
-/**@brief Function for initializing the ANT Bicycle Power Sensor profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_sens_config Pointer to the Bicycle Power Sensor configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_bpwr_sens_init(ant_bpwr_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bpwr_sens_config_t const * p_sens_config);
-
-/**@brief Function for opening the profile instance channel for ANT BPWR Display.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_bpwr_disp_open(ant_bpwr_profile_t * p_profile);
-
-/**@brief Function for opening the profile instance channel for ANT BPWR Sensor.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_bpwr_sens_open(ant_bpwr_profile_t * p_profile);
-
-/** @name Functions: Sensor calibration API
- * @{
- */
-
-/** @brief Function for initializing the response for a calibration request.
- *
- * This function should be used to signal the status of the calibration procedure to the ANT profile layer .
- *
- * @param[in] p_profile Pointer to the profile instance.
- */
-void ant_bpwr_calib_response(ant_bpwr_profile_t * p_profile);
-/** @} */
-
-
-/**@brief Function for handling the Sensor ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Bicycle Power Display profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_bpwr_sens_evt_handler(ant_bpwr_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-/**@brief Function for handling the Display ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Bicycle Power Display profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_bpwr_disp_evt_handler(ant_bpwr_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-/** @name Functions: Display calibration API
- * @{
- */
-
-/**@brief Function for initializing the calibration request process from the Bicycle Power Display side.
- *
- * @details This function requests a transfer to the Sensor and starts watching for the calibration response.
- * If a calibration response has already been requested, the function ignores the new request and returns NRF_SUCCESS.
- *
- * @param [in] p_profile Pointer to the profile instance.
- * @param [in] p_page_1 Pointer to the prepared page 1.
- *
- * @return Values returned by the @ref sd_ant_acknowledge_message_tx SVC callback.
- */
-uint32_t ant_bpwr_calib_request(ant_bpwr_profile_t * p_profile, ant_bpwr_page1_data_t * p_page_1);
-
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BICYCLE_POWER_H__
-
diff --git a/components/ant/ant_profiles/ant_bpwr/ant_bpwr_local.h b/components/ant/ant_profiles/ant_bpwr/ant_bpwr_local.h
deleted file mode 100644
index 3059d54..0000000
--- a/components/ant/ant_profiles/ant_bpwr/ant_bpwr_local.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
- *
- * The information contained herein is property of Nordic Semiconductor ASA.
- * Terms and conditions of usage are described in detail in NORDIC
- * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
- *
- * Licensees are granted free, non-transferable use of the information. NO
- * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
- * the file.
- *
- */
-
-
-#ifndef ANT_BPWR_LOCAL_H__
-#define ANT_BPWR_LOCAL_H__
-
-#include
-#include
-#include "ant_bpwr.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup ant_bpwr
- * @{
- */
-
-/** @brief Bicycle Power Sensor control block. */
-typedef struct
-{
- uint8_t message_counter;
- ant_bpwr_torque_t torque_use;
- enum
- {
- BPWR_SENS_CALIB_NONE, ///< Idle state.
- BPWR_SENS_CALIB_REQUESTED, ///< Received request for general calibration result message by the sensor.
- BPWR_SENS_CALIB_READY, ///< Calibration response message is ready to be transmitted.
- } calib_stat;
- ant_bpwr_calib_handler_t calib_handler;
-} ant_bpwr_sens_cb_t;
-
-/**@brief Bicycle Power Sensor RX control block. */
-typedef struct
-{
- uint8_t calib_timeout;
- enum
- {
- BPWR_DISP_CALIB_NONE, ///< Idle state.
- BPWR_DISP_CALIB_REQUESTED, ///< Calibration requested.
- } calib_stat;
-} ant_bpwr_disp_cb_t;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.c
deleted file mode 100644
index fa8f723..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include "ant_bpwr_common_data.h"
-#include "ant_bpwr_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_COMMON"
-#if ANT_BPWR_COMMON_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_COMMON_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_COMMON_INFO_COLOR
-#else // ANT_BPWR_COMMON_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_COMMON_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BPWR common page data layout structure. */
-typedef struct
-{
- uint8_t reserved0[2];
- uint8_t instantaneous_cadence;
- uint8_t reserved1[4];
-}ant_bpwr_cadence_data_layout_t;
-
-/**@brief Function for tracing common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- */
-static void cadence_data_log(ant_bpwr_common_data_t const * p_common_data)
-{
- if (p_common_data->instantaneous_cadence == 0xFF)
- {
- NRF_LOG_INFO("instantaneous cadence: -- rpm\r\n\n");
- }
- else
- {
- NRF_LOG_INFO("instantaneous cadence: %u rpm\r\n\n",
- p_common_data->instantaneous_cadence);
- }
-}
-
-void ant_bpwr_cadence_encode(uint8_t * p_page_buffer,
- ant_bpwr_common_data_t const * p_common_data)
-{
- ant_bpwr_cadence_data_layout_t * p_outcoming_data = (ant_bpwr_cadence_data_layout_t *)p_page_buffer;
- p_outcoming_data->instantaneous_cadence = p_common_data->instantaneous_cadence;
-
- cadence_data_log(p_common_data);
-}
-
-void ant_bpwr_cadence_decode(uint8_t const * p_page_buffer,
- ant_bpwr_common_data_t * p_common_data)
-{
- ant_bpwr_cadence_data_layout_t const * p_incoming_data = (ant_bpwr_cadence_data_layout_t *)p_page_buffer;
- p_common_data->instantaneous_cadence = p_incoming_data->instantaneous_cadence;
-
- cadence_data_log(p_common_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.h
deleted file mode 100644
index 187e6d5..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_common_data.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_COMMON_DATA_H__
-#define ANT_BPWR_COMMON_DATA_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_common_data_page Stride Based Speed and Distance Monitor profile common data
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BPWR common data.
- *
- * @details This structure stores data that is not associated with a particular page.
- */
-typedef struct
-{
- uint8_t instantaneous_cadence; ///< Crank cadence (rpm, 0 - 254, 255-> invalid).
-} ant_bpwr_common_data_t;
-
-/**@brief Initialize common data.
- */
-#define DEFAULT_ANT_BPWR_COMMON_DATA() \
- (ant_bpwr_common_data_t) \
- { \
- .instantaneous_cadence = 0, \
- }
-
-/**@brief Function for encoding speed.
- *
- * This function can be used for pages 16, 17, and 18.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_cadence_encode(uint8_t * p_page_buffer,
- ant_bpwr_common_data_t const * p_common_data);
-
-/**@brief Function for decoding speed.
- *
- * This function can be used for pages 16, 17, and 18.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_common_data Pointer to the common data.
- */
-void ant_bpwr_cadence_decode(uint8_t const * p_page_buffer,
- ant_bpwr_common_data_t * p_common_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_COMMON_DATA_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.c
deleted file mode 100644
index ec885e0..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include
-#include "ant_bpwr_page_1.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_PAGE_1"
-#if ANT_BPWR_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_PAGE_1_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_PAGE_1_INFO_COLOR
-#else // ANT_BPWR_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_PAGE_1_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief bicycle power page 1 data layout structure. */
-typedef struct
-{
- uint8_t calibration_id; ///< Calibration request type
- union
- {
- struct
- {
- uint8_t reserved[6]; ///< Unused, fill by 0xFF.
- } general_calib_request;
- struct
- {
- uint8_t auto_zero_status; ///< Status of automatic zero feature of power sensor.
- uint8_t reserved[5]; ///< Unused, fill by 0xFF.
- } auto_zero_config;
- struct
- {
- uint8_t auto_zero_status; ///< Status of automatic zero feature of power sensor.
- uint8_t reserved[3]; ///< Unused, fill by 0xFF.
- uint8_t data[2]; ///< Calibration Data.
- } general_calib_response;
- struct
- {
- uint8_t enable : 1;
- uint8_t status : 1;
- uint8_t reserved0 : 6; ///< Unused, fill by 0x00.
- uint8_t reserved1[5]; ///< Unused, fill by 0xFF.
- } auto_zero_support;
- struct
- {
- uint8_t manufac_spec[6]; ///< Manufacture Specyfic Data.
- } custom_calib;
- } data;
-} ant_bpwr_page1_data_layout_t;
-
-
-static void page1_data_log(ant_bpwr_page1_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Calibration id: %u\r\n", p_page_data->calibration_id);
-
- switch (p_page_data->calibration_id)
- {
- case ANT_BPWR_CALIB_ID_MANUAL:
- // No implementation needed
- break;
-
- case ANT_BPWR_CALIB_ID_MANUAL_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_FAILED:
- NRF_LOG_INFO("General calibration data: %u\r\n",
- p_page_data->data.general_calib);
- /* fall through */
- case ANT_BPWR_CALIB_ID_AUTO:
- /* fall through */
- case ANT_BPWR_CALIB_ID_AUTO_SUPPORT:
-
- switch (p_page_data->auto_zero_status)
- {
- case ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED:
- NRF_LOG_INFO("Auto zero not supported\r\n\n");
- break;
-
- case ANT_BPWR_AUTO_ZERO_OFF:
- NRF_LOG_INFO("Auto zero off\r\n\n");
- break;
-
- case ANT_BPWR_AUTO_ZERO_ON:
- NRF_LOG_INFO("Auto zero on\r\n\n");
- break;
- }
- break;
-
- case ANT_BPWR_CALIB_ID_CTF:
- NRF_LOG_INFO("Not supported\r\n\n");
- break;
-
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE_SUCCESS:
- NRF_LOG_INFO("Manufacture specyfic: ");
- NRF_LOG_HEXDUMP_INFO((uint8_t*)p_page_data->data.custom_calib,
- sizeof (p_page_data->data.custom_calib));
- break;
-
- default: // shouldn't occur
- NRF_LOG_INFO("Unsupported calibration ID\r\n\n");
- break;
- }
-}
-
-
-void ant_bpwr_page_1_encode(uint8_t * p_page_buffer,
- ant_bpwr_page1_data_t const * p_page_data)
-{
- ant_bpwr_page1_data_layout_t * p_outcoming_data = (ant_bpwr_page1_data_layout_t *)p_page_buffer;
-
- page1_data_log(p_page_data);
-
- p_outcoming_data->calibration_id = p_page_data->calibration_id;
-
- switch (p_page_data->calibration_id)
- {
- case ANT_BPWR_CALIB_ID_MANUAL:
- memset(p_outcoming_data->data.general_calib_request.reserved, 0xFF,
- sizeof (p_outcoming_data->data.general_calib_request.reserved));
- break;
-
- case ANT_BPWR_CALIB_ID_AUTO:
- memset(p_outcoming_data->data.auto_zero_config.reserved, 0xFF,
- sizeof (p_outcoming_data->data.auto_zero_config.reserved));
- p_outcoming_data->data.auto_zero_config.auto_zero_status =
- p_page_data->auto_zero_status;
- break;
-
- case ANT_BPWR_CALIB_ID_MANUAL_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_FAILED:
- memset(p_outcoming_data->data.general_calib_response.reserved, 0xFF,
- sizeof (p_outcoming_data->data.general_calib_response.reserved));
- p_outcoming_data->data.general_calib_response.auto_zero_status =
- p_page_data->auto_zero_status;
- UNUSED_PARAMETER(uint16_encode(p_page_data->data.general_calib,
- p_outcoming_data->data.general_calib_response.data));
- break;
-
- case ANT_BPWR_CALIB_ID_CTF:
- NRF_LOG_INFO("Not supported\r\n");
- break;
-
- case ANT_BPWR_CALIB_ID_AUTO_SUPPORT:
- memset(p_outcoming_data->data.auto_zero_support.reserved1, 0xFF,
- sizeof (p_outcoming_data->data.auto_zero_support.reserved1));
- p_outcoming_data->data.auto_zero_support.reserved0 = 0x00;
- p_outcoming_data->data.auto_zero_support.enable =
- (p_page_data->auto_zero_status == ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED) ? false : true;
- p_outcoming_data->data.auto_zero_support.status =
- (p_page_data->auto_zero_status == ANT_BPWR_AUTO_ZERO_ON) ? true : false;
- break;
-
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE_SUCCESS:
- memcpy(p_outcoming_data->data.custom_calib.manufac_spec,
- (void *)p_page_data->data.custom_calib,
- sizeof (p_page_data->data.custom_calib));
- break;
-
- default: // shouldn't occur
- break;
- }
-}
-
-
-void ant_bpwr_page_1_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page1_data_t * p_page_data)
-{
- ant_bpwr_page1_data_layout_t const * p_incoming_data =
- (ant_bpwr_page1_data_layout_t *)p_page_buffer;
-
- p_page_data->calibration_id = (ant_bpwr_calib_id_t)p_incoming_data->calibration_id;
-
- switch (p_incoming_data->calibration_id)
- {
- case ANT_BPWR_CALIB_ID_MANUAL:
- // No implementation needed
- break;
-
- case ANT_BPWR_CALIB_ID_AUTO:
- /* fall through */
- p_page_data->auto_zero_status =
- (ant_bpwr_auto_zero_status_t)p_incoming_data->data.auto_zero_config.auto_zero_status;
- break;
-
- case ANT_BPWR_CALIB_ID_MANUAL_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_FAILED:
- p_page_data->auto_zero_status =
- (ant_bpwr_auto_zero_status_t)p_incoming_data->data.general_calib_response.
- auto_zero_status;
- p_page_data->data.general_calib = uint16_decode(
- p_incoming_data->data.general_calib_response.data);
- break;
-
- case ANT_BPWR_CALIB_ID_CTF:
- NRF_LOG_INFO("Not supported\r\n");
- break;
-
- case ANT_BPWR_CALIB_ID_AUTO_SUPPORT:
-
- if (p_incoming_data->data.auto_zero_support.enable == false)
- {
- p_page_data->auto_zero_status = ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED;
- }
- else if (p_incoming_data->data.auto_zero_support.status)
- {
- p_page_data->auto_zero_status = ANT_BPWR_AUTO_ZERO_ON;
- }
- else
- {
- p_page_data->auto_zero_status = ANT_BPWR_AUTO_ZERO_OFF;
- }
- break;
-
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_REQ_SUCCESS:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE:
- /* fall through */
- case ANT_BPWR_CALIB_ID_CUSTOM_UPDATE_SUCCESS:
- memcpy((void *)p_page_data->data.custom_calib,
- p_incoming_data->data.custom_calib.manufac_spec,
- sizeof (p_page_data->data.custom_calib));
- break;
-
- default: // shouldn't occur
- break;
- }
-
- page1_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.h
deleted file mode 100644
index 094a110..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_1.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_PAGE_1_H__
-#define ANT_BPWR_PAGE_1_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_page1 Bicycle Power profile page 1
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief BPWR Calibration ID.
- */
-typedef enum
-{
- ANT_BPWR_CALIB_ID_NONE = 0x00,
- ANT_BPWR_CALIB_ID_MANUAL = 0xAA, ///< Calibration Request: Manual Zero.
- ANT_BPWR_CALIB_ID_AUTO = 0xAB, ///< Calibration Request: Auto Zero Configuration.
- ANT_BPWR_CALIB_ID_MANUAL_SUCCESS = 0xAC, ///< Calibration Response: Manual Zero Successful.
- ANT_BPWR_CALIB_ID_FAILED = 0xAF, ///< Calibration Response: Failed.
- ANT_BPWR_CALIB_ID_CTF = 0x10, ///< Crank Torque Frequency (CTF) Power sensor Defined Message.
- ANT_BPWR_CALIB_ID_AUTO_SUPPORT = 0x12, ///< Auto Zero Support.
- ANT_BPWR_CALIB_ID_CUSTOM_REQ = 0xBA, ///< Custom Calibration Parameter Request.
- ANT_BPWR_CALIB_ID_CUSTOM_REQ_SUCCESS = 0xBB, ///< Custom Calibration Parameter Response.
- ANT_BPWR_CALIB_ID_CUSTOM_UPDATE = 0xBC, ///< Custom Calibration Parameter Update.
- ANT_BPWR_CALIB_ID_CUSTOM_UPDATE_SUCCESS = 0xBD, ///< Custom Calibration Parameter Update Response.
-} ant_bpwr_calib_id_t;
-
-/**@brief BPWR Calibration Auto Zero Status.
- */
-typedef enum
-{
- ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED = 0xFF, ///< Auto Zero Not Supported.
- ANT_BPWR_AUTO_ZERO_OFF = 0x00, ///< Auto Zero OFF.
- ANT_BPWR_AUTO_ZERO_ON = 0x01, ///< Auto Zero ON.
-} ant_bpwr_auto_zero_status_t;
-
-/**@brief Data structure for Bicycle Power data page 1.
- */
-typedef struct
-{
- ant_bpwr_calib_id_t calibration_id; ///< Calibration request type.
- ant_bpwr_auto_zero_status_t auto_zero_status; ///< Status of automatic zero feature of power sensor.
- union
- {
- int16_t general_calib;
- uint8_t custom_calib[6];
- } data;
-} ant_bpwr_page1_data_t;
-
-/**@brief Initialize page 1.
- */
-#define DEFAULT_ANT_BPWR_PAGE1() \
- (ant_bpwr_page1_data_t) \
- { \
- .calibration_id = ANT_BPWR_CALIB_ID_NONE, \
- .auto_zero_status = ANT_BPWR_AUTO_ZERO_NOT_SUPPORTED, \
- .data.general_calib = 0x00, \
- }
-
-/**@brief Initialize page 1 with the general request.
- */
-#define ANT_BPWR_GENERAL_CALIB_REQUEST() \
- (ant_bpwr_page1_data_t) \
- { \
- .calibration_id = ANT_BPWR_CALIB_ID_MANUAL, \
- }
-
-/**@brief Function for encoding page 1.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_page_1_encode(uint8_t * p_page_buffer,
- ant_bpwr_page1_data_t const * p_page_data);
-
-/**@brief Function for decoding page 1.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_1_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page1_data_t * p_page_data);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGE_1_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.c
deleted file mode 100644
index 121b610..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include "ant_bpwr_page_16.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_PAGE_16"
-#if ANT_BPWR_PAGE_16_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_PAGE_16_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_PAGE_16_INFO_COLOR
-#else // ANT_BPWR_PAGE_16_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_PAGE_16_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief bicycle power page 16 data layout structure. */
-typedef struct
-{
- uint8_t update_event_count;
- uint8_t pedal_power;
- uint8_t reserved;
- uint8_t accumulated_power[2];
- uint8_t instantaneous_power[2];
-}ant_bpwr_page16_data_layout_t;
-
-
-static void page16_data_log(ant_bpwr_page16_data_t const * p_page_data)
-{
- NRF_LOG_INFO("event count: %u\r\n", p_page_data->update_event_count);
-
- if (p_page_data->pedal_power.byte != 0xFF)
- {
- NRF_LOG_INFO("pedal power: %u %%\r\n",
- p_page_data->pedal_power.items.distribution);
- }
- else
- {
- NRF_LOG_INFO("pedal power: --\r\n");
- }
-
- NRF_LOG_INFO("accumulated power: %u W\r\n", p_page_data->accumulated_power);
- NRF_LOG_INFO("instantaneous power: %u W\r\n", p_page_data->instantaneous_power);
-}
-
-
-void ant_bpwr_page_16_encode(uint8_t * p_page_buffer,
- ant_bpwr_page16_data_t const * p_page_data)
-{
- ant_bpwr_page16_data_layout_t * p_outcoming_data =
- (ant_bpwr_page16_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->update_event_count = p_page_data->update_event_count;
- p_outcoming_data->pedal_power = p_page_data->pedal_power.byte;
-
- UNUSED_PARAMETER(uint16_encode(p_page_data->accumulated_power,
- p_outcoming_data->accumulated_power));
- UNUSED_PARAMETER(uint16_encode(p_page_data->instantaneous_power,
- p_outcoming_data->instantaneous_power));
-
- page16_data_log(p_page_data);
-}
-
-
-void ant_bpwr_page_16_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page16_data_t * p_page_data)
-{
- ant_bpwr_page16_data_layout_t const * p_incoming_data =
- (ant_bpwr_page16_data_layout_t *)p_page_buffer;
-
- p_page_data->update_event_count = p_incoming_data->update_event_count;
- p_page_data->pedal_power.byte = p_incoming_data->pedal_power;
- p_page_data->accumulated_power = uint16_decode(p_incoming_data->accumulated_power);
- p_page_data->instantaneous_power = uint16_decode(p_incoming_data->instantaneous_power);
-
- page16_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.h
deleted file mode 100644
index b282e2b..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_16.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_PAGE_16_H__
-#define ANT_BPWR_PAGE_16_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_page16 Bicycle Power profile page 16
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for Bicycle Power data page 16.
- *
- * @note This structure implements only page 16 specific data.
- */
-typedef struct
-{
- union
- {
- struct
- {
- uint8_t distribution : 7; ///< Pedal power distribution (%).
- uint8_t differentiation : 1; ///< Pedal differentiation: 1 -> right, 0 -> unknown.
- } items;
- uint8_t byte;
- } pedal_power;
-
- uint8_t update_event_count; ///< Power event count.
- uint16_t accumulated_power; ///< Accumulated power (W).
- uint16_t instantaneous_power; ///< Instantaneous power (W).
-} ant_bpwr_page16_data_t;
-
-/**@brief Initialize page 16.
- */
-#define DEFAULT_ANT_BPWR_PAGE16() \
- (ant_bpwr_page16_data_t) \
- { \
- .update_event_count = 0, \
- .pedal_power.items.distribution = 0, \
- .pedal_power.items.differentiation = 0, \
- .accumulated_power = 0, \
- .instantaneous_power = 0, \
- }
-
-/**@brief Function for encoding page 16.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_page_16_encode(uint8_t * p_page_buffer,
- ant_bpwr_page16_data_t const * p_page_data);
-
-/**@brief Function for decoding page 16.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_16_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page16_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGE_16_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.c
deleted file mode 100644
index 75d4cc3..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include "ant_bpwr_page_17.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_PAGE_17"
-#if ANT_BPWR_PAGE_17_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_PAGE_17_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_PAGE_17_INFO_COLOR
-#else // ANT_BPWR_PAGE_17_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_PAGE_17_LOG_ENABLED
-#include "nrf_log.h"
-
-static void page17_data_log(ant_bpwr_page17_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Wheel:\r\n");
- ant_bpwr_page_torque_log((ant_bpwr_page_torque_data_t *) p_page_data);
-}
-
-
-void ant_bpwr_page_17_encode(uint8_t * p_page_buffer,
- ant_bpwr_page17_data_t const * p_page_data)
-{
- ant_bpwr_page_torque_encode(p_page_buffer, (ant_bpwr_page_torque_data_t *)p_page_data);
- page17_data_log(p_page_data);
-}
-
-
-void ant_bpwr_page_17_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page17_data_t * p_page_data)
-{
- ant_bpwr_page_torque_decode(p_page_buffer, (ant_bpwr_page_torque_data_t *) p_page_data);
- page17_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.h
deleted file mode 100644
index 3808144..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_17.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_PAGE_17_H__
-#define ANT_BPWR_PAGE_17_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_page17 Bicycle Power profile page 17
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-#include "ant_bpwr_page_torque.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for Bicycle Power data page 17.
- *
- * @note This structure implements only page 17 specific data.
- */
-typedef ant_bpwr_page_torque_data_t ant_bpwr_page17_data_t;
-
-/**@brief Initialize page 17.
- */
-#define DEFAULT_ANT_BPWR_PAGE17() (ant_bpwr_page17_data_t) DEFAULT_ANT_BPWR_PAGE_TORQUE(0, 0, 0, 0)
-
-/**@brief Function for encoding page 17.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_page_17_encode(uint8_t * p_page_buffer,
- ant_bpwr_page17_data_t const * p_page_data);
-
-/**@brief Function for decoding page 17.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_17_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page17_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGE_17_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.c
deleted file mode 100644
index fbff37f..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include "ant_bpwr_page_18.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_PAGE_18"
-#if ANT_BPWR_PAGE_18_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_PAGE_18_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_PAGE_18_INFO_COLOR
-#else // ANT_BPWR_PAGE_18_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_PAGE_18_LOG_ENABLED
-#include "nrf_log.h"
-
-static void page18_data_log(ant_bpwr_page18_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Crank:\r\n");
- ant_bpwr_page_torque_log((ant_bpwr_page_torque_data_t *) p_page_data);
-}
-
-
-void ant_bpwr_page_18_encode(uint8_t * p_page_buffer,
- ant_bpwr_page18_data_t const * p_page_data)
-{
- ant_bpwr_page_torque_encode(p_page_buffer, (ant_bpwr_page_torque_data_t *)p_page_data);
- page18_data_log(p_page_data);
-}
-
-
-void ant_bpwr_page_18_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page18_data_t * p_page_data)
-{
- ant_bpwr_page_torque_decode(p_page_buffer, (ant_bpwr_page_torque_data_t *) p_page_data);
- page18_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.h
deleted file mode 100644
index 4252abc..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_18.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2011 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BPWR_PAGE_18_H__
-#define ANT_BPWR_PAGE_18_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_page18 Bicycle Power profile page 18
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-#include "ant_bpwr_page_torque.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for Bicycle Power data page 18.
- *
- * @note This structure implements only page 18 specific data.
- */
-typedef ant_bpwr_page_torque_data_t ant_bpwr_page18_data_t;
-
-/**@brief Initialize page 18.
- */
-#define DEFAULT_ANT_BPWR_PAGE18() (ant_bpwr_page18_data_t) DEFAULT_ANT_BPWR_PAGE_TORQUE(0, 0, 0, 0)
-
-/**@brief Function for encoding page 18.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_page_18_encode(uint8_t * p_page_buffer,
- ant_bpwr_page18_data_t const * p_page_data);
-
-/**@brief Function for decoding page 18.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_18_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page18_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGE_18_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.c b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.c
deleted file mode 100644
index 7fa0b29..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BPWR)
-
-#include
-#include "ant_bpwr_page_torque.h"
-#include "ant_bpwr_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BPWR_PAGE_TORQUE"
-#if ANT_BPWR_PAGE_TORQUE_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BPWR_PAGE_TORQUE_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BPWR_PAGE_TORQUE_INFO_COLOR
-#else // ANT_BPWR_PAGE_TORQUE_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BPWR_PAGE_TORQUE_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief bicycle power page torque data layout structure. */
-typedef struct
-{
- uint8_t update_event_count;
- uint8_t tick;
- uint8_t reserved;
- uint8_t period[2];
- uint8_t accumulated_torque[2];
-}ant_bpwr_page_torque_data_layout_t;
-
-STATIC_ASSERT(ANT_BPWR_TORQUE_PERIOD_DISP_PRECISION == 1000); ///< Display format need to be updated
-STATIC_ASSERT(ANT_BPWR_ACC_TORQUE_DISP_PRECISION == 10); ///< Display format need to be updated
-
-void ant_bpwr_page_torque_log(ant_bpwr_page_torque_data_t const * p_page_data)
-{
- uint16_t period = ANT_BPWR_TORQUE_PERIOD_RESCALE(p_page_data->period);
- uint32_t acc_torque = ANT_BPWR_ACC_TORQUE_RESCALE(p_page_data->accumulated_torque);
-
- NRF_LOG_INFO("event count: %u\r\n", p_page_data->update_event_count);
- NRF_LOG_INFO("tick: %u\r\n", p_page_data->tick);
- NRF_LOG_INFO("period: %u.%03us\r\n",
- (unsigned int)(period / ANT_BPWR_TORQUE_PERIOD_DISP_PRECISION),
- (unsigned int)(period % ANT_BPWR_TORQUE_PERIOD_DISP_PRECISION));
- NRF_LOG_INFO("accumulated torque: %u.%01uNm\r\n",
- (unsigned int)(acc_torque / ANT_BPWR_ACC_TORQUE_DISP_PRECISION),
- (unsigned int)(acc_torque % ANT_BPWR_ACC_TORQUE_DISP_PRECISION));
-}
-
-
-void ant_bpwr_page_torque_encode(uint8_t * p_page_buffer,
- ant_bpwr_page_torque_data_t const * p_page_data)
-{
- ant_bpwr_page_torque_data_layout_t * p_outcoming_data =
- (ant_bpwr_page_torque_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->update_event_count = p_page_data->update_event_count;
- p_outcoming_data->tick = p_page_data->tick;
-
- UNUSED_PARAMETER(uint16_encode(p_page_data->period, p_outcoming_data->period));
- UNUSED_PARAMETER(uint16_encode(p_page_data->accumulated_torque,
- p_outcoming_data->accumulated_torque));
-}
-
-
-void ant_bpwr_page_torque_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page_torque_data_t * p_page_data)
-{
- ant_bpwr_page_torque_data_layout_t const * p_incoming_data =
- (ant_bpwr_page_torque_data_layout_t *)p_page_buffer;
-
- p_page_data->update_event_count = p_incoming_data->update_event_count;
- p_page_data->tick = p_incoming_data->tick;
- p_page_data->period = uint16_decode(p_incoming_data->period);
- p_page_data->accumulated_torque = uint16_decode(p_incoming_data->accumulated_torque);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BPWR)
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.h
deleted file mode 100644
index 1463dd8..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_page_torque.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_PAGE_TORQUE_COMMON_H__
-#define ANT_BPWR_PAGE_TORQUE_COMMON_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bicycle_p_page_torque Bicycle Power profile pages 17, 18 (commons)
- * @{
- * @ingroup ant_sdk_profiles_bpwr_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Common data structure for Bicycle Power data pages 17, 18.
- *
- * @note This structure implements specific data that is common for pages 17, 18.
- */
-typedef struct
-{
- uint8_t update_event_count; ///< Power event count.
- uint8_t tick; ///< Wheel/crank revolutions counter.
- uint16_t period; ///< Accumulated wheel/crank period (1/2048 s).
- uint16_t accumulated_torque; ///< Accumulated wheel/torque (1/32 Nm).
-} ant_bpwr_page_torque_data_t;
-
-/**@brief Initialize page torque.
- */
-#define DEFAULT_ANT_BPWR_PAGE_TORQUE(up_evt_cnt, def_tick, def_period, acc_torque) \
- { \
- .update_event_count = (up_evt_cnt), \
- .tick = (def_tick), \
- .period = (def_period), \
- .accumulated_torque = (acc_torque) \
- }
-
-/**@brief Function for encoding pages 17, 18.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bpwr_page_torque_encode(uint8_t * p_page_buffer,
- ant_bpwr_page_torque_data_t const * p_page_data);
-
-/**@brief Function for decoding pages 17, 18.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_torque_decode(uint8_t const * p_page_buffer,
- ant_bpwr_page_torque_data_t * p_page_data);
-
-/**@brief Function for logging pages 17, 18.
- *
- * @param[in] p_page_data Pointer to the page data.
- */
-void ant_bpwr_page_torque_log(ant_bpwr_page_torque_data_t const * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGE_TORQUE_COMMON_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_pages.h b/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_pages.h
deleted file mode 100644
index 560b33e..0000000
--- a/components/ant/ant_profiles/ant_bpwr/pages/ant_bpwr_pages.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_PAGES_H__
-#define ANT_BPWR_PAGES_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_pages Bicycle Power profile pages
- * @{
- * @ingroup ant_bpwr
- * @brief This module implements functions for the BPWR data pages.
- */
-
-#include "ant_bpwr_page_1.h" // Calibration message main data page.
-#include "ant_bpwr_page_16.h" // Standard power-only page.
-#include "ant_bpwr_page_17.h" // Wheel Torque main data page.
-#include "ant_bpwr_page_18.h" // Crank Torque main data page.
-#include "ant_bpwr_common_data.h" // Instantaneous cadence data.
-#include "ant_common_page_80.h" // Manufacturer's information data page.
-#include "ant_common_page_81.h" // Product information data page.
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_PAGES_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.c b/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.c
deleted file mode 100644
index 9f0af3b..0000000
--- a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "ant_bpwr_simulator.h"
-#include "app_util.h"
-#include "nordic_common.h"
-
-#define POWER_MIN 0
-#define POWER_MAX 2000
-#define POWER_INCR 10
-
-#define CADENCE_MIN 0
-#define CADENCE_MAX (UINT8_MAX - 1)
-#define CADENCE_INCR 1
-
-#define PEDAL_MIN 0
-#define PEDAL_MAX 100
-#define PEDAL_INCR 1
-
-#define TORQUE_PERIOD 774
-#define SIMULATOR_TIME_INCREMENT BPWR_MSG_PERIOD
-
-#define TORQUE_INCR 10
-
-
-void ant_bpwr_simulator_init(ant_bpwr_simulator_t * p_simulator,
- ant_bpwr_simulator_cfg_t const * p_config,
- bool auto_change)
-{
- p_simulator->p_profile = p_config->p_profile;
- p_simulator->_cb.auto_change = auto_change;
- p_simulator->_cb.tick_incr = 0;
-
- p_simulator->_cb.power_sensorsim_cfg.min = POWER_MIN;
- p_simulator->_cb.power_sensorsim_cfg.max = POWER_MAX;
- p_simulator->_cb.power_sensorsim_cfg.incr = POWER_INCR;
- p_simulator->_cb.power_sensorsim_cfg.start_at_max = false;
-
- p_simulator->_cb.cadence_sensorsim_cfg.min = CADENCE_MIN;
- p_simulator->_cb.cadence_sensorsim_cfg.max = CADENCE_MAX;
- p_simulator->_cb.cadence_sensorsim_cfg.incr = CADENCE_INCR;
- p_simulator->_cb.cadence_sensorsim_cfg.start_at_max = false;
-
- p_simulator->_cb.pedal_sensorsim_cfg.min = PEDAL_MIN;
- p_simulator->_cb.pedal_sensorsim_cfg.max = PEDAL_MAX;
- p_simulator->_cb.pedal_sensorsim_cfg.incr = PEDAL_INCR;
- p_simulator->_cb.pedal_sensorsim_cfg.start_at_max = false;
-
- p_simulator->p_profile->BPWR_PROFILE_pedal_power.differentiation = 0x01; // right
-
- sensorsim_init(&(p_simulator->_cb.power_sensorsim_state),
- &(p_simulator->_cb.power_sensorsim_cfg));
- sensorsim_init(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg));
- sensorsim_init(&(p_simulator->_cb.pedal_sensorsim_state),
- &(p_simulator->_cb.pedal_sensorsim_cfg));
-}
-
-
-void ant_bpwr_simulator_one_iteration(ant_bpwr_simulator_t * p_simulator, ant_bpwr_evt_t event)
-{
- switch (event)
- {
- case ANT_BPWR_PAGE_16_UPDATED:
-
- if (p_simulator->_cb.auto_change)
- {
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.power_sensorsim_state),
- &(p_simulator->_cb.power_sensorsim_cfg)));
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg)));
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.pedal_sensorsim_state),
- &(p_simulator->_cb.pedal_sensorsim_cfg)));
- }
-
- p_simulator->p_profile->BPWR_PROFILE_instantaneous_power =
- p_simulator->_cb.power_sensorsim_state.current_val;
- p_simulator->p_profile->BPWR_PROFILE_accumulated_power +=
- p_simulator->_cb.power_sensorsim_state.current_val;
-
- if (p_simulator->p_profile->BPWR_PROFILE_accumulated_power == UINT16_MAX)
- {
- p_simulator->p_profile->BPWR_PROFILE_accumulated_power = 0;
- }
- p_simulator->p_profile->BPWR_PROFILE_instantaneous_cadence =
- p_simulator->_cb.cadence_sensorsim_state.current_val;
- p_simulator->p_profile->BPWR_PROFILE_pedal_power.distribution =
- p_simulator->_cb.pedal_sensorsim_state.current_val;
- p_simulator->p_profile->BPWR_PROFILE_power_update_event_count++;
- break;
-
- case ANT_BPWR_PAGE_17_UPDATED:
-
- if (p_simulator->_cb.auto_change)
- {
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg)));
- }
- p_simulator->p_profile->BPWR_PROFILE_instantaneous_cadence =
- p_simulator->_cb.cadence_sensorsim_state.current_val;
- p_simulator->p_profile->BPWR_PROFILE_wheel_period += TORQUE_PERIOD;
- p_simulator->_cb.tick_incr +=
- SIMULATOR_TIME_INCREMENT;
- p_simulator->p_profile->BPWR_PROFILE_wheel_tick +=
- p_simulator->_cb.tick_incr / (TORQUE_PERIOD * 16);
- p_simulator->_cb.tick_incr =
- p_simulator->_cb.tick_incr % (TORQUE_PERIOD * 16);
- p_simulator->p_profile->BPWR_PROFILE_wheel_accumulated_torque += TORQUE_INCR;
- p_simulator->p_profile->BPWR_PROFILE_wheel_update_event_count++;
- break;
-
- case ANT_BPWR_PAGE_18_UPDATED:
-
- if (p_simulator->_cb.auto_change)
- {
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg)));
- }
- p_simulator->p_profile->BPWR_PROFILE_instantaneous_cadence =
- p_simulator->_cb.cadence_sensorsim_state.current_val;
- p_simulator->p_profile->BPWR_PROFILE_crank_period = TORQUE_PERIOD;
- p_simulator->_cb.tick_incr +=
- SIMULATOR_TIME_INCREMENT;
- p_simulator->p_profile->BPWR_PROFILE_crank_tick +=
- p_simulator->_cb.tick_incr / (TORQUE_PERIOD * 16);
- p_simulator->_cb.tick_incr =
- p_simulator->_cb.tick_incr % (TORQUE_PERIOD * 16);
- p_simulator->p_profile->BPWR_PROFILE_crank_accumulated_torque += TORQUE_INCR;
- p_simulator->p_profile->BPWR_PROFILE_crank_update_event_count++;
- break;
-
- default:
- break;
- }
-}
-
-
-void ant_bpwr_simulator_increment(ant_bpwr_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_increment(&(p_simulator->_cb.power_sensorsim_state),
- &(p_simulator->_cb.power_sensorsim_cfg));
- sensorsim_increment(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg));
- sensorsim_increment(&(p_simulator->_cb.pedal_sensorsim_state),
- &(p_simulator->_cb.pedal_sensorsim_cfg));
- }
-}
-
-
-void ant_bpwr_simulator_decrement(ant_bpwr_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_decrement(&(p_simulator->_cb.power_sensorsim_state),
- &(p_simulator->_cb.power_sensorsim_cfg));
- sensorsim_decrement(&(p_simulator->_cb.cadence_sensorsim_state),
- &(p_simulator->_cb.cadence_sensorsim_cfg));
- sensorsim_decrement(&(p_simulator->_cb.pedal_sensorsim_state),
- &(p_simulator->_cb.pedal_sensorsim_cfg));
- }
-}
-
-
diff --git a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.h b/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.h
deleted file mode 100644
index a1e8309..0000000
--- a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_SIMULATOR_H__
-#define ANT_BPWR_SIMULATOR_H__
-
-/** @file
- *
- * @defgroup ant_sdk_simulators ANT simulators
- * @ingroup ant_sdk_utils
- * @brief Modules that simulate sensors.
- *
- * @defgroup ant_sdk_bpwr_simulator ANT BPWR simulator
- * @{
- * @ingroup ant_sdk_simulators
- * @brief ANT BPWR simulator module.
- *
- * @details This module simulates power for the ANT BPWR profile. The module calculates
- * abstract values, which are handled by the BPWR pages data model to ensure that they are
- * compatible. It provides a handler for changing the power value manually and functionality
- * for changing the power automatically.
- *
- */
-
-#include
-#include
-#include "bsp.h"
-#include "ant_bpwr.h"
-#include "sensorsim.h"
-#include "ant_bpwr_simulator_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief BPWR simulator configuration structure. */
-typedef struct
-{
- ant_bpwr_profile_t * p_profile; ///< Related profile.
- ant_bpwr_torque_t sensor_type; ///< Type of related sensor.
-} ant_bpwr_simulator_cfg_t;
-
-/**@brief BPWR simulator structure. */
-typedef struct
-{
- ant_bpwr_profile_t * p_profile; ///< Related profile.
- ant_bpwr_simulator_cb_t _cb; ///< Internal control block.
-} ant_bpwr_simulator_t;
-
-
-/**@brief Function for initializing the ANT BPWR simulator instance.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- * @param[in] p_config Pointer to the simulator configuration structure.
- * @param[in] auto_change Enable or disable automatic changes of the power.
- */
-void ant_bpwr_simulator_init(ant_bpwr_simulator_t * p_simulator,
- ant_bpwr_simulator_cfg_t const * p_config,
- bool auto_change);
-
-/**@brief Function for simulating a device event.
- *
- * @details Based on this event, the transmitter data is simulated.
- *
- * This function should be called in the BPWR TX event handler.
- */
-void ant_bpwr_simulator_one_iteration(ant_bpwr_simulator_t * p_simulator, ant_bpwr_evt_t event);
-
-/**@brief Function for incrementing the power value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_bpwr_simulator_increment(ant_bpwr_simulator_t * p_simulator);
-
-/**@brief Function for decrementing the power value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_bpwr_simulator_decrement(ant_bpwr_simulator_t * p_simulator);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_SIMULATOR_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator_local.h b/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator_local.h
deleted file mode 100644
index c7edae1..0000000
--- a/components/ant/ant_profiles/ant_bpwr/simulator/ant_bpwr_simulator_local.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BPWR_SIMULATOR_LOCAL_H__
-#define ANT_BPWR_SIMULATOR_LOCAL_H__
-
-#include
-#include
-#include "bsp.h"
-#include "ant_bpwr.h"
-#include "sensorsim.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @ingroup ant_sdk_bpwr_simulator
- * @brief BPWR simulator control block structure. */
-typedef struct
-{
- bool auto_change; ///< Power will change automatically (if auto_change is set) or manually.
- uint32_t tick_incr; ///< Fractional part of tick increment.
- sensorsim_state_t power_sensorsim_state; ///< Power state of the simulated sensor.
- sensorsim_cfg_t power_sensorsim_cfg; ///< Power configuration of the simulated sensor.
- sensorsim_state_t cadence_sensorsim_state; ///< Cadence stated of the simulated sensor.
- sensorsim_cfg_t cadence_sensorsim_cfg; ///< Cadence configuration of the simulated sensor.
- sensorsim_state_t pedal_sensorsim_state; ///< Pedal state of the simulated sensor.
- sensorsim_cfg_t pedal_sensorsim_cfg; ///< Pedal configuration of the simulated sensor.
-}ant_bpwr_simulator_cb_t;
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_SIMULATOR_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_bpwr/utils/ant_bpwr_utils.h b/components/ant/ant_profiles/ant_bpwr/utils/ant_bpwr_utils.h
deleted file mode 100644
index bdf91e3..0000000
--- a/components/ant/ant_profiles/ant_bpwr/utils/ant_bpwr_utils.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BPWR_UTILS_H__
-#define ANT_BPWR_UTILS_H__
-
-#include "app_util.h"
-#include "nrf_assert.h"
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bpwr_utils Bicycle Power profile utilities
- * @{
- * @ingroup ant_bpwr
- * @brief This module implements utilities for the Bicycle Power profile.
- *
- */
-
-/*@brief A reversal of torque period unit.
- *
- * @details According to the ANT BPWR specification, the torque period unit is 1/2048 of a second.
- */
-#define ANT_BPWR_TORQUE_PERIOD_UNIT_REVERSAL 2048
-#define ANT_BPWR_TORQUE_PERIOD_DISP_PRECISION 1000
-#define ANT_BPWR_TORQUE_PERIOD_RESCALE(VALUE) value_rescale((VALUE), ANT_BPWR_TORQUE_PERIOD_UNIT_REVERSAL, \
- ANT_BPWR_TORQUE_PERIOD_DISP_PRECISION)
-
-/*@brief A reversal of accumulated torque unit.
- *
- * @details According to the ANT BPWR specification, the accumulated torque unit is 1/32 of a Nm.
- */
-#define ANT_BPWR_ACC_TORQUE_UNIT_REVERSAL 32
-#define ANT_BPWR_ACC_TORQUE_DISP_PRECISION 10
-#define ANT_BPWR_ACC_TORQUE_RESCALE(VALUE) value_rescale((VALUE), ANT_BPWR_ACC_TORQUE_UNIT_REVERSAL, \
- ANT_BPWR_ACC_TORQUE_DISP_PRECISION)
-
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BPWR_UTILS_H__
-
diff --git a/components/ant/ant_profiles/ant_bsc/ant_bsc.c b/components/ant/ant_profiles/ant_bsc/ant_bsc.c
deleted file mode 100644
index 8a8bde2..0000000
--- a/components/ant/ant_profiles/ant_bsc/ant_bsc.c
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "nrf_assert.h"
-#include "nrf_error.h"
-#include "app_error.h"
-#include "ant_interface.h"
-#include "ant_bsc.h"
-#include "ant_bsc_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BSC"
-#if ANT_BSC_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_INFO_COLOR
-#else // ANT_BSC_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_LOG_ENABLED
-#include "nrf_log.h"
-
-#define MAIN_DATA_INTERVAL 4 /**< The number of background data pages sent between main data pages.*/
-#define BACKGROUND_DATA_INTERVAL 64 /**< The number of main data pages sent between background data page.
- Background data page is sent every 65th message. */
-#define TX_TOGGLE_DIVISOR 4 /**< The number of messages between changing state of toggle bit. */
-
-/**@brief BSC message data layout structure. */
-typedef struct
-{
- ant_bsc_page_t page_number : 7;
- uint8_t toggle_bit : 1;
- uint8_t page_payload[7];
-}ant_bsc_single_message_layout_t;
-
-typedef struct
-{
- uint8_t page_payload[8];
-}ant_bsc_combined_message_layout_t;
-
-typedef union
-{
- ant_bsc_single_message_layout_t speed_or_cadence;
- ant_bsc_combined_message_layout_t combined;
-}ant_bsc_message_layout_t;
-
-
-/**@brief Function for initializing the ANT BSC profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-static ret_code_t ant_bsc_init(ant_bsc_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config)
-{
- p_profile->channel_number = p_channel_config->channel_number;
-
- p_profile->page_0 = DEFAULT_ANT_BSC_PAGE0();
- p_profile->page_1 = DEFAULT_ANT_BSC_PAGE1();
- p_profile->page_2 = DEFAULT_ANT_BSC_PAGE2();
- p_profile->page_3 = DEFAULT_ANT_BSC_PAGE3();
- p_profile->page_4 = DEFAULT_ANT_BSC_PAGE4();
- p_profile->page_5 = DEFAULT_ANT_BSC_PAGE5();
- p_profile->page_comb_0 = DEFAULT_ANT_BSC_COMBINED_PAGE0();
-
- NRF_LOG_INFO("ANT BSC channel %u init\r\n", p_profile->channel_number);
- return ant_channel_init(p_channel_config);
-}
-
-ret_code_t ant_bsc_disp_init(ant_bsc_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bsc_disp_config_t const * p_disp_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_disp_config->evt_handler != NULL);
-
- p_profile->evt_handler = p_disp_config->evt_handler;
- p_profile->_cb.p_disp_cb = p_disp_config->p_cb;
-
- p_profile->_cb.p_disp_cb->device_type = p_channel_config->device_type;
-
- return ant_bsc_init(p_profile, p_channel_config);
-}
-
-ret_code_t ant_bsc_sens_init(ant_bsc_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bsc_sens_config_t const * p_sens_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_sens_config != NULL);
- ASSERT(p_sens_config->p_cb != NULL);
- ASSERT(p_sens_config->evt_handler != NULL);
-
- ASSERT((p_sens_config->main_page_number == ANT_BSC_PAGE_0)
- || (p_sens_config->main_page_number == ANT_BSC_PAGE_5)
- || (p_sens_config->main_page_number == ANT_BSC_COMB_PAGE_0));
-
- p_profile->evt_handler = p_sens_config->evt_handler;
- p_profile->_cb.p_sens_cb = p_sens_config->p_cb;
-
- p_profile->_cb.p_sens_cb->page_1_present = p_sens_config->page_1_present;
- p_profile->_cb.p_sens_cb->page_4_present = p_sens_config->page_4_present;
- p_profile->_cb.p_sens_cb->main_page_number = p_sens_config->main_page_number;
- p_profile->_cb.p_sens_cb->bkgd_page_number =
- p_sens_config->page_1_present ? ANT_BSC_PAGE_1 : ANT_BSC_PAGE_2;
- p_profile->_cb.p_sens_cb->message_counter = 0;
- p_profile->_cb.p_sens_cb->toggle_bit = true;
- p_profile->_cb.p_sens_cb->device_type = p_channel_config->device_type; /* Device type is set up in channel config */
-
- return ant_bsc_init(p_profile, p_channel_config);
-}
-
-/**@brief Function for setting the next background page number.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- */
-__STATIC_INLINE void next_bkgd_page_number_set(ant_bsc_profile_t * p_profile)
-{
- /* Determine the last background page*/
- ant_bsc_page_t last_bkgd_page =
- p_profile->_cb.p_sens_cb->page_4_present ? ANT_BSC_PAGE_4 : ANT_BSC_PAGE_3;
-
- /* Switch the background page according to user settings */
- ++(p_profile->_cb.p_sens_cb->bkgd_page_number);
- if (p_profile->_cb.p_sens_cb->bkgd_page_number > last_bkgd_page)
- {
- p_profile->_cb.p_sens_cb->bkgd_page_number =
- p_profile->_cb.p_sens_cb->page_1_present ? ANT_BSC_PAGE_1 : ANT_BSC_PAGE_2;
- }
-}
-
-/**@brief Function for getting next page number to send.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @return Next page number.
- */
-static ant_bsc_page_t next_page_number_get(ant_bsc_profile_t * p_profile)
-{
- ant_bsc_page_t page_number;
-
- /* This is a single speed or cadence sensor - switch data page */
- if (p_profile->_cb.p_sens_cb->message_counter < (BACKGROUND_DATA_INTERVAL))
- {
- /* Return main page */
- page_number = p_profile->_cb.p_sens_cb->main_page_number;
- }
- else
- {
- /* Return background page */
- page_number = p_profile->_cb.p_sens_cb->bkgd_page_number;
- }
-
- /* Set page toggle bit */
- if ((p_profile->_cb.p_sens_cb->message_counter % TX_TOGGLE_DIVISOR) == 0)
- {
- p_profile->_cb.p_sens_cb->toggle_bit ^= 1;
- }
-
- /* Update message counter, wrap when counter equals 64 + 4 */
- ++(p_profile->_cb.p_sens_cb->message_counter);
- if (p_profile->_cb.p_sens_cb->message_counter == (BACKGROUND_DATA_INTERVAL + MAIN_DATA_INTERVAL))
- {
- p_profile->_cb.p_sens_cb->message_counter = 0;
- /* Set new background data page number */
- next_bkgd_page_number_set(p_profile);
- }
-
- return page_number;
-}
-
-/**@brief Function for encoding BSC message.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[out] p_message_payload Pointer to the message payload structure.
- *
- * @note Assume to be called each time when Tx window will occur.
- */
-static void sens_message_encode(ant_bsc_profile_t * p_profile, uint8_t * p_message_payload)
-{
- ant_bsc_message_layout_t * p_bsc_message_payload = (ant_bsc_message_layout_t *)p_message_payload;
- ant_bsc_evt_t bsc_sens_event;
-
- if (p_profile->_cb.p_sens_cb->device_type == BSC_COMBINED_DEVICE_TYPE)
- {
- NRF_LOG_INFO("BSC TX Page: \"Combined Speed & Cadence Page\"\r\n");
- ant_bsc_combined_page_0_encode(p_bsc_message_payload->combined.page_payload,
- &(p_profile->page_comb_0));
- bsc_sens_event = (ant_bsc_evt_t) ANT_BSC_COMB_PAGE_0_UPDATED;
- }
- else
- {
- p_bsc_message_payload->speed_or_cadence.page_number = next_page_number_get(p_profile);
- p_bsc_message_payload->speed_or_cadence.toggle_bit = p_profile->_cb.p_sens_cb->toggle_bit;
- NRF_LOG_INFO("BSC TX Page number: %u\r\n",
- p_bsc_message_payload->speed_or_cadence.page_number);
-
- ant_bsc_page_0_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_0));
- bsc_sens_event = (ant_bsc_evt_t) p_bsc_message_payload->speed_or_cadence.page_number;
-
- switch (p_bsc_message_payload->speed_or_cadence.page_number)
- {
- case ANT_BSC_PAGE_0:
- // No implementation needed
- break;
- case ANT_BSC_PAGE_1:
- ant_bsc_page_1_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_1));
- break;
- case ANT_BSC_PAGE_2:
- ant_bsc_page_2_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_2));
- break;
- case ANT_BSC_PAGE_3:
- ant_bsc_page_3_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_3));
- break;
- case ANT_BSC_PAGE_4:
- ant_bsc_page_4_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_4));
- break;
- case ANT_BSC_PAGE_5:
- ant_bsc_page_5_encode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_5));
- break;
- default:
- // No implementation needed
- break;
- }
- }
-
- p_profile->evt_handler(p_profile, bsc_sens_event);
-}
-
-/**@brief Function for setting payload for ANT message and sending it.
- *
- * @param[in] p_profile Pointer to the profile instance.
- */
-static void ant_message_send(ant_bsc_profile_t * p_profile)
-{
- uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE];
- uint32_t err_code;
-
- sens_message_encode(p_profile, p_message_payload);
- err_code = sd_ant_broadcast_message_tx(p_profile->channel_number,
- sizeof(p_message_payload),
- p_message_payload);
- APP_ERROR_CHECK(err_code);
-}
-
-void ant_bsc_sens_evt_handler(ant_bsc_profile_t * p_profile,
- ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- switch (p_ant_event->event)
- {
- case EVENT_TX:
- ant_message_send(p_profile);
- break;
-
- default:
- break;
- }
- }
-}
-
-ret_code_t ant_bsc_disp_open(ant_bsc_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- NRF_LOG_INFO("ANT BSC channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-ret_code_t ant_bsc_sens_open(ant_bsc_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- // Fill tx buffer for the first frame
- ant_message_send(p_profile);
-
- NRF_LOG_INFO("ANT BSC channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-/**@brief Function for decoding BSC message.
- *
- * @param[in,out] p_profile Pointer to the profile instance.
- * @param[in] p_message_payload Pointer to the message payload structure.
- *
- * @note Assume to be call each time when Rx window will occur.
- */
-static void disp_message_decode(ant_bsc_profile_t * p_profile, uint8_t * p_message_payload)
-{
- const ant_bsc_message_layout_t * p_bsc_message_payload =
- (ant_bsc_message_layout_t *)p_message_payload;
- ant_bsc_evt_t bsc_disp_event;
-
- if (p_profile->_cb.p_disp_cb->device_type == BSC_COMBINED_DEVICE_TYPE)
- {
- NRF_LOG_INFO("BSC RX Page Number: \"Combined Speed & Cadence Page\"\r\n");
- ant_bsc_combined_page_0_decode(p_bsc_message_payload->combined.page_payload,
- &(p_profile->page_comb_0));
- bsc_disp_event = (ant_bsc_evt_t) ANT_BSC_COMB_PAGE_0_UPDATED;
- }
- else
- {
- NRF_LOG_INFO("BSC RX Page Number: %u\r\n",
- p_bsc_message_payload->speed_or_cadence.page_number);
- ant_bsc_page_0_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_0)); // Page 0 is present in each message
- bsc_disp_event = (ant_bsc_evt_t) p_bsc_message_payload->speed_or_cadence.page_number;
-
- switch (p_bsc_message_payload->speed_or_cadence.page_number)
- {
- case ANT_BSC_PAGE_0:
- // No implementation needed
- break;
-
- case ANT_BSC_PAGE_1:
- ant_bsc_page_1_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_1));
- break;
-
- case ANT_BSC_PAGE_2:
- ant_bsc_page_2_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_2));
- break;
-
- case ANT_BSC_PAGE_3:
- ant_bsc_page_3_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_3));
- break;
-
- case ANT_BSC_PAGE_4:
- ant_bsc_page_4_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_4));
- break;
-
- case ANT_BSC_PAGE_5:
- ant_bsc_page_5_decode(p_bsc_message_payload->speed_or_cadence.page_payload,
- &(p_profile->page_5));
- break;
-
- default:
- // No implementation needed
- break;
- }
- }
-
- p_profile->evt_handler(p_profile, bsc_disp_event);
-}
-
-void ant_bsc_disp_evt_handler(ant_bsc_profile_t * p_profile,
- ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- ANT_MESSAGE * p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
- switch (p_ant_event->event)
- {
- case EVENT_RX:
-
- if (p_message->ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
- {
- disp_message_decode(p_profile, p_message->ANT_MESSAGE_aucPayload);
- }
- break;
- default:
- break;
- }
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/ant_bsc.h b/components/ant/ant_profiles/ant_bsc/ant_bsc.h
deleted file mode 100644
index aec6226..0000000
--- a/components/ant/ant_profiles/ant_bsc/ant_bsc.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/** @file
- *
- * @defgroup ant_bsc Bicycle Speed and Cadence profile
- * @{
- * @ingroup ant_sdk_profiles
- * @brief This module implements the Bicycle Speed and Cadence profile.
- *
- */
-
-#ifndef ANT_BSC_H__
-#define ANT_BSC_H__
-
-#include
-#include
-#include "sdk_errors.h"
-#include "ant_parameters.h"
-#include "ant_stack_handler_types.h"
-#include "ant_channel_config.h"
-#include "ant_bsc_pages.h"
-
-#define BSC_ANTPLUS_RF_FREQ 0x39u ///< Frequency, decimal 57 (2457 MHz).
-
-#define BSC_SPEED_DEVICE_TYPE 0x7B ///< Device type reserved for ANT+ bike speed sensor.
-#define BSC_CADENCE_DEVICE_TYPE 0x7A ///< Device type reserved for ANT+ bike cadence sensor.
-#define BSC_COMBINED_DEVICE_TYPE 0x79 ///< Device type reserved for ANT+ bike combined speed and cadence sensor.
-
-#define BSC_MSG_PERIOD_4Hz 1u ///< Message period, 4 Hz (in basic period counts, where basic period time = 0.25 s).
-#define BSC_MSG_PERIOD_2Hz 2u ///< Message period, 2 Hz (in basic period counts).
-#define BSC_MSG_PERIOD_1Hz 4u ///< Message period, 1 Hz (in basic period counts).
-#define BSC_MSG_PERIOD_SPEED 0x1FB6u ///< Message period in ticks, decimal 8118 (4.04 Hz).
-#define BSC_MSG_PERIOD_CADENCE 0x1FA6u ///< Message period in ticks, decimal 8102 (4.04 Hz).
-#define BSC_MSG_PERIOD_COMBINED 0x1F96u ///< Message period in ticks, decimal 8086 (4.05 Hz).
-
-
-#define BSC_EXT_ASSIGN 0x00 ///< ANT ext assign (see Ext. Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
-#define BSC_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE_RX_ONLY ///< Display BSC channel type.
-#define BSC_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER ///< Sensor BSC channel type.
-
-
-/**@brief Select the basic ANT channel period (in ticks) for the BSC profile depending on the device type.
- *
- * @param[in] DEVICE_TYPE Type of device. Supported types: @ref BSC_SPEED_DEVICE_TYPE, @ref BSC_CADENCE_DEVICE_TYPE,
- * @ref BSC_COMBINED_DEVICE_TYPE.
- */
-#define BSC_DEVICE_TICKS(DEVICE_TYPE) \
- ((DEVICE_TYPE) == (BSC_SPEED_DEVICE_TYPE) ? (BSC_MSG_PERIOD_SPEED) : \
- ((DEVICE_TYPE) == (BSC_CADENCE_DEVICE_TYPE) ? (BSC_MSG_PERIOD_CADENCE) : \
- ((DEVICE_TYPE) == (BSC_COMBINED_DEVICE_TYPE) ? (BSC_MSG_PERIOD_COMBINED) : 0u)))
-
-/**@brief Calculate the channel period (in ticks) depending on the device type and the chosen message frequency.
- *
- * @param[in] DEVICE_TYPE Type of device. Supported types: @ref BSC_SPEED_DEVICE_TYPE, @ref BSC_CADENCE_DEVICE_TYPE,
- * @ref BSC_COMBINED_DEVICE_TYPE.
- * @param[in] BSC_MSG_PERIOD Channel data period. The BSC profile supports only the following periods:
- * @ref BSC_MSG_PERIOD_4Hz, @ref BSC_MSG_PERIOD_2Hz, @ref BSC_MSG_PERIOD_1Hz.
- */
-#define BSC_PERIOD_TICKS(DEVICE_TYPE, BSC_MSG_PERIOD) \
- ((BSC_DEVICE_TICKS(DEVICE_TYPE)) * (BSC_MSG_PERIOD))
-
-/**@brief Initialize an ANT channel configuration structure for the BSC profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_TYPE Type of device. Supported types: @ref BSC_SPEED_DEVICE_TYPE, @ref BSC_CADENCE_DEVICE_TYPE,
- * @ref BSC_COMBINED_DEVICE_TYPE.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- * @param[in] BSC_MSG_PERIOD Channel data frequency in Hz. The BSC profile supports only the following frequencies:
- * @ref BSC_MSG_PERIOD_4Hz, @ref BSC_MSG_PERIOD_2Hz, @ref BSC_MSG_PERIOD_1Hz.
- */
-#define BSC_DISP_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER, \
- BSC_MSG_PERIOD) \
-static const ant_channel_config_t NAME##_channel_bsc_disp_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = BSC_DISP_CHANNEL_TYPE, \
- .ext_assign = BSC_EXT_ASSIGN, \
- .rf_freq = BSC_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = (DEVICE_TYPE), \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = BSC_PERIOD_TICKS(DEVICE_TYPE, BSC_MSG_PERIOD), \
- .network_number = (NETWORK_NUMBER), \
- }
-#define BSC_DISP_CHANNEL_CONFIG(NAME) &NAME##_channel_bsc_disp_config
-
-/**@brief Initialize an ANT channel configuration structure for the BSC profile (Transmitter).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_TYPE Type of device. Supported types: @ref BSC_SPEED_DEVICE_TYPE, @ref BSC_CADENCE_DEVICE_TYPE,
- * @ref BSC_COMBINED_DEVICE_TYPE.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- */
-#define BSC_SENS_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER) \
-static const ant_channel_config_t NAME##_channel_bsc_sens_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = BSC_SENS_CHANNEL_TYPE, \
- .ext_assign = BSC_EXT_ASSIGN, \
- .rf_freq = BSC_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = (DEVICE_TYPE), \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = BSC_PERIOD_TICKS(DEVICE_TYPE, BSC_MSG_PERIOD_4Hz), \
- .network_number = (NETWORK_NUMBER), \
- }
-#define BSC_SENS_CHANNEL_CONFIG(NAME) &NAME##_channel_bsc_sens_config
-
-/**@brief Initialize an ANT profile configuration structure for the BSC profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the BSC profile.
- */
-#define BSC_DISP_PROFILE_CONFIG_DEF(NAME, \
- EVT_HANDLER) \
-static ant_bsc_disp_cb_t NAME##_bsc_disp_cb; \
-static const ant_bsc_disp_config_t NAME##_profile_bsc_disp_config = \
- { \
- .p_cb = &NAME##_bsc_disp_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define BSC_DISP_PROFILE_CONFIG(NAME) &NAME##_profile_bsc_disp_config
-
-/**@brief Initialize an ANT profile configuration structure for the BSC profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] PAGE_1_PRESENT Determines whether page 1 is included.
- * @param[in] PAGE_4_PRESENT Determines whether page 4 is included.
- * @param[in] MAIN_PAGE_NUMBER Determines the main data page (@ref ANT_BSC_PAGE_0 or @ref ANT_BSC_PAGE_5 or @ref ANT_BSC_COMB_PAGE_0).
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the BSC profile.
- */
-#define BSC_SENS_PROFILE_CONFIG_DEF(NAME, \
- PAGE_1_PRESENT, \
- PAGE_4_PRESENT, \
- MAIN_PAGE_NUMBER, \
- EVT_HANDLER) \
-static ant_bsc_sens_cb_t NAME##_bsc_sens_cb; \
-static const ant_bsc_sens_config_t NAME##_profile_bsc_sens_config = \
- { \
- .page_1_present = (PAGE_1_PRESENT), \
- .page_4_present = (PAGE_4_PRESENT), \
- .main_page_number = (MAIN_PAGE_NUMBER), \
- .p_cb = &NAME##_bsc_sens_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define BSC_SENS_PROFILE_CONFIG(NAME) &NAME##_profile_bsc_sens_config
-
-/**@brief BSC page number type. */
-typedef enum{
- ANT_BSC_PAGE_0, ///< Main data page number 0.
- ANT_BSC_PAGE_1, ///< Background data page number 1. This page is optional.
- ANT_BSC_PAGE_2, ///< Background data page number 2.
- ANT_BSC_PAGE_3, ///< Background data page number 3.
- ANT_BSC_PAGE_4, ///< Background data page number 4. This page is optional.
- ANT_BSC_PAGE_5, ///< Main data page number 5. This page is optional.
- ANT_BSC_COMB_PAGE_0 ///< Main data page number 0 for combined speed and cadence sensor.
-} ant_bsc_page_t;
-
-/**@brief BSC profile event type. */
-typedef enum{
- ANT_BSC_PAGE_0_UPDATED = ANT_BSC_PAGE_0, ///< Data page 0 has been updated (Display) or sent (Sensor).
- ANT_BSC_PAGE_1_UPDATED = ANT_BSC_PAGE_1, ///< Data page 0 and page 1 have been updated (Display) or sent (Sensor).
- ANT_BSC_PAGE_2_UPDATED = ANT_BSC_PAGE_2, ///< Data page 0 and page 2 have been updated (Display) or sent (Sensor).
- ANT_BSC_PAGE_3_UPDATED = ANT_BSC_PAGE_3, ///< Data page 0 and page 3 have been updated (Display) or sent (Sensor).
- ANT_BSC_PAGE_4_UPDATED = ANT_BSC_PAGE_4, ///< Data page 0 and page 4 have been updated (Display) or sent (Sensor).
- ANT_BSC_PAGE_5_UPDATED = ANT_BSC_PAGE_5, ///< Data page 0 and page 5 have been updated (Display) or sent (Sensor).
- ANT_BSC_COMB_PAGE_0_UPDATED = ANT_BSC_COMB_PAGE_0, ///< Combined Speed and cadence data page has been updated (Display) or sent (Sensor).
-} ant_bsc_evt_t;
-
-// Forward declaration of the ant_bsc_profile_t type.
-typedef struct ant_bsc_profile_s ant_bsc_profile_t;
-
-/**@brief BSC event handler type. */
-typedef void (* ant_bsc_evt_handler_t) (ant_bsc_profile_t *, ant_bsc_evt_t);
-
-#include "ant_bsc_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief BSC Display configuration structure. */
-typedef struct
-{
- ant_bsc_disp_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_bsc_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BSC profile.
-} ant_bsc_disp_config_t;
-
-/**@brief BSC Sensor configuration structure. */
-typedef struct
-{
- bool page_1_present; ///< Determines whether page 1 is included.
- bool page_4_present; ///< Determines whether page 4 is included.
- ant_bsc_page_t main_page_number; ///< Determines the main data page (@ref ANT_BSC_PAGE_0 or @ref ANT_BSC_PAGE_5 or @ref ANT_BSC_COMB_PAGE_0).
- ant_bsc_sens_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_bsc_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BSC profile.
-} ant_bsc_sens_config_t;
-
-/**@brief BSC profile structure. */
-struct ant_bsc_profile_s
-{
- uint8_t channel_number; ///< Channel number assigned to the profile.
- union {
- ant_bsc_disp_cb_t * p_disp_cb;
- ant_bsc_sens_cb_t * p_sens_cb;
- } _cb; ///< Pointer to internal control block.
- ant_bsc_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the BSC profile.
- ant_bsc_page0_data_t page_0; ///< Page 0.
- ant_bsc_page1_data_t page_1; ///< Page 1.
- ant_bsc_page2_data_t page_2; ///< Page 2.
- ant_bsc_page3_data_t page_3; ///< Page 3.
- ant_bsc_page4_data_t page_4; ///< Page 4.
- ant_bsc_page5_data_t page_5; ///< Page 5.
- ant_bsc_combined_page0_data_t page_comb_0; ///< Page 0 for combined speed and cadence sensor.
-};
-
-/** @name Defines for accessing ant_bsc_profile_t member variables
-@{ */
-#define BSC_PROFILE_event_time page_0.event_time
-#define BSC_PROFILE_rev_count page_0.rev_count
-#define BSC_PROFILE_operating_time page_1.operating_time
-#define BSC_PROFILE_manuf_id page_2.manuf_id
-#define BSC_PROFILE_serial_num page_2.serial_num
-#define BSC_PROFILE_hw_version page_3.hw_version
-#define BSC_PROFILE_sw_version page_3.sw_version
-#define BSC_PROFILE_model_num page_3.model_num
-#define BSC_PROFILE_fract_bat_volt page_4.fract_bat_volt
-#define BSC_PROFILE_coarse_bat_volt page_4.coarse_bat_volt
-#define BSC_PROFILE_bat_status page_4.bat_status
-#define BSC_PROFILE_stop_indicator page_5.stop_indicator
-#define BSC_PROFILE_cadence_event_time page_comb_0.cadence_event_time
-#define BSC_PROFILE_cadence_rev_count page_comb_0.cadence_rev_count
-#define BSC_PROFILE_speed_event_time page_comb_0.speed_event_time
-#define BSC_PROFILE_speed_rev_count page_comb_0.speed_rev_count
-/** @} */
-
-/**@brief Function for initializing the ANT BSC profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_disp_config Pointer to the BSC display configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_bsc_disp_init(ant_bsc_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bsc_disp_config_t const * p_disp_config);
-
-/**@brief Function for initializing the ANT BSC profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_sens_config Pointer to the BSC sensor configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_bsc_sens_init(ant_bsc_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_bsc_sens_config_t const * p_sens_config);
-
-/**@brief Function for opening the profile instance channel for the ANT BSC Display.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_bsc_disp_open(ant_bsc_profile_t * p_profile);
-
-/**@brief Function for opening the profile instance channel for the ANT BSC Sensor.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_bsc_sens_open(ant_bsc_profile_t * p_profile);
-
-/**@brief Function for handling the Sensor ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Bicycle Speed and Cadence Sensor profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_bsc_sens_evt_handler(ant_bsc_profile_t * p_profile,
- ant_evt_t * p_ant_event);
-
-/**@brief Function for handling the Display ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Bicycle Speed and Cadence Display profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_bsc_disp_evt_handler(ant_bsc_profile_t * p_profile,
- ant_evt_t * p_ant_event);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_H__
-/** @} */
-
diff --git a/components/ant/ant_profiles/ant_bsc/ant_bsc_local.h b/components/ant/ant_profiles/ant_bsc/ant_bsc_local.h
deleted file mode 100644
index 41060be..0000000
--- a/components/ant/ant_profiles/ant_bsc/ant_bsc_local.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef ANT_BSC_LOCAL_H__
-#define ANT_BSC_LOCAL_H__
-
-#include
-#include
-#include "ant_bsc.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup ant_bsc
- * @{
- */
-
-/**@brief BSC Sensor control block. */
-typedef struct
-{
- uint8_t device_type;
- uint8_t toggle_bit : 1;
- ant_bsc_page_t main_page_number : 7;
- uint8_t page_1_present : 1;
- uint8_t page_4_present : 1;
- ant_bsc_page_t bkgd_page_number : 6;
- uint8_t message_counter;
-}ant_bsc_sens_cb_t;
-
-/**@brief BSC Display control block. */
-typedef struct
-{
- uint8_t device_type;
-}ant_bsc_disp_cb_t;
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.c
deleted file mode 100644
index 7e430b5..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_combined_page_0.h"
-#include "ant_bsc_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_COMBINED_PAGE_0"
-#if ANT_BSC_COMBINED_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_COMBINED_PAGE_0_INFO_COLOR
-#else // ANT_BSC_COMBINED_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_COMBINED_PAGE_0_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 0 data layout structure. */
-typedef struct
-{
- uint8_t cadence_evt_time_LSB;
- uint8_t cadence_evt_time_MSB;
- uint8_t cadence_rev_count_LSB;
- uint8_t cadence_rev_count_MSB;
- uint8_t speed_evt_time_LSB;
- uint8_t speed_evt_time_MSB;
- uint8_t speed_rev_count_LSB;
- uint8_t speed_rev_count_MSB;
-}ant_bsc_combined_page0_data_layout_t;
-
-/**@brief Function for printing combined speed and cadence page0 data. */
-static void comb_page0_data_log(ant_bsc_combined_page0_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Cadence Revolution count: %u\r\n",
- (unsigned int)p_page_data->cadence_rev_count);
-
- NRF_LOG_INFO("Cadence event time: %u.%03us\r\n",
- (unsigned int)ANT_BSC_EVENT_TIME_SEC(p_page_data->cadence_event_time),
- (unsigned int)ANT_BSC_EVENT_TIME_MSEC(p_page_data->cadence_event_time));
-
- NRF_LOG_INFO("Speed Revolution count: %u\r\n",
- (unsigned int)p_page_data->speed_rev_count);
-
- NRF_LOG_INFO("Speed event time: %u.%03us\r\n\n",
- (unsigned int)ANT_BSC_EVENT_TIME_SEC(p_page_data->speed_event_time),
- (unsigned int)ANT_BSC_EVENT_TIME_MSEC(p_page_data->speed_event_time));
-}
-
-void ant_bsc_combined_page_0_encode(uint8_t * p_page_buffer, ant_bsc_combined_page0_data_t const * p_page_data)
-{
- ant_bsc_combined_page0_data_layout_t * p_outcoming_data = (ant_bsc_combined_page0_data_layout_t *) p_page_buffer;
-
- uint16_t cadence_event_time = p_page_data->cadence_event_time;
- uint16_t cadence_rev_count = p_page_data->cadence_rev_count;
- uint16_t speed_event_time = p_page_data->speed_event_time;
- uint16_t speed_rev_count = p_page_data->speed_rev_count;
-
- p_outcoming_data->cadence_evt_time_LSB = (uint8_t)(cadence_event_time & UINT8_MAX);
- p_outcoming_data->cadence_evt_time_MSB = (uint8_t)((cadence_event_time >> 8) & UINT8_MAX);
- p_outcoming_data->cadence_rev_count_LSB = (uint8_t)(cadence_rev_count & UINT8_MAX);
- p_outcoming_data->cadence_rev_count_MSB = (uint8_t)((cadence_rev_count >> 8) & UINT8_MAX);
- p_outcoming_data->speed_evt_time_LSB = (uint8_t)(speed_event_time & UINT8_MAX);
- p_outcoming_data->speed_evt_time_MSB = (uint8_t)((speed_event_time >> 8) & UINT8_MAX);
- p_outcoming_data->speed_rev_count_LSB = (uint8_t)(speed_rev_count & UINT8_MAX);
- p_outcoming_data->speed_rev_count_MSB = (uint8_t)((speed_rev_count >> 8) & UINT8_MAX);
-
- comb_page0_data_log(p_page_data);
-}
-
-void ant_bsc_combined_page_0_decode(uint8_t const * p_page_buffer, ant_bsc_combined_page0_data_t * p_page_data)
-{
- ant_bsc_combined_page0_data_layout_t const * p_incoming_data = (ant_bsc_combined_page0_data_layout_t *)p_page_buffer;
-
- uint16_t cadence_event_time = (uint16_t)((p_incoming_data->cadence_evt_time_MSB << 8)
- + p_incoming_data->cadence_evt_time_LSB);
- uint16_t cadence_revolution_count = (uint16_t) ((p_incoming_data->cadence_rev_count_MSB << 8)
- + p_incoming_data->cadence_rev_count_LSB);
- uint16_t speed_event_time = (uint16_t)((p_incoming_data->speed_evt_time_MSB << 8)
- + p_incoming_data->speed_evt_time_LSB);
- uint16_t speed_revolution_count = (uint16_t) ((p_incoming_data->speed_rev_count_MSB << 8)
- + p_incoming_data->speed_rev_count_LSB);
-
- p_page_data->cadence_event_time = cadence_event_time;
- p_page_data->cadence_rev_count = cadence_revolution_count;
- p_page_data->speed_event_time = speed_event_time;
- p_page_data->speed_rev_count = speed_revolution_count;
-
- comb_page0_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.h
deleted file mode 100644
index b6e6834..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_combined_page_0.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_COMBINED_PAGE_0_H__
-#define ANT_BSC_COMBINED_PAGE_0_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_combined_page0 BSC profile page 0 (combined speed & cadence)
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for Bicycle Combined Speed and Cadence data page 0.
- *
- * This structure is used as a common page.
- */
-typedef struct
-{
- uint16_t cadence_event_time; ///< Cadence event time.
- uint16_t cadence_rev_count; ///< Cadence revolution count.
- uint16_t speed_event_time; ///< Speed event time.
- uint16_t speed_rev_count; ///< Speed revolution count.
-} ant_bsc_combined_page0_data_t;
-
-/**@brief Initialize page 0.
- */
-#define DEFAULT_ANT_BSC_COMBINED_PAGE0() \
- (ant_bsc_combined_page0_data_t) \
- { \
- .cadence_event_time = 0, \
- .cadence_rev_count = 0, \
- .speed_event_time = 0, \
- .speed_rev_count = 0, \
- }
-
-/**@brief Function for encoding page 0.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_combined_page_0_encode(uint8_t * p_page_buffer, ant_bsc_combined_page0_data_t const * p_page_data);
-
-/**@brief Function for decoding page 0.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_combined_page_0_decode(uint8_t const * p_page_buffer, ant_bsc_combined_page0_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_COMBINED_PAGE_0_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.c
deleted file mode 100644
index aa6ead8..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_0.h"
-#include "ant_bsc_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_0"
-#if ANT_BSC_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_0_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_0_INFO_COLOR
-#else // ANT_BSC_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_0_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 0 data layout structure. */
-typedef struct
-{
- uint8_t reserved[3];
- uint8_t bsc_evt_time_LSB;
- uint8_t bsc_evt_time_MSB;
- uint8_t bsc_rev_count_LSB;
- uint8_t bsc_rev_count_MSB;
-}ant_bsc_page0_data_layout_t;
-
-/**@brief Function for printing speed or cadence page0 data. */
-static void page0_data_log(ant_bsc_page0_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Revolution count: %u\r\n", (unsigned int)p_page_data->rev_count);
-
- NRF_LOG_INFO("BSC event time: %u.%03us\r\n",
- (unsigned int)ANT_BSC_EVENT_TIME_SEC(p_page_data->event_time),
- (unsigned int)ANT_BSC_EVENT_TIME_MSEC(p_page_data->event_time));
-
-// NRF_LOG_INFO("%03us\r\n", (unsigned int)ANT_BSC_EVENT_TIME_MSEC(p_page_data->event_time));
-}
-
-void ant_bsc_page_0_encode(uint8_t * p_page_buffer, ant_bsc_page0_data_t const * p_page_data)
-{
- ant_bsc_page0_data_layout_t * p_outcoming_data = (ant_bsc_page0_data_layout_t *) p_page_buffer;
- uint16_t event_time = p_page_data->event_time;
- uint16_t rev_count = p_page_data->rev_count;
-
- p_outcoming_data->reserved[0] = UINT8_MAX;
- p_outcoming_data->reserved[1] = UINT8_MAX;
- p_outcoming_data->reserved[2] = UINT8_MAX;
- p_outcoming_data->bsc_evt_time_LSB = (uint8_t)(event_time & UINT8_MAX);
- p_outcoming_data->bsc_evt_time_MSB = (uint8_t)((event_time >> 8) & UINT8_MAX);
- p_outcoming_data->bsc_rev_count_LSB = (uint8_t)(rev_count & UINT8_MAX);
- p_outcoming_data->bsc_rev_count_MSB = (uint8_t)((rev_count >> 8) & UINT8_MAX);
-
- page0_data_log(p_page_data);
-}
-
-void ant_bsc_page_0_decode(uint8_t const * p_page_buffer, ant_bsc_page0_data_t * p_page_data)
-{
- ant_bsc_page0_data_layout_t const * p_incoming_data = (ant_bsc_page0_data_layout_t *)p_page_buffer;
-
- uint16_t event_time = (uint16_t)((p_incoming_data->bsc_evt_time_MSB << 8)
- + p_incoming_data->bsc_evt_time_LSB);
-
- uint16_t revolution_count = (uint16_t) ((p_incoming_data->bsc_rev_count_MSB << 8)
- + p_incoming_data->bsc_rev_count_LSB);
-
- p_page_data->event_time = event_time;
- p_page_data->rev_count = revolution_count;
-
- page0_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.h
deleted file mode 100644
index d3362c1..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_0.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_0_H__
-#define ANT_BSC_PAGE_0_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page0 BSC profile page 0
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BSC data page 0.
- *
- * This structure is used as a common page.
- */
-typedef struct
-{
- uint16_t event_time; ///< Speed or cadence event time.
- uint16_t rev_count; ///< Speed or cadence revolution count.
-} ant_bsc_page0_data_t;
-
-/**@brief Initialize page 0.
- */
-#define DEFAULT_ANT_BSC_PAGE0() \
- (ant_bsc_page0_data_t) \
- { \
- .event_time = 0, \
- .rev_count = 0 \
- }
-
-/**@brief Function for encoding page 0.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_0_encode(uint8_t * p_page_buffer, ant_bsc_page0_data_t const * p_page_data);
-
-/**@brief Function for decoding page 0.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_0_decode(uint8_t const * p_page_buffer, ant_bsc_page0_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_0_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.c
deleted file mode 100644
index f878dd8..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_1.h"
-#include "ant_bsc_utils.h"
-#include "app_util.h"
-#include "nordic_common.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_1"
-#if ANT_BSC_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_1_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_1_INFO_COLOR
-#else // ANT_BSC_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_1_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 1 data layout structure. */
-typedef struct
-{
- uint8_t cumulative_operating_time[3];
- uint8_t reserved[4];
-}ant_bsc_page1_data_layout_t;
-
-/**@brief Function for printing speed or cadence page1 data. */
-static void page1_data_log(ant_bsc_page1_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Cumulative operating time: %ud %uh %um %us\r\n",
- (unsigned int)ANT_BSC_OPERATING_DAYS(p_page_data->operating_time),
- (unsigned int)ANT_BSC_OPERATING_HOURS(p_page_data->operating_time),
- (unsigned int)ANT_BSC_OPERATING_MINUTES(p_page_data->operating_time),
- (unsigned int)ANT_BSC_OPERATING_SECONDS(p_page_data->operating_time));
-}
-
-void ant_bsc_page_1_encode(uint8_t * p_page_buffer, ant_bsc_page1_data_t const * p_page_data)
-{
- ant_bsc_page1_data_layout_t * p_outcoming_data = (ant_bsc_page1_data_layout_t *)p_page_buffer;
-
- UNUSED_PARAMETER(uint24_encode(p_page_data->operating_time,
- p_outcoming_data->cumulative_operating_time));
- page1_data_log( p_page_data);
-}
-
-void ant_bsc_page_1_decode(uint8_t const * p_page_buffer, ant_bsc_page1_data_t * p_page_data)
-{
- ant_bsc_page1_data_layout_t const * p_incoming_data = (ant_bsc_page1_data_layout_t *)p_page_buffer;
-
- p_page_data->operating_time = uint24_decode(p_incoming_data->cumulative_operating_time);
-
- page1_data_log( p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
-
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.h
deleted file mode 100644
index 4cb6bc4..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_1.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_1_H__
-#define ANT_BSC_PAGE_1_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page1 BSC profile page 1
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BSC data page 1.
- *
- * This structure implements only page 1 specific data.
- */
-typedef struct
-{
- uint32_t operating_time; ///< Operating time.
-} ant_bsc_page1_data_t;
-
-/**@brief Initialize page 1.
- */
-#define DEFAULT_ANT_BSC_PAGE1() \
- (ant_bsc_page1_data_t) \
- { \
- .operating_time = 0, \
- }
-
-/**@brief Function for encoding page 1.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_1_encode(uint8_t * p_page_buffer, ant_bsc_page1_data_t const * p_page_data);
-
-/**@brief Function for decoding page 1.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_1_decode(uint8_t const * p_page_buffer, ant_bsc_page1_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_1_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.c
deleted file mode 100644
index c305d28..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_2.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_2"
-#if ANT_BSC_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_2_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_2_INFO_COLOR
-#else // ANT_BSC_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_2_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 2 data layout structure. */
-typedef struct
-{
- uint8_t manuf_id;
- uint8_t serial_num_LSB;
- uint8_t serial_num_MSB;
- uint8_t reserved[4];
-}ant_bsc_page2_data_layout_t;
-
-/**@brief Function for printing speed or cadence page2 data. */
-static void page2_data_log(ant_bsc_page2_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Manufacturer ID: %u\r\n", (unsigned int)p_page_data->manuf_id);
- NRF_LOG_INFO("Serial No (upper 16-bits): 0x%X\r\n",
- (unsigned int)p_page_data->serial_num);
-}
-
-void ant_bsc_page_2_encode(uint8_t * p_page_buffer, ant_bsc_page2_data_t const * p_page_data)
-{
- ant_bsc_page2_data_layout_t * p_outcoming_data = (ant_bsc_page2_data_layout_t *)p_page_buffer;
- uint32_t serial_num = p_page_data->serial_num;
-
- p_outcoming_data->manuf_id = (uint8_t)p_page_data->manuf_id;
- p_outcoming_data->serial_num_LSB = (uint8_t)(serial_num & UINT8_MAX);
- p_outcoming_data->serial_num_MSB = (uint8_t)((serial_num >> 8) & UINT8_MAX);
-
- page2_data_log( p_page_data);
-}
-
-void ant_bsc_page_2_decode(uint8_t const * p_page_buffer, ant_bsc_page2_data_t * p_page_data)
-{
- ant_bsc_page2_data_layout_t const * p_incoming_data = (ant_bsc_page2_data_layout_t *)p_page_buffer;
- uint32_t serial_num = (uint32_t)((p_incoming_data->serial_num_MSB << 8)
- + p_incoming_data->serial_num_LSB);
-
- p_page_data->manuf_id = (uint32_t)p_incoming_data->manuf_id;
- p_page_data->serial_num = serial_num;
-
- page2_data_log( p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.h
deleted file mode 100644
index c116ca9..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_2.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_2_H__
-#define ANT_BSC_PAGE_2_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page2 BSC profile page 2
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BSC data page 2.
- *
- * This structure implements only page 2 specific data.
- */
-typedef struct
-{
- uint8_t manuf_id; ///< Manufacturer ID.
- uint16_t serial_num; ///< Serial number.
-} ant_bsc_page2_data_t;
-
-/**@brief Initialize page 2.
- */
-#define DEFAULT_ANT_BSC_PAGE2() \
- (ant_bsc_page2_data_t) \
- { \
- .manuf_id = 0, \
- .serial_num = 0, \
- }
-
-/**@brief Function for encoding page 2.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_2_encode(uint8_t * p_page_buffer, ant_bsc_page2_data_t const * p_page_data);
-
-/**@brief Function for decoding page 2.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_2_decode(uint8_t const * p_page_buffer, ant_bsc_page2_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_2_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.c
deleted file mode 100644
index c0c04ba..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_3.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_3"
-#if ANT_BSC_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_3_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_3_INFO_COLOR
-#else // ANT_BSC_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_3_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 3 data layout structure. */
-typedef struct
-{
- uint8_t hw_version;
- uint8_t sw_version;
- uint8_t model_num;
- uint8_t reserved[4];
-}ant_bsc_page3_data_layout_t;
-
-/**@brief Function for printing speed or cadence page3 data. */
-static void page3_data_log(ant_bsc_page3_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Hardware Rev ID: %u\r\n", (unsigned int)p_page_data->hw_version);
- NRF_LOG_INFO("Model Number: %u\r\n", (unsigned int)p_page_data->model_num);
- NRF_LOG_INFO("Software Ver ID: %u\r\n", (unsigned int)p_page_data->sw_version);
-}
-
-void ant_bsc_page_3_encode(uint8_t * p_page_buffer, ant_bsc_page3_data_t const * p_page_data)
-{
- ant_bsc_page3_data_layout_t * p_outcoming_data = (ant_bsc_page3_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->hw_version = (uint8_t)p_page_data->hw_version;
- p_outcoming_data->sw_version = (uint8_t)p_page_data->sw_version;
- p_outcoming_data->model_num = (uint8_t)p_page_data->model_num;
-
- page3_data_log( p_page_data);
-}
-
-void ant_bsc_page_3_decode(uint8_t const * p_page_buffer, ant_bsc_page3_data_t * p_page_data)
-{
- ant_bsc_page3_data_layout_t const * p_incoming_data = (ant_bsc_page3_data_layout_t *)p_page_buffer;
-
- p_page_data->hw_version = (uint32_t)p_incoming_data->hw_version;
- p_page_data->sw_version = (uint32_t)p_incoming_data->sw_version;
- p_page_data->model_num = (uint32_t)p_incoming_data->model_num;
-
- page3_data_log( p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.h
deleted file mode 100644
index a16e2bf..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_3.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_3_H__
-#define ANT_BSC_PAGE_3_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page3 BSC profile page 3
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BSC data page 3.
- *
- * This structure implements only page 3 specific data.
- */
-typedef struct
-{
- uint8_t hw_version; ///< Hardware version.
- uint8_t sw_version; ///< Software version.
- uint8_t model_num; ///< Model number.
-} ant_bsc_page3_data_t;
-
-/**@brief Initialize page 3.
- */
-#define DEFAULT_ANT_BSC_PAGE3() \
- (ant_bsc_page3_data_t) \
- { \
- .hw_version = 0, \
- .sw_version = 0, \
- .model_num = 0, \
- }
-
-/**@brief Function for encoding page 3.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_3_encode(uint8_t * p_page_buffer, ant_bsc_page3_data_t const * p_page_data);
-
-/**@brief Function for decoding page 3.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_3_decode(uint8_t const * p_page_buffer, ant_bsc_page3_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_3_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.c
deleted file mode 100644
index 9e8b110..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_4.h"
-#include "ant_bsc_utils.h"
-#include "app_util.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_4"
-#if ANT_BSC_PAGE_4_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_4_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_4_INFO_COLOR
-#else // ANT_BSC_PAGE_4_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_4_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC page 4 data layout structure. */
-typedef struct
-{
- uint8_t reserved_byte;
- uint8_t fract_bat_volt;
- uint8_t coarse_bat_volt : 4;
- uint8_t bat_status : 3;
- uint8_t bitfield_reserved : 1;
- uint8_t reserved[4];
-}ant_bsc_page4_data_layout_t;
-
-/* Display precission must be updated. */
-STATIC_ASSERT(ANT_BSC_BAT_VOLTAGE_PRECISION == 1000);
-
-/**@brief Function for printing speed or cadence page4 data. */
-static void page4_data_log( ant_bsc_page4_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Battery voltage: %u.%03uV\r\n",
- (unsigned int)p_page_data->coarse_bat_volt,
- (unsigned int)ANT_BSC_BAT_VOLTAGE_FRACTION_MV(p_page_data->fract_bat_volt));
- NRF_LOG_INFO("Battery status: %u\r\n", (unsigned int)p_page_data->bat_status);
-}
-
-void ant_bsc_page_4_encode(uint8_t * p_page_buffer, ant_bsc_page4_data_t const * p_page_data)
-{
- ant_bsc_page4_data_layout_t * p_outcoming_data = (ant_bsc_page4_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->reserved_byte = UINT8_MAX;
- p_outcoming_data->fract_bat_volt = p_page_data->fract_bat_volt;
- p_outcoming_data->coarse_bat_volt = p_page_data->coarse_bat_volt;
- p_outcoming_data->bat_status = p_page_data->bat_status;
- p_outcoming_data->bitfield_reserved = 0;
-
- page4_data_log( p_page_data);
-}
-
-void ant_bsc_page_4_decode(uint8_t const * p_page_buffer, ant_bsc_page4_data_t * p_page_data)
-{
- ant_bsc_page4_data_layout_t const * p_incoming_data = (ant_bsc_page4_data_layout_t *)p_page_buffer;
-
- p_page_data->fract_bat_volt = p_incoming_data->fract_bat_volt;
- p_page_data->coarse_bat_volt = p_incoming_data->coarse_bat_volt;
- p_page_data->bat_status = p_incoming_data->bat_status;
-
- page4_data_log( p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.h
deleted file mode 100644
index 7af4919..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_4.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_4_H__
-#define ANT_BSC_PAGE_4_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page4 BSC profile page 4
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief BSC profile battery status.
- *
- * This enum represents possible battery status values for the ANT BSC profile.
- */
-typedef enum
-{
- RESERVED0 = 0, ///< Reserved.
- BSC_BAT_STATUS_NEW = 1, ///< Battery status: new.
- BSC_BAT_STATUS_GOOD = 2, ///< Battery status: good.
- BSC_BAT_STATUS_OK = 3, ///< Battery status: ok.
- BSC_BAT_STATUS_LOW = 4, ///< Battery status: low.
- BSC_BAT_STATUS_CRITICAL = 5, ///< Battery status: critical.
- RESERVED1 = 6, ///< Reserved.
- BSC_BAT_STATUS_INVALID = 7 ///< Invalid battery status.
-} ant_bsc_bat_status_t;
-
-/**@brief Data structure for BSC data page 4.
- *
- * This structure implements only page 4 specific data.
- */
-typedef struct
-{
- uint8_t fract_bat_volt; ///< Fractional battery voltage.
- uint8_t coarse_bat_volt : 4; ///< Coarse battery voltage.
- uint8_t bat_status : 3; ///< Battery status.
-} ant_bsc_page4_data_t;
-
-/**@brief Initialize page 4.
- */
-#define DEFAULT_ANT_BSC_PAGE4() \
- (ant_bsc_page4_data_t) \
- { \
- .fract_bat_volt = 0, \
- .coarse_bat_volt = 0, \
- .bat_status = BSC_BAT_STATUS_INVALID \
- }
-
-/**@brief Function for encoding page 4.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_4_encode(uint8_t * p_page_buffer, ant_bsc_page4_data_t const * p_page_data);
-
-/**@brief Function for decoding page 4.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_4_decode(uint8_t const * p_page_buffer, ant_bsc_page4_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_4_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.c b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.c
deleted file mode 100644
index 07c5c91..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_BSC)
-
-#include "ant_bsc_page_5.h"
-#include "ant_bsc_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_BCS_PAGE_5"
-#if ANT_BSC_PAGE_5_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_BSC_PAGE_5_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_BSC_PAGE_5_INFO_COLOR
-#else // ANT_BSC_PAGE_5_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_BSC_PAGE_5_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief BSC profile page 5 bitfields definitions. */
-#define ANT_BSC_STOP_IND_MASK 0x01
-
-/**@brief BSC page 5 data layout structure. */
-typedef struct
-{
- uint8_t flags;
- uint8_t reserved[6];
-}ant_bsc_page5_data_layout_t;
-
-/**@brief Function for printing speed or cadence page5 data. */
-static void page5_data_log(ant_bsc_page5_data_t const * p_page_data)
-{
- if (p_page_data->stop_indicator)
- {
- NRF_LOG_INFO("Bicycle stopped.\r\n");
- }
- else
- {
- NRF_LOG_INFO("Bicycle moving.\r\n");
- }
-}
-
-void ant_bsc_page_5_encode(uint8_t * p_page_buffer, ant_bsc_page5_data_t const * p_page_data)
-{
- ant_bsc_page5_data_layout_t * p_outcoming_data = (ant_bsc_page5_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->flags = (uint8_t)p_page_data->stop_indicator;
-
- page5_data_log( p_page_data);
-}
-
-void ant_bsc_page_5_decode(uint8_t const * p_page_buffer, ant_bsc_page5_data_t * p_page_data)
-{
- ant_bsc_page5_data_layout_t const * p_incoming_data = (ant_bsc_page5_data_layout_t *)p_page_buffer;
-
- p_page_data->stop_indicator = (p_incoming_data->flags) & ANT_BSC_STOP_IND_MASK;
-
- page5_data_log( p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_BSC)
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.h
deleted file mode 100644
index 22b250d..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_page_5.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_PAGE_5_H__
-#define ANT_BSC_PAGE_5_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_page5 BSC profile page 5
- * @{
- * @ingroup ant_sdk_profiles_bsc_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for BSC data page 5.
- *
- * This structure implements only page 5 specific data.
- */
-typedef struct
-{
- uint8_t stop_indicator:1; ///< Stop indication bit.
- uint8_t reserved:7; ///< Reserved.
-} ant_bsc_page5_data_t;
-
-/**@brief Initialize page 5.
- */
-#define DEFAULT_ANT_BSC_PAGE5() \
- (ant_bsc_page5_data_t) \
- { \
- .stop_indicator = 0, \
- .reserved = 0, \
- }
-
-/**@brief Function for encoding page 5.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_bsc_page_5_encode(uint8_t * p_page_buffer, ant_bsc_page5_data_t const * p_page_data);
-
-/**@brief Function for decoding page 5.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_bsc_page_5_decode(uint8_t const * p_page_buffer, ant_bsc_page5_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_PAGE_5_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_pages.h b/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_pages.h
deleted file mode 100644
index 392678c..0000000
--- a/components/ant/ant_profiles/ant_bsc/pages/ant_bsc_pages.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __ANT_BSC_PAGES_H
-#define __ANT_BSC_PAGES_H
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_pages Bicycle Speed and Cadence profile pages
- * @{
- * @ingroup ant_bsc
- * @brief This module implements functions for the BSC data pages.
- */
-
-#include "ant_bsc_page_0.h"
-#include "ant_bsc_page_1.h"
-#include "ant_bsc_page_2.h"
-#include "ant_bsc_page_3.h"
-#include "ant_bsc_page_4.h"
-#include "ant_bsc_page_5.h"
-#include "ant_bsc_combined_page_0.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __ANT_BSC_PAGES_H
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.c b/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.c
deleted file mode 100644
index 0ea8062..0000000
--- a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.c
+++ /dev/null
@@ -1,281 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "ant_bsc_simulator.h"
-#include "ant_bsc_utils.h"
-#include "app_util.h"
-
-#define ITERATION_ANT_CYCLES(DEVICE_TYPE) \
- (BSC_PERIOD_TICKS(DEVICE_TYPE, BSC_MSG_PERIOD_4Hz)) ///< period of calculation [1/32678 s], defined in ANT device profile
- // use the same DEVICE TYPE as in profile definition
-#define ITERATION_PERIOD(DEVICE_TYPE) \
- ((ITERATION_ANT_CYCLES(DEVICE_TYPE)) * 1024 / ANT_CLOCK_FREQUENCY) ///< integer part of calculation's period [1/1024 s]
-#define ITERATION_FRACTION(DEVICE_TYPE) \
- ((ITERATION_ANT_CYCLES(DEVICE_TYPE)) * 1024 % ANT_CLOCK_FREQUENCY) ///< fractional part of calculation's period [1/32678 s]
-
-#define SPEED_SIM_MIN_VAL 0u ///< speed simulation minimum value [m/s]
-#define SPEED_SIM_MAX_VAL 16u ///< speed simulation maximum value [m/s]
-#define SPEED_SIM_INCREMENT 1u ///< speed simulation value increment [m/s]
-#define CADENCE_SIM_MIN_VAL 70u ///< cadence simulation minimum value [rpm]
-#define CADENCE_SIM_MAX_VAL 120u ///< cadence simulation maximum value [rpm]
-#define CADENCE_SIM_INCREMENT 1u ///< cadence simulation value increment [rpm]
-#define WHEEL_CIRCUMFERENCE 1766u ///< bike wheel circumference [mm]
-#define MM_TO_METERS(MM_VAL) ((MM_VAL) / 1000u)
-#define TWO_SEC_TO_TICKS 2048 ///< number of [1/1024s] ticks in 2 sec period
-#define CUMULATIVE_TIME_UNIT 2 ///< cumulative time unit
-
-void ant_bsc_simulator_init(ant_bsc_simulator_t * p_simulator,
- ant_bsc_simulator_cfg_t const * p_config,
- bool auto_change)
-{
- p_simulator->p_profile = p_config->p_profile;
- p_simulator->_cb.auto_change = auto_change;
- p_simulator->_cb.speed_sim_val = SPEED_SIM_MIN_VAL;
- p_simulator->_cb.cadence_sim_val = CADENCE_SIM_MIN_VAL;
- p_simulator->_cb.time_since_last_s_evt = 0;
- p_simulator->_cb.fraction_since_last_s_evt = 0;
- p_simulator->_cb.time_since_last_c_evt = 0;
- p_simulator->_cb.fraction_since_last_c_evt = 0;
- p_simulator->_cb.device_type = p_config->device_type;
-
- p_simulator->_cb.sensorsim_s_cfg.min = SPEED_SIM_MIN_VAL;
- p_simulator->_cb.sensorsim_s_cfg.max = SPEED_SIM_MAX_VAL;
- p_simulator->_cb.sensorsim_s_cfg.incr = SPEED_SIM_INCREMENT;
- p_simulator->_cb.sensorsim_s_cfg.start_at_max = false;
- sensorsim_init(&(p_simulator->_cb.sensorsim_s_state),
- &(p_simulator->_cb.sensorsim_s_cfg));
- p_simulator->_cb.sensorsim_c_cfg.min = CADENCE_SIM_MIN_VAL;
- p_simulator->_cb.sensorsim_c_cfg.max = CADENCE_SIM_MAX_VAL;
- p_simulator->_cb.sensorsim_c_cfg.incr = CADENCE_SIM_INCREMENT;
- p_simulator->_cb.sensorsim_c_cfg.start_at_max = false;
- p_simulator->_cb.stop_cnt = 0;
- sensorsim_init(&(p_simulator->_cb.sensorsim_c_state),
- &(p_simulator->_cb.sensorsim_c_cfg));
-}
-
-
-void ant_bsc_simulator_one_iteration(ant_bsc_simulator_t * p_simulator)
-{
-
- // Set constant battery voltage
- p_simulator->p_profile->BSC_PROFILE_coarse_bat_volt = 2;
- p_simulator->p_profile->BSC_PROFILE_fract_bat_volt = 200;
- p_simulator->p_profile->BSC_PROFILE_bat_status = BSC_BAT_STATUS_GOOD;
-
- // Calculate speed and cadence values
- if (p_simulator->_cb.auto_change)
- {
- p_simulator->_cb.speed_sim_val = sensorsim_measure(&(p_simulator->_cb.sensorsim_s_state),
- &(p_simulator->_cb.sensorsim_s_cfg));
- p_simulator->_cb.cadence_sim_val = sensorsim_measure(&(p_simulator->_cb.sensorsim_c_state),
- &(p_simulator->_cb.sensorsim_c_cfg));
- }
- else
- {
- p_simulator->_cb.speed_sim_val = p_simulator->_cb.sensorsim_s_state.current_val;
- p_simulator->_cb.cadence_sim_val = p_simulator->_cb.sensorsim_c_state.current_val;
- }
-
- // Simulate bicycle stopped for around 10s and go for around 5s only in auto-simulation
- if (p_simulator->_cb.auto_change)
- {
- if ((p_simulator->p_profile->_cb.p_sens_cb->main_page_number == ANT_BSC_PAGE_5) &&
- (p_simulator->_cb.stop_cnt++ < 40))
- {
- p_simulator->_cb.speed_sim_val = 0;
- p_simulator->_cb.cadence_sim_val = 0;
- }
- else
- {
- if (p_simulator->_cb.stop_cnt == 60)
- {
- p_simulator->_cb.stop_cnt = 0;
- }
- }
- }
- if (p_simulator->_cb.speed_sim_val == 0)
- {
- p_simulator->p_profile->BSC_PROFILE_stop_indicator = 1;
- }
- else
- {
- p_simulator->p_profile->BSC_PROFILE_stop_indicator = 0;
- }
-
- // @note: Take a local copy within scope in order to assist the compiler in variable register
- // allocation.
- const uint32_t computed_speed = p_simulator->_cb.speed_sim_val;
- const uint32_t computed_cadence = p_simulator->_cb.cadence_sim_val;
-
- // @note: This implementation assumes that the current instantaneous speed/cadence can vary and this
- // function is called with static frequency.
- // value and the speed/cadence pulse interval is derived from it. The computation is based on 60
- // seconds in a minute and the used time base is 1/1024 seconds.
- const uint32_t current_speed_pulse_interval =
- MM_TO_METERS((WHEEL_CIRCUMFERENCE * 1024u) / computed_speed);
- const uint32_t current_cadence_pulse_interval = (60u * 1024u) / computed_cadence;
-
- //update time from last evt detected
- p_simulator->_cb.time_since_last_s_evt += ITERATION_PERIOD(p_simulator->_cb.device_type);
- p_simulator->_cb.time_since_last_c_evt += ITERATION_PERIOD(p_simulator->_cb.device_type);
-
- // extended calculation by fraction make calculating accurate in long time perspective
- p_simulator->_cb.fraction_since_last_s_evt += ITERATION_FRACTION(p_simulator->_cb.device_type);
- p_simulator->_cb.fraction_since_last_c_evt += ITERATION_FRACTION(p_simulator->_cb.device_type);
-
- uint32_t add_period = p_simulator->_cb.fraction_since_last_s_evt / ANT_CLOCK_FREQUENCY;
- if (add_period > 0)
- {
- p_simulator->_cb.time_since_last_s_evt++;
- p_simulator->_cb.fraction_since_last_s_evt %= ANT_CLOCK_FREQUENCY;
- }
-
- add_period = p_simulator->_cb.fraction_since_last_c_evt / ANT_CLOCK_FREQUENCY;
- if (add_period > 0)
- {
- p_simulator->_cb.time_since_last_c_evt++;
- p_simulator->_cb.fraction_since_last_c_evt %= ANT_CLOCK_FREQUENCY;
- }
-
- // Calculate cumulative time based on time since last event (from profile data) in [1/1024] ticks
- int16_t diff = p_simulator->p_profile->BSC_PROFILE_event_time -
- p_simulator->_cb.prev_time_since_evt;
- p_simulator->_cb.prev_time_since_evt = p_simulator->p_profile->BSC_PROFILE_event_time;
-
- if (diff >= 0) // Check for time count overflow
- {
- // No overflow
- p_simulator->_cb.cumulative_time += diff / TWO_SEC_TO_TICKS;
- p_simulator->_cb.cumulative_time_frac += diff % TWO_SEC_TO_TICKS;
- }
- else
- {
- p_simulator->_cb.cumulative_time += (UINT16_MAX + diff) / TWO_SEC_TO_TICKS;
- p_simulator->_cb.cumulative_time_frac += (UINT16_MAX + diff) % TWO_SEC_TO_TICKS;
- }
- // Check fraction
- if ((p_simulator->_cb.cumulative_time_frac / TWO_SEC_TO_TICKS) > 0)
- {
- p_simulator->_cb.cumulative_time += p_simulator->_cb.cumulative_time_frac / TWO_SEC_TO_TICKS;
- p_simulator->_cb.cumulative_time_frac %= TWO_SEC_TO_TICKS;
- }
- // Update page data if necessary
- if (p_simulator->_cb.cumulative_time != p_simulator->p_profile->BSC_PROFILE_operating_time)
- {
- p_simulator->p_profile->BSC_PROFILE_operating_time = p_simulator->_cb.cumulative_time;
- }
-
- //calc number of events as will fill
- uint32_t new_s_events = p_simulator->_cb.time_since_last_s_evt /
- current_speed_pulse_interval;
- uint32_t add_speed_event_time = new_s_events * current_speed_pulse_interval;
- if ((new_s_events > 0) && ((p_simulator->_cb.device_type == BSC_SPEED_DEVICE_TYPE) ||
- (p_simulator->_cb.device_type == BSC_COMBINED_DEVICE_TYPE)))
- {
- p_simulator->p_profile->BSC_PROFILE_rev_count += new_s_events;
- p_simulator->p_profile->BSC_PROFILE_speed_rev_count += new_s_events;
-
- // Current speed event time is the previous event time plus the current speed
- // pulse interval.
- uint32_t current_speed_event_time = p_simulator->p_profile->BSC_PROFILE_event_time +
- add_speed_event_time;
- // Set current event time.
- p_simulator->p_profile->BSC_PROFILE_event_time = current_speed_event_time; // <- B<4,5> <-
-
- current_speed_event_time = p_simulator->p_profile->BSC_PROFILE_speed_event_time +
- add_speed_event_time;
- // Set current event time for combined device.
- p_simulator->p_profile->BSC_PROFILE_speed_event_time = current_speed_event_time;
-
- p_simulator->_cb.time_since_last_s_evt -= add_speed_event_time;
- }
-
- uint32_t new_c_events = p_simulator->_cb.time_since_last_c_evt /
- current_cadence_pulse_interval;
- uint32_t add_cadence_event_time = new_c_events * current_cadence_pulse_interval;
- if ((new_c_events > 0) && ((p_simulator->_cb.device_type == BSC_CADENCE_DEVICE_TYPE) ||
- (p_simulator->_cb.device_type == BSC_COMBINED_DEVICE_TYPE)))
- {
- p_simulator->p_profile->BSC_PROFILE_rev_count += new_c_events;
- p_simulator->p_profile->BSC_PROFILE_cadence_rev_count += new_c_events;
-
- // Current speed event time is the previous event time plus the current speed
- // pulse interval.
- uint32_t current_cadence_event_time = p_simulator->p_profile->BSC_PROFILE_event_time +
- add_cadence_event_time;
- // Set current event time.
- p_simulator->p_profile->BSC_PROFILE_event_time = current_cadence_event_time; //<- B<4,5> <-
-
- current_cadence_event_time = p_simulator->p_profile->BSC_PROFILE_cadence_event_time +
- add_cadence_event_time;
- // Set current event time for combined device.
- p_simulator->p_profile->BSC_PROFILE_cadence_event_time = current_cadence_event_time;
-
- p_simulator->_cb.time_since_last_c_evt -= add_cadence_event_time;
- }
-}
-
-
-void ant_bsc_simulator_increment(ant_bsc_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- // Speed
- sensorsim_increment(&(p_simulator->_cb.sensorsim_s_state),
- &(p_simulator->_cb.sensorsim_s_cfg));
- // Cadence
- sensorsim_increment(&(p_simulator->_cb.sensorsim_c_state),
- &(p_simulator->_cb.sensorsim_c_cfg));
- }
-}
-
-
-void ant_bsc_simulator_decrement(ant_bsc_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- // Speed
- sensorsim_decrement(&(p_simulator->_cb.sensorsim_s_state),
- &(p_simulator->_cb.sensorsim_s_cfg));
- // Cadence
- sensorsim_decrement(&(p_simulator->_cb.sensorsim_c_state),
- &(p_simulator->_cb.sensorsim_c_cfg));
- }
-}
diff --git a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.h b/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.h
deleted file mode 100644
index 249f7d6..0000000
--- a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BSC_SIMULATOR_H__
-#define ANT_BSC_SIMULATOR_H__
-
-/** @file
- *
- * @defgroup ant_sdk_bsc_simulator ANT BSC simulator
- * @{
- * @ingroup ant_sdk_simulators
- * @brief ANT BSC simulator module.
- *
- * @details This module simulates a pulse for the ANT Bicycle Speed and Cadence profile. The module
- * calculates abstract values, which are handled by the BSC pages data model to ensure that
- * they are compatible. It provides a handler for changing the cadence and speed values manually
- * as well as functionality to change the values automatically.
- *
- */
-
-#include
-#include
-#include "ant_bsc.h"
-#include "ant_bsc_utils.h"
-#include "sensorsim.h"
-#include "ant_bsc_simulator_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief BSC simulator configuration structure. */
-typedef struct
-{
- ant_bsc_profile_t * p_profile; ///< Related profile.
- uint8_t device_type; ///< BSC device type (must be consistent with the type chosen for the profile). Supported types:
- // @ref BSC_SPEED_DEVICE_TYPE, @ref BSC_CADENCE_DEVICE_TYPE, @ref BSC_COMBINED_DEVICE_TYPE.
-} ant_bsc_simulator_cfg_t;
-
-/**@brief BSC simulator structure. */
-typedef struct
-{
- ant_bsc_profile_t * p_profile; ///< Related profile.
- ant_bsc_simulator_cb_t _cb; ///< Internal control block.
-} ant_bsc_simulator_t;
-
-
-/**@brief Function for initializing the ANT BSC simulator instance.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- * @param[in] p_config Pointer to the simulator configuration structure.
- * @param[in] auto_change Enable or disable automatic changes of speed or cadence.
- */
-void ant_bsc_simulator_init(ant_bsc_simulator_t * p_simulator,
- ant_bsc_simulator_cfg_t const * p_config,
- bool auto_change);
-
-/**@brief Function for simulating a device event.
- *
- * @details Based on this event, the transmitter data is simulated.
- *
- * This function should be called in the BSC Sensor event handler.
- */
-void ant_bsc_simulator_one_iteration(ant_bsc_simulator_t * p_simulator);
-
-/**@brief Function for incrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_bsc_simulator_increment(ant_bsc_simulator_t * p_simulator);
-
-/**@brief Function for decrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_bsc_simulator_decrement(ant_bsc_simulator_t * p_simulator);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_SIMULATOR_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator_local.h b/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator_local.h
deleted file mode 100644
index c405033..0000000
--- a/components/ant/ant_profiles/ant_bsc/simulator/ant_bsc_simulator_local.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_BSC_SIMULATOR_LOCAL_H__
-#define ANT_BSC_SIMULATOR_LOCAL_H__
-
-#include
-#include
-#include "ant_bsc.h"
-#include "sensorsim.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**@brief BSC simulator control block structure. */
-typedef struct
-{
- uint8_t device_type;
- bool auto_change; ///< Cadence will change automatically (if auto_change is set) or manually.
- uint16_t speed_sim_val; ///< Instantaneous speed value.
- uint16_t cadence_sim_val; ///< Instantaneous cadence value.
- uint32_t time_since_last_s_evt; ///< Time since last speed event occurred (integer part).
- uint64_t fraction_since_last_s_evt; ///< Time since last speed event occurred (fractional part).
- uint32_t time_since_last_c_evt; ///< Time since last cadence event occurred (integer part).
- uint64_t fraction_since_last_c_evt; ///< Time since last cadence event occurred (fractional part).
- sensorsim_state_t sensorsim_s_state; ///< State of the simulated speed sensor.
- sensorsim_cfg_t sensorsim_s_cfg; ///< Configuration of the simulated speed sensor.
- sensorsim_state_t sensorsim_c_state; ///< State of the simulated cadence sensor.
- sensorsim_cfg_t sensorsim_c_cfg; ///< Configuration of the simulated cadence sensor.
- uint16_t prev_time_since_evt; ///< Previous value of time since the last event.
- uint32_t cumulative_time; ///< Cumulative time in 2 s ticks used for updating the cumulative time.
- uint32_t cumulative_time_frac; ///< Cumulative time in 2 s ticks (fractional part), used for updating the cumulative time.
- uint8_t stop_cnt; ///< Counter used for simulating bicycle stopped state.
-} ant_bsc_simulator_cb_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_SIMULATOR_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_bsc/utils/ant_bsc_utils.h b/components/ant/ant_profiles/ant_bsc/utils/ant_bsc_utils.h
deleted file mode 100644
index 964f53d..0000000
--- a/components/ant/ant_profiles/ant_bsc/utils/ant_bsc_utils.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_BSC_UTILS_H__
-#define ANT_BSC_UTILS_H__
-
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_bsc_utils Bicycle Speed and Cadence profile utilities
- * @{
- * @ingroup ant_bsc
- * @brief This module implements utilities for the Bicycle Speed and Cadence profile.
- *
- */
-
-/**@brief Unit for BSC operating time.
- *
- * @details According to the ANT BSC specification, the operating time unit is 2 seconds.
- */
-#define ANT_BSC_OPERATING_TIME_UNIT 2u
-
-/**@brief This macro should be used to get the seconds part of the operating time.
- */
-#define ANT_BSC_OPERATING_SECONDS(OPERATING_TIME) (((OPERATING_TIME) * ANT_BSC_OPERATING_TIME_UNIT) % 60)
-
-/**@brief This macro should be used to get the minutes part of the operating time.
- */
-#define ANT_BSC_OPERATING_MINUTES(OPERATING_TIME) ((((OPERATING_TIME) * ANT_BSC_OPERATING_TIME_UNIT) / 60) % 60)
-
-/**@brief This macro should be used to get the hours part of the operating time.
- */
-#define ANT_BSC_OPERATING_HOURS(OPERATING_TIME) ((((OPERATING_TIME) * ANT_BSC_OPERATING_TIME_UNIT) / (60 * 60)) % 24)
-
-/**@brief This macro should be used to get the days part of the operating time.
- */
-#define ANT_BSC_OPERATING_DAYS(OPERATING_TIME) ((((OPERATING_TIME) * ANT_BSC_OPERATING_TIME_UNIT) / (60 * 60)) / 24)
-
-/**@brief Number of Bicycle Speed or Cadence event time counts per second.
- *
- * @details According to the ANT BSC specification, the speed or cadence event time unit is 1/1024 of a second.
- */
-#define ANT_BSC_EVENT_TIME_COUNTS_PER_SEC 1024u
-
-/**@brief BSC event time display required precision.
- *
- * @details This value is used to decode the number of milliseconds.
- */
-#define ANT_BSC_EVENT_TIME_PRECISION 1000u
-
-/**@brief This macro should be used to get the seconds part of the BSC event time.
- */
-#define ANT_BSC_EVENT_TIME_SEC(EVENT_TIME) ((EVENT_TIME) / ANT_BSC_EVENT_TIME_COUNTS_PER_SEC)
-
-/**@brief This macro should be used to get the milliseconds part of the BSC event time.
- */
-#define ANT_BSC_EVENT_TIME_MSEC(EVENT_TIME) (((((EVENT_TIME) % ANT_BSC_EVENT_TIME_COUNTS_PER_SEC) * ANT_BSC_EVENT_TIME_PRECISION) \
- + ANT_BSC_EVENT_TIME_COUNTS_PER_SEC / 2) \
- / ANT_BSC_EVENT_TIME_COUNTS_PER_SEC)
-
-/**@brief Battery voltage display required precision.
- *
- * @details This value is used to decode the number of mV.
- */
-#define ANT_BSC_BAT_VOLTAGE_PRECISION 1000u
-
-/**@brief Bike Speed and Cadence profile, unit divisor of the fractional part of the battery voltage.
- *
- * @details According to the ANT BSC specification, the battery voltage fraction unit is (1/256) V.
- */
-#define ANT_BSC_BAT_VOLTAGE_FRACTION_PER_VOLT 256u
-
-/**@brief This macro should be used to get the mV part of the BSC battery voltage.
- */
-#define ANT_BSC_BAT_VOLTAGE_FRACTION_MV(VOLT_FRACT) ((((VOLT_FRACT) * ANT_BSC_BAT_VOLTAGE_PRECISION) \
- + ANT_BSC_BAT_VOLTAGE_FRACTION_PER_VOLT / 2) \
- / ANT_BSC_BAT_VOLTAGE_FRACTION_PER_VOLT)
-
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_BSC_UTILS_H__
-
diff --git a/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.c b/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.c
deleted file mode 100644
index f6aaa2c..0000000
--- a/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_REQUEST_CONTROLLER)
-#include "ant_request_controller.h"
-#include "ant_interface.h"
-#include "ant_parameters.h"
-#include "app_error.h"
-#include "nrf_assert.h"
-#include "nrf.h"
-
-/**@brief Common message data layout structure. */
-typedef struct
-{
- uint8_t page_number; ///< Page number.
- uint8_t page_payload[7]; ///< Page payload.
-}ant_common_message_layout_t;
-
-
-void ant_request_controller_init(ant_request_controller_t * p_controller)
-{
- ASSERT(p_controller != NULL);
-
- p_controller->state = ANT_REQUEST_CONTROLLER_IDLE;
- p_controller->page_70 = DEFAULT_ANT_COMMON_PAGE70();
-}
-
-
-uint32_t ant_request_controller_request(ant_request_controller_t * p_controller,
- uint8_t channel_number,
- ant_common_page70_data_t * p_page_70)
-{
- ASSERT(p_controller != NULL);
- ASSERT(p_page_70 != NULL);
-
- ant_common_message_layout_t message;
- message.page_number = ANT_COMMON_PAGE_70;
-
- ant_common_page_70_encode(message.page_payload, p_page_70);
-
- p_controller->state = ANT_REQUEST_CONTROLLER_SENDED;
-
- return sd_ant_acknowledge_message_tx(channel_number, sizeof (message), (uint8_t *)&message);
-}
-
-
-bool ant_request_controller_pending_get(ant_request_controller_t * p_controller,
- uint8_t * p_page_number)
-{
- ASSERT(p_controller != NULL);
- ASSERT(p_page_number != NULL);
-
- if ((p_controller->state == ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED)
- || (p_controller->state == ANT_REQUEST_CONTROLLER_ACK_REQUESTED)
- || (p_controller->state == ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED))
- {
- *p_page_number = p_controller->page_70.page_number;
- return true;
- }
- return false;
-}
-
-
-bool ant_request_controller_ack_needed(ant_request_controller_t * p_controller)
-{
- ASSERT(p_controller != NULL);
- return ((p_controller->state == ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED)
- || (p_controller->state == ANT_REQUEST_CONTROLLER_ACK_REQUESTED));
-}
-
-
-ant_request_controller_evt_t ant_request_controller_disp_evt_handler(
- ant_request_controller_t * p_controller,
- ant_evt_t * p_ant_event)
-{
- ASSERT(p_controller != NULL);
- ASSERT(p_ant_event != NULL);
-
- if ( p_controller->state == ANT_REQUEST_CONTROLLER_SENDED)
- {
- switch (p_ant_event->event)
- {
- case EVENT_TRANSFER_TX_FAILED:
- p_controller->state = ANT_REQUEST_CONTROLLER_IDLE;
- return ANT_REQUEST_CONTROLLER_FAILED;
-
- case EVENT_TRANSFER_TX_COMPLETED:
- p_controller->state = ANT_REQUEST_CONTROLLER_IDLE;
- return ANT_REQUEST_CONTROLLER_SUCCESS;
-
- default:
- break;
- }
- }
-
- return ANT_REQUEST_CONTROLLER_NONE;
-}
-
-
-/**@brief Function for confirmation of page sending.
- *
- * @param[in] p_controller Pointer to the controller instance.
- */
-__STATIC_INLINE void page_sended(ant_request_controller_t * p_controller)
-{
- if (!((p_controller->page_70.transmission_response.items.transmit_count)--))
- {
- p_controller->state = ANT_REQUEST_CONTROLLER_IDLE;
- }
-}
-
-
-/**@brief Function for handling page request.
- *
- * @param[in] p_controller Pointer to the controller instance.
- * @param[in] p_message_payload Pointer to the message payload.
- */
-__STATIC_INLINE void page_requested(ant_request_controller_t * p_controller,
- ant_common_message_layout_t * p_message_payload)
-{
- ant_common_page_70_decode(p_message_payload->page_payload, &(p_controller->page_70));
-
- if ((p_controller->page_70.command_type == ANT_PAGE70_COMMAND_PAGE_DATA_REQUEST)
- && (p_controller->page_70.transmission_response.specyfic != ANT_PAGE70_RESPONSE_INVALID))
- {
- if (p_controller->page_70.transmission_response.items.ack_resposne)
- {
- if (p_controller->page_70.transmission_response.specyfic ==
- ANT_PAGE70_RESPONSE_TRANSMIT_UNTIL_SUCCESS)
- {
- p_controller->state = ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED;
- }
- else
- {
- p_controller->state = ANT_REQUEST_CONTROLLER_ACK_REQUESTED;
- }
- }
- else
- {
- p_controller->state = ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED;
- }
- }
-}
-
-
-void ant_request_controller_sens_evt_handler(ant_request_controller_t * p_controller,
- ant_evt_t * p_ant_event)
-{
- ASSERT(p_controller != NULL);
- ASSERT(p_ant_event != NULL);
-
- ANT_MESSAGE * p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
- ant_common_message_layout_t * p_message_payload =
- (ant_common_message_layout_t *)p_message->ANT_MESSAGE_aucPayload;
-
- switch (p_ant_event->event)
- {
- case EVENT_RX:
-
- if (p_message_payload->page_number == ANT_COMMON_PAGE_70)
- {
- page_requested(p_controller, p_message_payload);
- }
- break;
-
- case EVENT_TRANSFER_TX_COMPLETED:
-
- if (p_controller->state == ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED)
- {
- p_controller->state = ANT_REQUEST_CONTROLLER_IDLE;
- }
- /* fall through */
-
- case EVENT_TX:
-
- if (p_controller->state == ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED
- || p_controller->state == ANT_REQUEST_CONTROLLER_ACK_REQUESTED)
- {
- page_sended(p_controller);
- }
- break;
-
- default:
- break;
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_REQUEST_CONTROLLER)
diff --git a/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.h b/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.h
deleted file mode 100644
index 1ad712a..0000000
--- a/components/ant/ant_profiles/ant_common/ant_request_controller/ant_request_controller.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/** @file
- *
- * @defgroup ant_request_controller ANT request controller
- * @{
- * @ingroup ant_sdk_utils
- *
- * @brief Module for handling page requests related to page 70.
- */
-
-#ifndef ANT_REQUEST_CONTROLLER_H__
-#define ANT_REQUEST_CONTROLLER_H__
-#include
-#include "ant_common_page_70.h"
-#include "ant_stack_handler_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Request controller events types. */
-typedef enum
-{
- ANT_REQUEST_CONTROLLER_NONE, ///< No event.
- ANT_REQUEST_CONTROLLER_SUCCESS, ///< Page request successful.
- ANT_REQUEST_CONTROLLER_FAILED, ///< Page request failed.
-} ant_request_controller_evt_t;
-
-/**@brief Request controller states. */
-typedef enum
-{
- ANT_REQUEST_CONTROLLER_IDLE, ///< Module is in idle state.
- ANT_REQUEST_CONTROLLER_SENDED, ///< Module waits for acknowledgment of its request.
- ANT_REQUEST_CONTROLLER_BROADCAST_REQUESTED, ///< Module is requested to send page n times using broadcast.
- ANT_REQUEST_CONTROLLER_ACK_REQUESTED, ///< Module is requested to send page n times using acknowledgment.
- ANT_REQUEST_CONTROLLER_ACK_UNTIL_SUCCESS_REQUESTED, ///< Module is requested to send page until success using acknowledgment.
-} ant_request_controller_state_t;
-
-/**@brief ANT request controller structure. */
-typedef struct
-{
- ant_request_controller_state_t state; ///< Actual module state.
- ant_common_page70_data_t page_70; ///< Page 70.
-} ant_request_controller_t;
-
-/**@brief Function for initializing the ANT request controller instance.
- *
- * @param[in] p_controller Pointer to the controller instance.
- */
-void ant_request_controller_init(ant_request_controller_t * p_controller);
-
-/**@brief Function for sending a request.
- *
- * @param[in] p_controller Pointer to the controller instance.
- * @param[in] channel_number Channel number.
- * @param[in] p_page_70 Pointer to the prepared page 70.
- *
- * @return Error code returned by @ref sd_ant_acknowledge_message_tx().
- */
-uint32_t ant_request_controller_request(ant_request_controller_t * p_controller,
- uint8_t channel_number,
- ant_common_page70_data_t * p_page_70);
-
-/**@brief Function for getting pending page number.
- *
- * @details This function checks whether a page number was requested.
- *
- * @param[in] p_controller Pointer to the controller instance.
- * @param[out] p_page_number Pending page number (valid if true was returned).
- *
- * @retval TRUE If there was a pending page.
- * @retval FALSE If no page was pending.
- */
-bool ant_request_controller_pending_get(ant_request_controller_t * p_controller,
- uint8_t * p_page_number);
-
-/**@brief Function for checking whether the next page must be sent with acknowledgment.
- *
- * @param[in] p_controller Pointer to the controller instance.
- *
- * @retval TRUE If the next transmission needs acknowledgment.
- * @retval FALSE If the next transmission does not need acknowledgment.
- */
-bool ant_request_controller_ack_needed(ant_request_controller_t * p_controller);
-
-/**
- * @brief Function for handling ANT events on display side.
- *
- * @details All events from the ANT stack that are related to the appropriate channel number
- * should be propagated.
- *
- * @param[in] p_controller Pointer to the controller instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-ant_request_controller_evt_t ant_request_controller_disp_evt_handler(
- ant_request_controller_t * p_controller,
- ant_evt_t * p_ant_event);
-
-/**
- * @brief Function for handling ANT events on sensor side.
- *
- * @details All events from the ANT stack that are related to the appropriate channel number
- * should be propagated.
- *
- * @param[in] p_controller Pointer to the controller instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- * @retval TRUE If there was a pending page.
- */
-void ant_request_controller_sens_evt_handler(ant_request_controller_t * p_controller,
- ant_evt_t * p_ant_event);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_REQUEST_CONTROLLER_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.c b/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.c
deleted file mode 100644
index 0ea6f7f..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_COMMON_PAGE_70)
-
-#include
-#include "ant_common_page_70.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_COMMON_PAGE_70"
-#if ANT_COMMON_PAGE_70_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_COMMON_PAGE_70_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_COMMON_PAGE_70_INFO_COLOR
-#else // ANT_COMMON_PAGE_70_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_COMMON_PAGE_70_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief ANT+ common page 70 data layout structure. */
-typedef struct
-{
- uint8_t reserved[2];
- uint8_t descriptor[2];
- uint8_t req_trans_response;
- uint8_t req_page_number;
- uint8_t command_type;
-}ant_common_page70_data_layout_t;
-
-/**@brief Function for tracing page 70 data.
- *
- * @param[in] p_page_data Pointer to the page 70 data.
- */
-static void page70_data_log(volatile ant_common_page70_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Page %d request\r\n", p_page_data->page_number);
-
- switch (p_page_data->transmission_response.specyfic)
- {
- case ANT_PAGE70_RESPONSE_TRANSMIT_UNTIL_SUCCESS:
- NRF_LOG_INFO("Try to send until ACK\r\n");
- break;
-
- case ANT_PAGE70_RESPONSE_INVALID:
- NRF_LOG_INFO("Invalid requested transmission response\r\n");
- break;
-
- default:
-
- if (p_page_data->transmission_response.items.ack_resposne)
- {
- NRF_LOG_INFO("Answer with acknowledged messages\r\n");
- }
- NRF_LOG_INFO("Requested number of transmissions: %d\r\n",
- p_page_data->transmission_response.items.transmit_count);
- }
-
- switch (p_page_data->command_type)
- {
- case ANT_PAGE70_COMMAND_PAGE_DATA_REQUEST:
- NRF_LOG_INFO("Request Data Page\r\n");
- break;
-
- case ANT_PAGE70_COMMAND_ANT_FS_SESSION_REQUEST:
- NRF_LOG_INFO("Request ANT-FS Session\r\n");
- break;
-
- default:
- NRF_LOG_INFO("Invalid request\r\n");
- }
- NRF_LOG_INFO("Descriptor %x\r\n\n", p_page_data->descriptor);
-}
-
-
-void ant_common_page_70_encode(uint8_t * p_page_buffer,
- volatile ant_common_page70_data_t const * p_page_data)
-{
- ant_common_page70_data_layout_t * p_outcoming_data =
- (ant_common_page70_data_layout_t *)p_page_buffer;
-
- memset(p_outcoming_data->reserved, UINT8_MAX, sizeof (p_outcoming_data->reserved));
- UNUSED_PARAMETER(uint16_encode(p_page_data->descriptor, p_outcoming_data->descriptor));
- p_outcoming_data->req_trans_response = p_page_data->transmission_response.byte;
- p_outcoming_data->req_page_number = p_page_data->page_number;
- p_outcoming_data->command_type = p_page_data->command_type;
-
- page70_data_log(p_page_data);
-}
-
-
-void ant_common_page_70_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page70_data_t * p_page_data)
-{
- ant_common_page70_data_layout_t const * p_incoming_data =
- (ant_common_page70_data_layout_t *)p_page_buffer;
-
- p_page_data->descriptor = uint16_decode(p_incoming_data->descriptor);
- p_page_data->transmission_response.byte = p_incoming_data->req_trans_response;
- p_page_data->page_number = p_incoming_data->req_page_number;
- p_page_data->command_type = (ant_page70_command_t)p_incoming_data->command_type;
-
- page70_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_COMMON_PAGE_70)
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.h b/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.h
deleted file mode 100644
index db1325c..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_70.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_COMMON_PAGE_70_H__
-#define ANT_COMMON_PAGE_70_H__
-
-/** @file
- *
- * @defgroup ant_common_page_70 ANT+ common page 70
- * @{
- * @ingroup ant_sdk_common_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANT_COMMON_PAGE_70 (70) ///< @brief ID value of common page 70.
-#define ANT_PAGE70_INVALID_DESCRIPTOR UINT16_MAX ///< Invalid descriptor.
-
-/**@brief Command type.
- */
-typedef enum
-{
- ANT_PAGE70_COMMAND_PAGE_DATA_REQUEST = 0x01, ///< Page request.
- ANT_PAGE70_COMMAND_ANT_FS_SESSION_REQUEST = 0x02, ///< ANT FS session request.
-} ant_page70_command_t;
-
-
-/**@brief Data structure for ANT+ common data page 70.
- */
-typedef struct
-{
- uint8_t page_number; ///< Requested page number.
- uint16_t descriptor; ///< Descriptor.
- ant_page70_command_t command_type; ///< Command type.
- union
- {
- enum
- {
- ANT_PAGE70_RESPONSE_INVALID = 0x00, ///< Invalid response type.
- ANT_PAGE70_RESPONSE_TRANSMIT_UNTIL_SUCCESS = 0x80, ///< Transmit until a successful acknowledge is received.
- } specyfic;
- struct
- {
- uint8_t transmit_count :7; ///< Number of re-transmissions.
- uint8_t ack_resposne :1; ///< Acknowledge transmission is required.
- } items;
- uint8_t byte;
- } transmission_response;
-} ant_common_page70_data_t;
-
-/**@brief Initialize page 70 with default values.
- */
-#define DEFAULT_ANT_COMMON_PAGE70() \
- (ant_common_page70_data_t) \
- { \
- .page_number = 0x00, \
- .command_type = (ant_page70_command_t)0x00, \
- .transmission_response.specyfic = ANT_PAGE70_RESPONSE_INVALID, \
- .descriptor = ANT_PAGE70_INVALID_DESCRIPTOR, \
- }
-
-/**@brief Initialize page 70 with the page request.
- */
-#define ANT_COMMON_PAGE_DATA_REQUEST(PAGE_NUMBER) \
- (ant_common_page70_data_t) \
- { \
- .page_number = (PAGE_NUMBER), \
- .command_type = ANT_PAGE70_COMMAND_PAGE_DATA_REQUEST, \
- .transmission_response.specyfic = ANT_PAGE70_RESPONSE_TRANSMIT_UNTIL_SUCCESS, \
- .descriptor = ANT_PAGE70_INVALID_DESCRIPTOR, \
- }
-
-/**@brief Function for encoding page 70.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_common_page_70_encode(uint8_t * p_page_buffer,
- volatile ant_common_page70_data_t const * p_page_data);
-
-/**@brief Function for decoding page 70.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_common_page_70_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page70_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_COMMON_PAGE_70_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.c b/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.c
deleted file mode 100644
index 9f7cc88..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_COMMON_PAGE_80)
-
-#include
-#include "ant_common_page_80.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_COMMON_PAGE_80"
-#if ANT_COMMON_PAGE_80_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_COMMON_PAGE_80_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_COMMON_PAGE_80_INFO_COLOR
-#else // ANT_COMMON_PAGE_80_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_COMMON_PAGE_80_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief ant+ common page 80 data layout structure. */
-typedef struct
-{
- uint8_t reserved[2]; ///< unused, fill by 0xFF
- uint8_t hw_revision;
- uint8_t manufacturer_id[2];
- uint8_t model_number[2];
-}ant_common_page80_data_layout_t;
-
-
-/**@brief Function for tracing page 80 data.
- *
- * @param[in] p_page_data Pointer to the page 80 data.
- */
-static void page80_data_log(volatile ant_common_page80_data_t const * p_page_data)
-{
- NRF_LOG_INFO("hw revision: %u\r\n", p_page_data->hw_revision);
- NRF_LOG_INFO("manufacturer id: %u\r\n", p_page_data->manufacturer_id);
- NRF_LOG_INFO("model number: %u\r\n\n", p_page_data->model_number);
-}
-
-
-void ant_common_page_80_encode(uint8_t * p_page_buffer,
- volatile ant_common_page80_data_t const * p_page_data)
-{
- ant_common_page80_data_layout_t * p_outcoming_data =
- (ant_common_page80_data_layout_t *)p_page_buffer;
-
- memset(p_page_buffer, UINT8_MAX, sizeof (p_outcoming_data->reserved));
-
- p_outcoming_data->hw_revision = p_page_data->hw_revision;
-
- UNUSED_PARAMETER(uint16_encode(p_page_data->manufacturer_id,
- p_outcoming_data->manufacturer_id));
- UNUSED_PARAMETER(uint16_encode(p_page_data->model_number, p_outcoming_data->model_number));
-
- page80_data_log(p_page_data);
-}
-
-
-void ant_common_page_80_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page80_data_t * p_page_data)
-{
- ant_common_page80_data_layout_t const * p_incoming_data =
- (ant_common_page80_data_layout_t *)p_page_buffer;
-
- p_page_data->hw_revision = p_incoming_data->hw_revision;
-
- p_page_data->manufacturer_id = uint16_decode(p_incoming_data->manufacturer_id);
- p_page_data->model_number = uint16_decode(p_incoming_data->model_number);
-
- page80_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_COMMON_PAGE_80)
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.h b/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.h
deleted file mode 100644
index ce0318e..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_80.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_COMMON_PAGE_80_H__
-#define ANT_COMMON_PAGE_80_H__
-
-/** @file
- *
- * @defgroup ant_sdk_common_pages ANT+ common pages
- * @{
- * @ingroup ant_sdk_profiles
- * @brief This module implements functions for the ANT+ common pages.
- * @details ANT+ common data pages define common data formats that can be used by any device on any ANT network. The ability to send and receive these common pages is defined by the transmission type of the ANT channel parameter.
- *
- * Note that all unused pages in this section are not defined and therefore cannot be used.
- * @}
- *
- * @defgroup ant_common_page_80 ANT+ common page 80
- * @{
- * @ingroup ant_sdk_common_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANT_COMMON_PAGE_80 (80) ///< @brief ID value of common page 80.
-
-/**@brief Data structure for ANT+ common data page 80.
- *
- * @note This structure implements only page 80 specific data.
- */
-typedef struct
-{
- uint8_t hw_revision; ///< Hardware revision.
- uint16_t manufacturer_id; ///< Manufacturer ID.
- uint16_t model_number; ///< Model number.
-} ant_common_page80_data_t;
-
-/**@brief Initialize page 80.
- */
-#define DEFAULT_ANT_COMMON_page80() \
- (ant_common_page80_data_t) \
- { \
- .hw_revision = 0x00, \
- .manufacturer_id = UINT8_MAX, \
- .model_number = 0x00, \
- }
-
-/**@brief Initialize page 80.
- */
-#define ANT_COMMON_page80(hw_rev, man_id, mod_num) \
- (ant_common_page80_data_t) \
- { \
- .hw_revision = (hw_rev), \
- .manufacturer_id = (man_id), \
- .model_number = (mod_num), \
- }
-
-/**@brief Function for encoding page 80.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_common_page_80_encode(uint8_t * p_page_buffer,
- volatile ant_common_page80_data_t const * p_page_data);
-
-/**@brief Function for decoding page 80.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_common_page_80_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page80_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_COMMON_PAGE_80_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.c b/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.c
deleted file mode 100644
index 3259bae..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_COMMON_PAGE_81)
-
-#include "ant_common_page_81.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_COMMON_PAGE_81"
-#if ANT_COMMON_PAGE_81_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_COMMON_PAGE_81_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_COMMON_PAGE_81_INFO_COLOR
-#else // ANT_COMMON_PAGE_81_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_COMMON_PAGE_81_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief ant+ common page 81 data layout structure. */
-typedef struct
-{
- uint8_t reserved; ///< unused, fill by 0xFF
- uint8_t sw_revision_minor;
- uint8_t sw_revision_major;
- uint8_t serial_number[4];
-}ant_common_page81_data_layout_t;
-
-
-/**@brief Function for tracing page 80 data.
- *
- * @param[in] p_page_data Pointer to the page 80 data.
- */
-static void page81_data_log(volatile ant_common_page81_data_t const * p_page_data)
-{
- if (p_page_data->sw_revision_minor != UINT8_MAX)
- {
- NRF_LOG_INFO("sw revision: %u.%u\r\n",
- ((ant_common_page81_data_t const *) p_page_data)->sw_revision_major,
- ((ant_common_page81_data_t const *) p_page_data)->sw_revision_minor);
- }
- else
- {
- NRF_LOG_INFO("sw revision: %u\r\n", p_page_data->sw_revision_major);
- }
-
- NRF_LOG_INFO("serial number: %u\r\n\n", (unsigned int) p_page_data->serial_number);
-}
-
-
-void ant_common_page_81_encode(uint8_t * p_page_buffer,
- volatile ant_common_page81_data_t const * p_page_data)
-{
- ant_common_page81_data_layout_t * p_outcoming_data =
- (ant_common_page81_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->reserved = UINT8_MAX;
-
- p_outcoming_data->sw_revision_minor = p_page_data->sw_revision_minor;
- p_outcoming_data->sw_revision_major = p_page_data->sw_revision_major;
-
- UNUSED_PARAMETER(uint32_encode(p_page_data->serial_number, p_outcoming_data->serial_number));
-
- page81_data_log(p_page_data);
-}
-
-
-void ant_common_page_81_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page81_data_t * p_page_data)
-{
- ant_common_page81_data_layout_t const * p_incoming_data =
- (ant_common_page81_data_layout_t *)p_page_buffer;
-
- p_page_data->sw_revision_minor = p_incoming_data->sw_revision_minor;
- p_page_data->sw_revision_major = p_incoming_data->sw_revision_major;
-
- p_page_data->serial_number = uint32_decode(p_incoming_data->serial_number);
-
- page81_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_COMMON_PAGE_81)
diff --git a/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.h b/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.h
deleted file mode 100644
index a62e83e..0000000
--- a/components/ant/ant_profiles/ant_common/pages/ant_common_page_81.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_COMMON_PAGE_81_H__
-#define ANT_COMMON_PAGE_81_H__
-
-/** @file
- *
- * @defgroup ant_common_page_81 ANT+ common page 81
- * @{
- * @ingroup ant_sdk_common_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANT_COMMON_PAGE_81 (81) ///< @brief ID value of common page 81.
-
-/**@brief Data structure for ANT+ common data page 81.
- *
- * @note This structure implements only page 81 specific data.
- */
-typedef struct
-{
- uint8_t sw_revision_minor; ///< Supplemental, fill by 0xFF if unused.
- uint8_t sw_revision_major; ///< Main software version.
- uint32_t serial_number; ///< Lowest 32 b of serial number, fill by 0xFFFFFFFFF if unused.
-} ant_common_page81_data_t;
-
-/**@brief Initialize page 81.
- */
-#define DEFAULT_ANT_COMMON_page81() \
- (ant_common_page81_data_t) \
- { \
- .sw_revision_minor = UINT8_MAX, \
- .sw_revision_major = UINT8_MAX, \
- .serial_number = UINT32_MAX, \
- }
-
-/**@brief Initialize page 81.
- */
-#define ANT_COMMON_page81(sw_major_rev, sw_minor_rev, seril_no) \
- (ant_common_page81_data_t) \
- { \
- .sw_revision_minor = (sw_minor_rev), \
- .sw_revision_major = (sw_major_rev), \
- .serial_number = (seril_no), \
- }
-
-/**@brief Function for encoding page 81.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_common_page_81_encode(uint8_t * p_page_buffer,
- volatile ant_common_page81_data_t const * p_page_data);
-
-/**@brief Function for decoding page 81.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_common_page_81_decode(uint8_t const * p_page_buffer,
- volatile ant_common_page81_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_COMMON_PAGE_81_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/ant_hrm.c b/components/ant/ant_profiles/ant_hrm/ant_hrm.c
deleted file mode 100644
index ac48339..0000000
--- a/components/ant/ant_profiles/ant_hrm/ant_hrm.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if ANT_HRM_ENABLED
-
-#include "nrf_assert.h"
-#include "app_error.h"
-#include "ant_interface.h"
-#include "app_util.h"
-#include "ant_hrm.h"
-#include "ant_hrm_utils.h"
-#include "app_error.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM"
-#if ANT_HRM_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_INFO_COLOR
-#else // ANT_HRM_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_LOG_ENABLED
-#include "nrf_log.h"
-
-#define BACKGROUND_DATA_INTERVAL 64 /**< The number of main data pages sent between background data page.
- Background data page is sent every 65th message. */
-#define TX_TOGGLE_DIVISOR 4 /**< The number of messages between changing state of toggle bit. */
-
-/**@brief HRM message data layout structure. */
-typedef struct
-{
- ant_hrm_page_t page_number : 7;
- uint8_t toggle_bit : 1;
- uint8_t page_payload[7];
-} ant_hrm_message_layout_t;
-
-/**@brief Function for initializing the ANT HRM profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-static ret_code_t ant_hrm_init(ant_hrm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config)
-{
- p_profile->channel_number = p_channel_config->channel_number;
-
- p_profile->page_0 = DEFAULT_ANT_HRM_PAGE0();
- p_profile->page_1 = DEFAULT_ANT_HRM_PAGE1();
- p_profile->page_2 = DEFAULT_ANT_HRM_PAGE2();
- p_profile->page_3 = DEFAULT_ANT_HRM_PAGE3();
- p_profile->page_4 = DEFAULT_ANT_HRM_PAGE4();
-
- NRF_LOG_INFO("ANT HRM channel %u init\r\n", p_profile->channel_number);
- return ant_channel_init(p_channel_config);
-}
-
-
-ret_code_t ant_hrm_disp_init(ant_hrm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_hrm_evt_handler_t evt_handler)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(evt_handler != NULL);
-
- p_profile->evt_handler = evt_handler;
-
- return ant_hrm_init(p_profile, p_channel_config);
-}
-
-
-ret_code_t ant_hrm_sens_init(ant_hrm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_hrm_sens_config_t const * p_sens_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_sens_config != NULL);
- ASSERT(p_sens_config->p_cb != NULL);
- ASSERT(p_sens_config->evt_handler != NULL);
-
- ASSERT((p_sens_config->main_page_number == ANT_HRM_PAGE_0)
- || (p_sens_config->main_page_number == ANT_HRM_PAGE_4));
-
- p_profile->evt_handler = p_sens_config->evt_handler;
- p_profile->_cb.p_sens_cb = p_sens_config->p_cb;
-
- ant_hrm_sens_cb_t * p_hrm_cb = p_profile->_cb.p_sens_cb;
- p_hrm_cb->page_1_present = p_sens_config->page_1_present;
- p_hrm_cb->main_page_number = p_sens_config->main_page_number;
- p_hrm_cb->ext_page_number = p_hrm_cb->page_1_present ? ANT_HRM_PAGE_1 : ANT_HRM_PAGE_2;
- p_hrm_cb->message_counter = 0;
- p_hrm_cb->toggle_bit = true;
-
- return ant_hrm_init(p_profile, p_channel_config);
-}
-
-
-/**@brief Function for getting next page number to send.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @return Next page number.
- */
-static ant_hrm_page_t next_page_number_get(ant_hrm_profile_t * p_profile)
-{
- ant_hrm_sens_cb_t * p_hrm_cb = p_profile->_cb.p_sens_cb;
- ant_hrm_page_t page_number;
-
- if (p_hrm_cb->message_counter == (BACKGROUND_DATA_INTERVAL))
- {
- page_number = p_hrm_cb->ext_page_number;
-
- p_hrm_cb->message_counter = 0;
-
- p_hrm_cb->ext_page_number++;
-
- if (p_hrm_cb->ext_page_number > ANT_HRM_PAGE_3)
- {
- p_hrm_cb->ext_page_number = p_hrm_cb->page_1_present ? ANT_HRM_PAGE_1 : ANT_HRM_PAGE_2;
- }
- }
- else
- {
- page_number = p_hrm_cb->main_page_number;
- }
-
- if (p_hrm_cb->message_counter % TX_TOGGLE_DIVISOR == 0)
- {
- p_hrm_cb->toggle_bit ^= 1;
- }
-
- p_hrm_cb->message_counter++;
-
- return page_number;
-}
-
-
-/**@brief Function for encoding HRM message.
- *
- * @note Assume to be call each time when Tx window will occur.
- */
-static void sens_message_encode(ant_hrm_profile_t * p_profile, uint8_t * p_message_payload)
-{
- ant_hrm_message_layout_t * p_hrm_message_payload =
- (ant_hrm_message_layout_t *)p_message_payload;
- ant_hrm_sens_cb_t * p_hrm_cb = p_profile->_cb.p_sens_cb;
-
- p_hrm_message_payload->page_number = next_page_number_get(p_profile);
- p_hrm_message_payload->toggle_bit = p_hrm_cb->toggle_bit;
-
- NRF_LOG_INFO("HRM TX Page number: %u\r\n", p_hrm_message_payload->page_number);
-
- ant_hrm_page_0_encode(p_hrm_message_payload->page_payload, &(p_profile->page_0)); // Page 0 is present in each message
-
- switch (p_hrm_message_payload->page_number)
- {
- case ANT_HRM_PAGE_0:
- // No implementation needed
- break;
-
- case ANT_HRM_PAGE_1:
- ant_hrm_page_1_encode(p_hrm_message_payload->page_payload, &(p_profile->page_1));
- break;
-
- case ANT_HRM_PAGE_2:
- ant_hrm_page_2_encode(p_hrm_message_payload->page_payload, &(p_profile->page_2));
- break;
-
- case ANT_HRM_PAGE_3:
- ant_hrm_page_3_encode(p_hrm_message_payload->page_payload, &(p_profile->page_3));
- break;
-
- case ANT_HRM_PAGE_4:
- ant_hrm_page_4_encode(p_hrm_message_payload->page_payload, &(p_profile->page_4));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_hrm_evt_t)p_hrm_message_payload->page_number);
-}
-
-
-/**@brief Function for setting payload for ANT message and sending it.
- *
- * @param[in] p_profile Pointer to the profile instance.
- */
-static void ant_message_send(ant_hrm_profile_t * p_profile)
-{
- uint32_t err_code;
- uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE];
-
- sens_message_encode(p_profile, p_message_payload);
- err_code =
- sd_ant_broadcast_message_tx(p_profile->channel_number,
- sizeof (p_message_payload),
- p_message_payload);
- APP_ERROR_CHECK(err_code);
-}
-
-
-void ant_hrm_sens_evt_handler(ant_hrm_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- switch (p_ant_event->event)
- {
- case EVENT_TX:
- ant_message_send(p_profile);
- break;
-
- default:
- break;
- }
- }
-}
-
-
-ret_code_t ant_hrm_disp_open(ant_hrm_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- NRF_LOG_INFO("ANT HRM channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-
-ret_code_t ant_hrm_sens_open(ant_hrm_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- // Fill tx buffer for the first frame
- ant_message_send(p_profile);
-
- NRF_LOG_INFO("ANT HRM channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-
-/**@brief Function for decoding HRM message.
- *
- * @note Assume to be call each time when Rx window will occur.
- */
-static void disp_message_decode(ant_hrm_profile_t * p_profile, uint8_t * p_message_payload)
-{
- const ant_hrm_message_layout_t * p_hrm_message_payload =
- (ant_hrm_message_layout_t *)p_message_payload;
-
- NRF_LOG_INFO("HRM RX Page Number: %u\r\n", p_hrm_message_payload->page_number);
-
- ant_hrm_page_0_decode(p_hrm_message_payload->page_payload, &(p_profile->page_0)); // Page 0 is present in each message
-
- switch (p_hrm_message_payload->page_number)
- {
- case ANT_HRM_PAGE_0:
- // No implementation needed
- break;
-
- case ANT_HRM_PAGE_1:
- ant_hrm_page_1_decode(p_hrm_message_payload->page_payload, &(p_profile->page_1));
- break;
-
- case ANT_HRM_PAGE_2:
- ant_hrm_page_2_decode(p_hrm_message_payload->page_payload, &(p_profile->page_2));
- break;
-
- case ANT_HRM_PAGE_3:
- ant_hrm_page_3_decode(p_hrm_message_payload->page_payload, &(p_profile->page_3));
- break;
-
- case ANT_HRM_PAGE_4:
- ant_hrm_page_4_decode(p_hrm_message_payload->page_payload, &(p_profile->page_4));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_hrm_evt_t)p_hrm_message_payload->page_number);
-}
-
-
-void ant_hrm_disp_evt_handler(ant_hrm_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- if (p_ant_event->channel == p_profile->channel_number)
- {
- ANT_MESSAGE * p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
-
- switch (p_ant_event->event)
- {
- case EVENT_RX:
-
- if (p_message->ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
- {
- disp_message_decode(p_profile, p_message->ANT_MESSAGE_aucPayload);
- }
- break;
-
- default:
- break;
- }
- }
-}
-
-#endif // ANT_HRM_ENABLED
diff --git a/components/ant/ant_profiles/ant_hrm/ant_hrm.h b/components/ant/ant_profiles/ant_hrm/ant_hrm.h
deleted file mode 100644
index e441ed7..0000000
--- a/components/ant/ant_profiles/ant_hrm/ant_hrm.h
+++ /dev/null
@@ -1,291 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/** @file
- *
- * @defgroup ant_hrm Heart Rate Monitor profile
- * @{
- * @ingroup ant_sdk_profiles
- * @brief This module implements the Heart Rate Monitor profile.
- *
- */
-
-#ifndef ANT_HRM_H__
-#define ANT_HRM_H__
-
-#include
-#include
-#include "app_util.h"
-#include "ant_parameters.h"
-#include "ant_stack_handler_types.h"
-#include "ant_channel_config.h"
-#include "ant_hrm_pages.h"
-#include "sdk_errors.h"
-
-#define HRM_DEVICE_TYPE 0x78u ///< Device type reserved for ANT+ heart rate monitor.
-#define HRM_ANTPLUS_RF_FREQ 0x39u ///< Frequency, decimal 57 (2457 MHz).
-
-#define HRM_MSG_PERIOD_4Hz 0x1F86u ///< Message period, decimal 8070 (4.06 Hz).
-#define HRM_MSG_PERIOD_2Hz 0x3F0Cu ///< Message period, decimal 16140 (2.03 Hz).
-#define HRM_MSG_PERIOD_1Hz 0x7E18u ///< Message period, decimal 32280 (1.02 Hz).
-
-#define HRM_EXT_ASSIGN 0x00 ///< ANT ext assign.
-#define HRM_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE_RX_ONLY ///< Display HRM channel type.
-#define HRM_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER ///< Sensor HRM channel type.
-
-/**@brief Initialize an ANT channel configuration structure for the HRM profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- * @param[in] HRM_MSG_PERIOD Channel period in 32 kHz counts. The HRM profile supports only the following periods:
- * @ref HRM_MSG_PERIOD_4Hz, @ref HRM_MSG_PERIOD_2Hz, @ref HRM_MSG_PERIOD_1Hz.
- */
-#define HRM_DISP_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER, \
- HRM_MSG_PERIOD) \
-static const ant_channel_config_t NAME##_channel_hrm_disp_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = HRM_DISP_CHANNEL_TYPE, \
- .ext_assign = HRM_EXT_ASSIGN, \
- .rf_freq = HRM_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = HRM_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = (HRM_MSG_PERIOD), \
- .network_number = (NETWORK_NUMBER), \
- }
-#define HRM_DISP_CHANNEL_CONFIG(NAME) &NAME##_channel_hrm_disp_config
-
-/**@brief Initialize an ANT channel configuration structure for the HRM profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- */
-#define HRM_SENS_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER) \
-static const ant_channel_config_t NAME##_channel_hrm_sens_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = HRM_SENS_CHANNEL_TYPE, \
- .ext_assign = HRM_EXT_ASSIGN, \
- .rf_freq = HRM_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = HRM_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = HRM_MSG_PERIOD_4Hz, \
- .network_number = (NETWORK_NUMBER), \
- }
-#define HRM_SENS_CHANNEL_CONFIG(NAME) &NAME##_channel_hrm_sens_config
-
-/**@brief Initialize an ANT profile configuration structure for the HRM profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] PAGE_1_PRESENT Determines whether page 1 is included.
- * @param[in] MAIN_PAGE_NUMBER Determines the main data page (@ref ANT_HRM_PAGE_0 or @ref ANT_HRM_PAGE_4).
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the HRM profile.
- */
-#define HRM_SENS_PROFILE_CONFIG_DEF(NAME, \
- PAGE_1_PRESENT, \
- MAIN_PAGE_NUMBER, \
- EVT_HANDLER) \
-static ant_hrm_sens_cb_t NAME##_hrm_sens_cb; \
-static const ant_hrm_sens_config_t NAME##_profile_hrm_sens_config = \
- { \
- .page_1_present = (PAGE_1_PRESENT), \
- .main_page_number = (MAIN_PAGE_NUMBER), \
- .p_cb = &NAME##_hrm_sens_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define HRM_SENS_PROFILE_CONFIG(NAME) &NAME##_profile_hrm_sens_config
-
-/**@brief HRM page number type. */
-typedef enum
-{
- ANT_HRM_PAGE_0, ///< Main data page number 0.
- ANT_HRM_PAGE_1, ///< Background data page number 1. This page is optional.
- ANT_HRM_PAGE_2, ///< Background data page number 2.
- ANT_HRM_PAGE_3, ///< Background data page number 3.
- ANT_HRM_PAGE_4 ///< Main data page number 4.
-} ant_hrm_page_t;
-
-/**@brief HRM profile event type. */
-typedef enum
-{
- ANT_HRM_PAGE_0_UPDATED = ANT_HRM_PAGE_0, ///< Data page 0 has been updated (Display) or sent (Sensor).
- ANT_HRM_PAGE_1_UPDATED = ANT_HRM_PAGE_1, ///< Data page 0 and page 1 have been updated (Display) or sent (Sensor).
- ANT_HRM_PAGE_2_UPDATED = ANT_HRM_PAGE_2, ///< Data page 0 and page 2 have been updated (Display) or sent (Sensor).
- ANT_HRM_PAGE_3_UPDATED = ANT_HRM_PAGE_3, ///< Data page 0 and page 3 have been updated (Display) or sent (Sensor).
- ANT_HRM_PAGE_4_UPDATED = ANT_HRM_PAGE_4, ///< Data page 0 and page 4 have been updated (Display) or sent (Sensor).
-} ant_hrm_evt_t;
-
-// Forward declaration of the ant_hrm_profile_t type.
-typedef struct ant_hrm_profile_s ant_hrm_profile_t;
-
-/**@brief HRM event handler type. */
-typedef void (* ant_hrm_evt_handler_t) (ant_hrm_profile_t *, ant_hrm_evt_t);
-
-#include "ant_hrm_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief HRM sensor configuration structure. */
-typedef struct
-{
- bool page_1_present; ///< Determines whether page 1 is included.
- ant_hrm_page_t main_page_number; ///< Determines the main data page (@ref ANT_HRM_PAGE_0 or @ref ANT_HRM_PAGE_4).
- ant_hrm_sens_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_hrm_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the HRM profile.
-} ant_hrm_sens_config_t;
-
-/**@brief HRM profile structure. */
-struct ant_hrm_profile_s
-{
- uint8_t channel_number; ///< Channel number assigned to the profile.
- union {
- void * p_none;
- ant_hrm_sens_cb_t * p_sens_cb;
- } _cb; ///< Pointer to internal control block.
- ant_hrm_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the HRM profile.
- ant_hrm_page0_data_t page_0; ///< Page 0.
- ant_hrm_page1_data_t page_1; ///< Page 1.
- ant_hrm_page2_data_t page_2; ///< Page 2.
- ant_hrm_page3_data_t page_3; ///< Page 3.
- ant_hrm_page4_data_t page_4; ///< Page 4.
-};
-
-/** @name Defines for accessing ant_hrm_profile_t member variables
- @{ */
-#define HRM_PROFILE_beat_count page_0.beat_count
-#define HRM_PROFILE_computed_heart_rate page_0.computed_heart_rate
-#define HRM_PROFILE_beat_time page_0.beat_time
-#define HRM_PROFILE_operating_time page_1.operating_time
-#define HRM_PROFILE_manuf_id page_2.manuf_id
-#define HRM_PROFILE_serial_num page_2.serial_num
-#define HRM_PROFILE_hw_version page_3.hw_version
-#define HRM_PROFILE_sw_version page_3.sw_version
-#define HRM_PROFILE_model_num page_3.model_num
-#define HRM_PROFILE_manuf_spec page_4.manuf_spec
-#define HRM_PROFILE_prev_beat page_4.prev_beat
-/** @} */
-
-/**@brief Function for initializing the ANT HRM Display profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] evt_handler Event handler to be called for handling events in the HRM profile.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_hrm_disp_init(ant_hrm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_hrm_evt_handler_t evt_handler);
-
-/**@brief Function for initializing the ANT HRM Sensor profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_sens_config Pointer to the HRM sensor configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_hrm_sens_init(ant_hrm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_hrm_sens_config_t const * p_sens_config);
-
-/**@brief Function for opening the profile instance channel for ANT HRM Display.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_hrm_disp_open(ant_hrm_profile_t * p_profile);
-
-/**@brief Function for opening the profile instance channel for ANT HRM Sensor.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_hrm_sens_open(ant_hrm_profile_t * p_profile);
-
-/**@brief Function for handling the sensor ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Heart Rate Monitor Sensor profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_hrm_sens_evt_handler(ant_hrm_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-/**@brief Function for handling the display ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the Heart Rate Monitor Display profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_hrm_disp_evt_handler(ant_hrm_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_H__
-/** @} */
-
diff --git a/components/ant/ant_profiles/ant_hrm/ant_hrm_local.h b/components/ant/ant_profiles/ant_hrm/ant_hrm_local.h
deleted file mode 100644
index f8cca6a..0000000
--- a/components/ant/ant_profiles/ant_hrm/ant_hrm_local.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef ANT_HRM_LOCAL_H__
-#define ANT_HRM_LOCAL_H__
-
-#include
-#include
-#include "ant_hrm.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup ant_hrm
- * @{
- */
-
-/** @brief HRM Sensor control block. */
-typedef struct
-{
- uint8_t toggle_bit;
- ant_hrm_page_t main_page_number;
- uint8_t page_1_present;
- ant_hrm_page_t ext_page_number;
- uint8_t message_counter;
-} ant_hrm_sens_cb_t;
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.c b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.c
deleted file mode 100644
index db90550..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_HRM)
-
-#include "ant_hrm_page_0.h"
-#include "ant_hrm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM_PAGE_0"
-#if ANT_HRM_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_PAGE_0_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_PAGE_0_INFO_COLOR
-#else // ANT_HRM_PAGE_0_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_PAGE_0_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief HRM page 0 data layout structure. */
-typedef struct
-{
- uint8_t reserved[3];
- uint8_t heart_beat_evt_time_LSB;
- uint8_t heart_beat_evt_time_MSB;
- uint8_t heart_beat_count;
- uint8_t computed_heart_rate;
-}ant_hrm_page0_data_layout_t;
-
-/**@brief Function for tracing page 0 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 0 data.
- */
-static void page0_data_log(ant_hrm_page0_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Heart beat count: %u\r\n", (unsigned int)p_page_data->beat_count);
- NRF_LOG_INFO("Computed heart rate: %u\r\n",
- (unsigned int) p_page_data->computed_heart_rate);
- NRF_LOG_INFO("Heart beat event time: %u.%03us\r\n\n",
- (unsigned int) ANT_HRM_BEAT_TIME_SEC(p_page_data->beat_time),
- (unsigned int) ANT_HRM_BEAT_TIME_MSEC(p_page_data->beat_time));
-}
-
-
-void ant_hrm_page_0_encode(uint8_t * p_page_buffer,
- ant_hrm_page0_data_t const * p_page_data)
-{
- ant_hrm_page0_data_layout_t * p_outcoming_data = (ant_hrm_page0_data_layout_t *)p_page_buffer;
- uint32_t beat_time = p_page_data->beat_time;
-
- p_outcoming_data->reserved[0] = UINT8_MAX;
- p_outcoming_data->reserved[1] = UINT8_MAX;
- p_outcoming_data->reserved[2] = UINT8_MAX;
- p_outcoming_data->heart_beat_evt_time_LSB = (uint8_t)(beat_time & UINT8_MAX);
- p_outcoming_data->heart_beat_evt_time_MSB = (uint8_t)((beat_time >> 8) & UINT8_MAX);
- p_outcoming_data->heart_beat_count = (uint8_t)p_page_data->beat_count;
- p_outcoming_data->computed_heart_rate = (uint8_t)p_page_data->computed_heart_rate;
-
- page0_data_log(p_page_data);
-}
-
-
-void ant_hrm_page_0_decode(uint8_t const * p_page_buffer,
- ant_hrm_page0_data_t * p_page_data)
-{
- ant_hrm_page0_data_layout_t const * p_incoming_data =
- (ant_hrm_page0_data_layout_t *)p_page_buffer;
-
- uint32_t beat_time = (uint32_t)((p_incoming_data->heart_beat_evt_time_MSB << 8)
- + p_incoming_data->heart_beat_evt_time_LSB);
-
- p_page_data->beat_count = (uint32_t)p_incoming_data->heart_beat_count;
- p_page_data->computed_heart_rate = (uint32_t)p_incoming_data->computed_heart_rate;
- p_page_data->beat_time = beat_time;
-
- page0_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_HRM)
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.h
deleted file mode 100644
index 6006183..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_0.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_PAGE_0_H__
-#define ANT_HRM_PAGE_0_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_page0 HRM profile page 0
- * @{
- * @ingroup ant_sdk_profiles_hrm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for HRM data page 0.
- *
- * This structure is used as a common page.
- */
-typedef struct
-{
- uint8_t beat_count; ///< Beat count.
- uint8_t computed_heart_rate; ///< Computed heart rate.
- uint16_t beat_time; ///< Beat time.
-} ant_hrm_page0_data_t;
-
-/**@brief Initialize page 0.
- */
-#define DEFAULT_ANT_HRM_PAGE0() \
- (ant_hrm_page0_data_t) \
- { \
- .beat_count = 0, \
- .computed_heart_rate = 0, \
- .beat_time = 0, \
- }
-
-/**@brief Function for encoding page 0.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_hrm_page_0_encode(uint8_t * p_page_buffer,
- ant_hrm_page0_data_t const * p_page_data);
-
-/**@brief Function for decoding page 0.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_hrm_page_0_decode(uint8_t const * p_page_buffer,
- ant_hrm_page0_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_PAGE_0_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.c b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.c
deleted file mode 100644
index fccf06a..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_HRM)
-
-#include "ant_hrm_page_1.h"
-#include "ant_hrm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM_PAGE_1"
-#if ANT_HRM_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_PAGE_1_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_PAGE_1_INFO_COLOR
-#else // ANT_HRM_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_PAGE_1_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief HRM page 1 data layout structure. */
-typedef struct
-{
- uint8_t cumulative_operating_time[3];
- uint8_t reserved[4];
-}ant_hrm_page1_data_layout_t;
-
-/**@brief Function for tracing page 1 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 1 data.
- */
-static void page1_data_log(ant_hrm_page1_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Cumulative operating time: %ud %uh %um %us\r\n\n",
- (unsigned int) ANT_HRM_OPERATING_DAYS(p_page_data->operating_time),
- (unsigned int) ANT_HRM_OPERATING_HOURS(p_page_data->operating_time),
- (unsigned int) ANT_HRM_OPERATING_MINUTES(p_page_data->operating_time),
- (unsigned int) ANT_HRM_OPERATING_SECONDS(p_page_data->operating_time));
-}
-
-
-void ant_hrm_page_1_encode(uint8_t * p_page_buffer,
- ant_hrm_page1_data_t const * p_page_data)
-{
- ant_hrm_page1_data_layout_t * p_outcoming_data = (ant_hrm_page1_data_layout_t *)p_page_buffer;
- uint32_t operating_time = p_page_data->operating_time;
-
- UNUSED_PARAMETER(uint24_encode(operating_time, p_outcoming_data->cumulative_operating_time));
- page1_data_log(p_page_data);
-}
-
-
-void ant_hrm_page_1_decode(uint8_t const * p_page_buffer,
- ant_hrm_page1_data_t * p_page_data)
-{
- ant_hrm_page1_data_layout_t const * p_incoming_data =
- (ant_hrm_page1_data_layout_t *)p_page_buffer;
-
- uint32_t operating_time = uint24_decode(p_incoming_data->cumulative_operating_time);
-
- p_page_data->operating_time = operating_time;
-
- page1_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_HRM)
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.h
deleted file mode 100644
index b79c28e..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_1.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_PAGE_1_H__
-#define ANT_HRM_PAGE_1_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_page1 HRM profile page 1
- * @{
- * @ingroup ant_sdk_profiles_hrm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for HRM data page 1.
- *
- * This structure implements only page 1 specific data.
- */
-typedef struct
-{
- uint32_t operating_time; ///< Operating time.
-} ant_hrm_page1_data_t;
-
-/**@brief Initialize page 1.
- */
-#define DEFAULT_ANT_HRM_PAGE1() \
- (ant_hrm_page1_data_t) \
- { \
- .operating_time = 0, \
- }
-
-/**@brief Function for encoding page 1.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_hrm_page_1_encode(uint8_t * p_page_buffer,
- ant_hrm_page1_data_t const * p_page_data);
-
-/**@brief Function for decoding page 1.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_hrm_page_1_decode(uint8_t const * p_page_buffer,
- ant_hrm_page1_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_PAGE_1_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.c b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.c
deleted file mode 100644
index f73bc6c..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_HRM)
-
-#include "ant_hrm_page_2.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM_PAGE_2"
-#if ANT_HRM_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_PAGE_2_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_PAGE_2_INFO_COLOR
-#else // ANT_HRM_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_PAGE_2_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief HRM page 2 data layout structure. */
-typedef struct
-{
- uint8_t manuf_id;
- uint8_t serial_num_LSB;
- uint8_t serial_num_MSB;
- uint8_t reserved[4];
-}ant_hrm_page2_data_layout_t;
-
-/**@brief Function for tracing page 2 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 2 data.
- */
-static void page2_data_log(ant_hrm_page2_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Manufacturer ID: %u\r\n", (unsigned int)p_page_data->manuf_id);
- NRF_LOG_INFO("Serial No (upper 16-bits): 0x%X\r\n\n", (unsigned int)p_page_data->serial_num);
-}
-
-
-void ant_hrm_page_2_encode(uint8_t * p_page_buffer,
- ant_hrm_page2_data_t const * p_page_data)
-{
- ant_hrm_page2_data_layout_t * p_outcoming_data = (ant_hrm_page2_data_layout_t *)p_page_buffer;
- uint32_t serial_num = p_page_data->serial_num;
-
- p_outcoming_data->manuf_id = (uint8_t)p_page_data->manuf_id;
- p_outcoming_data->serial_num_LSB = (uint8_t)(serial_num & UINT8_MAX);
- p_outcoming_data->serial_num_MSB = (uint8_t)((serial_num >> 8) & UINT8_MAX);
-
- page2_data_log(p_page_data);
-}
-
-
-void ant_hrm_page_2_decode(uint8_t const * p_page_buffer,
- ant_hrm_page2_data_t * p_page_data)
-{
- ant_hrm_page2_data_layout_t const * p_incoming_data =
- (ant_hrm_page2_data_layout_t *)p_page_buffer;
- uint32_t serial_num =
- (uint32_t)((p_incoming_data->serial_num_MSB << 8)
- + p_incoming_data->
- serial_num_LSB);
-
- p_page_data->manuf_id = (uint32_t)p_incoming_data->manuf_id;
- p_page_data->serial_num = serial_num;
-
- page2_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_HRM)
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.h
deleted file mode 100644
index 6d426e7..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_2.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_PAGE_2_H__
-#define ANT_HRM_PAGE_2_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_page2 HRM profile page 2
- * @{
- * @ingroup ant_sdk_profiles_hrm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for HRM data page 2.
- *
- * This structure implements only page 2 specific data.
- */
-typedef struct
-{
- uint8_t manuf_id; ///< Manufacturer ID.
- uint16_t serial_num; ///< Serial number.
-} ant_hrm_page2_data_t;
-
-/**@brief Initialize page 2.
- */
-#define DEFAULT_ANT_HRM_PAGE2() \
- (ant_hrm_page2_data_t) \
- { \
- .manuf_id = 0, \
- .serial_num = 0, \
- }
-
-/**@brief Function for encoding page 2.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_hrm_page_2_encode(uint8_t * p_page_buffer,
- ant_hrm_page2_data_t const * p_page_data);
-
-/**@brief Function for decoding page 2.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_hrm_page_2_decode(uint8_t const * p_page_buffer,
- ant_hrm_page2_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_PAGE_2_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.c b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.c
deleted file mode 100644
index 5eb783d..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_HRM)
-
-#include "ant_hrm_page_3.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM_PAGE_3"
-#if ANT_HRM_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_PAGE_3_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_PAGE_3_INFO_COLOR
-#else // ANT_HRM_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_PAGE_3_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief HRM page 3 data layout structure. */
-typedef struct
-{
- uint8_t hw_version;
- uint8_t sw_version;
- uint8_t model_num;
- uint8_t reserved[4];
-}ant_hrm_page3_data_layout_t;
-
-/**@brief Function for tracing page 3 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 3 data.
- */
-static void page3_data_log(ant_hrm_page3_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Hardware Rev ID %u\r\n", (unsigned int)p_page_data->hw_version);
- NRF_LOG_INFO("Model %u\r\n", (unsigned int)p_page_data->model_num);
- NRF_LOG_INFO("Software Ver ID %u\r\n\n", (unsigned int)p_page_data->sw_version);
-}
-
-
-void ant_hrm_page_3_encode(uint8_t * p_page_buffer,
- ant_hrm_page3_data_t const * p_page_data)
-{
- ant_hrm_page3_data_layout_t * p_outcoming_data = (ant_hrm_page3_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->hw_version = (uint8_t)p_page_data->hw_version;
- p_outcoming_data->sw_version = (uint8_t)p_page_data->sw_version;
- p_outcoming_data->model_num = (uint8_t)p_page_data->model_num;
-
- page3_data_log(p_page_data);
-}
-
-
-void ant_hrm_page_3_decode(uint8_t const * p_page_buffer,
- ant_hrm_page3_data_t * p_page_data)
-{
- ant_hrm_page3_data_layout_t const * p_incoming_data =
- (ant_hrm_page3_data_layout_t *)p_page_buffer;
-
- p_page_data->hw_version = (uint32_t)p_incoming_data->hw_version;
- p_page_data->sw_version = (uint32_t)p_incoming_data->sw_version;
- p_page_data->model_num = (uint32_t)p_incoming_data->model_num;
-
- page3_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_HRM)
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.h
deleted file mode 100644
index 8f04b37..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_3.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_PAGE_3_H__
-#define ANT_HRM_PAGE_3_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_page3 HRM profile page 3
- * @{
- * @ingroup ant_sdk_profiles_hrm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for HRM data page 3.
- *
- * This structure implements only page 3 specific data.
- */
-typedef struct
-{
- uint8_t hw_version; ///< Hardware version.
- uint8_t sw_version; ///< Software version.
- uint8_t model_num; ///< Model number.
-} ant_hrm_page3_data_t;
-
-/**@brief Initialize page 3.
- */
-#define DEFAULT_ANT_HRM_PAGE3() \
- (ant_hrm_page3_data_t) \
- { \
- .hw_version = 0, \
- .sw_version = 0, \
- .model_num = 0, \
- }
-
-/**@brief Function for encoding page 3.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_hrm_page_3_encode(uint8_t * p_page_buffer,
- ant_hrm_page3_data_t const * p_page_data);
-
-/**@brief Function for decoding page 3.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_hrm_page_3_decode(uint8_t const * p_page_buffer,
- ant_hrm_page3_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_PAGE_3_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.c b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.c
deleted file mode 100644
index 3abf6b1..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_HRM)
-
-#include "ant_hrm_page_4.h"
-#include "ant_hrm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_HRM_PAGE_4"
-#if ANT_HRM_PAGE_4_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_HRM_PAGE_4_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_HRM_PAGE_4_INFO_COLOR
-#else // ANT_HRM_PAGE_4_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_HRM_PAGE_4_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief HRM page 4 data layout structure. */
-typedef struct
-{
- uint8_t manuf_spec;
- uint8_t prev_beat_LSB;
- uint8_t prev_beat_MSB;
- uint8_t reserved[4];
-}ant_hrm_page4_data_layout_t;
-
-/**@brief Function for tracing page 4 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 4 data.
- */
-static void page4_data_log(ant_hrm_page4_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Previous heart beat event time: %u.%03us\r\n\n",
- (unsigned int)ANT_HRM_BEAT_TIME_SEC(p_page_data->prev_beat),
- (unsigned int)ANT_HRM_BEAT_TIME_MSEC(p_page_data->prev_beat));
-}
-
-
-void ant_hrm_page_4_encode(uint8_t * p_page_buffer,
- ant_hrm_page4_data_t const * p_page_data)
-{
- ant_hrm_page4_data_layout_t * p_outcoming_data = (ant_hrm_page4_data_layout_t *)p_page_buffer;
- uint32_t prev_beat = p_page_data->prev_beat;
-
- p_outcoming_data->manuf_spec = p_page_data->manuf_spec;
- p_outcoming_data->prev_beat_LSB = (uint8_t)(prev_beat & UINT8_MAX);
- p_outcoming_data->prev_beat_MSB = (uint8_t)((prev_beat >> 8) & UINT8_MAX);
-
- page4_data_log(p_page_data);
-}
-
-
-void ant_hrm_page_4_decode(uint8_t const * p_page_buffer,
- ant_hrm_page4_data_t * p_page_data)
-{
- ant_hrm_page4_data_layout_t const * p_incoming_data =
- (ant_hrm_page4_data_layout_t *)p_page_buffer;
-
- uint32_t prev_beat = (uint32_t)((p_incoming_data->prev_beat_MSB << 8)
- + p_incoming_data->prev_beat_LSB);
-
- p_page_data->manuf_spec = p_incoming_data->manuf_spec;
- p_page_data->prev_beat = prev_beat;
-
- page4_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_HRM)
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.h
deleted file mode 100644
index a73e80c..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_page_4.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_PAGE_4_H__
-#define ANT_HRM_PAGE_4_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_page4 HRM profile page 4
- * @{
- * @ingroup ant_sdk_profiles_hrm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for HRM data page 4.
- *
- * This structure implements only page 4 specific data.
- */
-typedef struct
-{
- uint8_t manuf_spec; ///< Manufacturer specific byte.
- uint16_t prev_beat; ///< Previous beat.
-} ant_hrm_page4_data_t;
-
-/**@brief Initialize page 4.
- */
-#define DEFAULT_ANT_HRM_PAGE4() \
- (ant_hrm_page4_data_t) \
- { \
- .manuf_spec = 0, \
- .prev_beat = 0, \
- }
-
-/**@brief Function for encoding page 4.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_hrm_page_4_encode(uint8_t * p_page_buffer,
- ant_hrm_page4_data_t const * p_page_data);
-
-/**@brief Function for decoding page 4.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_hrm_page_4_decode(uint8_t const * p_page_buffer,
- ant_hrm_page4_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_PAGE_3_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_pages.h b/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_pages.h
deleted file mode 100644
index ae82ba9..0000000
--- a/components/ant/ant_profiles/ant_hrm/pages/ant_hrm_pages.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __ANT_HRM_PAGES_H
-#define __ANT_HRM_PAGES_H
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_pages Heart Rate Monitor profile pages
- * @{
- * @ingroup ant_hrm
- * @brief This module implements functions for the HRM data pages.
- */
-
-#include "ant_hrm_page_0.h"
-#include "ant_hrm_page_1.h"
-#include "ant_hrm_page_2.h"
-#include "ant_hrm_page_3.h"
-#include "ant_hrm_page_4.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __ANT_HRM_PAGES_H
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.c b/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.c
deleted file mode 100644
index 5b6103e..0000000
--- a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if ANT_HRM_ENABLED
-
-#include "ant_hrm_simulator.h"
-#include "ant_hrm_utils.h"
-#include "nordic_common.h"
-
-#define ITERATION_ANT_CYCLES HRM_MSG_PERIOD_4Hz ///< period of calculation [1/32678 s], defined in ANT device profile
-#define ITERATION_PERIOD (ITERATION_ANT_CYCLES * 1024 / ANT_CLOCK_FREQUENCY) ///< integer part of calculation's period [1/1024 s]
-#define ITERATION_FRACTION (ITERATION_ANT_CYCLES * 1024 % ANT_CLOCK_FREQUENCY) ///< fractional part of calculation's period [1/32678 s]
-
-void ant_hrm_simulator_init(ant_hrm_simulator_t * p_simulator,
- ant_hrm_simulator_cfg_t const * p_config,
- bool auto_change)
-{
-
- p_simulator->p_profile = p_config->p_profile;
- p_simulator->_cb.sensorsim_cfg = p_config->sensorsim_cfg;
- p_simulator->_cb.auto_change = auto_change;
- p_simulator->_cb.sensorsim_state.current_val = p_simulator->_cb.sensorsim_cfg.min;
- p_simulator->_cb.time_since_last_hb = 0;
- p_simulator->_cb.fraction_since_last_hb = 0;
-
- sensorsim_init(&(p_simulator->_cb.sensorsim_state), &(p_simulator->_cb.sensorsim_cfg));
-}
-
-
-void ant_hrm_simulator_one_iteration(ant_hrm_simulator_t * p_simulator)
-{
-
- if (p_simulator->_cb.auto_change)
- {
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg)));
- }
-
- // @note: Take a local copy within scope in order to assist the compiler in variable register
- // allocation.
- const uint32_t computed_heart_rate_value = p_simulator->_cb.sensorsim_state.current_val;
-
- // @note: This implementation assumes that the current instantaneous heart can vary and this
- // function is called with static frequency.
- // value and the heart rate pulse interval is derived from it. The computation is based on 60
- // seconds in a minute and the used time base is 1/1024 seconds.
- const uint32_t current_hb_pulse_interval = (60u * 1024u) / computed_heart_rate_value;
-
- // update time from last hb detected
- p_simulator->_cb.time_since_last_hb += ITERATION_PERIOD;
-
- // extended celculadion by fraction make calculating accurat in long time perspective
- p_simulator->_cb.fraction_since_last_hb += ITERATION_FRACTION;
- uint32_t add_period = p_simulator->_cb.fraction_since_last_hb / ANT_CLOCK_FREQUENCY;
-
- if (add_period > 0)
- {
- p_simulator->_cb.time_since_last_hb++;
- p_simulator->_cb.fraction_since_last_hb %= ANT_CLOCK_FREQUENCY;
- }
-
- // calc number of hb as will fill
- uint32_t new_beats = p_simulator->_cb.time_since_last_hb / current_hb_pulse_interval;
- uint32_t add_event_time = new_beats * current_hb_pulse_interval;
-
- if (new_beats > 0)
- {
- p_simulator->p_profile->HRM_PROFILE_computed_heart_rate =
- (uint8_t)computed_heart_rate_value;
-
- // Current heart beat event time is the previous event time added with the current heart rate
- // pulse interval.
- uint32_t current_heart_beat_event_time = p_simulator->p_profile->HRM_PROFILE_beat_time +
- add_event_time;
-
- // Set current event time.
- p_simulator->p_profile->HRM_PROFILE_beat_time = current_heart_beat_event_time; // <- B<4,5> <-
-
- // Set previous event time. // p4.B<2,3> <- B<4,5>
- p_simulator->p_profile->HRM_PROFILE_prev_beat =
- p_simulator->p_profile->HRM_PROFILE_beat_time - current_hb_pulse_interval;
-
- // Event count.
- p_simulator->p_profile->HRM_PROFILE_beat_count += new_beats; // B<6>
-
- p_simulator->_cb.time_since_last_hb -= add_event_time;
- }
-}
-
-
-void ant_hrm_simulator_increment(ant_hrm_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_increment(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg));
- }
-}
-
-
-void ant_hrm_simulator_decrement(ant_hrm_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_decrement(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg));
- }
-}
-
-
-#endif // ANT_HRM_ENABLED
diff --git a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.h b/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.h
deleted file mode 100644
index 6767afd..0000000
--- a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_HRM_SIMULATOR_H__
-#define ANT_HRM_SIMULATOR_H__
-
-/** @file
- *
- * @defgroup ant_sdk_hrm_simulator ANT HRM simulator
- * @{
- * @ingroup ant_sdk_simulators
- * @brief ANT HRM simulator module.
- *
- * @details This module simulates a pulse for the ANT HRM profile. The module calculates abstract values, which are handled
- * by the HRM pages data model to ensure that they are compatible. It provides a handler for changing the heart rate
- * value manually and functionality to change the heart rate value automatically.
- *
- */
-
-#include
-#include
-#include "ant_hrm.h"
-#include "ant_hrm_utils.h"
-#include "sensorsim.h"
-#include "ant_hrm_simulator_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**@brief HRM simulator configuration structure. */
-typedef struct
-{
- ant_hrm_profile_t * p_profile; ///< Related profile.
- sensorsim_cfg_t sensorsim_cfg; ///< Sensorsim configuration.
-} ant_hrm_simulator_cfg_t;
-
-/**@brief Initialize @ref ant_hrm_simulator_cfg_t.
- */
-#define DEFAULT_ANT_HRM_SIMULATOR_CFG(P_PROFILE, MIN_HEART_RATE, MAX_HEART_RATE, INCREMENT) \
- { \
- .p_profile = (P_PROFILE), \
- .sensorsim_cfg.min = (MIN_HEART_RATE), \
- .sensorsim_cfg.max = (MAX_HEART_RATE), \
- .sensorsim_cfg.incr = (INCREMENT), \
- .sensorsim_cfg.start_at_max = false, \
- }
-
-/**@brief HRM simulator structure. */
-typedef struct
-{
- ant_hrm_profile_t * p_profile; ///< Related profile.
- ant_hrm_simulator_cb_t _cb; ///< Internal control block.
-} ant_hrm_simulator_t;
-
-
-/**@brief Function for initializing the ANT HRM simulator instance.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- * @param[in] p_config Pointer to the simulator configuration structure.
- * @param[in] auto_change Enable or disable automatic changes of the cadence.
- */
-void ant_hrm_simulator_init(ant_hrm_simulator_t * p_simulator,
- ant_hrm_simulator_cfg_t const * p_config,
- bool auto_change);
-
-/**@brief Function for simulating a device event.
- *
- * @details Based on this event, the transmitter data is simulated.
- *
- * This function should be called in the HRM TX event handler.
- */
-void ant_hrm_simulator_one_iteration(ant_hrm_simulator_t * p_simulator);
-
-/**@brief Function for incrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_hrm_simulator_increment(ant_hrm_simulator_t * p_simulator);
-
-/**@brief Function for decrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_hrm_simulator_decrement(ant_hrm_simulator_t * p_simulator);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_SIMULATOR_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator_local.h b/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator_local.h
deleted file mode 100644
index d6c76a4..0000000
--- a/components/ant/ant_profiles/ant_hrm/simulator/ant_hrm_simulator_local.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_HRM_SIMULATOR_LOCAL_H__
-#define ANT_HRM_SIMULATOR_LOCAL_H__
-
-#include
-#include
-#include "ant_hrm.h"
-#include "sensorsim.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @ingroup ant_sdk_hrm_simulator
- * @brief HRM simulator control block structure. */
-typedef struct
-{
- bool auto_change; ///< Cadence will change automatically (if auto_change is set) or manually.
- uint32_t time_since_last_hb; ///< Time since last heart beat occurred (integer part).
- uint64_t fraction_since_last_hb; ///< Time since last heart beat occurred (fractional part).
- sensorsim_state_t sensorsim_state; ///< State of the simulated sensor.
- sensorsim_cfg_t sensorsim_cfg; ///< Configuration of the simulated sensor.
-} ant_hrm_simulator_cb_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_SIMULATOR_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_hrm/utils/ant_hrm_utils.h b/components/ant/ant_profiles/ant_hrm/utils/ant_hrm_utils.h
deleted file mode 100644
index f8e35d9..0000000
--- a/components/ant/ant_profiles/ant_hrm/utils/ant_hrm_utils.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_HRM_UTILS_H__
-#define ANT_HRM_UTILS_H__
-
-#include "app_util.h"
-#include "nrf_assert.h"
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_hrm_utils Heart Rate Monitor profile utilities
- * @{
- * @ingroup ant_hrm
- * @brief This module implements utilities for the Heart Rate Monitor profile.
- *
- */
-
-/**@brief Unit for HRM operating time.
- *
- * @details According to the ANT HRM specification, the operating time unit is 2 seconds.
- */
-#define ANT_HRM_OPERATING_TIME_UNIT 2u
-
-/**@brief This macro should be used to get the seconds part of the operating time.
- */
-#define ANT_HRM_OPERATING_SECONDS(OPERATING_TIME) (((OPERATING_TIME) * ANT_HRM_OPERATING_TIME_UNIT) % 60)
-
-/**@brief This macro should be used to get the minutes part of the operating time.
- */
-#define ANT_HRM_OPERATING_MINUTES(OPERATING_TIME) ((((OPERATING_TIME) * ANT_HRM_OPERATING_TIME_UNIT) / 60) % 60)
-
-/**@brief This macro should be used to get the hours part of the operating time.
- */
-#define ANT_HRM_OPERATING_HOURS(OPERATING_TIME) ((((OPERATING_TIME) * ANT_HRM_OPERATING_TIME_UNIT) / (60 * 60)) % 24)
-
-/**@brief This macro should be used to get the days part of the operating time.
- */
-#define ANT_HRM_OPERATING_DAYS(OPERATING_TIME) ((((OPERATING_TIME) * ANT_HRM_OPERATING_TIME_UNIT) / (60 * 60)) / 24)
-
-/**@brief Number of HRM beat time counts per second.
- *
- * @details According to the ANT HRM specification, the beat time unit is 1/1024 of a second.
- */
-#define ANT_HRM_BEAT_TIME_COUNTS_PER_SEC 1024u
-
-/**@brief Beat time display required precision.
- *
- * @details This value is used to decode the number of milliseconds.
- */
-#define ANT_HRM_BEAT_TIME_PRECISION 1000u
-
-/**@brief This macro should be used to get the seconds part of the HRM beat time.
- */
-#define ANT_HRM_BEAT_TIME_SEC(BEAT_TIME) ((BEAT_TIME) / ANT_HRM_BEAT_TIME_COUNTS_PER_SEC)
-
-/**@brief This macro should be used to get the milliseconds part of the HRM beat time.
- */
-#define ANT_HRM_BEAT_TIME_MSEC(BEAT_TIME) (((((BEAT_TIME) % ANT_HRM_BEAT_TIME_COUNTS_PER_SEC) * ANT_HRM_BEAT_TIME_PRECISION) \
- + (ANT_HRM_BEAT_TIME_COUNTS_PER_SEC / 2)) \
- / ANT_HRM_BEAT_TIME_COUNTS_PER_SEC)
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_HRM_UTILS_H__
-
diff --git a/components/ant/ant_profiles/ant_sdm/ant_sdm.c b/components/ant/ant_profiles/ant_sdm/ant_sdm.c
deleted file mode 100644
index 64d9290..0000000
--- a/components/ant/ant_profiles/ant_sdm/ant_sdm.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "nrf_assert.h"
-#include "app_error.h"
-#include "ant_interface.h"
-#include "ant_sdm.h"
-#include "app_error.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM"
-#if ANT_SDM_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_INFO_COLOR
-#else // ANT_SDM_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_LOG_ENABLED
-#include "nrf_log.h"
-
-#define COMMON_DATA_INTERVAL 64 /**< Common data page is sent every 65th message. */
-
-/**@brief SDM message data layout structure. */
-typedef struct
-{
- ant_sdm_page_t page_number;
- uint8_t page_payload[7];
-}ant_sdm_message_layout_t;
-
-/**@brief Function for initializing the ANT SDM profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- *
- * @retval NRF_SUCCESS Successful initialization.
- * Error code when initialization failed.
- */
-static ret_code_t ant_sdm_init(ant_sdm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config)
-{
- p_profile->channel_number = p_channel_config->channel_number;
-
- p_profile->page_1 = DEFAULT_ANT_SDM_PAGE1();
- p_profile->page_2 = DEFAULT_ANT_SDM_PAGE2();
- p_profile->page_3 = DEFAULT_ANT_SDM_PAGE3();
- p_profile->page_22 = DEFAULT_ANT_SDM_PAGE22();
- p_profile->common = DEFAULT_ANT_SDM_COMMON_DATA();
- p_profile->page_80 = DEFAULT_ANT_COMMON_page80();
- p_profile->page_81 = DEFAULT_ANT_COMMON_page81();
-
- NRF_LOG_INFO("ANT SDM channel %u init\r\n", p_profile->channel_number);
- return ant_channel_init(p_channel_config);
-}
-
-ret_code_t ant_sdm_disp_init(ant_sdm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_sdm_disp_config_t const * p_disp_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_disp_config != NULL);
- ASSERT(p_disp_config->p_cb != NULL);
- ASSERT(p_disp_config->evt_handler != NULL);
-
- p_profile->evt_handler = p_disp_config->evt_handler;
- p_profile->_cb.p_disp_cb = p_disp_config->p_cb;
- ant_request_controller_init(&(p_profile->_cb.p_disp_cb->req_controller));
-
- return ant_sdm_init(p_profile, p_channel_config);
-}
-
-ret_code_t ant_sdm_sens_init(ant_sdm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_sdm_sens_config_t const * p_sens_config)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_channel_config != NULL);
- ASSERT(p_sens_config != NULL);
- ASSERT(p_sens_config->p_cb != NULL);
- ASSERT(p_sens_config->evt_handler != NULL);
- ASSERT(p_sens_config->supplementary_page_number == ANT_SDM_PAGE_1
- || p_sens_config->supplementary_page_number == ANT_SDM_PAGE_2
- || p_sens_config->supplementary_page_number == ANT_SDM_PAGE_3);
-
- p_profile->evt_handler = p_sens_config->evt_handler;
- p_profile->_cb.p_sens_cb = p_sens_config->p_cb;
- ant_request_controller_init(&(p_profile->_cb.p_sens_cb->req_controller));
-
- p_profile->_cb.p_sens_cb->message_counter = 0;
- p_profile->_cb.p_sens_cb->supp_page_control = 0;
- p_profile->_cb.p_sens_cb->supp_page_number = p_sens_config->supplementary_page_number;
- p_profile->_cb.p_sens_cb->common_page_number = ANT_SDM_PAGE_80;
-
- return ant_sdm_init(p_profile, p_channel_config);
-}
-
-ret_code_t ant_sdm_page_request(ant_sdm_profile_t * p_profile, ant_common_page70_data_t * p_page_70)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_page_70 != NULL);
-
- uint32_t err_code = ant_request_controller_request(&(p_profile->_cb.p_disp_cb->req_controller),
- p_profile->channel_number, p_page_70);
- NRF_LOG_INFO("\r\n");
-
- return err_code;
-}
-
-/**@brief Function for getting next page number to send.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @return Next page number.
- */
-static ant_sdm_page_t next_page_number_get(ant_sdm_profile_t * p_profile)
-{
- ant_sdm_sens_cb_t * p_sdm_cb = p_profile->_cb.p_sens_cb;
- ant_sdm_page_t page_number;
-
- if (ant_request_controller_pending_get(&(p_sdm_cb->req_controller), (uint8_t *)&page_number))
- {
- // No implementation needed
- }
- else if (p_sdm_cb->message_counter == (COMMON_DATA_INTERVAL))
- {
- page_number = p_sdm_cb->common_page_number;
- p_sdm_cb->message_counter++;
- }
- else if (p_sdm_cb->message_counter == (COMMON_DATA_INTERVAL + 1))
- {
- page_number = p_sdm_cb->common_page_number;
- p_sdm_cb->common_page_number = (p_sdm_cb->common_page_number == ANT_SDM_PAGE_80)
- ? ANT_SDM_PAGE_81 : ANT_SDM_PAGE_80;
- p_sdm_cb->message_counter = 0;
- }
- else
- {
- if (p_sdm_cb->supp_page_control)
- {
- page_number = p_sdm_cb->supp_page_number;
- }
- else
- {
- page_number = ANT_SDM_PAGE_1;
- }
-
- if ((p_sdm_cb->message_counter % 2) == 1)
- {
- p_sdm_cb->supp_page_control = !p_sdm_cb->supp_page_control;
- }
- p_sdm_cb->message_counter++;
- }
- return page_number;
-}
-
-/**@brief Function for encoding SDM message.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_message_payload Pointer to the message payload.
- *
- * @note Assume to be call each time when Tx window will occur.
- */
-static void sens_message_encode(ant_sdm_profile_t * p_profile, uint8_t * p_message_payload)
-{
- ant_sdm_message_layout_t * p_sdm_message_payload = (ant_sdm_message_layout_t *)p_message_payload;
-
- p_sdm_message_payload->page_number = next_page_number_get(p_profile);
-
- NRF_LOG_INFO("SDM Page number: %u\r\n", p_sdm_message_payload->page_number);
-
- switch (p_sdm_message_payload->page_number)
- {
- case ANT_SDM_PAGE_1:
- ant_sdm_page_1_encode(p_sdm_message_payload->page_payload, &(p_profile->page_1),
- &(p_profile->common));
- ant_sdm_speed_encode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_2:
- ant_sdm_page_2_encode(p_sdm_message_payload->page_payload, &(p_profile->page_2));
- ant_sdm_speed_encode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_3:
- ant_sdm_page_2_encode(p_sdm_message_payload->page_payload, &(p_profile->page_2));
- ant_sdm_page_3_encode(p_sdm_message_payload->page_payload, &(p_profile->page_3));
- ant_sdm_speed_encode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_16:
- ant_sdm_page_16_encode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_22:
- ant_sdm_page_22_encode(p_sdm_message_payload->page_payload, &(p_profile->page_22));
- break;
-
- case ANT_SDM_PAGE_80:
- ant_common_page_80_encode(p_sdm_message_payload->page_payload, &(p_profile->page_80));
- break;
-
- case ANT_SDM_PAGE_81:
- ant_common_page_81_encode(p_sdm_message_payload->page_payload, &(p_profile->page_81));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_sdm_evt_t)p_sdm_message_payload->page_number);
-}
-
-void ant_sdm_sens_evt_handler(ant_sdm_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_ant_event != NULL);
-
- if (p_ant_event->channel == p_profile->channel_number)
- {
- uint32_t err_code;
- uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE];
- ant_sdm_sens_cb_t * p_sdm_cb = p_profile->_cb.p_sens_cb;
- ant_request_controller_sens_evt_handler(&(p_sdm_cb->req_controller), p_ant_event);
-
- switch (p_ant_event->event)
- {
- case EVENT_TX:
- case EVENT_TRANSFER_TX_FAILED:
- case EVENT_TRANSFER_TX_COMPLETED:
- sens_message_encode(p_profile, p_message_payload);
- if (ant_request_controller_ack_needed(&(p_sdm_cb->req_controller)))
- {
- err_code = sd_ant_acknowledge_message_tx(p_profile->channel_number, sizeof(p_message_payload), p_message_payload);
- }
- else
- {
- err_code = sd_ant_broadcast_message_tx(p_profile->channel_number, sizeof(p_message_payload), p_message_payload);
- }
- APP_ERROR_CHECK(err_code);
- break;
- default:
- break;
- }
- }
-}
-
-ret_code_t ant_sdm_disp_open(ant_sdm_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- NRF_LOG_INFO("ANT SDM channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-ret_code_t ant_sdm_sens_open(ant_sdm_profile_t * p_profile)
-{
- ASSERT(p_profile != NULL);
-
- // Fill tx buffer for the first frame
- uint32_t err_code;
- uint8_t p_message_payload[ANT_STANDARD_DATA_PAYLOAD_SIZE];
-
- sens_message_encode(p_profile, p_message_payload);
- err_code =
- sd_ant_broadcast_message_tx(p_profile->channel_number,
- sizeof (p_message_payload),
- p_message_payload);
- APP_ERROR_CHECK(err_code);
-
- NRF_LOG_INFO("ANT SDM channel %u open\r\n", p_profile->channel_number);
- return sd_ant_channel_open(p_profile->channel_number);
-}
-
-
-/**@brief Function for decoding SDM message.
- *
- * @note Assume to be call each time when Rx window will occur.
- */
-static void disp_message_decode(ant_sdm_profile_t * p_profile, uint8_t * p_message_payload)
-{
- const ant_sdm_message_layout_t * p_sdm_message_payload = (ant_sdm_message_layout_t *)p_message_payload;
-
- NRF_LOG_INFO("SDM Page number: %u\r\n", p_sdm_message_payload->page_number);
-
- switch (p_sdm_message_payload->page_number)
- {
- case ANT_SDM_PAGE_1:
- ant_sdm_page_1_decode(p_sdm_message_payload->page_payload, &(p_profile->page_1), &(p_profile->common));
- ant_sdm_speed_decode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_3:
- ant_sdm_page_3_decode(p_sdm_message_payload->page_payload, &(p_profile->page_3));
- /* fall through */
- case ANT_SDM_PAGE_2:
- ant_sdm_page_2_decode(p_sdm_message_payload->page_payload, &(p_profile->page_2));
- ant_sdm_speed_decode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_16:
- ant_sdm_page_16_decode(p_sdm_message_payload->page_payload, &(p_profile->common));
- break;
-
- case ANT_SDM_PAGE_22:
- ant_sdm_page_22_decode(p_sdm_message_payload->page_payload, &(p_profile->page_22));
- break;
-
- case ANT_SDM_PAGE_80:
- ant_common_page_80_decode(p_sdm_message_payload->page_payload, &(p_profile->page_80));
- break;
-
- case ANT_SDM_PAGE_81:
- ant_common_page_81_decode(p_sdm_message_payload->page_payload, &(p_profile->page_81));
- break;
-
- default:
- return;
- }
-
- p_profile->evt_handler(p_profile, (ant_sdm_evt_t)p_sdm_message_payload->page_number);
-}
-
-void ant_sdm_disp_evt_handler(ant_sdm_profile_t * p_profile, ant_evt_t * p_ant_event)
-{
- ASSERT(p_profile != NULL);
- ASSERT(p_ant_event != NULL);
-
- if (p_ant_event->channel == p_profile->channel_number)
- {
- ANT_MESSAGE * p_message = (ANT_MESSAGE *)p_ant_event->msg.evt_buffer;
- ant_sdm_disp_cb_t * p_sdm_cb = p_profile->_cb.p_disp_cb;
-
- switch (ant_request_controller_disp_evt_handler(&(p_sdm_cb->req_controller), p_ant_event))
- {
- case ANT_REQUEST_CONTROLLER_SUCCESS:
- p_profile->evt_handler(p_profile, ANT_SDM_PAGE_REQUEST_SUCCESS);
- break;
- case ANT_REQUEST_CONTROLLER_FAILED:
- p_profile->evt_handler(p_profile, ANT_SDM_PAGE_REQUEST_FAILED);
- break;
- default:
- break;
- }
-
- switch (p_ant_event->event)
- {
- case EVENT_RX:
- if (p_message->ANT_MESSAGE_ucMesgID == MESG_BROADCAST_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_ACKNOWLEDGED_DATA_ID
- || p_message->ANT_MESSAGE_ucMesgID == MESG_BURST_DATA_ID)
- {
- disp_message_decode(p_profile, p_message->ANT_MESSAGE_aucPayload);
- }
- break;
- default:
- break;
- }
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/ant_sdm.h b/components/ant/ant_profiles/ant_sdm/ant_sdm.h
deleted file mode 100644
index b7da9d0..0000000
--- a/components/ant/ant_profiles/ant_sdm/ant_sdm.h
+++ /dev/null
@@ -1,331 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/** @file
- *
- * @defgroup ant_sdm Stride Based Speed and Distance Monitor profile
- * @{
- * @ingroup ant_sdk_profiles
- * @brief This module implements the Stride Based Speed and Distance Monitor profile.
- *
- */
-
-#ifndef ANT_SDM_H__
-#define ANT_SDM_H__
-
-#include
-#include
-#include "ant_parameters.h"
-#include "ant_stack_handler_types.h"
-#include "ant_channel_config.h"
-#include "ant_request_controller.h"
-#include "ant_sdm_pages.h"
-#include "sdk_errors.h"
-
-#define SDM_DEVICE_TYPE 0x7Cu ///< Device type reserved for ANT+ SDM.
-#define SDM_ANTPLUS_RF_FREQ 0x39u ///< Frequency, decimal 57 (2457 MHz).
-
-#define SDM_MSG_PERIOD_4Hz 0x1FC6u ///< Message period, decimal 8134 (4.03 Hz).
-#define SDM_MSG_PERIOD_2Hz 0x3F8Cu ///< Message period, decimal 16268 (2.01 Hz).
-
-#define SDM_EXT_ASSIGN 0x00 ///< ANT ext assign (see Ext. Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
-#define SDM_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE ///< RX SDM channel type.
-#define SDM_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER ///< TX SDM channel type.
-
-/**@brief Initialize an ANT channel configuration structure for the SDM profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- * @param[in] SDM_MSG_PERIOD Channel period in 32 kHz counts. The SDM profile supports only the following periods:
- * @ref SDM_MSG_PERIOD_4Hz, @ref SDM_MSG_PERIOD_2Hz.
- */
-#define SDM_DISP_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER, \
- SDM_MSG_PERIOD) \
-static const ant_channel_config_t NAME##_channel_sdm_disp_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = SDM_DISP_CHANNEL_TYPE, \
- .ext_assign = SDM_EXT_ASSIGN, \
- .rf_freq = SDM_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = SDM_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = (SDM_MSG_PERIOD), \
- .network_number = (NETWORK_NUMBER), \
- }
-#define SDM_DISP_CHANNEL_CONFIG(NAME) &NAME##_channel_sdm_disp_config
-
-/**@brief Initialize an ANT channel configuration structure for the SDM profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] CHANNEL_NUMBER Number of the channel assigned to the profile instance.
- * @param[in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance.
- * @param[in] DEVICE_NUMBER Number of the device assigned to the profile instance.
- * @param[in] NETWORK_NUMBER Number of the network assigned to the profile instance.
- */
-#define SDM_SENS_CHANNEL_CONFIG_DEF(NAME, \
- CHANNEL_NUMBER, \
- TRANSMISSION_TYPE, \
- DEVICE_NUMBER, \
- NETWORK_NUMBER) \
-static const ant_channel_config_t NAME##_channel_sdm_sens_config = \
- { \
- .channel_number = (CHANNEL_NUMBER), \
- .channel_type = SDM_SENS_CHANNEL_TYPE, \
- .ext_assign = SDM_EXT_ASSIGN, \
- .rf_freq = SDM_ANTPLUS_RF_FREQ, \
- .transmission_type = (TRANSMISSION_TYPE), \
- .device_type = SDM_DEVICE_TYPE, \
- .device_number = (DEVICE_NUMBER), \
- .channel_period = SDM_MSG_PERIOD_4Hz, \
- .network_number = (NETWORK_NUMBER), \
- }
-#define SDM_SENS_CHANNEL_CONFIG(NAME) &NAME##_channel_sdm_sens_config
-
-/**@brief Initialize an ANT profile configuration structure for the SDM profile (Display).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the SDM profile.
- */
-#define SDM_DISP_PROFILE_CONFIG_DEF(NAME, \
- EVT_HANDLER) \
-static ant_sdm_disp_cb_t NAME##_sdm_disp_cb; \
-static const ant_sdm_disp_config_t NAME##_profile_sdm_disp_config = \
- { \
- .p_cb = &NAME##_sdm_disp_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define SDM_DISP_PROFILE_CONFIG(NAME) &NAME##_profile_sdm_disp_config
-
-/**@brief Initialize an ANT profile configuration structure for the SDM profile (Sensor).
- *
- * @param[in] NAME Name of related instance.
- * @param[in] SUPPLEMENTARY_PAGE_NUMBER Supplementary data page (ANT_SDM_PAGE_2 or ANT_SDM_PAGE_3). Use ANT_SDM_PAGE_1 to disable.
- * @param[in] EVT_HANDLER Event handler to be called for handling events in the SDM profile.
- */
-#define SDM_SENS_PROFILE_CONFIG_DEF(NAME, \
- SUPPLEMENTARY_PAGE_NUMBER, \
- EVT_HANDLER) \
-static ant_sdm_sens_cb_t NAME##_sdm_sens_cb; \
-static const ant_sdm_sens_config_t NAME##_profile_sdm_sens_config = \
- { \
- .supplementary_page_number = (SUPPLEMENTARY_PAGE_NUMBER), \
- .p_cb = &NAME##_sdm_sens_cb, \
- .evt_handler = (EVT_HANDLER), \
- }
-#define SDM_SENS_PROFILE_CONFIG(NAME) &NAME##_profile_sdm_sens_config
-
-
-/**@brief SDM page number type. */
-typedef enum{
- ANT_SDM_PAGE_1 = 1, ///< Required data page 1.
- ANT_SDM_PAGE_2 = 2, ///< Supplementary data page 2.
- ANT_SDM_PAGE_3 = 3, ///< Supplementary data page 3.
- ANT_SDM_PAGE_16 = 16, ///< Page 16 (sent on request).
- ANT_SDM_PAGE_22 = 22, ///< Page 22 (sent on request).
- ANT_SDM_PAGE_70 = ANT_COMMON_PAGE_70,
- ANT_SDM_PAGE_80 = ANT_COMMON_PAGE_80,
- ANT_SDM_PAGE_81 = ANT_COMMON_PAGE_81,
-} ant_sdm_page_t;
-
-/**@brief SDM profile event type. */
-typedef enum{
- ANT_SDM_PAGE_1_UPDATED = ANT_SDM_PAGE_1, ///< Data page 1 and speed have been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_2_UPDATED = ANT_SDM_PAGE_2, ///< Data page 2 and speed have been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_3_UPDATED = ANT_SDM_PAGE_3, ///< Data page 3 and speed have been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_16_UPDATED = ANT_SDM_PAGE_16, ///< Data page 16 has been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_22_UPDATED = ANT_SDM_PAGE_22, ///< Data page 22 has been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_80_UPDATED = ANT_SDM_PAGE_80, ///< Data page 80 has been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_81_UPDATED = ANT_SDM_PAGE_81, ///< Data page 81 has been updated (Display) or sent (Sensor).
- ANT_SDM_PAGE_REQUEST_SUCCESS, ///< Data page request reached the destination.
- ANT_SDM_PAGE_REQUEST_FAILED, ///< Data page request did not reach the destination.
-} ant_sdm_evt_t;
-
-// Forward declaration of the ant_sdm_profile_t type.
-typedef struct ant_sdm_profile_s ant_sdm_profile_t;
-
-/**@brief SDM event handler type. */
-typedef void (* ant_sdm_evt_handler_t) (ant_sdm_profile_t *, ant_sdm_evt_t);
-
-#include "ant_sdm_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief SDM Sensor configuration structure. */
-typedef struct
-{
- ant_sdm_page_t supplementary_page_number; ///< Supplementary data page (ANT_SDM_PAGE_2 or ANT_SDM_PAGE_3). Use ANT_SDM_PAGE_1 to disable.
- ant_sdm_sens_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_sdm_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the SDM profile.
-} ant_sdm_sens_config_t;
-
-/**@brief SDM Display configuration structure. */
-typedef struct
-{
- ant_sdm_disp_cb_t * p_cb; ///< Pointer to the data buffer for internal use.
- ant_sdm_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the SDM profile.
-} ant_sdm_disp_config_t;
-
-/**@brief SDM profile structure. */
-struct ant_sdm_profile_s
-{
- uint8_t channel_number; ///< Channel number assigned to the profile.
- union {
- ant_sdm_disp_cb_t * p_disp_cb;
- ant_sdm_sens_cb_t * p_sens_cb;
- } _cb; ///< Pointer to internal control block.
- ant_sdm_evt_handler_t evt_handler; ///< Event handler to be called for handling events in the SDM profile.
- ant_sdm_page1_data_t page_1; ///< Page 1.
- ant_sdm_page2_data_t page_2; ///< Page 2.
- ant_sdm_page3_data_t page_3; ///< Page 3.
- ant_sdm_page22_data_t page_22; ///< Page 22.
- ant_common_page80_data_t page_80; ///< Page 80.
- ant_common_page81_data_t page_81; ///< Page 81.
- ant_sdm_common_data_t common; ///< SDM common data.
-};
-
-/** @name Defines for accessing ant_sdm_profile_t members variables
-@{ */
-#define SDM_PROFILE_update_latency page_1.update_latency
-#define SDM_PROFILE_time page_1.time
-#define SDM_PROFILE_status page_2.status.items
-#define SDM_PROFILE_cadence page_2.cadence
-#define SDM_PROFILE_calories page_3.calories
-#define SDM_PROFILE_capabilities page_22.capabilities.items
-#define SDM_PROFILE_speed common.speed
-#define SDM_PROFILE_distance common.distance
-#define SDM_PROFILE_strides common.strides
-#define SDM_PROFILE_hw_revision page_80.hw_revision
-#define SDM_PROFILE_manufacturer_id page_80.manufacturer_id
-#define SDM_PROFILE_model_number page_80.model_number
-#define SDM_PROFILE_sw_revision_minor page_81.sw_revision_minor
-#define SDM_PROFILE_sw_revision_major page_81.sw_revision_major
-#define SDM_PROFILE_serial_number page_81.serial_number
-/** @} */
-
-/**@brief Function for initializing the ANT SDM RX profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_disp_config Pointer to the SDM Display configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_sdm_disp_init(ant_sdm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_sdm_disp_config_t const * p_disp_config);
-
-/**@brief Function for initializing the ANT SDM TX profile instance.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_channel_config Pointer to the ANT channel configuration structure.
- * @param[in] p_sens_config Pointer to the SDM Sensor configuration structure.
- *
- * @retval NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
- */
-ret_code_t ant_sdm_sens_init(ant_sdm_profile_t * p_profile,
- ant_channel_config_t const * p_channel_config,
- ant_sdm_sens_config_t const * p_sens_config);
-
-/**@brief Function for opening the profile instance channel for ANT SDM Display.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_sdm_disp_open(ant_sdm_profile_t * p_profile);
-
-/**@brief Function for opening the profile instance channel for ANT SDM Sensor.
- *
- * Before calling this function, pages should be configured.
- *
- * @param[in] p_profile Pointer to the profile instance.
- *
- * @retval NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
- */
-ret_code_t ant_sdm_sens_open(ant_sdm_profile_t * p_profile);
-
-/**@brief Function for sending a data page request.
- *
- * This function can be called only on the display side.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_page_70 Pointer to the prepared page 70.
- *
- * @retval NRF_SUCCESS If the request has been sent. Otherwise, an error code is returned.
- */
-ret_code_t ant_sdm_page_request(ant_sdm_profile_t * p_profile, ant_common_page70_data_t * p_page_70);
-
-/**@brief Function for handling the Sensor ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the SDM Sensor profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_sdm_sens_evt_handler(ant_sdm_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-/**@brief Function for handling the Display ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the SDM Display profile.
- *
- * @param[in] p_profile Pointer to the profile instance.
- * @param[in] p_ant_event Event received from the ANT stack.
- */
-void ant_sdm_disp_evt_handler(ant_sdm_profile_t * p_profile, ant_evt_t * p_ant_event);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/ant_sdm_local.h b/components/ant/ant_profiles/ant_sdm/ant_sdm_local.h
deleted file mode 100644
index 6b19c77..0000000
--- a/components/ant/ant_profiles/ant_sdm/ant_sdm_local.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef ANT_SDM_LOCAL_H__
-#define ANT_SDM_LOCAL_H__
-
-#include
-#include
-#include "ant_sdm.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup ant_sdm
- * @{
- */
-
-/** @brief SDM Display control block. */
-typedef struct
-{
- ant_request_controller_t req_controller;
-}ant_sdm_disp_cb_t;
-
-/**@brief SDM Sensor control block. */
-typedef struct
-{
- uint8_t supp_page_control;
- ant_sdm_page_t supp_page_number;
- ant_sdm_page_t common_page_number;
- uint8_t message_counter;
- ant_request_controller_t req_controller;
-}ant_sdm_sens_cb_t;
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.c
deleted file mode 100644
index d734057..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_common_data.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM"
-#if ANT_SDM_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_INFO_COLOR
-#else // ANT_SDM_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief SDM common page data layout structure. */
-typedef struct
-{
- uint8_t reserved0[3];
- uint8_t speed_integer :4;
- uint8_t reserved1 :4;
- uint8_t speed_fractional;
- uint8_t reserved2[2];
-}ant_sdm_speed_data_layout_t;
-
-/**@brief Function for tracing common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- */
-static void speed_data_log(ant_sdm_common_data_t const * p_common_data)
-{
- uint32_t speed = ANT_SDM_SPEED_RESCALE(p_common_data->speed);
- UNUSED_VARIABLE(speed);
-
- NRF_LOG_INFO("Speed %u.%02u m/s\r\n\n",
- (unsigned int)(speed / ANT_SDM_SPEED_DISP_PRECISION),
- (unsigned int)(speed % ANT_SDM_SPEED_DISP_PRECISION));
-}
-
-void ant_sdm_speed_encode(uint8_t * p_page_buffer,
- ant_sdm_common_data_t const * p_common_data)
-{
- ant_sdm_speed_data_layout_t * p_outcoming_data = (ant_sdm_speed_data_layout_t *)p_page_buffer;
- uint16_t speed = p_common_data->speed;
-
- p_outcoming_data->speed_integer = speed / ANT_SDM_SPEED_UNIT_REVERSAL;
- p_outcoming_data->speed_fractional = speed % ANT_SDM_SPEED_UNIT_REVERSAL;
-
- speed_data_log(p_common_data);
-}
-
-void ant_sdm_speed_decode(uint8_t const * p_page_buffer,
- ant_sdm_common_data_t * p_common_data)
-{
- ant_sdm_speed_data_layout_t const * p_incoming_data = (ant_sdm_speed_data_layout_t *)p_page_buffer;
- uint16_t speed = (p_incoming_data->speed_integer
- * ANT_SDM_SPEED_UNIT_REVERSAL)
- + p_incoming_data->speed_fractional;
-
- p_common_data->speed = speed;
-
- speed_data_log(p_common_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.h
deleted file mode 100644
index afd2e2b..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_common_data.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_COMMON_DATA_H__
-#define ANT_SDM_COMMON_DATA_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_common_data_page Stride Based Speed and Distance Monitor profile common data
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for SDM common data.
- *
- * @details This structure stores data that is not associated with a particular page.
- */
-typedef struct
-{
- uint16_t speed; ///< Actual speed.
- uint32_t distance; ///< Accumulated distance.
- uint32_t strides; ///< Accumulated strides.
-} ant_sdm_common_data_t;
-
-/**@brief Initialize common data.
- */
-#define DEFAULT_ANT_SDM_COMMON_DATA() \
- (ant_sdm_common_data_t) \
- { \
- .speed = 0, \
- .distance = 0, \
- .strides = 0, \
- }
-
-/**@brief Function for encoding speed.
- *
- * This function can be used for pages 2 and 3.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_speed_encode(uint8_t * p_page_buffer,
- ant_sdm_common_data_t const * p_common_data);
-
-/**@brief Function for decoding speed.
- *
- * This function can be used for pages 2 and 3.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_common_data Pointer to the common data.
- */
-void ant_sdm_speed_decode(uint8_t const * p_page_buffer,
- ant_sdm_common_data_t * p_common_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_COMMON_DATA_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.c
deleted file mode 100644
index e23f215..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_page_1.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM_PAGE_1"
-#if ANT_SDM_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_PAGE_1_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_PAGE_1_INFO_COLOR
-#else // ANT_SDM_PAGE_1_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_PAGE_1_LOG_ENABLED
-#include "nrf_log.h"
-
-/**@brief SDM page 1 data layout structure. */
-typedef struct
-{
- uint8_t time_fractional;
- uint8_t time_integer;
- uint8_t distance_integer;
- uint8_t reserved0 : 4;
- uint8_t distance_fractional : 4;
- uint8_t reserved1;
- uint8_t strides;
- uint8_t update_latency;
-}ant_sdm_page1_data_layout_t;
-
-STATIC_ASSERT(ANT_SDM_UPDATE_LATENCY_DISP_PRECISION == 1000); ///< Display format need to be updated
-STATIC_ASSERT(ANT_SDM_TIME_DISP_PRECISION == 1000); ///< Display format need to be updated
-STATIC_ASSERT(ANT_SDM_DISTANCE_DISP_PRECISION == 10); ///< Display format need to be updated
-
-/**@brief Function for tracing page 1 and common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- * @param[in] p_page_data Pointer to the page 1 data.
- */
-static void page_1_data_log(ant_sdm_page1_data_t const * p_page_data,
- ant_sdm_common_data_t const * p_common_data)
-{
- uint32_t strides = p_common_data->strides;
- uint64_t distance = ANT_SDM_DISTANCE_RESCALE(p_common_data->distance);
- uint16_t update_latency = ANT_SDM_UPDATE_LATENCY_RESCALE(p_page_data->update_latency);
- uint32_t time = ANT_SDM_TIME_RESCALE(p_page_data->time);
-
- NRF_LOG_INFO("Update latency %u.%03u s\r\n",
- update_latency / ANT_SDM_UPDATE_LATENCY_DISP_PRECISION,
- update_latency % ANT_SDM_UPDATE_LATENCY_DISP_PRECISION);
- NRF_LOG_INFO("Time %u.%03u s\r\n",
- (unsigned int)(time / ANT_SDM_TIME_DISP_PRECISION),
- (unsigned int)(time % ANT_SDM_TIME_DISP_PRECISION));
- NRF_LOG_INFO("Distance %u.%01um \r\n",
- (unsigned int)(distance / ANT_SDM_DISTANCE_DISP_PRECISION),
- (unsigned int)(distance % ANT_SDM_DISTANCE_DISP_PRECISION));
- NRF_LOG_INFO("Strides %u\r\n", (unsigned int)strides);
-}
-
-
-void ant_sdm_page_1_encode(uint8_t * p_page_buffer,
- ant_sdm_page1_data_t const * p_page_data,
- ant_sdm_common_data_t const * p_common_data)
-{
- ant_sdm_page1_data_layout_t * p_outcoming_data = (ant_sdm_page1_data_layout_t *)p_page_buffer;
- uint32_t distance = p_common_data->distance;
- uint16_t time = p_page_data->time;
-
- p_outcoming_data->time_fractional = time % ANT_SDM_TIME_UNIT_REVERSAL;
- p_outcoming_data->time_integer = time / ANT_SDM_TIME_UNIT_REVERSAL;
- p_outcoming_data->distance_integer =
- (UINT8_MAX & (distance / ANT_SDM_DISTANCE_UNIT_REVERSAL)); // Only LSB
- p_outcoming_data->distance_fractional = distance % ANT_SDM_DISTANCE_UNIT_REVERSAL;
- p_outcoming_data->strides = (UINT8_MAX & p_common_data->strides); // Only LSB
- p_outcoming_data->update_latency = p_page_data->update_latency;
-
- page_1_data_log(p_page_data, p_common_data);
-}
-
-
-void ant_sdm_page_1_decode(uint8_t const * p_page_buffer,
- ant_sdm_page1_data_t * p_page_data,
- ant_sdm_common_data_t * p_common_data)
-{
- ant_sdm_page1_data_layout_t const * p_incoming_data =
- (ant_sdm_page1_data_layout_t *)p_page_buffer;
-
- uint16_t distance = p_incoming_data->distance_integer * ANT_SDM_DISTANCE_UNIT_REVERSAL
- + p_incoming_data->distance_fractional;
- uint16_t time = p_incoming_data->time_integer * ANT_SDM_TIME_UNIT_REVERSAL
- + p_incoming_data->time_fractional;
-
- uint8_t prev_strides = p_common_data->strides;
-
- p_common_data->strides += ((p_incoming_data->strides - prev_strides) & UINT8_MAX);
-
- uint16_t prev_distance = p_common_data->distance;
- p_common_data->distance += ((distance - prev_distance) & 0xFFF);
-
- p_page_data->update_latency = p_incoming_data->update_latency;
- p_page_data->time = time;
- p_page_data->strides = p_incoming_data->strides;
-
- page_1_data_log(p_page_data, p_common_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.h
deleted file mode 100644
index 4e2ca41..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_1.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_PAGE_1_H__
-#define ANT_SDM_PAGE_1_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_page1 Stride Based Speed and Distance Monitor profile page 1
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-#include "ant_sdm_common_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for SDM data page 1.
- */
-typedef struct
-{
- uint8_t update_latency; ///< Update latency.
- uint8_t strides; ///< Strides (writing to this field has no effect).
- uint16_t time; ///< Time.
-} ant_sdm_page1_data_t;
-
-/**@brief Initialize page 1.
- */
-#define DEFAULT_ANT_SDM_PAGE1() \
- (ant_sdm_page1_data_t) \
- { \
- .update_latency = 0, \
- .time = 0, \
- }
-
-/**@brief Function for encoding page 1.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[in] p_common_data Pointer to the common data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_page_1_encode(uint8_t * p_page_buffer,
- ant_sdm_page1_data_t const * p_page_data,
- ant_sdm_common_data_t const * p_common_data);
-
-/**@brief Function for decoding page 1.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- * @param[out] p_common_data Pointer to the common data.
- */
-void ant_sdm_page_1_decode(uint8_t const * p_page_buffer,
- ant_sdm_page1_data_t * p_page_data,
- ant_sdm_common_data_t * p_common_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_PAGE_1_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.c
deleted file mode 100644
index b0f465d..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_page_16.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM_PAGE_16"
-#if ANT_SDM_PAGE_16_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_PAGE_16_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_PAGE_16_INFO_COLOR
-#else // ANT_SDM_PAGE_16_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_PAGE_16_LOG_ENABLED
-#include "nrf_log.h"
-
-
-/**@brief SDM page 16 data layout structure. */
-typedef struct
-{
- uint8_t strides[3];
- uint8_t distance[4];
-}ant_sdm_page16_data_layout_t;
-
-STATIC_ASSERT(ANT_SDM_DISTANCE_DISP_PRECISION == 10); ///< Display format need to be updated
-
-/**@brief Function for tracing common data.
- *
- * @param[in] p_common_data Pointer to the common data.
- */
-static void page_16_data_log(ant_sdm_common_data_t const * p_common_data)
-{
- uint64_t distance = ANT_SDM_DISTANCE_RESCALE(p_common_data->distance);
-
- NRF_LOG_INFO("Distance %u.%01u m\r\n",
- (unsigned int)(distance / ANT_SDM_DISTANCE_DISP_PRECISION),
- (unsigned int)(distance % ANT_SDM_DISTANCE_DISP_PRECISION));
- NRF_LOG_INFO("Strides %u\r\n\n",
- (unsigned int)p_common_data->strides);
-}
-
-
-void ant_sdm_page_16_encode(uint8_t * p_page_buffer,
- ant_sdm_common_data_t const * p_common_data)
-{
- ant_sdm_page16_data_layout_t * p_outcoming_data = (ant_sdm_page16_data_layout_t *)p_page_buffer;
-
- UNUSED_PARAMETER(uint24_encode(p_common_data->strides, p_outcoming_data->strides));
- UNUSED_PARAMETER(uint32_encode(p_common_data->distance << 4, p_outcoming_data->distance));
-
- page_16_data_log(p_common_data);
-}
-
-
-void ant_sdm_page_16_decode(uint8_t const * p_page_buffer,
- ant_sdm_common_data_t * p_common_data)
-{
- ant_sdm_page16_data_layout_t const * p_incoming_data =
- (ant_sdm_page16_data_layout_t *)p_page_buffer;
-
- p_common_data->strides = uint24_decode(p_incoming_data->strides);
- p_common_data->distance = uint32_decode(p_incoming_data->distance) >> 4;
-
- page_16_data_log(p_common_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.h
deleted file mode 100644
index a721d2b..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_16.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_PAGE_16_H__
-#define ANT_SDM_PAGE_16_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_page16 Stride Based Speed and Distance Monitor profile page 16
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-#include "ant_sdm_common_data.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Function for encoding page 16.
- *
- * @param[in] p_common_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_page_16_encode(uint8_t * p_page_buffer,
- ant_sdm_common_data_t const * p_common_data);
-
-/**@brief Function for decoding page 16.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_common_data Pointer to the page data.
- */
-void ant_sdm_page_16_decode(uint8_t const * p_page_buffer,
- ant_sdm_common_data_t * p_common_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_PAGE_16_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.c
deleted file mode 100644
index b9f4a08..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_page_2.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM_PAGE_2"
-#if ANT_SDM_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_PAGE_2_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_PAGE_2_INFO_COLOR
-#else // ANT_SDM_PAGE_2_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_PAGE_2_LOG_ENABLED
-#include "nrf_log.h"
-
-
-/**@brief SDM page 2 data layout structure. */
-typedef struct
-{
- uint8_t reserved0[2];
- uint8_t cadence_integer;
- uint8_t reserved1 : 4;
- uint8_t cadence_fractional : 4;
- uint8_t reserved2;
- uint8_t reserved3;
- uint8_t status;
-}ant_sdm_page2_data_layout_t;
-
-/**@brief Function for page 2 data.
- *
- * @param[in] p_common_data Pointer to the page 2 data.
- */
-static void page_2_data_log(ant_sdm_page2_data_t const * p_page_data)
-{
- static const char * p_location[4] = {"Laces", "Midsole", "Other", "Ankle"};
- static const char * p_battery[4] = {"New", "Good", "OK", "Low"};
- static const char * p_health[4] = {"OK", "Error", "Warning", ""};
- static const char * p_state[4] = {"Inactive", "Active", "", ""};
-
- uint16_t cadence = ANT_SDM_CADENCE_RESCALE(p_page_data->cadence);
-
- NRF_LOG_INFO("Status:\r\n");
- NRF_LOG_INFO("state: %s\r\n",
- (uint32_t)p_state[p_page_data->status.items.state]);
- NRF_LOG_INFO("health: %s\r\n",
- (uint32_t)p_health[p_page_data->status.items.health]);
- NRF_LOG_INFO("battery: %s\r\n",
- (uint32_t)p_battery[p_page_data->status.items.battery]);
- NRF_LOG_INFO("location: %s\r\n",
- (uint32_t)p_location[p_page_data->status.items.location]);
- NRF_LOG_INFO("Cadence %u.%01u strides/min\r\n",
- cadence / ANT_SDM_CADENCE_DISP_PRECISION,
- cadence % ANT_SDM_CADENCE_DISP_PRECISION);
-}
-
-
-void ant_sdm_page_2_encode(uint8_t * p_page_buffer,
- ant_sdm_page2_data_t const * p_page_data)
-{
- ant_sdm_page2_data_layout_t * p_outcoming_data = (ant_sdm_page2_data_layout_t *)p_page_buffer;
- uint8_t status = p_page_data->status.byte;
- uint16_t cadence = p_page_data->cadence;
-
- p_outcoming_data->reserved0[0] = UINT8_MAX;
- p_outcoming_data->reserved0[1] = UINT8_MAX;
- p_outcoming_data->cadence_integer = cadence / ANT_SDM_CADENCE_UNIT_REVERSAL;
- p_outcoming_data->cadence_fractional = cadence % ANT_SDM_CADENCE_UNIT_REVERSAL;
- p_outcoming_data->reserved3 = UINT8_MAX;
- p_outcoming_data->status = status;
- page_2_data_log(p_page_data);
-}
-
-
-void ant_sdm_page_2_decode(uint8_t const * p_page_buffer,
- ant_sdm_page2_data_t * p_page_data)
-{
- ant_sdm_page2_data_layout_t const * p_incoming_data =
- (ant_sdm_page2_data_layout_t *)p_page_buffer;
-
- uint8_t status = p_incoming_data->status;
- uint16_t cadence = p_incoming_data->cadence_integer * ANT_SDM_CADENCE_UNIT_REVERSAL
- + p_incoming_data->cadence_fractional;
-
- p_page_data->cadence = cadence;
- p_page_data->status.byte = status;
-
- page_2_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.h
deleted file mode 100644
index 5a008fb..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_2.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_PAGE_2_H__
-#define ANT_SDM_PAGE_2_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_page2 Stride Based Speed and Distance Monitor profile page 2
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for SDM data page 2.
- */
-typedef struct
-{
- union
- {
- struct
- {
- enum
- {
- ANT_SDM_USE_STATE_INACTIVE = 0x00,
- ANT_SDM_USE_STATE_ACTIVE = 0x01,
- ANT_SDM_STATE_RESERVED0 = 0x02,
- ANT_SDM_STATE_RESERVED1 = 0x03,
- } state : 2; ///< Use state.
- enum
- {
- ANT_SDM_HEALTH_OK = 0x00,
- ANT_SDM_HEALTH_ERROR = 0x01,
- ANT_SDM_HEALTH_WARNING = 0x02,
- ANT_SDM_HEALTH_RESERVED = 0x03,
- } health : 2; ///< SDM health.
- enum
- {
- ANT_SDM_BATTERY_STATUS_NEW = 0x00,
- ANT_SDM_BATTERY_STATUS_GOOD = 0x01,
- ANT_SDM_BATTERY_STATUS_OK = 0x02,
- ANT_SDM_BATTERY_STATUS_LOW = 0x03,
- } battery : 2; ///< Battery status.
- enum
- {
- ANT_SDM_LOCATION_LACES = 0x00,
- ANT_SDM_LOCATION_MIDSOLE = 0x01,
- ANT_SDM_LOCATION_OTHER = 0x02,
- ANT_SDM_LOCATION_ANKLE = 0x03,
- } location : 2; ///< Location of the SDM sensor.
- } items;
- uint8_t byte;
- } status; ///< Actual status.
- uint16_t cadence; ///< Actual cadence.
-} ant_sdm_page2_data_t;
-
-/**@brief Initialize page 2.
- */
-#define DEFAULT_ANT_SDM_PAGE2() \
- (ant_sdm_page2_data_t) \
- { \
- .status.byte = 0, \
- .cadence = 0, \
- }
-
-/**@brief Function for encoding page 2.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_page_2_encode(uint8_t * p_page_buffer,
- ant_sdm_page2_data_t const * p_page_data);
-
-/**@brief Function for decoding page 2.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_sdm_page_2_decode(uint8_t const * p_page_buffer,
- ant_sdm_page2_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_PAGE_2_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.c
deleted file mode 100644
index c59ef4f..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include
-#include "ant_sdm_page_22.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM_PAGE_22"
-#if ANT_SDM_PAGE_22_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_PAGE_22_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_PAGE_22_INFO_COLOR
-#else // ANT_SDM_PAGE_22_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_PAGE_22_LOG_ENABLED
-#include "nrf_log.h"
-
-
-/**@brief SDM page 22 data layout structure. */
-typedef struct
-{
- uint8_t capabilities;
- uint8_t reserved[6];
-}ant_sdm_page22_data_layout_t;
-
-/**@brief Function for tracing page 22 data.
- *
- * @param[in] p_page_data Pointer to the page 22 data.
- */
-static void page_22_data_log(ant_sdm_page22_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Capabilities: ");
-
- if (p_page_data->capabilities.items.time_is_valid)
- {
- NRF_LOG_RAW_INFO(" time");
- }
-
- if (p_page_data->capabilities.items.distance_is_valid)
- {
- NRF_LOG_RAW_INFO(" distance");
- }
-
- if (p_page_data->capabilities.items.speed_is_valid)
- {
- NRF_LOG_RAW_INFO(" speed");
- }
-
- if (p_page_data->capabilities.items.latency_is_valid)
- {
- NRF_LOG_RAW_INFO(" latency");
- }
-
- if (p_page_data->capabilities.items.cadency_is_valid)
- {
- NRF_LOG_RAW_INFO(" cadence");
- }
-
- if (p_page_data->capabilities.items.calorie_is_valid)
- {
- NRF_LOG_RAW_INFO(" calories");
- }
- NRF_LOG_RAW_INFO("\r\n\n");
-}
-
-
-void ant_sdm_page_22_encode(uint8_t * p_page_buffer,
- ant_sdm_page22_data_t const * p_page_data)
-{
- ant_sdm_page22_data_layout_t * p_outcoming_data = (ant_sdm_page22_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->capabilities = p_page_data->capabilities.byte;
- memset(p_outcoming_data->reserved, UINT8_MAX, sizeof (p_outcoming_data->reserved));
-
- page_22_data_log(p_page_data);
-}
-
-
-void ant_sdm_page_22_decode(uint8_t const * p_page_buffer,
- ant_sdm_page22_data_t * p_page_data)
-{
- ant_sdm_page22_data_layout_t const * p_incoming_data =
- (ant_sdm_page22_data_layout_t *)p_page_buffer;
-
- p_page_data->capabilities.byte = p_incoming_data->capabilities;
-
- page_22_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.h
deleted file mode 100644
index 961d63b..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_22.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_PAGE_22_H__
-#define ANT_SDM_PAGE_22_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_page22 Stride Based Speed and Distance Monitor profile page 22
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for SDM data page 22.
- */
-typedef struct
-{
- union
- {
- struct
- {
- bool time_is_valid : 1; ///< Transmitted time is valid.
- bool distance_is_valid : 1; ///< Transmitted distance is valid.
- bool speed_is_valid : 1; ///< Transmitted speed is valid.
- bool latency_is_valid : 1; ///< Transmitted latency is valid.
- bool cadency_is_valid : 1; ///< Transmitted cadency is valid.
- bool calorie_is_valid : 1; ///< Transmitted calorie is valid.
- } items;
- uint8_t byte;
- } capabilities;
-} ant_sdm_page22_data_t;
-
-/**@brief Initialize page 2.
- */
-#define DEFAULT_ANT_SDM_PAGE22() \
- (ant_sdm_page22_data_t) \
- { \
- .capabilities.byte = 0, \
- }
-
-/**@brief Function for encoding page 22.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_page_22_encode(uint8_t * p_page_buffer,
- ant_sdm_page22_data_t const * p_page_data);
-
-/**@brief Function for decoding page 22.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_sdm_page_22_decode(uint8_t const * p_page_buffer,
- ant_sdm_page22_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_PAGE_22_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.c b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.c
deleted file mode 100644
index 6f6a946..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_page_3.h"
-#include "ant_sdm_utils.h"
-
-#define NRF_LOG_MODULE_NAME "ANT_SDM_PAGE_3"
-#if ANT_SDM_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL ANT_SDM_PAGE_3_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR ANT_SDM_PAGE_3_INFO_COLOR
-#else // ANT_SDM_PAGE_3_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // ANT_SDM_PAGE_3_LOG_ENABLED
-#include "nrf_log.h"
-
-
-/**@brief SDM page 3 data layout structure. */
-typedef struct
-{
- uint8_t reserved0[5];
- uint8_t calories;
- uint8_t reserved1;
-}ant_sdm_page3_data_layout_t;
-
-static void page_3_data_log(ant_sdm_page3_data_t const * p_page_data)
-{
- NRF_LOG_INFO("Calories: %u\r\n\n", p_page_data->calories);
-}
-
-
-void ant_sdm_page_3_encode(uint8_t * p_page_buffer,
- ant_sdm_page3_data_t const * p_page_data)
-{
- ant_sdm_page3_data_layout_t * p_outcoming_data = (ant_sdm_page3_data_layout_t *)p_page_buffer;
-
- p_outcoming_data->calories = p_page_data->calories;
- page_3_data_log(p_page_data);
-}
-
-
-void ant_sdm_page_3_decode(uint8_t const * p_page_buffer,
- ant_sdm_page3_data_t * p_page_data)
-{
- ant_sdm_page3_data_layout_t const * p_incoming_data =
- (ant_sdm_page3_data_layout_t *)p_page_buffer;
-
- uint8_t prev_calories = (uint8_t) p_page_data->calories;
-
- p_page_data->calories += ((p_incoming_data->calories - prev_calories) & UINT8_MAX);
-
- page_3_data_log(p_page_data);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.h
deleted file mode 100644
index a022769..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_page_3.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_PAGE_3_H__
-#define ANT_SDM_PAGE_3_H__
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_page3 Stride Based Speed and Distance Monitor profile page 3
- * @{
- * @ingroup ant_sdk_profiles_sdm_pages
- */
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief Data structure for SDM data page 3.
- */
-typedef struct
-{
- uint32_t calories; ///< Calories.
-} ant_sdm_page3_data_t;
-
-/**@brief Initialize page 3.
- */
-#define DEFAULT_ANT_SDM_PAGE3() \
- (ant_sdm_page3_data_t) \
- { \
- .calories = 0, \
- }
-
-/**@brief Function for encoding page 3.
- *
- * @param[in] p_page_data Pointer to the page data.
- * @param[out] p_page_buffer Pointer to the data buffer.
- */
-void ant_sdm_page_3_encode(uint8_t * p_page_buffer,
- ant_sdm_page3_data_t const * p_page_data);
-
-/**@brief Function for decoding page 3.
- *
- * @param[in] p_page_buffer Pointer to the data buffer.
- * @param[out] p_page_data Pointer to the page data.
- */
-void ant_sdm_page_3_decode(uint8_t const * p_page_buffer,
- ant_sdm_page3_data_t * p_page_data);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_PAGE_3_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_pages.h b/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_pages.h
deleted file mode 100644
index f02dcd6..0000000
--- a/components/ant/ant_profiles/ant_sdm/pages/ant_sdm_pages.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef __ANT_SDM_PAGES_H
-#define __ANT_SDM_PAGES_H
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_pages Stride Based Speed and Distance Monitor profile pages
- * @{
- * @ingroup ant_sdm
- * @brief This module implements functions for the SDM data pages.
- */
-
-#include "ant_sdm_page_1.h"
-#include "ant_sdm_page_2.h"
-#include "ant_sdm_page_3.h"
-#include "ant_sdm_page_16.h"
-#include "ant_sdm_page_22.h"
-#include "ant_sdm_common_data.h"
-#include "ant_common_page_70.h"
-#include "ant_common_page_80.h"
-#include "ant_common_page_81.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __ANT_SDM_PAGES_H
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.c b/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.c
deleted file mode 100644
index de23ad8..0000000
--- a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SDM)
-
-#include "ant_sdm_simulator.h"
-#include "ant_sdm_utils.h"
-
-#define SIMULATOR_STRIDE_LENGTH_UNIT_REVERSAL 100 ///< Stride length unit is cm.
-#define SIMULATOR_BURN_RATE_UNIT 1000 ///< Burn rate uinit is kcal per km.
-#define SIMULATOR_TIME_INCREMENT SDM_MSG_PERIOD_4Hz ///< Ticks between two cycles.
-#define SIMULATOR_TIME_UNIT_REVERSAL ANT_CLOCK_FREQUENCY ///< Simulation time frequency.
-#define SEC_PER_MIN 60 ///< Number of seconds per minute.
-#define SIMULATOR_STRIDE_UNIT_REVERSAL (SIMULATOR_TIME_UNIT_REVERSAL * \
- ANT_SDM_CADENCE_UNIT_REVERSAL * SEC_PER_MIN)
-
-
-void ant_sdm_simulator_init(ant_sdm_simulator_t * p_simulator,
- ant_sdm_simulator_cfg_t const * p_config,
- bool auto_change)
-{
- p_simulator->p_profile = p_config->p_profile;
- p_simulator->_cb.stride_length = p_config->stride_length;
- p_simulator->_cb.burn_rate = p_config->burn_rate;
- p_simulator->_cb.sensorsim_cfg = p_config->sensorsim_cfg;
- p_simulator->_cb.auto_change = auto_change;
- p_simulator->_cb.sensorsim_state.current_val = p_simulator->_cb.sensorsim_cfg.min;
- p_simulator->_cb.stride_incr = 0;
- p_simulator->_cb.time = 0;
-
-
- sensorsim_init(&(p_simulator->_cb.sensorsim_state), &(p_simulator->_cb.sensorsim_cfg));
-}
-
-
-void ant_sdm_simulator_one_iteration(ant_sdm_simulator_t * p_simulator)
-{
- if (p_simulator->_cb.auto_change)
- {
- UNUSED_PARAMETER(sensorsim_measure(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg)));
- }
-
- p_simulator->_cb.time += SIMULATOR_TIME_INCREMENT;
-
- p_simulator->_cb.stride_incr += p_simulator->_cb.sensorsim_state.current_val *
- SIMULATOR_TIME_INCREMENT;
- p_simulator->p_profile->SDM_PROFILE_strides += p_simulator->_cb.stride_incr /
- SIMULATOR_STRIDE_UNIT_REVERSAL;
- p_simulator->_cb.stride_incr = p_simulator->_cb.stride_incr %
- SIMULATOR_STRIDE_UNIT_REVERSAL;
-
-
- uint32_t distance = value_rescale(
- p_simulator->p_profile->SDM_PROFILE_strides * p_simulator->_cb.stride_length,
- SIMULATOR_STRIDE_LENGTH_UNIT_REVERSAL,
- ANT_SDM_DISTANCE_UNIT_REVERSAL);
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.cadency_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_cadence = p_simulator->_cb.sensorsim_state.current_val;
- }
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.speed_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_speed = value_rescale(
- p_simulator->_cb.sensorsim_state.current_val * p_simulator->_cb.stride_length,
- ANT_SDM_CADENCE_UNIT_REVERSAL * SIMULATOR_STRIDE_LENGTH_UNIT_REVERSAL * SEC_PER_MIN,
- ANT_SDM_SPEED_UNIT_REVERSAL);
- }
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.distance_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_distance = distance;
- }
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.calorie_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_calories = value_rescale(distance,
- SIMULATOR_BURN_RATE_UNIT
- * ANT_SDM_DISTANCE_UNIT_REVERSAL,
- p_simulator->_cb.burn_rate);
- }
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.time_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_time = value_rescale(p_simulator->_cb.time,
- SIMULATOR_TIME_UNIT_REVERSAL,
- ANT_SDM_TIME_UNIT_REVERSAL);
- }
-
- if (p_simulator->p_profile->SDM_PROFILE_capabilities.latency_is_valid)
- {
- p_simulator->p_profile->SDM_PROFILE_update_latency =
- ROUNDED_DIV(((uint64_t)p_simulator->_cb.stride_incr *
- ANT_SDM_UPDATE_LATENCY_UNIT_REVERSAL),
- (uint64_t)SIMULATOR_TIME_UNIT_REVERSAL *
- p_simulator->_cb.sensorsim_state.current_val);
- }
-}
-
-
-void ant_sdm_simulator_increment(ant_sdm_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_increment(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg));
- }
-}
-
-
-void ant_sdm_simulator_decrement(ant_sdm_simulator_t * p_simulator)
-{
- if (!p_simulator->_cb.auto_change)
- {
- sensorsim_decrement(&(p_simulator->_cb.sensorsim_state),
- &(p_simulator->_cb.sensorsim_cfg));
- }
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SDM)
diff --git a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.h b/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.h
deleted file mode 100644
index 626598b..0000000
--- a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_SIMULATOR_H__
-#define ANT_SDM_SIMULATOR_H__
-
-/** @file
- *
- * @defgroup ant_sdk_sdm_simulator ANT SDM simulator
- * @{
- * @ingroup ant_sdk_simulators
- * @brief ANT SDM simulator module.
- *
- * @details This module simulates strides for the ANT SDM profile. The module calculates
- * abstract values, which are handled by the SDM pages data model to ensure that they are
- * compatible. It provides a handler for changing the cadence value manually and functionality
- * for changing the cadence automatically.
- *
- */
-
-#include
-#include
-#include "ant_sdm.h"
-#include "ant_sdm_utils.h"
-#include "sensorsim.h"
-#include "ant_sdm_simulator_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@brief SDM simulator configuration structure. */
-typedef struct
-{
- ant_sdm_profile_t * p_profile; ///< Related profile.
- uint32_t stride_length; ///< Length of a stride in cm.
- uint32_t burn_rate; ///< Kcal per kilometer.
- sensorsim_cfg_t sensorsim_cfg; ///< Sensorsim configuration.
-} ant_sdm_simulator_cfg_t;
-
-/**@brief Initialize @ref ant_sdm_simulator_cfg_t.
- */
-#define DEFAULT_ANT_SDM_SIMULATOR_CFG(P_PROFILE, \
- STRIDE_LEN, \
- BURN_RATE, \
- MIN_CADENCE, \
- MAX_CADENCE, \
- INCREMENT) \
- { \
- .p_profile = (P_PROFILE), \
- .stride_length = (STRIDE_LEN), \
- .burn_rate = (BURN_RATE), \
- .sensorsim_cfg.min = (MIN_CADENCE) *(ANT_SDM_CADENCE_UNIT_REVERSAL), \
- .sensorsim_cfg.max = (MAX_CADENCE) *(ANT_SDM_CADENCE_UNIT_REVERSAL), \
- .sensorsim_cfg.incr = (INCREMENT) *(ANT_SDM_CADENCE_UNIT_REVERSAL), \
- .sensorsim_cfg.start_at_max = false, \
- }
-
-/**@brief SDM simulator structure. */
-typedef struct
-{
- ant_sdm_profile_t * p_profile; ///< Related profile.
- ant_sdm_simulator_cb_t _cb; ///< Internal control block.
-} ant_sdm_simulator_t;
-
-
-/**@brief Function for initializing the ANT SDM simulator instance.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- * @param[in] p_config Pointer to the simulator configuration structure.
- * @param[in] auto_change Enable or disable automatic changes of the cadence.
- */
-void ant_sdm_simulator_init(ant_sdm_simulator_t * p_simulator,
- ant_sdm_simulator_cfg_t const * p_config,
- bool auto_change);
-
-/**@brief Function for simulating a device event.
- *
- * @details Based on this event, the transmitter data is simulated.
- *
- * This function should be called in the SDM TX event handler.
- */
-void ant_sdm_simulator_one_iteration(ant_sdm_simulator_t * p_simulator);
-
-/**@brief Function for incrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_sdm_simulator_increment(ant_sdm_simulator_t * p_simulator);
-
-/**@brief Function for decrementing the cadence value.
- *
- * @param[in] p_simulator Pointer to the simulator instance.
- */
-void ant_sdm_simulator_decrement(ant_sdm_simulator_t * p_simulator);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_SIMULATOR_H__
-/** @} */
diff --git a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator_local.h b/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator_local.h
deleted file mode 100644
index 2ccbd36..0000000
--- a/components/ant/ant_profiles/ant_sdm/simulator/ant_sdm_simulator_local.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_SIMULATOR_LOCAL_H__
-#define ANT_SDM_SIMULATOR_LOCAL_H__
-
-#include
-#include
-#include "ant_sdm.h"
-#include "sensorsim.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @ingroup ant_sdk_sdm_simulator
- * @brief SDM simulator control block structure. */
-typedef struct
-{
- bool auto_change; ///< Cadence will change automatically (if auto_change is set) or manually.
- uint8_t stride_length; ///< Length of a stride (in cm).
- uint8_t burn_rate; ///< Kcal per kilometer.
- uint32_t stride_incr; ///< Fractional part of stride increment.
- uint64_t time; ///< Simulation time.
- sensorsim_state_t sensorsim_state; ///< State of the simulated sensor.
- sensorsim_cfg_t sensorsim_cfg; ///< Configuration of the simulated sensor.
-}ant_sdm_simulator_cb_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_SIMULATOR_LOCAL_H__
diff --git a/components/ant/ant_profiles/ant_sdm/utils/ant_sdm_utils.h b/components/ant/ant_profiles/ant_sdm/utils/ant_sdm_utils.h
deleted file mode 100644
index 870835a..0000000
--- a/components/ant/ant_profiles/ant_sdm/utils/ant_sdm_utils.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_SDM_UTILS_H__
-#define ANT_SDM_UTILS_H__
-
-#include "nrf_assert.h"
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @file
- *
- * @defgroup ant_sdk_profiles_sdm_utils Stride Based Speed and Distance Monitor profile utilities
- * @{
- * @ingroup ant_sdm
- * @brief This module implements utilities for the Stride Based Speed and Distance Monitor profile.
- *
- */
-
-/*@brief A reversal of time unit.
- *
- * @details According to the ANT SDM specification, the time unit (fractional part) is 1/200 of a second.
- */
-#define ANT_SDM_TIME_UNIT_REVERSAL 200
-#define ANT_SDM_TIME_DISP_PRECISION 1000
-#define ANT_SDM_TIME_RESCALE(VALUE) value_rescale((VALUE), ANT_SDM_TIME_UNIT_REVERSAL, \
- ANT_SDM_TIME_DISP_PRECISION)
-
-/*@brief A reversal of distance unit.
- *
- * @details According to the ANT SDM specification, the distance unit (page 1 - fractional part) is 1/16 of a meter.
- */
-#define ANT_SDM_DISTANCE_UNIT_REVERSAL 16
-#define ANT_SDM_DISTANCE_DISP_PRECISION 10
-#define ANT_SDM_DISTANCE_RESCALE(VALUE) value_rescale((VALUE), ANT_SDM_DISTANCE_UNIT_REVERSAL, \
- ANT_SDM_DISTANCE_DISP_PRECISION)
-
-/*@brief A reversal of speed unit.
- *
- * @details According to the ANT SDM specification, the speed unit (fractional part) is 1/256 of m/s.
- */
-#define ANT_SDM_SPEED_UNIT_REVERSAL 256
-#define ANT_SDM_SPEED_DISP_PRECISION 100
-#define ANT_SDM_SPEED_RESCALE(VALUE) value_rescale((VALUE), ANT_SDM_SPEED_UNIT_REVERSAL, \
- ANT_SDM_SPEED_DISP_PRECISION)
-
-/*@brief A reversal of update latency unit.
- *
- * @details According to the ANT SDM specification, the update latency unit (fractional part) is 1/32 of a second.
- */
-#define ANT_SDM_UPDATE_LATENCY_UNIT_REVERSAL 32
-#define ANT_SDM_UPDATE_LATENCY_DISP_PRECISION 1000
-#define ANT_SDM_UPDATE_LATENCY_RESCALE(VALUE) value_rescale((VALUE), ANT_SDM_UPDATE_LATENCY_UNIT_REVERSAL, \
- ANT_SDM_UPDATE_LATENCY_DISP_PRECISION)
-
-/*@brief A reversal of cadence unit.
- *
- * @details According to the ANT SDM specification, the cadence unit (fractional part) is 1/16 of strides/minute.
- */
-#define ANT_SDM_CADENCE_UNIT_REVERSAL 16
-#define ANT_SDM_CADENCE_DISP_PRECISION 10
-#define ANT_SDM_CADENCE_RESCALE(VALUE) value_rescale((VALUE), ANT_SDM_CADENCE_UNIT_REVERSAL, \
- ANT_SDM_CADENCE_DISP_PRECISION)
-
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SDM_UTILS_H__
-
diff --git a/components/ant/ant_search_config/ant_search_config.c b/components/ant/ant_search_config/ant_search_config.c
deleted file mode 100644
index 042e811..0000000
--- a/components/ant/ant_search_config/ant_search_config.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_SEARCH_CONFIG)
-
-#include "ant_search_config.h"
-#include "ant_interface.h"
-
-uint32_t ant_search_init(ant_search_config_t const * p_config)
-{
- uint32_t err_code;
-
- if (p_config->low_priority_timeout == ANT_LOW_PRIORITY_SEARCH_DISABLE
- && p_config->high_priority_timeout == ANT_HIGH_PRIORITY_SEARCH_DISABLE)
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- err_code = sd_ant_search_channel_priority_set(p_config->channel_number,
- p_config->search_priority);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_search_waveform_set(p_config->channel_number,
- p_config->waveform);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_channel_rx_search_timeout_set(p_config->channel_number,
- p_config->high_priority_timeout);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_channel_low_priority_rx_search_timeout_set(p_config->channel_number,
- p_config->low_priority_timeout);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_active_search_sharing_cycles_set(p_config->channel_number,
- p_config->search_sharing_cycles);
- return err_code;
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_SEARCH_CONFIG)
diff --git a/components/ant/ant_search_config/ant_search_config.h b/components/ant/ant_search_config/ant_search_config.h
deleted file mode 100644
index 4dd2cf7..0000000
--- a/components/ant/ant_search_config/ant_search_config.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef ANT_SEARCH_CONFIG_H__
-#define ANT_SEARCH_CONFIG_H__
-
-/** @file
- *
- * @defgroup ant_search_config ANT search configuration
- * @{
- * @ingroup ant_sdk_utils
- * @brief ANT channel search configuration module.
- */
-
-#include
-#include "ant_parameters.h"
-#include "sdk_config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANT_SEARCH_SHARING_CYCLES_DISABLE 0x00 ///< Disable search sharing.
-
-#define ANT_LOW_PRIORITY_SEARCH_DISABLE 0x00 ///< Disable low priority search.
-#define ANT_LOW_PRIORITY_TIMEOUT_DISABLE 0xFF ///< Disable low priority search time-out.
-
-#define ANT_HIGH_PRIORITY_SEARCH_DISABLE 0x00 ///< Disable high priority search.
-#define ANT_HIGH_PRIORITY_TIMEOUT_DISABLE 0xFF ///< Disable high priority search time-out.
-
-/**@brief Search priority. */
-typedef enum
-{
- ANT_SEARCH_PRIORITY_DEFAULT = 0, ///< Default search priority level.
- ANT_SEARCH_PRIORITY_LOWEST = ANT_SEARCH_PRIORITY_DEFAULT, ///< Lowest search priority level.
- ANT_SEARCH_PRIORITY_0 = ANT_SEARCH_PRIORITY_LOWEST,
- ANT_SEARCH_PRIORITY_1 = 1,
- ANT_SEARCH_PRIORITY_2 = 2,
- ANT_SEARCH_PRIORITY_3 = 3,
- ANT_SEARCH_PRIORITY_4 = 4,
- ANT_SEARCH_PRIORITY_5 = 5,
- ANT_SEARCH_PRIORITY_6 = 6,
- ANT_SEARCH_PRIORITY_7 = 7,
- ANT_SEARCH_PRIORITY_HIGHEST = ANT_SEARCH_PRIORITY_7, ///< Highest search priority level.
-} ant_search_priority_t;
-
-/**@brief ANT search waveform. */
-typedef enum
-{
- ANT_WAVEFORM_DEFAULT = 316, ///< Standard search waveform value.
- ANT_WAVEFORM_FAST = 97, ///< Accelerated search waveform value.
-} ant_waveform_t;
-
-/**@brief ANT search configuration structure. */
-typedef struct
-{
- uint8_t channel_number; ///< Assigned channel number.
- uint8_t low_priority_timeout; ///< Low priority time-out (in 2.5 second increments).
- uint8_t high_priority_timeout; ///< High priority time-out (in 2.5 second increments).
- uint8_t search_sharing_cycles; ///< Number of search cycles to run before alternating searches. Search sharing can be disabled by @ref ANT_SEARCH_SHARING_CYCLES_DISABLE.
- ant_search_priority_t search_priority; ///< Search priority.
- ant_waveform_t waveform; ///< Search waveform. Do not use custom values.
-} ant_search_config_t;
-
-/**@brief Initializes the default ANT search configuration structure.
- *
- * @param[in] CHANNEL_NUMBER Number of the channel.
- */
-#define DEFAULT_ANT_SEARCH_CONFIG(CHANNEL_NUMBER) \
-{ \
- .channel_number = CHANNEL_NUMBER, \
- .low_priority_timeout = ANT_DEFAULT_LOW_PRIORITY_TIMEOUT, \
- .high_priority_timeout = ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT, \
- .search_sharing_cycles = ANT_SEARCH_SHARING_CYCLES_DISABLE, \
- .search_priority = ANT_SEARCH_PRIORITY_DEFAULT, \
- .waveform = ANT_WAVEFORM_DEFAULT, \
-}
-
-/**@brief Function for configuring the ANT channel search.
- *
- * @param[in] p_config Pointer to the search configuration structure.
- *
- * @retval NRF_SUCCESS If the channel was successfully configured. Otherwise, an error code is returned.
- */
-uint32_t ant_search_init(ant_search_config_t const * p_config);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_SEARCH_CONFIG_H__
-/** @} */
diff --git a/components/ant/ant_stack_config/ant_stack_config.c b/components/ant/ant_stack_config/ant_stack_config.c
deleted file mode 100644
index 29af15b..0000000
--- a/components/ant/ant_stack_config/ant_stack_config.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_STACK_CONFIG)
-#include "nrf_assert.h"
-#include "ant_stack_config.h"
-#include "ant_interface.h"
-#include "ant_parameters.h"
-
-#define ANT_BUFFER_SIZE_FOR_SD ANT_ENABLE_GET_REQUIRED_SPACE(ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED, \
- ANT_CONFIG_ENCRYPTED_CHANNELS, \
- ANT_CONFIG_BURST_QUEUE_SIZE, \
- ANT_CONFIG_EVENT_QUEUE_SIZE)
-
-static union
-{
- uint8_t u8[ANT_BUFFER_SIZE_FOR_SD];
- uint32_t u32[1]; // force allign to uint32_t
-}ant_stack_buffer; /*!< Memory buffer provided in order to support channel configuration */
-
-uint32_t ant_stack_static_config(void)
-{
- ASSERT(ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED <= MAX_ANT_CHANNELS);
- ASSERT(ANT_CONFIG_ENCRYPTED_CHANNELS <= ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED);
-
- ANT_ENABLE m_ant_enable_cfg =
- {
- .ucTotalNumberOfChannels = ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED,
- .ucNumberOfEncryptedChannels = ANT_CONFIG_ENCRYPTED_CHANNELS,
- .usNumberOfEvents = ANT_CONFIG_EVENT_QUEUE_SIZE,
- .pucMemoryBlockStartLocation = ant_stack_buffer.u8,
- .usMemoryBlockByteSize = ANT_BUFFER_SIZE_FOR_SD
- };
-
- return sd_ant_enable(&m_ant_enable_cfg);
-}
-
-#endif // NRF_MODULE_ENABLED(ANT_STACK_CONFIG)
diff --git a/components/ant/ant_stack_config/ant_stack_config.h b/components/ant/ant_stack_config/ant_stack_config.h
deleted file mode 100644
index 24d7bc2..0000000
--- a/components/ant/ant_stack_config/ant_stack_config.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_STACK_CONFIG_H__
-#define ANT_STACK_CONFIG_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @file
- */
-
-/**
- * @defgroup ant_stack_config ANT stack configuration
- * @{
- * @ingroup ant_sdk_utils
- * @brief Configuration of resources used in the ANT stack.
- *
- * This module initializes the stack according to the configuration of the ANT channels.
- */
-
-/**
- * @brief Function for configuring and enabling the ANT stack.
- * @details The function sets the channel configuration for the stack using the parameters provided
- * in the sdk_config.h file. It also assigns a correspondingly large buffer
- * as static resource.
- *
- * @return A SoftDevice error code.
- */
-uint32_t ant_stack_static_config(void);
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_STACK_CONFIG_H__
diff --git a/components/ant/ant_stack_config/config/ant_stack_config_defs.h b/components/ant/ant_stack_config/config/ant_stack_config_defs.h
deleted file mode 100644
index 425f01e..0000000
--- a/components/ant/ant_stack_config/config/ant_stack_config_defs.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef ANT_STACK_CONFIG_DEFS_H__
-#define ANT_STACK_CONFIG_DEFS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED 0
-#define ANT_CONFIG_ENCRYPTED_CHANNELS 0
-#define ANT_CONFIG_BURST_QUEUE_SIZE 128
-#define ANT_CONFIG_EVENT_QUEUE_SIZE 32
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // ANT_STACK_CONFIG_DEFS_H__
diff --git a/components/ant/ant_state_indicator/ant_state_indicator.c b/components/ant/ant_state_indicator/ant_state_indicator.c
deleted file mode 100644
index 5c4db39..0000000
--- a/components/ant/ant_state_indicator/ant_state_indicator.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(ANT_STATE_INDICATOR)
-#include "ant_parameters.h"
-#include "bsp.h"
-#include "ant_state_indicator.h"
-#include "app_error.h"
-#include "bsp_btn_ant.h"
-#include "nrf_soc.h"
-
-/**
- * @addtogroup ant_sdk_state_indicator ANT channel state indicator module.
- * @{
- */
-
-static uint8_t m_related_channel; ///< ANT channel number linked to indication
-static uint8_t m_channel_type; ///< type of linked ANT channel
-
-
-void ant_state_indicator_init( uint8_t channel, uint8_t channel_type)
-{
- m_related_channel = channel;
- m_channel_type = channel_type;
-
- uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- APP_ERROR_CHECK(err_code);
-}
-
-
-uint32_t ant_state_indicator_channel_opened(void)
-{
- uint32_t err_code = NRF_SUCCESS;
-
- switch (m_channel_type)
- {
- case CHANNEL_TYPE_SLAVE:
- err_code = bsp_indication_set(BSP_INDICATE_SCANNING);
- break;
-
- case CHANNEL_TYPE_SLAVE_RX_ONLY:
- err_code = bsp_indication_set(BSP_INDICATE_SCANNING);
- break;
-
- case CHANNEL_TYPE_MASTER:
- err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
- break;
- }
-
- return err_code;
-}
-
-
-void ant_state_indicator_evt_handler(ant_evt_t * p_ant_evt)
-{
- uint32_t err_code = NRF_SUCCESS;
-
- if (m_related_channel != p_ant_evt->channel)
- return;
-
- switch (m_channel_type)
- {
- case CHANNEL_TYPE_SLAVE:
- case CHANNEL_TYPE_SLAVE_RX_ONLY:
- switch (p_ant_evt->event)
- {
- case EVENT_RX:
- err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
- break;
-
- case EVENT_RX_FAIL:
- err_code = bsp_indication_set(BSP_INDICATE_RCV_ERROR);
- break;
-
- case EVENT_RX_FAIL_GO_TO_SEARCH:
- err_code = bsp_indication_set(BSP_INDICATE_SCANNING);
- break;
-
- case EVENT_CHANNEL_CLOSED:
- err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- ant_state_indicator_sleep_mode_enter();
- break;
-
- case EVENT_RX_SEARCH_TIMEOUT:
- err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- break;
- }
- break;
-
- case CHANNEL_TYPE_MASTER:
- switch (p_ant_evt->event)
- {
- case EVENT_TX:
- break;
- }
- break;
- }
- APP_ERROR_CHECK(err_code);
-}
-
-
-void ant_state_indicator_sleep_mode_enter(void)
-{
- uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
- APP_ERROR_CHECK(err_code);
-
- // Prepare wakeup buttons.
- err_code = bsp_btn_ant_sleep_mode_prepare();
- APP_ERROR_CHECK(err_code);
-
- // Go to system-off mode (this function will not return; wakeup will cause a reset).
- err_code = sd_power_system_off();
- for (;;)
- {
- // Infinite loop after sd_power_system_off for emulated System OFF.
- }
-}
-
-/**
- *@}
- */
-
-#endif // NRF_MODULE_ENABLED(ANT_STATE_INDICATOR)
diff --git a/components/ant/ant_state_indicator/ant_state_indicator.h b/components/ant/ant_state_indicator/ant_state_indicator.h
deleted file mode 100644
index 7fb9451..0000000
--- a/components/ant/ant_state_indicator/ant_state_indicator.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __ANT_STATE_INDICATOR_H
-#define __ANT_STATE_INDICATOR_H
-
-/** @file
- *
- * @defgroup ant_state_indicator ANT channel state indicator
- * @{
- * @ingroup ant_sdk_utils
- * @brief ANT channel state indicator module.
- *
- * @details This module provides functionality for indicating the ANT channel state.
- */
-
-#include
-#include "ant_stack_handler_types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @brief Function for initializing the ANT channel state indicator.
- *
- * @details This function links the signaling procedure with a specific ANT channel.
- *
- * Before calling this function, you must initiate the @ref lib_bsp to be able to use the LEDs.
- *
- * @param[in] channel ANT channel number.
- * @param[in] channel_type ANT channel type (see Assign Channel Parameters in ant_parameters.h: @ref ant_parameters).
- */
-void ant_state_indicator_init( uint8_t channel, uint8_t channel_type);
-
-
-/**
- * @brief Function for handling ANT events.
- *
- * @details This function handles all events from the ANT stack that are of interest to the channel state indicator.
- * This function should always be called when an ANT event occurs.
- *
- * @param[in] p_ant_evt Event received from the ANT stack.
- */
-void ant_state_indicator_evt_handler(ant_evt_t * p_ant_evt);
-
-
-/**
- * @brief Function for indicating the channel opening.
- *
- * @details This function should be called after the opening of the channel.
- *
- * @retval NRF_SUCCESS If the state was successfully indicated.
- * @retval NRF_ERROR_NO_MEM If the internal timer operations queue was full.
- * @retval NRF_ERROR_INVALID_STATE If the application timer module has not been initialized
- * or the internal timer has not been created.
- */
-uint32_t ant_state_indicator_channel_opened(void);
-
-
-/**@brief Function for putting the chip into sleep mode.
- *
- * @details This function sets up a wakeup button and puts the chip into deep sleep mode.
- *
- * @note This function will not return.
- */
-void ant_state_indicator_sleep_mode_enter(void);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/** @} */
diff --git a/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.c b/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.c
deleted file mode 100644
index 568c7a9..0000000
--- a/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.c
+++ /dev/null
@@ -1,964 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if NFC_HAL_ENABLED
-
-#include "hal_nfc_t4t.h"
-#include
-#include
-#include "nfc_t4t_lib.h"
-#include "nfc_fixes.h"
-#include "nrf.h"
-#include "app_util_platform.h"
-#include "nordic_common.h"
-#include "nrf_drv_clock.h"
-
-#define NRF_LOG_MODULE_NAME "HAL_NFC"
-#if HAL_NFC_CONFIG_LOG_ENABLED
-#define NRF_LOG_LEVEL HAL_NFC_CONFIG_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR HAL_NFC_CONFIG_INFO_COLOR
-#define NRF_LOG_DEBUG_COLOR HAL_NFC_CONFIG_DEBUG_COLOR
-#else // HAL_NFC_CONFIG_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // HAL_NFC_CONFIG_LOG_ENABLED
-#include "nrf_log.h"
-
-#if HAL_NFC_CONFIG_DEBUG_PIN_ENABLED
- #include "nrf_gpio.h"
-
- #define HAL_NFC_DEBUG_PIN_CONFIG(pin_num) nrf_gpio_cfg_output(pin_num)
- #define HAL_NFC_DEBUG_PIN_CLEAR(pin_num) nrf_gpio_pin_clear(pin_num)
- #define HAL_NFC_DEBUG_PIN_SET(pin_num) nrf_gpio_pin_set(pin_num)
-
- #define HAL_NFC_DEBUG_PINS_INITIALIZE() \
- do{ \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_HCLOCK_ON_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_NFC_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_NFC_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_DETECT_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_DETECT_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_TIMER4_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_TIMER4_EVENT_DEBUG_PIN); \
- } while(0)
-#else
- #define HAL_NFC_DEBUG_PIN_CLEAR(pin_num)
- #define HAL_NFC_DEBUG_PIN_SET(pin_num)
- #define HAL_NFC_DEBUG_PINS_INITIALIZE()
-#endif // HAL_NFC_DEBUG_PIN_ENABLE
-
-
-/* NFC library version history:
- * #define NFC_LIB_VERSION 0x00 first experimental version intended for nRF52840 IC rev. Engineering A (PCA10056, part of nRF52840 Preview Development Kit)
- */
-
-#define NFC_LIB_VERSION 0x00u /**< Internal: current NFC lib. version */
-
-#define T2T_INTERNAL_BYTES_NR 10u /**< Number of internal bytes defined by Type 2 Tag Operation Technical Specification */
-#define T2T_INTERNAL_BYTE_SN0_SHIFT 0u /**< Internal Byte SN0, NRF_FICR->NFC.TAGHEADER0.MFGID which is Manufacturer ID */
-#define T2T_INTERNAL_BYTE_SN1_SHIFT 8u /**< Internal Byte SN1, NRF_FICR->NFC.TAGHEADER0.UID0 */
-#define T2T_INTERNAL_BYTE_SN2_SHIFT 16u /**< Internal Byte SN2, NRF_FICR->NFC.TAGHEADER0.UID1 */
-#define T2T_INTERNAL_BYTE_SN3_SHIFT 0u /**< Internal Byte SN3, NRF_FICR->NFC.TAGHEADER1.UID3 */
-#define T2T_INTERNAL_BYTE_SN4_SHIFT 8u /**< Internal Byte SN4, NRF_FICR->NFC.TAGHEADER1.UID4 */
-#define T2T_INTERNAL_BYTE_SN5_SHIFT 16u /**< Internal Byte SN5, NRF_FICR->NFC.TAGHEADER1.UID5 */
-#define T2T_INTERNAL_BYTE_SN6_SHIFT 24u /**< Internal Byte SN6, NRF_FICR->NFC.TAGHEADER1.UID6 */
-#define CASCADE_TAG_BYTE 0x88u /**< Constant defined by ISO/EIC 14443-3 */
-#define NFCID1_2ND_LAST_BYTE2_SHIFT 16u /**< Shift value for NFC ID byte 2 */
-#define NFCID1_2ND_LAST_BYTE1_SHIFT 8u /**< Shift value for NFC ID byte 1 */
-#define NFCID1_2ND_LAST_BYTE0_SHIFT 0u /**< Shift value for NFC ID byte 0 */
-#define NFCID1_LAST_BYTE3_SHIFT 24u /**< Shift value for NFC ID byte 3 */
-#define NFCID1_LAST_BYTE2_SHIFT 16u /**< Shift value for NFC ID byte 2 */
-#define NFCID1_LAST_BYTE1_SHIFT 8u /**< Shift value for NFC ID byte 1 */
-#define NFCID1_LAST_BYTE0_SHIFT 0u /**< Shift value for NFC ID byte 0 */
-#define NFC_RX_BUFFER_SIZE 256u /**< NFC Rx data buffer size */
-#define NFC_SLP_REQ_CMD 0x50u /**< NFC SLP_REQ command identifier */
-#define NFC_CRC_SIZE 2u /**< CRC size in bytes */
-#define NFC_T4T_SELRES_PROTOCOL 1u /**< Type 4A Tag PROTOCOL bit setup (b7:b6) for SEL_RES Response frame */
-#define NFC_T4T_SELRES_PROTOCOL_MSK 0x03u /**< PROTOCOL bits mask for SEL_RES Response frame */
-#define NFC_T4T_FWI_MAX 4u /**< Maximum FWI parameter value */
-#define NFC_T4T_RATS_CMD 0xE0u /**< RATS Command Byte */
-#define NFC_T4T_S_DESELECT 0xC2u /**< S(DESELECT) Block identifier */
-#define NFC_T4T_S_WTX 0xF2u /**< S(WTX)Block identifier */
-#define NFC_T4T_I_BLOCK 0x02u /**< I- Block identifier (static bits) */
-#define NFC_T4T_BLOCK_MSK 0xEEu /**< I/R- block mask (DID and NAD not supported, expect these bit equal 0) */
-#define NFC_T4T_R_BLOCK 0xA2u /**< R- Block identifier (static bits) */
-#define NFC_T4T_WTXM_MAX 0x16u /**< WTXM maximum value based on 'NFC Forum Digital Protocol Specification Version 1.1, Requirement 15.2.2.9', and FRAMEDELAYMAX maximum register setting */
-#define NFCT_INTEN_MSK 0x1C5CFFu /**< Mask for all NFCT interrupts */
-
-
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- #define NRF_NFCT_ERRORSTATUS_ALL (NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) /**< Mask for clearing all error flags in NFCT_ERRORSTATUS register */
-#else
- #define NRF_NFCT_ERRORSTATUS_ALL (NFCT_ERRORSTATUS_NFCFIELDTOOWEAK_Msk | \
- NFCT_ERRORSTATUS_NFCFIELDTOOSTRONG_Msk | \
- NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) /**< Mask for clearing all error flags in NFCT_ERRORSTATUS register */
-#endif // HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-
-#define NRF_NFCT_FRAMESTATUS_RX_MSK (NFCT_FRAMESTATUS_RX_OVERRUN_Msk | \
- NFCT_FRAMESTATUS_RX_PARITYSTATUS_Msk | \
- NFCT_FRAMESTATUS_RX_CRCERROR_Msk) /**< Mask for clearing all flags in NFCT_FRAMESTATUS_RX register */
-#define NFC_FIELD_ON_MASK NFCT_FIELDPRESENT_LOCKDETECT_Msk /**< Mask for checking FIELDPRESENT register for state: FIELD ON. */
-#define NFC_FIELD_OFF_MASK NFCT_FIELDPRESENT_FIELDPRESENT_Msk /**< Mask for checking FIELDPRESENT register for state: FIELD OFF. */
-
-#define NFC_T4T_FWI_TO_FWT(FWI) (256u * 16u * (1 << (FWI))) /**< Macro for calculating FWT (in number of NFC carrier periods) from FWI parameter. */
-
-/* Begin: Bugfix for FTPAN-xx (AUTOCOLRESCONFIG) */
-#define NRF_NFCT_AUTOCOLRESCONFIG (*(uint32_t volatile *)(0x4000559C))
-#define NRF_NFCT_AUTOCOLRESCONFIG_Pos 0
-/* End: Bugfix for FTPAN-xx */
-
-typedef enum
-{
- NFC_FIELD_STATE_NONE, /**< Initial value indicating no NFCT Field events. */
- NFC_FIELD_STATE_OFF, /**< NFCT FIELDLOST Event has been set. */
- NFC_FIELD_STATE_ON, /**< NFCT FIELDDETECTED Event has been set. */
- NFC_FIELD_STATE_UNKNOWN /**< Both NFCT Field Events have been set - ambiguous state. */
-}nfct_field_sense_state_t;
-
-/* Static function declarations */
-static inline void nrf_nfct_event_clear(volatile uint32_t * p_event);
-static inline void nrf_nfct_clock_event_handler(nrf_drv_clock_evt_type_t event);
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state);
-
-/* Static data */
-static hal_nfc_callback_t m_nfc_lib_callback = (hal_nfc_callback_t) NULL; /**< Callback to nfc_lib layer */
-static void * m_nfc_lib_context; /**< Callback execution context */
-static volatile uint8_t m_nfc_rx_buffer[NFC_RX_BUFFER_SIZE] = {0}; /**< Buffer for NFC Rx data */
-static volatile bool m_slp_req_received = false; /**< Flag indicating that SLP_REQ Command was received */
-static volatile bool m_field_on = false; /**< Flag indicating that NFC Tag field is present */
-static nrf_drv_clock_handler_item_t m_clock_handler_item; /**< Clock event handler item structure */
-static volatile uint8_t m_fwi; /**< FWI parameter */
-static uint8_t m_wtx_data[2]; /**< Tx buffer for an S(WTX) block */
-static volatile bool m_deselect = false; /**< Flag indicating reception of DESELECT command */
-static volatile bool m_swtx_sent = false; /**< Flag indicating that SWTX command has been sended. */
-static volatile bool m_pending_msg = false; /**< Flag signaling pending message during SWTX command execution. */
-static volatile const uint8_t * m_pending_msg_ptr = NULL; /**< Pointer to pending message buffer. */
-static volatile size_t m_pending_data_length = 0; /**< Length of pending message data. */
-static volatile bool m_t4t_tx_waiting = false; /**< Indicates if HAL is waiting for upper layer response to received command */
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-static volatile uint32_t m_nfc_fieldpresent_mask = NFC_FIELD_OFF_MASK; /**< Mask used for NFC Field polling in NFCT_FIELDPRESENT register */
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-static inline void hal_nfc_re_setup(void);
-static void hal_nfc_field_check(void);
-
-#define NRF_NFCT_POWER (*(uint32_t volatile *)(0x40005FFC))
-
-#define NFC_HAL_FIELDPRESENT_MASK (NFCT_FIELDPRESENT_LOCKDETECT_Msk | \
- NFCT_FIELDPRESENT_FIELDPRESENT_Msk)
-
-#define NFC_HAL_FIELDPRESENT_IS_LOST ((NFCT_FIELDPRESENT_FIELDPRESENT_NoField << \
- NFCT_FIELDPRESENT_FIELDPRESENT_Pos) | \
- (NFCT_FIELDPRESENT_LOCKDETECT_NotLocked << \
- NFCT_FIELDPRESENT_LOCKDETECT_Pos))
-
-static void field_timer_with_callback_config()
-{
- NRF_TIMER4->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos;
- NRF_TIMER4->BITMODE = TIMER_BITMODE_BITMODE_08Bit << TIMER_BITMODE_BITMODE_Pos;
- NRF_TIMER4->PRESCALER = 4 << TIMER_PRESCALER_PRESCALER_Pos;
- NRF_TIMER4->CC[0] = 100 << TIMER_CC_CC_Pos;
- NRF_TIMER4->SHORTS = TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos;
- NRF_TIMER4->INTENSET = TIMER_INTENSET_COMPARE0_Set << TIMER_INTENSET_COMPARE0_Pos;
-
- NVIC_ClearPendingIRQ(TIMER4_IRQn);
- NVIC_SetPriority(TIMER4_IRQn, APP_IRQ_PRIORITY_LOW);
- NVIC_EnableIRQ(TIMER4_IRQn);
-}
-
-
-void TIMER4_IRQHandler(void)
-{
- HAL_NFC_DEBUG_PIN_SET(TIMER4_EVENT_PIN);
- hal_nfc_field_check();
- NRF_TIMER4->EVENTS_COMPARE[0] = 0;
- HAL_NFC_DEBUG_PIN_CLEAR(TIMER4_EVENT_PIN);
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-/**
- * @brief Common part of setup used for NFCT initialization and reinitialization.
- */
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-static void hal_nfc_common_hw_setup(uint8_t * const nfc_internal)
-#else
-static inline void hal_nfc_common_hw_setup(uint8_t * const nfc_internal)
-#endif
-{
- uint32_t nfc_tag_header0 = NRF_FICR->NFC.TAGHEADER0;
- uint32_t nfc_tag_header1 = NRF_FICR->NFC.TAGHEADER1;
-
-/* Begin: Bugfix for FTPAN-98 */
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- *(volatile uint32_t *)0x4000568C = 0x00038148;
-#endif // HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-/* End: Bugfix for FTPAN-98 */
-
-/* Begin: Bugfix for FTPAN-17 */
-/* fixed by avoiding usage of FIELDLOST event */
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- NRF_NFCT->INTENSET = (NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos);
-#else
- NRF_NFCT->INTENSET = (NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos) |
- (NFCT_INTENSET_FIELDLOST_Enabled << NFCT_INTENSET_FIELDLOST_Pos);
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-/* End: Bugfix for FTPAN-17 */
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMESTART_Enabled << NFCT_INTENSET_TXFRAMESTART_Pos);
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_ERROR_Enabled << NFCT_INTENSET_ERROR_Pos) |
- (NFCT_INTENSET_SELECTED_Enabled << NFCT_INTENSET_SELECTED_Pos);
-
- /* According to ISO/IEC 14443-3 */
- nfc_internal[0] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN0_SHIFT)); // SN0
- nfc_internal[1] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN1_SHIFT)); // SN1
- nfc_internal[2] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN2_SHIFT)); // SN2
- nfc_internal[3] = (uint8_t) ((CASCADE_TAG_BYTE) ^ nfc_internal[0] ^
- nfc_internal[1] ^ nfc_internal[2]); // BCC0 = CASCADE_TAG_BYTE ^ SN0 ^ SN1 ^ SN2
- nfc_internal[4] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN3_SHIFT)); // SN3
- nfc_internal[5] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN4_SHIFT)); // SN4
- nfc_internal[6] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN5_SHIFT)); // SN5
- nfc_internal[7] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN6_SHIFT)); // SN6
- nfc_internal[8] = (uint8_t) (nfc_internal[4] ^ nfc_internal[5] ^
- nfc_internal[6] ^ nfc_internal[7]); // BCC1 = SN3 ^ SN4 ^ SN5 ^ SN6
- nfc_internal[9] = (uint8_t) (NFC_LIB_VERSION); // For internal use
-
- /* MSB of NFCID1_2ND_LAST register is not used - always 0 */
- NRF_NFCT->NFCID1_2ND_LAST = ((uint32_t) nfc_internal[0] << NFCID1_2ND_LAST_BYTE2_SHIFT) |
- ((uint32_t) nfc_internal[1] << NFCID1_2ND_LAST_BYTE1_SHIFT) |
- ((uint32_t) nfc_internal[2] << NFCID1_2ND_LAST_BYTE0_SHIFT);
-
- NRF_NFCT->NFCID1_LAST = ((uint32_t) nfc_internal[4] << NFCID1_LAST_BYTE3_SHIFT) |
- ((uint32_t) nfc_internal[5] << NFCID1_LAST_BYTE2_SHIFT) |
- ((uint32_t) nfc_internal[6] << NFCID1_LAST_BYTE1_SHIFT) |
- ((uint32_t) nfc_internal[7] << NFCID1_LAST_BYTE0_SHIFT);
-
- /* Set FRAMEDELAYMAX to maximum available setting, corresponding to FWI = 4 */
- NRF_NFCT->FRAMEDELAYMAX = NFCT_FRAMEDELAYMAX_FRAMEDELAYMAX_Msk;
- m_fwi = 4;
-
- /* Set PROTOCOL bits for Type 4A Tag */
- NRF_NFCT->SELRES =
- (NFC_T4T_SELRES_PROTOCOL << NFCT_SELRES_PROTOCOL_Pos) & NFCT_SELRES_PROTOCOL_Msk;
-
- /* Begin: Bugfix for FTPAN-25 (IC-9929) */
- /* Workaround for wrong SENSRES values require using SDD00001, but here SDD00100 is used
- because it's required to operate with Windows Phone */
- NRF_NFCT->SENSRES =
- (NFCT_SENSRES_NFCIDSIZE_NFCID1Double << NFCT_SENSRES_NFCIDSIZE_Pos) |
- (NFCT_SENSRES_BITFRAMESDD_SDD00100 << NFCT_SENSRES_BITFRAMESDD_Pos);
- /* End: Bugfix for FTPAN-25 (IC-9929)*/
-
- m_swtx_sent = false;
- m_pending_msg = false;
- m_pending_msg_ptr = NULL;
- m_pending_data_length = 0;
-}
-
-
-ret_code_t hal_nfc_setup(hal_nfc_callback_t callback, void * p_context)
-{
- uint8_t nfc_internal[T2T_INTERNAL_BYTES_NR];
-
- m_nfc_lib_callback = callback;
- m_nfc_lib_context = p_context;
-
- hal_nfc_common_hw_setup(nfc_internal);
-
- /* Initialize SDK Clock module for handling high precission clock requests */
- m_clock_handler_item.event_handler = nrf_nfct_clock_event_handler;
- m_clock_handler_item.p_next = NULL;
-
- ret_code_t err_code = nrf_drv_clock_init();
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- field_timer_with_callback_config();
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
- NRF_LOG_INFO("Init\r\n");
- HAL_NFC_DEBUG_PINS_INITIALIZE();
-
- if ((err_code == NRF_SUCCESS) || (err_code == NRF_ERROR_MODULE_ALREADY_INITIALIZED))
- {
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_INTERNAL;
- }
-}
-
-
-/**@brief Function for clearing an event flag in NRF_NFCT registers.
- *
- * @param[in] p_event Pointer to event register.
- *
- */
-static inline void nrf_nfct_event_clear(volatile uint32_t * p_event)
-{
- *p_event = 0;
-
- /* Perform read to ensure clearing is effective */
- volatile uint32_t dummy = *p_event;
- (void)dummy;
-}
-
-
-/**@brief Function for handling events from Clock Module.
- *
- * @param[in] event Clock event.
- *
- */
-static inline void nrf_nfct_clock_event_handler(nrf_drv_clock_evt_type_t event)
-{
- switch (event)
- {
- case NRF_DRV_CLOCK_EVT_HFCLK_STARTED:
- /* Activate NFCT only when HFXO is running */
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- NRF_NFCT->TASKS_ACTIVATE = 1;
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- break;
-
- default:
- /* No implementation required */
- break;
- }
-}
-
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-static inline void nrf_nfct_field_lost_hfclk_handle(void)
-{
- /* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
- // reset the NFC for release HFCLK
- __DMB();
- NRF_NFCT_POWER = 0;
- __DMB();
- NRF_NFCT_POWER = 1;
- /* END: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-/**@brief Function for evaluating and handling NFC field events.
- *
- * @param[in] field_state Current field state.
- *
- */
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state)
-{
- if (field_state == NFC_FIELD_STATE_UNKNOWN)
- {
- /* Probe NFC field */
- uint32_t field_present = NRF_NFCT->FIELDPRESENT;
-
- if (field_present & m_nfc_fieldpresent_mask)
- {
- field_state = NFC_FIELD_STATE_ON;
- }
- else
- {
- field_state = NFC_FIELD_STATE_OFF;
- }
- }
-
- /* Field event service */
- switch (field_state)
- {
- case NFC_FIELD_STATE_ON:
- if (!m_field_on)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- nrf_drv_clock_hfclk_request(&m_clock_handler_item);
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- }
- m_field_on = true;
- break;
-
- case NFC_FIELD_STATE_OFF:
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); // DEBUG!
-
-/* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- *(volatile uint32_t *)0x40005010 = 1;
-#endif // HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-/* END: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
- NRF_NFCT->TASKS_SENSE = 1;
- nrf_drv_clock_hfclk_release();
- m_field_on = false;
-
- NRF_NFCT->INTENCLR =
- (NFCT_INTENCLR_RXFRAMEEND_Clear << NFCT_INTENCLR_RXFRAMEEND_Pos) |
- (NFCT_INTENCLR_RXERROR_Clear << NFCT_INTENCLR_RXERROR_Pos);
-
- /* Change mask to FIELD_OFF state - trigger FIELD_ON even if HW has not locked to the field */
- m_nfc_fieldpresent_mask = NFC_FIELD_OFF_MASK;
-
- if ((m_nfc_lib_callback != NULL) )
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_OFF, 0, 0);
- }
-
- /* Re-enable Auto Collision Resolution */
- NRF_NFCT_AUTOCOLRESCONFIG = NRF_NFCT_AUTOCOLRESCONFIG &
- ~(1u << NRF_NFCT_AUTOCOLRESCONFIG_Pos);
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); // DEBUG!
- break;
-
- default:
- /* No implementation required */
- break;
- }
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-ret_code_t hal_nfc_parameter_set(hal_nfc_param_id_t id, void * p_data, size_t data_length)
-{
- /* Parameter validation is done in upper-layer */
-
- if (id == HAL_NFC_PARAM_FWI)
- {
- /* Update Frame Wait Time setting; possible settings are limited by NFCT hardware */
- m_fwi = *((uint8_t *)p_data);
-
- if (data_length != sizeof(uint8_t))
- {
- return NRF_ERROR_DATA_SIZE;
- }
- if (m_fwi > NFC_T4T_FWI_MAX)
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- /* Set FRAMEDELAYTIME */
- if (m_fwi == NFC_T4T_FWI_MAX)
- {
- NRF_NFCT->FRAMEDELAYMAX = NFCT_FRAMEDELAYMAX_FRAMEDELAYMAX_Msk;
- }
- else
- {
- NRF_NFCT->FRAMEDELAYMAX = NFC_T4T_FWI_TO_FWT(m_fwi);
- }
- }
- else if (id == HAL_NFC_PARAM_SELRES)
- {
- /* Update SEL_RES 'Protocol' bits setting */
- uint8_t sel_res = *((uint8_t *)p_data);
-
- if (data_length != sizeof(uint8_t))
- {
- return NRF_ERROR_DATA_SIZE;
- }
- if (sel_res > NFC_T4T_SELRES_PROTOCOL_MSK)
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- NRF_NFCT->SELRES =
- (sel_res << NFCT_SELRES_PROTOCOL_Pos) & NFCT_SELRES_PROTOCOL_Msk;
- }
- else
- {
- /* No implementation needed */
- }
-
- return NRF_SUCCESS;
-}
-
-
-/* This function is used by nfc_lib for unit testing only */
-ret_code_t hal_nfc_parameter_get(hal_nfc_param_id_t id, void * p_data, size_t * p_max_data_length)
-{
- if (*p_max_data_length < 1)
- {
- *p_max_data_length = 1;
- return NRF_ERROR_DATA_SIZE;
- }
-
- if (id == HAL_NFC_PARAM_FWI)
- {
- *((uint8_t *) p_data) = m_fwi;
- *p_max_data_length = sizeof(m_fwi);
- }
- else if (id == HAL_NFC_PARAM_SELRES)
- {
- /* Update SEL_RES 'Protocol' bits setting */
- uint8_t sel_res = (NRF_NFCT->SELRES & NFCT_SELRES_PROTOCOL_Msk) >>
- NFCT_SELRES_PROTOCOL_Pos;
- *((uint8_t *) p_data) = sel_res;
- *p_max_data_length = sizeof(sel_res);
- }
- else
- {
- /* No implementation needed */
- }
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t hal_nfc_start(void)
-{
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
-
- NVIC_ClearPendingIRQ(NFCT_IRQn);
- NVIC_SetPriority(NFCT_IRQn, APP_IRQ_PRIORITY_LOW);
- NVIC_EnableIRQ(NFCT_IRQn);
-
- NRF_NFCT->TASKS_SENSE = 1;
-
- NRF_LOG_INFO("Start\r\n");
- return NRF_SUCCESS;
-}
-
-
-ret_code_t hal_nfc_send(const uint8_t * p_data, size_t data_length)
-{
- if (data_length == 0)
- {
- return NRF_ERROR_DATA_SIZE;
- }
-
- if(m_swtx_sent)
- {
- m_pending_msg_ptr = p_data;
- m_pending_data_length = data_length;
- m_pending_msg = true;
-
- NRF_LOG_DEBUG("Pending message.\r\n");
- return NRF_SUCCESS;
- }
-
- m_t4t_tx_waiting = false;
-
- /* Ignore previous TX END events, SW takes care only for data frames which tranmission is triggered in this function */
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMEEND_Enabled << NFCT_INTENSET_TXFRAMEEND_Pos); //Moved to the end in T4T to avoid delaying TASKS_STARTX
- NRF_NFCT->PACKETPTR = (uint32_t) p_data;
- NRF_NFCT->TXD.AMOUNT = (data_length << NFCT_TXD_AMOUNT_TXDATABYTES_Pos) &
- NFCT_TXD_AMOUNT_TXDATABYTES_Msk;
- NRF_NFCT->FRAMEDELAYMODE = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_WindowGrid <<
- NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_Pos;
- NRF_NFCT->TASKS_STARTTX = 1;
-
- NRF_LOG_INFO("Send\r\n");
- return NRF_SUCCESS;
-}
-
-
-ret_code_t hal_nfc_stop(void)
-{
- NRF_NFCT->TASKS_DISABLE = 1;
-
- NRF_LOG_INFO("Stop\r\n");
- return NRF_SUCCESS;
-}
-
-
-ret_code_t hal_nfc_done(void)
-{
- m_nfc_lib_callback = (hal_nfc_callback_t) NULL;
-
- return NRF_SUCCESS;
-}
-
-
-void NFCT_IRQHandler(void)
-{
- nfct_field_sense_state_t current_field = NFC_FIELD_STATE_NONE;
-
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_NFC_EVENT_DEBUG_PIN); // DEBUG!
-
- if (NRF_NFCT->EVENTS_FIELDDETECTED && (NRF_NFCT->INTEN & NFCT_INTEN_FIELDDETECTED_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_FIELDDETECTED);
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_DETECT_EVENT_DEBUG_PIN); // DEBUG!
- current_field = NFC_FIELD_STATE_ON;
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_DETECT_EVENT_DEBUG_PIN); // DEBUG!
-
- NRF_LOG_DEBUG("Field detected\r\n");
- }
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- if (NRF_NFCT->EVENTS_FIELDLOST && (NRF_NFCT->INTEN & NFCT_INTEN_FIELDLOST_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_FIELDLOST);
- current_field =
- (current_field == NFC_FIELD_STATE_NONE) ? NFC_FIELD_STATE_OFF : NFC_FIELD_STATE_UNKNOWN;
-
- NRF_LOG_DEBUG("Field lost\r\n");
- }
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
- /* Perform actions if any FIELD event is active */
- if (current_field != NFC_FIELD_STATE_NONE)
- {
- nrf_nfct_field_event_handler(current_field);
- }
-
- if (NRF_NFCT->EVENTS_RXFRAMEEND && (NRF_NFCT->INTEN & NFCT_INTEN_RXFRAMEEND_Msk))
- {
- /* Take into account only number of whole bytes */
- uint32_t rx_data_size = ((NRF_NFCT->RXD.AMOUNT & NFCT_RXD_AMOUNT_RXDATABYTES_Msk) >>
- NFCT_RXD_AMOUNT_RXDATABYTES_Pos) - NFC_CRC_SIZE;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXFRAMEEND);
-
- /* Look for Tag 4 Type Commands */
- if (m_nfc_rx_buffer[0] == NFC_T4T_RATS_CMD)
- {
- /* Disable Auto Collision Resolution */
- NRF_NFCT_AUTOCOLRESCONFIG = NRF_NFCT_AUTOCOLRESCONFIG |
- (1u << NRF_NFCT_AUTOCOLRESCONFIG_Pos);
- NRF_LOG_DEBUG("RX: T4T Activate\r\n");
- }
- else if (m_nfc_rx_buffer[0] == NFC_T4T_S_DESELECT)
- {
- m_deselect = true;
- NRF_LOG_DEBUG("RX: T4T Go to sleep\r\n");
- }
- else if (m_swtx_sent && m_nfc_rx_buffer[0] == NFC_T4T_S_WTX)
- {
- m_swtx_sent = false;
-
- NRF_LOG_DEBUG("RX: S(WTX) reponse\r\n");
-
- if(m_pending_msg)
- {
- m_pending_msg = false;
-
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMEEND_Enabled << NFCT_INTENSET_TXFRAMEEND_Pos);
- NRF_NFCT->PACKETPTR = (uint32_t) m_pending_msg_ptr;
- NRF_NFCT->TXD.AMOUNT = (m_pending_data_length << NFCT_TXD_AMOUNT_TXDATABYTES_Pos) &
- NFCT_TXD_AMOUNT_TXDATABYTES_Msk;
- NRF_NFCT->FRAMEDELAYMODE = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_WindowGrid <<
- NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_Pos;
- NRF_NFCT->TASKS_STARTTX = 1;
-
- m_t4t_tx_waiting = false;
- NRF_LOG_DEBUG("Sending pending message!\r\n");
- }
- }
- else if ((m_nfc_rx_buffer[0] & NFC_T4T_BLOCK_MSK) == NFC_T4T_I_BLOCK)
- {
- /* Set up default transmission of S(WTX) block. Tx will be executed only if FDT timer expires (FrameDelayMode-ExactVal) before
- * hal_nfc_send is called */
- m_wtx_data[0] = NFC_T4T_S_WTX;
- m_wtx_data[1] = NFC_T4T_WTXM_MAX;
- NRF_NFCT->PACKETPTR = (uint32_t) m_wtx_data;
- NRF_NFCT->TXD.AMOUNT = (sizeof(m_wtx_data) << NFCT_TXD_AMOUNT_TXDATABYTES_Pos) &
- NFCT_TXD_AMOUNT_TXDATABYTES_Msk;
- NRF_NFCT->FRAMEDELAYMODE = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_ExactVal <<
- NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_Pos;
- NRF_NFCT->TASKS_STARTTX = 1;
- m_t4t_tx_waiting = true;
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMEEND_Enabled << NFCT_INTENSET_TXFRAMEEND_Pos);
- }
- else
- {
- /* Indicate that SLP_REQ was received - this will cause FRAMEDELAYTIMEOUT error */
- if (m_nfc_rx_buffer[0] == NFC_SLP_REQ_CMD)
- {
- m_slp_req_received = true;
- NRF_NFCT->INTENCLR = NFCT_INTENCLR_RXFRAMEEND_Clear << NFCT_INTENCLR_RXFRAMEEND_Pos; // disable RX here (will enable at SELECTED)
- }
- /* Not a READ Command, so wait for next frame reception */
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
- }
-
- if (m_nfc_lib_callback != NULL)
- {
- /* This callback should trigger transmission of READ Response */
- m_nfc_lib_callback(m_nfc_lib_context,
- HAL_NFC_EVENT_DATA_RECEIVED,
- (void *)m_nfc_rx_buffer,
- rx_data_size);
- }
- /* Clear TXFRAMESTART EVENT so it can be checked in hal_nfc_send */
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMESTART);
- NRF_LOG_DEBUG("Rx fend\r\n");
- }
-
- if (NRF_NFCT->EVENTS_TXFRAMEEND && (NRF_NFCT->INTEN & NFCT_INTEN_TXFRAMEEND_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- /* Disable TX END event to ignore frame transmission other than READ response */
- NRF_NFCT->INTENCLR = (NFCT_INTENCLR_TXFRAMEEND_Clear << NFCT_INTENCLR_TXFRAMEEND_Pos);
-
- if (m_deselect)
- {
- /* Re-enable Auto Collision Resolution */
- NRF_NFCT_AUTOCOLRESCONFIG = NRF_NFCT_AUTOCOLRESCONFIG &
- ~(1u << NRF_NFCT_AUTOCOLRESCONFIG_Pos);
- NRF_NFCT->TASKS_GOSLEEP = 1;
- /* Disable RX here (will be enabled at SELECTED) */
- NRF_NFCT->INTENCLR = NFCT_INTENCLR_RXFRAMEEND_Clear <<
- NFCT_INTENCLR_RXFRAMEEND_Pos;
- m_deselect = false;
- }
- else
- {
- /* Set up for reception */
- NRF_NFCT->PACKETPTR = (uint32_t) m_nfc_rx_buffer;
- NRF_NFCT->MAXLEN = NFC_RX_BUFFER_SIZE;
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
- NRF_NFCT->INTENSET =
- (NFCT_INTENSET_RXFRAMEEND_Enabled << NFCT_INTENSET_RXFRAMEEND_Pos) |
- (NFCT_INTENSET_RXERROR_Enabled << NFCT_INTENSET_RXERROR_Pos);
- }
-
- if (m_nfc_lib_callback != NULL)
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_DATA_TRANSMITTED, 0, 0);
- }
-
- NRF_LOG_DEBUG("Tx fend\r\n");
- }
-
- if (NRF_NFCT->EVENTS_SELECTED && (NRF_NFCT->INTEN & NFCT_INTEN_SELECTED_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_SELECTED);
-
- /* Clear also RX END and RXERROR events because SW does not take care of commands which were received before selecting the tag */
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXFRAMEEND);
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXERROR);
-
- /* Set up registers for EasyDMA and start receiving packets */
- NRF_NFCT->PACKETPTR = (uint32_t) m_nfc_rx_buffer;
- NRF_NFCT->MAXLEN = NFC_RX_BUFFER_SIZE;
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_RXFRAMEEND_Enabled << NFCT_INTENSET_RXFRAMEEND_Pos) |
- (NFCT_INTENSET_RXERROR_Enabled << NFCT_INTENSET_RXERROR_Pos);
-
- /* At this point any previous error status can be ignored */
- NRF_NFCT->FRAMESTATUS.RX = NRF_NFCT_FRAMESTATUS_RX_MSK;
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- /* Change mask to FIELD_ON state - trigger FIELD_ON only if HW has locked to the field */
- m_nfc_fieldpresent_mask = NFC_FIELD_ON_MASK;
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
- if (m_nfc_lib_callback != NULL)
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_ON, 0, 0);
- }
-
- m_swtx_sent = false;
- m_pending_msg = false;
- m_pending_msg_ptr = NULL;
- m_pending_data_length = 0;
-
- NRF_LOG_DEBUG("Selected\r\n");
- }
-
- if (NRF_NFCT->EVENTS_RXERROR && (NRF_NFCT->INTEN & NFCT_INTEN_RXERROR_Msk))
- {
- uint32_t rx_status = NRF_NFCT->FRAMESTATUS.RX;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXERROR);
-
- NRF_LOG_DEBUG("Rx error (0x%x)\r\n", (unsigned int) rx_status);
- (void) rx_status;
-
- m_swtx_sent = false;
-
- if(m_pending_msg)
- {
- m_pending_msg = false;
- m_t4t_tx_waiting = false;
-
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMEEND_Enabled << NFCT_INTENSET_TXFRAMEEND_Pos);
- NRF_NFCT->PACKETPTR = (uint32_t) m_pending_msg_ptr;
- NRF_NFCT->TXD.AMOUNT = (m_pending_data_length << NFCT_TXD_AMOUNT_TXDATABYTES_Pos) &
- NFCT_TXD_AMOUNT_TXDATABYTES_Msk;
- NRF_NFCT->FRAMEDELAYMODE = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_WindowGrid <<
- NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_Pos;
- NRF_NFCT->TASKS_STARTTX = 1;
-
- NRF_LOG_DEBUG("Sending pending message!\r\n");
- }
-
- /* Clear rx frame status */
- NRF_NFCT->FRAMESTATUS.RX = NRF_NFCT_FRAMESTATUS_RX_MSK;
- }
-
- if (NRF_NFCT->EVENTS_ERROR && (NRF_NFCT->INTEN & NFCT_INTEN_ERROR_Msk))
- {
- uint32_t err_status = NRF_NFCT->ERRORSTATUS;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_ERROR);
-
- /* Clear FRAMEDELAYTIMEOUT error (expected HW behaviour) when SLP_REQ command was received */
- if ((err_status & NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) && m_slp_req_received)
- {
- NRF_NFCT->ERRORSTATUS = NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk;
- m_slp_req_received = false;
-
- NRF_LOG_DEBUG("RX: SLP_REQ\r\n");
- }
- /* Report any other error */
- err_status &= ~NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk;
-
- if (err_status)
- {
- NRF_LOG_DEBUG("Error (0x%x)\r\n", (unsigned int) err_status);
- }
-
- /* Clear error status */
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
- }
-
- if (NRF_NFCT->EVENTS_TXFRAMESTART && (NRF_NFCT->INTEN & NFCT_INTEN_TXFRAMESTART_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMESTART);
-
- if (m_t4t_tx_waiting)
- {
- m_t4t_tx_waiting = false;
- m_swtx_sent = true;
-
- NRF_LOG_DEBUG("Response timeout, sending WTX!\r\n");
- }
- }
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_NFC_EVENT_DEBUG_PIN); // DEBUG!
-}
-
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- #error Wrong workaround combination
-#endif
-
-static uint32_t field_state_cnt = 0;
-/**
- * @brief Function for evaluating and handling NFC fieldlost event.
- */
-static void hal_nfc_field_check(void)
-{
- uint32_t nfc_fieldpresen_masked;
-
- nfc_fieldpresen_masked = NRF_NFCT->FIELDPRESENT & NFC_HAL_FIELDPRESENT_MASK;
-
- if (nfc_fieldpresen_masked == NFC_HAL_FIELDPRESENT_IS_LOST)
- {
- ++field_state_cnt;
- if (field_state_cnt > 7)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); // DEBUG!
-
- NRF_TIMER4->TASKS_SHUTDOWN = 1;
-
- nrf_drv_clock_hfclk_release();
-
- nrf_nfct_field_lost_hfclk_handle();
-
- if ((m_nfc_lib_callback != NULL) )
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_OFF, 0, 0);
- }
- m_field_on = false;
-
- /* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
- // resume the NFCT to initialized state
- hal_nfc_re_setup();
- /* End: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); // DEBUG!
- }
-
- return;
- }
-
- field_state_cnt = 0;
-}
-
-
-/**
- * @brief Function for enablinge hight precision clock and start eveluating fieldlost event.
- */
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state)
-{
- if (!m_field_on)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- nrf_drv_clock_hfclk_request(&m_clock_handler_item);
-
- NRF_TIMER4->TASKS_CLEAR = 1;
- NRF_TIMER4->TASKS_START = 1;
- field_state_cnt = 0;
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); // DEBUG!
- }
- m_field_on = true;
-}
-
-
-/**
- * @brief Function for resume the NFCT to initialized state after software's reset.
- */
-static inline void hal_nfc_re_setup(void)
-{
- uint8_t nfc_internal[T2T_INTERNAL_BYTES_NR];
-
- hal_nfc_common_hw_setup(nfc_internal);
-
- NRF_LOG_INFO("Reinitialize\r\n");
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#endif // NFC_HAL_ENABLED
diff --git a/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.h b/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.h
deleted file mode 100644
index ef0a307..0000000
--- a/components/nfc/experimental_t4t_lib/hal_t4t/hal_nfc_t4t.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef HAL_NFC_H__
-#define HAL_NFC_H__
-
-/** @file
- * @defgroup nfc_t4t_hal NFC Type 4 Tag HAL
- * @{
- * @ingroup nfc_t4t
- * @brief @tagAPI52 Hardware abstraction layer for the NFC Type 4 Tag library.
- *
- * @note Before the NFCT peripheral enters ACTIVATED state, the HFXO must be running.
- * To fulfill this requirement and allow other software modules to also request the HFXO, the NFC Type 4 Tag HAL uses @ref nrf_drv_clock module.
- *
- */
-
-#include
-#include
-#include
-
-
-/** @brief Events passed to the upper-layer callback function. */
-typedef enum {
- HAL_NFC_EVENT_FIELD_ON, ///< Field is detected.
- HAL_NFC_EVENT_FIELD_OFF, ///< Field is lost.
- HAL_NFC_EVENT_DATA_RECEIVED, ///< Data is received.
- HAL_NFC_EVENT_DATA_TRANSMITTED ///< Data is transmitted.
-} hal_nfc_event_t;
-
-
-/** @brief Parameter IDs for the set/get function. */
-typedef enum {
- HAL_NFC_PARAM_ID_TESTING, ///< Used for unit tests.
- HAL_NFC_PARAM_FWI, ///< Frame Wait Time parameter.
- HAL_NFC_PARAM_SELRES, ///< Parameter for setting the 'Protocol' bits for SEL_RES packet.
- HAL_NFC_PARAM_ID_UNKNOWN
-} hal_nfc_param_id_t;
-
-
-/** @brief Callback from HAL_NFC layer into the upper layer.
- *
- * If event == HAL_NFC_EVENT_DATA_RECEIVED:
- * p_data points to the received packet. The memory belongs to the HAL_NFC layer and
- * is guaranteed to be valid only until the callback returns.
- *
- * If event == HAL_NFC_EVENT_DATA_TRANSMITTED:
- * p_data points to the transmitted packet. The memory belongs to the application.
- *
- * If event == \:
- * p_data definition is event-specific (to be defined).
- *
- * @param[in] p_context Context for callback execution.
- * @param[in] event The event that occurred.
- * @param[in] p_data Received/transmitted data or NULL.
- * @param[in] data_length Size of the received/transmitted packet.
- */
-typedef void (* hal_nfc_callback_t)(void * p_context,
- hal_nfc_event_t event,
- const uint8_t * p_data,
- size_t data_length);
-
-
-/** @brief Function for initializing the NFC layer.
- *
- * This function provides a pointer to a callback function and the callback context
- * to the NFC layer.
- *
- * @param[in] callback Pointer to the callback function.
- * @param[in] p_context Context of callback.
- *
- * @retval NRF_SUCCESS If the NFC layer was initialized successfully. If one
- * of the arguments was invalid, an error code is returned.
- */
-ret_code_t hal_nfc_setup(hal_nfc_callback_t callback, void * p_context);
-
-
-/** @brief Function for setting a HAL_NFC parameter.
- *
- * This function allows to set any parameter defined as available by HAL_NFC.
- *
- * @param[in] id ID of the parameter to set.
- * @param[in] p_data Pointer to the buffer containing the data to set.
- * @param[in] data_length Size of the buffer containing the data to set.
- *
- * @retval NRF_SUCCESS If the parameter was set successfully. If one of the arguments
- * was invalid (for example, wrong data length), an error code
- * is returned.
- */
-ret_code_t hal_nfc_parameter_set(hal_nfc_param_id_t id, void * p_data, size_t data_length);
-
-
-/** @brief Function for querying a HAL_NFC parameter value.
- *
- * The queried value will be placed into the passed data buffer. If the buffer
- * is too small, p_max_data_length will contain the required buffer size.
- *
- * @param[in] id ID of the parameter to query.
- * @param[in, out] p_data Pointer to a buffer receiving the queried data.
- * @param[in, out] p_max_data_length Size of the buffer. It receives the required size if buffer is too small.
- *
- * @retval NRF_SUCCESS If the parameter was received successfully. If one of the arguments
- * was invalid (for example, the buffer was too small), an error code
- * is returned.
- */
-ret_code_t hal_nfc_parameter_get(hal_nfc_param_id_t id, void * p_data, size_t * p_max_data_length);
-
-
-/** @brief Function for starting the NFC subsystem.
- *
- * After this function completes, NFC readers will be able to detect the chip.
- *
- * @retval NRF_SUCCESS If the NFC subsystem was started successfully. If the NFC
- * subsystem could not be started, an error code is returned.
- */
-ret_code_t hal_nfc_start(void);
-
-
-/** @brief Function for sending a packet to the connected NFC reader.
- *
- * The provided data buffer belongs to the caller and is guaranteed to be
- * valid until the HAL_NFC_EVENT_DATA_TRANSMITTED event is received by the
- * callback.
- *
- * @param[in] p_data The data packet to send.
- * @param[in] data_length Size of the packet in bytes.
- *
- * @retval NRF_SUCCESS If the packet was sent. Otherwise, an error code is returned.
- */
-ret_code_t hal_nfc_send(const uint8_t * p_data, size_t data_length);
-
-
-/** @brief Function for stopping the NFC subsystem.
- *
- * After this function returns, NFC readers will no longer be able to connect
- * to the chip.
- *
- * @retval NRF_SUCCESS If the NFC subsystem was stopped. Otherwise, an error code
- * is returned.
- */
-ret_code_t hal_nfc_stop(void);
-
-
-/** @brief Function for releasing resources.
- *
- * After this call returns, the callback is considered invalid and no more
- * events will be posted to it.
- *
- * @retval NRF_SUCCESS This function always succeeds.
- */
-ret_code_t hal_nfc_done(void);
-
-
-/** @} */
-#endif /* HAL_NFC_H__ */
-
diff --git a/components/nfc/experimental_t4t_lib/license.txt b/components/nfc/experimental_t4t_lib/license.txt
deleted file mode 100644
index d629f64..0000000
--- a/components/nfc/experimental_t4t_lib/license.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Copyright (c) 2016 - 2017, Telit Communications Cyprus Ltd
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form, except as embedded into a Nordic
- Semiconductor ASA integrated circuit in a product or a software update for
- such product, must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. Neither the name of Nordic Semiconductor ASA nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-4. This software, with or without modification, must only be used with a
- Nordic Semiconductor ASA integrated circuit.
-
-5. Any software provided in binary form under this license must not be reverse
- engineered, decompiled, modified and/or disassembled.
-
-THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/components/nfc/experimental_t4t_lib/nfc_fixes.h b/components/nfc/experimental_t4t_lib/nfc_fixes.h
deleted file mode 100644
index c68505c..0000000
--- a/components/nfc/experimental_t4t_lib/nfc_fixes.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_FIXES_H__
-#define NFC_FIXES_H__
-
-#include
-
-/** @file
- * @defgroup nfc_fixes NFC fixes and workarounds
- * @{
- * @ingroup nfc_t4t
- * @brief @tagAPI52 Fixes for hardware-related anomalies.
- *
- * If you are using PCA10040 (part of nRF52 Development Kit),
- * you must define the macro HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND in order to apply
- * workarounds for the following anomalies:
- * - 79. NFCT: A false EVENTS_FIELDDETECTED event occurs after the field is lost.
- * - 116. NFCT does not release HFCLK when switching from ACTIVATED to SENSE mode.
- *
- * If you are using PCA10056 (part of nRF52840 Development Kit),
- * you must define the macro HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND in order to apply
- * workarounds for the following anomalies:
- * - 98. NFCT: The NFCT is not able to communicate with the peer.
- * - 116. NFCT does not release HFCLK when switching from ACTIVATED to SENSE mode.
- *
- * The current code contains a patch for anomaly 25 (NFCT: Reset value of
- * SENSRES register is incorrect), so that it now works on Windows Phone.
- */
-
-#ifdef BOARD_PCA10040 // assume nRF52832 chip in IC rev. Engineering B or Engineering C
- #define HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-#elif defined(BOARD_PCA10056) // assume nRF52840 chip in IC rev. Engineering A
- #define HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-#endif
-
-/** @} */
-#endif /* NFC_FIXES_H__ */
-
diff --git a/components/nfc/experimental_t4t_lib/nfc_t4t_lib.h b/components/nfc/experimental_t4t_lib/nfc_t4t_lib.h
deleted file mode 100644
index ef1cc2f..0000000
--- a/components/nfc/experimental_t4t_lib/nfc_t4t_lib.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Telit Communications Cyprus Ltd
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T4T_LIB_H__
-#define NFC_T4T_LIB_H__
-
-/** @file
- *
- * @addtogroup nfc_api
- *
- * @defgroup nfc_t4t NFC Type 4 Tag
- * @ingroup nfc_api
- * @brief Implementation of NFC Type 4 Tag.
- *
- * @defgroup nfc_t4t_lib NFC tag 4 type emulation library
- * @{
- * @ingroup nfc_t4t
- * @brief The T4T emulation library interface
- *
- * This is the NFC Forum NDEF tag 4 type emulation library. It implements the ISO14443-4A protocol
- * (ISO-DEP) and additionally can emulate a read-writable NDEF content. If the emulation of the NDEF
- * content is not needed, the library works in a raw mode where all APDUs are delivered to the user,
- * who is then responsible to generate a timely RPDU as a response.
- *
- * The sequence of initializing functions determines whether the NDEF emulation will run or whether
- * the raw mode is used.
- *
- * - E.g. NDEF emulation
- * * @ref nfc_t4t_setup
- * * @ref nfc_t4t_ndef_rwpayload_set or @ref nfc_t4t_ndef_staticpayload_set
- * * @ref nfc_t4t_emulation_start
- * * ... running in NDEF emulation mode ...
- * - E.g. RAW mode
- * * @ref nfc_t4t_setup
- * * @ref nfc_t4t_emulation_start
- * * ... running in RAW emulation mode ...
- */
-
-#include
-#include
-#include
-#include "sdk_errors.h"
-
-#define NFC_T4T_MAX_PAYLOAD_SIZE 0xFFF0U
-
-/**< @brief Emulation mode. */
-typedef enum
-{
- NFC_T4T_EMUMODE_NDEF, ///< Emulated NDEF AID and EF-Files.
- NFC_T4T_EMUMODE_PICC ///< Run just ISO-DEP, deliver I-Frames up.
-} nfc_t4t_emu_mode_t;
-
-
-/**< @brief Event identifiers used by the @ref nfc_t4t_callback_t */
-typedef enum
-{
- NFC_T4T_EVENT_NONE,
- ///< This ID is never used. Dummy value for completeness.
-
- NFC_T4T_EVENT_FIELD_ON,
- ///< External Reader polling detected.
-
- NFC_T4T_EVENT_FIELD_OFF,
- ///< External Reader polling ended.
-
- NFC_T4T_EVENT_NDEF_READ,
- ///< External Reader has read static NDEF-Data from Emulation.
- /**<
- * A Read operation happened on last byte of NDEF-Data.
- */
-
- NFC_T4T_EVENT_NDEF_UPDATED,
- ///< External Reader has written to length information of NDEF-Data from Emulation.
- /**<
- * The usual behavior of a Reader-Writer that accesses NDEF information for update is to set
- * the length to zero at the beginning of the update process. It then writes the content
- * of NDEF-Data. When all content is written it will update the length information inside
- * the NDEF file. This event will be generated every time an update to the length is happening.
- * This length information is residing in the first 2 bytes of the NDEF-Content container and is called 'NLEN'.
- * Since this callback is triggered on any access to these bytes the returned data_length
- * information might not be consistent (e.g. in case of only a single byte write to the length).
- *
- * @param[out] data_length Current value of NDEF content length
- * information i.e. 'NLEN' field.
- */
-
- NFC_T4T_EVENT_DATA_TRANSMITTED,
- ///< In Raw mode it signals that the data from @ref nfc_t4t_response_pdu_send have been sent out.
-
- NFC_T4T_EVENT_DATA_IND,
- ///< In Raw mode delivers the APDU fragments
- /**<
- * All @ref NFC_T4T_EVENT_DATA_IND events that have the @ref NFC_T4T_DI_FLAG_MORE flag set
- * belong to the same APDU. The first @ref NFC_T4T_EVENT_DATA_IND without @ref NFC_T4T_DI_FLAG_MORE
- * flag signals the completeness of the APDU. The Application then has to reply with a call
- * to @ref nfc_t4t_response_pdu_send. The library will handle internally the fragmentation of
- * the response towards the Reader-Writer. The data of the response PDU must be kept
- * valid until the next callback from the library happens (e.g. next @ref NFC_T4T_EVENT_DATA_IND
- * or @ref NFC_T4T_EVENT_FIELD_OFF).
- *
- * @param[out] p_data Pointer to the fragment of APDU.
- * @param[out] data_length Length of data.
- * @param[out] flags @ref nfc_t4t_data_ind_flags_t.
- */
-} nfc_t4t_event_t;
-
-/**< @brief Flags coming with nfc_t4t_callback_t at @ref NFC_T4T_EVENT_DATA_IND event.*/
-typedef enum
-{
- NFC_T4T_DI_FLAG_NONE = 0x00, ///< Dummy value.
- NFC_T4T_DI_FLAG_MORE = 0x01 ///< This signals that more data is expected to be received.
-} nfc_t4t_data_ind_flags_t;
-
-/**< @brief Parameter IDs that can be set/get with @ref nfc_t4t_parameter_set or
- * @ref nfc_t4t_parameter_get.
- */
-typedef enum
-{
- NFC_T4T_PARAM_TESTING, ///< Internal usage only for Unit-Testing.
- NFC_T4T_PARAM_FWI, ///< Frame Wait Time parameter
- NFC_T4T_PARAM_SELRES ///< Parameter for setting 'Protocol' bits for SEL_RES packet
-} nfc_t4t_param_id_t;
-
-/** @brief Callback to pass events from NFCLib to application.
- *
- * @param[out] p_context Application context for callback execution.
- * @param[out] event The event that occurred. see @ref nfc_t4t_event_t.
- * @param[out] p_data Data to send to the application (event specific).
- * @param[out] data_length Length of the data. In case of @ref NFC_T4T_EVENT_NDEF_UPDATED, this parameter
- * contains the value of the 'NLEN' field of the NDEF File;
- * if the value is non-zero, it corresponds to the new size of the NDEF Message in the updated NDEF File.
- * @param[out] flags Some events deliver flags. see @ref nfc_t4t_event_t for details.
- */
-typedef void (*nfc_t4t_callback_t)(void * p_context,
- nfc_t4t_event_t event,
- const uint8_t * p_data,
- size_t data_length,
- uint32_t flags);
-
-/** @brief Register the application callback for event signaling.
- *
- * The callback will be called by NFCLib to notify the application of relevant events. It will be
- * called from the HAL_NFC callback context. The library support 3 different Modes of Emulation:
- * - Raw ISO-Dep exchanges. All PDUs are signaled through the callback.
- * - Read-Only T4T NDEF-Tag. A static buffer is served. Only Field-Status callbacks.
- * - Read-Write T4T NDEF-Tag. A mutable buffer is used. Only Field-Status callbacks.
- *
- * The default mode is Raw ISO-Dep mode. The two other NDEF T4T modes are activated through
- * the corresponding @ref nfc_t4t_ndef_rwpayload_set/ @ref nfc_t4t_ndef_staticpayload_set functions.
- * The mode is locked in with a call to @ref nfc_t4t_emulation_start.
- *
- * @param[in] callback Function pointer to the callback.
- * @param[in] p_context Pointer to a memory area used by the callback for execution (optional).
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_INVALID_STATE If emulation is in running state.
- */
-ret_code_t nfc_t4t_setup(nfc_t4t_callback_t callback, void * p_context);
-
-/** @brief Set emulation buffer and content for a NDEF Tag emulation that is Read/Writable.
- *
- * The buffer needs to be kept accessible for the lifetime of the emulation.
- * If an external Reader-Writer changes the NDEF content it is signaled through the app-callback.
- *
- * @param[in] p_emulation_buffer Buffer pointer
- * @param[in] buffer_length Length of buffer (maximum writable NDEF size)
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_DATA_SIZE Invalid argument (e.g. wrong data length).
- * @retval NRF_ERROR_INVALID_PARAM Invalid argument (e.g. NULL pointer).
- * @retval NRF_ERROR_INVALID_STATE If emulation is in running state.
- */
-ret_code_t nfc_t4t_ndef_rwpayload_set(uint8_t * p_emulation_buffer, size_t buffer_length);
-
-/** @brief Set emulationBuffer and Content for a NDEF Tag emulation that is Read-Only.
- *
- * The buffer needs to be kept accessible for the lifetime of the emulation.
- * Since no write access is done to the buffer, the content could reside in flash memory.
- *
- * @param[in] p_emulation_buffer Const buffer pointer
- * @param[in] buffer_length Length of contained NDEF payload message
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_DATA_SIZE Invalid argument (e.g. wrong data length).
- * @retval NRF_ERROR_INVALID_PARAM Invalid argument (e.g. NULL pointer).
- * @retval NRF_ERROR_INVALID_STATE Emulation is in running stated.
- */
-ret_code_t nfc_t4t_ndef_staticpayload_set(const uint8_t * p_emulation_buffer, size_t buffer_length);
-
-/** @brief Send a raw response PDU after getting a Request PDU callback.
- *
- * When the library works in raw ISO-DEP mode it will signal request PDUs through the callback.
- * The application then has to answer with a response PDU. It will use this function to send back
- * the response PDU. This function can not be used in T4T NDEF (RW / STATIC) emulation modes.
- *
- * The lower ISODEP layer will handle the defragmentation of a long response PDU into smaller
- * pieces that the PCD can understand.
- *
- * @param[in] p_pdu Const PDU pointer.
- * @param[in] pdu_length Length of PDU.
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_DATA_SIZE Invalid argument (e.g. wrong data length).
- * @retval NRF_ERROR_INVALID_PARAM Invalid argument (e.g. NULL pointer).
- * @retval NRF_ERROR_INVALID_STATE Emulation is in running state.
- */
-ret_code_t nfc_t4t_response_pdu_send(const uint8_t * p_pdu, size_t pdu_length);
-
-/** @brief Set an NFC parameter.
- *
- * Allows to set any parameter defined as available by HAL_NFC.
- *
- * @param[in] id ID of the parameter to set.
- * @param[in] p_data Pointer to a buffer containing the data to set.
- * @param[in] data_length Size of the buffer containing the data to set.
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_DATA_SIZE Invalid argument (e.g. wrong data length).
- * @retval NRF_ERROR_INVALID_PARAM Invalid argument (e.g. NULL pointer).
- */
-ret_code_t nfc_t4t_parameter_set(nfc_t4t_param_id_t id, void * p_data, size_t data_length);
-
-/** @brief Query an NFC parameter value.
- *
- * The queried value will be placed into the passed data buffer.
- * If the buffer is too small, p_max_data_length will contain the required buffer size.
- * If the buffer is big enough, p_max_data_length will contain the actual size of the data.
- *
- * @param[in] id ID of the parameter to query.
- * @param[out] p_data Pointer to a buffer receiving the queried data.
- * @param[out] p_max_data_length Size of the buffer, receives actual size of queried data.
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_DATA_SIZE Invalid argument (e.g. wrong data length).
- * @retval NRF_ERROR_INVALID_PARAM Invalid argument (e.g. NULL pointer).
- */
-ret_code_t nfc_t4t_parameter_get(nfc_t4t_param_id_t id, void * p_data, size_t * p_max_data_length);
-
-/** @brief Activate the NFC frontend.
- *
- * Only after calling this function, events will be posted to the application callback.
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_INVALID_STATE Already started.
- */
-ret_code_t nfc_t4t_emulation_start(void);
-
-/**
- * @brief Deactivate the NFC frontend.
- *
- * After calling this function, no more events will be posted to the application callback.
- *
- * @retval NRF_SUCCESS Success.
- * @retval NRF_ERROR_INVALID_STATE Emulation was already stopped
- */
-ret_code_t nfc_t4t_emulation_stop(void);
-
-/**
- * @brief Release reference to application callback.
- *
- * After calling this function, the passed callback pointer is no longer considered valid.
- * After calling this function, the passed p_ndef pointer is no longer considered valid.
- *
- * You need to restart with @ref nfc_t4t_setup to run a new Emulation.
- *
- * @retval NRF_SUCCESS Always succeeds.
- */
-ret_code_t nfc_t4t_done(void);
-
-/**
- @}
-*/
-
-#endif // NFC_T4T_LIB_H__
diff --git a/components/nfc/experimental_t4t_lib/nfc_t4t_lib_gcc.a b/components/nfc/experimental_t4t_lib/nfc_t4t_lib_gcc.a
deleted file mode 100644
index efbf12b..0000000
Binary files a/components/nfc/experimental_t4t_lib/nfc_t4t_lib_gcc.a and /dev/null differ
diff --git a/components/nfc/experimental_t4t_lib/nfc_t4t_lib_iar.a b/components/nfc/experimental_t4t_lib/nfc_t4t_lib_iar.a
deleted file mode 100644
index b6eb9c1..0000000
Binary files a/components/nfc/experimental_t4t_lib/nfc_t4t_lib_iar.a and /dev/null differ
diff --git a/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.c b/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.c
deleted file mode 100644
index bd39e27..0000000
--- a/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_ac_rec.h"
-#include
-#include "nrf_error.h"
-#include "nrf.h"
-
-#define AC_REC_CPS_BYTE_SIZE 1 ///< Size of the field with CPS data.
-#define AC_REC_DATA_REF_LEN_SIZE 1 ///< Size of the Data Reference Length field.
-#define AC_REC_AUX_DATA_REF_COUNT_SIZE 1 ///< Size of the Data Reference Length field.
-
-const uint8_t nfc_ac_rec_type_field[2] = {'a', 'c'}; ///< Alternative Carrier Record type.
-
-/**
- * @brief Function for calculating the payload length of the NFC NDEF Alternative Carrier record.
- */
-static uint32_t nfc_ac_rec_payload_size_get(nfc_ac_rec_payload_desc_t const * p_ac_rec_payload_desc)
-{
- int32_t i = 0;
- // Initialize with size of byte with CPS.
- uint32_t payload_size = AC_REC_CPS_BYTE_SIZE;
-
- // Add Carrier Data Reference size.
- payload_size += p_ac_rec_payload_desc->carrier_data_ref.length + AC_REC_DATA_REF_LEN_SIZE;
-
- // Add Auxiliary Data Reference Count size.
- payload_size += AC_REC_AUX_DATA_REF_COUNT_SIZE;
-
- for (i = 0; i < p_ac_rec_payload_desc->aux_data_ref_count; i++)
- {
- // Add Auxiliary Data Reference size.
- payload_size += p_ac_rec_payload_desc->p_aux_data_ref[i].length + AC_REC_DATA_REF_LEN_SIZE;
- }
-
- return payload_size;
-}
-
-
-ret_code_t nfc_ac_rec_payload_constructor(nfc_ac_rec_payload_desc_t * p_nfc_rec_ac_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- int32_t i = 0;
- uint32_t payload_size = nfc_ac_rec_payload_size_get(p_nfc_rec_ac_payload_desc);
-
- if (p_buff != NULL)
- {
- // Not enough space in the buffer, return an error.
- if (payload_size > *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- // Invalid CPS value.
- if ( p_nfc_rec_ac_payload_desc->cps & ~NFC_AC_CPS_MASK )
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- // Copy CPS.
- *p_buff = p_nfc_rec_ac_payload_desc->cps;
- p_buff += AC_REC_CPS_BYTE_SIZE;
-
- // Copy Carrier Data Reference.
- *p_buff = p_nfc_rec_ac_payload_desc->carrier_data_ref.length;
- p_buff += AC_REC_DATA_REF_LEN_SIZE;
-
- memcpy( p_buff,
- p_nfc_rec_ac_payload_desc->carrier_data_ref.p_data,
- p_nfc_rec_ac_payload_desc->carrier_data_ref.length );
- p_buff += p_nfc_rec_ac_payload_desc->carrier_data_ref.length;
-
- // Copy Auxiliary Data Reference.
- *p_buff = p_nfc_rec_ac_payload_desc->aux_data_ref_count;
- p_buff += AC_REC_AUX_DATA_REF_COUNT_SIZE;
-
- for (i = 0; i < p_nfc_rec_ac_payload_desc->aux_data_ref_count; i++)
- {
- *p_buff = p_nfc_rec_ac_payload_desc->p_aux_data_ref[i].length;
- p_buff += AC_REC_DATA_REF_LEN_SIZE;
-
- memcpy( p_buff,
- p_nfc_rec_ac_payload_desc->p_aux_data_ref[i].p_data,
- p_nfc_rec_ac_payload_desc->p_aux_data_ref[i].length );
- p_buff += p_nfc_rec_ac_payload_desc->p_aux_data_ref[i].length;
- }
- }
-
- // Assign payload size to the return buffer.
- *p_len = payload_size;
-
- return NRF_SUCCESS;
-}
-
-
-void nfc_ac_rec_auxiliary_data_ref_clear(nfc_ndef_record_desc_t * p_ac_rec)
-{
- nfc_ac_rec_payload_desc_t * p_ac_rec_payload =
- (nfc_ac_rec_payload_desc_t*)p_ac_rec->p_payload_descriptor;
-
- p_ac_rec_payload->aux_data_ref_count = 0;
-}
-
-
-ret_code_t nfc_ac_rec_auxiliary_data_ref_add(nfc_ndef_record_desc_t * p_ac_rec,
- uint8_t * p_aux_data,
- uint8_t aux_length)
-{
- nfc_ac_rec_payload_desc_t * p_ac_rec_payload =
- (nfc_ac_rec_payload_desc_t *)p_ac_rec->p_payload_descriptor;
-
- if (p_ac_rec_payload->aux_data_ref_count >= p_ac_rec_payload->max_aux_data_ref)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- p_ac_rec_payload->p_aux_data_ref[p_ac_rec_payload->aux_data_ref_count].p_data = p_aux_data;
- p_ac_rec_payload->p_aux_data_ref[p_ac_rec_payload->aux_data_ref_count].length = aux_length;
- p_ac_rec_payload->aux_data_ref_count++;
-
- return NRF_SUCCESS;
-}
diff --git a/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.h b/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.h
deleted file mode 100644
index 03a2061..0000000
--- a/components/nfc/ndef/connection_handover/ac_rec/nfc_ac_rec.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_AC_REC_H__
-#define NFC_AC_REC_H__
-
-/**@file
- *
- * @defgroup nfc_ac_rec ac (Alternative carrier) records
- * @{
- * @ingroup nfc_ble_pair_msg
- *
- * @brief Generation of NFC NDEF Alternative Carrier records for NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define AC_REC_CPS_BYTE_SIZE 1 ///< Size of the field with CPS data.
-#define AC_REC_DATA_REF_LEN_SIZE 1 ///< Size of the Data Reference Length field.
-#define AC_REC_AUX_DATA_REF_COUNT_SIZE 1 ///< Size of the Data Reference Length field.
-
-/**
- * @brief Carrier Power State.
- *
- * Possible Carrier Power State field values in an Alternative Carrier record.
- */
-typedef enum
-{
- NFC_AC_CPS_INACTIVE = 0x00, ///< Alternative Carrier inactive.
- NFC_AC_CPS_ACTIVE = 0x01, ///< Alternative Carrier active.
- NFC_AC_CPS_ACTIVATING = 0x02, ///< Alternative Carrier activating.
- NFC_AC_CPS_UNKNOWN = 0x03 ///< Alternative Carrier power status unknown.
-} nfc_ac_rec_cps_t;
-
-#define NFC_AC_CPS_MASK (NFC_AC_CPS_UNKNOWN) ///< Mask of Carrier Power State bits in a first ac record byte.
-
-/**
- * @brief Carrier Data Reference and Auxiliary Data Reference descriptor.
- */
-typedef struct
-{
- uint8_t length; ///< Length of the data field.
- uint8_t * p_data; ///< Pointer to the Data Reference characters. Not relevant if length is 0.
-} nfc_ac_rec_data_ref_t;
-
-/**
- * @brief Alternative Carrier record payload descriptor.
- */
-typedef struct
-{
- nfc_ac_rec_cps_t cps; ///< Carrier Power State value.
- nfc_ac_rec_data_ref_t carrier_data_ref; ///< Carrier Data Reference.
- uint8_t const max_aux_data_ref; ///< Maximum number of Auxiliary Data Reference fields.
- uint8_t aux_data_ref_count; ///< Number of Auxiliary Data Reference fields.
- nfc_ac_rec_data_ref_t * p_aux_data_ref; ///< Pointer to the Auxiliary Data Reference fields.
-} nfc_ac_rec_payload_desc_t;
-
-
-/**
- * @brief Constructor for an NFC NDEF Alternative Carrier record payload.
- *
- * This function encodes the payload of an Alternative Carrier record as specified in the Connection
- * Handover standard. It implements an API compatible with @ref p_payload_constructor_t.
- */
-ret_code_t nfc_ac_rec_payload_constructor(nfc_ac_rec_payload_desc_t * p_nfc_rec_ac_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len);
-
-/**
- * @brief External reference to the type field of the Alternative Carrier record, defined in the
- * file @c nfc_ac_rec.c. It is used in the @ref NFC_NDEF_AC_RECORD_DESC_DEF macro.
- */
-extern const uint8_t nfc_ac_rec_type_field[2];
-
-/**
- * @brief Size of the type field of the Alternative Carrier record, defined in the
- * file @c nfc_ac_rec.c. It is used in the @ref NFC_NDEF_AC_RECORD_DESC_DEF macro.
- */
-#define NFC_AC_REC_TYPE_LENGTH 2
-
-/**
- *@brief Macro for creating and initializing an NFC NDEF record descriptor for an Alternative Carrier record.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_record_desc_t and
- * a static instance of type @ref nfc_ac_rec_payload_desc_t, which together constitute an instance of an Alternative Carrier record.
- *
- * Use the macro @ref NFC_NDEF_AC_RECORD_DESC to access the NDEF Alternative Carrier record descriptor instance.
- *
- * @param[in] NAME Name of the created record descriptor instance.
- * @param[in] CPS Carrier Power State value.
- * @param[in] CARR_DATA_REF_LEN Length of the Carrier Data Reference field.
- * @param[in] P_CARR_DATA_REF Pointer to the Carrier Data Reference field.
- * @param[in] MAX_AUX_DATA_REF Maximum number of Auxiliary Data Reference fields.
- */
-#define NFC_NDEF_AC_RECORD_DESC_DEF(NAME, \
- CPS, \
- CARR_DATA_REF_LEN, \
- P_CARR_DATA_REF, \
- MAX_AUX_DATA_REF) \
- static nfc_ac_rec_data_ref_t NAME##_nfc_ac_rec_aux_data_ref_array[MAX_AUX_DATA_REF]; \
- static nfc_ac_rec_payload_desc_t NAME##_nfc_ac_rec_payload_desc = \
- { \
- .cps = CPS, \
- .carrier_data_ref = {CARR_DATA_REF_LEN, P_CARR_DATA_REF}, \
- .max_aux_data_ref = MAX_AUX_DATA_REF, \
- .aux_data_ref_count = 0, \
- .p_aux_data_ref = NAME##_nfc_ac_rec_aux_data_ref_array \
- }; \
- NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
- TNF_WELL_KNOWN, \
- 0, \
- 0, \
- nfc_ac_rec_type_field, \
- NFC_AC_REC_TYPE_LENGTH, \
- nfc_ac_rec_payload_constructor, \
- &(NAME##_nfc_ac_rec_payload_desc))
-
-/**
- * @brief Macro for accessing the NFC NDEF Alternative Carrier record descriptor
- * instance that was created with @ref NFC_NDEF_AC_RECORD_DESC_DEF.
- */
-#define NFC_NDEF_AC_RECORD_DESC(NAME) NFC_NDEF_GENERIC_RECORD_DESC(NAME)
-
-/**
- * @brief Function for clearing an Auxiliary Data Reference in an NFC NDEF Alternative Carrier record.
- *
- * This function clears the Auxiliary Data References from the Alternative Carrier record.
- *
- * @param[in, out] p_ac_rec Pointer to the Alternative Carrier record descriptor.
- */
-void nfc_ac_rec_auxiliary_data_ref_clear(nfc_ndef_record_desc_t * p_ac_rec);
-
-/**
- * @brief Function for adding an Auxiliary Data Reference to an NFC NDEF Alternative Carrier record.
- *
- * @param[in, out] p_ac_rec Pointer to an ac record.
- * @param[in] p_aux_data Pointer to the Auxiliary Data Reference data buffer.
- * @param[in] aux_length Length of the Auxiliary Data Reference data.
- *
- * @retval NRF_SUCCESS If the Auxiliary Data Reference was added successfully.
- * @retval NRF_ERROR_NO_MEM If the record already contains the maximum number of Auxiliary Data References.
- */
-ret_code_t nfc_ac_rec_auxiliary_data_ref_add(nfc_ndef_record_desc_t * p_ac_rec,
- uint8_t * p_aux_data,
- uint8_t aux_length);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_AC_REC_H__
diff --git a/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.c b/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.c
deleted file mode 100644
index e7cb102..0000000
--- a/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.c
+++ /dev/null
@@ -1,393 +0,0 @@
-/**
- * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_ble_oob_advdata.h"
-#include "sdk_common.h"
-#include "nfc_ble_pair_msg.h"
-
-// LESC OOB data AD_TYPE values.
-#define BLE_GAP_AD_TYPE_LESC_CONFIRM_VALUE 0x22
-#define BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE 0x23
-
-/**
- * @brief Macro for verifying basic parameters used for encoding single BLE AD Type.
- *
- * It verifies if provided buffer is NULL and if there is enough space for the encoded data.
- * In case of NULL pointer buffer, necessary space for current AD Type is calculated.
- *
- * @param[in] P_ENCODED_DATA Buffer for the encoded data.
- * @param[in] P_OFFSET Pointer to index of the first free cell in the buffer.
- * @param[in] AD_TYPE_SIZE Size of the single AD Type.
- * @param[in] MAX_SIZE Maximal size of the provided buffer.
- */
-#define NFC_BLE_OOB_ADVDATA_INPUT_VERIFY( P_ENCODED_DATA, P_OFFSET, AD_TYPE_SIZE, MAX_SIZE) \
- if ( (P_ENCODED_DATA) == NULL ) \
- { \
- *(P_OFFSET) += (AD_TYPE_SIZE); \
- return NRF_SUCCESS; \
- } \
- if ( *(P_OFFSET) + (AD_TYPE_SIZE) > (MAX_SIZE) ) \
- { \
- return NRF_ERROR_DATA_SIZE; \
- }
-
-/**@brief Function for encoding data of Security Manager OOB Flags AD Type.
- *
- * @param[in] oob_flags Security Manager OOB Flags AD Type payload.
- * @param[out] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in,out] p_offset \c in: Offset of \p p_encoded_data buffer before this AD type encoding.
- * \c out: Offset of \p p_encoded_data buffer after this AD type encoding.
- * @param[in] max_size Size of \p p_encoded_data buffer.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_DATA_SIZE If the provided buffer size is too small.
- */
-static ret_code_t sec_mgr_oob_flags_encode(uint8_t oob_flags,
- uint8_t * p_encoded_data,
- uint16_t * p_offset,
- uint16_t max_size)
-{
- NFC_BLE_OOB_ADVDATA_INPUT_VERIFY(p_encoded_data, p_offset, AD_TYPE_OOB_FLAGS_SIZE, max_size);
-
- // Encode flags.
- p_encoded_data[*p_offset] = (uint8_t)(ADV_AD_TYPE_FIELD_SIZE + AD_TYPE_OOB_FLAGS_DATA_SIZE);
- *p_offset += ADV_LENGTH_FIELD_SIZE;
- p_encoded_data[*p_offset] = BLE_GAP_AD_TYPE_SECURITY_MANAGER_OOB_FLAGS;
- *p_offset += ADV_AD_TYPE_FIELD_SIZE;
- p_encoded_data[*p_offset] = oob_flags;
- *p_offset += AD_TYPE_OOB_FLAGS_DATA_SIZE;
-
- return NRF_SUCCESS;
-}
-
-/**@brief Function for encoding data of Security Manager TK Value AD Type.
- *
- * @param[in] p_tk_value Security Manager TK Value AD Type payload.
- * @param[out] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in,out] p_offset \c in: Offset of \p p_encoded_data buffer before this AD type encoding.
- * \c out: Offset of \p p_encoded_data buffer after this AD type encoding.
- * @param[in] max_size Size of \p p_encoded_data buffer.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_DATA_SIZE If the provided buffer size is too small.
- */
-static ret_code_t tk_value_encode(ble_advdata_tk_value_t * p_tk_value,
- uint8_t * p_encoded_data,
- uint16_t * p_offset,
- uint16_t max_size)
-{
- ret_code_t err_code;
-
- NFC_BLE_OOB_ADVDATA_INPUT_VERIFY(p_encoded_data, p_offset, AD_TYPE_TK_VALUE_SIZE, max_size);
-
- // Encode TK Value.
- p_encoded_data[*p_offset] = (uint8_t)(ADV_AD_TYPE_FIELD_SIZE + AD_TYPE_TK_VALUE_DATA_SIZE);
- *p_offset += ADV_LENGTH_FIELD_SIZE;
- p_encoded_data[*p_offset] = BLE_GAP_AD_TYPE_SECURITY_MANAGER_TK_VALUE;
- *p_offset += ADV_AD_TYPE_FIELD_SIZE;
-
- // Remember location of TK in the buffer if this feature was enabled.
- err_code = nfc_tk_to_group_add(&p_encoded_data[*p_offset]);
- VERIFY_SUCCESS(err_code);
-
- nfc_tk_value_payload_encode(p_tk_value, &p_encoded_data[*p_offset]);
- (*p_offset) += AD_TYPE_TK_VALUE_DATA_SIZE;
-
- return NRF_SUCCESS;
-}
-
-/**@brief Function for encoding LESC OOB data in the CH NDEF message.
- *
- * @param[in] p_lesc_value Pointer to the LESC OOB values to be encoded.
- * @param[out] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in,out] p_offset \c in: Offset of \p p_encoded_data buffer before this AD type encoding.
- * \c out: Offset of \p p_encoded_data buffer after this AD type encoding.
- * @param[in] max_size Size of \p p_encoded_data buffer.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_DATA_SIZE If the provided buffer size is too small.
- */
-static ret_code_t lesc_value_encode(ble_gap_lesc_oob_data_t * p_lesc_value,
- uint8_t * p_encoded_data,
- uint16_t * p_offset,
- uint16_t max_size)
-{
- ret_code_t err_code;
-
- NFC_BLE_OOB_ADVDATA_INPUT_VERIFY(p_encoded_data, p_offset, AD_TYPE_LESC_SIZE, max_size);
-
- // Encode LESC Confirm Value.
- p_encoded_data[*p_offset] = (uint8_t)(ADV_AD_TYPE_FIELD_SIZE + AD_TYPE_CONFIRM_VALUE_DATA_SIZE);
- *p_offset += ADV_LENGTH_FIELD_SIZE;
- p_encoded_data[*p_offset] = BLE_GAP_AD_TYPE_LESC_CONFIRM_VALUE;
- *p_offset += ADV_AD_TYPE_FIELD_SIZE;
-
- memcpy(&p_encoded_data[*p_offset], p_lesc_value->c, sizeof(p_lesc_value->c));
-
- uint8_t *p_confirm = &p_encoded_data[*p_offset];
-
- (*p_offset) += AD_TYPE_CONFIRM_VALUE_DATA_SIZE;
-
- // Encode LESC Random Value.
- p_encoded_data[*p_offset] = (uint8_t)(ADV_AD_TYPE_FIELD_SIZE + AD_TYPE_RANDOM_VALUE_DATA_SIZE);
- *p_offset += ADV_LENGTH_FIELD_SIZE;
- p_encoded_data[*p_offset] = BLE_GAP_AD_TYPE_LESC_RANDOM_VALUE;
- *p_offset += ADV_AD_TYPE_FIELD_SIZE;
-
- memcpy(&p_encoded_data[*p_offset], p_lesc_value->r, sizeof(p_lesc_value->r));
-
- uint8_t *p_random = &p_encoded_data[*p_offset];
-
- (*p_offset) += AD_TYPE_RANDOM_VALUE_DATA_SIZE;
-
- // Remember location of LESC OOB data in the buffer in case of key changes.
- err_code = nfc_lesc_pos_set(p_confirm, p_random);
-
- return err_code;
-}
-
-/**@brief Function for encoding data of LE Role AD Type.
- *
- * @param[in] le_role LE Role AD Type payload.
- * @param[out] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in,out] p_offset \c in: Offset of \p p_encoded_data buffer before this AD type encoding.
- * \c out: Offset of \p p_encoded_data buffer after this AD type encoding.
- * @param[in] max_size Size of \p p_encoded_data buffer.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_DATA_SIZE If the provided buffer size is too small.
- * @retval NRF_ERROR_INVALID_PARAM If \p le_role parameter has invalid value.
- */
-static ret_code_t le_role_encode(ble_advdata_le_role_t le_role,
- uint8_t * p_encoded_data,
- uint16_t * p_offset,
- uint16_t max_size)
-{
- NFC_BLE_OOB_ADVDATA_INPUT_VERIFY(p_encoded_data, p_offset, AD_TYPE_LE_ROLE_SIZE, max_size);
-
- // Encode LE Role.
- p_encoded_data[*p_offset] = (uint8_t)(ADV_AD_TYPE_FIELD_SIZE + AD_TYPE_LE_ROLE_DATA_SIZE);
- *p_offset += ADV_LENGTH_FIELD_SIZE;
- p_encoded_data[*p_offset] = BLE_GAP_AD_TYPE_LE_ROLE;
- *p_offset += ADV_AD_TYPE_FIELD_SIZE;
- switch (le_role)
- {
- case BLE_ADVDATA_ROLE_ONLY_PERIPH:
- p_encoded_data[*p_offset] = NFC_BLE_ADVDATA_ROLE_ENCODED_ONLY_PERIPH;
- break;
- case BLE_ADVDATA_ROLE_ONLY_CENTRAL:
- p_encoded_data[*p_offset] = NFC_BLE_ADVDATA_ROLE_ENCODED_ONLY_CENTRAL;
- break;
- case BLE_ADVDATA_ROLE_BOTH_PERIPH_PREFERRED:
- p_encoded_data[*p_offset] = NFC_BLE_ADVDATA_ROLE_ENCODED_BOTH_PERIPH_PREFERRED;
- break;
- case BLE_ADVDATA_ROLE_BOTH_CENTRAL_PREFERRED:
- p_encoded_data[*p_offset] = NFC_BLE_ADVDATA_ROLE_ENCODED_BOTH_CENTRAL_PREFERRED;
- break;
- default:
- return NRF_ERROR_INVALID_PARAM;
- }
- *p_offset += AD_TYPE_LE_ROLE_DATA_SIZE;
-
- return NRF_SUCCESS;
-}
-
-/**@brief Function for calculating the size of Local Name AD Type.
- *
- * @param[in] p_advdata Pointer to the structure for specifying the content of encoded data.
- * @param[out] p_len Size of the buffer that is necessary to encode Local Name AD Type.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval Other Other error codes might be returned depending on
- * @ref sd_ble_gap_device_name_get function.
- */
-__STATIC_INLINE ret_code_t nfc_ble_oob_name_size_calc(ble_advdata_t const * const p_advdata,
- uint16_t * const p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
- uint16_t device_len;
-
- if (p_advdata->name_type == BLE_ADVDATA_SHORT_NAME)
- {
- device_len = p_advdata->short_name_len;
- }
- else
- {
- err_code = sd_ble_gap_device_name_get(NULL, &device_len);
- }
-
- *p_len += ADV_LENGTH_FIELD_SIZE + ADV_AD_TYPE_FIELD_SIZE + device_len;
- return err_code;
-}
-
-/**@brief Function for calculating the size of AD Types which are encoded by @ref adv_data_encode function.
- *
- * @param[in] p_advdata Pointer to the structure for specifying the content of encoded data.
- * @param[out] p_len Size of the buffer that is necessary to encode AD Types.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval Other Other error codes might be returned depending on
- * @ref nfc_ble_oob_name_size_calc function.
- */
-static ret_code_t nfc_ble_oob_adv_data_size_calc(ble_advdata_t const * const p_advdata,
- uint16_t * const p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
-
- if (p_advdata->include_ble_device_addr)
- {
- *p_len += AD_TYPE_BLE_DEVICE_ADDR_SIZE;
- }
- if (p_advdata->include_appearance)
- {
- *p_len += AD_TYPE_APPEARANCE_SIZE;
- }
- if (p_advdata->flags != 0)
- {
- *p_len += AD_TYPE_FLAGS_SIZE;
- }
- if (p_advdata->name_type != BLE_ADVDATA_NO_NAME)
- {
- err_code = nfc_ble_oob_name_size_calc(p_advdata, p_len);
- }
- return err_code;
-}
-
-/**@brief Function for verifying if BLE advertising data structure contains only supported AD Types
- * by this encoding module.
- *
- * @param[in] advdata Structure with BLE advertising data.
- *
- * @retval NRF_SUCCESS If the verification was successful.
- * @retval NRF_ERROR_INVALID_PARAM If there is any AD type which is not supported by this
- * module.
- */
-static ret_code_t nfc_ble_oob_adv_data_check(ble_advdata_t advdata)
-{
- advdata.p_sec_mgr_oob_flags = NULL;
- advdata.p_tk_value = NULL;
- advdata.le_role = BLE_ADVDATA_ROLE_NOT_PRESENT;
- advdata.include_ble_device_addr = false;
- advdata.include_appearance = false;
- advdata.flags = 0;
- advdata.name_type = BLE_ADVDATA_NO_NAME;
- advdata.short_name_len = 0;
- advdata.p_lesc_data = NULL;
-
- ble_advdata_t pattern_advdata;
- memset(&pattern_advdata, 0, sizeof(ble_advdata_t));
-
- if ( memcmp( &pattern_advdata, &advdata, sizeof(ble_advdata_t)) == 0 )
- {
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-}
-
-ret_code_t nfc_ble_oob_adv_data_encode(ble_advdata_t const * const p_advdata,
- uint8_t * const p_encoded_data,
- uint16_t * const p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
- uint16_t max_size = *p_len;
- uint16_t offset = 0;
-
- // Verify ADV data structure.
- err_code = nfc_ble_oob_adv_data_check(*p_advdata);
- VERIFY_SUCCESS(err_code);
-
- // Encode Security Manager OOB Flags.
- if (p_advdata->p_sec_mgr_oob_flags != NULL)
- {
- err_code = sec_mgr_oob_flags_encode(*p_advdata->p_sec_mgr_oob_flags,
- p_encoded_data,
- &offset,
- max_size);
- VERIFY_SUCCESS(err_code);
- }
-
- // Encode LESC keys
- if (p_advdata->p_lesc_data != NULL)
- {
- err_code = lesc_value_encode(p_advdata->p_lesc_data, p_encoded_data, &offset, max_size);
- VERIFY_SUCCESS(err_code);
- }
-
- // Encode Security Manager TK value.
- if (p_advdata->p_tk_value != NULL)
- {
- err_code = tk_value_encode(p_advdata->p_tk_value, p_encoded_data, &offset, max_size);
- VERIFY_SUCCESS(err_code);
- }
-
- // Encode LE Role.
- if (BLE_ADVDATA_ROLE_NOT_PRESENT != p_advdata->le_role)
- {
- err_code = le_role_encode(p_advdata->le_role, p_encoded_data, &offset, max_size);
- VERIFY_SUCCESS(err_code);
- }
-
- // Encode remaining AD Types or precalculate necessary buffer space.
- if (p_encoded_data != NULL)
- {
- uint16_t adv_data_size = max_size - offset;
- err_code = adv_data_encode(p_advdata, p_encoded_data + offset, &adv_data_size);
- *p_len = offset + adv_data_size;
- }
- else
- {
- err_code = nfc_ble_oob_adv_data_size_calc(p_advdata, &offset);
- *p_len = offset;
- }
-
- return err_code;
-}
-
-void nfc_tk_value_payload_encode(ble_advdata_tk_value_t * p_tk_value,
- uint8_t * p_tk_payload_data)
-{
- for (uint8_t i = 0; i < AD_TYPE_TK_VALUE_DATA_SIZE; i++)
- {
- *(p_tk_payload_data++) = p_tk_value->tk[i];
- }
-}
diff --git a/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.h b/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.h
deleted file mode 100644
index fb168ce..0000000
--- a/components/nfc/ndef/connection_handover/ble_oob_advdata/nfc_ble_oob_advdata.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/** @file
- *
- * @defgroup nfc_ble_oob_advdata Advertising and Scan Response Data Encoder for NFC OOB pairing
- * @{
- * @ingroup nfc_ble_pair_msg
- * @brief Function for encoding data in the Advertising and Scan Response Data format, which
- * can be used to create payload of NFC message intended for initiating the Out-of-Band
- * pairing.
- */
-
-#ifndef NFC_BLE_OOB_ADVDATA_H__
-#define NFC_BLE_OOB_ADVDATA_H__
-
-#include
-#include "ble_advdata.h"
-#include "app_util.h"
-#include "sdk_errors.h"
-
-
-#define AD_TYPE_LE_ROLE_DATA_SIZE 1UL /**< Data size (in octets) of the LE Bluetooth Device Address AD type. */
-#define AD_TYPE_LE_ROLE_SIZE (ADV_AD_DATA_OFFSET + \
- AD_TYPE_LE_ROLE_DATA_SIZE) /**< Size (in octets) of the LE Bluetooth Device Address AD type. */
-#define AD_TYPE_TK_VALUE_DATA_SIZE (sizeof(ble_advdata_tk_value_t)) /**< Data size (in octets) of the Security Manager TK value AD type. */
-#define AD_TYPE_TK_VALUE_SIZE (ADV_AD_DATA_OFFSET + \
- AD_TYPE_TK_VALUE_DATA_SIZE) /**< Size (in octets) of the Security Manager TK value AD type. */
-#define AD_TYPE_OOB_FLAGS_DATA_SIZE 1UL /**< Data size (in octets) of the Security Manager OOB Flags AD type. */
-#define AD_TYPE_OOB_FLAGS_SIZE (ADV_AD_DATA_OFFSET + \
- AD_TYPE_OOB_FLAGS_DATA_SIZE) /**< Size (in octets) of the Security Manager OOB Flags AD type. */
-
-#define AD_TYPE_CONFIRM_VALUE_DATA_SIZE 16UL /**< Data size (in octets) of the LESC Confirmation value. */
-#define AD_TYPE_CONFIRM_VALUE_SIZE (ADV_AD_DATA_OFFSET + \
- AD_TYPE_CONFIRM_VALUE_DATA_SIZE) /**< Size (in octets) of the LESC Confirmation value AD type. */
-#define AD_TYPE_RANDOM_VALUE_DATA_SIZE 16UL /**< Data size (in octets) of the LESC Random value. */
-#define AD_TYPE_RANDOM_VALUE_SIZE (ADV_AD_DATA_OFFSET + \
- AD_TYPE_RANDOM_VALUE_DATA_SIZE) /**< Size (in octets) of the LESC Random value AD type. */
-#define AD_TYPE_LESC_SIZE (AD_TYPE_RANDOM_VALUE_SIZE + \
- AD_TYPE_CONFIRM_VALUE_SIZE) /**< Size (in octets) of the LESC OOB AD data field in NDEF message. */
-
-#define AD_TYPE_SEC_MGR_OOB_FLAG_SET 1U /**< Security Manager OOB Flag set. Flag selection is done using _POS defines */
-#define AD_TYPE_SEC_MGR_OOB_FLAG_CLEAR 0U /**< Security Manager OOB Flag clear. Flag selection is done using _POS defines */
-#define AD_TYPE_SEC_MGR_OOB_FLAG_OOB_DATA_PRESENT_POS 0UL /**< Security Manager OOB Data Present Flag position. */
-#define AD_TYPE_SEC_MGR_OOB_FLAG_OOB_LE_SUPPORTED_POS 1UL /**< Security Manager OOB Low Energy Supported Flag position. */
-#define AD_TYPE_SEC_MGR_OOB_FLAG_SIM_LE_AND_EP_POS 2UL /**< Security Manager OOB Simultaneous LE and BR/EDR to Same Device Capable Flag position. */
-#define AD_TYPE_SEC_MGR_OOB_ADDRESS_TYPE_PUBLIC 0UL /**< Security Manager OOB Public Address type. */
-#define AD_TYPE_SEC_MGR_OOB_ADDRESS_TYPE_RANDOM 1UL /**< Security Manager OOB Random Address type. */
-#define AD_TYPE_SEC_MGR_OOB_FLAG_ADDRESS_TYPE_POS 3UL /**< Security Manager OOB Address type Flag (0 = Public Address, 1 = Random Address) position. */
-
-/**@brief Payload field values of LE Role BLE GAP AD Type. Corresponds with @ref ble_advdata_le_role_t enum. */
-typedef enum
-{
- NFC_BLE_ADVDATA_ROLE_ENCODED_ONLY_PERIPH = 0, /**< Only Peripheral Role supported. */
- NFC_BLE_ADVDATA_ROLE_ENCODED_ONLY_CENTRAL, /**< Only Central Role supported. */
- NFC_BLE_ADVDATA_ROLE_ENCODED_BOTH_PERIPH_PREFERRED, /**< Peripheral and Central Role supported. Peripheral Role preferred for connection establishment. */
- NFC_BLE_ADVDATA_ROLE_ENCODED_BOTH_CENTRAL_PREFERRED /**< Peripheral and Central Role supported. Central Role preferred for connection establishment */
-} nfc_ble_advdata_le_role_encoded_t;
-
-/**@brief Function for encoding data in the Advertising and Scan Response data format, which
- * is used for NFC OOB pairing.
- *
- *
- * @details This function encodes data into the Advertising and Scan Response data format (AD structures).
- * Encoding is based on the selections in the supplied structures. This function uses
- * @ref adv_data_encode to encode regular data and adds additional AD Structures which are specific
- * for NFC OOB pairing: Security Manager TK Value, LESC OOB values, OOB Flags, and LE Role.
- *
- * @param[in] p_advdata Pointer to the structure for specifying the content of encoded data.
- * @param[out] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in,out] p_len \c in: Size of \p p_encoded_data buffer.
- * \c out: Length of encoded data.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_INVALID_PARAM If the operation failed because a wrong parameter was provided in \p p_advdata.
- * @retval NRF_ERROR_DATA_SIZE If the operation failed because not all the requested data could fit into the
- * provided buffer or some encoded AD structure is too long and its
- * length cannot be encoded with one octet.
- */
-ret_code_t nfc_ble_oob_adv_data_encode(ble_advdata_t const * const p_advdata,
- uint8_t * const p_encoded_data,
- uint16_t * const p_len);
-
-/**@brief Function for encoding payload field of Security Manager TK Value AD Type.
- *
- * @param[in] p_tk_value Security Manager TK Value AD Type payload.
- * @param[out] p_tk_payload_data Pointer to the buffer where TK payload data will be stored.
- *
- */
-void nfc_tk_value_payload_encode(ble_advdata_tk_value_t * p_tk_value,
- uint8_t * p_tk_payload_data);
-
-#endif // NFC_BLE_OOB_ADVDATA_H__
-
-/** @} */
diff --git a/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.c b/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.c
deleted file mode 100644
index 44d40a3..0000000
--- a/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_ble_pair_msg.h"
-#include "nfc_hs_rec.h"
-#include "nfc_ac_rec.h"
-#include "nfc_le_oob_rec.h"
-#include "nfc_ep_oob_rec.h"
-#include "nfc_ndef_msg.h"
-#include "sdk_macros.h"
-
-/**
- * @brief Descriptor of TK value locations in Connection Handover NDEF message.
- */
-typedef struct
-{
- uint8_t ** pp_tk_group; /**< Pointer to array of pointer with TK locations in CH NDEF message. */
- uint8_t tk_num; /**< Number of valid TK locations. */
- uint8_t tk_max_num; /**< Maximal number of possible TK locations. */
-} nfc_ble_tk_group_t;
-
-/**
- * @brief Descriptor of LESC OOB data in Connection Handover NDEF message.
- */
-typedef struct
-{
- uint8_t * confirm; /**< Pointer to the LESC OOB confirmation value in the CH NDEF message. */
- uint8_t * random; /**< Pointer to the LESC OOB random value in the CH NDEF message. */
-} nfc_ble_lesc_data_pos_t;
-
-static nfc_ble_lesc_data_pos_t m_lesc_pos = {NULL, NULL}; /**< Descriptor used to update LESC keys in the NDEF Message */
-static nfc_ble_tk_group_t m_tk_group; /**< Descriptor used to find TK locations in the NDEF Message which require update. */
-static bool m_tk_modifier_on = false; /**< Flag indicating that TK modifier feature is on. */
-
-/* Default value for Security Manager Out Of Band Flags field in BLE AD structure */
-/* which is used for EP OOB Record payload */
-static const uint8_t sec_mgr_oob_flags =
- (AD_TYPE_SEC_MGR_OOB_FLAG_SET << AD_TYPE_SEC_MGR_OOB_FLAG_OOB_DATA_PRESENT_POS) |
- (AD_TYPE_SEC_MGR_OOB_FLAG_SET << AD_TYPE_SEC_MGR_OOB_FLAG_OOB_LE_SUPPORTED_POS) |
- (AD_TYPE_SEC_MGR_OOB_FLAG_CLEAR << AD_TYPE_SEC_MGR_OOB_FLAG_SIM_LE_AND_EP_POS) |
- (AD_TYPE_SEC_MGR_OOB_ADDRESS_TYPE_RANDOM << AD_TYPE_SEC_MGR_OOB_FLAG_ADDRESS_TYPE_POS);
-
-/**@brief Function for configuring TK group modifier feature.
- *
- * @details This function configures the structure which is responsible for tracking TK locations.
- * These locations can be afterwards easily accessed with @ref nfc_tk_group_modifier_update
- * and modified.
- *
- * @param[in] pp_tk_group Pointer to array of TK locations that should be modified with
- * @ref nfc_tk_group_modifier_update function.
- * @param[in] max_group_size Maximal number of TK locations that can added to \p pp_tk_group.
- */
-__STATIC_INLINE void nfc_tk_group_modifier_config(uint8_t ** pp_tk_group, uint8_t max_group_size)
-{
- m_tk_group.pp_tk_group = pp_tk_group;
- m_tk_group.tk_num = 0;
- m_tk_group.tk_max_num = max_group_size;
-}
-
-/** @brief Function for generating a description of a simplified LE OOB message according to the BLE
- * AD structure.
- *
- * This function declares and initializes a static instance of a simplified LE OOB message
- * with Bluetooth Carrier Configuration LE record. Payload of this record can be configured
- * via AD structure.
- *
- * @param[in] p_le_advdata Pointer to the AD for LE OOB record.
- * @param[out] pp_le_oob_msg_desc Pointer to pointer to the NDEF message instance.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-static ret_code_t nfc_ble_simplified_le_oob_msg_declare(ble_advdata_t const * const p_le_advdata,
- nfc_ndef_msg_desc_t ** pp_le_oob_msg_desc)
-{
- ret_code_t err_code;
- nfc_ndef_record_desc_t * p_nfc_le_oob_record;
-
- /* Create NFC NDEF message description, capacity - 1 record */
- NFC_NDEF_MSG_DEF(nfc_le_oob_msg, 1);
-
- /* The message description is static, therefore */
- /* you must clear the message (needed for supporting multiple calls) */
- nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_le_oob_msg));
-
- if (p_le_advdata != NULL)
- {
- /* Create NFC NDEF LE OOB Record description without record ID field */
- p_nfc_le_oob_record = nfc_le_oob_rec_declare(0 , p_le_advdata);
-
- /* Add LE OOB Record as lone record to message */
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_le_oob_msg), p_nfc_le_oob_record);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
- else
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- *pp_le_oob_msg_desc = &NFC_NDEF_MSG(nfc_le_oob_msg);
-
- return NRF_SUCCESS;
-}
-
-/** @brief Function for generating a description of a simplified EP OOB message according to the BLE
- * AD structure.
- *
- * This function declares and initializes a static instance of a simplified EP OOB message
- * with Bluetooth Carrier Configuration EP record. Payload of this record can be configured
- * via AD structure.
- *
- * @param[in] p_ep_advdata Pointer to the AD structure for EP OOB record.
- * @param[out] pp_ep_oob_msg_desc Pointer to pointer to the NDEF message instance.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-static ret_code_t nfc_ble_simplified_ep_oob_msg_declare(ble_advdata_t const * const p_ep_advdata,
- nfc_ndef_msg_desc_t ** pp_ep_oob_msg_desc)
-{
- ret_code_t err_code;
- nfc_ndef_record_desc_t * p_nfc_ep_oob_record;
-
- /* Create NFC NDEF message description, capacity - 1 record */
- NFC_NDEF_MSG_DEF(nfc_ep_oob_msg, 1);
-
- /* The message description is static, therefore */
- /* you must clear the message (needed for supporting multiple calls) */
- nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_ep_oob_msg));
-
- if (p_ep_advdata != NULL)
- {
- /* Create NFC NDEF EP OOB Record description without record ID field */
- p_nfc_ep_oob_record = nfc_ep_oob_rec_declare(0 , p_ep_advdata);
-
- /* Add EP OOB Record as lone record to message */
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_ep_oob_msg), p_nfc_ep_oob_record);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
- else
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- *pp_ep_oob_msg_desc = &NFC_NDEF_MSG(nfc_ep_oob_msg);
-
- return NRF_SUCCESS;
-}
-
-/** @brief Function for generating a description of a Handover Select NDEF message according to
- * the BLE AD structures.
- *
- * This function declares and initializes a static instance of an NFC NDEF message description
- * of a Handover Select NDEF message with a Hs record and two OOB records (LE and EP with
- * modifications for Windows). Payload of these records can be configured via AD structures.
- *
- * @warning The order of LE and EP records cannot be changed. Android devices are able to pair
- * correctly only when the LE record appears before the EP record.
- *
- * @param[in] p_le_advdata Pointer to the AD structure for LE OOB record.
- * @param[in] p_ep_advdata Pointer to the AD structure for EP OOB record.
- * @param[out] pp_bt_oob_full_msg Pointer to a pointer to the NDEF message instance.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-static ret_code_t nfc_ble_full_handover_select_msg_declare(ble_advdata_t const * const p_le_advdata,
- ble_advdata_t const * const p_ep_advdata,
- nfc_ndef_msg_desc_t ** pp_bt_oob_full_msg)
-{
- ret_code_t err_code = NRF_SUCCESS;
-
- // Carrier reference buffers for ac records.
- static uint8_t carrier_le_reference = '0';
- static uint8_t carrier_ep_reference = '1';
-
- // Create ac records for both message types.
- NFC_NDEF_AC_RECORD_DESC_DEF(ac_rec_le, NFC_AC_CPS_ACTIVE, 1, &carrier_le_reference, 1);
- NFC_NDEF_AC_RECORD_DESC_DEF(ac_rec_ep, NFC_AC_CPS_ACTIVE, 1, &carrier_ep_reference, 1);
-
- // Create a Hs record and assign existing ac records to it.
- NFC_NDEF_HS_RECORD_DESC_DEF(hs_rec, 1, 3, 2);
-
- nfc_ndef_record_desc_t * p_nfc_hs_record = &NFC_NDEF_HS_RECORD_DESC(hs_rec);
-
- // Clear the record before assigning local records to it (in case this function has already been called).
- nfc_hs_rec_local_record_clear(p_nfc_hs_record);
-
- err_code = nfc_hs_rec_local_record_add(p_nfc_hs_record, &NFC_NDEF_AC_RECORD_DESC(ac_rec_le));
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- err_code = nfc_hs_rec_local_record_add(p_nfc_hs_record, &NFC_NDEF_AC_RECORD_DESC(ac_rec_ep));
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- // Create le and ep records.
- nfc_ndef_record_desc_t * p_nfc_le_oob_record =
- nfc_le_oob_rec_declare(carrier_le_reference , p_le_advdata);
-
- nfc_ndef_record_desc_t * p_nfc_ep_oob_record =
- nfc_ep_oob_rec_declare(carrier_ep_reference , p_ep_advdata);
-
- // Create full NDEF Handover Select message for Connection Handover and assign Hs, le and ep records to it.
- NFC_NDEF_MSG_DEF(hs_full_msg, 3);
-
- // Clear the message before assigning records to it (in case this function has already been called).
- nfc_ndef_msg_clear(&NFC_NDEF_MSG(hs_full_msg));
-
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(hs_full_msg), p_nfc_hs_record);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(hs_full_msg), p_nfc_le_oob_record);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(hs_full_msg), p_nfc_ep_oob_record);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- *pp_bt_oob_full_msg = &NFC_NDEF_MSG(hs_full_msg);
-
- return err_code;
-}
-
-/** @brief Function for creating an AD structure with common configuration for EP and LE OOB records.
- *
- * This function creates an AD structure and initializes its fields with default content. Only
- * fields that are common for both EP and LE OOB records are filled.
- *
- * @param[in] p_tk_value Pointer to the authentication Temporary Key (TK). If NULL,
- * TK field of the returned AD structure is empty.
- * @param[out] p_adv_data Pointer to BLE AD structure with common configuration for EP and
- * LE OOB records.
- */
-static void common_adv_data_create(ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- ble_advdata_t * const p_adv_data)
-{
- memset((uint8_t *) p_adv_data, 0, sizeof(ble_advdata_t));
-
- /* Set common configuration of AD structure for both Bluetooth EP and LE record */
- p_adv_data->include_appearance = true;
- p_adv_data->name_type = BLE_ADVDATA_FULL_NAME;
- p_adv_data->p_tk_value = NULL;
- if (p_tk_value != NULL)
- {
- p_adv_data->p_tk_value = p_tk_value;
- }
-
- p_adv_data->p_lesc_data = p_lesc_data;
-}
-
-/** @brief Function for creating an AD structure with default configuration for an LE OOB record.
- *
- * This function creates an AD structure and initializes its fields with default content for
- * LE OOB record payload.
- *
- * @param[in] p_tk_value Pointer to the authentication Temporary Key (TK). If NULL,
- * TK field of the returned AD structure is empty.
- * @param[out] p_le_adv_data Pointer to BLE AD structure with default configuration
- * for LE OOB record.
- */
-static void le_oob_specific_adv_data_create(ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- ble_advdata_t * const p_le_adv_data)
-{
- /* Create default configuration which is common for both EP and LE OOB Records */
- common_adv_data_create(p_tk_value, p_lesc_data, p_le_adv_data);
-
- /* LE specific configuration */
- p_le_adv_data->include_ble_device_addr = true;
- p_le_adv_data->le_role = BLE_ADVDATA_ROLE_ONLY_PERIPH;
- p_le_adv_data->flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
-}
-
-/** @brief Function for creating an AD structure with default configuration for an EP OOB record.
- *
- * This function creates an AD structure and initializes its fields with default content for
- * EP OOB record payload.
- *
- * @param[in] p_tk_value Pointer to the authentication Temporary Key (TK). If NULL,
- * TK field of the returned AD structure is empty.
- * @param[out] p_ep_adv_data Pointer to BLE AD structure with default configuration
- * for EP OOB record.
- */
-static void ep_oob_specific_adv_data_create(ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- ble_advdata_t * const p_ep_adv_data)
-{
- /* Create default configuration which is common for both EP and LE OOB Records */
- common_adv_data_create(p_tk_value, p_lesc_data, p_ep_adv_data);
-
- /* EP specific configuration */
- p_ep_adv_data->p_sec_mgr_oob_flags = (uint8_t *) &sec_mgr_oob_flags;
-}
-
-ret_code_t nfc_ble_simplified_le_oob_msg_encode(ble_advdata_t const * const p_le_advdata,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- nfc_ndef_msg_desc_t * p_le_oob_msg_desc;
- ret_code_t err_code;
-
- err_code = nfc_ble_simplified_le_oob_msg_declare(p_le_advdata, &p_le_oob_msg_desc);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (!m_tk_modifier_on)
- {
- nfc_tk_group_modifier_config(NULL, 0);
- }
-
- /* Encode whole message into buffer */
- err_code = nfc_ndef_msg_encode(p_le_oob_msg_desc,
- p_buf,
- p_len);
-
- return err_code;
-}
-
-ret_code_t nfc_ble_simplified_ep_oob_msg_encode(ble_advdata_t const * const p_ep_advdata,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- nfc_ndef_msg_desc_t * p_ep_oob_msg_desc;
- ret_code_t err_code;
-
- err_code = nfc_ble_simplified_ep_oob_msg_declare(p_ep_advdata, &p_ep_oob_msg_desc);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (!m_tk_modifier_on)
- {
- nfc_tk_group_modifier_config(NULL, 0);
- }
-
- /* Encode whole message into buffer */
- err_code = nfc_ndef_msg_encode(p_ep_oob_msg_desc,
- p_buf,
- p_len);
-
- return err_code;
-}
-
-ret_code_t nfc_ble_full_handover_select_msg_encode(ble_advdata_t const * const p_le_advdata,
- ble_advdata_t const * const p_ep_advdata,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- nfc_ndef_msg_desc_t * p_full_hs_msg_desc;
- ret_code_t err_code;
-
- err_code = nfc_ble_full_handover_select_msg_declare(p_le_advdata,
- p_ep_advdata,
- &p_full_hs_msg_desc);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (!m_tk_modifier_on)
- {
- nfc_tk_group_modifier_config(NULL, 0);
- }
-
- /* Encode whole message into buffer */
- err_code = nfc_ndef_msg_encode(p_full_hs_msg_desc,
- p_buf,
- p_len);
-
- return err_code;
-}
-
-ret_code_t nfc_ble_pair_default_msg_encode(nfc_ble_pair_type_t nfc_ble_pair_type,
- ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- ble_advdata_t le_adv_data;
- ble_advdata_t ep_adv_data;
- ret_code_t err_code = NRF_SUCCESS;
-
- switch (nfc_ble_pair_type)
- {
-
- case NFC_BLE_PAIR_MSG_BLUETOOTH_LE_SHORT:
- le_oob_specific_adv_data_create(p_tk_value, p_lesc_data, &le_adv_data);
- err_code = nfc_ble_simplified_le_oob_msg_encode(&le_adv_data, p_buf, p_len);
- break;
-
- case NFC_BLE_PAIR_MSG_BLUETOOTH_EP_SHORT:
- ep_oob_specific_adv_data_create(p_tk_value, NULL, &ep_adv_data);
- err_code = nfc_ble_simplified_ep_oob_msg_encode(&ep_adv_data, p_buf, p_len);
- break;
-
- case NFC_BLE_PAIR_MSG_FULL:
- le_oob_specific_adv_data_create(p_tk_value, p_lesc_data, &le_adv_data);
- ep_oob_specific_adv_data_create(p_tk_value, NULL, &ep_adv_data);
- err_code = nfc_ble_full_handover_select_msg_encode(&le_adv_data,
- &ep_adv_data,
- p_buf,
- p_len);
- break;
-
- }
-
- return err_code;
-}
-
-ret_code_t nfc_ble_pair_msg_updatable_tk_encode(nfc_ble_pair_type_t nfc_ble_pair_type,
- ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- uint8_t * p_buf,
- uint32_t * p_len,
- uint8_t ** pp_tk_group,
- uint8_t max_group_size)
-{
- ret_code_t err_code = NRF_SUCCESS;
-
- m_tk_modifier_on = true;
- nfc_tk_group_modifier_config(pp_tk_group, max_group_size);
- err_code = nfc_ble_pair_default_msg_encode(nfc_ble_pair_type, p_tk_value,
- p_lesc_data, p_buf, p_len);
- m_tk_modifier_on = false;
-
- return err_code;
-}
-
-ret_code_t nfc_tk_group_modifier_update(ble_advdata_tk_value_t * p_tk_value)
-{
- VERIFY_PARAM_NOT_NULL(m_tk_group.pp_tk_group);
- for (uint8_t tk_index = 0; tk_index < m_tk_group.tk_num; ++tk_index)
- {
- uint8_t * p_tk_payload_data = m_tk_group.pp_tk_group[tk_index];
- nfc_tk_value_payload_encode(p_tk_value, p_tk_payload_data);
- }
- return NRF_SUCCESS;
-}
-
-ret_code_t nfc_tk_to_group_add(uint8_t * p_tk_location)
-{
- // Feature was disabled.
- if (m_tk_group.pp_tk_group == NULL)
- {
- return NRF_SUCCESS;
- }
-
- if (m_tk_group.tk_num < m_tk_group.tk_max_num)
- {
- m_tk_group.pp_tk_group[m_tk_group.tk_num++] = p_tk_location;
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_NO_MEM;
- }
-}
-
-ret_code_t nfc_lesc_pos_set(uint8_t * p_confirm, uint8_t * p_random)
-{
- if((p_confirm != NULL) && (p_random != NULL))
- {
- m_lesc_pos.confirm = p_confirm;
- m_lesc_pos.random = p_random;
-
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_NULL;
- }
-}
-
-ret_code_t nfc_lesc_data_update(ble_gap_lesc_oob_data_t * ble_lesc_oob_data)
-{
- if(ble_lesc_oob_data != NULL)
- {
- if((ble_lesc_oob_data->c != NULL) && (ble_lesc_oob_data->r != NULL))
- {
- memcpy(m_lesc_pos.confirm, ble_lesc_oob_data->c, AD_TYPE_CONFIRM_VALUE_DATA_SIZE);
- memcpy(m_lesc_pos.random, ble_lesc_oob_data->r, AD_TYPE_RANDOM_VALUE_DATA_SIZE);
-
- return NRF_SUCCESS;
- }
-
- return NRF_ERROR_INVALID_STATE;
- }
- else
- {
- return NRF_ERROR_NULL;
- }
-}
diff --git a/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.h b/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.h
deleted file mode 100644
index 18814af..0000000
--- a/components/nfc/ndef/connection_handover/ble_pair_msg/nfc_ble_pair_msg.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_BLE_PAIR_MSG_H__
-#define NFC_BLE_PAIR_MSG_H__
-
-/**@file
- *
- * @defgroup nfc_modules NDEF message modules
- * @ingroup nfc_api
- * @brief Implementation of NDEF messages.
- *
- * @defgroup nfc_ndef_messages Predefined NDEF messages
- * @ingroup nfc_modules
- * @brief Predefined NDEF messages for standard use.
- *
- * @defgroup nfc_ble_pair_msg BLE pairing messages
- * @{
- * @ingroup nfc_ndef_messages
- *
- * @brief Generation of NFC NDEF messages used for BLE pairing.
- *
- */
-
-#include
-#include "ble_advdata.h"
-#include "sdk_errors.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Types of BLE pairing message.
- *
- * Use one of these values to choose the type of NDEF BLE pairing message.
- */
-typedef enum
-{
- NFC_BLE_PAIR_MSG_BLUETOOTH_LE_SHORT, ///< Simplified LE OOB message.
- NFC_BLE_PAIR_MSG_BLUETOOTH_EP_SHORT, ///< Simplified EP OOB message.
- NFC_BLE_PAIR_MSG_FULL ///< BLE Handover Select Message.
-} nfc_ble_pair_type_t;
-
-/** @brief Function for encoding simplified LE OOB messages.
- *
- * This function encodes a simplified LE OOB message into a buffer. The payload of the LE OOB record
- * inside the message can be configured via the advertising data structure.
- *
- * This function was implemented partially according to "Bluetooth Secure Simple Pairing Using NFC"
- * (denotation "NFCForum-AD-BTSSP_1_1" published on 2014-01-09) chapters 3.1, 3.2, 4.3.2,
- * and according to "Supplement to the Bluetooth Core Specification" (Version 5, adoption date:
- * Dec 02 2014).
- *
- * @note To be able to encode the message, a SoftDevice must be enabled and configured.
- *
- * @param[in] p_le_advdata Pointer to the BLE advertising data structure for the LE OOB record.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-ret_code_t nfc_ble_simplified_le_oob_msg_encode(ble_advdata_t const * const p_le_advdata,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/** @brief Function for encoding simplified EP OOB messages.
- *
- * This function encodes a simplified EP OOB message into a buffer. The payload of the EP OOB record
- * inside the message can be configured via the advertising data structure.
- *
- * This function was implemented partially according to "Bluetooth Secure Simple Pairing Using NFC"
- * (denotation "NFCForum-AD-BTSSP_1_1" published on 2014-01-09) chapters 3.1, 3.2, 4.3.1,
- * and according to "Supplement to the Bluetooth Core Specification" (Version 5, adoption date:
- * Dec 02 2014).
- *
- * @note To be able to encode the message, a SoftDevice must be enabled and configured.
- *
- * @param[in] p_ep_advdata Pointer to the BLE advertising data structure for the EP OOB record.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-ret_code_t nfc_ble_simplified_ep_oob_msg_encode(ble_advdata_t const * const p_ep_advdata,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/** @brief Function for encoding BLE Handover Select Messages.
- *
- * This function encodes a BLE Handover Select Message into a buffer. The payload of the LE OOB record
- * and the EP OOB record inside the message can be configured via the advertising data structures.
- *
- * This function was implemented partially according to "Bluetooth Secure Simple Pairing Using NFC"
- * (denotation "NFCForum-AD-BTSSP_1_1" published on 2014-01-09) chapters 3.1, 3.2, 4.1.1
- * and 4.1.2 (combined), and according to "Supplement to the Bluetooth Core Specification" (Version 5,
- * adoption date: Dec 02 2014).
- *
- * @note To be able to encode the message, a SoftDevice must be enabled and configured.
- *
- * @param[in] p_le_advdata Pointer to the BLE advertising data structure for the LE OOB record.
- * @param[in] p_ep_advdata Pointer to the BLE advertising data structure for the EP OOB record.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-ret_code_t nfc_ble_full_handover_select_msg_encode(ble_advdata_t const * const p_le_advdata,
- ble_advdata_t const * const p_ep_advdata,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/** @brief Function for encoding any type of BLE pairing messages with default BLE
- * advertising data structures.
- *
- * This function encodes a BLE pairing message into a buffer. The message can be encoded as
- * one of the three message types (using @ref nfc_ble_simplified_le_oob_msg_encode,
- * @ref nfc_ble_simplified_ep_oob_msg_encode, or @ref nfc_ble_full_handover_select_msg_encode),
- * according to the @p nfc_ble_pair_type parameter. LE and EP OOB records use the default
- * advertising data structure configuration. Only one field ('Security Manager TK') in the BLE
- * advertising data can be configured for both records by specifying the @p p_tk_value parameter.
- *
- * For LE OOB records, the default BLE advertising data structure configuration fills the required
- * fields 'LE Bluetooth Device Address' and 'LE Role' and the optional fields 'Appearance',
- * 'Local Name', and 'Flags'.
- *
- * For EP OOB records, the default BLE advertising data structure configuration fills the required
- * field 'Security Manager Out Of Band Flags' and the optional fields 'Appearance',
- * 'Local Name', and 'Flags'.
- *
- * @note To be able to encode the message, a SoftDevice must be enabled and configured.
- *
- * @param[in] nfc_ble_pair_type Type of BLE pairing message.
- * @param[in] p_tk_value Pointer to the authentication Temporary Key (TK). If NULL,
- * TK value field is not encoded in the NDEF message.
- * @param[in] p_lesc_data Pointer to the LESC OOB data. If NULL, LESC OOB fields are
- * not encoded in the NDEF message.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-ret_code_t nfc_ble_pair_default_msg_encode(nfc_ble_pair_type_t nfc_ble_pair_type,
- ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/** @brief Function for encoding any type of BLE pairing messages with default BLE
- * advertising data structures and with TK modifier feature.
- *
- * This function is very similar to @ref nfc_ble_pair_default_msg_encode function, but
- * additionaly it enables to track TK locations which were encoded in Connection Handover
- * NDEF message. After using this function, you can update TK value in NDEF by calling
- * @ref nfc_tk_group_modifier_update.
- *
- * @param[in] nfc_ble_pair_type Type of BLE pairing message.
- * @param[in] p_tk_value Pointer to the authentication Temporary Key (TK). If NULL,
- * TK value field is not encoded in the NDEF message.
- * @param[in] p_lesc_data Pointer to the LESC OOB data. If NULL, LESC OOB values are
- * not encoded in the NDEF message.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- * @param[in] pp_tk_group Pointer to array of TK locations that should be modified with
- * @ref nfc_tk_group_modifier_update function.
- * @param[in] max_group_size Maximal number of TK locations that can added to \p pp_tk_group.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-ret_code_t nfc_ble_pair_msg_updatable_tk_encode(nfc_ble_pair_type_t nfc_ble_pair_type,
- ble_advdata_tk_value_t * const p_tk_value,
- ble_gap_lesc_oob_data_t * const p_lesc_data,
- uint8_t * p_buf,
- uint32_t * p_len,
- uint8_t ** pp_tk_group,
- uint8_t max_group_size);
-
-/**@brief Function for updating the Connection Handover NDEF message with new TK value.
- *
- * @details This function updates NDEF message with new TK value. This update is applied to all of
- * TK locations in the Connection Handover NDEF message. This function can only be used
- * after calling @ref nfc_ble_pair_msg_updatable_tk_encode, which is used to encode
- * Connection Handover NDEF message.
- *
- * @param[in] p_tk_value Pointer to the new TK value. The NDEF message will be updated with this
- * value.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_NULL If pointer to TK locations was NULL.
- */
-ret_code_t nfc_tk_group_modifier_update(ble_advdata_tk_value_t * p_tk_value);
-
-/**@brief Function for adding new location of TK value to the location description structure.
- *
- * @param[in] p_tk_location New location of TK value in the Connection Handover NDEF message.
- *
- * @retval NRF_SUCCESS If the operation was successful or if buffer used for holding TK
- * locations is NULL.
- * @retval NRF_ERROR_NO_MEM If there is no place in the buffer for the new TK value location.
- */
-ret_code_t nfc_tk_to_group_add(uint8_t * p_tk_location);
-
-/**@brief Function for updating the Connection Handover NDEF message with a new LESC OOB values.
- *
- * @details Updates LESC Confirmation and Random Values based on its locations set by the @ref nfc_lesc_pos_set function.
- *
- * @param[in] ble_lesc_oob_data Pointer to the new LESC OOB data. The NDEF message will be updated with this data.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_NULL If pointer to the new LESC OOB data is NULL.
- * @retval NRF_ERROR_INVALID_STATE If pointer to the LESC OOB data location in NDEF message is NULL.
- */
-ret_code_t nfc_lesc_data_update(ble_gap_lesc_oob_data_t * ble_lesc_oob_data);
-
-/**@brief Function for storing pointers to the LESC OOB data inside NDEF message.
- *
- * @details It allows LESC OOB data update without regenerating entire CH NDEF message.
- *
- * @param[in] p_confirm Pointer to the LESC Confirmation Value position in the NDEF message.
- * @param[in] p_random Pointer to the LESC Random Value position in the NDEF message.
- *
- * @retval NRF_SUCCESS If the operation was successful.
- * @retval NRF_ERROR_NULL If either of pointers is set to NULL.
- */
-ret_code_t nfc_lesc_pos_set(uint8_t * p_confirm, uint8_t * p_random);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_BLE_PAIR_MSG_H__
diff --git a/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.c b/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.c
deleted file mode 100644
index fc59ab9..0000000
--- a/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include
-
-/* Record Payload Type for Bluetooth Carrier Configuration LE record */
-const uint8_t le_oob_rec_type_field[] =
-{
- 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '/', 'v', 'n', 'd', '.',
- 'b', 'l', 'u', 'e', 't', 'o', 'o', 't', 'h', '.', 'l', 'e', '.', 'o', 'o', 'b'
-};
diff --git a/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.h b/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.h
deleted file mode 100644
index f4b9aee..0000000
--- a/components/nfc/ndef/connection_handover/common/nfc_ble_pair_common.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include
-
-/* Record Payload Type for Bluetooth Carrier Configuration LE record */
-extern const uint8_t le_oob_rec_type_field[32];
diff --git a/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.c b/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.c
deleted file mode 100644
index 6dfc494..0000000
--- a/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_ep_oob_rec.h"
-#include "sdk_errors.h"
-#include "ble_gap.h"
-#include "app_util.h"
-
-/* NFC OOB EP definitions */
-#define NFC_EP_OOB_REC_GAP_ADDR_LEN BLE_GAP_ADDR_LEN
-#define NFC_EP_OOB_REC_OOB_DATA_LEN_SIZE 2UL
-#define NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN (NFC_EP_OOB_REC_GAP_ADDR_LEN + \
- NFC_EP_OOB_REC_OOB_DATA_LEN_SIZE)
-
-/* Record Payload Type for Bluetooth Carrier Configuration EP record */
-static const uint8_t ep_oob_rec_type_field[] =
-{
- 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '/', 'v', 'n', 'd', '.',
- 'b', 'l', 'u', 'e', 't', 'o', 'o', 't', 'h', '.', 'e', 'p', '.', 'o', 'o', 'b'
-};
-
-/**
- * @brief Function for validating AD structure content for a Bluetooth Carrier Configuration EP record.
- *
- * This function validates AD structure content. LE Bluetooth Device Address and LE Role
- * fields must not be included. Security Manager OOB Flags structure is required.
- *
- * @param[in] p_ble_advdata Pointer to the description of the payload.
- *
- * @retval NRF_SUCCESS If the validation was successful.
- * @retval NRF_ERROR_INVALID_PARAM Otherwise.
- */
-static ret_code_t nfc_ep_oob_adv_data_check(ble_advdata_t const * const p_ble_advdata)
-{
- if ((true == p_ble_advdata->include_ble_device_addr) ||
- (BLE_ADVDATA_ROLE_NOT_PRESENT != p_ble_advdata->le_role) ||
- (NULL == p_ble_advdata->p_sec_mgr_oob_flags))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- /* If Flags field in AD structure is present, the BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED flag
- must be set. */
- if ((0 != p_ble_advdata->flags) &&
- ((p_ble_advdata->flags & BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) == 0))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
- return NRF_SUCCESS;
-}
-
-/**
- * @brief Function for encoding device address to Bluetooth Carrier Configuration EP record.
- *
- * This fuction is used to encode device address to Bluetooth Carrier Configuration EP record.
- *
- * @param[in] p_encoded_data Pointer to the buffer where encoded data will be returned.
- * @param[in] max_len Available memory in the buffer.
- *
- * @retval NRF_SUCCESS If the encoding was successful.
- * @retval NRF_ERROR_NO_MEM If available memory was not enough.
- * @retval NRF_ERROR_xxx If any other error occured.
- */
-static ret_code_t nfc_ep_oob_bluetooth_device_address_encode(uint8_t * const p_encoded_data,
- uint16_t max_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
- ble_gap_addr_t device_address;
-
- memset(&device_address, 0x00, sizeof(device_address));
-
- if (NFC_EP_OOB_REC_GAP_ADDR_LEN > max_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- /* Get BLE address */
- #if (NRF_SD_BLE_API_VERSION == 2)
- err_code = sd_ble_gap_address_get(&device_address);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- #endif
-
- #if (NRF_SD_BLE_API_VERSION == 3)
- err_code = sd_ble_gap_addr_get(&device_address);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- #endif
-
- /* Encode Bluetooth EP device address */
- memcpy(p_encoded_data, device_address.addr, NFC_EP_OOB_REC_GAP_ADDR_LEN);
-
- return NRF_SUCCESS;
-}
-
-/**
- * @brief Function for constructing the payload for a Bluetooth Carrier Configuration EP record.
- *
- * This function encodes the record payload according to the BLE AD structure. It implements
- * an API compatible with @ref p_payload_constructor_t.
- *
- * @param[in] p_ble_advdata Pointer to the description of the payload.
- * @param[out] p_buff Pointer to payload destination. If NULL, function will
- * calculate the expected size of the record payload.
- *
- * @param[in,out] p_len Size of available memory to write as input. Size of generated
- * payload as output.
- *
- * @retval NRF_SUCCESS If the record payload was encoded successfully.
- * @retval NRF_ERROR_NO_MEM If available memory was not enough for record payload to be encoded.
- * @retval Other If any other error occurred during record payload encoding.
- */
-static ret_code_t nfc_ep_oob_payload_constructor(ble_advdata_t * p_ble_advdata,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
- uint8_t * p_ad_data = NULL;
- uint16_t payload_len, ad_data_len;
-
- /* Check correctness of the configuration structure */
- err_code = nfc_ep_oob_adv_data_check(p_ble_advdata);
- if (NRF_SUCCESS != err_code)
- {
- return err_code;
- }
-
- if (p_buff != NULL)
- {
- /* Validate if there is enough memory for OOB payload length field and BLE device address */
- if (NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN > *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- /* Set proper memory offset in payload buffer for AD structure and count available memory.
- * Bluetooth EP device address and OOB payload length field must be inserted before the AD payload */
- p_ad_data = (uint8_t *) (p_buff + NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN);
- ad_data_len = *p_len - NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN;
- if ( *p_len - NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN > UINT16_MAX )
- {
- ad_data_len = UINT16_MAX;
- }
- }
-
- /* Encode AD structures into NFC record payload */
- err_code = nfc_ble_oob_adv_data_encode(p_ble_advdata, p_ad_data, &ad_data_len);
- if (NRF_SUCCESS != err_code)
- {
- return err_code;
- }
-
- /* Now as the final payload length is known OOB payload length field, and Bluetooth device
- * address can be encoded */
- payload_len = ad_data_len + NFC_EP_OOB_REC_PAYLOAD_PREFIX_LEN;
- if (p_buff != NULL)
- {
- p_buff += uint16_encode(payload_len, p_buff);
- err_code = nfc_ep_oob_bluetooth_device_address_encode(p_buff, p_ad_data - p_buff);
- if (NRF_SUCCESS != err_code)
- {
- return err_code;
- }
- }
-
- /* Update total payload length */
- *p_len = payload_len;
-
- return err_code;
-}
-
-
-nfc_ndef_record_desc_t * nfc_ep_oob_rec_declare(uint8_t rec_payload_id,
- ble_advdata_t const * const p_ble_advdata)
-{
- static uint8_t payload_id = 0;
-
- NFC_NDEF_GENERIC_RECORD_DESC_DEF( nfc_ep_oob_rec,
- TNF_MEDIA_TYPE,
- &payload_id, // memory for possible ID value
- 0, // no ID by default
- (ep_oob_rec_type_field),
- sizeof(ep_oob_rec_type_field),
- nfc_ep_oob_payload_constructor,
- NULL);
-
- nfc_ndef_record_desc_t * nfc_ep_oob_rec = &NFC_NDEF_GENERIC_RECORD_DESC( nfc_ep_oob_rec);
-
- /* Update record descriptor */
- nfc_ep_oob_rec->p_payload_descriptor = (void *) p_ble_advdata;
-
- /* Handle record ID configuration */
- payload_id = rec_payload_id;
- nfc_ep_oob_rec->id_length = (rec_payload_id != 0) ? 1 : 0;
-
- return nfc_ep_oob_rec;
-}
diff --git a/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.h b/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.h
deleted file mode 100644
index 90d106b..0000000
--- a/components/nfc/ndef/connection_handover/ep_oob_rec/nfc_ep_oob_rec.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_EP_OOB_REC_H__
-#define NFC_EP_OOB_REC_H__
-
-/**@file
- *
- * @defgroup nfc_ep_oob_rec EP OOB records
- * @{
- * @ingroup nfc_ble_pair_msg
- *
- * @brief Generation of NFC NDEF EP OOB records for NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-#include "nfc_ble_oob_advdata.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Function for generating a description of an NFC NDEF Bluetooth Carrier Configuration EP record.
- *
- * This function declares and initializes a static instance of an NFC NDEF record description
- * for a Bluetooth Carrier Configuration EP record.
- *
- * @note The record payload data (@p p_ble_advdata) should be declared as static. If it is
- * declared as automatic, the NDEF message encoding (see @ref nfc_ble_simplified_ep_oob_msg_encode)
- * must be done in the same variable scope.
- *
- * @param[in] rec_payload_id NDEF record header Payload ID field (limited to one byte).
- * If 0, no ID is present in the record description.
- * @param[in] p_ble_advdata Pointer to the encoded BLE advertising data structure. This
- * data is used to create the record payload.
- *
- * @return Pointer to the description of the record.
- */
-nfc_ndef_record_desc_t * nfc_ep_oob_rec_declare(uint8_t rec_payload_id,
- ble_advdata_t const * const p_ble_advdata);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_EP_OOB_REC_H__
diff --git a/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.c b/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.c
deleted file mode 100644
index 82b5bbf..0000000
--- a/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_hs_rec.h"
-#include "nfc_ac_rec.h"
-#include "nrf_error.h"
-
-#define HS_REC_VERSION_SIZE 1
-
-const uint8_t nfc_hs_rec_type_field[] = {'H', 's'}; ///< Handover Select record type.
-
-
-ret_code_t nfc_hs_rec_payload_constructor(nfc_hs_rec_payload_desc_t * p_nfc_hs_rec_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
-
- if (p_buff != NULL)
- {
- // There must be at least 1 free byte in buffer for version byte.
- if (*p_len < HS_REC_VERSION_SIZE)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- // Major/minor version byte.
- *p_buff = ( (p_nfc_hs_rec_payload_desc->major_version << 4) & 0xF0) |
- ( p_nfc_hs_rec_payload_desc->minor_version & 0x0F);
- p_buff += HS_REC_VERSION_SIZE;
-
- // Decrement remaining buffer size.
- *p_len -= HS_REC_VERSION_SIZE;
- }
-
- // Encode local records encapsulated in a message.
- err_code = nfc_ndef_msg_encode(p_nfc_hs_rec_payload_desc->p_local_records, p_buff, p_len);
- if (err_code!= NRF_SUCCESS)
- {
- return err_code;
- }
-
- // Add version byte to the total record size.
- *p_len += HS_REC_VERSION_SIZE;
-
- return NRF_SUCCESS;
-}
-
-
-void nfc_hs_rec_local_record_clear(nfc_ndef_record_desc_t * p_hs_rec)
-{
- nfc_hs_rec_payload_desc_t* p_hs_payload =
- (nfc_hs_rec_payload_desc_t*)p_hs_rec->p_payload_descriptor;
-
- nfc_ndef_msg_clear(p_hs_payload->p_local_records);
-}
-
-
-ret_code_t nfc_hs_rec_local_record_add(nfc_ndef_record_desc_t * p_hs_rec,
- nfc_ndef_record_desc_t * p_local_rec)
-{
- nfc_hs_rec_payload_desc_t* p_hs_payload =
- (nfc_hs_rec_payload_desc_t*)p_hs_rec->p_payload_descriptor;
-
- return nfc_ndef_msg_record_add(p_hs_payload->p_local_records, p_local_rec);
-}
diff --git a/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.h b/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.h
deleted file mode 100644
index 87a0b95..0000000
--- a/components/nfc/ndef/connection_handover/hs_rec/nfc_hs_rec.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_HS_REC_H__
-#define NFC_HS_REC_H__
-
-/**@file
- *
- * @defgroup nfc_hs_rec Hs (Handover Select) records
- * @{
- * @ingroup nfc_ble_pair_msg
- *
- * @brief Generation of NFC NDEF Handover Select records for NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-#include "nfc_ndef_msg.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Handover Select record payload descriptor.
- */
-typedef struct
-{
- uint8_t major_version; ///< Major version number of the supported Connection Handover specification.
- uint8_t minor_version; ///< Minor version number of the supported Connection Handover specification.
- nfc_ndef_msg_desc_t * p_local_records; ///< Pointer to a message encapsulating local records.
-} nfc_hs_rec_payload_desc_t;
-
-
-/**
- * @brief Constructor for an NFC NDEF Handover Select record payload.
- *
- * This function encodes the payload of a Handover Select record as specified in the Connection
- * Handover standard. It implements an API compatible with @ref p_payload_constructor_t.
- */
-
-ret_code_t nfc_hs_rec_payload_constructor(nfc_hs_rec_payload_desc_t * p_nfc_hs_rec_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len);
-
-/**
- * @brief An external reference to the type field of the Handover Select record, defined in the
- * file @c nfc_hs_rec.c. It is used in the @ref NFC_NDEF_HS_RECORD_DESC_DEF macro.
- */
-extern const uint8_t nfc_hs_rec_type_field[];
-
-/**
- * @brief Size of the type field of the Handover Select record, defined in the
- * file @c nfc_hs_rec.c. It is used in the @ref NFC_NDEF_HS_RECORD_DESC_DEF macro.
- */
-#define NFC_HS_REC_TYPE_LENGTH 2
-
-/**
- * @brief Macro for creating and initializing an NFC NDEF record descriptor for a Handover Select record.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_record_desc_t and
- * a static instance of type @ref nfc_hs_rec_payload_desc_t, which together constitute an instance of a Handover Select record.
- *
- * Use the macro @ref NFC_NDEF_HS_RECORD_DESC to access the NDEF Handover Select record descriptor instance.
- *
- * @param[in] NAME Name of the created record descriptor instance.
- * @param[in] MAJOR_VERSION Major version number of the supported Connection Handover specification.
- * @param[in] MINOR_VERSION Minor version number of the supported Connection Handover specification.
- * @param[in] MAX_RECORDS Maximum number of local records (ac records plus optional err record).
- */
-#define NFC_NDEF_HS_RECORD_DESC_DEF(NAME, \
- MAJOR_VERSION, \
- MINOR_VERSION, \
- MAX_RECORDS) \
- NFC_NDEF_MSG_DEF(NAME, MAX_RECORDS); \
- static nfc_hs_rec_payload_desc_t NAME##_nfc_hs_rec_payload_desc = \
- { \
- .major_version = MAJOR_VERSION, \
- .minor_version = MINOR_VERSION, \
- .p_local_records = &NFC_NDEF_MSG(NAME) \
- }; \
- NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
- TNF_WELL_KNOWN, \
- 0, \
- 0, \
- nfc_hs_rec_type_field , \
- NFC_HS_REC_TYPE_LENGTH, \
- nfc_hs_rec_payload_constructor, \
- &(NAME##_nfc_hs_rec_payload_desc))
-
-/**
- * @brief Macro for accessing the NFC NDEF Handover Select record descriptor
- * instance that was created with @ref NFC_NDEF_HS_RECORD_DESC_DEF.
- */
-#define NFC_NDEF_HS_RECORD_DESC(NAME) NFC_NDEF_GENERIC_RECORD_DESC(NAME)
-
-/**
- * @brief Function for clearing local records in the NFC NDEF Handover Select record.
- *
- * This function clears local records from the Handover Select record.
- *
- * @param[in, out] p_hs_rec Pointer to the Handover Select record descriptor.
- */
-void nfc_hs_rec_local_record_clear(nfc_ndef_record_desc_t * p_hs_rec);
-
-/**
- * @brief Function for adding a local record to an NFC NDEF Handover Select record.
- *
- * @param[in, out] p_hs_rec Pointer to a Handover Select record.
- * @param[in] p_local_rec Pointer to a local record to add.
- *
- * @retval NRF_SUCCESS If the local record was added successfully.
- * @retval NRF_ERROR_NO_MEM If the Handover Select record already contains the maximum number of local records.
- */
-ret_code_t nfc_hs_rec_local_record_add(nfc_ndef_record_desc_t * p_hs_rec,
- nfc_ndef_record_desc_t * p_local_rec);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_HS_REC_H__
diff --git a/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.c b/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.c
deleted file mode 100644
index 5c757ad..0000000
--- a/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nfc_le_oob_rec.h"
-#include "sdk_errors.h"
-#include "ble_gap.h"
-#include "nfc_ble_pair_common.h"
-
-/**
- * @brief Function for validating AD structure content for a Bluetooth Carrier Configuration LE record.
- *
- * This function validates AD structure content. LE Bluetooth Device Address and LE Role
- * fields are required. Security Manager Out Of Band Flags structure must not be included.
- *
- * @param[in] p_ble_advdata Pointer to the description of the payload.
- *
- * @retval NRF_SUCCESS If the validation was successful.
- * @retval NRF_ERROR_INVALID_PARAM Otherwise.
- */
-static ret_code_t nfc_le_oob_adv_data_check(ble_advdata_t const * const p_ble_advdata)
-{
- if ((false == p_ble_advdata->include_ble_device_addr) ||
- (BLE_ADVDATA_ROLE_NOT_PRESENT == p_ble_advdata->le_role) ||
- (NULL != p_ble_advdata->p_sec_mgr_oob_flags))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- /* If Flags field in AD structure is present, the BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED flag
- must be set. */
- if ((0 != p_ble_advdata->flags) &&
- ((p_ble_advdata->flags & BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED) == 0))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- return NRF_SUCCESS;
-}
-
-/**
- * @brief Function for constructing the payload for a Bluetooth Carrier Configuration LE record.
- *
- * This function encodes the record payload according to the BLE AD structure. It implements
- * an API compatible with @ref p_payload_constructor_t
- *
- * @param[in] p_ble_advdata Pointer to the description of the payload.
- * @param[out] p_buff Pointer to payload destination. If NULL, function will
- * calculate the expected size of the record payload.
- *
- * @param[in,out] p_len Size of available memory to write as input. Size of generated
- * payload as output.
- *
- * @retval NRF_SUCCESS If the record payload was encoded successfully.
- * @retval Other If the record payload encoding failed.
- */
-static ret_code_t nfc_le_oob_payload_constructor(ble_advdata_t * p_ble_advdata,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- ret_code_t err_code = NRF_SUCCESS;
-
- /* Check correctness of the configuration structure */
- err_code = nfc_le_oob_adv_data_check(p_ble_advdata);
- if (NRF_SUCCESS != err_code)
- {
- return err_code;
- }
-
- /* Encode AD structures into NFC record payload */
- uint16_t buff_len = *p_len;
- if (*p_len > UINT16_MAX)
- {
- buff_len = UINT16_MAX;
- }
- err_code = nfc_ble_oob_adv_data_encode(p_ble_advdata, p_buff, &buff_len);
-
- /* Update total payload length */
- *p_len = (uint32_t) buff_len;
-
- return err_code;
-}
-
-nfc_ndef_record_desc_t * nfc_le_oob_rec_declare(uint8_t rec_payload_id,
- ble_advdata_t const * const p_ble_advdata)
-{
- static uint8_t payload_id = 0;
-
- NFC_NDEF_GENERIC_RECORD_DESC_DEF( nfc_le_oob_rec,
- TNF_MEDIA_TYPE,
- &payload_id, // memory for possible ID value
- 0, // no ID by default
- (le_oob_rec_type_field),
- sizeof(le_oob_rec_type_field),
- nfc_le_oob_payload_constructor,
- NULL);
-
- nfc_ndef_record_desc_t * nfc_le_oob_rec = &NFC_NDEF_GENERIC_RECORD_DESC( nfc_le_oob_rec);
-
- /* Update record descriptor */
- nfc_le_oob_rec->p_payload_descriptor = (void *) p_ble_advdata;
-
- /* Handle record ID configuration */
- payload_id = rec_payload_id;
- nfc_le_oob_rec->id_length = (rec_payload_id != 0) ? 1 : 0;
-
- return nfc_le_oob_rec;
-}
diff --git a/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.h b/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.h
deleted file mode 100644
index 3957364..0000000
--- a/components/nfc/ndef/connection_handover/le_oob_rec/nfc_le_oob_rec.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_LE_OOB_REC_H__
-#define NFC_LE_OOB_REC_H__
-
-/**@file
- *
- * @defgroup nfc_le_oob_rec LE OOB records
- * @{
- * @ingroup nfc_ble_pair_msg
- *
- * @brief Generation of NFC NDEF LE OOB records for NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-#include "nfc_ble_oob_advdata.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Function for generating a description of an NFC NDEF Bluetooth Carrier Configuration LE Record.
- *
- * This function declares and initializes a static instance of an NFC NDEF record description
- * for a Bluetooth Carrier Configuration LE record.
- *
- * @note The record payload data (@p p_ble_advdata) should be declared as static. If it is
- * declared as automatic, the NDEF message encoding (see @ref nfc_ble_simplified_le_oob_msg_encode)
- * must be done in the same variable scope.
- *
- * @param[in] rec_payload_id NDEF record header Payload ID field (Limited to one byte).
- * If 0, no ID is present in the record description.
- * @param[in] p_ble_advdata Pointer to the encoded BLE advertising data structure. This
- * data is used to create the record payload.
- *
- * @return Pointer to the description of the record.
- */
-nfc_ndef_record_desc_t * nfc_le_oob_rec_declare(uint8_t rec_payload_id,
- ble_advdata_t const * const p_ble_advdata);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_LE_OOB_REC_H__
diff --git a/components/nfc/ndef/generic/message/nfc_ndef_msg.c b/components/nfc/ndef/generic/message/nfc_ndef_msg.c
deleted file mode 100644
index 75ab89f..0000000
--- a/components/nfc/ndef/generic/message/nfc_ndef_msg.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if NFC_NDEF_MSG_ENABLED
-
-#include "app_util.h"
-#include "nfc_ndef_msg.h"
-#include "nordic_common.h"
-#include "nrf.h"
-
-#define TYPE_4_TAG 4U ///< Type 4 Tag identifier.
-#define NLEN_FIELD_SIZE 2U ///< Size of NLEN field, used to encode NDEF message for Type 4 Tag.
-
-/**
- * @brief Resolve the value of record location flags of the NFC NDEF record within an NFC NDEF message.
- */
-__STATIC_INLINE nfc_ndef_record_location_t record_location_get(uint32_t index,
- uint32_t record_count)
-{
- nfc_ndef_record_location_t record_location;
-
- if (index == 0)
- {
- if (record_count == 1)
- {
- record_location = NDEF_LONE_RECORD;
- }
- else
- {
- record_location = NDEF_FIRST_RECORD;
- }
- }
- else if (record_count == index + 1)
- {
- record_location = NDEF_LAST_RECORD;
- }
- else
- {
- record_location = NDEF_MIDDLE_RECORD;
- }
-
- return record_location;
-}
-
-
-ret_code_t nfc_ndef_msg_encode(nfc_ndef_msg_desc_t const * p_ndef_msg_desc,
- uint8_t * p_msg_buffer,
- uint32_t * const p_msg_len)
-{
- nfc_ndef_record_location_t record_location;
- uint32_t temp_len;
- uint32_t i;
- uint32_t err_code;
-
- uint32_t sum_of_len = 0;
-
- if ((p_ndef_msg_desc == NULL) || p_msg_len == NULL)
- {
- return NRF_ERROR_NULL;
- }
-
- nfc_ndef_record_desc_t * * pp_record_rec_desc = p_ndef_msg_desc->pp_record;
-
- if (p_ndef_msg_desc->pp_record == NULL)
- {
- return NRF_ERROR_NULL;
- }
-
-#if NFC_NDEF_MSG_TAG_TYPE == TYPE_4_TAG
- uint8_t * p_root_msg_buffer = p_msg_buffer;
-
- if (p_msg_buffer != NULL)
- {
- if (*p_msg_len < NLEN_FIELD_SIZE)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- p_msg_buffer += NLEN_FIELD_SIZE;
- }
- sum_of_len += NLEN_FIELD_SIZE;
-#endif
-
- for (i = 0; i < p_ndef_msg_desc->record_count; i++)
- {
- record_location = record_location_get(i, p_ndef_msg_desc->record_count);
-
- temp_len = *p_msg_len - sum_of_len;
-
- err_code = nfc_ndef_record_encode(*pp_record_rec_desc,
- record_location,
- p_msg_buffer,
- &temp_len);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- sum_of_len += temp_len;
- if (p_msg_buffer != NULL)
- {
- p_msg_buffer += temp_len;
- }
-
- /* next record */
- pp_record_rec_desc++;
- }
-
-#if NFC_NDEF_MSG_TAG_TYPE == TYPE_4_TAG
- if (p_msg_buffer != NULL)
- {
- if (sum_of_len - NLEN_FIELD_SIZE > UINT16_MAX)
- {
- return NRF_ERROR_NOT_SUPPORTED;
- }
-
- UNUSED_RETURN_VALUE(uint16_big_encode(sum_of_len - NLEN_FIELD_SIZE, p_root_msg_buffer));
- }
-#endif
-
- *p_msg_len = sum_of_len;
-
- return NRF_SUCCESS;
-}
-
-
-void nfc_ndef_msg_clear(nfc_ndef_msg_desc_t * p_msg)
-{
- p_msg->record_count = 0;
-}
-
-
-ret_code_t nfc_ndef_msg_record_add(nfc_ndef_msg_desc_t * const p_msg,
- nfc_ndef_record_desc_t * const p_record)
-{
- if (p_msg->record_count >= p_msg->max_record_count)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- p_msg->pp_record[p_msg->record_count] = p_record;
- p_msg->record_count++;
-
- return NRF_SUCCESS;
-}
-
-#endif // NFC_NDEF_MSG_ENABLED
diff --git a/components/nfc/ndef/generic/message/nfc_ndef_msg.h b/components/nfc/ndef/generic/message/nfc_ndef_msg.h
deleted file mode 100644
index f9ab4d2..0000000
--- a/components/nfc/ndef/generic/message/nfc_ndef_msg.h
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_NDEF_MSG_H__
-#define NFC_NDEF_MSG_H__
-
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/**@file
- *
- * @defgroup nfc_ndef_msg Custom NDEF messages
- * @{
- * @ingroup nfc_modules
- *
- * @brief Generation of NFC NDEF messages for the NFC tag.
- *
- */
-
- /**
- * @brief NDEF message descriptor.
- */
- typedef struct {
- nfc_ndef_record_desc_t ** pp_record; ///< Pointer to an array of pointers to NDEF record descriptors.
- uint32_t max_record_count; ///< Number of elements in the allocated pp_record array, which defines the maximum number of records within the NDEF message.
- uint32_t record_count; ///< Number of records in the NDEF message.
- } nfc_ndef_msg_desc_t;
-
- /**
- * @brief Function for encoding an NDEF message.
- *
- * This function encodes an NDEF message according to the provided message descriptor.
- *
- * @note The way of encoding an NDEF message may vary depending on tag's platform, which
- * can be chosen with @ref NFC_NDEF_MSG_TAG_TYPE in @c sdk_config.h.
- *
- * @param[in] p_ndef_msg_desc Pointer to the message descriptor.
- * @param[out] p_msg_buffer Pointer to the message destination. If NULL, function will
- * calculate the expected size of the message.
- * @param[in,out] p_msg_len Size of the available memory for the message as input. Size of
- * the generated message as output.
- *
- * @return Return value from @ref nfc_ndef_record_encode.
- */
-ret_code_t nfc_ndef_msg_encode(nfc_ndef_msg_desc_t const * p_ndef_msg_desc,
- uint8_t * p_msg_buffer,
- uint32_t * const p_msg_len);
-
-/**
- * @brief Function for clearing an NDEF message.
- *
- * This function clears an NDEF message descriptor, thus empties the NDEF message.
- *
- * @param[in,out] p_msg Pointer to the message descriptor.
- */
-void nfc_ndef_msg_clear( nfc_ndef_msg_desc_t * p_msg);
-
-/**
- * @brief Function for adding a record to an NDEF message.
- *
- * @param[in] p_record Pointer to the record descriptor.
- * @param[in,out] p_msg Pointer to the message descriptor.
- *
- * @retval NRF_SUCCESS If the record was added successfully.
- * @retval NRF_ERROR_NO_MEM If the message already contains the maximum number of records and the operation is not allowed.
- */
-ret_code_t nfc_ndef_msg_record_add(nfc_ndef_msg_desc_t * const p_msg,
- nfc_ndef_record_desc_t * const p_record);
-
-
-/**@brief Macro for creating and initializing an NFC NDEF message descriptor.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_msg_desc_t
- * and a static array of pointers to record descriptors (@ref nfc_ndef_record_desc_t) used
- * by the message.
- *
- * Use the macro @ref NFC_NDEF_MSG to access the NDEF message descriptor instance.
- *
- * @param[in] NAME Name of the related instance.
- * @param[in] MAX_RECORD_CNT Maximal count of records in the message.
- */
-#define NFC_NDEF_MSG_DEF(NAME, MAX_RECORD_CNT) \
- static nfc_ndef_record_desc_t * NAME##_nfc_ndef_p_record_desc_array[MAX_RECORD_CNT]; \
- static nfc_ndef_msg_desc_t NAME##_nfc_ndef_msg_desc = \
- { \
- .pp_record = NAME##_nfc_ndef_p_record_desc_array, \
- .record_count = 0, \
- .max_record_count = MAX_RECORD_CNT \
- }
-
-/** @brief Macro for accessing the NFC NDEF message descriptor instance
- * that you created with @ref NFC_NDEF_MSG_DEF.
- */
-#define NFC_NDEF_MSG(NAME) (NAME##_nfc_ndef_msg_desc)
-
-/**
- * @brief Macro for creating and initializing an NFC NDEF record descriptor with an encapsulated NDEF message.
-
- * This macro creates and initializes a static instance of type
- * @ref nfc_ndef_record_desc_t that contains an encapsulated NDEF message as
- * payload. @ref nfc_ndef_msg_encode is used as payload constructor to encode
- * the message. The encoded message is then used as payload for the record.
- *
- * Use the macro @ref NFC_NDEF_NESTED_NDEF_MSG_RECORD to access the NDEF record descriptor instance.
- *
- * @param[in] NAME Name of the created record descriptor instance.
- * @param[in] TNF Type Name Format (TNF) value for the record.
- * @param[in] P_ID Pointer to the ID string.
- * @param[in] ID_LEN Length of the ID string.
- * @param[in] P_TYPE Pointer to the type string.
- * @param[in] TYPE_LEN Length of the type string.
- * @param[in] P_NESTED_MESSAGE Pointer to the message descriptor to encapsulate
- * as the record's payload.
- */
-#define NFC_NDEF_NESTED_NDEF_MSG_RECORD_DEF( NAME, \
- TNF, \
- P_ID, \
- ID_LEN, \
- P_TYPE, \
- TYPE_LEN, \
- P_NESTED_MESSAGE ) \
- static nfc_ndef_record_desc_t NAME##_ndef_record_nested_desc = \
- { \
- .tnf = TNF, \
- \
- .id_length = ID_LEN, \
- .p_id = P_ID, \
- \
- .type_length = TYPE_LEN, \
- .p_type = P_TYPE, \
- \
- .payload_constructor = (p_payload_constructor_t)(nfc_ndef_msg_encode), \
- .p_payload_descriptor = (void*) (P_NESTED_MESSAGE) \
- }
-
-/** @brief Macro for accessing the NFC NDEF record descriptor instance
- * that you created with @ref NFC_NDEF_NESTED_NDEF_MSG_RECORD_DEF.
- */
-#define NFC_NDEF_NESTED_NDEF_MSG_RECORD(NAME) (NAME##_ndef_record_nested_desc)
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
- #endif
-
diff --git a/components/nfc/ndef/generic/record/nfc_ndef_record.c b/components/nfc/ndef/generic/record/nfc_ndef_record.c
deleted file mode 100644
index 7d594fc..0000000
--- a/components/nfc/ndef/generic/record/nfc_ndef_record.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-#include "app_util.h"
-#include "nrf.h"
-
-
-/* Sum of sizes of fields: TNF-flags, Type Length, Payload Length in long NDEF record. */
-#define NDEF_RECORD_BASE_LONG_SIZE (2 + NDEF_RECORD_PAYLOAD_LEN_LONG_SIZE)
-
-__STATIC_INLINE uint32_t record_header_size_calc(nfc_ndef_record_desc_t const * p_ndef_record_desc)
-{
- uint32_t len = NDEF_RECORD_BASE_LONG_SIZE;
-
- len += p_ndef_record_desc->id_length + p_ndef_record_desc->type_length;
-
- if (p_ndef_record_desc->id_length > 0)
- {
- len++;
- }
-
- return len;
-}
-
-
-ret_code_t nfc_ndef_record_encode(nfc_ndef_record_desc_t const * p_ndef_record_desc,
- nfc_ndef_record_location_t record_location,
- uint8_t * p_record_buffer,
- uint32_t * p_record_len)
-{
- uint8_t * p_flags; // use as pointer to TNF + flags field
- uint8_t * p_payload_len = NULL; // use as pointer to payload length field
- uint32_t record_payload_len;
-
- if (p_ndef_record_desc == NULL)
- {
- return NRF_ERROR_NULL;
- }
-
- // count record length without payload
- uint32_t record_header_len = record_header_size_calc(p_ndef_record_desc);
- uint32_t err_code = NRF_SUCCESS;
-
- if (p_record_buffer != NULL)
- {
- /* verify location range */
- if ((record_location & (~NDEF_RECORD_LOCATION_MASK)) != 0x00)
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- /* verify if there is enough available memory */
- if (record_header_len > *p_record_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- p_flags = p_record_buffer;
- p_record_buffer++;
-
- // set location bits and clear other bits in 1st byte.
- *p_flags = record_location;
-
- *p_flags |= p_ndef_record_desc->tnf;
-
- /* TYPE LENGTH */
- *(p_record_buffer++) = p_ndef_record_desc->type_length;
-
- // use always long record and remember payload len field memory offset.
- p_payload_len = p_record_buffer;
- p_record_buffer += NDEF_RECORD_PAYLOAD_LEN_LONG_SIZE;
-
- /* ID LENGTH - option */
- if (p_ndef_record_desc->id_length > 0)
- {
- *(p_record_buffer++) = p_ndef_record_desc->id_length;
-
- /* IL flag */
- *p_flags |= NDEF_RECORD_IL_MASK;
- }
-
- /* TYPE */
- memcpy(p_record_buffer, p_ndef_record_desc->p_type, p_ndef_record_desc->type_length);
- p_record_buffer += p_ndef_record_desc->type_length;
-
- /* ID */
- if (p_ndef_record_desc->id_length > 0)
- {
- memcpy(p_record_buffer, p_ndef_record_desc->p_id, p_ndef_record_desc->id_length);
- p_record_buffer += p_ndef_record_desc->id_length;
- }
-
- // count how much memory is left in record buffer for payload field.
- record_payload_len = (*p_record_len - record_header_len);
- }
-
- /* PAYLOAD */
- if (p_ndef_record_desc->payload_constructor != NULL)
- {
- err_code =
- p_ndef_record_desc->payload_constructor(p_ndef_record_desc->p_payload_descriptor,
- p_record_buffer,
- &record_payload_len);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
- else
- {
- return NRF_ERROR_NULL;
- }
-
- if (p_record_buffer != NULL)
- {
- /* PAYLOAD LENGTH */
- (void) uint32_big_encode(record_payload_len, p_payload_len);
- }
-
- *p_record_len = record_header_len + record_payload_len;
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_ndef_bin_payload_memcopy(nfc_ndef_bin_payload_desc_t * p_payload_descriptor,
- uint8_t * p_buffer,
- uint32_t * p_len)
-{
-
- if (p_buffer != NULL)
- {
- if ( *p_len < p_payload_descriptor->payload_length)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- memcpy(p_buffer,
- p_payload_descriptor->p_payload,
- p_payload_descriptor->payload_length);
- }
-
- *p_len = p_payload_descriptor->payload_length;
-
- return NRF_SUCCESS;
-}
-
-
diff --git a/components/nfc/ndef/generic/record/nfc_ndef_record.h b/components/nfc/ndef/generic/record/nfc_ndef_record.h
deleted file mode 100644
index fc02f47..0000000
--- a/components/nfc/ndef/generic/record/nfc_ndef_record.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_NDEF_RECORD_H__
-#define NFC_NDEF_RECORD_H__
-
-#include
-#include
-#include "compiler_abstraction.h"
-#include "sdk_errors.h"
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@file
- *
- * @defgroup nfc_ndef_record Custom NDEF records
- * @{
- * @ingroup nfc_ndef_msg
- *
- * @brief Generation of NFC NDEF records for NFC messages.
- *
- */
-
-
-#define NDEF_RECORD_IL_MASK 0x08 ///< Mask of the ID field presence bit in the flags byte of an NDEF record.
-#define NDEF_RECORD_TNF_MASK 0x07 ///< Mask of the TNF value field in the first byte of an NDEF record.
-#define NDEF_RECORD_SR_MASK 0x10 ///< Mask of the SR flag. If set, this flag indicates that the PAYLOAD_LENGTH field has a size of 1 byte. Otherwise, PAYLOAD_LENGTH has 4 bytes.
-#define NDEF_RECORD_PAYLOAD_LEN_LONG_SIZE 4 ///< Size of the Payload Length field in a long NDEF record.
-#define NDEF_RECORD_PAYLOAD_LEN_SHORT_SIZE 1 ///< Size of the Payload Length field in a short NDEF record.
-#define NDEF_RECORD_ID_LEN_SIZE 1 ///< Size of the ID Length field in an NDEF record.
-
-
-/**
- * @brief Payload constructor type.
-
- * A payload constructor is a function for constructing the payload of an NDEF
- * record.
- *
- * @param[in] p_payload_descriptor Pointer to the input data for the constructor.
- * @param[out] p_buffer Pointer to the payload destination. If NULL, function will
- * calculate the expected size of the record payload.
- *
- * @param[in,out] p_len Size of the available memory to write as input. Size of the generated
- * record payload as output. The implementation must check if the payload
- * will fit in the provided buffer. This must be checked by the caller function.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_xxx If an error occurred.
- */
-typedef ret_code_t (* p_payload_constructor_t)(void * p_payload_descriptor,
- uint8_t * p_buffer,
- uint32_t * p_len);
-
-
-/**
- * @brief Type Name Format (TNF) Field Values.
- *
- * Values to specify the TNF of a record.
- */
-typedef enum
-{
- TNF_EMPTY = 0x00, ///< The value indicates that there is no type or payload associated with this record.
- TNF_WELL_KNOWN = 0x01, ///< NFC Forum well-known type [NFC RTD].
- TNF_MEDIA_TYPE = 0x02, ///< Media-type as defined in RFC 2046 [RFC 2046].
- TNF_ABSOLUTE_URI = 0x03, ///< Absolute URI as defined in RFC 3986 [RFC 3986].
- TNF_EXTERNAL_TYPE = 0x04, ///< NFC Forum external type [NFC RTD].
- TNF_UNKNOWN_TYPE = 0x05, ///< The value indicates that there is no type associated with this record.
- TNF_UNCHANGED = 0x06, ///< The value is used for the record chunks used in chunked payload.
- TNF_RESERVED = 0x07, ///< The value is reserved for future use.
-} nfc_ndef_record_tnf_t;
-
-
-/**
- * @brief NDEF record descriptor.
- */
-typedef struct
-{
- nfc_ndef_record_tnf_t tnf; ///< Value of the Type Name Format (TNF) field.
-
- uint8_t id_length; ///< Length of the ID field. If 0, a record format without ID field is assumed.
- uint8_t const * p_id; ///< Pointer to the ID field data. Not relevant if id_length is 0.
-
- uint8_t type_length; ///< Length of the type field.
- uint8_t const * p_type; ///< Pointer to the type field data. Not relevant if type_length is 0.
-
- p_payload_constructor_t payload_constructor; ///< Pointer to the payload constructor function.
- void * p_payload_descriptor; ///< Pointer to the data for the payload constructor function.
-
-} nfc_ndef_record_desc_t;
-
-/**
- * @brief Record position within the NDEF message.
- *
- * Values to specify the location of a record within the NDEF message.
- */
-typedef enum
-{
- NDEF_FIRST_RECORD = 0x80, ///< First record.
- NDEF_MIDDLE_RECORD = 0x00, ///< Middle record.
- NDEF_LAST_RECORD = 0x40, ///< Last record.
- NDEF_LONE_RECORD = 0xC0 ///< Only one record in the message.
-} nfc_ndef_record_location_t;
-
-#define NDEF_RECORD_LOCATION_MASK (NDEF_LONE_RECORD) ///< Mask of the Record Location bits in the NDEF record's flags byte.
-
-/**
- * @brief Binary data descriptor containing the payload for the record.
- */
-typedef struct
-{
- uint8_t const * p_payload; ///< Pointer to the buffer with the data.
- uint32_t payload_length; ///< Length of data in bytes.
-} nfc_ndef_bin_payload_desc_t;
-
-/**
- * @brief Macro for creating and initializing an NFC NDEF record descriptor for a generic record.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_record_desc_t.
- *
- * Use the macro @ref NFC_NDEF_GENERIC_RECORD_DESC to access the NDEF record descriptor instance.
- *
- * @param[in] NAME Name of the created descriptor instance.
- * @param[in] TNF Type Name Format (TNF) value for the record.
- * @param[in] P_ID Pointer to the ID string.
- * @param[in] ID_LEN Length of the ID string.
- * @param[in] P_TYPE Pointer to the type string.
- * @param[in] TYPE_LEN Length of the type string.
- * @param[in] P_PAYLOAD_CONSTRUCTOR Pointer to the payload constructor function.
- * The constructor must be of type @ref p_payload_constructor_t.
- * @param[in] P_PAYLOAD_DESCRIPTOR Pointer to the data for the payload constructor.
- */
-#define NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
- TNF, \
- P_ID, \
- ID_LEN, \
- P_TYPE, \
- TYPE_LEN, \
- P_PAYLOAD_CONSTRUCTOR, \
- P_PAYLOAD_DESCRIPTOR) \
- static nfc_ndef_record_desc_t NAME##_ndef_generic_record_desc = \
- { \
- .tnf = TNF, \
- \
- .id_length = ID_LEN, \
- .p_id = P_ID, \
- \
- .type_length = TYPE_LEN, \
- .p_type = P_TYPE, \
- \
- .payload_constructor = (p_payload_constructor_t)P_PAYLOAD_CONSTRUCTOR, \
- .p_payload_descriptor = (void *) P_PAYLOAD_DESCRIPTOR \
- }
-
-
-/** @brief Macro for accessing the NFC NDEF record descriptor instance
- * that you created with @ref NFC_NDEF_GENERIC_RECORD_DESC_DEF.
- */
-#define NFC_NDEF_GENERIC_RECORD_DESC(NAME) (NAME##_ndef_generic_record_desc)
-
-/**
- * @brief Macro for creating and initializing an NFC NDEF record descriptor for a record with
- * binary payload.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_record_desc_t and a binary data descriptor containing the payload data.
- *
- * Use the macro @ref NFC_NDEF_RECORD_BIN_DATA to access the NDEF record descriptor instance.
- *
- * @param[in] NAME Name of the created descriptor instance.
- * @param[in] TNF Type Name Format (TNF) value for the record.
- * @param[in] P_ID Pointer to the ID string.
- * @param[in] ID_LEN Length of the ID string.
- * @param[in] P_TYPE Pointer to the type string.
- * @param[in] TYPE_LEN Length of the type string.
- * @param[in] P_PAYLOAD Pointer to the payload data that will be copied to the payload field.
- * @param[in] PAYLOAD_LEN Length of the payload.
- */
-#define NFC_NDEF_RECORD_BIN_DATA_DEF(NAME, \
- TNF, \
- P_ID, ID_LEN, \
- P_TYPE, \
- TYPE_LEN, \
- P_PAYLOAD, \
- PAYLOAD_LEN) \
- static nfc_ndef_bin_payload_desc_t NAME##_nfc_ndef_bin_payload_desc = \
- { \
- .p_payload = P_PAYLOAD, \
- .payload_length = PAYLOAD_LEN \
- }; \
- \
- static nfc_ndef_record_desc_t NAME##_nfc_ndef_bin_record_desc = \
- { \
- .tnf = TNF, \
- \
- .id_length = ID_LEN, \
- .p_id = P_ID, \
- \
- .type_length = TYPE_LEN, \
- .p_type = P_TYPE, \
- \
- .payload_constructor = (p_payload_constructor_t) nfc_ndef_bin_payload_memcopy, \
- .p_payload_descriptor = (void *) &NAME##_nfc_ndef_bin_payload_desc \
- }
-
-
-/** @brief Macro for accessing the NFC NDEF record descriptor instance
- * that you created with @ref NFC_NDEF_RECORD_BIN_DATA_DEF.
- */
-#define NFC_NDEF_RECORD_BIN_DATA(NAME) (NAME##_nfc_ndef_bin_record_desc)
-
-/** @brief Macro for accessing the binary data descriptor that contains
- * the payload of the record that you created with @ref NFC_NDEF_RECORD_BIN_DATA_DEF.
- */
-#define NFC_NDEF_BIN_PAYLOAD_DESC(NAME) (NAME##_nfc_ndef_bin_payload_desc)
-
-/**
- * @brief Function for encoding an NDEF record.
- *
- * This function encodes an NDEF record according to the provided record descriptor.
- *
- * @param[in] p_ndef_record_desc Pointer to the record descriptor.
- * @param[in] record_location Location of the record within the NDEF message.
- * @param[out] p_record_buffer Pointer to the record destination. If NULL, function will
- * calculate the expected size of the record.
- * @param[in,out] p_record_len Size of the available memory for the record as input. Size of the generated
- * record as output.
- *
- * @retval NRF_SUCCESS If the record was encoded successfully.
- * @retval NRF_ERROR_NO_MEM If the predicted record size is bigger than the provided buffer space.
- * @retval NRF_ERROR_INVALID_PARAM If the location of the record is erroneous.
- * @retval Other Other codes might be returned depending on the NDEF record payload constructor implementation.
- */
-ret_code_t nfc_ndef_record_encode(nfc_ndef_record_desc_t const * p_ndef_record_desc,
- nfc_ndef_record_location_t record_location,
- uint8_t * p_record_buffer,
- uint32_t * p_record_len);
-
-/**
- * @brief Function for constructing the payload for an NFC NDEF record from binary data.
- *
- * This function copies data from a binary buffer to the payload field of the NFC NDEF record.
- *
- * @param[in] p_payload_descriptor Pointer to the descriptor of the binary data location and size.
- *
- * @param[out] p_buffer Pointer to the payload destination. If NULL, function will
- * calculate the expected size of the record payload.
- * @param[in,out] p_len Size of the available memory for the payload as input. Size of the copied payload
- * as output.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_NO_MEM If the payload size is bigger than the provided buffer space.
- */
-ret_code_t nfc_ndef_bin_payload_memcopy(nfc_ndef_bin_payload_desc_t * p_payload_descriptor,
- uint8_t * p_buffer,
- uint32_t * p_len);
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_NDEF_RECORD_H__
-
diff --git a/components/nfc/ndef/launchapp/nfc_launchapp_msg.c b/components/nfc/ndef/launchapp/nfc_launchapp_msg.c
deleted file mode 100644
index 2394398..0000000
--- a/components/nfc/ndef/launchapp/nfc_launchapp_msg.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include
-#include "nfc_launchapp_rec.h"
-#include "nfc_launchapp_msg.h"
-#include "nrf_error.h"
-
-/** @brief Function for generating a description of an NFC NDEF launch application message.
- *
- * This function declares and initializes a static instance of an NFC NDEF message description
- * and the NFC NDEF record descriptions that are referenced by this message description.
- *
- * @param[in] p_android_package_name Pointer to the Android package name string.
- * If NULL, the Android Application Record will be skipped.
- * @param[in] android_package_name_length Length of the Android package name.
- * @param[in] p_win_app_id Pointer to the Windows application ID string (GUID).
- * If NULL, the Windows LaunchApp Record will be skipped.
- * @param[in] win_app_id_length Length of the Windows application ID.
- * @param[out] pp_launchapp_msg_desc Pointer to pointer to the NDEF message description.
- *
- * @retval NRF_SUCCESS If the description was successfully created.
- * @retval NRF_ERROR_INVALID_PARAM If both p_android_package_name and windows_application_id were
- * invalid (equal to NULL).
- */
-__STATIC_INLINE ret_code_t nfc_launchapp_msg_declare(uint8_t const * p_android_package_name,
- uint8_t android_package_name_length,
- uint8_t const * p_win_app_id,
- uint8_t win_app_id_length,
- nfc_ndef_msg_desc_t ** pp_launchapp_msg_desc)
-{
-
- uint32_t err_code;
-
- nfc_ndef_record_desc_t * p_win_rec, * p_android_rec;
-
- /* Create NFC NDEF message description, capacity - 2 records */
- NFC_NDEF_MSG_DEF(nfc_launchapp_msg, 2);
-
- /* The message description is static, therefore you must */
- /* clear the message (needed for supporting multiple calls). */
- nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_launchapp_msg));
-
- if (p_win_app_id != NULL)
- {
- /* Create NFC NDEF Windows Phone LaunchApp Record description */
- p_win_rec = nfc_windows_launchapp_rec_declare(p_win_app_id,
- win_app_id_length);
-
- /* Add Windows LaunchApp record as first record to message */
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_launchapp_msg), p_win_rec);
-
- if (err_code != NRF_SUCCESS)
- return err_code;
- }
-
- if (p_android_package_name != NULL)
- {
- /* Create NFC NDEF Android Application Record description */
- p_android_rec = nfc_android_application_rec_declare(p_android_package_name,
- android_package_name_length);
-
- /* Add Android App Record as second record to message */
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_launchapp_msg), p_android_rec);
-
- if (err_code != NRF_SUCCESS)
- return err_code;
- }
-
- if (NFC_NDEF_MSG(nfc_launchapp_msg).record_count == 0)
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- *pp_launchapp_msg_desc = &NFC_NDEF_MSG(nfc_launchapp_msg);
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_launchapp_msg_encode(uint8_t const * p_android_package_name,
- uint8_t android_package_name_length,
- uint8_t const * p_win_app_id,
- uint8_t win_app_id_length,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- nfc_ndef_msg_desc_t * p_launchapp_msg_desc;
- ret_code_t err_code;
-
- err_code = nfc_launchapp_msg_declare(p_android_package_name,
- android_package_name_length,
- p_win_app_id,
- win_app_id_length,
- &p_launchapp_msg_desc);
-
- if (err_code != NRF_SUCCESS)
- return err_code;
-
- /* Encode whole message into buffer */
- err_code = nfc_ndef_msg_encode(p_launchapp_msg_desc,
- p_buf,
- p_len);
-
- return err_code;
-}
-
-
diff --git a/components/nfc/ndef/launchapp/nfc_launchapp_msg.h b/components/nfc/ndef/launchapp/nfc_launchapp_msg.h
deleted file mode 100644
index db9cebe..0000000
--- a/components/nfc/ndef/launchapp/nfc_launchapp_msg.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_LAUNCHAPP_MSG_H__
-#define NFC_LAUNCHAPP_MSG_H__
-
-/** @file
- *
- * @defgroup nfc_launch_app_msg Launch app messages
- * @{
- * @ingroup nfc_ndef_messages
- *
- * @brief Generation of NFC NDEF messages that can be used to launch apps.
- *
- */
-
-#include
-#include "nfc_ndef_msg.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/** @brief Function for encoding an NFC NDEF launch app message.
- *
- * This function encodes an NFC NDEF message into a buffer.
- *
- * @param[in] p_android_package_name Pointer to the Android package name string.
- * If NULL, the Android Application Record will be skipped.
- * @param[in] android_package_name_length Length of the Android package name.
- * @param[in] p_win_app_id Pointer to the Windows application ID string (GUID).
- * If NULL, the Windows LaunchApp record will be skipped.
- * @param[in] win_app_id_length Length of the Windows application ID.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the description was successfully created.
- * @retval NRF_ERROR_INVALID_PARAM If both p_android_package_name and windows_application_id were
- * invalid (equal to NULL).
- * @retval NRF_ERROR_NO_MEM If the predicted message size is bigger than the provided
- * buffer space.
- * @retval Other Other codes might be returned depending on
- * the function @ref nfc_ndef_msg_encode
- */
-ret_code_t nfc_launchapp_msg_encode(uint8_t const * p_android_package_name,
- uint8_t android_package_name_length,
- uint8_t const * p_win_app_id,
- uint8_t win_app_id_length,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
- #endif // NFC_LAUNCHAPP_MSG_H__
-
-
diff --git a/components/nfc/ndef/launchapp/nfc_launchapp_rec.c b/components/nfc/ndef/launchapp/nfc_launchapp_rec.c
deleted file mode 100644
index b49f14e..0000000
--- a/components/nfc/ndef/launchapp/nfc_launchapp_rec.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include "nrf_error.h"
-#include "app_util.h"
-#include "nfc_ndef_record.h"
-
-/**
- * @brief Type of description of payload of Windows LaunchApp record.
- */
-typedef struct
-{
- const uint8_t * platform;
- uint8_t platform_length;
- const uint8_t * app_id;
- uint8_t app_id_length;
-} win_launchapp_payload_desc_t;
-
-/** @brief Description of payload of Windows LaunchApp record. */
-static win_launchapp_payload_desc_t m_win_launchapp_dsc;
-
-static const uint8_t launchapp_type_str[] = {'a', 'n', 'd', 'r', 'o', 'i', 'd', '.', 'c', 'o', 'm',
- ':', 'p', 'k', 'g'};
-
-static const uint8_t win_launchapp_type_str[] = {'w', 'i', 'n', 'd', 'o', 'w', 's', '.', 'c', 'o',
- 'm', '/', 'L', 'a', 'u', 'n', 'c', 'h', 'A', 'p',
- 'p'};
-
-static const uint8_t win_phone_str[] = {'W', 'i', 'n', 'd', 'o', 'w', 's', 'P', 'h', 'o', 'n', 'e'};
-
-nfc_ndef_record_desc_t * nfc_android_application_rec_declare(uint8_t const * p_package_name,
- uint8_t package_name_length)
-{
- NFC_NDEF_RECORD_BIN_DATA_DEF(android_app_rec,
- TNF_EXTERNAL_TYPE, // tnf <- external
- NULL, // no id
- 0, // no id
- launchapp_type_str,
- sizeof(launchapp_type_str),
- NULL,
- 0);
-
- NFC_NDEF_BIN_PAYLOAD_DESC(android_app_rec).p_payload = p_package_name;
- NFC_NDEF_BIN_PAYLOAD_DESC(android_app_rec).payload_length = package_name_length;
-
- return &NFC_NDEF_RECORD_BIN_DATA(android_app_rec);
-}
-
-#define WIN_LAUNCHAPP_EMPTY_PARAMETER 0x20 ///< The empty parameter value for the Windows LaunchApp Record.
-
-/**
- * @brief Function for constructing the payload for a Windows LaunchApp record.
- *
- * This function encodes the payload according to the LaunchApp record definition. It implements an API
- * compatible with p_payload_constructor_t.
- *
- * @param[in] p_input Pointer to the description of the payload.
- * @param[out] p_buff Pointer to payload destination. If NULL, function will
- * calculate the expected size of the LaunchApp record payload.
- *
- * @param[in,out] p_len Size of available memory to write as input. Size of generated
- * payload as output.
- *
- * @retval NRF_SUCCESS Always success.
- */
-static ret_code_t nfc_win_launchapp_payload_constructor(win_launchapp_payload_desc_t * p_input,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
-
- win_launchapp_payload_desc_t * launch_desc = (win_launchapp_payload_desc_t *) p_input;
-
- uint32_t temp_len = (uint32_t)launch_desc->platform_length + launch_desc->app_id_length + 7;
-
- if (p_buff != NULL)
- {
- if (temp_len > *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- *p_buff++ = 0x00; // platform count: 1
- *p_buff++ = 0x01; // -||-
-
- *p_buff++ = launch_desc->platform_length;
- memcpy(p_buff, launch_desc->platform, launch_desc->platform_length); // platform
- p_buff += launch_desc->platform_length;
-
-
- *p_buff++ = launch_desc->app_id_length;
- memcpy(p_buff, launch_desc->app_id, launch_desc->app_id_length);
- p_buff += launch_desc->app_id_length;
-
- *p_buff++ = 0x00; // parameters length 1B
- *p_buff++ = 0x01; // -||-
- *p_buff++ = WIN_LAUNCHAPP_EMPTY_PARAMETER; // empty parameter
- }
-
- *p_len = temp_len;
-
- return NRF_SUCCESS;
-}
-
-
-nfc_ndef_record_desc_t * nfc_windows_launchapp_rec_declare(const uint8_t * p_win_app_id,
- uint8_t win_app_id_length)
-{
-
- NFC_NDEF_GENERIC_RECORD_DESC_DEF(win_launchapp,
- TNF_ABSOLUTE_URI,
- NULL,
- 0,
- win_launchapp_type_str,
- sizeof(win_launchapp_type_str),
- nfc_win_launchapp_payload_constructor,
- &m_win_launchapp_dsc);
-
- m_win_launchapp_dsc.platform = win_phone_str;
- m_win_launchapp_dsc.platform_length = sizeof(win_phone_str);
-
- m_win_launchapp_dsc.app_id = p_win_app_id;
- m_win_launchapp_dsc.app_id_length = win_app_id_length;
-
- return &NFC_NDEF_GENERIC_RECORD_DESC(win_launchapp);
-}
-
-
diff --git a/components/nfc/ndef/launchapp/nfc_launchapp_rec.h b/components/nfc/ndef/launchapp/nfc_launchapp_rec.h
deleted file mode 100644
index a57de77..0000000
--- a/components/nfc/ndef/launchapp/nfc_launchapp_rec.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_LAUNCHAPP_REC_H__
-#define NFC_LAUNCHAPP_REC_H__
-
-/**@file
- *
- * @defgroup nfc_launch_app_rec Launch app records
- * @{
- * @ingroup nfc_launch_app_msg
- *
- * @brief Generation of NFC NDEF record descriptions that launch apps.
- *
- */
-
-#include
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Function for generating a description of an NFC NDEF Android Application Record (AAR).
- *
- * This function declares and initializes a static instance of an NFC NDEF record description
- * of an Android Application Record (AAR).
- *
- * @note The record payload data (@p p_package_name) should be declared as
- * static. If it is declared as automatic, the NDEF message encoding
- * (see @ref nfc_ndef_msg_encode) must be done in the same variable
- * scope.
- *
- * @param[in] p_package_name Pointer to the Android package name string.
- * @param[in] package_name_length Length of the Android package name.
- *
- * @return Pointer to the description of the record.
- */
-nfc_ndef_record_desc_t * nfc_android_application_rec_declare(uint8_t const * p_package_name,
- uint8_t package_name_length);
-
-/** @brief Function for generating a description of an NFC NDEF Windows LaunchApp record.
- *
- * This function declares and initializes a static instance of an NFC NDEF record description
- * of a Windows LaunchApp record.
- *
- * @note The record payload data (@p p_win_app_id) should be declared as
- * static. If it is declared as automatic, the NDEF message encoding
- * (see @ref nfc_ndef_msg_encode) must be done in the same variable
- * scope.
- *
- * @param[in] p_win_app_id Pointer to the Windows application ID string (GUID).
- * @param[in] win_app_id_length Length of the Windows application ID.
- *
- * @return Pointer to the description of the record.
- */
-nfc_ndef_record_desc_t * nfc_windows_launchapp_rec_declare(const uint8_t * p_win_app_id,
- uint8_t win_app_id_length);
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_LAUNCHAPP_REC
diff --git a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.c b/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.c
deleted file mode 100644
index c83ec83..0000000
--- a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(NFC_NDEF_MSG_PARSER)
-
-#include "nfc_ndef_msg_parser.h"
-#include "nrf_delay.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_NDEF_MSG_PARSER"
-#if NFC_NDEF_MSG_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_NDEF_MSG_PARSER_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_NDEF_MSG_PARSER_INFO_COLOR
-#else // NFC_NDEF_MSG_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_NDEF_MSG_PARSER_LOG_ENABLED
-#include "nrf_log.h"
-
-ret_code_t ndef_msg_parser(uint8_t * const p_result_buf,
- uint32_t * const p_result_buf_len,
- uint8_t * const p_nfc_data,
- uint32_t * const p_nfc_data_len)
-{
- ret_code_t ret_code;
- nfc_ndef_parser_memo_desc_t parser_memory_helper;
-
- ret_code = ndef_parser_memo_resolve(p_result_buf,
- p_result_buf_len,
- &parser_memory_helper);
-
- if (ret_code != NRF_SUCCESS)
- {
- return ret_code;
- }
-
- ret_code = internal_ndef_msg_parser(&parser_memory_helper,
- p_nfc_data,
- p_nfc_data_len);
-
- return ret_code;
-}
-
-
-void ndef_msg_printout(nfc_ndef_msg_desc_t * const p_msg_desc)
-{
- uint32_t i;
-
- nrf_delay_ms(100);
- NRF_LOG_INFO("NDEF message contains %d record(s)\r\n\r\n", p_msg_desc->record_count);
-
- for (i = 0; i < p_msg_desc->record_count; i++)
- {
- ndef_record_printout(i, p_msg_desc->pp_record[i]);
- }
-}
-
-#endif // NRF_MODULE_ENABLED(NFC_NDEF_MSG_PARSER)
diff --git a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.h b/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.h
deleted file mode 100644
index 2fdc155..0000000
--- a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_NDEF_MSG_PARSER_H__
-#define NFC_NDEF_MSG_PARSER_H__
-
-/**@file
- *
- * @defgroup nfc_ndef_parser NDEF message parser
- * @{
- * @ingroup nfc_modules
- *
- * @brief Parser for NFC NDEF messages and records.
- *
- * @defgroup nfc_ndef_msg_parser Parser for NDEF messages
- * @{
- * @ingroup nfc_ndef_parser
- *
- * @brief Parser for NFC NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_msg_parser_local.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Macro for calculating the memory size required for holding the
- * description of a message that consists of a certain number of NDEF records.
- *
- * @param[in] max_count_of_records Maximum number of records to hold.
- */
-#define NFC_NDEF_PARSER_REQIRED_MEMO_SIZE_CALC(max_count_of_records) \
- ((uint32_t)(max_count_of_records) <= 1) ? \
- (sizeof(parsed_ndef_msg_1_t) * (uint32_t)(max_count_of_records)) : \
- (sizeof(parsed_ndef_msg_1_t) + ((NFC_PARSER_M_DELTA) *((uint32_t)(max_count_of_records) - 1)))
-
-/**
- * @brief Function for parsing NFC NDEF messages.
- *
- * This function parses NDEF messages using NDEF binary record descriptors.
- *
- * @param[out] p_result_buf Pointer to the buffer that will be used to hold
- * the NDEF message descriptor. After parsing is completed successfully, the first address
- * in the buffer is filled by the NDEF message descriptor
- * (@ref nfc_ndef_msg_desc_t), which provides a full description of
- * the parsed NDEF message.
- * @param[in,out] p_result_buf_len As input: size of the buffer specified by @p p_result_buf.
- * As output: size of the reserved (used) part of the buffer specified by
- * @p p_result_buf.
- * @param[in] p_nfc_data Pointer to the data to be parsed.
- * @param[in,out] p_nfc_data_len As input: size of the NFC data in the @p p_nfc_data buffer. As output: size of the parsed message.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_NO_MEM If the provided buffer is too small to hold a one-record message or
- * the buffer is too small to hold the actual result of the parsing.
- * @retval NRF_ERROR_INVALID_LENGTH If the expected message length is bigger than the amount of the provided input data.
- * @retval NRF_ERROR_INVALID_DATA If the message is not a valid NDEF message.
- */
-ret_code_t ndef_msg_parser(uint8_t * const p_result_buf,
- uint32_t * const p_result_buf_len,
- uint8_t * const p_nfc_data,
- uint32_t * const p_nfc_data_len);
-
-/**
- * @brief Function for printing the parsed contents of an NDEF message.
- *
- * @param[in] p_msg_desc Pointer to the descriptor of the message that should be printed.
- */
-void ndef_msg_printout(nfc_ndef_msg_desc_t * const p_msg_desc);
-
-/**
- * @}
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_NDEF_MSG_PARSER_H__
-
-
diff --git a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.c b/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.c
deleted file mode 100644
index 06b1103..0000000
--- a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(NFC_NDEF_MSG_PARSER)
-
-#include "nfc_ndef_msg_parser_local.h"
-
-ret_code_t internal_ndef_msg_parser(nfc_ndef_parser_memo_desc_t * const p_parser_memo_desc,
- uint8_t const * p_nfc_data,
- uint32_t * const p_nfc_data_len)
-{
- nfc_ndef_record_location_t record_location;
-
- ret_code_t ret_code;
-
- uint32_t nfc_data_left = *p_nfc_data_len;
- uint32_t temp_nfc_data_len = 0;
-
- // want to modify -> use local copy
- nfc_ndef_bin_payload_desc_t * p_bin_pay_desc = p_parser_memo_desc->p_bin_pay_desc;
- nfc_ndef_record_desc_t * p_rec_desc = p_parser_memo_desc->p_rec_desc;
-
-
- while (nfc_data_left > 0)
- {
- temp_nfc_data_len = nfc_data_left;
-
- ret_code = ndef_record_parser(p_bin_pay_desc,
- p_rec_desc,
- &record_location,
- p_nfc_data,
- &temp_nfc_data_len);
-
- if (ret_code != NRF_SUCCESS)
- {
- return ret_code;
- }
-
- // verify the records location flags
- if (p_parser_memo_desc->p_msg_desc->record_count == 0)
- {
- if ((record_location != NDEF_FIRST_RECORD) && (record_location != NDEF_LONE_RECORD))
- {
- return NRF_ERROR_INVALID_DATA;
- }
- }
- else
- {
- if ((record_location != NDEF_MIDDLE_RECORD) && (record_location != NDEF_LAST_RECORD))
- {
- return NRF_ERROR_INVALID_DATA;
- }
- }
-
- ret_code = nfc_ndef_msg_record_add(p_parser_memo_desc->p_msg_desc, p_rec_desc);
-
- if (ret_code != NRF_SUCCESS)
- {
- return ret_code;
- }
-
- nfc_data_left -= temp_nfc_data_len;
-
- if ((record_location == NDEF_LAST_RECORD) || (record_location == NDEF_LONE_RECORD))
- {
- *p_nfc_data_len = *p_nfc_data_len - nfc_data_left;
- return NRF_SUCCESS;
- }
- else
- {
- if (p_parser_memo_desc->p_msg_desc->record_count ==
- p_parser_memo_desc->p_msg_desc->max_record_count)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- p_nfc_data += temp_nfc_data_len;
- p_bin_pay_desc++;
- p_rec_desc++;
- }
- }
-
- return NRF_ERROR_INVALID_DATA;
-
-}
-
-
-ret_code_t ndef_parser_memo_resolve(uint8_t * const p_result_buf,
- uint32_t * const p_result_buf_len,
- nfc_ndef_parser_memo_desc_t * const p_parser_memo_desc)
-{
-
- uint32_t max_rec_num;
- uint32_t memory_last;
- uint8_t * p_end;
- nfc_ndef_record_desc_t * * pp_record_desc_array;
-
- if (*p_result_buf_len < sizeof(parsed_ndef_msg_1_t))
- {
- return NRF_ERROR_NO_MEM;
- }
-
- memory_last = (*p_result_buf_len) - sizeof(parsed_ndef_msg_1_t);
- max_rec_num = (memory_last / (NFC_PARSER_M_DELTA)) + 1;
-
- p_parser_memo_desc->p_msg_desc = (nfc_ndef_msg_desc_t *) p_result_buf;
- pp_record_desc_array =
- (nfc_ndef_record_desc_t * *) &p_parser_memo_desc->p_msg_desc[1];
- p_parser_memo_desc->p_bin_pay_desc =
- (nfc_ndef_bin_payload_desc_t *) &pp_record_desc_array[max_rec_num];
- p_parser_memo_desc->p_rec_desc =
- (nfc_ndef_record_desc_t *) &p_parser_memo_desc->p_bin_pay_desc[max_rec_num];
-
- // initialize message description
- p_parser_memo_desc->p_msg_desc->pp_record = pp_record_desc_array;
- p_parser_memo_desc->p_msg_desc->max_record_count = max_rec_num;
- p_parser_memo_desc->p_msg_desc->record_count = 0;
-
- p_end = (uint8_t *) &p_parser_memo_desc->p_rec_desc[max_rec_num];
-
- *p_result_buf_len = p_end - p_result_buf;
-
- return NRF_SUCCESS;
-}
-
-#endif // NRF_MODULE_ENABLED(NFC_NDEF_MSG_PARSER)
diff --git a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.h b/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.h
deleted file mode 100644
index a46b0bc..0000000
--- a/components/nfc/ndef/parser/message/nfc_ndef_msg_parser_local.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef NFC_NDEF_MSG_PARSER_LOCAL_H__
-#define NFC_NDEF_MSG_PARSER_LOCAL_H__
-
-/**@file
- *
- * @defgroup nfc_ndef_msg_parser_local NDEF message parser (internal)
- * @{
- * @ingroup nfc_ndef_msg_parser
- *
- * @brief Internal part of the parser for NFC NDEF messages.
- *
- */
-
-#include
-#include "nfc_ndef_msg.h"
-#include "nfc_ndef_record_parser.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Type for holding descriptors that are used by the NDEF parser.
- */
-typedef struct
-{
- nfc_ndef_msg_desc_t * p_msg_desc; ///< Pointer to the message descriptor.
- nfc_ndef_bin_payload_desc_t * p_bin_pay_desc; ///< Pointer to the array of binary payload descriptors.
- nfc_ndef_record_desc_t * p_rec_desc; ///< Pointer to the array of record descriptors.
-} nfc_ndef_parser_memo_desc_t;
-
-/**
- * @brief Memory allocated for a one-record message.
- */
-typedef struct
-{
- nfc_ndef_msg_desc_t msg_desc;
- nfc_ndef_record_desc_t * p_record_desc_array[1];
- nfc_ndef_bin_payload_desc_t bin_pay_desc[1];
- nfc_ndef_record_desc_t rec_desc[1];
-} parsed_ndef_msg_1_t;
-
-/**
- * @brief Memory allocated for a two-record message.
- */
-typedef struct
-{
- nfc_ndef_msg_desc_t msg_desc;
- nfc_ndef_record_desc_t * p_record_desc_array[2];
- nfc_ndef_bin_payload_desc_t bin_pay_desc[2];
- nfc_ndef_record_desc_t rec_desc[2];
-} parsed_ndef_msg_2_t;
-
-/**
- * @brief Amount of memory that is required per record in addition to the memory allocated for the message descriptor.
- */
-#define NFC_PARSER_M_DELTA (sizeof(parsed_ndef_msg_2_t) - sizeof(parsed_ndef_msg_1_t))
-
-
-/**
- * @brief Function for resolving data instances in the provided buffer according
- * to requirements of the function @ref internal_ndef_msg_parser.
- *
- * This internal function distributes the provided memory between certain data instances that are required
- * by @ref internal_ndef_msg_parser.
- *
- * This function should not be used directly.
- *
- * @param[in] p_result_buf Pointer to the buffer that will be used to allocate
- * data instances.
- * @param[in,out] p_result_buf_len As input: size of the buffer specified by @p p_result_buf.
- * As output: size of the reserved (used) part of the buffer specified by
- * @p p_result_buf.
- * @param[out] p_parser_memo_desc Pointer to the structure for holding descriptors of the allocated data
- * instances.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_NO_MEM If the provided buffer is too small to hold a one-record message.
- */
-ret_code_t ndef_parser_memo_resolve(uint8_t * const p_result_buf,
- uint32_t * const p_result_buf_len,
- nfc_ndef_parser_memo_desc_t * const p_parser_memo_desc);
-
-
-/**
- * @brief Function for parsing NFC NDEF messages.
- *
- * This internal function parses NDEF messages into certain data instances.
- *
- * This function should not be used directly.
- *
- * @param[in,out] p_parser_memo_desc Pointer to the structure that holds descriptors of the allocated data
- * instances for the parser. This structure contains the following fields: @n
- * .p_msg_desc Pointer to the message descriptor that will
- * be filled with parsed data. @n
- * .p_bin_pay_desc Pointer to the array of binary payload
- * descriptors that will be filled with parsed
- * data. @n
- * .p_rec_desc Pointer to the array of record descriptors
- * that will be filled with parsed data. @n
- * The arrays specified by @p .p_bin_pay_desc and @p .p_rec_desc must not
- * contain more elements than the message descriptor
- * specified by \p .p_msg_desc can hold.
- *
- * @param[in] p_nfc_data Pointer to the data to be parsed.
- * @param[in,out] p_nfc_data_len As input: size of the NFC data in the @p p_nfc_data buffer.
- * As output: size of the parsed message.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_INVALID_LENGTH If the expected message length is bigger than the amount of provided input data.
- * @retval NRF_ERROR_INVALID_DATA If the message is not a valid NDEF message.
- * @retval NRF_ERROR_NO_MEM If the provided memory resources are too small to hold the parsing result.
- */
-ret_code_t internal_ndef_msg_parser(nfc_ndef_parser_memo_desc_t * const p_parser_memo_desc,
- uint8_t const * p_nfc_data,
- uint32_t * const p_nfc_data_len);
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_NDEF_MSG_PARSER_LOCAL_H__
diff --git a/components/nfc/ndef/parser/record/nfc_ndef_record_parser.c b/components/nfc/ndef/parser/record/nfc_ndef_record_parser.c
deleted file mode 100644
index f21f0ff..0000000
--- a/components/nfc/ndef/parser/record/nfc_ndef_record_parser.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(NFC_NDEF_RECORD_PARSER)
-
-#include
-#include
-#include "nfc_ndef_record_parser.h"
-#include "app_util.h"
-#include "nordic_common.h"
-#include "nrf_delay.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_NDEF_PARSER"
-#if NFC_NDEF_RECORD_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_NDEF_RECORD_PARSER_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_NDEF_RECORD_PARSER_INFO_COLOR
-#else // NFC_NDEF_RECORD_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_NDEF_RECORD_PARSER_LOG_ENABLED
-#include "nrf_log.h"
-
-/* Sum of sizes of fields: TNF-flags, Type Length, Payload Length in short NDEF record. */
-#define NDEF_RECORD_BASE_LONG_SHORT (2 + NDEF_RECORD_PAYLOAD_LEN_SHORT_SIZE)
-
-
-ret_code_t ndef_record_parser(nfc_ndef_bin_payload_desc_t * p_bin_pay_desc,
- nfc_ndef_record_desc_t * p_rec_desc,
- nfc_ndef_record_location_t * p_record_location,
- uint8_t const * p_nfc_data,
- uint32_t * p_nfc_data_len)
-{
- uint32_t expected_rec_size = NDEF_RECORD_BASE_LONG_SHORT;
-
- if (expected_rec_size > *p_nfc_data_len)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- p_rec_desc->tnf = (nfc_ndef_record_tnf_t) ((*p_nfc_data) & NDEF_RECORD_TNF_MASK);
-
- /* An NDEF parser that receives an NDEF record with an unknown or unsupported TNF field value
- SHOULD treat it as Unknown. See NFCForum-TS-NDEF_1.0 */
- if (p_rec_desc->tnf == TNF_RESERVED)
- {
- p_rec_desc->tnf = TNF_UNKNOWN_TYPE;
- }
-
- *p_record_location = (nfc_ndef_record_location_t) ((*p_nfc_data) & NDEF_RECORD_LOCATION_MASK);
-
- uint8_t flags = *(p_nfc_data++);
-
- p_rec_desc->type_length = *(p_nfc_data++);
-
- uint32_t payload_lenght;
-
- if (flags & NDEF_RECORD_SR_MASK)
- {
- payload_lenght = *(p_nfc_data++);
- }
- else
- {
- expected_rec_size +=
- NDEF_RECORD_PAYLOAD_LEN_LONG_SIZE - NDEF_RECORD_PAYLOAD_LEN_SHORT_SIZE;
-
- if (expected_rec_size > *p_nfc_data_len)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- payload_lenght = uint32_big_decode(p_nfc_data);
- p_nfc_data += NDEF_RECORD_PAYLOAD_LEN_LONG_SIZE;
- }
-
- if (flags & NDEF_RECORD_IL_MASK)
- {
- expected_rec_size += NDEF_RECORD_ID_LEN_SIZE;
-
- if (expected_rec_size > *p_nfc_data_len)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- p_rec_desc->id_length = *(p_nfc_data++);
- }
- else
- {
- p_rec_desc->id_length = 0;
- p_rec_desc->p_id = NULL;
- }
-
- expected_rec_size += p_rec_desc->type_length + p_rec_desc->id_length + payload_lenght;
-
- if (expected_rec_size > *p_nfc_data_len)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- if (p_rec_desc->type_length > 0)
- {
- p_rec_desc->p_type = p_nfc_data;
-
- p_nfc_data += p_rec_desc->type_length;
- }
- else
- {
- p_rec_desc->p_type = NULL;
- }
-
- if (p_rec_desc->id_length > 0)
- {
- p_rec_desc->p_id = p_nfc_data;
-
- p_nfc_data += p_rec_desc->id_length;
- }
-
- if (payload_lenght == 0)
- {
- p_bin_pay_desc->p_payload = NULL;
- }
- else
- {
- p_bin_pay_desc->p_payload = p_nfc_data;
- }
-
- p_bin_pay_desc->payload_length = payload_lenght;
-
- p_rec_desc->p_payload_descriptor = p_bin_pay_desc;
- p_rec_desc->payload_constructor = (p_payload_constructor_t) nfc_ndef_bin_payload_memcopy;
-
- *p_nfc_data_len = expected_rec_size;
-
- return NRF_SUCCESS;
-}
-
-char const * const tnf_strings[] =
-{
- "Empty\r\n",
- "NFC Forum well-known type\r\n",
- "Media-type (RFC 2046)\r\n",
- "Absolute URI (RFC 3986)\r\n",
- "NFC Forum external type (NFC RTD)\r\n",
- "Unknown\r\n",
- "Unchanged\r\n",
- "Reserved\r\n"
-};
-
-void ndef_record_printout(uint32_t num, nfc_ndef_record_desc_t * const p_rec_desc)
-{
- NRF_LOG_INFO("NDEF record %d content:\r\n", num);
- NRF_LOG_INFO("TNF: %s",(uint32_t)tnf_strings[p_rec_desc->tnf]);
-
- if (p_rec_desc->p_id != NULL)
- {
- NRF_LOG_INFO("ID:\r\n");
- NRF_LOG_HEXDUMP_INFO((uint8_t *)p_rec_desc->p_id, p_rec_desc->id_length);
- }
-
- if (p_rec_desc->p_type != NULL)
- {
- NRF_LOG_INFO("type:\r\n");
- NRF_LOG_HEXDUMP_INFO((uint8_t *)p_rec_desc->p_type, p_rec_desc->type_length);
- }
-
- if (p_rec_desc->payload_constructor == (p_payload_constructor_t) nfc_ndef_bin_payload_memcopy)
- {
- nfc_ndef_bin_payload_desc_t * p_bin_pay_desc = p_rec_desc->p_payload_descriptor;
-
- if (p_bin_pay_desc->p_payload != NULL)
- {
- NRF_LOG_INFO("Payload data (%d bytes):\r\n", p_bin_pay_desc->payload_length);
- NRF_LOG_HEXDUMP_INFO((uint8_t *)p_bin_pay_desc->p_payload, p_bin_pay_desc->payload_length);
- }
- else
- {
- NRF_LOG_INFO("No payload\r\n");
- }
- }
- NRF_LOG_INFO("\r\n\r\n");
-}
-
-#endif // NRF_MODULE_ENABLED(NFC_NDEF_RECORD_PARSER)
diff --git a/components/nfc/ndef/parser/record/nfc_ndef_record_parser.h b/components/nfc/ndef/parser/record/nfc_ndef_record_parser.h
deleted file mode 100644
index 39f2c46..0000000
--- a/components/nfc/ndef/parser/record/nfc_ndef_record_parser.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_NDEF_RECORD_PARSER_H__
-#define NFC_NDEF_RECORD_PARSER_H__
-
-#include
-#include "sdk_errors.h"
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@file
- *
- * @defgroup nfc_ndef_record_parser Parser for NDEF records
- * @{
- * @ingroup nfc_ndef_parser
- *
- * @brief Parser for NFC NDEF records.
- *
- */
-
-
-/**
- * @brief Function for parsing NDEF records.
- *
- * This parsing implementation uses the binary payload descriptor (@ref nfc_ndef_bin_payload_desc_t) to describe the payload for the record.
- *
- * @param[out] p_bin_pay_desc Pointer to the binary payload descriptor that will be filled and referenced by the record descriptor.
- * @param[out] p_rec_desc Pointer to the record descriptor that will be filled with parsed data.
- * @param[out] p_record_location Pointer to the record location.
- * @param[in] p_nfc_data Pointer to the raw data to be parsed.
- * @param[in,out] p_nfc_data_len As input: size of the NFC data in the @p p_nfc_data buffer. As output: size of the parsed record.
- *
- * @retval NRF_SUCCESS If the function completed successfully.
- * @retval NRF_ERROR_INVALID_LENGTH If the expected record length is bigger than the provided input data amount.
- */
-ret_code_t ndef_record_parser(nfc_ndef_bin_payload_desc_t * p_bin_pay_desc,
- nfc_ndef_record_desc_t * p_rec_desc,
- nfc_ndef_record_location_t * p_record_location,
- uint8_t const * p_nfc_data,
- uint32_t * p_nfc_data_len);
-
-/**
- * @brief Function for printing the parsed contents of the NDEF record.
- *
- * @param[in] num Sequence number of the record within the NDEF message.
- * @param[in] p_rec_desc Pointer to the descriptor of the record that should be printed.
- *
- */
-void ndef_record_printout(uint32_t num, nfc_ndef_record_desc_t * const p_rec_desc);
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_NDEF_RECORD_PARSER_H__
diff --git a/components/nfc/ndef/text/nfc_text_rec.c b/components/nfc/ndef/text/nfc_text_rec.c
deleted file mode 100644
index 0f7d479..0000000
--- a/components/nfc/ndef/text/nfc_text_rec.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include "nfc_text_rec.h"
-#include "nrf_error.h"
-
-#define TEXT_REC_STATUS_SIZE 1 ///< Size of the status.
-#define TEXT_REC_STATUS_UTF_POS 7 ///< Position of a character encoding type.
-#define TEXT_REC_RESERVED_POS 6 ///< Reserved position.
-
-const uint8_t nfc_text_rec_type_field[] = {'T'};
-
-
-/**
- * @brief Function for calculating payload size.
- */
-__STATIC_INLINE uint32_t nfc_text_rec_payload_size_get(nfc_text_rec_payload_desc_t * p_nfc_rec_text_payload_desc)
-{
- return (TEXT_REC_STATUS_SIZE
- + p_nfc_rec_text_payload_desc->lang_code_len
- + p_nfc_rec_text_payload_desc->data_len);
-}
-
-ret_code_t nfc_text_rec_payload_constructor(nfc_text_rec_payload_desc_t * p_nfc_rec_text_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- if ((p_nfc_rec_text_payload_desc->lang_code_len == 0)
- || (p_nfc_rec_text_payload_desc->lang_code_len & (1 << TEXT_REC_RESERVED_POS))
- || (p_nfc_rec_text_payload_desc->lang_code_len & (1 << TEXT_REC_STATUS_UTF_POS))
- || (p_nfc_rec_text_payload_desc->p_lang_code == NULL)
- || (p_nfc_rec_text_payload_desc->data_len == 0)
- || (p_nfc_rec_text_payload_desc->p_data == NULL)
- || (p_len == NULL))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- uint32_t payload_size = nfc_text_rec_payload_size_get(p_nfc_rec_text_payload_desc);
-
- if (p_buff != NULL)
- {
- if (payload_size > *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- *p_buff = (p_nfc_rec_text_payload_desc->lang_code_len
- + (p_nfc_rec_text_payload_desc->utf << TEXT_REC_STATUS_UTF_POS));
- p_buff += TEXT_REC_STATUS_SIZE;
-
- memcpy(p_buff,
- p_nfc_rec_text_payload_desc->p_lang_code,
- p_nfc_rec_text_payload_desc->lang_code_len);
- p_buff += p_nfc_rec_text_payload_desc->lang_code_len;
-
- memcpy(p_buff,
- p_nfc_rec_text_payload_desc->p_data,
- p_nfc_rec_text_payload_desc->data_len);
- }
-
- *p_len = payload_size;
-
- return NRF_SUCCESS;
-}
-
-
diff --git a/components/nfc/ndef/text/nfc_text_rec.h b/components/nfc/ndef/text/nfc_text_rec.h
deleted file mode 100644
index 80268ee..0000000
--- a/components/nfc/ndef/text/nfc_text_rec.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_TEXT_REC_H__
-#define NFC_TEXT_REC_H__
-
-/**@file
- *
- * @defgroup nfc_text_rec Text records
- * @{
- * @ingroup nfc_ndef_messages
- *
- * @brief Generation of NFC NDEF Text record descriptions.
- *
- */
-
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Type of the Unicode Transformation Format.
- *
- * Values to specify the type of UTF for an NFC NDEF Text record.
- */
-typedef enum
-{
- UTF_8 = 0, ///< Unicode Transformation Format 8.
- UTF_16 = 1, ///< Unicode Transformation Format 16.
-} nfc_text_rec_utf_type_t;
-
-/**
- * @brief Text record payload descriptor.
- */
-typedef struct
-{
- nfc_text_rec_utf_type_t utf; ///< Type of the Unicode Transformation Format.
-
- uint8_t const * p_lang_code; ///< Pointer to the IANA language code.
- uint8_t lang_code_len; ///< Length of the IANA language code.
-
- uint8_t const * p_data; ///< Pointer to the user text.
- uint32_t data_len; ///< Length of the user text.
-} nfc_text_rec_payload_desc_t;
-
-/**
- * @brief Constructor for an NFC NDEF Text record payload.
- *
- * @param[in] p_nfc_rec_text_payload_desc Pointer to the Text record description.
- * @param[out] p_buff Pointer to the payload destination. If NULL, function will
- * calculate the expected size of the Text record payload.
- *
- * @param[in,out] p_len Size of the available memory to write as input.
- * Size of the generated record payload as output.
- */
-ret_code_t nfc_text_rec_payload_constructor(nfc_text_rec_payload_desc_t * p_nfc_rec_text_payload_desc,
- uint8_t * p_buff,
- uint32_t * p_len);
-
-/**
- * @brief External reference to the type field of the Text record, defined in the
- * file @c nfc_text_rec.c. It is used in the @ref NFC_NDEF_TEXT_RECORD_DESC_DEF macro.
- */
-extern const uint8_t nfc_text_rec_type_field[];
-
-/**
- * @brief Size of the type field of the Text record, defined in the
- * file @c nfc_text_rec.c. It is used in the @ref NFC_NDEF_TEXT_RECORD_DESC_DEF macro.
- */
-#define NFC_TEXT_REC_TYPE_LENGTH 1
-
-/**
- *@brief Macro for creating and initializing an NFC NDEF record descriptor for a Text record.
- *
- * This macro creates and initializes a static instance of type @ref nfc_ndef_record_desc_t and
- * a static instance of type @ref nfc_text_rec_payload_desc_t, which together constitute
- * an instance of a Text record.
- *
- * Use the macro @ref NFC_NDEF_TEXT_RECORD_DESC to access the NDEF Text record descriptor instance.
- *
- * @param[in] NAME Name of the created record descriptor instance.
- * @param[in] UTF Unicode Transformation Format.
- * @param[in] P_LANG_CODE Pointer to the IANA language code.
- * @param[in] LANG_CODE_LEN Length of the IANA language code.
- * @param[in] P_DATA Pointer to the user text.
- * @param[in] DATA_LEN Length of the user text.
- */
-#define NFC_NDEF_TEXT_RECORD_DESC_DEF(NAME, \
- UTF, \
- P_LANG_CODE, \
- LANG_CODE_LEN, \
- P_DATA, \
- DATA_LEN) \
- static nfc_text_rec_payload_desc_t NAME##_nfc_text_rec_payload_desc; \
- NAME##_nfc_text_rec_payload_desc = (nfc_text_rec_payload_desc_t) \
- { \
- .utf = UTF, \
- .p_lang_code = P_LANG_CODE, \
- .lang_code_len = LANG_CODE_LEN, \
- .p_data = P_DATA, \
- .data_len = DATA_LEN, \
- }; \
- NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
- TNF_WELL_KNOWN, \
- 0, \
- 0, \
- nfc_text_rec_type_field, \
- NFC_TEXT_REC_TYPE_LENGTH, \
- nfc_text_rec_payload_constructor, \
- &(NAME##_nfc_text_rec_payload_desc))
-
-/**
- * @brief Macro for accessing the NFC NDEF Text record descriptor
- * instance that was created with @ref NFC_NDEF_TEXT_RECORD_DESC_DEF.
- */
-#define NFC_NDEF_TEXT_RECORD_DESC(NAME) NFC_NDEF_GENERIC_RECORD_DESC(NAME)
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_TEXT_REC_H__
diff --git a/components/nfc/ndef/uri/nfc_uri_msg.c b/components/nfc/ndef/uri/nfc_uri_msg.c
deleted file mode 100644
index 22c21e4..0000000
--- a/components/nfc/ndef/uri/nfc_uri_msg.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include "nfc_uri_msg.h"
-
-/** @brief Function for generating a description of an NFC NDEF URI message.
- *
- * This function declares and initializes a static instance of an NFC NDEF message description
- * and NFC NDEF records descriptions.
- *
- * @param[in] uri_id_code URI identifier code that defines the protocol field of the URI.
- * @param[in] p_uri_data Pointer to the URI string.
- * This string should not contain the protocol field if the protocol
- * was specified in @p uri_id_code
- * @param[in] uri_data_len Length of the URI string.
- * @param[out] pp_uri_msg_desc Pointer to pointer to the NDEF message description.
- *
- * @retval NRF_SUCCESS If the description was successfully created.
- * @retval NRF_ERROR_INVALID_PARAM If the URI string was invalid (equal to NULL).
- */
-static ret_code_t nfc_uri_msg_declare( nfc_uri_id_t uri_id_code,
- uint8_t const * const p_uri_data,
- uint8_t uri_data_len,
- nfc_ndef_msg_desc_t ** pp_uri_msg_desc)
-{
- ret_code_t err_code;
- nfc_ndef_record_desc_t * p_uri_rec;
-
- /* Create NFC NDEF message description, capacity - 1 record */
- NFC_NDEF_MSG_DEF(nfc_uri_msg, 1);
-
- /* The message description is static, therefore */
- /* you must clear the message (needed for supporting multiple calls) */
- nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_uri_msg));
-
- if (p_uri_data != NULL)
- {
- /* Create NFC NDEF URI Record description */
- p_uri_rec = nfc_uri_rec_declare(uri_id_code,
- p_uri_data,
- uri_data_len);
-
- /* Add URI record as lone record to message */
- err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_uri_msg), p_uri_rec);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
- else
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- *pp_uri_msg_desc = &NFC_NDEF_MSG(nfc_uri_msg);
-
- return NRF_SUCCESS;
-}
-
-ret_code_t nfc_uri_msg_encode( nfc_uri_id_t uri_id_code,
- uint8_t const * const p_uri_data,
- uint8_t uri_data_len,
- uint8_t * p_buf,
- uint32_t * p_len)
-{
- ret_code_t err_code;
- nfc_ndef_msg_desc_t * p_uri_msg_desc;
-
- /* Create NFC NDEF message description with URI record */
- err_code = nfc_uri_msg_declare( uri_id_code,
- p_uri_data,
- uri_data_len,
- &p_uri_msg_desc);
-
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- /* Encode whole message into buffer */
- err_code = nfc_ndef_msg_encode(p_uri_msg_desc,
- p_buf,
- p_len);
-
- return err_code;
-}
diff --git a/components/nfc/ndef/uri/nfc_uri_msg.h b/components/nfc/ndef/uri/nfc_uri_msg.h
deleted file mode 100644
index 5226be2..0000000
--- a/components/nfc/ndef/uri/nfc_uri_msg.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_URI_MSG_H__
-#define NFC_URI_MSG_H__
-
-/**@file
- *
- * @defgroup nfc_uri_msg URI messages
- * @{
- * @ingroup nfc_ndef_messages
- *
- * @brief Generation of NFC NDEF messages with a URI record.
- *
- */
-
-#include "nfc_ndef_msg.h"
-#include "nfc_uri_rec.h"
-#include "nrf_error.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @brief Function for encoding an NFC NDEF URI message.
- *
- * This function encodes an NFC NDEF message into a buffer.
- *
- * @param[in] uri_id_code URI identifier code that defines the protocol field of the URI.
- * @param[in] p_uri_data Pointer to the URI string.
- * The string should not contain the protocol field if the protocol
- * was specified in @p uri_id_code.
- * @param[in] uri_data_len Length of the URI string.
- * @param[out] p_buf Pointer to the buffer for the message.
- * @param[in,out] p_len Size of the available memory for the message as input.
- * Size of the generated message as output.
- *
- * @retval NRF_SUCCESS If the description was successfully created.
- * @retval NRF_ERROR_INVALID_PARAM If the URI string was invalid (equal to NULL).
- * @retval NRF_ERROR_NO_MEM If the predicted message size is bigger than the provided
- * buffer space.
- * @retval Other Other codes might be returned depending on
- * the function @ref nfc_ndef_msg_encode.
- */
-ret_code_t nfc_uri_msg_encode( nfc_uri_id_t uri_id_code,
- uint8_t const * const p_uri_data,
- uint8_t uri_data_len,
- uint8_t * p_buf,
- uint32_t * p_len);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_URI_MSG_H__
diff --git a/components/nfc/ndef/uri/nfc_uri_rec.c b/components/nfc/ndef/uri/nfc_uri_rec.c
deleted file mode 100644
index 92d3534..0000000
--- a/components/nfc/ndef/uri/nfc_uri_rec.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include
-#include "nfc_uri_rec.h"
-#include "nrf_error.h"
-
-/**
- * @brief Type of description of the payload of a URI record.
- */
-typedef struct
-{
- nfc_uri_id_t uri_id_code; ///< URI identifier code.
- uint8_t const * p_uri_data; ///< Pointer to a URI string.
- uint8_t uri_data_len; ///< Length of the URI string.
-} uri_payload_desc_t;
-
-/**
- * @brief Function for constructing the payload for a URI record.
- *
- * This function encodes the payload according to the URI record definition. It implements an API
- * compatible with @ref p_payload_constructor_t.
- *
- * @param[in] p_input Pointer to the description of the payload.
- * @param[out] p_buff Pointer to payload destination. If NULL, function will
- * calculate the expected size of the URI record payload.
- *
- * @param[in,out] p_len Size of available memory to write as input. Size of generated
- * payload as output.
- *
- * @retval NRF_SUCCESS If the payload was encoded successfully.
- * @retval NRF_ERROR_NO_MEM If the predicted payload size is bigger than the provided buffer space.
- */
-static ret_code_t nfc_uri_payload_constructor( uri_payload_desc_t * p_input,
- uint8_t * p_buff,
- uint32_t * p_len)
-{
- if (p_buff != NULL)
- {
- /* Verify if there is enough available memory */
- if (p_input->uri_data_len >= *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- /* Copy descriptor content into the buffer */
- *(p_buff++) = p_input->uri_id_code;
- memcpy(p_buff, p_input->p_uri_data, p_input->uri_data_len );
- }
-
- *p_len = p_input->uri_data_len + 1;
-
- return NRF_SUCCESS;
-}
-
-nfc_ndef_record_desc_t * nfc_uri_rec_declare( nfc_uri_id_t uri_id_code,
- uint8_t const * const p_uri_data,
- uint8_t uri_data_len)
-{
- static uri_payload_desc_t uri_payload_desc;
- static const uint8_t static_uri_type = 'U';
-
- NFC_NDEF_GENERIC_RECORD_DESC_DEF( uri_rec,
- TNF_WELL_KNOWN, // tnf <- well-known
- NULL,
- 0, // no id
- &static_uri_type,
- 1, // type size 1B
- nfc_uri_payload_constructor,
- &uri_payload_desc);
-
- uri_payload_desc.uri_id_code = uri_id_code;
- uri_payload_desc.p_uri_data = p_uri_data;
- uri_payload_desc.uri_data_len = uri_data_len;
-
- return &NFC_NDEF_GENERIC_RECORD_DESC( uri_rec);
-}
-
diff --git a/components/nfc/ndef/uri/nfc_uri_rec.h b/components/nfc/ndef/uri/nfc_uri_rec.h
deleted file mode 100644
index aab3d96..0000000
--- a/components/nfc/ndef/uri/nfc_uri_rec.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_URI_REC_H__
-#define NFC_URI_REC_H__
-
-/**@file
- *
- * @defgroup nfc_uri_rec URI records
- * @{
- * @ingroup nfc_uri_msg
- *
- * @brief Generation of NFC NDEF URI record descriptions.
- *
- */
-
-#include "nfc_ndef_record.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @enum nfc_uri_id_t
- * @brief URI identifier codes according to "URI Record Type Definition"
- * (denotation "NFCForum-TS-RTD_URI_1.0" published on 2006-07-24) chapter 3.2.2.
- */
-typedef enum
-{
- NFC_URI_NONE = 0x00, /**< No prepending is done. */
- NFC_URI_HTTP_WWW = 0x01, /**< "http://www." */
- NFC_URI_HTTPS_WWW = 0x02, /**< "https://www." */
- NFC_URI_HTTP = 0x03, /**< "http:" */
- NFC_URI_HTTPS = 0x04, /**< "https:" */
- NFC_URI_TEL = 0x05, /**< "tel:" */
- NFC_URI_MAILTO = 0x06, /**< "mailto:" */
- NFC_URI_FTP_ANONYMOUS = 0x07, /**< "ftp://anonymous:anonymous@" */
- NFC_URI_FTP_FTP = 0x08, /**< "ftp://ftp." */
- NFC_URI_FTPS = 0x09, /**< "ftps://" */
- NFC_URI_SFTP = 0x0A, /**< "sftp://" */
- NFC_URI_SMB = 0x0B, /**< "smb://" */
- NFC_URI_NFS = 0x0C, /**< "nfs://" */
- NFC_URI_FTP = 0x0D, /**< "ftp://" */
- NFC_URI_DAV = 0x0E, /**< "dav://" */
- NFC_URI_NEWS = 0x0F, /**< "news:" */
- NFC_URI_TELNET = 0x10, /**< "telnet://" */
- NFC_URI_IMAP = 0x11, /**< "imap:" */
- NFC_URI_RTSP = 0x12, /**< "rtsp://" */
- NFC_URI_URN = 0x13, /**< "urn:" */
- NFC_URI_POP = 0x14, /**< "pop:" */
- NFC_URI_SIP = 0x15, /**< "sip:" */
- NFC_URI_SIPS = 0x16, /**< "sips:" */
- NFC_URI_TFTP = 0x17, /**< "tftp:" */
- NFC_URI_BTSPP = 0x18, /**< "btspp://" */
- NFC_URI_BTL2CAP = 0x19, /**< "btl2cap://" */
- NFC_URI_BTGOEP = 0x1A, /**< "btgoep://" */
- NFC_URI_TCPOBEX = 0x1B, /**< "tcpobex://" */
- NFC_URI_IRDAOBEX = 0x1C, /**< "irdaobex://" */
- NFC_URI_FILE = 0x1D, /**< "file://" */
- NFC_URI_URN_EPC_ID = 0x1E, /**< "urn:epc:id:" */
- NFC_URI_URN_EPC_TAG = 0x1F, /**< "urn:epc:tag:" */
- NFC_URI_URN_EPC_PAT = 0x20, /**< "urn:epc:pat:" */
- NFC_URI_URN_EPC_RAW = 0x21, /**< "urn:epc:raw:" */
- NFC_URI_URN_EPC = 0x22, /**< "urn:epc:" */
- NFC_URI_URN_NFC = 0x23, /**< "urn:nfc:" */
- NFC_URI_RFU = 0xFF /**< No prepending is done. Reserved for future use. */
-} nfc_uri_id_t;
-
-/** @brief Function for generating a description of a URI record.
- *
- * This function declares and initializes a static instance of an NFC NDEF record description
- * of a URI record.
- *
- * @note The record payload data (@p uri_id_code, @p p_uri_data, and @p
- * uri_data_len) should be declared as static. If it is declared as
- * automatic, the NDEF message encoding (see @ref nfc_uri_msg_encode)
- * must be done in the same variable scope.
- *
- * @param[in] uri_id_code URI identifier code that defines the protocol field of the URI.
- * @param[in] p_uri_data Pointer to the URI string.
- * The string should not contain the protocol field if the protocol
- * was specified in @p uri_id_code.
- * @param[in] uri_data_len Length of the URI string.
- *
- * @return Pointer to the description of the record.
- */
-nfc_ndef_record_desc_t * nfc_uri_rec_declare( nfc_uri_id_t uri_id_code,
- uint8_t const * const p_uri_data,
- uint8_t uri_data_len);
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NFC_URI_REC_H__
diff --git a/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.c b/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.c
deleted file mode 100644
index d481d43..0000000
--- a/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.c
+++ /dev/null
@@ -1,733 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if NFC_HAL_ENABLED
-
-#include "hal_nfc_t2t.h"
-#include
-#include
-#include "nfc_t2t_lib.h"
-#include "nfc_fixes.h"
-#include "nrf.h"
-#include "app_util_platform.h"
-#include "nordic_common.h"
-#include "nrf_drv_clock.h"
-
-#define NRF_LOG_MODULE_NAME "HAL_NFC"
-#if HAL_NFC_CONFIG_LOG_ENABLED
-#define NRF_LOG_LEVEL HAL_NFC_CONFIG_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR HAL_NFC_CONFIG_INFO_COLOR
-#define NRF_LOG_DEBUG_COLOR HAL_NFC_CONFIG_DEBUG_COLOR
-#else // HAL_NFC_CONFIG_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // HAL_NFC_CONFIG_LOG_ENABLED
-#include "nrf_log.h"
-
-
-#if HAL_NFC_CONFIG_DEBUG_PIN_ENABLED
- #include "nrf_gpio.h"
-
- #define HAL_NFC_DEBUG_PIN_CONFIG(pin_num) nrf_gpio_cfg_output(pin_num)
- #define HAL_NFC_DEBUG_PIN_CLEAR(pin_num) nrf_gpio_pin_clear(pin_num)
- #define HAL_NFC_DEBUG_PIN_SET(pin_num) nrf_gpio_pin_set(pin_num)
-
- #define HAL_NFC_DEBUG_PINS_INITIALIZE() \
- do{ \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_HCLOCK_ON_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_NFC_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_NFC_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_DETECT_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_DETECT_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CONFIG(HAL_NFC_TIMER4_EVENT_DEBUG_PIN); \
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_TIMER4_EVENT_DEBUG_PIN); \
- } while(0)
-#else
- #define HAL_NFC_DEBUG_PIN_CLEAR(pin_num)
- #define HAL_NFC_DEBUG_PIN_SET(pin_num)
- #define HAL_NFC_DEBUG_PINS_INITIALIZE()
-#endif // HAL_NFC_CONFIG_DEBUG_PIN_ENABLED
-
-
-/* NFC library version history:
- * #define NFC_LIB_VERSION 0x00 first experimental version intended for nRF52 IC rev. Engineering A (PCA10036, part of nRF52 Preview Development Kit)
- * #define NFC_LIB_VERSION 0x01 experimental version intended for nRF52 IC rev. Engineering B (PCA10040, part of nRF52 Development Kit)
- * #define NFC_LIB_VERSION 0x02 experimental version intended for fix IC-12826 and fix: not released HFCLK in SENSE mode
- * #define NFC_LIB_VERSION 0x03 experimental version intended for support logging module
- * #define NFC_LIB_VERSION 0x04 experimental version intended for nRF52840 IC rev. Engineering A (PCA10056, part of nRF52840 Preview Development Kit). Removed PCA10036 support.
- */
-
-#define NFC_LIB_VERSION 0x03u /**< Internal: current NFC lib. version */
-
-#define T2T_INTERNAL_BYTES_NR 10u /**< Number of internal bytes defined by Type 2 Tag Operation Technical Specification */
-#define T2T_INTERNAL_BYTE_SN0_SHIFT 0u /**< Internal Byte SN0, NRF_FICR->NFC.TAGHEADER0.MFGID which is Manufacturer ID */
-#define T2T_INTERNAL_BYTE_SN1_SHIFT 8u /**< Internal Byte SN1, NRF_FICR->NFC.TAGHEADER0.UID0 */
-#define T2T_INTERNAL_BYTE_SN2_SHIFT 16u /**< Internal Byte SN2, NRF_FICR->NFC.TAGHEADER0.UID1 */
-#define T2T_INTERNAL_BYTE_SN3_SHIFT 0u /**< Internal Byte SN3, NRF_FICR->NFC.TAGHEADER1.UID3 */
-#define T2T_INTERNAL_BYTE_SN4_SHIFT 8u /**< Internal Byte SN4, NRF_FICR->NFC.TAGHEADER1.UID4 */
-#define T2T_INTERNAL_BYTE_SN5_SHIFT 16u /**< Internal Byte SN5, NRF_FICR->NFC.TAGHEADER1.UID5 */
-#define T2T_INTERNAL_BYTE_SN6_SHIFT 24u /**< Internal Byte SN6, NRF_FICR->NFC.TAGHEADER1.UID6 */
-#define CASCADE_TAG_BYTE 0x88u /**< Constant defined by ISO/EIC 14443-3 */
-
-#define NFCID1_2ND_LAST_BYTE2_SHIFT 16u /**< Shift value for NFC ID byte 2 */
-#define NFCID1_2ND_LAST_BYTE1_SHIFT 8u /**< Shift value for NFC ID byte 1 */
-#define NFCID1_2ND_LAST_BYTE0_SHIFT 0u /**< Shift value for NFC ID byte 0 */
-#define NFCID1_LAST_BYTE3_SHIFT 24u /**< Shift value for NFC ID byte 3 */
-#define NFCID1_LAST_BYTE2_SHIFT 16u /**< Shift value for NFC ID byte 2 */
-#define NFCID1_LAST_BYTE1_SHIFT 8u /**< Shift value for NFC ID byte 1 */
-#define NFCID1_LAST_BYTE0_SHIFT 0u /**< Shift value for NFC ID byte 0 */
-
-#define NFC_RX_BUFFER_SIZE 16u /**< NFC Rx data buffer size */
-#define T2T_READ_CMD 0x30u /**< Type 2 Tag Read command identifier */
-#define NFC_SLP_REQ_CMD 0x50u /**< NFC SLP_REQ command identifier */
-#define NFC_CRC_SIZE 2u /**< CRC size in bytes */
-
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- #define NRF_NFCT_ERRORSTATUS_ALL (NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) /**< Mask for clearing all error flags in NFCT_ERRORSTATUS register */
-#else
- #define NRF_NFCT_ERRORSTATUS_ALL (NFCT_ERRORSTATUS_NFCFIELDTOOWEAK_Msk | \
- NFCT_ERRORSTATUS_NFCFIELDTOOSTRONG_Msk | \
- NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) /**< Mask for clearing all error flags in NFCT_ERRORSTATUS register */
-#endif // HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-
-#define NRF_NFCT_FRAMESTATUS_RX_MSK (NFCT_FRAMESTATUS_RX_OVERRUN_Msk | \
- NFCT_FRAMESTATUS_RX_PARITYSTATUS_Msk | \
- NFCT_FRAMESTATUS_RX_CRCERROR_Msk) /**< Mask for clearing all flags in NFCT_FRAMESTATUS_RX register */
-#define NFC_FIELD_ON_MASK NFCT_FIELDPRESENT_LOCKDETECT_Msk /**< Mask for checking FIELDPRESENT register for state: FIELD ON. */
-#define NFC_FIELD_OFF_MASK NFCT_FIELDPRESENT_FIELDPRESENT_Msk /**< Mask for checking FIELDPRESENT register for state: FIELD OFF. */
-
-typedef enum
-{
- NFC_FIELD_STATE_NONE, /**< Initial value indicating no NFCT Field events. */
- NFC_FIELD_STATE_OFF, /**< NFCT FIELDLOST Event has been set. */
- NFC_FIELD_STATE_ON, /**< NFCT FIELDDETECTED Event has been set. */
- NFC_FIELD_STATE_UNKNOWN /**< Both NFCT Field Events have been set - ambiguous state. */
-}nfct_field_sense_state_t;
-
-/* Static function declarations */
-static inline void nrf_nfct_event_clear(volatile uint32_t * p_event);
-static inline void nrf_nfct_clock_event_handler(nrf_drv_clock_evt_type_t event);
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state);
-
-/* Static data */
-static hal_nfc_callback_t m_nfc_lib_callback = (hal_nfc_callback_t) NULL; /**< Callback to nfc_lib layer */
-static void * m_nfc_lib_context; /**< Callback execution context */
-static volatile uint8_t m_nfc_rx_buffer[NFC_RX_BUFFER_SIZE] = {0}; /**< Buffer for NFC Rx data */
-static volatile bool m_slp_req_received = false; /**< Flag indicating that SLP_REQ Command was received */
-static volatile bool m_field_on = false; /**< Flag indicating that NFC Tag field is present */
-static nrf_drv_clock_handler_item_t m_clock_handler_item; /**< Clock event handler item structure */
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- static volatile uint32_t m_nfc_fieldpresent_mask = NFC_FIELD_OFF_MASK; /**< Mask used for NFC Field polling in NFCT_FIELDPRESENT register */
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#define NRF_NFCT_POWER (*(uint32_t volatile *)(0x40005FFC))
-
-#define NFC_HAL_FIELDPRESENT_MASK (NFCT_FIELDPRESENT_LOCKDETECT_Msk | \
- NFCT_FIELDPRESENT_FIELDPRESENT_Msk)
-
-#define NFC_HAL_FIELDPRESENT_IS_LOST ((NFCT_FIELDPRESENT_FIELDPRESENT_NoField << \
- NFCT_FIELDPRESENT_FIELDPRESENT_Pos) | \
- (NFCT_FIELDPRESENT_LOCKDETECT_NotLocked << \
- NFCT_FIELDPRESENT_LOCKDETECT_Pos))
-
-#ifndef HAL_NFC_FIELD_TIMER_PERIOD
- #define HAL_NFC_FIELD_TIMER_PERIOD 100 /* unit - us */
-#endif
-
-static inline void hal_nfc_re_setup(void);
-static void hal_nfc_field_check(void);
-
-static void field_timer_with_callback_config()
-{
- NRF_TIMER4->MODE = TIMER_MODE_MODE_Timer << TIMER_MODE_MODE_Pos;
- NRF_TIMER4->BITMODE = TIMER_BITMODE_BITMODE_08Bit << TIMER_BITMODE_BITMODE_Pos;
- NRF_TIMER4->PRESCALER = 4 << TIMER_PRESCALER_PRESCALER_Pos;
- NRF_TIMER4->CC[0] = HAL_NFC_FIELD_TIMER_PERIOD << TIMER_CC_CC_Pos;
- NRF_TIMER4->SHORTS = TIMER_SHORTS_COMPARE0_CLEAR_Enabled << TIMER_SHORTS_COMPARE0_CLEAR_Pos;
- NRF_TIMER4->INTENSET = TIMER_INTENSET_COMPARE0_Set << TIMER_INTENSET_COMPARE0_Pos;
-
- NVIC_ClearPendingIRQ(TIMER4_IRQn);
- NVIC_SetPriority(TIMER4_IRQn, APP_IRQ_PRIORITY_LOW);
- NVIC_EnableIRQ(TIMER4_IRQn);
-}
-
-void TIMER4_IRQHandler(void)
-{
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_TIMER4_EVENT_DEBUG_PIN);
- hal_nfc_field_check();
- NRF_TIMER4->EVENTS_COMPARE[0] = 0;
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_TIMER4_EVENT_DEBUG_PIN);
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-/**
- * @brief Common part of setup used for NFCT initialization and reinitialization.
- */
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-static void hal_nfc_common_hw_setup(uint8_t * const nfc_internal)
-#else
-static inline void hal_nfc_common_hw_setup(uint8_t * const nfc_internal)
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-{
- uint32_t nfc_tag_header0 = NRF_FICR->NFC.TAGHEADER0;
- uint32_t nfc_tag_header1 = NRF_FICR->NFC.TAGHEADER1;
-
-/* Begin: Bugfix for FTPAN-98 */
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- *(volatile uint32_t *)0x4000568C = 0x00038148;
-#endif
-/* End: Bugfix for FTPAN-98 */
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- NRF_NFCT->INTENSET = (NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos);
-#else
- NRF_NFCT->INTENSET = (NFCT_INTENSET_FIELDDETECTED_Enabled << NFCT_INTENSET_FIELDDETECTED_Pos) |
- (NFCT_INTENSET_FIELDLOST_Enabled << NFCT_INTENSET_FIELDLOST_Pos);
-#endif
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_ERROR_Enabled << NFCT_INTENSET_ERROR_Pos) |
- (NFCT_INTENSET_SELECTED_Enabled << NFCT_INTENSET_SELECTED_Pos);
-
- /* According to ISO/IEC 14443-3 */
- nfc_internal[0] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN0_SHIFT)); //SN0
- nfc_internal[1] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN1_SHIFT)); //SN1
- nfc_internal[2] = (uint8_t) (LSB_32(nfc_tag_header0 >> T2T_INTERNAL_BYTE_SN2_SHIFT)); //SN2
- nfc_internal[3] = (uint8_t) ((CASCADE_TAG_BYTE) ^ nfc_internal[0] ^
- nfc_internal[1] ^ nfc_internal[2]); //BCC0 = CASCADE_TAG_BYTE ^ SN0 ^ SN1 ^ SN2
- nfc_internal[4] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN3_SHIFT)); //SN3
- nfc_internal[5] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN4_SHIFT)); //SN4
- nfc_internal[6] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN5_SHIFT)); //SN5
- nfc_internal[7] = (uint8_t) (LSB_32(nfc_tag_header1 >> T2T_INTERNAL_BYTE_SN6_SHIFT)); //SN6
- nfc_internal[8] = (uint8_t) (nfc_internal[4] ^ nfc_internal[5] ^
- nfc_internal[6] ^ nfc_internal[7]); //BCC1 = SN3 ^ SN4 ^ SN5 ^ SN6
- nfc_internal[9] = (uint8_t) (NFC_LIB_VERSION); //For internal use
-
-
- /* MSB of NFCID1_2ND_LAST register is not used - always 0 */
- NRF_NFCT->NFCID1_2ND_LAST = ((uint32_t) nfc_internal[0] << NFCID1_2ND_LAST_BYTE2_SHIFT) |
- ((uint32_t) nfc_internal[1] << NFCID1_2ND_LAST_BYTE1_SHIFT) |
- ((uint32_t) nfc_internal[2] << NFCID1_2ND_LAST_BYTE0_SHIFT);
-
- NRF_NFCT->NFCID1_LAST = ((uint32_t) nfc_internal[4] << NFCID1_LAST_BYTE3_SHIFT) |
- ((uint32_t) nfc_internal[5] << NFCID1_LAST_BYTE2_SHIFT) |
- ((uint32_t) nfc_internal[6] << NFCID1_LAST_BYTE1_SHIFT) |
- ((uint32_t) nfc_internal[7] << NFCID1_LAST_BYTE0_SHIFT);
-
- /* Begin: Bugfix for FTPAN-25 (IC-9929) */
- /* Workaround for wrong SENSRES values require using SDD00001, but here SDD00100 is used
- because it's required to operate with Windows Phone */
- NRF_NFCT->SENSRES =
- (NFCT_SENSRES_NFCIDSIZE_NFCID1Double << NFCT_SENSRES_NFCIDSIZE_Pos) |
- (NFCT_SENSRES_BITFRAMESDD_SDD00100 << NFCT_SENSRES_BITFRAMESDD_Pos);
- /* End: Bugfix for FTPAN-25 (IC-9929)*/
-}
-
-
-ret_code_t hal_nfc_setup(hal_nfc_callback_t callback, void * p_context)
-{
- uint8_t nfc_internal[T2T_INTERNAL_BYTES_NR];
-
- m_nfc_lib_callback = callback;
- m_nfc_lib_context = p_context;
-
- hal_nfc_common_hw_setup(nfc_internal);
-
- (void) nfc_t2t_internal_set((uint8_t *) nfc_internal, sizeof(nfc_internal));
-
- /* Initialize SDK Clock module for handling high precission clock requests */
- m_clock_handler_item.event_handler = nrf_nfct_clock_event_handler;
- m_clock_handler_item.p_next = NULL;
-
- ret_code_t err_code = nrf_drv_clock_init();
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- field_timer_with_callback_config();
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
- NRF_LOG_INFO("Init\r\n");
- HAL_NFC_DEBUG_PINS_INITIALIZE();
-
- if ((err_code == NRF_SUCCESS) || (err_code == NRF_ERROR_MODULE_ALREADY_INITIALIZED))
- {
- return NRF_SUCCESS;
- }
- else
- {
- return NRF_ERROR_INTERNAL;
- }
-}
-
-/**@brief Function for clearing an event flag in NRF_NFCT registers.
- *
- * @param[in] p_event Pointer to event register.
- *
- */
-static inline void nrf_nfct_event_clear(volatile uint32_t * p_event)
-{
- *p_event = 0;
-
- /* Perform read to ensure clearing is effective */
- volatile uint32_t dummy = *p_event;
- (void)dummy;
-}
-
-/**@brief Function for handling events from Clock Module.
- *
- * @param[in] event Clock event.
- *
- */
-static inline void nrf_nfct_clock_event_handler(nrf_drv_clock_evt_type_t event)
-{
- switch(event)
- {
- case NRF_DRV_CLOCK_EVT_HFCLK_STARTED:
- /* Activate NFCT only when HFXO is running */
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- NRF_NFCT->TASKS_ACTIVATE = 1;
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- break;
-
- default:
- /* No implementation required */
- break;
- }
-}
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-static inline void nrf_nfct_field_lost_hfclk_handle(void)
-{
- /* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
- // reset the NFC for release HFCLK
- __DMB();
- NRF_NFCT_POWER = 0;
- __DMB();
- NRF_NFCT_POWER = 1;
- /* END: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-/**@brief Function for evaluating and handling NFC field events.
- *
- * @param[in] field_state Current field state.
- *
- */
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state)
-{
- if (field_state == NFC_FIELD_STATE_UNKNOWN)
- {
- /* Probe NFC field */
- uint32_t field_present = NRF_NFCT->FIELDPRESENT;
-
- if (field_present & m_nfc_fieldpresent_mask)
- {
- field_state = NFC_FIELD_STATE_ON;
- }
- else
- {
- field_state = NFC_FIELD_STATE_OFF;
- }
- }
-
- /* Field event service */
- switch(field_state)
- {
- case NFC_FIELD_STATE_ON:
- if (!m_field_on)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- nrf_drv_clock_hfclk_request(&m_clock_handler_item);
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- }
- m_field_on = true;
- break;
-
- case NFC_FIELD_STATE_OFF:
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); //DEBUG!
-
-/* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- *(volatile uint32_t *)0x40005010 = 1;
-#endif // HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-/* END: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
- NRF_NFCT->TASKS_SENSE = 1;
- nrf_drv_clock_hfclk_release();
- m_field_on = false;
-
- NRF_NFCT->INTENCLR =
- (NFCT_INTENCLR_RXFRAMEEND_Clear << NFCT_INTENCLR_RXFRAMEEND_Pos) |
- (NFCT_INTENCLR_RXERROR_Clear << NFCT_INTENCLR_RXERROR_Pos);
-
- /* Change mask to FIELD_OFF state - trigger FIELD_ON even if HW has not locked to the field */
- m_nfc_fieldpresent_mask = NFC_FIELD_OFF_MASK;
-
- if ((m_nfc_lib_callback != NULL) )
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_OFF, 0, 0);
- }
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); //DEBUG!
- break;
-
- default:
- /* No implementation required */
- break;
- }
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-/* This function is used by nfc_lib for unit testing only */
-ret_code_t hal_nfc_parameter_set(hal_nfc_param_id_t id, void * p_data, size_t data_length)
-{
- (void)id;
- (void)p_data;
- (void)data_length;
-
- return NRF_SUCCESS;
-}
-
-/* This function is used by nfc_lib for unit testing only */
-ret_code_t hal_nfc_parameter_get(hal_nfc_param_id_t id, void * p_data, size_t * p_max_data_length)
-{
- (void)id;
- (void)p_data;
- (void)p_max_data_length;
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t hal_nfc_start(void)
-{
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
-
- NVIC_ClearPendingIRQ(NFCT_IRQn);
- NVIC_SetPriority(NFCT_IRQn, APP_IRQ_PRIORITY_LOW);
- NVIC_EnableIRQ(NFCT_IRQn);
-
- NRF_NFCT->TASKS_SENSE = 1;
-
- NRF_LOG_INFO("Start\r\n");
- return NRF_SUCCESS;
-}
-
-ret_code_t hal_nfc_send(const uint8_t * p_data, size_t data_length)
-{
- if (data_length == 0)
- {
- return NRF_ERROR_DATA_SIZE;
- }
-
- /* Ignore previous TX END events, SW takes care only for data frames which tranmission is triggered in this function */
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- NRF_NFCT->PACKETPTR = (uint32_t) p_data;
- NRF_NFCT->TXD.AMOUNT = (data_length << NFCT_TXD_AMOUNT_TXDATABYTES_Pos) &
- NFCT_TXD_AMOUNT_TXDATABYTES_Msk;
- NRF_NFCT->INTENSET = (NFCT_INTENSET_TXFRAMEEND_Enabled << NFCT_INTENSET_TXFRAMEEND_Pos);
- NRF_NFCT->TASKS_STARTTX = 1;
-
- NRF_LOG_INFO("Send\r\n");
- return NRF_SUCCESS;
-}
-
-ret_code_t hal_nfc_stop(void)
-{
- NRF_NFCT->TASKS_DISABLE = 1;
-
- NRF_LOG_INFO("Stop\r\n");
- return NRF_SUCCESS;
-}
-
-ret_code_t hal_nfc_done(void)
-{
- m_nfc_lib_callback = (hal_nfc_callback_t) NULL;
-
- return NRF_SUCCESS;
-}
-
-void NFCT_IRQHandler(void)
-{
- nfct_field_sense_state_t current_field = NFC_FIELD_STATE_NONE;
-
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_NFC_EVENT_DEBUG_PIN); //DEBUG!
-
- if (NRF_NFCT->EVENTS_FIELDDETECTED && (NRF_NFCT->INTEN & NFCT_INTEN_FIELDDETECTED_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_FIELDDETECTED);
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_DETECT_EVENT_DEBUG_PIN); //DEBUG!
- current_field = NFC_FIELD_STATE_ON;
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_DETECT_EVENT_DEBUG_PIN); //DEBUG!
-
- NRF_LOG_DEBUG("Field detected\r\n");
- }
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- if (NRF_NFCT->EVENTS_FIELDLOST && (NRF_NFCT->INTEN & NFCT_INTEN_FIELDLOST_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_FIELDLOST);
- current_field =
- (current_field == NFC_FIELD_STATE_NONE) ? NFC_FIELD_STATE_OFF : NFC_FIELD_STATE_UNKNOWN;
-
- NRF_LOG_DEBUG("Field lost\r\n");
- }
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
- /* Perform actions if any FIELD event is active */
- if (current_field != NFC_FIELD_STATE_NONE)
- {
- nrf_nfct_field_event_handler(current_field);
- }
-
- if (NRF_NFCT->EVENTS_RXFRAMEEND && (NRF_NFCT->INTEN & NFCT_INTEN_RXFRAMEEND_Msk))
- {
- /* Take into account only number of whole bytes */
- uint32_t rx_data_size = ((NRF_NFCT->RXD.AMOUNT & NFCT_RXD_AMOUNT_RXDATABYTES_Msk) >>
- NFCT_RXD_AMOUNT_RXDATABYTES_Pos) - NFC_CRC_SIZE;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXFRAMEEND);
-
- /* Look for Tag 2 Type READ Command */
- if (m_nfc_rx_buffer[0] == T2T_READ_CMD)
- {
- if(m_nfc_lib_callback != NULL)
- {
- /* This callback should trigger transmission of READ Response */
- m_nfc_lib_callback(m_nfc_lib_context,
- HAL_NFC_EVENT_DATA_RECEIVED,
- (void*)m_nfc_rx_buffer,
- rx_data_size);
- }
- }
- else
- {
- /* Indicate that SLP_REQ was received - this will cause FRAMEDELAYTIMEOUT error */
- if(m_nfc_rx_buffer[0] == NFC_SLP_REQ_CMD)
- {
- m_slp_req_received = true;
- }
- /* Not a READ Command, so wait for next frame reception */
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
- }
-
- NRF_LOG_DEBUG("Rx fend\r\n");
- }
-
- if (NRF_NFCT->EVENTS_TXFRAMEEND && (NRF_NFCT->INTEN & NFCT_INTEN_TXFRAMEEND_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_TXFRAMEEND);
-
- /* Disable TX END event to ignore frame transmission other than READ response */
- NRF_NFCT->INTENCLR = (NFCT_INTENCLR_TXFRAMEEND_Clear << NFCT_INTENCLR_TXFRAMEEND_Pos);
-
- /* Set up for reception */
- NRF_NFCT->PACKETPTR = (uint32_t) m_nfc_rx_buffer;
- NRF_NFCT->MAXLEN = NFC_RX_BUFFER_SIZE;
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
-
- if (m_nfc_lib_callback != NULL)
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_DATA_TRANSMITTED, 0, 0);
- }
-
- NRF_LOG_DEBUG("Tx fend\r\n");
- }
-
- if (NRF_NFCT->EVENTS_SELECTED && (NRF_NFCT->INTEN & NFCT_INTEN_SELECTED_Msk))
- {
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_SELECTED);
- /* Clear also RX END and RXERROR events because SW does not take care of commands which were received before selecting the tag */
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXFRAMEEND);
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXERROR);
-
- /* Set up registers for EasyDMA and start receiving packets */
- NRF_NFCT->PACKETPTR = (uint32_t) m_nfc_rx_buffer;
- NRF_NFCT->MAXLEN = NFC_RX_BUFFER_SIZE;
- NRF_NFCT->TASKS_ENABLERXDATA = 1;
-
- NRF_NFCT->INTENSET = (NFCT_INTENSET_RXFRAMEEND_Enabled << NFCT_INTENSET_RXFRAMEEND_Pos) |
- (NFCT_INTENSET_RXERROR_Enabled << NFCT_INTENSET_RXERROR_Pos);
-
- /* At this point any previous error status can be ignored */
- NRF_NFCT->FRAMESTATUS.RX = NRF_NFCT_FRAMESTATUS_RX_MSK;
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
-
-#ifndef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
- /* Change mask to FIELD_ON state - trigger FIELD_ON only if HW has locked to the field */
- m_nfc_fieldpresent_mask = NFC_FIELD_ON_MASK;
-#endif
-
- if (m_nfc_lib_callback != NULL)
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_ON, 0, 0);
- }
-
- NRF_LOG_DEBUG("Selected\r\n");
- }
-
- if (NRF_NFCT->EVENTS_RXERROR && (NRF_NFCT->INTEN & NFCT_INTEN_RXERROR_Msk))
- {
- uint32_t rx_status = NRF_NFCT->FRAMESTATUS.RX;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_RXERROR);
-
- NRF_LOG_DEBUG("Rx error (0x%x)\r\n", (unsigned int) rx_status);
- (void) rx_status;
-
- /* Clear rx frame status */
- NRF_NFCT->FRAMESTATUS.RX = NRF_NFCT_FRAMESTATUS_RX_MSK;
- }
-
- if (NRF_NFCT->EVENTS_ERROR && (NRF_NFCT->INTEN & NFCT_INTEN_ERROR_Msk))
- {
- uint32_t err_status = NRF_NFCT->ERRORSTATUS;
- nrf_nfct_event_clear(&NRF_NFCT->EVENTS_ERROR);
-
- /* Clear FRAMEDELAYTIMEOUT error (expected HW behaviour) when SLP_REQ command was received */
- if ((err_status & NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk) && m_slp_req_received)
- {
- NRF_NFCT->ERRORSTATUS = NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk;
- m_slp_req_received = false;
-
- NRF_LOG_DEBUG("Error (SLP_REQ)\r\n");
- }
- /* Report any other error */
- err_status &= ~NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk;
- if (err_status)
- {
- NRF_LOG_DEBUG("Error (0x%x)\r\n", (unsigned int) err_status);
- }
-
- /* Clear error status */
- NRF_NFCT->ERRORSTATUS = NRF_NFCT_ERRORSTATUS_ALL;
- }
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_NFC_EVENT_DEBUG_PIN); //DEBUG!
-}
-
-
-#ifdef HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#ifdef HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
- #error Wrong workaround combination
-#endif
-
-static uint32_t field_state_cnt = 0;
-/**
- * @brief Function for evaluating and handling NFC fieldlost event.
- */
-static void hal_nfc_field_check(void)
-{
- uint32_t nfc_fieldpresen_masked;
-
- nfc_fieldpresen_masked = NRF_NFCT->FIELDPRESENT & NFC_HAL_FIELDPRESENT_MASK;
-
- if (nfc_fieldpresen_masked == NFC_HAL_FIELDPRESENT_IS_LOST)
- {
- ++field_state_cnt;
- if (field_state_cnt > 7)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); //DEBUG!
-
- NRF_TIMER4->TASKS_SHUTDOWN = 1;
-
- nrf_drv_clock_hfclk_release();
-
- nrf_nfct_field_lost_hfclk_handle();
-
- if ((m_nfc_lib_callback != NULL))
- {
- m_nfc_lib_callback(m_nfc_lib_context, HAL_NFC_EVENT_FIELD_OFF, 0, 0);
- }
- m_field_on = false;
-
- /* Begin: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
- // resume the NFCT to initialized state
- hal_nfc_re_setup();
- /* End: Bugfix for FTPAN-116 (IC-12886) NFCT won't release HFCLK */
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_OFF_DEBUG_PIN); //DEBUG!
- }
-
- return;
- }
-
- field_state_cnt = 0;
-}
-
-/**
- * @brief Function for enablinge hight precision clock and start eveluating fieldlost event.
- */
-static inline void nrf_nfct_field_event_handler(volatile nfct_field_sense_state_t field_state)
-{
- if (!m_field_on)
- {
- HAL_NFC_DEBUG_PIN_SET(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- nrf_drv_clock_hfclk_request(&m_clock_handler_item);
-
- NRF_TIMER4->TASKS_CLEAR = 1;
- NRF_TIMER4->TASKS_START = 1;
- field_state_cnt = 0;
-
- HAL_NFC_DEBUG_PIN_CLEAR(HAL_NFC_HCLOCK_ON_DEBUG_PIN); //DEBUG!
- }
- m_field_on = true;
-}
-
-/**
- * @brief Function for resume the NFCT to initialized state after software's reset.
- */
-static inline void hal_nfc_re_setup(void)
-{
- uint8_t nfc_internal[T2T_INTERNAL_BYTES_NR];
-
- hal_nfc_common_hw_setup(nfc_internal);
-
- NRF_LOG_INFO("Reinitialize\r\n");
-}
-#endif // HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-
-#endif // NFC_HAL_ENABLED
diff --git a/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.h b/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.h
deleted file mode 100644
index 607816d..0000000
--- a/components/nfc/t2t_lib/hal_t2t/hal_nfc_t2t.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef HAL_NFC_H__
-#define HAL_NFC_H__
-
-/** @file
- * @defgroup nfc_t2t_hal NFC Type 2 Tag HAL
- * @{
- * @ingroup nfc_t2t
- * @brief @tagAPI52 Hardware abstraction layer for the NFC Type 2 Tag library.
- *
- * @note Before the NFCT peripheral enters ACTIVATED state, the HFXO must be running.
- * To fulfill this requirement and allow other software modules to also request the HFXO, the NFC Type 4 Tag HAL uses @ref nrf_drv_clock module.
- *
- */
-
-#include
-#include
-#include
-
-
-/** @brief Events passed to the upper-layer callback function. */
-typedef enum {
- HAL_NFC_EVENT_FIELD_ON, ///< Field is detected.
- HAL_NFC_EVENT_FIELD_OFF, ///< Field is lost.
- HAL_NFC_EVENT_DATA_RECEIVED, ///< Data is received.
- HAL_NFC_EVENT_DATA_TRANSMITTED ///< Data is Transmitted.
-} hal_nfc_event_t;
-
-
-/** @brief Parameter IDs for set/get function. */
-typedef enum {
- HAL_NFC_PARAM_ID_TESTING, ///< Used for unit tests.
- HAL_NFC_PARAM_ID_UNKNOWN
-} hal_nfc_param_id_t;
-
-
-/** @brief Callback from HAL_NFC layer into the upper layer.
- *
- * If event == HAL_NFC_EVENT_DATA_RECEIVED:
- * p_data points to the received packet. The memory belongs to the HAL_NFC layer and
- * is guaranteed to be valid only until the callback returns.
- *
- * If event == HAL_NFC_EVENT_DATA_TRANSMITTED:
- * p_data points to the transmitted packet. The memory belongs to the application.
- *
- * If event == \:
- * p_data definition is event-specific (to be defined).
- *
- * @param[in] p_context Context for callback execution.
- * @param[in] event The event that occurred.
- * @param[in] p_data Received/transmitted data or NULL.
- * @param[in] data_length Size of the received/transmitted packet.
- */
-typedef void (* hal_nfc_callback_t)(void * p_context,
- hal_nfc_event_t event,
- const uint8_t * p_data,
- size_t data_length);
-
-
-/** @brief Function for initializing the NFC layer.
- *
- * This function provides a pointer to a callback function and the callback context
- * to the NFC layer.
- *
- * @param[in] callback Pointer to the callback function.
- * @param[in] p_context Context of callback.
- *
- * @retval NRF_SUCCESS If the NFC layer was initialized successfully. If one
- * of the arguments was invalid, an error code is returned.
- */
-ret_code_t hal_nfc_setup(hal_nfc_callback_t callback, void * p_context);
-
-
-/** @brief Function for setting a HAL_NFC parameter.
- *
- * This function allows to set any parameter defined as available by HAL_NFC.
- *
- * @param[in] id ID of the parameter to set.
- * @param[in] p_data Pointer to the buffer containing the data to set.
- * @param[in] data_length Size of the buffer containing the data to set.
- *
- * @retval NRF_SUCCESS If the parameter was set successfully. If one of the arguments
- * was invalid (for example, wrong data length), an error code
- * is returned.
- */
-ret_code_t hal_nfc_parameter_set(hal_nfc_param_id_t id, void * p_data, size_t data_length);
-
-
-/** @brief Function for querying a HAL_NFC parameter value.
- *
- * The queried value will be placed into the passed data buffer. If the buffer
- * is too small, maxDataLength will contain the required buffer size.
- *
- * @param[in] id ID of the parameter to query.
- * @param[in] p_data Pointer to a buffer receiving the queried data.
- * @param[in, out] p_max_data_length Size of the buffer. It receives the required size if buffer is too small.
- *
- * @retval NRF_SUCCESS If the parameter was received successfully. If one of the arguments
- * was invalid (for example, the buffer was too small), an error code
- * is returned.
- */
-ret_code_t hal_nfc_parameter_get(hal_nfc_param_id_t id, void * p_data, size_t * p_max_data_length);
-
-
-/** @brief Function for starting the NFC subsystem.
- *
- * After this function completes, NFC readers will be able to detect the chip.
- *
- * @retval NRF_SUCCESS If the NFC subsystem was started successfully. If the NFC
- * subsystem could not be started, an error code is returned.
- */
-ret_code_t hal_nfc_start(void);
-
-
-/** @brief Function for sending a packet to the connected NFC reader.
- *
- * The provided data buffer belongs to the caller and is guaranteed to be
- * valid until the HAL_NFC_EVENT_DATA_TRANSMITTED event is received by the
- * callback.
- *
- * @param[in] p_data The data packet to send.
- * @param[in] data_length Size of the packet in bytes.
- *
- * @retval NRF_SUCCESS If the packet was sent. Otherwise, an error code is returned.
- */
-ret_code_t hal_nfc_send(const uint8_t * p_data, size_t data_length);
-
-
-/** @brief Function for stopping the NFC subsystem.
- *
- * After this function returns, NFC readers will no longer be able to connect
- * to the chip.
- *
- * @retval NRF_SUCCESS If the NFC subsystem was stopped. Otherwise, an error code
- * is returned.
- */
-ret_code_t hal_nfc_stop(void);
-
-
-/** @brief Function for releasing resources.
- *
- * After this call returns, the callback is considered invalid and no more
- * events will be posted to it.
- *
- * @retval NRF_SUCCESS This function always succeeds.
- */
-ret_code_t hal_nfc_done(void);
-
-/** @} */
-#endif /* HAL_NFC_H__ */
-
diff --git a/components/nfc/t2t_lib/license.txt b/components/nfc/t2t_lib/license.txt
deleted file mode 100644
index fb8b852..0000000
--- a/components/nfc/t2t_lib/license.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-Copyright (c) 2015 - 2017, Telit Communications Cyprus Ltd
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form, except as embedded into a Nordic
- Semiconductor ASA integrated circuit in a product or a software update for
- such product, must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. Neither the name of Nordic Semiconductor ASA nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-4. This software, with or without modification, must only be used with a
- Nordic Semiconductor ASA integrated circuit.
-
-5. Any software provided in binary form under this license must not be reverse
- engineered, decompiled, modified and/or disassembled.
-
-THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/components/nfc/t2t_lib/nfc_fixes.h b/components/nfc/t2t_lib/nfc_fixes.h
deleted file mode 100644
index 1dc7b79..0000000
--- a/components/nfc/t2t_lib/nfc_fixes.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_FIXES_H__
-#define NFC_FIXES_H__
-
-#include
-
-/** @file
- * @defgroup nfc_fixes NFC fixes and workarounds
- * @{
- * @ingroup nfc_t2t
- * @brief @tagAPI52 Fixes for hardware-related anomalies.
- *
- * If you are using PCA10040 (part of nRF52 Development Kit),
- * you must define the macro HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND in order to apply
- * workarounds for the following anomalies:
- * - 79. NFCT: A false EVENTS_FIELDDETECTED event occurs after the field is lost.
- * - 116. NFCT does not release HFCLK when switching from ACTIVATED to SENSE mode.
- *
- * If you are using PCA10056 (part of nRF52840 Development Kit),
- * you must define the macro HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND in order to apply
- * workarounds for the following anomalies:
- * - 98. NFCT: The NFCT is not able to communicate with the peer.
- * - 116. NFCT does not release HFCLK when switching from ACTIVATED to SENSE mode.
- *
- * The current code contains a patch for anomaly 25 (NFCT: Reset value of
- * SENSRES register is incorrect), so that it now works on Windows Phone.
- */
-
-#ifdef BOARD_PCA10040 // assume nRF52832 chip in IC rev. Engineering B or Engineering C
- #define HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
-#elif defined(BOARD_PCA10056) // assume nRF52840 chip in IC rev. Engineering A
- #define HAL_NFC_NRF52840_ENGINEERING_A_WORKAROUND
-#endif
-
-/** @} */
-#endif /* NFC_FIXES_H__ */
-
diff --git a/components/nfc/t2t_lib/nfc_t2t_lib.h b/components/nfc/t2t_lib/nfc_t2t_lib.h
deleted file mode 100644
index 5544f0a..0000000
--- a/components/nfc/t2t_lib/nfc_t2t_lib.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Telit Communications Cyprus Ltd
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T2T_LIB_H__
-#define NFC_T2T_LIB_H__
-
-/** @file
- *
- * @addtogroup nfc_api
- *
- * @defgroup nfc_t2t NFC Type 2 Tag
- * @ingroup nfc_api
- * @brief Implementation of NFC Type 2 Tag.
- *
- * @defgroup nfc_t2t_lib NFC tag 2 type emulation library
- * @{
- * @ingroup nfc_t2t
- * @brief The T2T emulation library interface.
- */
-
-#include
-#include
-
-#define NFC_T2T_SIZEOF_INTERNAL_BYTES 10 ///< T2T internal byte size.
-#define NFC_T2T_MAX_PAYLOAD_SIZE 988 ///< Maximum NDEF message size.
-#define NFC_T2T_MAX_PAYLOAD_SIZE_RAW 1008 ///< No NDEF-TLV and no implicit lock bytes at the end.
-
-/** @brief Events passed to the callback function. */
-typedef enum
-{
- NFC_T2T_EVENT_NONE,
- ///< Not used.
-
- NFC_T2T_EVENT_FIELD_ON,
- ///< NFC tag has detected external NFC field and was selected by an NFC polling device.
-
- NFC_T2T_EVENT_FIELD_OFF,
- ///< External NFC field has been removed.
-
- NFC_T2T_EVENT_DATA_READ,
- ///< NFC polling device has read all tag data.
- /**<
- * Repeated reading in the same session i.e. before @ref NFC_T2T_EVENT_FIELD_OFF event,
- * will not trigger another @ref NFC_T2T_EVENT_DATA_READ event.
- */
-
- NFC_T2T_EVENT_STOPPED
- ///< Reference to the application NFC callback has been released using @ref nfc_t2t_done.
-} nfc_t2t_event_t;
-
-typedef enum
-{
- NFC_T2T_PARAM_TESTING ///< Used for unit tests.
-} nfc_t2t_param_id_t;
-
-/** @brief Callback to pass events from NFC T2T Library to application.
- *
- * @param[in] p_context Application context for callback execution.
- * @param[in] event The event that occurred.
- * @param[in] p_data Data to send to the application (event specific).
- * @param[in] data_length Length of the data.
- */
-typedef void (*nfc_t2t_callback_t)(void * p_context,
- nfc_t2t_event_t event,
- const uint8_t * p_data,
- size_t data_length);
-
-/** @brief Function for registering the application callback for event signaling.
- *
- * The callback will be called by NFC T2T Library to notify the application of relevant
- * events. It will be called from the HAL_NFC callback context.
- *
- * @param[in] callback Function pointer to the callback.
- * @param[in] p_context Pointer to a memory area used by the callback for execution (optional).
- *
- * @retval NRF_SUCCESS If the application callback was registered successfully. If one
- * of the arguments was invalid, an error code is returned.
- */
-ret_code_t nfc_t2t_setup(nfc_t2t_callback_t callback, void * p_context);
-
-/** @brief Function for setting an NFC parameter.
- *
- * @note Not implemented. For future use.
- *
- * This function allows to set any parameter defined as available by HAL_NFC.
- *
- * @param[in] id ID of the parameter to set.
- * @param[in] p_data Pointer to a buffer containing the data to set.
- * @param[in] data_length Size of the buffer containing the data to set.
- *
- * @retval NRF_SUCCESS If the parameter was set successfully. If one of the arguments
- * was invalid (for example, a wrong data length), an error code
- * is returned.
- */
-ret_code_t nfc_t2t_parameter_set(nfc_t2t_param_id_t id, void * p_data, size_t data_length);
-
-/** @brief Function for querying an NFC parameter value.
- *
- * @note Not implemented. For future use.
- *
- * The queried value will be placed into the passed data buffer. If the buffer
- * is too small, p_max_data_length will contain the required buffer size. If the
- * buffer is big enough, p_max_data_length will contain the actual size of the
- * data.
- *
- * @param[in] id ID of the parameter to query.
- * @param[in] p_data Pointer to a buffer receiving the queried data.
- * @param[in, out] p_max_data_length Size of the buffer, receives actual size of queried data.
- *
- * @retval NRF_SUCCESS If the parameter was received successfully. If one of the arguments
- * was invalid (for example, the buffer was too small), an error code
- * is returned.
- */
-ret_code_t nfc_t2t_parameter_get(nfc_t2t_param_id_t id, void * p_data, size_t * p_max_data_length);
-
-/** @brief Function for registering the payload to send on reception of a READ request.
- *
- * The payload is considered to only contain the NDEF message to deliver to a
- * reader. The required NDEF TLV will be created implicitly by NFC T2T Library.
- *
- * The pointer to the payload must stay valid for the duration of the library
- * execution, or until it is explicitly released.
- *
- * If the pointer is not NULL, but the length is zero, the paypload is
- * considered to be an empty NDEF message.
- *
- * If a new payload is registered, the previously registered one is considered
- * released.
- *
- * Passing a NULL pointer releases the current payload without registering a
- * new one.
- *
- * If an invalid size is given (too big), the function returns with an error
- * and the currently registered payload is left unchanged.
- *
- * @param[in] p_payload Pointer to the memory area containing the payload to send.
- * @param[in] payload_length Size of the payload in bytes.
- *
- * @retval NRF_SUCCESS If the operation was successful. If one
- * of the arguments was invalid, an error code is returned.
- */
-ret_code_t nfc_t2t_payload_set(const uint8_t * p_payload, size_t payload_length);
-
-/** @brief Function for registering the raw payload to send on reception of a READ request.
- *
- * The payload will be delivered directly as-is to the reader, without
- * implicitly adding an NDEF TLV container. This can be used if the
- * application wants to define the TLVs itself, for example, to provide a different
- * memory layout.
- *
- * The pointer to the payload must stay valid for the duration of the library
- * execution, or until it is explicitly released.
- *
- * If a new payload is registered, the previously registered one is considered
- * released.
- *
- * Passing a NULL pointer releases the current payload, without registering a
- * new one.
- *
- * If an invalid size is given (too big), the function returns with an error
- * and the currently registered payload is left unchanged.
- *
- * @param[in] p_payload Pointer to the memory area containing the payload to send.
- * @param[in] payload_length Size of the payload in bytes.
- *
- * @retval NRF_SUCCESS If the operation was successful. If one
- * of the arguments was invalid, an error code is returned.
- */
-ret_code_t nfc_t2t_payload_raw_set(const uint8_t * p_payload, size_t payload_length);
-
-/** @brief Function for registering the sequence of internal bytes.
- *
- * This refers to the first 10 bytes of the tag memory. The library will set
- * a sensible default for these bytes. The application can use this function
- * to override the default.
- *
- * Passing a NULL pointer reverts back to the default sequence.
- * The data will be copied by NFC T2T Library, so the memory does not have to remain valid
- * after the function returns.
- *
- * @note When modifying the internal bytes, remember that they must be consistent
- * with the NFC hardware register settings (see @ref nfc_t2t_format_internal).
- *
- * @param[in] p_data Pointer to the memory area containing the data.
- * @param[in] data_length Size of the data in bytes.
- *
- * @retval NRF_SUCCESS If the operation was successful. If the data was not NULL and the
- * data length was not 10, an error code is returned.
- */
-ret_code_t nfc_t2t_internal_set(const uint8_t * p_data, size_t data_length);
-
-/** @brief Function for activating the NFC frontend.
- *
- * You must call this function so that events are posted to the application
- * callback.
- *
- * @retval NRF_SUCCESS If the NFC frontend was activated successfully. If the lower layer
- * could not be started, an error code is returned.
- */
-ret_code_t nfc_t2t_emulation_start(void);
-
-/** @brief Function for deactivating the NFC frontend.
- *
- * After calling this function, no more events will be posted to the
- * application callback.
- *
- * @retval NRF_SUCCESS If the NFC frontend was deactivated successfully. If the lower layer
- * could not be stopped, an error code is returned.
- */
-ret_code_t nfc_t2t_emulation_stop(void);
-
-/** @brief Function for releasing the reference to the application callback.
- *
- * After calling this function, the passed callback pointer is no longer
- * considered valid.
- *
- * @retval NRF_SUCCESS This function always succeeds.
- */
-ret_code_t nfc_t2t_done(void);
-
-/** @} */
-#endif // NFC_T2T_LIB_H__
diff --git a/components/nfc/t2t_lib/nfc_t2t_lib_gcc.a b/components/nfc/t2t_lib/nfc_t2t_lib_gcc.a
deleted file mode 100644
index c46954d..0000000
Binary files a/components/nfc/t2t_lib/nfc_t2t_lib_gcc.a and /dev/null differ
diff --git a/components/nfc/t2t_lib/nfc_t2t_lib_iar.a b/components/nfc/t2t_lib/nfc_t2t_lib_iar.a
deleted file mode 100644
index 5dc28cc..0000000
Binary files a/components/nfc/t2t_lib/nfc_t2t_lib_iar.a and /dev/null differ
diff --git a/components/nfc/t2t_parser/nfc_t2t_parser.c b/components/nfc/t2t_parser/nfc_t2t_parser.c
deleted file mode 100644
index 6b448c5..0000000
--- a/components/nfc/t2t_parser/nfc_t2t_parser.c
+++ /dev/null
@@ -1,679 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_common.h"
-#if NRF_MODULE_ENABLED(NFC_T2T_PARSER)
-
-#include
-#include
-#include "nrf_delay.h"
-#include "nfc_t2t_parser.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_T2T_PARSER"
-#if NFC_T2T_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_T2T_PARSER_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_T2T_PARSER_INFO_COLOR
-#else // NFC_T2T_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_T2T_PARSER_LOG_ENABLED
-#include "nrf_log.h"
-
-/// Gets least significant nibble (a 4-bit value) from a byte.
-#define LSN_GET(val) (val & 0x0F)
-
-/// Gets most significant nibble (a 4-bit value) from a byte.
-#define MSN_GET(val) ((val >> 4) & 0x0F)
-
-/**
- * @brief Function for inserting the TLV block into a @ref type_2_tag_t structure.
- *
- * The content of a TLV block structure pointed by the p_tlv_block is copied into a TLV block
- * array within the structure pointed by the p_type_2_tag.
- *
- * @param[in,out] p_type_2_tag Pointer to the structure that contains the TLV blocks array.
- * @param[in] p_tlv_block Pointer to the TLV block to insert.
- *
- * @retval NRF_SUCCESS If the block was inserted successfully.
- * @retval NRF_ERROR_NO_MEM If there is already maximum number of blocks stored in the array.
- *
- */
-static ret_code_t type_2_tag_tlv_block_insert(type_2_tag_t * p_type_2_tag,
- tlv_block_t * p_tlv_block)
-{
- if (p_type_2_tag->tlv_count == p_type_2_tag->max_tlv_blocks)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- // Copy contents of the source block.
- p_type_2_tag->p_tlv_block_array[p_type_2_tag->tlv_count] = *p_tlv_block;
- p_type_2_tag->tlv_count++;
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for checking if the TLV block length is correct.
- *
- * Some TLV block has predefined length:
- * TLV_NULL and TLV_TERMINATOR always have a length of 1 byte.
- * TLV_LOCK_CONTROL and TLV_MEMORY_CONTROL always have a length of 3 bytes.
- *
- * @param[in] p_block_to_check Pointer to the structure that contains the TLV block length.
- *
- * @retval TRUE If the length is correct.
- * @retval FALSE Otherwise.
- *
- */
-static bool tlv_block_is_data_length_correct(tlv_block_t * p_block_to_check)
-{
- switch (p_block_to_check->tag)
- {
- case TLV_NULL:
- case TLV_TERMINATOR:
- if (p_block_to_check->length != TLV_NULL_TERMINATOR_LEN)
- {
- return false;
- }
- break;
-
- case TLV_LOCK_CONTROL:
- case TLV_MEMORY_CONTROL:
- if (p_block_to_check->length != TLV_LOCK_MEMORY_CTRL_LEN)
- {
- return false;
- }
- break;
-
- case TLV_NDEF_MESSAGE:
- case TLV_PROPRIETARY:
- default:
- // Any length will do.
- break;
- }
-
- return true;
-}
-
-/**
- * @brief Function for checking if the end of the tag data area was reached.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains the data area size.
- * @param[in] offset Current byte offset.
- *
- * @retval TRUE If the offset indicates the end of the data area.
- * @retval FALSE Otherwise.
- *
- */
-static bool type_2_tag_is_end_reached(type_2_tag_t * p_type_2_tag, uint16_t offset)
-{
- return offset == (p_type_2_tag->cc.data_area_size + T2T_FIRST_DATA_BLOCK_OFFSET);
-}
-
-
-/**
- * @brief Function for checking if version of Type 2 Tag specification read from a tag is supported.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains the tag version.
- *
- * @retval TRUE If the version is supported and tag data can be parsed.
- * @retval FALSE Otherwise.
- *
- */
-static bool type_2_tag_is_version_supported(type_2_tag_t * p_type_2_tag)
-{
- // Simple check atm, as only 1 major version has been issued so far, so no backward compatibility
- // is needed, tags with newer version implemented shall be rejected according to the doc.
- return p_type_2_tag->cc.major_version == T2T_SUPPORTED_MAJOR_VERSION;
-}
-
-
-/**
- * @brief Function for checking if the field fits into the data area specified in
- * the Capability Container.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains the data area size.
- * @param[in] offset As Offset of the field to check.
- * @param[in] field_length Length of the field to check.
- *
- * @retval TRUE If the field fits into the data area.
- * @retval FALSE If the field exceeds the data area.
- *
- */
-static bool type_2_tag_is_field_within_data_range(type_2_tag_t * p_type_2_tag,
- uint16_t offset,
- uint16_t field_length)
-{
- // Invalid argument, return false.
- if (field_length == 0)
- {
- return false;
- }
- return ( (offset + field_length - 1) <
- (p_type_2_tag->cc.data_area_size + T2T_FIRST_DATA_BLOCK_OFFSET) )
- && ( offset >= T2T_FIRST_DATA_BLOCK_OFFSET );
-}
-
-
-/**
- * @brief Function for reading the tag field of a TLV block from the p_raw_data buffer.
- *
- * This function reads the tag field containing a TLV block type and inserts its value into
- * a structure pointed by the p_tlv_buf pointer.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains Type 2 Tag data parsed so far.
- * @param[in] p_raw_data Pointer to the buffer with a raw data from the tag.
- * @param[in,out] p_t_offset As input: offset of the tag field to read. As output: offset of
- * the first byte after the tag field.
- * @param[out] p_tlv_buf Pointer to a @ref tlv_block_t structure where the tag type will be
- * inserted.
- *
- * @retval NRF_SUCCESS If the tag field at specified offset is correct.
- * @retval NRF_ERROR_INVALID_DATA If the tag field at specified offset exceeds the data
- * area specified in the Capability Container.
- *
- */
-static ret_code_t type_2_tag_type_extract(type_2_tag_t * p_type_2_tag,
- uint8_t * p_raw_data,
- uint16_t * p_t_offset,
- tlv_block_t * p_tlv_buf)
-{
- if (!type_2_tag_is_field_within_data_range(p_type_2_tag, *p_t_offset, TLV_T_LENGTH))
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- p_tlv_buf->tag = p_raw_data[*p_t_offset];
- *p_t_offset += TLV_T_LENGTH;
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for reading the length field of a TLV block from the p_raw_data buffer.
- *
- * This function reads the length field of a TLV block and inserts its value into a structure
- * pointed by the p_tlv_buf pointer.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains Type 2 Tag data parsed so far.
- * @param[in] p_raw_data Pointer to the buffer with a raw data from the tag.
- * @param[in,out] p_l_offset As input: offset of the length field to read. As output: offset of
- * the first byte after the length field.
- * @param[out] p_tlv_buf Pointer to a @ref tlv_block_t structure where the length will be
- * inserted.
- *
- * @retval NRF_SUCCESS If the length field at specified offset is correct.
- * @retval NRF_ERROR_INVALID_DATA If the length field at specified offset exceeds the data
- * area specified in the Capability Container or has
- * incorrect format.
- *
- */
-static ret_code_t type_2_tag_length_extract(type_2_tag_t * p_type_2_tag,
- uint8_t * p_raw_data,
- uint16_t * p_l_offset,
- tlv_block_t * p_tlv_buf)
-{
- uint16_t length;
-
- if (!type_2_tag_is_field_within_data_range(p_type_2_tag, *p_l_offset, TLV_L_SHORT_LENGTH))
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- length = p_raw_data[*p_l_offset];
-
- if (length == TLV_L_FORMAT_FLAG)
- {
- // Check another two bytes.
- if (!type_2_tag_is_field_within_data_range(p_type_2_tag, *p_l_offset, TLV_L_LONG_LENGTH))
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- length = uint16_big_decode(&p_raw_data[*p_l_offset + 1]);
-
- // Long length value cannot be lower than 0xFF.
- if (length < 0xFF)
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- p_tlv_buf->length = length;
- *p_l_offset += TLV_L_LONG_LENGTH;
-
- }
- else
- {
- p_tlv_buf->length = length;
- *p_l_offset += TLV_L_SHORT_LENGTH;
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for reading a pointer to the value field of a TLV block from the p_raw_data buffer.
- *
- * This function reads a pointer to the value field of a TLV block and inserts it into
- * a structure pointed by the p_tlv_buf pointer. If there is no value field present in the
- * TLV block, NULL is inserted.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains Type 2 Tag data parsed so far.
- * @param[in] p_raw_data Pointer to the buffer with a raw data from the tag.
- * @param[in,out] p_v_offset As input: offset of the value field to read. As output: offset of
- * the first byte after the value field.
- * @param[in,out] p_tlv_buf Pointer to a @ref tlv_block_t structure where the value field
- * pointer will be inserted.
- *
- * @retval NRF_SUCCESS If the value field at specified offset is correct.
- * @retval NRF_ERROR_INVALID_DATA If the value field at specified offset exceeds the data
- * area specified in the Capability Container.
- *
- */
-static ret_code_t type_2_tag_value_ptr_extract(type_2_tag_t * p_type_2_tag,
- uint8_t * p_raw_data,
- uint16_t * p_v_offset,
- tlv_block_t * p_tlv_buf)
-{
- if (p_tlv_buf->length == 0)
- {
- // Clear the value pointer, don't touch the offset.
- p_tlv_buf->p_value = NULL;
- }
- else
- {
- if (!type_2_tag_is_field_within_data_range(p_type_2_tag, *p_v_offset, p_tlv_buf->length))
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- p_tlv_buf->p_value = p_raw_data + *p_v_offset;
- *p_v_offset += p_tlv_buf->length;
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for reading a single TLV block from the p_raw_data buffer.
- *
- * This function reads a single TLV block from the p_raw_data buffer and stores its contents in a
- * structure pointed by the p_tlv_buf.
- *
- * @param[in] p_type_2_tag Pointer to the structure that contains Type 2 Tag data parsed so far.
- * @param[in] p_raw_data Pointer to the buffer with a raw data from the tag.
- * @param[in,out] p_tlv_offset As input: offset of the TLV block to read. As output: offset of the
- * next TLV block, 0 if it was the last block.
- * @param[out] p_tlv_buf Pointer to a @ref tlv_block_t structure that will be filled with
- * the data read.
- *
- * @retval NRF_SUCCESS If the parsing operation of the block succeeded. Otherwise, an error
- * code is returned.
- *
- */
-static ret_code_t type_2_tag_tlv_block_extract(type_2_tag_t * p_type_2_tag,
- uint8_t * p_raw_data,
- uint16_t * p_offset,
- tlv_block_t * p_tlv_buf)
-{
- ret_code_t err_code;
- memset(p_tlv_buf, 0, sizeof(tlv_block_t));
-
- // TLV Tag field.
- err_code = type_2_tag_type_extract(p_type_2_tag, p_raw_data, p_offset, p_tlv_buf);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- // Further processing depends on tag field value.
- switch (p_tlv_buf->tag)
- {
- case TLV_NULL:
- // Simply ignore NULL blocks, leave the incremented offset.
- break;
-
- case TLV_TERMINATOR:
- // Write 0 to the offset variable, indicating that last TLV block was found.
- *p_offset = 0;
- break;
-
- case TLV_LOCK_CONTROL:
- case TLV_MEMORY_CONTROL:
- case TLV_NDEF_MESSAGE:
- case TLV_PROPRIETARY:
- default:
- // Unknown blocks should also be extracted.
- err_code = type_2_tag_length_extract(p_type_2_tag, p_raw_data, p_offset, p_tlv_buf);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (p_tlv_buf->length > 0)
- {
- err_code = type_2_tag_value_ptr_extract(p_type_2_tag, p_raw_data, p_offset, p_tlv_buf);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
-
- break;
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for checking the checksum bytes of the UID stored in internal area.
- *
- * This function calculates the block check character (BCC) bytes based on the parsed serial number
- * and compares them with bytes read from the Type 2 Tag.
- *
- * @param[in] p_sn Pointer to the @ref type_2_tag_serial_number_t structure to check.
- *
- * @retval TRUE If the calculated BCC matched the BCC from the tag.
- * @retval FALSE Otherwise.
- *
- */
-static bool type_2_tag_is_bcc_correct(type_2_tag_serial_number_t * p_sn)
-{
- uint8_t bcc1 = (uint8_t)T2T_UID_BCC_CASCADE_BYTE ^
- (uint8_t)p_sn->manufacturer_id ^
- (uint8_t)((p_sn->serial_number_part_1 >> 8) & 0xFF) ^
- (uint8_t)(p_sn->serial_number_part_1 & 0xFF);
-
- uint8_t bcc2 = (uint8_t)((p_sn->serial_number_part_2 >> 24) & 0xFF) ^
- (uint8_t)((p_sn->serial_number_part_2 >> 16) & 0xFF) ^
- (uint8_t)((p_sn->serial_number_part_2 >> 8) & 0xFF) ^
- (uint8_t)( p_sn->serial_number_part_2 & 0xFF);
-
- return (bcc1 == p_sn->check_byte_0) && (bcc2 == p_sn->check_byte_1);
-}
-
-
-/**
- * @brief Function for parsing an internal area of a Type 2 Tag.
- *
- * This function reads data from an internal area in the raw data buffer and fills the
- * @ref type_2_tag_serial_number_t structure within @ref type_2_tag_t.
- *
- * @param[in,out] p_type_2_tag Pointer to the structure that will be filled with parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw data from the tag.
- *
- * @retval NRF_SUCCESS If the parsing operation of the internal area succeeded.
- * Otherwise, an error code is returned.
- *
- */
-static ret_code_t type_2_tag_internal_parse(type_2_tag_t * p_type_2_tag, uint8_t * p_raw_data)
-{
- p_type_2_tag->sn.manufacturer_id = p_raw_data[0];
- p_type_2_tag->sn.serial_number_part_1 = uint16_big_decode(&p_raw_data[1]);
- p_type_2_tag->sn.check_byte_0 = p_raw_data[3];
- p_type_2_tag->sn.serial_number_part_2 = uint32_big_decode(&p_raw_data[4]);
- p_type_2_tag->sn.check_byte_1 = p_raw_data[8];
- p_type_2_tag->sn.internal = p_raw_data[9];
-
- p_type_2_tag->lock_bytes = uint16_big_decode(&p_raw_data[10]);
-
- if (!type_2_tag_is_bcc_correct(&p_type_2_tag->sn))
- {
- NRF_LOG_WARNING("Warning! BCC of the serial number is not correct!\r\n");
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for parsing a Capabiliy Container area of a Type 2 Tag.
- *
- * This function reads data from a Capability Container area in the raw data buffer and fills the
- * @ref type_2_tag_capability_container_t structure within @ref type_2_tag_t.
- *
- * @param[in,out] p_type_2_tag Pointer to the structure that will be filled with parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw data from the tag.
- *
- * @retval NRF_SUCCESS If the parsing operation of the Capability Container succeeded.
- * Otherwise, an error code is returned.
- *
- */
-static ret_code_t type_2_tag_cc_parse(type_2_tag_t * p_type_2_tag, uint8_t * p_raw_data)
-{
- uint8_t * p_cc_block = p_raw_data + T2T_CC_BLOCK_OFFSET;
-
- if (p_cc_block[0] != T2T_NFC_FORUM_DEFINED_DATA)
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- p_type_2_tag->cc.major_version = MSN_GET(p_cc_block[1]);
- p_type_2_tag->cc.minor_version = LSN_GET(p_cc_block[1]);
- p_type_2_tag->cc.data_area_size = p_cc_block[2] * 8;
- p_type_2_tag->cc.read_access = MSN_GET(p_cc_block[3]);
- p_type_2_tag->cc.write_access = LSN_GET(p_cc_block[3]);
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for parsing a single TLV block.
- *
- * This function reads a single TLV block from the raw data buffer, from the position indicated by
- * the p_tlv_offset, and adds it to the @ref type_2_tag_t structure.
- *
- * @param[in,out] p_type_2_tag Pointer to the structure that will be filled with parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw data from the tag.
- * @param[in,out] p_tlv_offset As input: offset of the TLV block to parse. As output: offset of the
- * next TLV block, 0 if it was the last block.
- *
- * @retval NRF_SUCCESS If the parsing operation of the block succeeded. Otherwise, an error
- * code is returned.
- *
- */
-static ret_code_t type_2_tag_tlv_parse(type_2_tag_t * p_type_2_tag,
- uint8_t * p_raw_data,
- uint16_t * p_tlv_offset)
-{
- ret_code_t err_code;
- tlv_block_t new_block;
-
- // Get tag field.
- err_code = type_2_tag_tlv_block_extract(p_type_2_tag, p_raw_data, p_tlv_offset, &new_block);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (!tlv_block_is_data_length_correct(&new_block))
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- // Further action depends on tag type.
- switch (new_block.tag)
- {
- case TLV_NULL:
- case TLV_TERMINATOR:
- // Ignore them.
- break;
-
- case TLV_LOCK_CONTROL:
- case TLV_MEMORY_CONTROL:
- case TLV_NDEF_MESSAGE:
- case TLV_PROPRIETARY:
- default:
- // Unknown tag types are also added.
- err_code = type_2_tag_tlv_block_insert(p_type_2_tag, &new_block);
- if (err_code != NRF_SUCCESS)
- {
- NRF_LOG_WARNING("Warning! Not enough memory to insert all of the blocks!\r\n");
- return err_code;
- }
- break;
- }
-
- return NRF_SUCCESS;
-}
-
-
-void type_2_tag_clear(type_2_tag_t * p_type_2_tag)
-{
- p_type_2_tag->tlv_count = 0;
- memset(&p_type_2_tag->cc, 0, sizeof(p_type_2_tag->cc));
- memset(&p_type_2_tag->sn, 0, sizeof(p_type_2_tag->sn));
-}
-
-
-ret_code_t type_2_tag_parse(type_2_tag_t * p_type_2_tag, uint8_t * p_raw_data)
-{
- ret_code_t err_code;
-
- type_2_tag_clear(p_type_2_tag);
-
- err_code = type_2_tag_internal_parse(p_type_2_tag, p_raw_data);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- err_code = type_2_tag_cc_parse(p_type_2_tag, p_raw_data);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
-
- if (!type_2_tag_is_version_supported(p_type_2_tag))
- {
- return NRF_ERROR_NOT_SUPPORTED;
- }
-
- uint16_t offset = T2T_FIRST_DATA_BLOCK_OFFSET;
-
- while (offset > 0)
- {
- // Check if end of tag is reached (no terminator block was present).
- if (type_2_tag_is_end_reached(p_type_2_tag, offset))
- {
- NRF_LOG_DEBUG("No terminator block was found in the tag!\r\n");
- break;
- }
-
- err_code = type_2_tag_tlv_parse(p_type_2_tag, p_raw_data, &offset);
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
-
- return NRF_SUCCESS;
-}
-
-
-void type_2_tag_printout(type_2_tag_t * p_type_2_tag)
-{
- uint32_t i;
- NRF_LOG_INFO("Type 2 Tag contents:\r\n\r\n");
- NRF_LOG_INFO("Number of TLV blocks: %d\r\n\r\n", p_type_2_tag->tlv_count);
-
- NRF_LOG_INFO("Internal data:\r\n");
- NRF_LOG_INFO(" Manufacturer ID: 0x%02x\r\n", p_type_2_tag->sn.manufacturer_id);
- NRF_LOG_INFO(" Serial number part 1: 0x%04x\r\n", p_type_2_tag->sn.serial_number_part_1);
- NRF_LOG_INFO(" Check byte 0: 0x%02x\r\n", p_type_2_tag->sn.check_byte_0);
- NRF_LOG_INFO(" Serial number part 2: 0x%08lx\r\n", p_type_2_tag->sn.serial_number_part_2);
- NRF_LOG_INFO(" Check byte 1: 0x%02x\r\n", p_type_2_tag->sn.check_byte_1);
- NRF_LOG_INFO(" Internal byte: 0x%02x\r\n", p_type_2_tag->sn.internal);
- NRF_LOG_INFO(" Lock bytes: 0x%04x\r\n\r\n", p_type_2_tag->lock_bytes);
-
- NRF_LOG_INFO("Capability Container data:\r\n");
- NRF_LOG_INFO(" Major version number: %d\r\n", p_type_2_tag->cc.major_version);
- NRF_LOG_INFO(" Minor version number: %d\r\n", p_type_2_tag->cc.minor_version);
- NRF_LOG_INFO(" Data area size: %d\r\n", p_type_2_tag->cc.data_area_size);
- NRF_LOG_INFO(" Read access: 0x%02X\r\n", p_type_2_tag->cc.read_access);
- NRF_LOG_INFO(" Write access: 0x%02X\r\n\r\n", p_type_2_tag->cc.write_access);
-
- for (i = 0; i < p_type_2_tag->tlv_count; i++)
- {
- NRF_LOG_INFO("TLV block 0x%02X: \r\n", p_type_2_tag->p_tlv_block_array[i].tag);
- switch (p_type_2_tag->p_tlv_block_array[i].tag)
- {
- case TLV_LOCK_CONTROL:
- NRF_LOG_INFO("Lock Control\r\n\r\n");
- break;
- case TLV_MEMORY_CONTROL:
- NRF_LOG_INFO("Memory Control\r\n\r\n");
- break;
- case TLV_NDEF_MESSAGE:
- NRF_LOG_INFO("NDEF Message\r\n\r\n");
- break;
- case TLV_PROPRIETARY:
- NRF_LOG_INFO("Proprietary\r\n\r\n");
- break;
- case TLV_NULL:
- NRF_LOG_INFO("Null\r\n\r\n");
- break;
- case TLV_TERMINATOR:
- NRF_LOG_INFO("Terminator\r\n\r\n");
- break;
- default:
- NRF_LOG_INFO("Unknown\r\n\r\n");
- break;
- }
-
- NRF_LOG_INFO(" Length: %d\r\n", p_type_2_tag->p_tlv_block_array[i].length);
-
- if (p_type_2_tag->p_tlv_block_array[i].length > 0)
- {
- NRF_LOG_INFO(" Data:\r\n");
- NRF_LOG_HEXDUMP_INFO(p_type_2_tag->p_tlv_block_array[i].p_value,
- p_type_2_tag->p_tlv_block_array[i].length);
- }
- NRF_LOG_INFO("\r\n\r\n");
- }
-}
-
-#endif // NRF_MODULE_ENABLED(NFC_T2T_PARSER)
diff --git a/components/nfc/t2t_parser/nfc_t2t_parser.h b/components/nfc/t2t_parser/nfc_t2t_parser.h
deleted file mode 100644
index d59e211..0000000
--- a/components/nfc/t2t_parser/nfc_t2t_parser.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_TYPE_2_TAG_PARSER_H__
-#define NFC_TYPE_2_TAG_PARSER_H__
-
-#include
-#include "nfc_tlv_block.h"
-#include "sdk_errors.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup nfc_type_2_tag Type 2 Tag
- * @{
- * @ingroup nfc_type_2_tag_parser
- *
- * @brief Descriptor for a Type 2 Tag.
- *
- */
-
-/**
- * @brief Descriptor for the internal bytes of a Type 2 Tag.
- */
-typedef struct
-{
- uint8_t manufacturer_id; ///< Manufacturer ID (the most significant byte of the UID/serial number).
- uint16_t serial_number_part_1; ///< Bytes 5-4 of the tag UID.
- uint8_t check_byte_0; ///< First block check character byte (XOR of the cascade tag byte, manufacturer ID byte, and the serial_number_part_1 bytes).
- uint32_t serial_number_part_2; ///< Bytes 3-0 of the tag UID.
- uint8_t check_byte_1; ///< Second block check character byte (XOR of the serial_number_part_2 bytes).
- uint8_t internal; ///< Tag internal bytes.
-} type_2_tag_serial_number_t;
-
-/**
- * @brief Descriptor for the Capability Container (CC) bytes of a Type 2 Tag.
- */
-typedef struct
-{
- uint8_t major_version; ///< Major version of the supported Type 2 Tag specification.
- uint8_t minor_version; ///< Minor version of the supported Type 2 Tag specification.
- uint16_t data_area_size; ///< Size of the data area in bytes.
- uint8_t read_access; ///< Read access for the data area.
- uint8_t write_access; ///< Write access for the data area.
-} type_2_tag_capability_container_t;
-
-/**
- * @brief Type 2 Tag descriptor.
- */
-typedef struct
-{
- type_2_tag_serial_number_t sn; ///< Values within the serial number area of the tag.
- uint16_t lock_bytes; ///< Value of the lock bytes.
- type_2_tag_capability_container_t cc; ///< Values within the Capability Container area of the tag.
-
- uint16_t const max_tlv_blocks; ///< Maximum number of TLV blocks that can be stored.
- tlv_block_t * p_tlv_block_array; ///< Pointer to the array for TLV blocks.
- uint16_t tlv_count; ///< Number of TLV blocks stored in the Type 2 Tag.
-
-} type_2_tag_t;
-
-/**
- * @brief Macro for creating and initializing a Type 2 Tag descriptor.
- *
- * This macro creates and initializes a static instance of a @ref type_2_tag_t structure and
- * an array of @ref tlv_block_t descriptors.
- *
- * Use the macro @ref NFC_TYPE_2_TAG_DESC to access the Type 2 Tag descriptor instance.
- *
- * @param[in] NAME Name of the created descriptor instance.
- * @param[in] MAX_BLOCKS Maximum number of @ref tlv_block_t descriptors that can be stored in the array.
- *
- */
-#define NFC_TYPE_2_TAG_DESC_DEF(NAME, MAX_BLOCKS) \
- static tlv_block_t NAME##_tlv_block_array[MAX_BLOCKS]; \
- static type_2_tag_t NAME##_type_2_tag = \
- { \
- .max_tlv_blocks = MAX_BLOCKS, \
- .p_tlv_block_array = NAME##_tlv_block_array, \
- .tlv_count = 0 \
- }
-
-/**
- * @brief Macro for accessing the @ref type_2_tag_t instance that was created
- * with @ref NFC_TYPE_2_TAG_DESC_DEF.
- */
-#define NFC_TYPE_2_TAG_DESC(NAME) (NAME##_type_2_tag)
-
-
-#define T2T_NFC_FORUM_DEFINED_DATA 0xE1 ///< Value indicating that the Type 2 Tag contains NFC Forum defined data.
-#define T2T_UID_BCC_CASCADE_BYTE 0x88 ///< Value used for calculating the first BCC byte of a Type 2 Tag serial number.
-
-#define T2T_SUPPORTED_MAJOR_VERSION 1 ///< Supported major version of the Type 2 Tag specification.
-#define T2T_SUPPORTED_MINOR_VERSION 2 ///< Supported minor version of the Type 2 Tag specification.
-
-#define T2T_BLOCK_SIZE 4 ///< Type 2 Tag block size in bytes.
-
-#define T2T_CC_BLOCK_OFFSET 12 ///< Offset of the Capability Container area in the Type 2 Tag.
-#define T2T_FIRST_DATA_BLOCK_OFFSET 16 ///< Offset of the data area in the Type 2 Tag.
-
-/**
- * @}
- */
-
-
-/**
- * @defgroup nfc_type_2_tag_parser NFC Type 2 Tag parser
- * @{
- * @ingroup nfc_t2t
- *
- * @brief Parser for Type 2 Tag data.
- *
- */
-
-/**
- * @brief Function for clearing the @ref type_2_tag_t structure.
- *
- * @param[in,out] p_type_2_tag Pointer to the structure that should be cleared.
- *
- */
-void type_2_tag_clear(type_2_tag_t * p_type_2_tag);
-
-/**
- * @brief Function for parsing raw data read from a Type 2 Tag.
- *
- * This function parses the header and the following TLV blocks of a Type 2 Tag. The data is read
- * from a buffer and stored in a @ref type_2_tag_t structure.
- *
- * @param[out] p_type_2_tag Pointer to the structure that will be filled with parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw data from the tag (should
- * point at the first byte of the first block of the tag).
- *
- * @retval NRF_SUCCESS If the data was parsed successfully.
- * @retval NRF_ERROR_NO_MEM If there is not enough memory to store all of the TLV blocks.
- * @retval Other If an error occurred during the parsing operation.
- *
- */
-ret_code_t type_2_tag_parse(type_2_tag_t * p_type_2_tag, uint8_t * p_raw_data);
-
-/**
- * @brief Function for printing parsed contents of the Type 2 Tag.
- *
- * @param[in] p_type_2_tag Pointer to the structure that should be printed.
- *
- */
-void type_2_tag_printout(type_2_tag_t * p_type_2_tag);
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_TYPE_2_TAG_PARSER_H__ */
diff --git a/components/nfc/t2t_parser/nfc_tlv_block.h b/components/nfc/t2t_parser/nfc_tlv_block.h
deleted file mode 100644
index f399e63..0000000
--- a/components/nfc/t2t_parser/nfc_tlv_block.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_TLV_BLOCK_H__
-#define NFC_TLV_BLOCK_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**@file
- *
- * @defgroup nfc_type_2_tag_tlv_block Type 2 Tag TLV blocks
- * @{
- * @ingroup nfc_type_2_tag_parser
- *
- * @brief Descriptor for a Type 2 Tag TLV block.
- *
- */
-
-/**
- * @brief Tag field values.
- *
- * Possible values for the tag field in a TLV block.
- */
-typedef enum
-{
- TLV_NULL = 0x00, ///< Might be used for padding of memory areas.
- TLV_LOCK_CONTROL = 0x01, ///< Defines details of the lock bits.
- TLV_MEMORY_CONTROL = 0x02, ///< Identifies reserved memory areas.
- TLV_NDEF_MESSAGE = 0x03, ///< Contains an NDEF message.
- TLV_PROPRIETARY = 0xFD, ///< Tag proprietary information.
- TLV_TERMINATOR = 0xFE ///< Last TLV block in the data area.
-} tlv_block_types_t;
-
-/**
- * @brief TLV block descriptor.
- */
-typedef struct
-{
- uint8_t tag; ///< Type of the TLV block.
- uint16_t length; ///< Length of the value field.
- uint8_t * p_value; ///< Pointer to the value field (NULL if no value field is present in the block).
-} tlv_block_t;
-
-#define TLV_T_LENGTH 1 ///< Length of a tag field.
-
-#define TLV_L_SHORT_LENGTH 1 ///< Length of a short length field.
-#define TLV_L_LONG_LENGTH 3 ///< Length of an extended length field.
-#define TLV_L_FORMAT_FLAG 0xFF ///< Value indicating the use of an extended length field.
-
-#define TLV_NULL_TERMINATOR_LEN 0 ///< Predefined length of the NULL and TERMINATOR TLV blocks.
-#define TLV_LOCK_MEMORY_CTRL_LEN 3 ///< Predefined length of the LOCK CONTROL and MEMORY CONTROL blocks.
-
-/**
- * @}
- */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_TLV_BLOCK_H__ */
diff --git a/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.c b/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.c
deleted file mode 100644
index 4119dbd..0000000
--- a/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if NFC_T4T_APDU_ENABLED
-
-#include "nfc_t4t_apdu.h"
-#include "sdk_macros.h"
-#include "nordic_common.h"
-#include "app_util.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_T4T_APDU"
-#if NFC_T4T_APDU_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_T4T_APDU_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_T4T_APDU_LOG_COLOR
-#else // NFC_T4T_APDU_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_T4T_APDU_LOG_ENABLED
-#include "nrf_log.h"
-
-/**
- * @brief Field sizes that can be present in CAPDU.
- */
-#define CLASS_TYPE_SIZE 1U
-#define INSTRUCTION_TYPE_SIZE 1U
-#define PARAMETER_SIZE 2U
-#define LC_SHORT_FORMAT_SIZE 1U
-#define LC_LONG_FORMAT_SIZE 3U
-#define LE_SHORT_FORMAT_SIZE 1U
-#define LE_LONG_FORMAT_SIZE 2U
-
-/**
- * @brief Values used to encode Lc field in CAPDU.
- */
-#define LC_LONG_FORMAT_TOKEN 0x00
-#define LC_LONG_FORMAT_THR 0xFF
-
-/**
- * @brief Values used to encode Le field in CAPDU.
- */
-#define LE_FIELD_ABSENT 0U
-#define LE_LONG_FORMAT_THR 0x0100
-#define LE_ENCODED_VAL_256 0x00
-
-
-#define STATUS_SIZE 2U ///< Size of Status field contained in RAPDU.
-
-/**
- * @brief Function for calculating size of CAPDU.
- */
-__STATIC_INLINE uint16_t nfc_t4t_comm_apdu_size_calc(nfc_t4t_comm_apdu_t const * const p_cmd_apdu)
-{
- uint16_t res = CLASS_TYPE_SIZE + INSTRUCTION_TYPE_SIZE + PARAMETER_SIZE;
- if (p_cmd_apdu->data.p_buff != NULL)
- {
- if (p_cmd_apdu->data.len > LC_LONG_FORMAT_THR)
- {
- res += LC_LONG_FORMAT_SIZE;
- }
- else
- {
- res += LC_SHORT_FORMAT_SIZE;
- }
- }
- res += p_cmd_apdu->data.len;
- if (p_cmd_apdu->resp_len != LE_FIELD_ABSENT)
- {
- if (p_cmd_apdu->resp_len > LE_LONG_FORMAT_THR)
- {
- res += LE_LONG_FORMAT_SIZE;
- }
- else
- {
- res += LE_SHORT_FORMAT_SIZE;
- }
- }
- return res;
-}
-
-
-/**
- * @brief Function for validating arguments used by CAPDU encoding procedure.
- */
-__STATIC_INLINE ret_code_t nfc_t4t_comm_apdu_args_validate(nfc_t4t_comm_apdu_t const * const p_cmd_apdu,
- uint8_t * p_raw_data,
- uint16_t * const p_len)
-{
- if((p_cmd_apdu == NULL) || (p_raw_data == NULL) || (p_len == NULL))
- {
- return NRF_ERROR_NULL;
- }
-
- if ((p_cmd_apdu->data.p_buff != NULL) && (p_cmd_apdu->data.len == 0))
- {
- return NRF_ERROR_INVALID_PARAM;
- }
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_t4t_comm_apdu_encode(nfc_t4t_comm_apdu_t const * const p_cmd_apdu,
- uint8_t * p_raw_data,
- uint16_t * const p_len)
-{
- // Validate passed arguments.
- ret_code_t err_code = nfc_t4t_comm_apdu_args_validate(p_cmd_apdu, p_raw_data, p_len);
- VERIFY_SUCCESS(err_code);
-
- // Check if there is enough memory in the provided buffer to store described CAPDU.
- uint16_t comm_apdu_len = nfc_t4t_comm_apdu_size_calc(p_cmd_apdu);
- if (comm_apdu_len > *p_len)
- {
- return NRF_ERROR_NO_MEM;
- }
- *p_len = comm_apdu_len;
-
- // Start to encode described CAPDU in the buffer.
- *p_raw_data++ = p_cmd_apdu->class_byte;
- *p_raw_data++ = p_cmd_apdu->instruction;
- *p_raw_data++ = MSB_16(p_cmd_apdu->parameter);
- *p_raw_data++ = LSB_16(p_cmd_apdu->parameter);
-
- // Check if optional data field should be included.
- if (p_cmd_apdu->data.p_buff != NULL)
- {
- if (p_cmd_apdu->data.len > LC_LONG_FORMAT_THR) // Use long data length encoding.
- {
- *p_raw_data++ = LC_LONG_FORMAT_TOKEN;
- *p_raw_data++ = MSB_16(p_cmd_apdu->data.len);
- *p_raw_data++ = LSB_16(p_cmd_apdu->data.len);
- }
- else // Use short data length encoding.
- {
- *p_raw_data++ = LSB_16(p_cmd_apdu->data.len);
- }
- memcpy(p_raw_data, p_cmd_apdu->data.p_buff, p_cmd_apdu->data.len);
- p_raw_data += p_cmd_apdu->data.len;
- }
-
- // Check if optional response length field present (Le) should be included.
- if (p_cmd_apdu->resp_len != LE_FIELD_ABSENT)
- {
- if (p_cmd_apdu->resp_len > LE_LONG_FORMAT_THR) // Use long response length encoding.
- {
- *p_raw_data++ = MSB_16(p_cmd_apdu->resp_len);
- *p_raw_data++ = LSB_16(p_cmd_apdu->resp_len);
- }
- else // Use short response length encoding.
- {
- if (p_cmd_apdu->resp_len == LE_LONG_FORMAT_THR)
- {
- *p_raw_data++ = LE_ENCODED_VAL_256;
- }
- else
- {
- *p_raw_data++ = LSB_16(p_cmd_apdu->resp_len);
- }
- }
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for validating arguments used by RAPDU decoding procedure.
- */
-__STATIC_INLINE ret_code_t nfc_t4t_resp_apdu_args_validate(nfc_t4t_resp_apdu_t const * const p_resp_apdu,
- uint8_t const * const p_raw_data,
- uint16_t len)
-{
- if ((p_resp_apdu == NULL) || (p_raw_data == NULL))
- {
- return NRF_ERROR_NULL;
- }
-
- if (len < STATUS_SIZE)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_t4t_resp_apdu_decode(nfc_t4t_resp_apdu_t * const p_resp_apdu,
- uint8_t const * const p_raw_data,
- uint16_t len)
-{
- // Validate passed arguments.
- ret_code_t err_code = nfc_t4t_resp_apdu_args_validate(p_resp_apdu, p_raw_data, len);
- VERIFY_SUCCESS(err_code);
-
- nfc_t4t_resp_apdu_clear(p_resp_apdu);
- if (len != STATUS_SIZE) // Optional data field is present in RAPDU.
- {
- p_resp_apdu->data.len = len - STATUS_SIZE;
- p_resp_apdu->data.p_buff = (uint8_t *) p_raw_data;
- }
- p_resp_apdu->status = uint16_big_decode(p_raw_data + p_resp_apdu->data.len);
-
- return NRF_SUCCESS;
-}
-
-
-void nfc_t4t_resp_apdu_printout(nfc_t4t_resp_apdu_t * p_resp_apdu)
-{
- NRF_LOG_INFO("R-APDU status: %4X \r\n", p_resp_apdu->status);
- if (p_resp_apdu->data.p_buff != NULL)
- {
- NRF_LOG_INFO("R-APDU data: \r\n");
- NRF_LOG_HEXDUMP_INFO(p_resp_apdu->data.p_buff, p_resp_apdu->data.len);
- }
- else
- {
- NRF_LOG_INFO("R-APDU no data field present.\r\n");
- }
-}
-
-
-#endif // NFC_T4T_APDU_ENABLED
-
diff --git a/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.h b/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.h
deleted file mode 100644
index 0ab72c7..0000000
--- a/components/nfc/t4t_parser/apdu/nfc_t4t_apdu.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T4T_APDU_H__
-#define NFC_T4T_APDU_H__
-
-/**@file
- *
- * @defgroup nfc_t4t_apdu APDU reader/writer
- * @{
- * @ingroup nfc_t4t_parser
- *
- * @brief APDU reader/writer for Type 4 Tag communication.
- *
- */
-
-#include
-#include
-#include "sdk_errors.h"
-#include "nrf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CLASS_BYTE_NO_SECURE_MSG 0x00 ///< Class byte indicating no secure messaging, used in C-APDU.
-
-/**
- * @name Parameters used when selecting instruction code in C-APDU.
- * @{
- */
-#define SELECT_BY_FILE_ID 0x000C ///< Select by file identifier, first or only occurence.
-#define SELECT_BY_NAME 0x0400 ///< Select by name, first or only occurence.
-/** @} */
-
-/**
- * @name Status codes contained in R-APDU.
- * @{
- */
-#define RAPDU_STATUS_CMD_COMPLETED 0x9000 ///< Command completed successfully.
-#define RAPDU_STATUS_SEL_ITEM_NOT_FOUND 0x6A82 ///< Selected item has not been found.
-/** @} */
-
-/**
- * @brief Possible instruction codes in C-APDU.
- */
-typedef enum
-{
- NFC_T4T_CAPDU_SELECT_INS = 0xA4, ///< Code used for selecting EF or NDEF application.
- NFC_T4T_CAPDU_READ_INS = 0xB0, ///< Code used for selecting EF or NDEF application.
- NFC_T4T_CAPDU_UPDATE_INS = 0xD6 ///< Code used for selecting EF or NDEF application.
-} nfc_t4t_comm_apdu_ins_type_t;
-
-/**
- * @brief APDU data field descriptor.
- */
-typedef struct
-{
- uint16_t len; ///< Data field length.
- uint8_t * p_buff; ///< Pointer to data field.
-} nfc_t4t_apdu_data_t;
-
-/**
- * @brief Command Application Protocol Data Unit (C-APDU) descriptor.
- */
-typedef struct
-{
- uint8_t class_byte; ///< Class byte.
- nfc_t4t_comm_apdu_ins_type_t instruction; ///< The chosen code of instruction.
- uint16_t parameter; ///< Parameters associated with the instruction code.
- nfc_t4t_apdu_data_t data; ///< Optional data fields (Lc + data bytes).
- uint16_t resp_len; ///< Optional response length field (Le).
-} nfc_t4t_comm_apdu_t;
-
-/**
- * @brief Response Application Protocol Data Unit (R-APDU) descriptor.
- */
-typedef struct
-{
- uint16_t status; ///< Mandatory status field.
- nfc_t4t_apdu_data_t data; ///< Optional data field.
-} nfc_t4t_resp_apdu_t;
-
-/**
- * @brief Macro for verifying R-APDU descriptor status.
- *
- * This macro verifies R-APDU descriptor status. It will cause the exterior
- * function to return nrf_error translated from R-APDU status, if the status is
- * not equal to @ref RAPDU_STATUS_CMD_COMPLETED.
- *
- * @param[in] P_RAPDU Pointer to R-APDU descriptor.
- *
- * @retval NRF_ERROR_NOT_FOUND If C-APDU select command could not find the selected item.
- * @retval NRF_ERROR_INTERNAL Unknown R-APDU error.
- */
-#define VERIFY_RAPDU_SUCCESS(P_RAPDU) \
- if (P_RAPDU->status == RAPDU_STATUS_SEL_ITEM_NOT_FOUND) \
- { \
- return NRF_ERROR_NOT_FOUND; \
- } \
- if (P_RAPDU->status != RAPDU_STATUS_CMD_COMPLETED) \
- { \
- return NRF_ERROR_INTERNAL; \
- }
-
-/**
- * @brief Function for clearing C-APDU descriptor and restoring its default values.
- *
- * @param[in] p_cmd_apdu Pointer to C-APDU descriptor.
- */
-__STATIC_INLINE void nfc_t4t_comm_apdu_clear(nfc_t4t_comm_apdu_t * const p_cmd_apdu);
-
-/**
- * @brief Function for clearing R-APDU descriptor and restoring its default values.
- *
- * @param[in] p_resp_apdu Pointer to R-APDU descriptor.
- */
-__STATIC_INLINE void nfc_t4t_resp_apdu_clear(nfc_t4t_resp_apdu_t * const p_resp_apdu);
-
-/**
- * @brief Function for encoding C-APDU.
- *
- * This function encodes C-APDU according to the provided descriptor.
- *
- * @param[in] p_cmd_apdu Pointer to the C-APDU descriptor.
- * @param[out] p_raw_data Pointer to the buffer with encoded C-APDU.
- * @param[in,out] p_len Size of the available memory for the C-APDU as input.
- * Size of the generated C-APDU as output.
- *
- * @retval NRF_SUCCESS If C-APDU was encoded successfully.
- * @retval NRF_ERROR_NO_MEM If the predicted C-APDU size is bigger than the provided buffer space.
- * @retval NRF_ERROR_INVALID_PARAM If C-APDU descriptor is invalid.
- * @retval NRF_ERROR_NULL If any passed argument is NULL.
- */
-ret_code_t nfc_t4t_comm_apdu_encode(nfc_t4t_comm_apdu_t const * const p_cmd_apdu,
- uint8_t * p_raw_data,
- uint16_t * const p_len);
-
-/**
- * @brief Function for decoding R-APDU.
- *
- * This function decodes buffer with encoded R-APDU and stores results in the R-APDU descriptor.
- *
- * @param[out] p_resp_apdu Pointer to the R-APDU descriptor.
- * @param[in] p_raw_data Pointer to the buffer with encoded R-APDU.
- * @param[in] len Size of of the buffer with encoded R-APDU.
- *
- * @retval NRF_SUCCESS If R-APDU was encoded successfully.
- * @retval NRF_ERROR_INVALID_LENGTH If the buffer is too small to hold a valid R-APDU.
- * @retval NRF_ERROR_NULL If any passed argument is NULL.
- */
-ret_code_t nfc_t4t_resp_apdu_decode(nfc_t4t_resp_apdu_t * const p_resp_apdu,
- uint8_t const * const p_raw_data,
- uint16_t len);
-
-/**
- * @brief Function for printing a R-APDU descriptor.
- *
- * This function prints a R-APDU descriptor.
- *
- * @param[in] p_resp_apdu Pointer to the R-APDU descriptor.
- */
-void nfc_t4t_resp_apdu_printout(nfc_t4t_resp_apdu_t * p_resp_apdu);
-
-#ifndef SUPPRESS_INLINE_IMPLEMENTATION
-
-__STATIC_INLINE void nfc_t4t_comm_apdu_clear(nfc_t4t_comm_apdu_t * const p_cmd_apdu)
-{
- memset(p_cmd_apdu, 0, sizeof(nfc_t4t_comm_apdu_t));
-}
-
-__STATIC_INLINE void nfc_t4t_resp_apdu_clear(nfc_t4t_resp_apdu_t * const p_resp_apdu)
-{
- memset(p_resp_apdu, 0, sizeof(nfc_t4t_resp_apdu_t));
-}
-
-#endif // SUPPRESS_INLINE_IMPLEMENTATION
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_T4T_APDU_H__ */
diff --git a/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.c b/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.c
deleted file mode 100644
index 4b7d811..0000000
--- a/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.c
+++ /dev/null
@@ -1,266 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "sdk_config.h"
-#if NFC_T4T_CC_FILE_PARSER_ENABLED
-
-#include
-#include "nfc_t4t_cc_file.h"
-#include "sdk_macros.h"
-#include "nordic_common.h"
-#include "app_util.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_T4T_CC_FILE_PARSER"
-#if NFC_T4T_CC_FILE_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_T4T_CC_FILE_PARSER_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_T4T_CC_FILE_PARSER_INFO_COLOR
-#else // NFC_T4T_CC_FILE_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_T4T_CC_FILE_PARSER_LOG_ENABLED
-#include "nrf_log.h"
-
-/**
- * @brief Valid value range for CCLEN field.
- */
-#define CC_LEN_MIN_VALUE 0x000F
-#define CC_LEN_MAX_VALUE 0xFFFE
-
-/**
- * @brief Valid major versions of Type 4 Tag specification.
- */
-#define NFC_T4T_EXTENDED_MAJOR_VER 0x03 ///< Major version number allowing first TLV block to be Extended NDEF File Control TLV
-#define NFC_T4T_REGULAR_MAJOR_VER 0x02 ///< Major version number allowing first TLV block to be NDEF File Control TLV
-
-/**
- * @brief Valid value range for MLe field.
- */
-#define MLE_LEN_MIN_VALUE 0x000F
-#define MLE_LEN_MAX_VALUE 0xFFFF
-
-/**
- * @brief Valid value range for MLc field.
- */
-#define MLC_LEN_MIN_VALUE 0x0001
-#define MLC_LEN_MAX_VALUE 0xFFFF
-
-/**
- * @brief Field sizes that are present in CC file.
- */
-#define CC_LEN_FIELD_SIZE 2U
-#define MAP_VER_FIELD_SIZE 1U
-#define MLE_FIELD_SIZE 2U
-#define MLC_FIELD_SIZE 2U
-
-/// Gets least significant nibble (a 4-bit value) from a byte.
-#define LSN_GET(val) (val & 0x0F)
-
-/// Gets most significant nibble (a 4-bit value) from a byte.
-#define MSN_GET(val) ((val >> 4) & 0x0F)
-
-/**
- * @brief Function for validating arguments used by CC file parsing procedure.
- */
-__STATIC_INLINE ret_code_t nfc_t4t_cc_args_validate(nfc_t4t_capability_container_t * p_t4t_cc_file,
- uint8_t * p_raw_data,
- uint16_t len)
-{
- if ( (p_t4t_cc_file == NULL)
- || (p_t4t_cc_file->p_tlv_block_array == NULL)
- || (p_raw_data == NULL) )
- {
- return NRF_ERROR_NULL;
- }
-
- if ( (len < CC_LEN_MIN_VALUE) || (len > CC_LEN_MAX_VALUE) )
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- if (p_t4t_cc_file->max_tlv_blocks == 0)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for validating CC file descriptor content.
- */
-__STATIC_INLINE ret_code_t nfc_t4t_cc_file_validate(nfc_t4t_capability_container_t * p_t4t_cc_file)
-{
- uint16_t type = p_t4t_cc_file->p_tlv_block_array[0].type;
-
- if ( (p_t4t_cc_file->major_version == NFC_T4T_EXTENDED_MAJOR_VER
- && type == EXTENDED_NDEF_FILE_CONTROL_TLV) ||
- (p_t4t_cc_file->major_version == NFC_T4T_REGULAR_MAJOR_VER
- && type == NDEF_FILE_CONTROL_TLV) )
- {
- return NRF_SUCCESS;
- }
-
- return NRF_ERROR_INVALID_DATA;
-}
-
-
-/**
- * @brief Function for clearing all TLV blocks from CC file descriptor.
- */
-__STATIC_INLINE void nfc_t4t_cc_file_clear(nfc_t4t_capability_container_t * p_t4t_cc_file)
-{
- p_t4t_cc_file->tlv_count = 0;
-}
-
-
-/**
- * @brief Function for adding a TLV block to the CC file descriptor.
- */
-static ret_code_t nfc_t4t_tlv_block_insert(nfc_t4t_capability_container_t * p_t4t_cc_file,
- nfc_t4t_tlv_block_t * p_tlv_block)
-{
- if (p_t4t_cc_file->tlv_count == p_t4t_cc_file->max_tlv_blocks)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- // Copy contents of the source block.
- p_t4t_cc_file->p_tlv_block_array[p_t4t_cc_file->tlv_count] = *p_tlv_block;
- p_t4t_cc_file->tlv_count++;
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_t4t_cc_file_parse(nfc_t4t_capability_container_t * p_t4t_cc_file,
- uint8_t * p_raw_data,
- uint16_t len)
-{
- ret_code_t err_code = nfc_t4t_cc_args_validate(p_t4t_cc_file, p_raw_data, len);
- VERIFY_SUCCESS(err_code);
-
- uint8_t * p_offset = p_raw_data;
- nfc_t4t_cc_file_clear(p_t4t_cc_file);
-
- p_t4t_cc_file->len = uint16_big_decode(p_offset);
- p_offset += CC_LEN_FIELD_SIZE;
-
- p_t4t_cc_file->major_version = MSN_GET(*p_offset);
- p_t4t_cc_file->minor_version = LSN_GET(*p_offset);
- p_offset += MAP_VER_FIELD_SIZE;
-
- p_t4t_cc_file->max_rapdu_size = uint16_big_decode(p_offset);
- p_offset += MLE_FIELD_SIZE;
-
- p_t4t_cc_file->max_capdu_size = uint16_big_decode(p_offset);
- p_offset += MLC_FIELD_SIZE;
-
- nfc_t4t_tlv_block_t new_block;
- len -= (p_offset - p_raw_data);
- while (len > 0)
- {
- uint16_t tlv_len = len;
- err_code = nfc_t4t_file_control_tlv_parse(&new_block, p_offset, &tlv_len);
- VERIFY_SUCCESS(err_code);
- p_offset += tlv_len;
- len -= tlv_len;
-
- err_code = nfc_t4t_tlv_block_insert(p_t4t_cc_file, &new_block);
- VERIFY_SUCCESS(err_code);
- }
-
- return nfc_t4t_cc_file_validate(p_t4t_cc_file);
-}
-
-
-nfc_t4t_tlv_block_t * nfc_t4t_file_content_get(nfc_t4t_capability_container_t * p_t4t_cc_file,
- uint16_t file_id)
-{
- nfc_t4t_tlv_block_t * p_tlv_array = p_t4t_cc_file->p_tlv_block_array;
- for (uint8_t i = 0; i < p_t4t_cc_file->tlv_count; i++)
- {
- nfc_t4t_file_control_val_t * p_tlv_value = &p_tlv_array[i].value;
- if (p_tlv_value->file_id == file_id)
- {
- return (p_tlv_array + i);
- }
- }
- return NULL;
-}
-
-
-ret_code_t nfc_t4t_file_content_set(nfc_t4t_capability_container_t * p_t4t_cc_file,
- nfc_t4t_file_t file,
- uint16_t file_id)
-{
- nfc_t4t_tlv_block_t * p_tlv_block;
-
- p_tlv_block = nfc_t4t_file_content_get(p_t4t_cc_file, file_id);
- if (p_tlv_block != NULL)
- {
- p_tlv_block->value.file = file;
- return NRF_SUCCESS;
- }
- return NRF_ERROR_NOT_FOUND;
-}
-
-
-void nfc_t4t_cc_file_printout(nfc_t4t_capability_container_t * p_t4t_cc_file)
-{
- NRF_LOG_INFO("Capability Container File content: \r\n")
- NRF_LOG_INFO("CCLEN: %d \r\n", p_t4t_cc_file->len);
- NRF_LOG_INFO("Mapping Version: %d.%d \r\n",
- p_t4t_cc_file->major_version,
- p_t4t_cc_file->minor_version);
- NRF_LOG_INFO("MLe: %d \r\n", p_t4t_cc_file->max_rapdu_size)
- NRF_LOG_INFO("MLc: %d \r\n\r\n", p_t4t_cc_file->max_capdu_size)
-
- NRF_LOG_INFO("Capability Container File contains %d File Control TLV block(s).\r\n",
- p_t4t_cc_file->tlv_count);
- for (uint8_t i = 0; i < p_t4t_cc_file->tlv_count; i++)
- {
- nfc_t4t_file_control_tlv_printout(i, &p_t4t_cc_file->p_tlv_block_array[i]);
- }
- NRF_LOG_RAW_INFO("\r\n");
-}
-
-
-#endif // NFC_T4T_CC_FILE_PARSER_ENABLED
-
diff --git a/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.h b/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.h
deleted file mode 100644
index ec90764..0000000
--- a/components/nfc/t4t_parser/cc_file/nfc_t4t_cc_file.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T4T_CC_FILE_H__
-#define NFC_T4T_CC_FILE_H__
-
-/**@file
- *
- * @defgroup nfc_t4t_cc_file CC file parser
- * @{
- * @ingroup nfc_t4t_parser
- *
- * @brief Capability Container file parser for Type 4 Tag.
- *
- */
-
-#include
-#include "sdk_errors.h"
-#include "nfc_t4t_tlv_block.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Descriptor for the Capability Container (CC) file of Type 4 Tag.
- */
-typedef struct
-{
- nfc_t4t_tlv_block_t * p_tlv_block_array; ///< Pointer to the array for TLV blocks.
- uint16_t tlv_count; ///< Number of TLV blocks stored in the Type 4 Tag.
- uint16_t const max_tlv_blocks; ///< Maximum number of TLV blocks.
- uint16_t len; ///< Size (bytes) of a Capability Container including this field.
- uint16_t max_rapdu_size; ///< MLe field - maximum R-APDU data size (bytes).
- uint16_t max_capdu_size; ///< MLc field - maximum C-APDU data size (bytes).
- uint8_t major_version; ///< Major version of the supported Type 4 Tag specification.
- uint8_t minor_version; ///< Minor version of the supported Type 4 Tag specification.
-} nfc_t4t_capability_container_t;
-
-/**
- * @brief Macro for creating and initializing a Type 4 Tag Capability Container descriptor.
- *
- * This macro creates and initializes a static instance of a @ref nfc_t4t_capability_container_t
- * structure and an array of @ref nfc_t4t_tlv_block_t descriptors.
- *
- * Use the macro @ref NFC_T4T_CC_DESC to access the Type 4 Tag descriptor instance.
- *
- * @param[in] NAME Name of the created descriptor instance.
- * @param[in] MAX_BLOCKS Maximum number of @ref nfc_t4t_tlv_block_t descriptors that can be
- * stored in the array.
- *
- */
-#define NFC_T4T_CC_DESC_DEF(NAME, MAX_BLOCKS) \
- static nfc_t4t_tlv_block_t NAME##_tlv_block_array[MAX_BLOCKS]; \
- static nfc_t4t_capability_container_t NAME##_type_4_tag = \
- { \
- .max_tlv_blocks = MAX_BLOCKS, \
- .p_tlv_block_array = NAME##_tlv_block_array, \
- .tlv_count = 0 \
- }
-
-/**
- * @brief Macro for accessing the @ref nfc_t4t_capability_container_t instance that was created
- * with @ref NFC_T4T_CC_DESC_DEF.
- *
- * @param[in] NAME Name of the created descriptor instance.
- */
-#define NFC_T4T_CC_DESC(NAME) (NAME##_type_4_tag)
-
-/**
- * @brief Function for parsing raw data of a CC file, read from a Type 4 Tag.
- *
- * This function parses raw data of a Capability Container file and stores the results in its
- * descriptor.
- *
- * @param[in,out] p_t4t_cc_file Pointer to the CC file descriptor that will be filled with
- * parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw data.
- * @param[in] len Buffer length.
- *
- * @retval NRF_SUCCESS If operation was successful.
- * @retval NRF_ERROR_NULL If any of the provided pointer arguments is NULL.
- * @retval NRF_ERROR_INVALID_LENGTH If provided buffer exceeds a valid CC file length range.
- * @retval NRF_ERROR_INVALID_DATA If mapping version of Type 4 Tag specification is not a
- * compatible CC file structure.
- * @retval Other Other error codes might be returned depending on
- * @ref nfc_t4t_file_control_tlv_parse function.
- */
-ret_code_t nfc_t4t_cc_file_parse(nfc_t4t_capability_container_t * p_t4t_cc_file,
- uint8_t * p_raw_data,
- uint16_t len);
-
-/**
- * @brief Function for finding File Control TLV block within the CC file descriptor.
- *
- * This function finds File Control TLV block that matches
- * the specified file ID within the CC file descriptor.
- *
- * @param[in] p_t4t_cc_file Pointer to the CC file descriptor.
- * @param[in] file_id File identifier.
- *
- * @retval TLV Pointer to the File Control TLV.
- * @retval NULL If TLV with the specified File ID was not found.
- */
-nfc_t4t_tlv_block_t * nfc_t4t_file_content_get(nfc_t4t_capability_container_t * p_t4t_cc_file,
- uint16_t file_id);
-
-/**
- * @brief Function for binding a file with its File Control TLV block.
- *
- * This function binds file content with its File Control TLV block, in which
- * maximal file size and access conditions are stored.
- *
- * @param[in,out] p_t4t_cc_file Pointer to the CC file descriptor.
- * @param[in] file File descriptor.
- * @param[in] file_id File identifier.
- *
- * @retval NRF_SUCCESS If operation was successful.
- * @retval NRF_ERROR_NOT_FOUND If the provided file ID does not match any ID stored in TLV blocks
- * of the CC file.
- */
-ret_code_t nfc_t4t_file_content_set(nfc_t4t_capability_container_t * p_t4t_cc_file,
- nfc_t4t_file_t file,
- uint16_t file_id);
-
-/**
- * @brief Function for printing the CC file descriptor.
- *
- * This function prints the CC file descriptor.
- *
- * @param[in] p_t4t_cc_file Pointer to the CC file.
- */
-void nfc_t4t_cc_file_printout(nfc_t4t_capability_container_t * p_t4t_cc_file);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_T4T_CC_FILE_H__ */
diff --git a/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.c b/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.c
deleted file mode 100644
index baf4452..0000000
--- a/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include "sdk_config.h"
-#if NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED
-
-#include "nfc_t4t_hl_detection_procedures.h"
-#include "nfc_t4t_apdu.h"
-#include "adafruit_pn532.h"
-#include "sdk_macros.h"
-#include "nordic_common.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_T4T_HL_DETECTION_PROCEDURES"
-#if NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR
-#else // NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED
-#include "nrf_log.h"
-
-#define CC_FILE_ID 0xE103 ///< File Identifier of Capability Container.
-#define FILE_ID_SIZE 2 ///< Size of File Identifier field in CC file.
-#define MIN_MAX_RAPDU_SIZE 0x0F ///< Minimal value of maximal RAPDU data field size.
-#define NDEF_FILE_NLEN_FIELD_SIZE 2 ///< Size of NLEN field in NDEF file.
-#define NDEF_APP_PROC_RESP_LEN 256 ///< Maximal size of RAPDU data in the NDEF Tag Application Select Procedure.
-
-// Adafruit library limitations.
-#define MAX_ADAFRUIT_RAPDU_SIZE 242 ///< Maximal value of RAPDU data field size
-#define MAX_ADAFRUIT_CAPDU_SIZE 56 ///< Maximal value of CAPDU data field size
-
-static uint8_t m_file_id[FILE_ID_SIZE]; ///< Buffer for selected EF ID storage.
-static const uint8_t m_nfc_t4t_select_ndef_app_data[] = {0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01}; ///< NDEF Tag Application name.
-static const uint8_t m_nlen_update_value[] = {0x00, 0x00}; ///< NLEN value used in NDEF Update Procedure.
-
-/**
- * @brief Function for performing APDU exchanges with Adafruit library.
- */
-static ret_code_t nfc_t4t_apdu_exchange(nfc_t4t_comm_apdu_t * const p_capdu,
- nfc_t4t_resp_apdu_t * const p_rapdu,
- uint8_t * const p_apdu_buff,
- uint8_t resp_len)
-{
- if (resp_len > APDU_BUFF_SIZE)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- uint16_t apdu_buff_len = APDU_BUFF_SIZE;
- ret_code_t err_code = nfc_t4t_comm_apdu_encode(p_capdu,
- p_apdu_buff,
- &apdu_buff_len);
- VERIFY_SUCCESS(err_code);
-
- err_code = adafruit_pn532_in_data_exchange(p_apdu_buff, apdu_buff_len, p_apdu_buff, &resp_len);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_resp_apdu_decode(p_rapdu, p_apdu_buff, resp_len);
- VERIFY_SUCCESS(err_code);
-
- nfc_t4t_resp_apdu_printout(p_rapdu);
- VERIFY_RAPDU_SUCCESS(p_rapdu);
-
- return err_code;
-}
-
-/**
- * @brief Function for performing APDU exchanges with Adafruit library with default response length.
- */
-static ret_code_t nfc_t4t_apdu_default_exchange(nfc_t4t_comm_apdu_t * const p_capdu,
- nfc_t4t_resp_apdu_t * const p_rapdu,
- uint8_t * const p_apdu_buff)
-{
- if (p_capdu->resp_len + sizeof(p_rapdu->status) > UINT8_MAX)
- {
- return NRF_ERROR_NOT_SUPPORTED;
- }
-
- uint8_t resp_len = (uint8_t) (p_capdu->resp_len + sizeof(p_rapdu->status));
- ret_code_t err_code = nfc_t4t_apdu_exchange(p_capdu, p_rapdu, p_apdu_buff, resp_len);
-
- return err_code;
-}
-
-
-/**
- * @brief Function for saving part of EF (contained in RAPDU) in storage buffer.
- */
-static ret_code_t nfc_t4t_file_chunk_save(nfc_t4t_resp_apdu_t const * const p_rapdu,
- uint8_t * const p_storage_buff,
- uint16_t storage_buff_len,
- uint16_t * const p_file_offset)
-{
- if (p_rapdu->data.p_buff == NULL)
- {
- return NRF_ERROR_NULL;
- }
- if ((*p_file_offset) + p_rapdu->data.len > storage_buff_len)
- {
- return NRF_ERROR_NO_MEM;
- }
-
- memcpy(p_storage_buff + (*p_file_offset), p_rapdu->data.p_buff, p_rapdu->data.len);
- *p_file_offset += p_rapdu->data.len;
-
- return NRF_SUCCESS;
-}
-
-
-/**
- * @brief Function for updating the remaining length of the read file.
- */
-static ret_code_t nfc_t4t_file_len_update(nfc_t4t_resp_apdu_t const * const p_rapdu,
- uint16_t * const p_len)
-{
- if (*p_len < p_rapdu->data.len)
- {
- return NRF_ERROR_INVALID_DATA;
- }
- *p_len -= p_rapdu->data.len;
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_t4t_ndef_tag_app_select(void)
-{
- ret_code_t err_code;
- nfc_t4t_comm_apdu_t capdu;
- nfc_t4t_resp_apdu_t rapdu;
- uint8_t apdu_buff[APDU_BUFF_SIZE];
-
- NRF_LOG_INFO("NDEF Tag Application Select Procedure \r\n");
-
- nfc_t4t_comm_apdu_clear(&capdu);
- capdu.instruction = NFC_T4T_CAPDU_SELECT_INS;
- capdu.parameter = SELECT_BY_NAME;
- capdu.data.p_buff = (uint8_t *) m_nfc_t4t_select_ndef_app_data;
- capdu.data.len = sizeof(m_nfc_t4t_select_ndef_app_data);
- capdu.resp_len = NDEF_APP_PROC_RESP_LEN;
-
- err_code = nfc_t4t_apdu_exchange(&capdu, &rapdu, apdu_buff, sizeof(rapdu.status));
- NRF_LOG_RAW_INFO("\r\n");
- return err_code;
-}
-
-
-ret_code_t nfc_t4t_file_select(uint16_t file_id)
-{
- ret_code_t err_code;
- nfc_t4t_comm_apdu_t capdu;
- nfc_t4t_resp_apdu_t rapdu;
- uint8_t apdu_buff[APDU_BUFF_SIZE];
-
- if (file_id != CC_FILE_ID)
- {
- NRF_LOG_INFO("File (ID = %4X) Select Procedure \r\n", file_id);
- }
- UNUSED_RETURN_VALUE(uint16_big_encode(file_id, m_file_id));
-
- nfc_t4t_comm_apdu_clear(&capdu);
- capdu.instruction = NFC_T4T_CAPDU_SELECT_INS;
- capdu.parameter = SELECT_BY_FILE_ID;
- capdu.data.p_buff = m_file_id;
- capdu.data.len = sizeof(m_file_id);
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- NRF_LOG_RAW_INFO("\r\n");
- return err_code;
-}
-
-
-ret_code_t nfc_t4t_cc_select(void)
-{
- NRF_LOG_INFO("Capability Container Select Procedure \r\n");
-
- return nfc_t4t_file_select(CC_FILE_ID);
-}
-
-
-ret_code_t nfc_t4t_cc_read(nfc_t4t_capability_container_t * const p_cc_file)
-{
- ret_code_t err_code;
- nfc_t4t_comm_apdu_t capdu;
- nfc_t4t_resp_apdu_t rapdu;
- uint16_t clen;
- uint16_t file_offset = 0;
- uint8_t storage_buff[CC_STORAGE_BUFF_SIZE];
- uint8_t apdu_buff[APDU_BUFF_SIZE];
-
- NRF_LOG_INFO("Capability Container Read Procedure \r\n");
-
- nfc_t4t_comm_apdu_clear(&capdu);
- capdu.instruction = NFC_T4T_CAPDU_READ_INS;
- capdu.parameter = file_offset;
- capdu.resp_len = MIN_MAX_RAPDU_SIZE;
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_chunk_save(&rapdu, storage_buff, CC_STORAGE_BUFF_SIZE, &file_offset);
- VERIFY_SUCCESS(err_code);
-
- clen = uint16_big_decode(storage_buff);
- err_code = nfc_t4t_file_len_update(&rapdu, &clen);
- VERIFY_SUCCESS(err_code);
-
- while (clen > 0)
- {
- capdu.parameter = file_offset;
- capdu.resp_len = MIN(MIN_MAX_RAPDU_SIZE, MIN(clen, MAX_ADAFRUIT_RAPDU_SIZE));
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_chunk_save(&rapdu, storage_buff, CC_STORAGE_BUFF_SIZE, &file_offset);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_len_update(&rapdu, &clen);
- VERIFY_SUCCESS(err_code);
- }
-
- err_code = nfc_t4t_cc_file_parse(p_cc_file, storage_buff, file_offset);
-
- NRF_LOG_RAW_INFO("\r\n");
- return err_code;
-}
-
-
-ret_code_t nfc_t4t_ndef_read(nfc_t4t_capability_container_t * const p_cc_file,
- uint8_t * p_ndef_file_buff,
- uint8_t ndef_file_buff_len)
-{
- ret_code_t err_code;
- nfc_t4t_comm_apdu_t capdu;
- nfc_t4t_resp_apdu_t rapdu;
- uint16_t len;
- uint16_t file_offset = 0;
- uint8_t apdu_buff[APDU_BUFF_SIZE];
-
- NRF_LOG_INFO("NDEF Read Procedure \r\n");
-
- // Read the NLEN (NDEF length) field of NDEF file.
- nfc_t4t_comm_apdu_clear(&capdu);
- capdu.instruction = NFC_T4T_CAPDU_READ_INS;
- capdu.parameter = file_offset;
- capdu.resp_len = NDEF_FILE_NLEN_FIELD_SIZE;
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_chunk_save(&rapdu, p_ndef_file_buff, ndef_file_buff_len, &file_offset);
- VERIFY_SUCCESS(err_code);
-
- len = uint16_big_decode(p_ndef_file_buff) + NDEF_FILE_NLEN_FIELD_SIZE;
- err_code = nfc_t4t_file_len_update(&rapdu, &len);
- VERIFY_SUCCESS(err_code);
-
- // Read the NDEF message.
- while (len > 0)
- {
- capdu.parameter = file_offset;
- capdu.resp_len = MIN(len, MIN(p_cc_file->max_rapdu_size, MAX_ADAFRUIT_RAPDU_SIZE));
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_chunk_save(&rapdu, p_ndef_file_buff, ndef_file_buff_len, &file_offset);
- VERIFY_SUCCESS(err_code);
-
- err_code = nfc_t4t_file_len_update(&rapdu, &len);
- VERIFY_SUCCESS(err_code);
- }
-
- // Bind NDEF File Control TLV with NDEF file.
- nfc_t4t_file_t file =
- {
- .p_content = p_ndef_file_buff,
- .len = file_offset
- };
- uint16_t file_id = uint16_big_decode(m_file_id);
- err_code = nfc_t4t_file_content_set(p_cc_file, file, file_id);
-
- NRF_LOG_RAW_INFO("\r\n");
- return err_code;
-}
-
-
-ret_code_t nfc_t4t_ndef_update(nfc_t4t_capability_container_t * const p_cc_file,
- uint8_t * p_ndef_file_buff,
- uint8_t ndef_file_buff_len)
-{
- ret_code_t err_code;
- nfc_t4t_comm_apdu_t capdu;
- nfc_t4t_resp_apdu_t rapdu;
- uint16_t len;
- uint16_t file_offset = 0;
- uint16_t file_id = uint16_big_decode(m_file_id);
- uint8_t apdu_buff[APDU_BUFF_SIZE];
- nfc_t4t_tlv_block_t * p_tlv_block;
-
- NRF_LOG_INFO("NDEF Update Procedure \r\n");
-
- if (ndef_file_buff_len < NDEF_FILE_NLEN_FIELD_SIZE)
- {
- return NRF_ERROR_INVALID_DATA;
- }
-
- // Check if selected NDEF file is registered in CC file descriptor.
- p_tlv_block = nfc_t4t_file_content_get(p_cc_file, file_id);
- if (p_tlv_block == NULL)
- {
- return NRF_ERROR_NULL;
- }
-
- // Check NDEF file capacity before writing anything to it.
- len = uint16_big_decode(p_ndef_file_buff);
- if ((len + NDEF_FILE_NLEN_FIELD_SIZE != ndef_file_buff_len) ||
- (ndef_file_buff_len > p_tlv_block->value.max_file_size))
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- // Write the value 0000h in the NLEN field.
- nfc_t4t_comm_apdu_clear(&capdu);
- capdu.instruction = NFC_T4T_CAPDU_UPDATE_INS;
- capdu.parameter = file_offset;
- capdu.data.p_buff = (uint8_t *) m_nlen_update_value;
- capdu.data.len = NDEF_FILE_NLEN_FIELD_SIZE;
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
- file_offset += NDEF_FILE_NLEN_FIELD_SIZE;
-
- // Write the NDEF message in the NDEF message field.
- while (len > 0)
- {
- capdu.parameter = file_offset;
- capdu.data.p_buff = p_ndef_file_buff + file_offset;
- capdu.data.len = MIN(len, MIN(p_cc_file->max_capdu_size, MAX_ADAFRUIT_CAPDU_SIZE));
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- file_offset += capdu.data.len;
- len -= capdu.data.len;
- }
-
- // Write the length of the NDEF message in the NLEN field.
- capdu.parameter = 0;
- capdu.data.p_buff = p_ndef_file_buff;
- capdu.data.len = NDEF_FILE_NLEN_FIELD_SIZE;
-
- err_code = nfc_t4t_apdu_default_exchange(&capdu, &rapdu, apdu_buff);
- VERIFY_SUCCESS(err_code);
-
- NRF_LOG_RAW_INFO("\r\n");
- return NRF_SUCCESS;
-}
-
-
-#endif // NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED
-
diff --git a/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.h b/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.h
deleted file mode 100644
index a685e9f..0000000
--- a/components/nfc/t4t_parser/hl_detection_procedure/nfc_t4t_hl_detection_procedures.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_H__
-#define NFC_T4T_HL_DETECTION_PROCEDURES_H__
-
-/**@file
- *
- * @defgroup nfc_t4t_parser NFC Type 4 Tag parser
- * @ingroup nfc_t4t
- * @brief Parser for Type 4 Tag data.
- *
- * @defgroup nfc_t4t_hl_detection_procedures High-level NDEF Detection Procedure
- * @{
- * @ingroup nfc_t4t_parser
- *
- * @brief High-level NDEF Detection Procedure for Type 4 Tag communication.
- *
- */
-
-#include
-#include "sdk_errors.h"
-#include "nfc_t4t_cc_file.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief Function for performing NDEF Tag Application Select Procedure.
- *
- * This function performs NDEF Tag Application Select Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.2.
- *
- * @retval NRF_SUCCESS If NDEF Tag Application was successfully selected.
- * @retval NRF_ERROR_NOT_FOUND If NDEF Tag Application was not found.
- * @retval NRF_ERROR_NO_MEM If the APDU buffer is too small.
- * @retval Other Other error codes may be returned depending on function
- * @ref adafruit_pn532_in_data_exchange and on @ref nfc_t4t_apdu
- * module functions.
- */
-ret_code_t nfc_t4t_ndef_tag_app_select(void);
-
-/**
- * @brief Function for performing Capability Container Select Procedure.
- *
- * This function performs Capability Container Select Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.3.
- *
- * @retval NRF_SUCCESS If the Capability Container file was successfully selected.
- * @retval NRF_ERROR_NOT_FOUND If the Capability Container file was not found.
- * @retval NRF_ERROR_NO_MEM If the APDU buffer is too small.
- * @retval Other Other error codes might be returned depending on function
- * @ref adafruit_pn532_in_data_exchange and on @ref nfc_t4t_apdu
- * module functions.
- */
-ret_code_t nfc_t4t_cc_select(void);
-
-/**
- * @brief Function for performing Capability Container Read Procedure.
- *
- * This function performs Capability Container Read Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.4.
- *
- * @param[out] p_cc_file Pointer to the Capability Container descriptor.
- *
- * @retval NRF_SUCCESS If Capability Container file was successfully read.
- * @retval NRF_ERROR_NO_MEM If APDU buffer or CC file storage buffer is too small.
- * @retval NRF_ERROR_NOT_SUPPORTED If the requested response length in C-APDU is too big.
- * @retval NRF_ERROR_NULL If R-APDU did not return any data bytes.
- * @retval NRF_ERROR_INVALID_DATA If CCLEN field is not coherent with R-APDU data length.
- * @retval Other Other error codes may be returned depending on functions
- * @ref adafruit_pn532_in_data_exchange, @ref nfc_t4t_cc_file_parse,
- * and on @ref nfc_t4t_apdu module functions.
- */
-ret_code_t nfc_t4t_cc_read(nfc_t4t_capability_container_t * const p_cc_file);
-
-/**
- * @brief Function for performing NDEF Select Procedure.
- *
- * This function performs NDEF Select Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.5.
- *
- * @param[in] file_id File Identifier to choose the correct file.
- *
- * @retval NRF_SUCCESS If NDEF file was successfully selected.
- * @retval NRF_ERROR_NOT_FOUND If NDEF file was not found.
- * @retval NRF_ERROR_NO_MEM If APDU buffer is too small.
- * @retval Other Other error codes may be returned depending on function
- * @ref adafruit_pn532_in_data_exchange and on @ref nfc_t4t_apdu
- * module functions.
- */
-ret_code_t nfc_t4t_file_select(uint16_t file_id);
-
-/**
- * @brief Function for performing NDEF Read Procedure.
- *
- * This function performs NDEF Read Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.6.
- *
- * @param[in,out] p_cc_file Pointer to the Capability Container descriptor.
- * @param[out] p_ndef_file_buff Pointer to the buffer where the NDEF file will be stored.
- * @param[in] ndef_file_buff_len Length of the provided NDEF file buffer.
- *
- * @retval NRF_SUCCESS If NDEF file was successfully read.
- * @retval NRF_ERROR_NO_MEM If APDU buffer or NDEF file buffer is too small.
- * @retval NRF_ERROR_NOT_SUPPORTED If requested response length in C-APDU is too big.
- * @retval NRF_ERROR_NULL If R-APDU did not return any data bytes.
- * @retval NRF_ERROR_INVALID_DATA If NLEN field is not coherent with R-APDU data length.
- * @retval Other Other error codes may be returned depending on function
- * @ref adafruit_pn532_in_data_exchange, @ref nfc_t4t_file_content_set,
- * and on @ref nfc_t4t_apdu module functions.
- */
-ret_code_t nfc_t4t_ndef_read(nfc_t4t_capability_container_t * const p_cc_file,
- uint8_t * p_ndef_file_buff,
- uint8_t ndef_file_buff_len);
-
-/**
- * @brief Function for performing NDEF Update Procedure.
- *
- * This function performs NDEF Update Procedure according to "Type 4 Tag Operation"
- * (Version 3.0 published on 2014-07-30) chapter 5.5.7.
- *
- * @param[in] p_cc_file Pointer to the Capability Container descriptor.
- * @param[in] p_ndef_file_buff Pointer to the buffer with NDEF file.
- * @param[in] ndef_file_buff_len Length of the provided NDEF file.
- *
- * @retval NRF_SUCCESS If NDEF file was successfully updated.
- * @retval NRF_ERROR_NO_MEM If APDU buffer or NDEF file buffer is too small.
- * @retval NRF_ERROR_NOT_SUPPORTED If the requested response length in C-APDU is too big.
- * @retval NRF_ERROR_INVALID_DATA If NDEF file buffer is smaller than NLEN field size.
- * @retval NRF_ERROR_INVALID_LENGTH If NLEN value is not coherent with NDEF file buffer length
- * or if buffer length is bigger than maximal file size.
- * @retval Other Other error codes may be returned depending on function
- * @ref adafruit_pn532_in_data_exchange, @ref nfc_t4t_file_content_get,
- * and on @ref nfc_t4t_apdu module functions.
- */
-ret_code_t nfc_t4t_ndef_update(nfc_t4t_capability_container_t * const p_cc_file,
- uint8_t * p_ndef_file_buff,
- uint8_t ndef_file_buff_len);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_T4T_HL_DETECTION_PROCEDURES_H__ */
diff --git a/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.c b/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.c
deleted file mode 100644
index 7f0ca69..0000000
--- a/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#include "sdk_config.h"
-#if NFC_T4T_TLV_BLOCK_PARSER_ENABLED
-
-#include
-#include "nfc_t4t_tlv_block.h"
-#include "app_util.h"
-#include "sdk_macros.h"
-#include "nordic_common.h"
-
-#define NRF_LOG_MODULE_NAME "NFC_T4T_TLV_BLOCK_PARSER"
-#if NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL
-#define NRF_LOG_INFO_COLOR NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR
-#else // NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED
-#define NRF_LOG_LEVEL 0
-#endif // NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED
-#include "nrf_log.h"
-
-#define TLV_TYPE_FIELD_LEN 1U ///< Length of a type field.
-
-/**
- * @brief TLV length field related defines.
- */
-#define TLV_LEN_SHORT_FIELD_LEN 1U ///< Length of a short length field.
-#define TLV_LEN_LONG_FIELD_LEN 3U ///< Length of an extended length field.
-#define TLV_LEN_LONG_FORMAT_TOKEN 0xFF ///< Value indicating the use of an extended length field.
-#define TLV_LEN_LONG_FORMAT_TOKEN_SIZE 1U ///< Size of long format token.
-#define TLV_LEN_LONG_FORMAT_MIN_VALUE 0xFF ///< The minimal value of length field that can be used in long format.
-
-/**
- * @brief Possible sizes of TLV block.
- */
-#define TLV_MIN_TL_FIELD_LEN (TLV_TYPE_FIELD_LEN + TLV_LEN_SHORT_FIELD_LEN)
-#define TLV_MIN_LONG_FORMAT_TL_FIELD_LEN (TLV_TYPE_FIELD_LEN + TLV_LEN_LONG_FIELD_LEN)
-#define TLV_MIN_VALUE_FIELD_SIZE 6U
-
-/**
- * @brief Field sizes that are present in TLV block.
- */
-#define FILE_CONTROL_FILE_ID_FIELD_SIZE 2U
-#define FILE_CONTROL_READ_ACCESS_FIELD_SIZE 1U
-#define FILE_CONTROL_WRITE_ACCESS_FIELD_SIZE 1U
-#define FILE_CONTROL_COMMON_FIELDS_SIZE (FILE_CONTROL_FILE_ID_FIELD_SIZE \
- + FILE_CONTROL_READ_ACCESS_FIELD_SIZE \
- + FILE_CONTROL_WRITE_ACCESS_FIELD_SIZE)
-
-/**
- * @brief Invalid values for File Identifier field.
- */
-#define FILE_ID_INVALID_VALUE_0 0x0000
-#define FILE_ID_INVALID_VALUE_1 0xE102
-#define FILE_ID_INVALID_VALUE_2 0xE103
-#define FILE_ID_INVALID_VALUE_3 0x3F00
-#define FILE_ID_INVALID_VALUE_4 0x3FFF
-#define FILE_ID_INVALID_VALUE_5 0xFFFF
-
-/**
- * @brief NDEF file related defines.
- */
-#define NDEF_FILE_MAX_SIZE_FIELD_SIZE 2U
-#define NDEF_FILE_MAX_SIZE_MIN_VAL 0x0005
-#define NDEF_FILE_MAX_SIZE_MAX_VAL 0xFFFE
-#define NDEF_FILE_CONTROL_TLV_LEN (FILE_CONTROL_COMMON_FIELDS_SIZE \
- + NDEF_FILE_MAX_SIZE_FIELD_SIZE)
-
-/**
- * @brief Proprietary file related defines.
- */
-#define PROPRIETARY_FILE_MAX_SIZE_FIELD_SIZE 2U
-#define PROPRIETARY_FILE_MAX_SIZE_MIN_VAL 0x0003
-#define PROPRIETARY_FILE_MAX_SIZE_MAX_VAL 0xFFFE
-#define PROPRIETARY_FILE_CONTROL_TLV_LEN (FILE_CONTROL_COMMON_FIELDS_SIZE \
- + PROPRIETARY_FILE_MAX_SIZE_FIELD_SIZE)
-
-/**
- * @brief Extended NDEF file related defines.
- */
-#define EXTENDED_NDEF_FILE_MAX_SIZE_FIELD_SIZE 4U
-#define EXTENDED_NDEF_FILE_MAX_SIZE_MIN_VAL 0x0000FFFF
-#define EXTENDED_NDEF_FILE_MAX_SIZE_MAX_VAL 0xFFFFFFFE
-#define EXTENDED_NDEF_FILE_CONTROL_TLV_LEN (FILE_CONTROL_COMMON_FIELDS_SIZE \
- + EXTENDED_NDEF_FILE_MAX_SIZE_FIELD_SIZE)
-
-/**
- * @brief Validates maximum file size field range. This field is present in every File Control TLV.
- */
-#define NFC_T4T_FILE_CONTROL_MAX_SIZE_FIELD_RANGE_VERIFY(VALUE, MIN, MAX) \
- if ( ( (VALUE) < (MIN) ) || ( (VALUE) > (MAX) ) ) \
- { \
- return NRF_ERROR_INVALID_DATA; \
- }
-
-
-/**
- * @brief Function for validating all possible types of File Control TLV.
- */
-__STATIC_INLINE ret_code_t nfc_t4t_file_control_tl_validate(nfc_t4t_tlv_block_t * p_file_control_tlv)
-{
- switch (p_file_control_tlv->type)
- {
- case NDEF_FILE_CONTROL_TLV:
- VERIFY_TRUE(p_file_control_tlv->length == NDEF_FILE_CONTROL_TLV_LEN,
- NRF_ERROR_INVALID_DATA);
- return NRF_SUCCESS;
-
- case PROPRIETARY_FILE_CONTROL_TLV:
- VERIFY_TRUE(p_file_control_tlv->length == PROPRIETARY_FILE_CONTROL_TLV_LEN,
- NRF_ERROR_INVALID_DATA);
- return NRF_SUCCESS;
-
- case EXTENDED_NDEF_FILE_CONTROL_TLV:
- VERIFY_TRUE(p_file_control_tlv->length == EXTENDED_NDEF_FILE_CONTROL_TLV_LEN,
- NRF_ERROR_INVALID_DATA);
- return NRF_SUCCESS;
-
- default:
- return NRF_ERROR_INVALID_DATA;
- }
-}
-
-
-/**
- * @brief Function for parsing value field of File Control TLV.
- */
-static ret_code_t nfc_t4t_file_control_value_parse(nfc_t4t_tlv_block_t * p_file_control_tlv,
- uint8_t * p_value_buff)
-{
- nfc_t4t_file_control_val_t * p_control_tlv_val;
-
- // Handle File Identifier field.
- p_control_tlv_val = &p_file_control_tlv->value;
- p_control_tlv_val->file_id = uint16_big_decode(p_value_buff);
- p_value_buff += FILE_CONTROL_FILE_ID_FIELD_SIZE;
-
- switch (p_control_tlv_val->file_id)
- {
- case FILE_ID_INVALID_VALUE_0:
- case FILE_ID_INVALID_VALUE_1:
- case FILE_ID_INVALID_VALUE_2:
- case FILE_ID_INVALID_VALUE_3:
- case FILE_ID_INVALID_VALUE_4:
- case FILE_ID_INVALID_VALUE_5:
- return NRF_ERROR_INVALID_DATA;
-
- default:
- break;
- }
-
- // Handle Max file size field.
- switch (p_file_control_tlv->type)
- {
- case NDEF_FILE_CONTROL_TLV:
- p_control_tlv_val->max_file_size = uint16_big_decode(p_value_buff);
- p_value_buff += NDEF_FILE_MAX_SIZE_FIELD_SIZE;
- NFC_T4T_FILE_CONTROL_MAX_SIZE_FIELD_RANGE_VERIFY(p_control_tlv_val->max_file_size,
- NDEF_FILE_MAX_SIZE_MIN_VAL,
- NDEF_FILE_MAX_SIZE_MAX_VAL);
- break;
-
- case PROPRIETARY_FILE_CONTROL_TLV:
- p_control_tlv_val->max_file_size = uint16_big_decode(p_value_buff);
- p_value_buff += PROPRIETARY_FILE_MAX_SIZE_FIELD_SIZE;
- NFC_T4T_FILE_CONTROL_MAX_SIZE_FIELD_RANGE_VERIFY(p_control_tlv_val->max_file_size,
- PROPRIETARY_FILE_MAX_SIZE_MIN_VAL,
- PROPRIETARY_FILE_MAX_SIZE_MAX_VAL);
- break;
-
- case EXTENDED_NDEF_FILE_CONTROL_TLV:
- p_control_tlv_val->max_file_size = uint32_big_decode(p_value_buff);
- p_value_buff += EXTENDED_NDEF_FILE_MAX_SIZE_FIELD_SIZE;
- NFC_T4T_FILE_CONTROL_MAX_SIZE_FIELD_RANGE_VERIFY(p_control_tlv_val->max_file_size,
- EXTENDED_NDEF_FILE_MAX_SIZE_MIN_VAL,
- EXTENDED_NDEF_FILE_MAX_SIZE_MAX_VAL);
- break;
- }
-
- // Handle read access condition field.
- p_control_tlv_val->read_access = *p_value_buff;
- p_value_buff += FILE_CONTROL_READ_ACCESS_FIELD_SIZE;
-
- // Handle write access condition field.
- p_control_tlv_val->write_access = *p_value_buff;
-
- return NRF_SUCCESS;
-}
-
-
-ret_code_t nfc_t4t_file_control_tlv_parse(nfc_t4t_tlv_block_t * p_file_control_tlv,
- uint8_t * p_raw_data,
- uint16_t * p_len)
-{
- ret_code_t err_code;
- uint8_t * p_offset = p_raw_data;
-
- if (*p_len < TLV_MIN_TL_FIELD_LEN)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
- memset(p_file_control_tlv, 0, sizeof(nfc_t4t_tlv_block_t));
-
- // Handle type field of TLV block.
- p_file_control_tlv->type = *p_offset;
- p_offset += TLV_TYPE_FIELD_LEN;
-
- // Handle length field of TLV block.
- if (*p_offset == TLV_LEN_LONG_FORMAT_TOKEN)
- {
- if (*p_len < TLV_MIN_LONG_FORMAT_TL_FIELD_LEN)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
-
- p_file_control_tlv->length = uint16_big_decode(p_offset + TLV_LEN_LONG_FORMAT_TOKEN_SIZE);
- p_offset += TLV_LEN_LONG_FIELD_LEN;
-
- if (p_file_control_tlv->length < TLV_LEN_LONG_FORMAT_MIN_VALUE)
- {
- return NRF_ERROR_INVALID_DATA;
- }
- }
- else
- {
- p_file_control_tlv->length = *p_offset;
- p_offset += TLV_LEN_SHORT_FIELD_LEN;
- }
-
- // Calculate the total TLV block size.
- uint16_t tlv_block_len = (p_offset - p_raw_data) + p_file_control_tlv->length;
- if (*p_len < tlv_block_len)
- {
- return NRF_ERROR_INVALID_LENGTH;
- }
- *p_len = tlv_block_len;
-
- // Validate if type and length fields contain values supported by Type 4 Tag.
- err_code = nfc_t4t_file_control_tl_validate(p_file_control_tlv);
- VERIFY_SUCCESS(err_code);
-
- // Handle value field of TLV block.
- err_code = nfc_t4t_file_control_value_parse(p_file_control_tlv, p_offset);
- return err_code;
-}
-
-
-void nfc_t4t_file_control_tlv_printout(uint8_t num, nfc_t4t_tlv_block_t * p_t4t_tlv_block)
-{
- NRF_LOG_INFO("%d file Control TLV\r\n", num);
- switch (p_t4t_tlv_block->type)
- {
- case NDEF_FILE_CONTROL_TLV:
- NRF_LOG_INFO("Type: NDEF File Control (0x%02x)\r\n", p_t4t_tlv_block->type);
- break;
-
- case PROPRIETARY_FILE_CONTROL_TLV:
- NRF_LOG_INFO("Type: Proprietary File Control (0x%02x)\r\n", p_t4t_tlv_block->type);
- break;
-
- case EXTENDED_NDEF_FILE_CONTROL_TLV:
- NRF_LOG_INFO("Type: Extended NDEF File Control (0x%02x)\r\n", p_t4t_tlv_block->type);
- break;
-
- default:
- NRF_LOG_INFO("Type: Unknown (0x%02x)\r\n", p_t4t_tlv_block->type);
- }
- NRF_LOG_INFO("Length (in bytes): %d\r\n", p_t4t_tlv_block->length);
-
- nfc_t4t_file_control_val_t * p_tlv_val = &p_t4t_tlv_block->value;
- NRF_LOG_INFO("File Identifier: 0x%04X \r\n", p_tlv_val->file_id);
- NRF_LOG_INFO("Maximum file size: %d \r\n", p_tlv_val->max_file_size);
- NRF_LOG_INFO("Read access condition: 0x%02X \r\n", p_tlv_val->read_access);
- NRF_LOG_INFO("Write access condition: 0x%02x \r\n\r\n", p_tlv_val->write_access);
-
- if (p_tlv_val->file.p_content != NULL)
- {
- NRF_LOG_INFO("NDEF file content present. Length: %d \r\n", p_tlv_val->file.len);
- NRF_LOG_HEXDUMP_INFO(p_tlv_val->file.p_content, p_tlv_val->file.len);
- }
- else
- {
- NRF_LOG_INFO("NDEF file content is not present \r\n");
- }
- NRF_LOG_RAW_INFO("\r\n");
-}
-
-
-#endif // NFC_T4T_TLV_BLOCK_PARSER_ENABLED
-
diff --git a/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.h b/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.h
deleted file mode 100644
index 973994b..0000000
--- a/components/nfc/t4t_parser/tlv/nfc_t4t_tlv_block.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NFC_T4T_TLV_BLOCK_H__
-#define NFC_T4T_TLV_BLOCK_H__
-
-/**@file
- *
- * @defgroup nfc_t4t_tlv_block File Control TLV block parser for Type 4 Tag.
- * @{
- * @ingroup nfc_t4t_cc_file
- *
- * @brief File Control TLV block parser for Type 4 Tag (T4T).
- *
- */
-
-#include
-#include "sdk_errors.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define CONTROL_FILE_READ_ACCESS_GRANTED 0x00 ///< Read access granted without any security.
-
-/**
- * @name Possible values of file write access condition field.
- * @{
- */
-#define CONTROL_FILE_WRITE_ACCESS_GRANTED 0x00 ///< Write access granted without any security.
-#define CONTROL_FILE_WRITE_ACCESS_DISABLED 0xFF ///< No write access granted without any security (read-only).
-/** @} */
-
-/**
- * @brief Possible types of File Control TLV for Type 4 Tag.
- */
-typedef enum
-{
- NDEF_FILE_CONTROL_TLV = 0x04, ///< Control information concerning the EF file with short NDEF message.
- PROPRIETARY_FILE_CONTROL_TLV = 0x05, ///< Control information concerning the Proprietary file with proprietary data.
- EXTENDED_NDEF_FILE_CONTROL_TLV = 0x06 ///< Control information concerning the EF file with long NDEF message.
-} nfc_t4t_tlv_block_types_t;
-
-/**
- * @brief File content descriptor.
- */
-typedef struct
-{
- uint8_t * p_content; ///< Pointer to the file content.
- uint16_t len; ///< Length of file content.
-} nfc_t4t_file_t;
-
-/**
- * @brief Extended NDEF/NDEF/Proprietary File Control Value descriptor.
- */
-typedef struct
-{
- nfc_t4t_file_t file; ///< Pointer to the described file content.
- uint32_t max_file_size; ///< Maximum size (in bytes) of the file.
- uint16_t file_id; ///< File identifier.
- uint8_t read_access; ///< File read access condition.
- uint8_t write_access; ///< File write access condition.
-} nfc_t4t_file_control_val_t;
-
-/**
- * @brief File Control TLV block descriptor.
- */
-typedef struct
-{
- nfc_t4t_file_control_val_t value; ///< Value field descriptor.
- uint16_t length; ///< Length of the value field.
- uint8_t type; ///< Type of the TLV block.
-} nfc_t4t_tlv_block_t;
-
-/**
- * @brief Function for parsing raw data of File Control TLV, read from a Type 4 Tag.
- *
- * This function parses raw data of File Control TLV and stores the results in its
- * descriptor.
- *
- * @param[in,out] p_file_control_tlv Pointer to the File Control TLV that will be filled with
- * parsed data.
- * @param[in] p_raw_data Pointer to the buffer with raw TLV data.
- * @param[in,out] p_len In: Buffer length with TLV blocks.
- * Out: Total length of first identified TLV within the buffer.
- *
- * @retval NRF_SUCCESS If operation was successful.
- * @retval NRF_ERROR_INVALID_LENGTH If provided buffer length is too small for TLV block.
- * @retval NRF_ERROR_INVALID_DATA If any TLV block field contains invalid data.
- */
-ret_code_t nfc_t4t_file_control_tlv_parse(nfc_t4t_tlv_block_t * p_file_control_tlv,
- uint8_t * p_raw_data,
- uint16_t * p_len);
-
-/**
- * @brief Function for printing TLV block descriptor.
- *
- * This function prints TLV block descriptor.
- *
- * @param[in] num TLV block number.
- * @param[in] p_t4t_tlv_block Pointer to the TLV block descriptor.
- */
-void nfc_t4t_file_control_tlv_printout(uint8_t num, nfc_t4t_tlv_block_t * p_t4t_tlv_block);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NFC_T4T_TLV_BLOCK_H__ */
diff --git a/components/proprietary_rf/esb/nrf_esb.c b/components/proprietary_rf/esb/nrf_esb.c
deleted file mode 100644
index 04d110b..0000000
--- a/components/proprietary_rf/esb/nrf_esb.c
+++ /dev/null
@@ -1,1299 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include "nrf_error.h"
-#include "nrf_esb.h"
-#include "nrf_esb_error_codes.h"
-#include "nrf_gpio.h"
-#include
-#include
-#include "sdk_common.h"
-#include "sdk_macros.h"
-#include "app_util.h"
-#include "nrf_log.h"
-
-#define BIT_MASK_UINT_8(x) (0xFF >> (8 - (x)))
-#define NRF_ESB_PIPE_COUNT 9
-
-// Constant parameters
-#define RX_WAIT_FOR_ACK_TIMEOUT_US_2MBPS (48) /**< 2 Mb RX wait for acknowledgment time-out value. Smallest reliable value - 43. */
-#define RX_WAIT_FOR_ACK_TIMEOUT_US_1MBPS (64) /**< 1 Mb RX wait for acknowledgment time-out value. Smallest reliable value - 59. */
-#define RX_WAIT_FOR_ACK_TIMEOUT_US_250KBPS (250) /**< 250 Kb RX wait for acknowledgment time-out value. */
-#define RX_WAIT_FOR_ACK_TIMEOUT_US_1MBPS_BLE (64) /**< 1 Mb RX wait for acknowledgment time-out (combined with BLE). */
-
-// Interrupt flags
-#define NRF_ESB_INT_TX_SUCCESS_MSK 0x01 /**< Interrupt mask value for TX success. */
-#define NRF_ESB_INT_TX_FAILED_MSK 0x02 /**< Interrupt mask value for TX failure. */
-#define NRF_ESB_INT_RX_DATA_RECEIVED_MSK 0x04 /**< Interrupt mask value for RX_DR. */
-
-#define NRF_ESB_PID_RESET_VALUE 0xFF /**< Invalid PID value which is guaranteed to not collide with any valid PID value. */
-#define NRF_ESB_PID_MAX 3 /**< Maximum value for PID. */
-#define NRF_ESB_CRC_RESET_VALUE 0xFFFF /**< CRC reset value. */
-
-// Internal Enhanced ShockBurst module state.
-typedef enum {
- NRF_ESB_STATE_IDLE, /**< Module idle. */
- NRF_ESB_STATE_PTX_TX, /**< Module transmitting without acknowledgment. */
- NRF_ESB_STATE_PTX_TX_ACK, /**< Module transmitting with acknowledgment. */
- NRF_ESB_STATE_PTX_RX_ACK, /**< Module transmitting with acknowledgment and reception of payload with the acknowledgment response. */
- NRF_ESB_STATE_PRX, /**< Module receiving packets without acknowledgment. */
- NRF_ESB_STATE_PRX_SEND_ACK, /**< Module transmitting acknowledgment in RX mode. */
-} nrf_esb_mainstate_t;
-
-
-#define DISABLE_RF_IRQ() NVIC_DisableIRQ(RADIO_IRQn)
-#define ENABLE_RF_IRQ() NVIC_EnableIRQ(RADIO_IRQn)
-
-#define RADIO_SHORTS_COMMON ( RADIO_SHORTS_READY_START_Msk | RADIO_SHORTS_END_DISABLE_Msk | \
- RADIO_SHORTS_ADDRESS_RSSISTART_Msk | RADIO_SHORTS_DISABLED_RSSISTOP_Msk )
-
-#define VERIFY_PAYLOAD_LENGTH(p) \
-do \
-{ \
- if (p->length == 0 || \
- p->length > NRF_ESB_MAX_PAYLOAD_LENGTH || \
- (m_config_local.protocol == NRF_ESB_PROTOCOL_ESB && \
- p->length > m_config_local.payload_length)) \
- { \
- return NRF_ERROR_INVALID_LENGTH; \
- } \
-}while (0)
-
-
-/* @brief Structure holding pipe info PID and CRC and acknowledgment payload. */
-typedef struct
-{
- uint16_t crc; /**< CRC value of the last received packet (Used to detect retransmits). */
- uint8_t pid; /**< Packet ID of the last received packet (Used to detect retransmits). */
- bool ack_payload; /**< Flag indicating the state of the transmission of acknowledgment payloads. */
-} pipe_info_t;
-
-
-/* @brief First-in, first-out queue of payloads to be transmitted. */
-typedef struct
-{
- nrf_esb_payload_t * p_payload[NRF_ESB_TX_FIFO_SIZE]; /**< Pointer to the actual queue. */
- uint32_t entry_point; /**< Current start of queue. */
- uint32_t exit_point; /**< Current end of queue. */
- uint32_t count; /**< Current number of elements in the queue. */
-} nrf_esb_payload_tx_fifo_t;
-
-
-/* @brief First-in, first-out queue of received payloads. */
-typedef struct
-{
- nrf_esb_payload_t * p_payload[NRF_ESB_RX_FIFO_SIZE]; /**< Pointer to the actual queue. */
- uint32_t entry_point; /**< Current start of queue. */
- uint32_t exit_point; /**< Current end of queue. */
- uint32_t count; /**< Current number of elements in the queue. */
-} nrf_esb_payload_rx_fifo_t;
-
-
-/**@brief Enhanced ShockBurst address.
- *
- * Enhanced ShockBurst addresses consist of a base address and a prefix
- * that is unique for each pipe. See @ref esb_addressing in the ESB user
- * guide for more information.
-*/
-typedef struct
-{
- uint8_t base_addr_p0[4]; /**< Base address for pipe 0 encoded in big endian. */
- uint8_t base_addr_p1[4]; /**< Base address for pipe 1-7 encoded in big endian. */
- uint8_t pipe_prefixes[8]; /**< Address prefix for pipe 0 to 7. */
- uint8_t num_pipes; /**< Number of pipes available. */
- uint8_t addr_length; /**< Length of the address including the prefix. */
- uint8_t rx_pipes_enabled; /**< Bitfield for enabled pipes. */
- uint8_t rf_channel; /**< Channel to use (must be between 0 and 125). */
-} nrf_esb_address_t;
-
-
-// Module state
-static bool m_esb_initialized = false;
-static nrf_esb_mainstate_t m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
-static nrf_esb_payload_t * mp_current_payload;
-
-static nrf_esb_event_handler_t m_event_handler;
-
-// Address parameters
-static nrf_esb_address_t m_esb_addr = NRF_ESB_ADDR_DEFAULT;
-
-// RF parameters
-static nrf_esb_config_t m_config_local;
-
-// TX FIFO
-static nrf_esb_payload_t m_tx_fifo_payload[NRF_ESB_TX_FIFO_SIZE];
-static nrf_esb_payload_tx_fifo_t m_tx_fifo;
-
-// RX FIFO
-static nrf_esb_payload_t m_rx_fifo_payload[NRF_ESB_RX_FIFO_SIZE];
-static nrf_esb_payload_rx_fifo_t m_rx_fifo;
-
-// Payload buffers
-static uint8_t m_tx_payload_buffer[NRF_ESB_MAX_PAYLOAD_LENGTH + 2];
-static uint8_t m_rx_payload_buffer[NRF_ESB_MAX_PAYLOAD_LENGTH + 2];
-
-// Run time variables
-static volatile uint32_t m_interrupt_flags = 0;
-static uint8_t m_pids[NRF_ESB_PIPE_COUNT];
-static pipe_info_t m_rx_pipe_info[NRF_ESB_PIPE_COUNT];
-static volatile uint32_t m_retransmits_remaining;
-static volatile uint32_t m_last_tx_attempts;
-static volatile uint32_t m_wait_for_ack_timeout_us;
-
-// These function pointers are changed dynamically, depending on protocol configuration and state.
-static void (*on_radio_disabled)(void) = 0;
-static void (*on_radio_end)(void) = 0;
-static void (*update_rf_payload_format)(uint32_t payload_length) = 0;
-
-
-// The following functions are assigned to the function pointers above.
-static void on_radio_disabled_tx_noack(void);
-static void on_radio_disabled_tx(void);
-static void on_radio_disabled_tx_wait_for_ack(void);
-static void on_radio_disabled_rx(void);
-static void on_radio_disabled_rx_ack(void);
-
-
-#define NRF_ESB_ADDR_UPDATE_MASK_BASE0 (1 << 0) /*< Mask value to signal updating BASE0 radio address. */
-#define NRF_ESB_ADDR_UPDATE_MASK_BASE1 (1 << 1) /*< Mask value to signal updating BASE1 radio address. */
-#define NRF_ESB_ADDR_UPDATE_MASK_PREFIX (1 << 2) /*< Mask value to signal updating radio prefixes. */
-
-
-// Function to do bytewise bit-swap on an unsigned 32-bit value
-static uint32_t bytewise_bit_swap(uint8_t const * p_inp)
-{
- uint32_t inp = (*(uint32_t*)p_inp);
-#if __CORTEX_M == (0x04U)
- return __REV((uint32_t)__RBIT(inp)); //lint -esym(628, __rev) -esym(526, __rev) -esym(628, __rbit) -esym(526, __rbit) */
-#else
- inp = (inp & 0xF0F0F0F0) >> 4 | (inp & 0x0F0F0F0F) << 4;
- inp = (inp & 0xCCCCCCCC) >> 2 | (inp & 0x33333333) << 2;
- inp = (inp & 0xAAAAAAAA) >> 1 | (inp & 0x55555555) << 1;
- return inp;
-#endif
-}
-
-
-// Internal function to convert base addresses from nRF24L type addressing to nRF51 type addressing
-static uint32_t addr_conv(uint8_t const* p_addr)
-{
- return __REV(bytewise_bit_swap(p_addr)); //lint -esym(628, __rev) -esym(526, __rev) */
-}
-
-
-static void update_rf_payload_format_esb_dpl(uint32_t payload_length)
-{
-#if (NRF_ESB_MAX_PAYLOAD_LENGTH <= 32)
- // Using 6 bits for length
- NRF_RADIO->PCNF0 = (0 << RADIO_PCNF0_S0LEN_Pos) |
- (6 << RADIO_PCNF0_LFLEN_Pos) |
- (3 << RADIO_PCNF0_S1LEN_Pos) ;
-#else
- // Using 8 bits for length
- NRF_RADIO->PCNF0 = (0 << RADIO_PCNF0_S0LEN_Pos) |
- (8 << RADIO_PCNF0_LFLEN_Pos) |
- (3 << RADIO_PCNF0_S1LEN_Pos) ;
-#endif
- NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled << RADIO_PCNF1_WHITEEN_Pos) |
- (RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos) |
- ((m_esb_addr.addr_length - 1) << RADIO_PCNF1_BALEN_Pos) |
- (0 << RADIO_PCNF1_STATLEN_Pos) |
- (NRF_ESB_MAX_PAYLOAD_LENGTH << RADIO_PCNF1_MAXLEN_Pos);
-}
-
-
-static void update_rf_payload_format_esb(uint32_t payload_length)
-{
- NRF_RADIO->PCNF0 = (1 << RADIO_PCNF0_S0LEN_Pos) |
- (0 << RADIO_PCNF0_LFLEN_Pos) |
- (1 << RADIO_PCNF0_S1LEN_Pos);
-
- NRF_RADIO->PCNF1 = (RADIO_PCNF1_WHITEEN_Disabled << RADIO_PCNF1_WHITEEN_Pos) |
- (RADIO_PCNF1_ENDIAN_Big << RADIO_PCNF1_ENDIAN_Pos) |
- ((m_esb_addr.addr_length - 1) << RADIO_PCNF1_BALEN_Pos) |
- (payload_length << RADIO_PCNF1_STATLEN_Pos) |
- (payload_length << RADIO_PCNF1_MAXLEN_Pos);
-}
-
-
-static void update_radio_addresses(uint8_t update_mask)
-{
- if ((update_mask & NRF_ESB_ADDR_UPDATE_MASK_BASE0) != 0)
- {
- NRF_RADIO->BASE0 = addr_conv(m_esb_addr.base_addr_p0);
- }
-
- if ((update_mask & NRF_ESB_ADDR_UPDATE_MASK_BASE1) != 0)
- {
- NRF_RADIO->BASE1 = addr_conv(m_esb_addr.base_addr_p1);
- }
-
- if ((update_mask & NRF_ESB_ADDR_UPDATE_MASK_PREFIX) != 0)
- {
- NRF_RADIO->PREFIX0 = bytewise_bit_swap(&m_esb_addr.pipe_prefixes[0]);
- NRF_RADIO->PREFIX1 = bytewise_bit_swap(&m_esb_addr.pipe_prefixes[4]);
- }
-}
-
-
-static void update_radio_tx_power()
-{
- NRF_RADIO->TXPOWER = m_config_local.tx_output_power << RADIO_TXPOWER_TXPOWER_Pos;
-}
-
-
-static void update_radio_bitrate()
-{
- NRF_RADIO->MODE = m_config_local.bitrate << RADIO_MODE_MODE_Pos;
-
- switch (m_config_local.bitrate)
- {
- case NRF_ESB_BITRATE_2MBPS:
- m_wait_for_ack_timeout_us = RX_WAIT_FOR_ACK_TIMEOUT_US_2MBPS;
- break;
-
- case NRF_ESB_BITRATE_1MBPS:
- m_wait_for_ack_timeout_us = RX_WAIT_FOR_ACK_TIMEOUT_US_1MBPS;
- break;
-
- case NRF_ESB_BITRATE_250KBPS:
- m_wait_for_ack_timeout_us = RX_WAIT_FOR_ACK_TIMEOUT_US_250KBPS;
- break;
-
- case NRF_ESB_BITRATE_1MBPS_BLE:
- m_wait_for_ack_timeout_us = RX_WAIT_FOR_ACK_TIMEOUT_US_1MBPS_BLE;
- break;
-
- default:
- // Should not be reached
- break;
- }
-}
-
-
-static void update_radio_protocol()
-{
- switch (m_config_local.protocol)
- {
- case NRF_ESB_PROTOCOL_ESB_DPL:
- update_rf_payload_format = update_rf_payload_format_esb_dpl;
- break;
-
- case NRF_ESB_PROTOCOL_ESB:
- update_rf_payload_format = update_rf_payload_format_esb;
- break;
-
- default:
- // Should not be reached
- break;
- }
-}
-
-
-static void update_radio_crc()
-{
- NRF_RADIO->CRCCNF = m_config_local.crc << RADIO_CRCCNF_LEN_Pos;
-
- if (m_config_local.crc == RADIO_CRCCNF_LEN_Two)
- {
- NRF_RADIO->CRCINIT = 0xFFFFUL; // Initial value
- NRF_RADIO->CRCPOLY = 0x11021UL; // CRC poly: x^16+x^12^x^5+1
- }
- else if (m_config_local.crc == RADIO_CRCCNF_LEN_One)
- {
- NRF_RADIO->CRCINIT = 0xFFUL; // Initial value
- NRF_RADIO->CRCPOLY = 0x107UL; // CRC poly: x^8+x^2^x^1+1
- }
-}
-
-
-static void update_radio_parameters()
-{
- update_radio_tx_power();
- update_radio_bitrate();
- update_radio_protocol();
- update_radio_crc();
- update_rf_payload_format(m_config_local.payload_length);
-}
-
-
-static void reset_fifos()
-{
- m_tx_fifo.entry_point = 0;
- m_tx_fifo.exit_point = 0;
- m_tx_fifo.count = 0;
-
- m_rx_fifo.entry_point = 0;
- m_rx_fifo.exit_point = 0;
- m_rx_fifo.count = 0;
-}
-
-
-static void initialize_fifos()
-{
- reset_fifos();
-
- for (int i = 0; i < NRF_ESB_TX_FIFO_SIZE; i++)
- {
- m_tx_fifo.p_payload[i] = &m_tx_fifo_payload[i];
- }
-
- for (int i = 0; i < NRF_ESB_RX_FIFO_SIZE; i++)
- {
- m_rx_fifo.p_payload[i] = &m_rx_fifo_payload[i];
- }
-}
-
-
-static void tx_fifo_remove_last()
-{
- if (m_tx_fifo.count > 0)
- {
- DISABLE_RF_IRQ();
-
- m_tx_fifo.count--;
- if (++m_tx_fifo.exit_point >= NRF_ESB_TX_FIFO_SIZE)
- {
- m_tx_fifo.exit_point = 0;
- }
-
- ENABLE_RF_IRQ();
- }
-}
-
-/** @brief Function to push the content of the rx_buffer to the RX FIFO.
- *
- * The module will point the register NRF_RADIO->PACKETPTR to a buffer for receiving packets.
- * After receiving a packet the module will call this function to copy the received data to
- * the RX FIFO.
- *
- * @param pipe Pipe number to set for the packet.
- * @param pid Packet ID.
- *
- * @retval true Operation successful.
- * @retval false Operation failed.
- */
-static bool rx_fifo_push_rfbuf(uint8_t pipe, uint8_t pid)
-{
- if (m_rx_fifo.count < NRF_ESB_RX_FIFO_SIZE)
- {
- if (m_config_local.protocol == NRF_ESB_PROTOCOL_ESB_DPL)
- {
- if (m_rx_payload_buffer[0] > NRF_ESB_MAX_PAYLOAD_LENGTH)
- {
- return false;
- }
-
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->length = m_rx_payload_buffer[0];
- }
- else if (m_config_local.mode == NRF_ESB_MODE_PTX)
- {
- // Received packet is an acknowledgment
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->length = 0;
- }
- else
- {
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->length = m_config_local.payload_length;
- }
-
- memcpy(m_rx_fifo.p_payload[m_rx_fifo.entry_point]->data, &m_rx_payload_buffer[2],
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->length);
-
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->pipe = pipe;
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->rssi = NRF_RADIO->RSSISAMPLE;
- m_rx_fifo.p_payload[m_rx_fifo.entry_point]->pid = pid;
- if (++m_rx_fifo.entry_point >= NRF_ESB_RX_FIFO_SIZE)
- {
- m_rx_fifo.entry_point = 0;
- }
- m_rx_fifo.count++;
-
- return true;
- }
-
- return false;
-}
-
-
-static void sys_timer_init()
-{
- // Configure the system timer with a 1 MHz base frequency
- NRF_ESB_SYS_TIMER->PRESCALER = 4;
- NRF_ESB_SYS_TIMER->BITMODE = TIMER_BITMODE_BITMODE_16Bit;
- NRF_ESB_SYS_TIMER->SHORTS = TIMER_SHORTS_COMPARE1_CLEAR_Msk | TIMER_SHORTS_COMPARE1_STOP_Msk;
-}
-
-
-static void ppi_init()
-{
- NRF_PPI->CH[NRF_ESB_PPI_TIMER_START].EEP = (uint32_t)&NRF_RADIO->EVENTS_READY;
- NRF_PPI->CH[NRF_ESB_PPI_TIMER_START].TEP = (uint32_t)&NRF_ESB_SYS_TIMER->TASKS_START;
-
- NRF_PPI->CH[NRF_ESB_PPI_TIMER_STOP].EEP = (uint32_t)&NRF_RADIO->EVENTS_ADDRESS;
- NRF_PPI->CH[NRF_ESB_PPI_TIMER_STOP].TEP = (uint32_t)&NRF_ESB_SYS_TIMER->TASKS_STOP;
-
- NRF_PPI->CH[NRF_ESB_PPI_RX_TIMEOUT].EEP = (uint32_t)&NRF_ESB_SYS_TIMER->EVENTS_COMPARE[0];
- NRF_PPI->CH[NRF_ESB_PPI_RX_TIMEOUT].TEP = (uint32_t)&NRF_RADIO->TASKS_DISABLE;
-
- NRF_PPI->CH[NRF_ESB_PPI_TX_START].EEP = (uint32_t)&NRF_ESB_SYS_TIMER->EVENTS_COMPARE[1];
- NRF_PPI->CH[NRF_ESB_PPI_TX_START].TEP = (uint32_t)&NRF_RADIO->TASKS_TXEN;
-}
-
-
-static void start_tx_transaction()
-{
- bool ack;
-
- m_last_tx_attempts = 1;
- // Prepare the payload
- mp_current_payload = m_tx_fifo.p_payload[m_tx_fifo.exit_point];
-
-
- switch (m_config_local.protocol)
- {
- case NRF_ESB_PROTOCOL_ESB:
- update_rf_payload_format(mp_current_payload->length);
- m_tx_payload_buffer[0] = mp_current_payload->pid;
- m_tx_payload_buffer[1] = 0;
- memcpy(&m_tx_payload_buffer[2], mp_current_payload->data, mp_current_payload->length);
-
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_RXEN_Msk;
- NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk | RADIO_INTENSET_READY_Msk;
-
- // Configure the retransmit counter
- m_retransmits_remaining = m_config_local.retransmit_count;
- on_radio_disabled = on_radio_disabled_tx;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PTX_TX_ACK;
- break;
-
- case NRF_ESB_PROTOCOL_ESB_DPL:
- ack = !mp_current_payload->noack || !m_config_local.selective_auto_ack;
- m_tx_payload_buffer[0] = mp_current_payload->length;
- m_tx_payload_buffer[1] = mp_current_payload->pid << 1;
- m_tx_payload_buffer[1] |= ack ? 0x00 : 0x01;
- memcpy(&m_tx_payload_buffer[2], mp_current_payload->data, mp_current_payload->length);
-
- // Handling ack if noack is set to false or if selective auto ack is turned off
- if (ack)
- {
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_RXEN_Msk;
- NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk | RADIO_INTENSET_READY_Msk;
-
- // Configure the retransmit counter
- m_retransmits_remaining = m_config_local.retransmit_count;
- on_radio_disabled = on_radio_disabled_tx;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PTX_TX_ACK;
- }
- else
- {
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON;
- NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk;
- on_radio_disabled = on_radio_disabled_tx_noack;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PTX_TX;
- }
- break;
-
- default:
- // Should not be reached
- break;
- }
-
- NRF_RADIO->TXADDRESS = mp_current_payload->pipe;
- NRF_RADIO->RXADDRESSES = 1 << mp_current_payload->pipe;
-
- NRF_RADIO->FREQUENCY = m_esb_addr.rf_channel;
- NRF_RADIO->PACKETPTR = (uint32_t)m_tx_payload_buffer;
-
- NVIC_ClearPendingIRQ(RADIO_IRQn);
- NVIC_EnableIRQ(RADIO_IRQn);
-
- NRF_RADIO->EVENTS_ADDRESS = 0;
- NRF_RADIO->EVENTS_PAYLOAD = 0;
- NRF_RADIO->EVENTS_DISABLED = 0;
-
- DEBUG_PIN_SET(DEBUGPIN4);
- NRF_RADIO->TASKS_TXEN = 1;
-}
-
-
-static void on_radio_disabled_tx_noack()
-{
- m_interrupt_flags |= NRF_ESB_INT_TX_SUCCESS_MSK;
- tx_fifo_remove_last();
-
- if (m_tx_fifo.count == 0)
- {
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- }
- else
- {
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- start_tx_transaction();
- }
-}
-
-
-static void on_radio_disabled_tx()
-{
- // Remove the DISABLED -> RXEN shortcut, to make sure the radio stays
- // disabled after the RX window
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON;
-
- // Make sure the timer is started the next time the radio is ready,
- // and that it will disable the radio automatically if no packet is
- // received by the time defined in m_wait_for_ack_timeout_us
- NRF_ESB_SYS_TIMER->CC[0] = m_wait_for_ack_timeout_us;
- NRF_ESB_SYS_TIMER->CC[1] = m_config_local.retransmit_delay - 130;
- NRF_ESB_SYS_TIMER->TASKS_CLEAR = 1;
- NRF_ESB_SYS_TIMER->EVENTS_COMPARE[0] = 0;
- NRF_ESB_SYS_TIMER->EVENTS_COMPARE[1] = 0;
-
- NRF_PPI->CHENSET = (1 << NRF_ESB_PPI_TIMER_START) |
- (1 << NRF_ESB_PPI_RX_TIMEOUT) |
- (1 << NRF_ESB_PPI_TIMER_STOP);
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TX_START);
- NRF_RADIO->EVENTS_END = 0;
-
- if (m_config_local.protocol == NRF_ESB_PROTOCOL_ESB)
- {
- update_rf_payload_format(0);
- }
-
- NRF_RADIO->PACKETPTR = (uint32_t)m_rx_payload_buffer;
- on_radio_disabled = on_radio_disabled_tx_wait_for_ack;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PTX_RX_ACK;
-}
-
-
-static void on_radio_disabled_tx_wait_for_ack()
-{
- // This marks the completion of a TX_RX sequence (TX with ACK)
-
- // Make sure the timer will not deactivate the radio if a packet is received
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TIMER_START) |
- (1 << NRF_ESB_PPI_RX_TIMEOUT) |
- (1 << NRF_ESB_PPI_TIMER_STOP);
-
- // If the radio has received a packet and the CRC status is OK
- if (NRF_RADIO->EVENTS_END && NRF_RADIO->CRCSTATUS != 0)
- {
- NRF_ESB_SYS_TIMER->TASKS_STOP = 1;
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TX_START);
- m_interrupt_flags |= NRF_ESB_INT_TX_SUCCESS_MSK;
- m_last_tx_attempts = m_config_local.retransmit_count - m_retransmits_remaining + 1;
-
- tx_fifo_remove_last();
-
- if (m_config_local.protocol != NRF_ESB_PROTOCOL_ESB && m_rx_payload_buffer[0] > 0)
- {
- if (rx_fifo_push_rfbuf((uint8_t)NRF_RADIO->TXADDRESS, 0))
- {
- m_interrupt_flags |= NRF_ESB_INT_RX_DATA_RECEIVED_MSK;
- }
- }
-
- if ((m_tx_fifo.count == 0) || (m_config_local.tx_mode == NRF_ESB_TXMODE_MANUAL))
- {
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- }
- else
- {
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- start_tx_transaction();
- }
- }
- else
- {
- if (m_retransmits_remaining-- == 0)
- {
- NRF_ESB_SYS_TIMER->TASKS_STOP = 1;
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TX_START);
- // All retransmits are expended, and the TX operation is suspended
- m_last_tx_attempts = m_config_local.retransmit_count + 1;
- m_interrupt_flags |= NRF_ESB_INT_TX_FAILED_MSK;
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- }
- else
- {
- // There are still more retransmits left, TX mode should be
- // entered again as soon as the system timer reaches CC[1].
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_RXEN_Msk;
- update_rf_payload_format(mp_current_payload->length);
- NRF_RADIO->PACKETPTR = (uint32_t)m_tx_payload_buffer;
- on_radio_disabled = on_radio_disabled_tx;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PTX_TX_ACK;
- NRF_ESB_SYS_TIMER->TASKS_START = 1;
- NRF_PPI->CHENSET = (1 << NRF_ESB_PPI_TX_START);
- if (NRF_ESB_SYS_TIMER->EVENTS_COMPARE[1])
- {
- NRF_RADIO->TASKS_TXEN = 1;
- }
- }
- }
-}
-
-static void clear_events_restart_rx(void)
-{
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON;
- update_rf_payload_format(m_config_local.payload_length);
- NRF_RADIO->PACKETPTR = (uint32_t)m_rx_payload_buffer;
- NRF_RADIO->EVENTS_DISABLED = 0;
- NRF_RADIO->TASKS_DISABLE = 1;
-
- while (NRF_RADIO->EVENTS_DISABLED == 0);
-
- NRF_RADIO->EVENTS_DISABLED = 0;
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_TXEN_Msk;
- NRF_RADIO->TASKS_RXEN = 1;
-}
-
-static void on_radio_disabled_rx(void)
-{
- bool ack = false;
- bool retransmit_payload = false;
- bool send_rx_event = true;
- pipe_info_t * p_pipe_info;
-
- if (NRF_RADIO->CRCSTATUS == 0)
- {
- clear_events_restart_rx();
- return;
- }
-
- if (m_rx_fifo.count >= NRF_ESB_RX_FIFO_SIZE)
- {
- clear_events_restart_rx();
- return;
- }
-
- p_pipe_info = &m_rx_pipe_info[NRF_RADIO->RXMATCH];
- if (NRF_RADIO->RXCRC == p_pipe_info->crc &&
- (m_rx_payload_buffer[1] >> 1) == p_pipe_info->pid
- )
- {
- retransmit_payload = true;
- send_rx_event = false;
- }
-
- p_pipe_info->pid = m_rx_payload_buffer[1] >> 1;
- p_pipe_info->crc = NRF_RADIO->RXCRC;
-
- if (m_config_local.selective_auto_ack == false || ((m_rx_payload_buffer[1] & 0x01) == 0))
- {
- ack = true;
- }
-
- if (ack)
- {
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_RXEN_Msk;
-
- switch (m_config_local.protocol)
- {
- case NRF_ESB_PROTOCOL_ESB_DPL:
- {
- if (m_tx_fifo.count > 0 &&
- (m_tx_fifo.p_payload[m_tx_fifo.exit_point]->pipe == NRF_RADIO->RXMATCH)
- )
- {
- // Pipe stays in ACK with payload until TX FIFO is empty
- // Do not report TX success on first ack payload or retransmit
- if (p_pipe_info->ack_payload == true && !retransmit_payload)
- {
- if (++m_tx_fifo.exit_point >= NRF_ESB_TX_FIFO_SIZE)
- {
- m_tx_fifo.exit_point = 0;
- }
-
- m_tx_fifo.count--;
-
- // ACK payloads also require TX_DS
- // (page 40 of the 'nRF24LE1_Product_Specification_rev1_6.pdf').
- m_interrupt_flags |= NRF_ESB_INT_TX_SUCCESS_MSK;
- }
-
- p_pipe_info->ack_payload = true;
-
- mp_current_payload = m_tx_fifo.p_payload[m_tx_fifo.exit_point];
-
- update_rf_payload_format(mp_current_payload->length);
- m_tx_payload_buffer[0] = mp_current_payload->length;
- memcpy(&m_tx_payload_buffer[2],
- mp_current_payload->data,
- mp_current_payload->length);
- }
- else
- {
- p_pipe_info->ack_payload = false;
- update_rf_payload_format(0);
- m_tx_payload_buffer[0] = 0;
- }
-
- m_tx_payload_buffer[1] = m_rx_payload_buffer[1];
- }
- break;
-
- case NRF_ESB_PROTOCOL_ESB:
- {
- update_rf_payload_format(0);
- m_tx_payload_buffer[0] = m_rx_payload_buffer[0];
- m_tx_payload_buffer[1] = 0;
- }
- break;
- }
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_PRX_SEND_ACK;
- NRF_RADIO->TXADDRESS = NRF_RADIO->RXMATCH;
- NRF_RADIO->PACKETPTR = (uint32_t)m_tx_payload_buffer;
- on_radio_disabled = on_radio_disabled_rx_ack;
- }
- else
- {
- clear_events_restart_rx();
- }
-
- if (send_rx_event)
- {
- // Push the new packet to the RX buffer and trigger a received event if the operation was
- // successful.
- if (rx_fifo_push_rfbuf(NRF_RADIO->RXMATCH, p_pipe_info->pid))
- {
- m_interrupt_flags |= NRF_ESB_INT_RX_DATA_RECEIVED_MSK;
- NVIC_SetPendingIRQ(ESB_EVT_IRQ);
- }
- }
-}
-
-
-static void on_radio_disabled_rx_ack(void)
-{
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_TXEN_Msk;
- update_rf_payload_format(m_config_local.payload_length);
-
- NRF_RADIO->PACKETPTR = (uint32_t)m_rx_payload_buffer;
- on_radio_disabled = on_radio_disabled_rx;
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_PRX;
-}
-
-
-/**@brief Function for clearing pending interrupts.
- *
- * @param[in,out] p_interrupts Pointer to the value that holds the current interrupts.
- *
- * @retval NRF_SUCCESS If the interrupts were cleared successfully.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- */
-static uint32_t nrf_esb_get_clear_interrupts(uint32_t * p_interrupts)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
- VERIFY_PARAM_NOT_NULL(p_interrupts);
-
- DISABLE_RF_IRQ();
-
- *p_interrupts = m_interrupt_flags;
- m_interrupt_flags = 0;
-
- ENABLE_RF_IRQ();
-
- return NRF_SUCCESS;
-}
-
-
-void RADIO_IRQHandler()
-{
- if (NRF_RADIO->EVENTS_READY && (NRF_RADIO->INTENSET & RADIO_INTENSET_READY_Msk))
- {
- NRF_RADIO->EVENTS_READY = 0;
- DEBUG_PIN_SET(DEBUGPIN1);
- }
-
- if (NRF_RADIO->EVENTS_END && (NRF_RADIO->INTENSET & RADIO_INTENSET_END_Msk))
- {
- NRF_RADIO->EVENTS_END = 0;
- DEBUG_PIN_SET(DEBUGPIN2);
-
- // Call the correct on_radio_end function, depending on the current protocol state
- if (on_radio_end)
- {
- on_radio_end();
- }
- }
-
- if (NRF_RADIO->EVENTS_DISABLED && (NRF_RADIO->INTENSET & RADIO_INTENSET_DISABLED_Msk))
- {
- NRF_RADIO->EVENTS_DISABLED = 0;
- DEBUG_PIN_SET(DEBUGPIN3);
-
- // Call the correct on_radio_disable function, depending on the current protocol state
- if (on_radio_disabled)
- {
- on_radio_disabled();
- }
- }
-
- DEBUG_PIN_CLR(DEBUGPIN1);
- DEBUG_PIN_CLR(DEBUGPIN2);
- DEBUG_PIN_CLR(DEBUGPIN3);
- DEBUG_PIN_CLR(DEBUGPIN4);
-}
-
-
-uint32_t nrf_esb_init(nrf_esb_config_t const * p_config)
-{
- uint32_t err_code;
-
- VERIFY_PARAM_NOT_NULL(p_config);
-
- if (m_esb_initialized)
- {
- err_code = nrf_esb_disable();
- if (err_code != NRF_SUCCESS)
- {
- return err_code;
- }
- }
-
- m_event_handler = p_config->event_handler;
-
- memcpy(&m_config_local, p_config, sizeof(nrf_esb_config_t));
-
- m_interrupt_flags = 0;
-
- memset(m_rx_pipe_info, 0, sizeof(m_rx_pipe_info));
- memset(m_pids, 0, sizeof(m_pids));
-
- update_radio_parameters();
-
- initialize_fifos();
-
- sys_timer_init();
-
- ppi_init();
-
- NVIC_SetPriority(RADIO_IRQn, m_config_local.radio_irq_priority & 0x03);
- NVIC_SetPriority(ESB_EVT_IRQ, m_config_local.event_irq_priority & 0x03);
- NVIC_EnableIRQ(ESB_EVT_IRQ);
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
- m_esb_initialized = true;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_suspend(void)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
-
- // Clear PPI
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TIMER_START) |
- (1 << NRF_ESB_PPI_TIMER_STOP) |
- (1 << NRF_ESB_PPI_RX_TIMEOUT) |
- (1 << NRF_ESB_PPI_TX_START);
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_disable(void)
-{
- // Clear PPI
- NRF_PPI->CHENCLR = (1 << NRF_ESB_PPI_TIMER_START) |
- (1 << NRF_ESB_PPI_TIMER_STOP) |
- (1 << NRF_ESB_PPI_RX_TIMEOUT) |
- (1 << NRF_ESB_PPI_TX_START);
-
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
-
- reset_fifos();
-
- memset(m_rx_pipe_info, 0, sizeof(m_rx_pipe_info));
- memset(m_pids, 0, sizeof(m_pids));
-
- // Disable the radio
- NVIC_DisableIRQ(ESB_EVT_IRQ);
- NRF_RADIO->SHORTS = RADIO_SHORTS_READY_START_Enabled << RADIO_SHORTS_READY_START_Pos |
- RADIO_SHORTS_END_DISABLE_Enabled << RADIO_SHORTS_END_DISABLE_Pos;
-
- return NRF_SUCCESS;
-}
-
-
-bool nrf_esb_is_idle(void)
-{
- return m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE;
-}
-
-
-void ESB_EVT_IRQHandler(void)
-{
- ret_code_t err_code;
- uint32_t interrupts;
- nrf_esb_evt_t event;
-
- event.tx_attempts = m_last_tx_attempts;
-
- err_code = nrf_esb_get_clear_interrupts(&interrupts);
- if (err_code == NRF_SUCCESS && m_event_handler != 0)
- {
- if (interrupts & NRF_ESB_INT_TX_SUCCESS_MSK)
- {
- event.evt_id = NRF_ESB_EVENT_TX_SUCCESS;
- m_event_handler(&event);
- }
- if (interrupts & NRF_ESB_INT_TX_FAILED_MSK)
- {
- event.evt_id = NRF_ESB_EVENT_TX_FAILED;
- m_event_handler(&event);
- }
- if (interrupts & NRF_ESB_INT_RX_DATA_RECEIVED_MSK)
- {
- event.evt_id = NRF_ESB_EVENT_RX_RECEIVED;
- m_event_handler(&event);
- }
- }
-}
-
-uint32_t nrf_esb_write_payload(nrf_esb_payload_t const * p_payload)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
- VERIFY_PARAM_NOT_NULL(p_payload);
- VERIFY_PAYLOAD_LENGTH(p_payload);
- VERIFY_FALSE(m_tx_fifo.count >= NRF_ESB_TX_FIFO_SIZE, NRF_ERROR_NO_MEM);
-
- if (m_config_local.mode == NRF_ESB_MODE_PTX &&
- p_payload->noack && !m_config_local.selective_auto_ack )
- {
- return NRF_ERROR_NOT_SUPPORTED;
- }
-
- DISABLE_RF_IRQ();
-
- memcpy(m_tx_fifo.p_payload[m_tx_fifo.entry_point], p_payload, sizeof(nrf_esb_payload_t));
-
- m_pids[p_payload->pipe] = (m_pids[p_payload->pipe] + 1) % (NRF_ESB_PID_MAX + 1);
- m_tx_fifo.p_payload[m_tx_fifo.entry_point]->pid = m_pids[p_payload->pipe];
-
- if (++m_tx_fifo.entry_point >= NRF_ESB_TX_FIFO_SIZE)
- {
- m_tx_fifo.entry_point = 0;
- }
-
- m_tx_fifo.count++;
-
- ENABLE_RF_IRQ();
-
-
- if (m_config_local.mode == NRF_ESB_MODE_PTX &&
- m_config_local.tx_mode == NRF_ESB_TXMODE_AUTO &&
- m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE)
- {
- start_tx_transaction();
- }
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_read_rx_payload(nrf_esb_payload_t * p_payload)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
- VERIFY_PARAM_NOT_NULL(p_payload);
-
- if (m_rx_fifo.count == 0)
- {
- return NRF_ERROR_NOT_FOUND;
- }
-
- DISABLE_RF_IRQ();
-
- p_payload->length = m_rx_fifo.p_payload[m_rx_fifo.exit_point]->length;
- p_payload->pipe = m_rx_fifo.p_payload[m_rx_fifo.exit_point]->pipe;
- p_payload->rssi = m_rx_fifo.p_payload[m_rx_fifo.exit_point]->rssi;
- p_payload->pid = m_rx_fifo.p_payload[m_rx_fifo.exit_point]->pid;
- memcpy(p_payload->data, m_rx_fifo.p_payload[m_rx_fifo.exit_point]->data, p_payload->length);
-
- if (++m_rx_fifo.exit_point >= NRF_ESB_RX_FIFO_SIZE)
- {
- m_rx_fifo.exit_point = 0;
- }
-
- m_rx_fifo.count--;
-
- ENABLE_RF_IRQ();
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_start_tx(void)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
-
- if (m_tx_fifo.count == 0)
- {
- return NRF_ERROR_BUFFER_EMPTY;
- }
-
- start_tx_transaction();
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_start_rx(void)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
-
- NRF_RADIO->INTENCLR = 0xFFFFFFFF;
- NRF_RADIO->EVENTS_DISABLED = 0;
- on_radio_disabled = on_radio_disabled_rx;
-
- NRF_RADIO->SHORTS = RADIO_SHORTS_COMMON | RADIO_SHORTS_DISABLED_TXEN_Msk;
- NRF_RADIO->INTENSET = RADIO_INTENSET_DISABLED_Msk;
- m_nrf_esb_mainstate = NRF_ESB_STATE_PRX;
-
- NRF_RADIO->RXADDRESSES = m_esb_addr.rx_pipes_enabled;
- NRF_RADIO->FREQUENCY = m_esb_addr.rf_channel;
- NRF_RADIO->PACKETPTR = (uint32_t)m_rx_payload_buffer;
-
- NVIC_ClearPendingIRQ(RADIO_IRQn);
- NVIC_EnableIRQ(RADIO_IRQn);
-
- NRF_RADIO->EVENTS_ADDRESS = 0;
- NRF_RADIO->EVENTS_PAYLOAD = 0;
- NRF_RADIO->EVENTS_DISABLED = 0;
-
- NRF_RADIO->TASKS_RXEN = 1;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_stop_rx(void)
-{
- if (m_nrf_esb_mainstate == NRF_ESB_STATE_PRX)
- {
- NRF_RADIO->SHORTS = 0;
- NRF_RADIO->INTENCLR = 0xFFFFFFFF;
- on_radio_disabled = NULL;
- NRF_RADIO->EVENTS_DISABLED = 0;
- NRF_RADIO->TASKS_DISABLE = 1;
- while (NRF_RADIO->EVENTS_DISABLED == 0);
- m_nrf_esb_mainstate = NRF_ESB_STATE_IDLE;
-
- return NRF_SUCCESS;
- }
-
- return NRF_ESB_ERROR_NOT_IN_RX_MODE;
-}
-
-
-uint32_t nrf_esb_flush_tx(void)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
-
- DISABLE_RF_IRQ();
-
- m_tx_fifo.count = 0;
- m_tx_fifo.entry_point = 0;
- m_tx_fifo.exit_point = 0;
-
- ENABLE_RF_IRQ();
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_pop_tx(void)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
- VERIFY_TRUE(m_tx_fifo.count > 0, NRF_ERROR_BUFFER_EMPTY);
-
- DISABLE_RF_IRQ();
-
- if (++m_tx_fifo.entry_point >= NRF_ESB_TX_FIFO_SIZE)
- {
- m_tx_fifo.entry_point = 0;
- }
- m_tx_fifo.count--;
-
- ENABLE_RF_IRQ();
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_flush_rx(void)
-{
- VERIFY_TRUE(m_esb_initialized, NRF_ERROR_INVALID_STATE);
-
- DISABLE_RF_IRQ();
-
- m_rx_fifo.count = 0;
- m_rx_fifo.entry_point = 0;
- m_rx_fifo.exit_point = 0;
-
- memset(m_rx_pipe_info, 0, sizeof(m_rx_pipe_info));
-
- ENABLE_RF_IRQ();
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_address_length(uint8_t length)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_TRUE(length > 2 && length < 6, NRF_ERROR_INVALID_PARAM);
-
- m_esb_addr.addr_length = length;
-
- update_rf_payload_format(m_config_local.payload_length);
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_base_address_0(uint8_t const * p_addr)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_PARAM_NOT_NULL(p_addr);
-
- memcpy(m_esb_addr.base_addr_p0, p_addr, 4);
-
- update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE0);
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_base_address_1(uint8_t const * p_addr)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_PARAM_NOT_NULL(p_addr);
-
- memcpy(m_esb_addr.base_addr_p1, p_addr, 4);
-
- update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_BASE1);
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_prefixes(uint8_t const * p_prefixes, uint8_t num_pipes)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_PARAM_NOT_NULL(p_prefixes);
- VERIFY_TRUE(num_pipes < 9, NRF_ERROR_INVALID_PARAM);
-
- memcpy(m_esb_addr.pipe_prefixes, p_prefixes, num_pipes);
- m_esb_addr.num_pipes = num_pipes;
- m_esb_addr.rx_pipes_enabled = BIT_MASK_UINT_8(num_pipes);
-
- update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_PREFIX);
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_update_prefix(uint8_t pipe, uint8_t prefix)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_TRUE(pipe < 8, NRF_ERROR_INVALID_PARAM);
-
- m_esb_addr.pipe_prefixes[pipe] = prefix;
-
- update_radio_addresses(NRF_ESB_ADDR_UPDATE_MASK_PREFIX);
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_enable_pipes(uint8_t enable_mask)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
-
- m_esb_addr.rx_pipes_enabled = enable_mask;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_rf_channel(uint32_t channel)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
- VERIFY_TRUE(channel <= 125, NRF_ERROR_INVALID_PARAM);
-
- m_esb_addr.rf_channel = channel;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_get_rf_channel(uint32_t * p_channel)
-{
- VERIFY_PARAM_NOT_NULL(p_channel);
-
- *p_channel = m_esb_addr.rf_channel;
-
- return NRF_SUCCESS;
-}
-
-
-uint32_t nrf_esb_set_tx_power(nrf_esb_tx_power_t tx_output_power)
-{
- VERIFY_TRUE(m_nrf_esb_mainstate == NRF_ESB_STATE_IDLE, NRF_ERROR_BUSY);
-
- if ( m_config_local.tx_output_power != tx_output_power )
- {
- m_config_local.tx_output_power = tx_output_power;
- update_radio_tx_power();
- }
-
- return NRF_SUCCESS;
-}
diff --git a/components/proprietary_rf/esb/nrf_esb.h b/components/proprietary_rf/esb/nrf_esb.h
deleted file mode 100644
index 1ddf26b..0000000
--- a/components/proprietary_rf/esb/nrf_esb.h
+++ /dev/null
@@ -1,526 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef __NRF_ESB_H
-#define __NRF_ESB_H
-
-#include
-#include
-#include "nrf.h"
-#include "app_util.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** @defgroup nrf_esb Enhanced ShockBurst
- * @{
- * @ingroup proprietary_api
- *
- * @brief Enhanced ShockBurst (ESB) is a basic protocol that supports two-way data
- * packet communication including packet buffering, packet acknowledgment,
- * and automatic retransmission of lost packets.
- */
-
-#define DEBUGPIN1 12
-#define DEBUGPIN2 13
-#define DEBUGPIN3 14
-#define DEBUGPIN4 15
-
-
-#ifdef NRF_ESB_DEBUG
-#define DEBUG_PIN_SET(a) (NRF_GPIO->OUTSET = (1 << (a)))
-#define DEBUG_PIN_CLR(a) (NRF_GPIO->OUTCLR = (1 << (a)))
-#else
-#define DEBUG_PIN_SET(a)
-#define DEBUG_PIN_CLR(a)
-#endif
-
-
-// Hardcoded parameters - change if necessary
-#ifndef NRF_ESB_MAX_PAYLOAD_LENGTH
-#define NRF_ESB_MAX_PAYLOAD_LENGTH 32 /**< The maximum size of the payload. Valid values are 1 to 252. */
-#endif
-
-#define NRF_ESB_TX_FIFO_SIZE 8 /**< The size of the transmission first-in, first-out buffer. */
-#define NRF_ESB_RX_FIFO_SIZE 8 /**< The size of the reception first-in, first-out buffer. */
-
-// 252 is the largest possible payload size according to the nRF5 architecture.
-STATIC_ASSERT(NRF_ESB_MAX_PAYLOAD_LENGTH <= 252);
-
-#define NRF_ESB_SYS_TIMER NRF_TIMER2 /**< The timer that is used by the module. */
-#define NRF_ESB_SYS_TIMER_IRQ_Handler TIMER2_IRQHandler /**< The handler that is used by @ref NRF_ESB_SYS_TIMER. */
-
-#define NRF_ESB_PPI_TIMER_START 10 /**< The PPI channel used for timer start. */
-#define NRF_ESB_PPI_TIMER_STOP 11 /**< The PPI channel used for timer stop. */
-#define NRF_ESB_PPI_RX_TIMEOUT 12 /**< The PPI channel used for RX time-out. */
-#define NRF_ESB_PPI_TX_START 13 /**< The PPI channel used for starting TX. */
-
-// Interrupt flags
-#define NRF_ESB_INT_TX_SUCCESS_MSK 0x01 /**< The flag used to indicate a success since the last event. */
-#define NRF_ESB_INT_TX_FAILED_MSK 0x02 /**< The flag used to indicate a failure since the last event. */
-#define NRF_ESB_INT_RX_DR_MSK 0x04 /**< The flag used to indicate that a packet was received since the last event. */
-
-#define NRF_ESB_PID_RESET_VALUE 0xFF /**< Invalid PID value that is guaranteed to not collide with any valid PID value. */
-#define NRF_ESB_PID_MAX 3 /**< The maximum value for PID. */
-#define NRF_ESB_CRC_RESET_VALUE 0xFFFF /**< The CRC reset value. */
-
-#define ESB_EVT_IRQ SWI0_IRQn /**< The ESB event IRQ number when running on an nRF5x device. */
-#define ESB_EVT_IRQHandler SWI0_IRQHandler /**< The handler for @ref ESB_EVT_IRQ when running on an nRF5x device. */
-
-/** Default address configuration for ESB. Roughly equal to the nRF24Lxx default (except for the number of pipes, because more pipes are supported). */
-#define NRF_ESB_ADDR_DEFAULT \
-{ \
- .base_addr_p0 = { 0xE7, 0xE7, 0xE7, 0xE7 }, \
- .base_addr_p1 = { 0xC2, 0xC2, 0xC2, 0xC2 }, \
- .pipe_prefixes = { 0xE7, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8 }, \
- .addr_length = 5, \
- .num_pipes = 8, \
- .rf_channel = 2, \
- .rx_pipes_enabled = 0xFF \
-}
-
-
-/** Default radio parameters. Roughly equal to the nRF24Lxx default parameters (except for CRC, which is set to 16 bit, and protocol, which is set to DPL). */
-#define NRF_ESB_DEFAULT_CONFIG {.protocol = NRF_ESB_PROTOCOL_ESB_DPL, \
- .mode = NRF_ESB_MODE_PTX, \
- .event_handler = 0, \
- .bitrate = NRF_ESB_BITRATE_2MBPS, \
- .crc = NRF_ESB_CRC_16BIT, \
- .tx_output_power = NRF_ESB_TX_POWER_0DBM, \
- .retransmit_delay = 250, \
- .retransmit_count = 3, \
- .tx_mode = NRF_ESB_TXMODE_AUTO, \
- .radio_irq_priority = 1, \
- .event_irq_priority = 2, \
- .payload_length = 32, \
- .selective_auto_ack = false \
-}
-
-
-/** Default legacy radio parameters, identical to the nRF24Lxx defaults. */
-#define NRF_ESB_LEGACY_CONFIG {.protocol = NRF_ESB_PROTOCOL_ESB, \
- .mode = NRF_ESB_MODE_PTX, \
- .event_handler = 0, \
- .bitrate = NRF_ESB_BITRATE_2MBPS, \
- .crc = NRF_ESB_CRC_8BIT, \
- .tx_output_power = NRF_ESB_TX_POWER_0DBM, \
- .retransmit_delay = 600, \
- .retransmit_count = 3, \
- .tx_mode = NRF_ESB_TXMODE_AUTO, \
- .radio_irq_priority = 1, \
- .event_irq_priority = 2, \
- .payload_length = 32, \
- .selective_auto_ack = false \
-}
-
-
-/**Macro to create an initializer for a TX data packet.
- *
- * @details This macro generates an initializer. Using the initializer is more efficient
- * than setting the individual parameters dynamically.
- *
- * @param[in] _pipe The pipe to use for the data packet.
- * @param[in] ... Comma separated list of character data to put in the TX buffer.
- * Supported values consist of 1 to 63 characters.
- *
- * @return Initializer that sets up the pipe, length, and byte array for content of the TX data.
- */
-#define NRF_ESB_CREATE_PAYLOAD(_pipe, ...) \
- {.pipe = _pipe, .length = NUM_VA_ARGS(__VA_ARGS__), .data = {__VA_ARGS__}}; \
- STATIC_ASSERT(NUM_VA_ARGS(__VA_ARGS__) > 0 && NUM_VA_ARGS(__VA_ARGS__) <= 63)
-
-
-/**@brief Enhanced ShockBurst protocols. */
-typedef enum {
- NRF_ESB_PROTOCOL_ESB, /*< Enhanced ShockBurst with fixed payload length. */
- NRF_ESB_PROTOCOL_ESB_DPL /*< Enhanced ShockBurst with dynamic payload length. */
-} nrf_esb_protocol_t;
-
-
-/**@brief Enhanced ShockBurst modes. */
-typedef enum {
- NRF_ESB_MODE_PTX, /*< Primary transmitter mode. */
- NRF_ESB_MODE_PRX /*< Primary receiver mode. */
-} nrf_esb_mode_t;
-
-
-/**@brief Enhanced ShockBurst bitrate modes. */
-typedef enum {
- NRF_ESB_BITRATE_2MBPS = RADIO_MODE_MODE_Nrf_2Mbit, /**< 2 Mb radio mode. */
- NRF_ESB_BITRATE_1MBPS = RADIO_MODE_MODE_Nrf_1Mbit, /**< 1 Mb radio mode. */
- NRF_ESB_BITRATE_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, /**< 250 Kb radio mode. */
- NRF_ESB_BITRATE_1MBPS_BLE = RADIO_MODE_MODE_Ble_1Mbit /**< 1 Mb radio mode using @e Bluetooth low energy radio parameters. */
-} nrf_esb_bitrate_t;
-
-
-/**@brief Enhanced ShockBurst CRC modes. */
-typedef enum {
- NRF_ESB_CRC_16BIT = RADIO_CRCCNF_LEN_Two, /**< Use two-byte CRC. */
- NRF_ESB_CRC_8BIT = RADIO_CRCCNF_LEN_One, /**< Use one-byte CRC. */
- NRF_ESB_CRC_OFF = RADIO_CRCCNF_LEN_Disabled /**< Disable CRC. */
-} nrf_esb_crc_t;
-
-
-/**@brief Enhanced ShockBurst radio transmission power modes. */
-typedef enum {
- NRF_ESB_TX_POWER_4DBM = RADIO_TXPOWER_TXPOWER_Pos4dBm, /**< 4 dBm radio transmit power. */
- NRF_ESB_TX_POWER_0DBM = RADIO_TXPOWER_TXPOWER_0dBm, /**< 0 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG4DBM = RADIO_TXPOWER_TXPOWER_Neg4dBm, /**< -4 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG8DBM = RADIO_TXPOWER_TXPOWER_Neg8dBm, /**< -8 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG12DBM = RADIO_TXPOWER_TXPOWER_Neg12dBm, /**< -12 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG16DBM = RADIO_TXPOWER_TXPOWER_Neg16dBm, /**< -16 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG20DBM = RADIO_TXPOWER_TXPOWER_Neg20dBm, /**< -20 dBm radio transmit power. */
- NRF_ESB_TX_POWER_NEG30DBM = RADIO_TXPOWER_TXPOWER_Neg30dBm /**< -30 dBm radio transmit power. */
-} nrf_esb_tx_power_t;
-
-
-/**@brief Enhanced ShockBurst transmission modes. */
-typedef enum {
- NRF_ESB_TXMODE_AUTO, /*< Automatic TX mode: When the TX FIFO contains packets and the radio is idle, packets are sent automatically. */
- NRF_ESB_TXMODE_MANUAL, /*< Manual TX mode: Packets are not sent until @ref nrf_esb_start_tx is called. This mode can be used to ensure consistent packet timing. */
- NRF_ESB_TXMODE_MANUAL_START /*< Manual start TX mode: Packets are not sent until @ref nrf_esb_start_tx is called. Then, transmission continues automatically until the TX FIFO is empty. */
-} nrf_esb_tx_mode_t;
-
-
-/**@brief Enhanced ShockBurst event IDs used to indicate the type of the event. */
-typedef enum
-{
- NRF_ESB_EVENT_TX_SUCCESS, /**< Event triggered on TX success. */
- NRF_ESB_EVENT_TX_FAILED, /**< Event triggered on TX failure. */
- NRF_ESB_EVENT_RX_RECEIVED /**< Event triggered on RX received. */
-} nrf_esb_evt_id_t;
-
-
-/**@brief Enhanced ShockBurst payload.
- *
- * @details The payload is used both for transmissions and for acknowledging a
- * received packet with a payload.
-*/
-typedef struct
-{
- uint8_t length; /**< Length of the packet (maximum value is NRF_ESB_MAX_PAYLOAD_LENGTH). */
- uint8_t pipe; /**< Pipe used for this payload. */
- int8_t rssi; /**< RSSI for the received packet. */
- uint8_t noack; /**< Flag indicating that this packet will not be acknowledged. */
- uint8_t pid; /**< PID assigned during communication. */
- uint8_t data[NRF_ESB_MAX_PAYLOAD_LENGTH]; /**< The payload data. */
-} nrf_esb_payload_t;
-
-
-/**@brief Enhanced ShockBurst event. */
-typedef struct
-{
- nrf_esb_evt_id_t evt_id; /**< Enhanced ShockBurst event ID. */
- uint32_t tx_attempts; /**< Number of TX retransmission attempts. */
-} nrf_esb_evt_t;
-
-
-/**@brief Definition of the event handler for the module. */
-typedef void (* nrf_esb_event_handler_t)(nrf_esb_evt_t const * p_event);
-
-
-/**@brief Main configuration structure for the module. */
-typedef struct
-{
- nrf_esb_protocol_t protocol; /**< Enhanced ShockBurst protocol. */
- nrf_esb_mode_t mode; /**< Enhanced ShockBurst mode. */
- nrf_esb_event_handler_t event_handler; /**< Enhanced ShockBurst event handler. */
-
- // General RF parameters
- nrf_esb_bitrate_t bitrate; /**< Enhanced ShockBurst bitrate mode. */
- nrf_esb_crc_t crc; /**< Enhanced ShockBurst CRC modes. */
-
- nrf_esb_tx_power_t tx_output_power; /**< Enhanced ShockBurst radio transmission power mode.*/
-
- uint16_t retransmit_delay; /**< The delay between each retransmission of unacknowledged packets. */
- uint16_t retransmit_count; /**< The number of retransmissions attempts before transmission fail. */
-
- // Control settings
- nrf_esb_tx_mode_t tx_mode; /**< Enhanced ShockBurst transmission mode. */
-
- uint8_t radio_irq_priority; /**< nRF radio interrupt priority. */
- uint8_t event_irq_priority; /**< ESB event interrupt priority. */
- uint8_t payload_length; /**< Length of the payload (maximum length depends on the platforms that are used on each side). */
-
- bool selective_auto_ack; /**< Enable or disable selective auto acknowledgment. */
-} nrf_esb_config_t;
-
-
-/**@brief Function for initializing the Enhanced ShockBurst module.
- *
- * @param p_config Parameters for initializing the module.
- *
- * @retval NRF_SUCCESS If initialization was successful.
- * @retval NRF_ERROR_NULL If the @p p_config argument was NULL.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_init(nrf_esb_config_t const * p_config);
-
-
-/**@brief Function for suspending the Enhanced ShockBurst module.
- *
- * Calling this function stops ongoing communications without changing the queues.
- *
- * @retval NRF_SUCCESS If Enhanced ShockBurst was suspended.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_suspend(void);
-
-
-/**@brief Function for disabling the Enhanced ShockBurst module.
- *
- * Calling this function disables the Enhanced ShockBurst module immediately.
- * Doing so might stop ongoing communications.
- *
- * @note All queues are flushed by this function.
- *
- * @retval NRF_SUCCESS If Enhanced ShockBurst was disabled.
- */
-uint32_t nrf_esb_disable(void);
-
-
-/**@brief Function for checking if the Enhanced ShockBurst module is idle.
- *
- * @retval true If the module is idle.
- * @retval false If the module is busy.
- */
-bool nrf_esb_is_idle(void);
-
-
-/**@brief Function for writing a payload for transmission or acknowledgment.
- *
- * This function writes a payload that is added to the queue. When the module is in PTX mode, the
- * payload is queued for a regular transmission. When the module is in PRX mode, the payload
- * is queued for when a packet is received that requires an acknowledgment with payload.
- *
- * @param[in] p_payload Pointer to the structure that contains information and state of the payload.
- *
- * @retval NRF_SUCCESS If the payload was successfully queued for writing.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- * @retval NRF_ERROR_NOT_SUPPORTED If @p p_payload->noack was false, but selective acknowledgment is not enabled.
- * @retval NRF_ERROR_NO_MEM If the TX FIFO is full.
- * @retval NRF_ERROR_INVALID_LENGTH If the payload length was invalid (zero or larger than the allowed maximum).
- */
-uint32_t nrf_esb_write_payload(nrf_esb_payload_t const * p_payload);
-
-
-/**@brief Function for reading an RX payload.
- *
- * @param[in,out] p_payload Pointer to the structure that contains information and state of the payload.
- *
- * @retval NRF_SUCCESS If the data was read successfully.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- */
-uint32_t nrf_esb_read_rx_payload(nrf_esb_payload_t * p_payload);
-
-
-/**@brief Function for starting transmission.
- *
- * @retval NRF_SUCCESS If the TX started successfully.
- * @retval NRF_ERROR_BUFFER_EMPTY If the TX does not start because the FIFO buffer is empty.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_start_tx(void);
-
-
-/**@brief Function for starting to transmit data from the FIFO buffer.
- *
- * @retval NRF_SUCCESS If the transmission was started successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_start_rx(void);
-
-
-/** @brief Function for stopping data reception.
- *
- * @retval NRF_SUCCESS If data reception was stopped successfully.
- * @retval NRF_ESB_ERROR_NOT_IN_RX_MODE If the function failed because the module is not in RX mode.
- */
-uint32_t nrf_esb_stop_rx(void);
-
-
-/**@brief Function for removing remaining items from the TX buffer.
- *
- * This function clears the TX FIFO buffer.
- *
- * @retval NRF_SUCCESS If pending items in the TX buffer were successfully cleared.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- */
-uint32_t nrf_esb_flush_tx(void);
-
-
-/**@brief Function for removing the first item from the TX buffer.
- *
- * @retval NRF_SUCCESS If the operation completed successfully.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- * @retval NRF_ERROR_BUFFER_EMPTY If there are no items in the queue to remove.
- */
-uint32_t nrf_esb_pop_tx(void);
-
-
-/**@brief Function for removing remaining items from the RX buffer.
- *
- * @retval NRF_SUCCESS If the pending items in the RX buffer were successfully cleared.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- */
-uint32_t nrf_esb_flush_rx(void);
-
-
-
-/**@brief Function for setting the length of the address.
- *
- * @param[in] length Length of the ESB address (in bytes).
- *
- * @retval NRF_SUCCESS If the address length was set successfully.
- * @retval NRF_ERROR_INVALID_PARAM If the address length was invalid.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_set_address_length(uint8_t length);
-
-
-/**@brief Function for setting the base address for pipe 0.
- *
- * @param[in] p_addr Pointer to the address data.
- *
- * @retval NRF_SUCCESS If the base address was set successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- */
-uint32_t nrf_esb_set_base_address_0(uint8_t const * p_addr);
-
-
-/**@brief Function for setting the base address for pipe 1 to pipe 7.
- *
- * @param[in] p_addr Pointer to the address data.
- *
- * @retval NRF_SUCCESS If the base address was set successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- */
-uint32_t nrf_esb_set_base_address_1(uint8_t const * p_addr);
-
-
-/**@brief Function for setting the number of pipes and the pipe prefix addresses.
- *
- * This function configures the number of available pipes, enables the pipes,
- * and sets their prefix addresses.
- *
- * @param[in] p_prefixes Pointer to a char array that contains the prefix for each pipe.
- * @param[in] num_pipes Number of pipes.
- *
- * @retval NRF_SUCCESS If the prefix addresses were set successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- * @retval NRF_ERROR_NULL If a required parameter was NULL.
- * @retval NRF_ERROR_INVALID_PARAM If an invalid number of pipes was given.
- */
-uint32_t nrf_esb_set_prefixes(uint8_t const * p_prefixes, uint8_t num_pipes);
-
-
-/**@brief Function for enabling pipes.
- *
- * The @p enable_mask parameter must contain the same number of pipes as has been configured
- * with @ref nrf_esb_set_prefixes.
- *
- * @param enable_mask Bitfield mask to enable or disable pipes. Setting a bit to
- * 0 disables the pipe. Setting a bit to 1 enables the pipe.
- *
- * @retval NRF_SUCCESS If the pipes were enabled and disabled successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_enable_pipes(uint8_t enable_mask);
-
-
-/**@brief Function for updating the prefix for a pipe.
- *
- * @param pipe Pipe for which to set the prefix.
- * @param prefix Prefix to set for the pipe.
- *
- * @retval NRF_SUCCESS If the operation completed successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- * @retval NRF_ERROR_INVALID_PARAM If the given pipe number was invalid.
- */
-uint32_t nrf_esb_update_prefix(uint8_t pipe, uint8_t prefix);
-
-
-/** @brief Function for setting the channel to use for the radio.
- *
- * The module must be in an idle state to call this function. As a PTX, the
- * application must wait for an idle state and as a PRX, the application must stop RX
- * before changing the channel. After changing the channel, operation can be resumed.
- *
- * @param[in] channel Channel to use for radio.
- *
- * @retval NRF_SUCCESS If the operation completed successfully.
- * @retval NRF_INVALID_STATE If the module is not initialized.
- * @retval NRF_ERROR_BUSY If the module was not in idle state.
- * @retval NRF_ERROR_INVALID_PARAM If the channel is invalid (larger than 125).
- */
-uint32_t nrf_esb_set_rf_channel(uint32_t channel);
-
-
-/**@brief Function for getting the current radio channel.
- *
- * @param[in, out] p_channel Pointer to the channel data.
- *
- * @retval NRF_SUCCESS If the operation completed successfully.
- * @retval NRF_ERROR_NULL If the required parameter was NULL.
- */
-uint32_t nrf_esb_rf_channel_get(uint32_t * p_channel);
-
-
-/**@brief Function for setting the radio output power.
- *
- * @param[in] tx_output_power Output power.
- *
- * @retval NRF_SUCCESS If the operation completed successfully.
- * @retval NRF_ERROR_BUSY If the function failed because the radio is busy.
- */
-uint32_t nrf_esb_set_tx_power(nrf_esb_tx_power_t tx_output_power);
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // NRF_ESB
diff --git a/components/proprietary_rf/esb/nrf_esb_error_codes.h b/components/proprietary_rf/esb/nrf_esb_error_codes.h
deleted file mode 100644
index c594151..0000000
--- a/components/proprietary_rf/esb/nrf_esb_error_codes.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-#ifndef __NRF_ESB_ERROR_CODES_H__
-#define __NRF_ESB_ERROR_CODES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NRF_ERROR_BUFFER_EMPTY (0x0100)
-
-#define NRF_ESB_ERROR_NOT_IN_RX_MODE (0x0101)
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/esb/nrf_esb_resources.h b/components/proprietary_rf/esb/nrf_esb_resources.h
deleted file mode 100644
index 35050c7..0000000
--- a/components/proprietary_rf/esb/nrf_esb_resources.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NRF_ESB_RESOURCES_H__
-#define NRF_ESB_RESOURCES_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @defgroup nrf_esb_resources ESB resources
- * @{
- * @ingroup nrf_esb
- */
-
-#ifndef ESB_ALTERNATIVE_RESOURCES
- #define ESB_PPI_CHANNELS_USED 0x00000007uL /**< PPI channels used by ESB (not available to the application). */
- #define ESB_TIMERS_USED 0x00000004uL /**< Timers used by ESB. */
- #define ESB_SWI_USED 0x00000001uL /**< Software interrupts used by ESB. */
-#else
- #define ESB_PPI_CHANNELS_USED 0x00000700uL /**< PPI channels used by ESB (not available to the application). */
- #define ESB_TIMERS_USED 0x00000001uL /**< Timers used by ESB. */
- #define ESB_SWI_USED 0x00000002uL /**< Software interrupts used by ESB. */
-#endif
-
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NRF_ESB_RESOURCES_H__ */
diff --git a/components/proprietary_rf/gzll/arm/license.txt b/components/proprietary_rf/gzll/arm/license.txt
deleted file mode 100644
index 3a9e590..0000000
--- a/components/proprietary_rf/gzll/arm/license.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form, except as embedded into a Nordic
- Semiconductor ASA integrated circuit in a product or a software update for
- such product, must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. Neither the name of Nordic Semiconductor ASA nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-4. This software, with or without modification, must only be used with a
- Nordic Semiconductor ASA integrated circuit.
-
-5. Any software provided in binary form under this license must not be reverse
- engineered, decompiled, modified and/or disassembled.
-
-THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/components/proprietary_rf/gzll/config/nrf_gzp_config.h b/components/proprietary_rf/gzll/config/nrf_gzp_config.h
deleted file mode 100644
index bf3dcda..0000000
--- a/components/proprietary_rf/gzll/config/nrf_gzp_config.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * Copyright (c) 2008 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#ifndef __GZP_CONFIG_H
-#define __GZP_CONFIG_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * Definition of "secret key" used during "Host ID exchange".
- */
-
-#define GZP_SECRET_KEY {1, 23, 45, 57, 26, 68, 12, 64, 13, 73, 13, 62, 26, 45, 12, 77}
-
-//-----------------------------------------------------------------------------
-
-/**
- Definition of the first static selected pairing channel. Should be located in
- the lower Nth of the channel range, where N is the size if the channel subset
- selected by the application.
-*/
-#define GZP_CHANNEL_LOW 2
-
-/**
- Definition of the second static selected pairing channel. Should be located in
- the upper Nth of the channel range, where N is the size if the channel subset
- selected by the application.
-*/
-#define GZP_CHANNEL_HIGH 79
-
-/**
- Definition of the static "global" pairing address.
-*/
-#define GZP_ADDRESS 4, 6, 8, 10
-
-/**
- Reduced TX power for use during close proximity pairing.
- */
-#define GZP_POWER NRF_GZLL_TX_POWER_N16_DBM
-
-/**
- Definition of pairing request timeout.
-*/
-#define GZP_REQ_TX_TIMEOUT 200
-
-/**
- Definition of the maximimum number of "backoff" packets (step 0) to be transmitted.
-*/
-#define GZP_MAX_BACKOFF_PACKETS 100
-
-/**
- Definition of the period a device shall wait before attempting to send the packet for
- fetching the pairing response (step 1).
-*/
-#define GZP_TX_ACK_WAIT_TIMEOUT (GZP_CLOSE_PROXIMITY_BACKOFF_RX_TIMEOUT + 50)
-
-/**
- Definition of the period a device in close proximity shall back off on the pairing
- address after a backoff packet has been received.
-*/
-#define GZP_CLOSE_PROXIMITY_BACKOFF_RX_TIMEOUT ((GZP_REQ_TX_TIMEOUT / 2) + 50)
-
-/**
- Definition of the period a device NOT in close proximity shall back off on the pairing
- address after a backoff packet has been received.
-*/
-#define GZP_NOT_PROXIMITY_BACKOFF_RX_TIMEOUT (GZP_CLOSE_PROXIMITY_BACKOFF_RX_TIMEOUT + GZP_STEP1_RX_TIMEOUT)
-
-/**
- Definition of the time the host waits for a device to complete
- transmission of the pairing request step 1 packet.
-*/
-#define GZP_STEP1_RX_TIMEOUT (((GZP_REQ_TX_TIMEOUT / 2) + GZP_TX_ACK_WAIT_TIMEOUT) + 50)
-
-/**
- Definition of the lowest boundary for the channel range to be used.
-*/
-#define GZP_CHANNEL_MIN 2
-
-/**
- Definition of the upper boundary for the channel range to be used.
-*/
-#define GZP_CHANNEL_MAX 80
-
-/**
- Definition of the minimum channel spacing for the channel subset generated
- during pairing.
-*/
-#define GZP_CHANNEL_SPACING_MIN 5
-
-/**
- Non volatile memory (Flash or OTP) storage address. A device will
- require GZP_DEVICE_PARAMS_STORAGE_SIZE bytes of memory, and
- Host 11 bytes. When using flash memory, storage address should
- be a multiple of chip page size.
-*/
-#define GZP_PARAMS_STORAGE_ADR 0x00001000
-
-/**
- Number of bytes available for parameter storage in Device.
- It is equal to flash page size on nRF5x chips.
-*/
-#if defined (NRF51)
- #define GZP_DEVICE_PARAMS_STORAGE_SIZE 1024
-#elif defined (NRF52)
- #define GZP_DEVICE_PARAMS_STORAGE_SIZE 4096
-#endif
-
-/**
- Maximum Device TX payload length [bytes].
- */
-#define GZP_MAX_FW_PAYLOAD_LENGTH 17
-
-/**
- Maximum Host ACK payload length [bytes].
- */
-#define GZP_MAX_ACK_PAYLOAD_LENGTH 10
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/gzll/gcc/gzll_nrf51_gcc.a b/components/proprietary_rf/gzll/gcc/gzll_nrf51_gcc.a
deleted file mode 100644
index a6f8dd7..0000000
Binary files a/components/proprietary_rf/gzll/gcc/gzll_nrf51_gcc.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/gcc/gzll_nrf51_sd_resources_gcc.a b/components/proprietary_rf/gzll/gcc/gzll_nrf51_sd_resources_gcc.a
deleted file mode 100644
index 1956f28..0000000
Binary files a/components/proprietary_rf/gzll/gcc/gzll_nrf51_sd_resources_gcc.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/gcc/gzll_nrf52_gcc.a b/components/proprietary_rf/gzll/gcc/gzll_nrf52_gcc.a
deleted file mode 100644
index f1d603c..0000000
Binary files a/components/proprietary_rf/gzll/gcc/gzll_nrf52_gcc.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/gcc/gzll_nrf52_sd_resources_gcc.a b/components/proprietary_rf/gzll/gcc/gzll_nrf52_sd_resources_gcc.a
deleted file mode 100644
index 3446a90..0000000
Binary files a/components/proprietary_rf/gzll/gcc/gzll_nrf52_sd_resources_gcc.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/gcc/license.txt b/components/proprietary_rf/gzll/gcc/license.txt
deleted file mode 100644
index 3a9e590..0000000
--- a/components/proprietary_rf/gzll/gcc/license.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form, except as embedded into a Nordic
- Semiconductor ASA integrated circuit in a product or a software update for
- such product, must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. Neither the name of Nordic Semiconductor ASA nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-4. This software, with or without modification, must only be used with a
- Nordic Semiconductor ASA integrated circuit.
-
-5. Any software provided in binary form under this license must not be reverse
- engineered, decompiled, modified and/or disassembled.
-
-THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/components/proprietary_rf/gzll/iar/gzll_nrf51_iar.a b/components/proprietary_rf/gzll/iar/gzll_nrf51_iar.a
deleted file mode 100644
index 499a2d3..0000000
Binary files a/components/proprietary_rf/gzll/iar/gzll_nrf51_iar.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/iar/gzll_nrf51_sd_resource_iar.a b/components/proprietary_rf/gzll/iar/gzll_nrf51_sd_resource_iar.a
deleted file mode 100644
index 60603bf..0000000
Binary files a/components/proprietary_rf/gzll/iar/gzll_nrf51_sd_resource_iar.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/iar/gzll_nrf52_iar.a b/components/proprietary_rf/gzll/iar/gzll_nrf52_iar.a
deleted file mode 100644
index 743ab9f..0000000
Binary files a/components/proprietary_rf/gzll/iar/gzll_nrf52_iar.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/iar/gzll_nrf52_sd_resource_iar.a b/components/proprietary_rf/gzll/iar/gzll_nrf52_sd_resource_iar.a
deleted file mode 100644
index e138f87..0000000
Binary files a/components/proprietary_rf/gzll/iar/gzll_nrf52_sd_resource_iar.a and /dev/null differ
diff --git a/components/proprietary_rf/gzll/iar/license.txt b/components/proprietary_rf/gzll/iar/license.txt
deleted file mode 100644
index 3a9e590..0000000
--- a/components/proprietary_rf/gzll/iar/license.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-2. Redistributions in binary form, except as embedded into a Nordic
- Semiconductor ASA integrated circuit in a product or a software update for
- such product, must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other
- materials provided with the distribution.
-
-3. Neither the name of Nordic Semiconductor ASA nor the names of its
- contributors may be used to endorse or promote products derived from this
- software without specific prior written permission.
-
-4. This software, with or without modification, must only be used with a
- Nordic Semiconductor ASA integrated circuit.
-
-5. Any software provided in binary form under this license must not be reverse
- engineered, decompiled, modified and/or disassembled.
-
-THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/components/proprietary_rf/gzll/nrf_gzll.h b/components/proprietary_rf/gzll/nrf_gzll.h
deleted file mode 100644
index 71de57e..0000000
--- a/components/proprietary_rf/gzll/nrf_gzll.h
+++ /dev/null
@@ -1,932 +0,0 @@
-/**
- * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-/**
- * @file
- * @brief Gazell Link Layer API.
- */
-
-#ifndef NRF_GZLL_H__
-#define NRF_GZLL_H__
-
-#include
-#include "nrf.h"
-#include "nrf_gzll_constants.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
-* @defgroup gzll_02_api Application Programming Interface (API)
-* @{
-* @ingroup modules_01_gzll
-* @brief Gazell Link Layer Application Programming Interface (API).
-*/
-
-
-/**
- * @enum nrf_gzll_mode_t
- * @brief Enumerator used for selecting Gazell mode.
- */
-typedef enum
-{
- NRF_GZLL_MODE_DEVICE, ///< Device mode
- NRF_GZLL_MODE_HOST, ///< Host mode
- NRF_GZLL_MODE_SUSPEND, ///< Suspend mode ("disabled with timer running")
-} nrf_gzll_mode_t;
-
-
-/**
- * @enum nrf_gzll_device_channel_selection_policy_t
- * @brief Enumerator used for selecting Gazell Device channel
- * selection policy.
- */
-typedef enum
-{
- NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL, ///< Start on previous successful channel
- NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT, ///< Start on channel currently monitored by Host
-} nrf_gzll_device_channel_selection_policy_t;
-
-
-/**
- * @enum nrf_gzll_tx_power_t
- * @brief Enumerator used for selecting the transmit (TX) power.
- */
-typedef enum
-{
- NRF_GZLL_TX_POWER_4_DBM, ///< 4 dBm transmit power.
- NRF_GZLL_TX_POWER_0_DBM, ///< 0 dBm transmit power.
- NRF_GZLL_TX_POWER_N4_DBM, ///< -4 dBm transmit power.
- NRF_GZLL_TX_POWER_N8_DBM, ///< -8 dBm transmit power.
- NRF_GZLL_TX_POWER_N12_DBM, ///< -12 dBm transmit power.
- NRF_GZLL_TX_POWER_N16_DBM, ///< -16 dBm transmit power.
- NRF_GZLL_TX_POWER_N20_DBM ///< -20 dBm transmit power.
-} nrf_gzll_tx_power_t;
-
-
-/**
- * @enum nrf_gzll_datarate_t
- * @brief Enumerator used for selecting the radio datarate.
- */
-typedef enum
-{
- NRF_GZLL_DATARATE_250KBIT, ///< 250 Kbps datarate.
- NRF_GZLL_DATARATE_1MBIT, ///< 1 Mbps datarate.
- NRF_GZLL_DATARATE_2MBIT ///< 2 Mbps datarate.
-} nrf_gzll_datarate_t;
-
-
-/**
- * @enum nrf_gzll_xosc_ctl_t
- * @brief Enumerator used for specifying whether switching the
- * external 16 MHz oscillator on/off shall be handled automatically
- * inside Gazell or manually by the application.
- */
-typedef enum
-{
- NRF_GZLL_XOSC_CTL_AUTO, ///< Switch XOSC on/off automatically
- NRF_GZLL_XOSC_CTL_MANUAL ///< Switch XOSC on/off manually
-} nrf_gzll_xosc_ctl_t;
-
-/**
- * @enum nrf_gzll_error_code_t
- * @brief Enumerator used for error codes for Gazell API functions
- */
-typedef enum
-{
- NRF_GZLL_ERROR_CODE_NO_ERROR = 0,
- ///< No error has been detected.
- NRF_GZLL_ERROR_CODE_FAILED_TO_INITIALIZE = 1,
- ///< The function NRF_GZLL_init failed.
- NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_CONFIGURE_WHEN_ENABLED = 2,
- ///< A call to a configuration 'set' function was made while Gazell was
- ///< enabled.
- NRF_GZLL_ERROR_CODE_POINTER_IS_NULL = 3,
- ///< A null pointer was given as an input to a function.
- NRF_GZLL_ERROR_CODE_INVALID_PIPE = 4,
- ///< An invalid pipe number was given as an input to a function.
- NRF_GZLL_ERROR_CODE_INVALID_MODE = 5,
- ///< An invalid value for the nrf_gzll_mode_t enumerator was given as input
- ///< to a function.
- NRF_GZLL_ERROR_CODE_INVALID_PAYLOAD_LENGTH = 6,
- ///< An invalid payload length was given as an input to a function.
- NRF_GZLL_ERROR_CODE_INVALID_CHANNEL_TABLE_SIZE = 7,
- ///< An invalid channel table size was given as an input to a function.
- NRF_GZLL_ERROR_CODE_INSUFFICIENT_PACKETS_AVAILABLE = 8,
- ///< There are insufficient packets in the Gazell memory pool to
- ///< successfully execute the operation.
- NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_ADD_TO_FULL_FIFO = 9,
- ///< There is insufficient space in the TX FIFO for the data packet.
- NRF_GZLL_ERROR_CODE_NO_SPACE_IN_RX_FIFO_FOR_ACK = 10,
- ///< There is insufficient space in the RX FIFO for the ACK.
- NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_FETCH_FROM_EMPTY_FIFO = 11,
- ///< Attempted to fetch a packet from an empty FIFO. Use the functions nrf_gzll_get_tx_fifo_packet_count() or nrf_gzll_get_rx_fifo_packet_count()
- NRF_GZLL_ERROR_CODE_ATTEMPTED_TO_FLUSH_WHEN_ENABLED = 12,
- ///< Attempted to fetch a packet from an empty FIFO. Use the functions nrf_gzll_get_tx_fifo_packet_count() or nrf_gzll_get_rx_fifo_packet_count()
- NRF_GZLL_ERROR_CODE_INVALID_PARAMETER = 14,
- ///< Attempted to set a variable which was not valid.
- NRF_GZLL_ERROR_CODE_INTERNAL_ASSERT_OCCURRED = 15,
- ///< An internal assert occurred.
- NRF_GZLL_ERROR_CODE_CALLBACK_NOT_IMPLEMENTED = 16,
- ///< A callback was called but not implemented by the application.
- NRF_GZLL_ERROR_CODE_NUMBER_OF_ERROR_CODES = 17,
- ///< Number of possible error codes.
-} nrf_gzll_error_code_t;
-
-
-/**
- * @struct nrf_gzll_device_tx_info_t;
- * @brief Data structure containing information about the last packet
- * transmission.
- */
-typedef struct
-{
- bool payload_received_in_ack;
- ///< A payload was received in the ACK.
- uint16_t num_tx_attempts;
- ///< Number of attempts used on previous Device packet transmission.
- uint16_t num_channel_switches;
- ///< Number of channel switches needed during previous packet transmission.
- int16_t rssi;
- ///< Received signal strength indicator in dBm. @sa nrf_gzll_enable_rssi().
-} nrf_gzll_device_tx_info_t;
-
-/**
- * @struct nrf_gzll_host_rx_info_t;
- * @brief Data structure containing information about the last packet
- * received.
- */
-typedef struct
-{
- bool packet_removed_from_tx_fifo;
- ///< A payload was received in the ACK.
- int16_t rssi;
- ///< Received signal strength indicator in dBm. @sa nrf_gzll_enable_rssi().
-} nrf_gzll_host_rx_info_t;
-
-
-
-
-/******************************************************************************/
-/** @name General API functions
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @brief Initialize Gazell.
- *
- * @param mode The mode to initialize Gazell in.
- *
- * @retval true if Gazell initialized.
- * @retval false if Gazell failed to initialize.
- */
-bool nrf_gzll_init(nrf_gzll_mode_t mode);
-
-
-/**
- * @brief Enable Gazell.
- *
- * When enabled the behaviour described for the current Gazell Link Layer mode
- * will apply.
- *
- * @retval false if nrf_gzll_init has not previously been called.
- */
-bool nrf_gzll_enable(void);
-
-/**
- * @brief Disable Gazell.
- *
- * When calling this function the Gazell Link Layer will begin disabling,
- * and will be fully disabled when Gazell calls nrf_gzll_disabled().
- * If there are any pending notifications, or if any new notifications are
- * being added to the internal notification queue while Gazell is disabling,
- * these will be sent to the application before Gazell is fully disabled.
- *
- * After Gazell has been fully disabled, no more notifications will be sent to
- * the application.
- */
-void nrf_gzll_disable(void);
-
-
-/** Check whether Gazell is enabled or disabled.
- *
- * @retval true If Gazell is enabled.
- * @retval false If Gazell is disabled.
- */
-bool nrf_gzll_is_enabled(void);
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Device mode callback functions
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @brief ACK received callback (Device mode only).
- *
- * This callback is made when the Device receives an ACK (acknowledgement)
- * packet.
- * @sa nrf_gzll_ack_payload_received.
- *
- * @param pipe is the pipe on which an ACK packet was received.
- * @param tx_info struct used to indicate whether a payload was received in the
- * ack, as well as the number of TX attempts and channel switches required.
- */
-void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info);
-
-
-/**
- * @brief Transmission failed callback (Device mode only).
- *
- * This callback is made when a packet does not receive an ACK after
- * nrf_gzll_max_retries is reached. The packet is deleted by Gazell.
- *
- * @param pipe is the pipe on which the transmission failed.
- * @param tx_info struct used to indicate whether a payload was received
- * in the ack, as well as RSSI and the number of TX attempts and
- * channel switches required.
- */
-void nrf_gzll_device_tx_failed(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info);
-
-
-/** @} */
-
-
-
-/******************************************************************************/
-/** @name Host mode callback functions
- * @{ */
-/******************************************************************************/
-
-/**
- * @brief Data packet received callback (Host mode only).
- *
- * This callback is made when a Host receives a data packet from a Device.
- *
- * @param pipe is the pipe on which the data packet was received.
- * @param rx_info struct used to indicate whether a payload was removed from the
- * pipe's TX FIFO, as well as RSSI.
- */
-void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info);
-
-
-/** @} */
-
-/******************************************************************************/
-/** @name Callback functions for both Device and Host mode
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @brief Disabled callback.
- *
- * This is called after Gazell enters the disabled state.
- * There is no further CPU use by Gazell, the radio is disabled and the timer is
- * powered down.
- */
-void nrf_gzll_disabled(void);
-
-
-/**
- * @brief Mode changed callbackl.
- *
- * This function is called after the Gazell mode has been changed.
- * This function can only be called when Gazell is enabled.
- */
-void nrf_gzll_mode_changed(void);
-
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Packet transmission and receiving functions
- * @{ */
-/******************************************************************************/
-
-/**
- * @brief Add a packet to the tail of the TX FIFO.
- *
- * In Device mode, the packet will be added.
- * In Host mode, the payload will be piggybacked onto an ACK.
- *
- * @param pipe Pipe to which to add the payload. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @param payload Pointer to the payload.
- * @param length Number of bytes of the payload to transmit
- * (0 to NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH).
- *
- * @retval true if the packet was successfully added to the TX FIFO.
- * @retval false if unsuccessful, check nrf_gzll_error_code_t for more information.
- */
-bool nrf_gzll_add_packet_to_tx_fifo(uint32_t pipe, uint8_t * payload, uint32_t length);
-
-
-/**
- * @brief Fetch a packet from the head of the RX FIFO.
- *
- * @param pipe Pipe from which to fetch the payload. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @param payload Pointer to copy the payload to.
- * @param length Length must be at least as large as the the number of bytes
- * in the received payload length.
- *
- * @retval true If the fetch was successful.
- * @retval false If unsuccessful, check nrf_gzll_error_code_t for more information.
- */
-bool nrf_gzll_fetch_packet_from_rx_fifo(uint32_t pipe, uint8_t * payload, uint32_t* length);
-
-
-/**
- * @brief Get the number of packets in the TX FIFO on a specific pipe.
- *
- * @param pipe The pipe for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- *
- * @retval >=0 The number of packets in the TX FIFO for the pipe.
- * @retval -1 If the pipe number is invalid.
- */
-int32_t nrf_gzll_get_tx_fifo_packet_count(uint32_t pipe);
-
-
-/**
- * @brief Get the number of packets in the RX FIFO on a specific pipe.
- *
- * @param pipe The pipe for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @retval >=0 The number of packets in the RX FIFO for the pipe.
- * @retval -1 If the pipe number is invalid.
- */
-int32_t nrf_gzll_get_rx_fifo_packet_count(uint32_t pipe);
-
-
-/**
- * @brief Get the total number of packets residing in all TX and RX FIFOs.
- *
- * Can be used to check against NRF_GZLL_CONST_MAX_TOTAL_PACKETS to
- * determine if there is free space in the memory pool for more packets.
- *
- * @return The number of packets residing in all TX and RX FIFOs.
- */
-uint32_t nrf_gzll_get_total_allocated_packet_count(void);
-
-
-/**
- * @brief Check if adding a packet to a pipe's TX FIFO should be successful.
- *
- * Checks if there is another space in the pipe's TX and RX FIFOs
- * as well as enough overall space in the packet pool.
- *
- * @param pipe The pip for which to check. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- *
- * @retval true If there is another space.
- * @retval false If there is not enough space, or the pipe is invalid.
- */
-bool nrf_gzll_ok_to_add_packet_to_tx_fifo(uint32_t pipe);
-
-/**
- * @brief Flush the RX FIFO for a specific pipe.
- *
- * Delete all the packets and free the memory of the TX FIFO for a
- * specific pipe.
- *
- * Note that it is not allowed to flush a TX FIFO when
- * Gazell is enabled.
- *
- * @param pipe is the pipe for which to flush. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @retval true if the pipe was flushed.
- * @retval false if the pipe was not flushed.
- */
-bool nrf_gzll_flush_tx_fifo(uint32_t pipe);
-
-
-/**
- * @brief Flush the RX FIFO for a specific pipe.
- *
- * Delete all the packets and free the memory of the RX FIFO for a
- * specific pipe.
- *
- * @param pipe is the pipe for which to flush. This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @retval true if the pipe was flushed.
- * @retval false if the pipe was not flushed.
- */
-bool nrf_gzll_flush_rx_fifo(uint32_t pipe);
-
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Configuration functions
- *
- * Configuration 'set' functions may only be called while Gazell is disabled. The
- * new parameter comes into effect when Gazell is enabled again.
- *
- * Configuration 'get' functions may be called at any time.
- *
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @brief Set the mode.
- *
- * @param mode The mode to be used.
- * See nrf_gzll_mode_t for a list of valid modes.
- *
- * It is allowed to change mode when Gazell is enabled. If the mode is
- * being changed while Gazell is enabled, the mode will not change right away.
- * In this case the callback function nrf_gzll_mode_changed() will be called
- * after the mdoe has changed.
- *
- * @retval true If the parameter was set.
- */
-bool nrf_gzll_set_mode(nrf_gzll_mode_t mode);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_mode().
- *
- * @return The current mode.
- */
-nrf_gzll_mode_t nrf_gzll_get_mode(void);
-
-
-/**
- * @brief Set the base address for pipe 0.
- *
- * The full on-air address for each pipe is composed of a multi-byte base address
- * prepended to a prefix byte.
- *
- * For packets to be received correctly, the most significant byte of
- * the base address should not be an alternating sequence of 0s and 1s i.e.
- * it should not be 0x55 or 0xAA.
- *
- * @param base_address The 4 byte base address. All bytes are used.
- *
- * @retval true If the parameter was set.
- * @return false If Gazell was enabled.
- */
-bool nrf_gzll_set_base_address_0(uint32_t base_address);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_base_address_0().
- *
- * @return Base address 0.
- */
-uint32_t nrf_gzll_get_base_address_0(void);
-
-
-/**
- * @brief Set the base address for pipes 1-7.
- *
- * Pipes 1 through 7 share base_address_1. @sa nrf_gzll_set_base_address_0.
- *
- * @param base_address The 4 byte base address.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_base_address_1(uint32_t base_address);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_base_address_1().
- *
- * @return Base address 1.
- */
-uint32_t nrf_gzll_get_base_address_1(void);
-
-
-/**
- * @brief Set the address prefix byte for a specific pipe.
- *
- * Each pipe should have its own unique prefix byte.
- *
- * @param pipe The pipe that the address should apply to.
- * This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @param address_prefix_byte The address prefix byte.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled, or if the pipe was invalid.
- */
-bool nrf_gzll_set_address_prefix_byte(uint32_t pipe, uint8_t address_prefix_byte);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_address_prefix_byte().
- *
- * @param pipe The pipe for which to get the address.
- * This value must be < NRF_GZLL_CONST_PIPE_COUNT.
- * @param out_address_prefix_byte The pointer in which to return the
- * address prefix byte.
- *
- * @retval true If the parameter was returned.
- * @retval false If Gazell was enabled, the pipe was invalid or
- * out_address was a NULL pointer.
- */
-bool nrf_gzll_get_address_prefix_byte(uint32_t pipe, uint8_t* out_address_prefix_byte);
-
-
-/**
- * @brief Set which pipes shall listen for packets in Host mode.
- *
- * This value is a bitmap, and each bit corresponds to a given pipe number.
- * Bit 0 set to "1" enables pipes 0, bit 1 set to "1" enables pipe 1
- * and so forth.
- * The maximum number of pipes is defined by NRF_GZLL_CONST_PIPE_COUNT.
- *
- * @param pipes A bitmap specifying which pipes to monitor.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_rx_pipes_enabled(uint32_t pipes);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_rx_pipes_enabled().
- *
- * @return Bitmap holding the current enabled pipes.
- */
-uint32_t nrf_gzll_get_rx_pipes_enabled(void);
-
-
-/**
- * @brief Set the timeslot period.
- *
- * The length in microseconds of a Gazell link layer timeslot.
- *
- * The minimum value of the timeslot period is dependent of the
- * radio data rate (@sa nrf_gzll_set_datarate()).
- *
- * - For NRF_GZLL_DATARATE_2MBIT the timeslot period must be >= 600 us.
- * - For NRF_GZLL_DATARATE_1MBIT the timeslot period must be >= 900 us.
- * - For NRF_GZLL_DATARATE_250KBIT the timeslot period must be >= 2700 us.
- *
- * @param period_us The timeslot period in microseconds.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_timeslot_period(uint32_t period_us);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_get_timeslot_period().
- *
- * @return The current timeslot period.
- */
-uint32_t nrf_gzll_get_timeslot_period(void);
-
-
-/**
- * @brief Set the Device channel selection policy
- *
- * The policy determines the initial channel when starting a new packet.
- * transmission.
- *
- * @param policy The channel selection policy.
- *
- * @arg NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL specifies
- * that a new packet transmission always shall use the previous
- * successful channel from the channel table. If Gazell is "in sync", Gazell
- * will wait until this channel is being monitored by the Host before starting
- * the transmission.
- *
- * @arg NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT specifies that
- * Gazell shall transmit on the channel that is currently being monitored by the
- * Host. This parameter is only used when Gazell is "in sync". When "out of" sync,
- * Gazell will always start using the "previous successful" channel.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled or the policy was invalid.
- */
-bool nrf_gzll_set_device_channel_selection_policy(nrf_gzll_device_channel_selection_policy_t policy);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_device_channel_selection_policy().
- *
- * @return the Device channel selection policy.
- */
-nrf_gzll_device_channel_selection_policy_t nrf_gzll_get_device_channel_selection_policy(void);
-
-
-/**
- * @brief Set the number of timeslots that Gazell shall
- * reside on a single channel before switching to another channel.
- *
- * This parameter applies in Host mode and for a Device that is
- * in the "in sync" state.
- *
- * Since the Device and Host can not be in perfect synchronization, a
- * transmission should overlap to adjacent timeslots on the Host.
- * Therefore this value should be at least 2.
- *
- * @sa nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync
- *
- * @param timeslots The number of timeslots to reside on
- * each channel before channel switch.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_timeslots_per_channel(uint32_t timeslots);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_timeslots_per_channel().
- *
- * @return The current number of timeslots.
- */
-uint32_t nrf_gzll_get_timeslots_per_channel(void);
-
-
-/**
- * @brief Set the number of timeslots that a Gazell shall
- * reside on a single channel before switching to another channel when
- * in the "out of sync" state.
- *
- * This value should be set so that the Device transmits on one channel
- * while the Host goes through a full channel rotation, i.e.,
- * channel_table_size*timeslots_per_channel.
- * This ensures that the channels on the Device and Host will coincide
- * at some point.
- * Further increasing the value has been observed to provide better performance
- * in the presence of interferers.
- *
- * @param timeslots The number of timeslots to reside on
- * each channel before channel switch.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(uint32_t timeslots);
-
-
-/**
- * @brief Get function counterpart to
- * nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync().
- *
- * @return The current number of timeslots.
- */
-uint32_t nrf_gzll_get_timeslots_per_channel_when_device_out_of_sync(void);
-
-
-/**
- * @brief Set the number of timeslots after a successful
- * reception of a Device or Host packet that the Gazell Link Layer shall assume
- * that the link is synchronized. A value of 0 implies that the
- * link is always out of sync.
- *
- * @param lifetime The sync lifetime in number of timeslots.
- *
- * @retval true If the sync lifetime was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_sync_lifetime(uint32_t lifetime);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_sync_lifetime().
- *
- * @return The sync lifetime measured in number of timeslots.
- */
-uint32_t nrf_gzll_get_sync_lifetime(void);
-
-
-/**
- * @brief Set the maximum number of TX attempts
- * that can be used for a single packet.
- *
- * After the maximum number of attempts have been spent without
- * receiving any ACK from the Host, the transmission will be terminated
- * and the nrf_gzll_device_tx_failed() callback will be called.
- *
- * @param max_tx_attempts The maximum number of TX attempts.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled.
- */
-bool nrf_gzll_set_max_tx_attempts(uint16_t max_tx_attempts);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_max_tx_attempts().
- *
- * @return The current max Device TX attempts.
- */
-uint16_t nrf_gzll_get_max_tx_attempts(void);
-
-
-/**
- * @brief Set the table of Radio Frequency (RF) channels.
- *
- * The valid channels are in the range 0 <= channel <= 125, where the
- * actual centre frequency is (2400 + channel) MHz.
- * The maximum channel table size is defined by
- * NRF_GZLL_CONST_MAX_CHANNEL_TABLE_SIZE.
- *
- * @param channel_table Pointer to the channel table.
- * @param size The size of the channel table.
- *
- * @retval true If the channel table was set.
- * @retval false If Gazell was enabled, or the channel_table pointer was NULL,
- * or the size was invalid.
- */
-bool nrf_gzll_set_channel_table(uint8_t* channel_table, uint32_t size);
-
-
-/**
- * @brief Get the table of Radio Frequency (RF) channels.
- *
- * @param channel_table Pointer to copy the channel table to.
- * @param size Pointer to copy the size of the channel table to.
- * The value already at size must be at least the size
- * of the channel table.
- *
- * @retval true If the channel table was copied to channel_table.
- * @retval false If the channel_table pointer was NULL,
- * or the size was not large enough.
- */
-bool nrf_gzll_get_channel_table(uint8_t* channel_table, uint32_t* size);
-
-
-/**
- * @brief Get the current channel table size.
- *
- * @return The current channel table size.
- */
-uint32_t nrf_gzll_get_channel_table_size(void);
-
-
-/**
- * @brief Set the radio TX power.
- *
- * @param tx_power TX power.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled or the TX power was invalid.
-*/
-bool nrf_gzll_set_tx_power(nrf_gzll_tx_power_t tx_power);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_tx_power().
- *
- * @return The current TX power.
- */
-nrf_gzll_tx_power_t nrf_gzll_get_tx_power(void);
-
-
-/**
- * @brief Set the radio datarate.
- *
- * @param data_rate Datarate.
- *
- * @retval true If the parameter was set.
- * @retval false If Gazell was enabled or the datarate was invalid.
- */
-bool nrf_gzll_set_datarate(nrf_gzll_datarate_t data_rate);
-
-
-/**
- * @brief Get function counterpart to nrf_gzll_set_datarate().
- *
- * @return The current datarate.
- */
-nrf_gzll_datarate_t nrf_gzll_get_datarate(void);
-
-
-/**
- * @brief Set whether start/stop of external oscillator (XOSC) shall be handled
- * automatically inside Gazell or manually by the application.
- *
- * When controlling the XOSC manually from the application it is
- * required that the XOSC is started before Gazell is enabled.
- *
- * When start/stop of the XOSC is handled automatically by Gazell,
- * the XOSC will only be running when needed, that is when the radio
- * is being used or when Gazell needs to maintain synchronization.
- *
- * It is required that the XOSC is started in order for the radio to be
- * able to send or receive any packets.
- *
- * @param xosc_ctl setting for XOSC control.
- *
- * @retval true if the parameter was set.
- * @retval false if Gazell was enabled or the xosc_ctl value was invalid.
- */
-bool nrf_gzll_set_xosc_ctl(nrf_gzll_xosc_ctl_t xosc_ctl);
-
-
-/**
- * Get function counterpart for nrf_gzll_set_xosc_ctl();
- *
- * @return The XOSC control setting.
- */
-nrf_gzll_xosc_ctl_t nrf_gzll_get_xosc_ctl(void);
-
-
-/**
- * @brief Set Gazell to disable automatically after a certain number of timeslot ticks.
- *
- * @param num_ticks Number of timeslot ticks.
- *
- */
-void nrf_gzll_set_auto_disable(uint32_t num_ticks);
-
-
-/**
- * @brief Get the number of timeslot ticks that have occurred since
- * nrf_gzll_init() was called.
- *
- * @return Number of timeslot ticks.
- *
- */
-uint32_t nrf_gzll_get_tick_count(void);
-
-
-/**
- * @brief Clear the internal timeslot tick count variable that is read
- * by nrf_gzll_get_tick_count().
- *
- */
-void nrf_gzll_clear_tick_count(void);
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Error handling functions
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @brief Gets the Gazell error code.
- *
- * @return The current error code.
- */
-nrf_gzll_error_code_t nrf_gzll_get_error_code(void);
-
-
-/**
- * @brief Reset the Gazell error code.
- *
- * The error code is reset to NRF_GZLL_ERROR_CODE_NO_ERRROR.
- */
-void nrf_gzll_reset_error_code(void);
-
-/** @} */
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzll_constants.h b/components/proprietary_rf/gzll/nrf_gzll_constants.h
deleted file mode 100644
index 809d397..0000000
--- a/components/proprietary_rf/gzll/nrf_gzll_constants.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Copyright (c) 2011 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-/**
- * @file
- * @brief Gazell Link Layer constants and default values.
- *
- * NOTE! Changing values here has no effect. They are only provided as a reference.
- */
-
-#ifndef NRF_GZLL_CONSTANTS_H__
-#define NRF_GZLL_CONSTANTS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * @addtogroup gzll_02_api
- * @{
- */
-
-
-/*****************************************************************************/
-/** @name Hardware resources used by Gazell */
-/*****************************************************************************/
-#define NRF_GZLL_HIGH_IRQ_PRIORITY 0 ///< Interrupt priority the Gazell timer and the radio
-#define NRF_GZLL_LOW_IRQ_PRIORITY 1 ///< Interrupt priority for Gazell callback functions.
-
-#ifndef USE_SD_HW_RESOURCES
-#define NRF_GZLL_SWI_IRQn SWI0_IRQn ///< Software interrupt # used for callback functions.
-#define NRF_GZLL_SWI_IRQ_HANDLER SWI0_IRQHandler ///< Software interrupt handler used for callback functions.
-
-#define NRF_GZLL_TIMER NRF_TIMER2 ///< Timer to be used as flywheel timer.
-#define NRF_GZLL_TIMER_PERPOWER_Msk POWER_PERPOWER_TIMER2_Msk ///< PERPOWER mask for the timer.
-#define NRF_GZLL_TIMER_IRQn TIMER2_IRQn ///< Interrupt # for the timer.
-#define NRF_GZLL_TIMER_IRQ_HANDLER TIMER2_IRQHandler ///< Interrupt handler for the timer.
-
-// In addition, Gazell uses the radio peripheral and radio interrupts.
-
-/*
- * PPI configuration
- */
-#define NRF_GZLL_PPI_EEP0 (NRF_PPI -> CH0_EEP) ///< Gazell PPI event endpoint 0
-#define NRF_GZLL_PPI_TEP0 (NRF_PPI -> CH0_TEP) ///< Gazell PPI task endpoint 0
-#define NRF_GZLL_PPI_EEP1 (NRF_PPI -> CH1_EEP) ///< Gazell PPI event endpoint 1
-#define NRF_GZLL_PPI_TEP1 (NRF_PPI -> CH1_TEP) ///< Gazell PPI task endpoint 1
-#define NRF_GZLL_PPI_EEP2 (NRF_PPI -> CH2_EEP) ///< Gazell PPI event endpoint 2
-#define NRF_GZLL_PPI_TEP2 (NRF_PPI -> CH2_TEP) ///< Gazell PPI task endpoint 2
-
-#define NRF_GZLL_PPI_CHEN_MSK_0_AND_1 (0x03) ///< Channel enable/disable mask for PPI endpoint 0 and 1.
-#define NRF_GZLL_PPI_CHEN_MSK_2 (0x04) ///< Channel enable/disable mask for PPI endpoint 2.
-
-#else
-
-#define NRF_GZLL_SWI_IRQn SWI1_IRQn ///< Software interrupt # used for callback functions.
-#define NRF_GZLL_SWI_IRQ_HANDLER SWI1_IRQHandler ///< Software interrupt handler used for callback functions.
-
-#define NRF_GZLL_TIMER NRF_TIMER0 ///< Timer to be used as flywheel timer.
-#define NRF_GZLL_TIMER_PERPOWER_Msk POWER_PERPOWER_TIMER0_Msk ///< PERPOWER mask for the timer.
-#define NRF_GZLL_TIMER_IRQn TIMER0_IRQn ///< Interrupt # for the timer.
-#define NRF_GZLL_TIMER_IRQ_HANDLER TIMER0_IRQHandler ///< Interrupt handler for the timer.
-
-// In addition, Gazell uses the radio peripheral and radio interrupts.
-
-/*
- * PPI configuration
- */
-#define NRF_GZLL_PPI_EEP0 (NRF_PPI -> CH8_EEP) ///< Gazell PPI event endpoint 0
-#define NRF_GZLL_PPI_TEP0 (NRF_PPI -> CH8_TEP) ///< Gazell PPI task endpoint 0
-#define NRF_GZLL_PPI_EEP1 (NRF_PPI -> CH9_EEP) ///< Gazell PPI event endpoint 1
-#define NRF_GZLL_PPI_TEP1 (NRF_PPI -> CH9_TEP) ///< Gazell PPI task endpoint 1
-#define NRF_GZLL_PPI_EEP2 (NRF_PPI -> CH10_EEP) ///< Gazell PPI event endpoint 2
-#define NRF_GZLL_PPI_TEP2 (NRF_PPI -> CH10_TEP) ///< Gazell PPI task endpoint 2
-
-#define NRF_GZLL_PPI_CHEN_MSK_0_AND_1 (0x300) ///< Channel enable/disable mask for PPI endpoint 0 and 1.
-#define NRF_GZLL_PPI_CHEN_MSK_2 (0x400) ///< Channel enable/disable mask for PPI endpoint 2.
-
-#endif
-
-#define NRF_GZLL_CONST_PIPE_COUNT 8 ///< Number of TX pipes (at least one for each Device-Host pairs).
-#define NRF_GZLL_CONST_FIFO_LENGTH 3 ///< Maximum number of packets allowed in a TX or RX FIFO.
-#define NRF_GZLL_CONST_MAX_TOTAL_PACKETS 6 ///< Maximum number of packets available for reservation at any one time.
-#define NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH 32 ///< Maximum allowed payload length in bytes.
-#define NRF_GZLL_CONST_CALLBACK_QUEUE_LENGTH 10 ///< Maximum number of notifications allowed in the callback queue.
-/** @} */
-
-
-
-/*****************************************************************************/
-/** @name Constant pipe and FIFO configuration */
-/*****************************************************************************/
-#define NRF_GZLL_CONST_PIPE_COUNT 8 ///< Number of TX pipes (at least one for each Device-Host pairs).
-#define NRF_GZLL_CONST_FIFO_LENGTH 3 ///< Maximum number of packets allowed in a TX or RX FIFO.
-#define NRF_GZLL_CONST_MAX_TOTAL_PACKETS 6 ///< Maximum number of packets available for reservation at any one time.
-#define NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH 32 ///< Maximum allowed payload length in bytes.
-#define NRF_GZLL_CONST_CALLBACK_QUEUE_LENGTH 10 ///< Maximum number of notifications allowed in the callback queue.
-/** @} */
-
-
-
-/*****************************************************************************/
-/** @name Default radio configuration */
-/*****************************************************************************/
-#define NRF_GZLL_DEFAULT_TX_POWER NRF_GZLL_TX_POWER_0_DBM ///< Default TX power.
-#define NRF_GZLL_DEFAULT_DATARATE NRF_GZLL_DATARATE_2MBIT ///< Default data rate.
-#define NRF_GZLL_DEFAULT_CHANNEL_TABLE {4, 25, 42, 63, 77} ///< Default channel table.
-#define NRF_GZLL_DEFAULT_CHANNEL_TABLE_SIZE 5 ///< Default channel table size.
-#define NRF_GZLL_CONST_MAX_CHANNEL_TABLE_SIZE 16 ///< Maximum channel table size allowed by Gazell.
-/** @} */
-
-
-/*****************************************************************************/
-/** @name Default Address configuration */
-/*****************************************************************************/
-/*
-Corresponds to Legacy nRFgo SDK Gazell config:
-#define GZLL_DEFAULT_ADDRESS_PIPE0 {0x01, 0x04, 0x07, 0x0A, 0x0D} // {1, 4, 7, 10, 13}
-#define GZLL_DEFAULT_ADDRESS_PIPE1 {0x02, 0x05, 0x08, 0x0B, 0x0E} // {2, 5, 8, 11, 14}
-#define GZLL_DEFAULT_ADDRESS_PIPE2 3
-#define GZLL_DEFAULT_ADDRESS_PIPE3 4
-#define GZLL_DEFAULT_ADDRESS_PIPE4 5
-#define GZLL_DEFAULT_ADDRESS_PIPE5 6
-*/
-#define NRF_GZLL_DEFAULT_FULL_ADDRESS_PIPE0 {0x01, 0x04, 0x07, 0x0A, 0x0D} ///< Corresponding legacy Gazell pipe 0 address.
-#define NRF_GZLL_DEFAULT_BASE_ADDRESS_0 0x0D0A0704 ///< Default base address 0.
-#define NRF_GZLL_DEFAULT_BASE_ADDRESS_1 0x0E0B0805 ///< Default base address 1.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_0 1 ///< Default prefix address pipe 0.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_1 2 ///< Default prefix address pipe 1.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_2 3 ///< Default prefix address pipe 2.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_3 4 ///< Default prefix address pipe 3.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_4 5 ///< Default prefix address pipe 4.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_5 6 ///< Default prefix address pipe 5.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_6 7 ///< Default prefix address pipe 6.
-#define NRF_GZLL_DEFAULT_PREFIX_BYTE_7 8 ///< Default prefix address pipe 7.
-#define NRF_GZLL_DEFAULT_BASE_ADDRESS_LENGTH NRF_GZLL_BASE_ADDRESS_LENGTH_4B ///< Default on-air base address length.
-
-#define NRF_GZLL_DEFAULT_RX_PIPES_ENABLED 0x000000FF ///< Enabled Rx pipes. See nrf_gzll_set_rx_pipes_enabled().
-
-/** @} */
-
-
-/*****************************************************************************/
-/** @name Default timeslot and synchronization configuration */
-/*****************************************************************************/
-#define NRF_GZLL_DEFAULT_TIMESLOT_PERIOD 600 ///< Default timeslot period.
-#define NRF_GZLL_DEFAULT_TIMESLOTS_PER_CHANNEL 2 ///< Timeslots use by the Host and by the Device when communication is in sync.
-#define NRF_GZLL_DEFAULT_TIMESLOTS_PER_CHANNEL_WHEN_DEVICE_OUT_OF_SYNC 15 ///< Timeslots use by the Device before communication is in sync.
-#define NRF_GZLL_DEFAULT_SYNC_LIFETIME (3 * NRF_GZLL_DEFAULT_CHANNEL_TABLE_SIZE * NRF_GZLL_DEFAULT_TIMESLOTS_PER_CHANNEL) ///< Number of timeslots to keep the timer running so that communication remains synchronized.
-#define NRF_GZLL_DEFAULT_DEVICE_CHANNEL_SELECTION_POLICY NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL ///< Default channel Gazell Device channel selection policy
-#define NRF_GZLL_DEFAULT_MAX_TX_ATTEMPTS 0 ///< Default maximum TX attempts for each packet. A value of zero implies maximum
-#define NRF_GZLL_DEFAULT_XOSC_CTL NRF_GZLL_XOSC_CTL_AUTO ///< Deafult setting for controlling the XOSC
-/** @} */
-
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzll_error.h b/components/proprietary_rf/gzll/nrf_gzll_error.h
deleted file mode 100644
index 13bd7a6..0000000
--- a/components/proprietary_rf/gzll/nrf_gzll_error.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2016 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/**
- * @file
- * @brief Gazell error API.
- */
-
-#ifndef NRF_GZLL_ERROR_H__
-#define NRF_GZLL_ERROR_H__
-
-#include "sdk_errors.h"
-#include "nrf_gzll.h"
-#include "app_error.h"
-
-#define GAZELLE_ERROR_CODE_CHECK(GZLL_RESULT) \
- do \
- { \
- if((GZLL_RESULT) == false) \
- { \
- nrf_gzll_error_code_t gzll_error_code = nrf_gzll_get_error_code(); \
- ret_code_t error_code = gzll_error_code + NRF_ERROR_GAZELLE_ERR_BASE; \
- APP_ERROR_HANDLER(error_code); \
- } \
- } while(0)
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzll_resources.h b/components/proprietary_rf/gzll/nrf_gzll_resources.h
deleted file mode 100644
index 0ae0f68..0000000
--- a/components/proprietary_rf/gzll/nrf_gzll_resources.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * Copyright (c) 2015 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef NRF_GZLL_RESOURCES_H__
-#define NRF_GZLL_RESOURCES_H__
-
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef GAZELL_ALTERNATIVE_RESOURCES
- #define GZLL_PPI_CHANNELS_USED 0x00000007uL /**< PPI channels utilized by Gazell (not available to th spplication). */
- #define GZLL_TIMERS_USED 0x00000004uL /**< Timers used by Gazell. */
- #define GZLL_SWI_USED 0x00000001uL /**< Software interrupts used by Gazell */
-#else
- #define GZLL_PPI_CHANNELS_USED 0x00000700uL /**< PPI channels utilized by Gazell (not available to th spplication). */
- #define GZLL_TIMERS_USED 0x00000001uL /**< Timers used by Gazell. */
- #define GZLL_SWI_USED 0x00000002uL /**< Software interrupts used by Gazell */
-#endif
-
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NRF_GZLL_RESOURCES_H__ */
diff --git a/components/proprietary_rf/gzll/nrf_gzp.c b/components/proprietary_rf/gzll/nrf_gzp.c
deleted file mode 100644
index 5e0ba33..0000000
--- a/components/proprietary_rf/gzll/nrf_gzp.c
+++ /dev/null
@@ -1,365 +0,0 @@
-/**
- * Copyright (c) 2009 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-/**
- * @file
- * @brief Implementation of Gazell Pairing Library (gzp), Common functions.
- * @defgroup gzp_source_common Gazell Pairing common functions implementation
- * @{
- * @ingroup gzp_04_source
- */
-
-
-#include "nrf_gzp.h"
-#include "nrf_gzll.h"
-#include "nrf_ecb.h"
-#include
-
-
-#define SOURCE_FILE NRF_SOURCE_FILE_GZP ///< File identifer for asserts.
-
-
-/******************************************************************************/
-/** @name Global variables
- * @{ */
-/******************************************************************************/
-
-/**
- * Constant holding base address part of the pairing address.
- */
-static const uint8_t pairing_base_address[4] = { GZP_ADDRESS };
-
-/**
- * Constant holding prefix byte of the pairing address.
- */
-static const uint8_t pairing_address_prefix_byte = 0;
-
-/**
- * Constant holding pre-defined "validation ID".
- */
-static const uint8_t gzp_validation_id[GZP_VALIDATION_ID_LENGTH] = GZP_VALIDATION_ID;
-
-/**
- * Constant holding pre-defined "secret key".
- */
-static const uint8_t gzp_secret_key[16] = GZP_SECRET_KEY;
-
-/**
- * Variable used for AES key selection
- */
-static gzp_key_select_t gzp_key_select;
-
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Misc. external variables.
- * @{ */
-/******************************************************************************/
-static uint8_t gzp_session_token[GZP_SESSION_TOKEN_LENGTH];
-static uint8_t gzp_dyn_key[GZP_DYN_KEY_LENGTH];
-
-/** @} */
-
-/******************************************************************************/
-/** @name Implementation common internal GZP functions
- * @{ */
-/******************************************************************************/
-bool gzp_update_radio_params(const uint8_t* system_address)
-{
- uint8_t i;
- uint8_t channels[NRF_GZLL_CONST_MAX_CHANNEL_TABLE_SIZE];
- uint32_t channel_table_size;
- uint32_t pairing_base_address_32, system_address_32;
- bool update_ok = true;
- bool gzll_enabled_state;
-
- gzll_enabled_state = nrf_gzll_is_enabled();
-
- // Configure "global" pairing address
- pairing_base_address_32 = (pairing_base_address[0]) +
- ((uint32_t)pairing_base_address[1] << 8) +
- ((uint32_t)pairing_base_address[2] << 16) +
- ((uint32_t)pairing_base_address[3] << 24) ;
- if (system_address != NULL)
- {
- system_address_32 = (system_address[0]) +
- ((uint32_t)system_address[1] << 8) +
- ((uint32_t)system_address[2] << 16) +
- ((uint32_t)system_address[3] << 24) ;
- }
- else
- {
- return false;
- }
-
- nrf_gzp_disable_gzll();
- update_ok = update_ok && nrf_gzll_set_base_address_0(pairing_base_address_32);
- update_ok = update_ok && nrf_gzll_set_address_prefix_byte(GZP_PAIRING_PIPE, pairing_address_prefix_byte);
- update_ok = update_ok && nrf_gzll_set_base_address_1(system_address_32);
-
- // Configure address for pipe 1 - 5. Address byte set to equal pipe number.
- for (i = 1; i < NRF_GZLL_CONST_PIPE_COUNT; i++)
- {
- update_ok = update_ok && nrf_gzll_set_address_prefix_byte(i,i);
- }
-
- channel_table_size = nrf_gzll_get_channel_table_size();
- gzp_generate_channels(&channels[0], system_address, channel_table_size);
-
- // Write generated channel subset to Gazell Link Layer
- update_ok = update_ok && nrf_gzll_set_channel_table(&channels[0], channel_table_size);
- if (gzll_enabled_state)
- {
- update_ok = update_ok && nrf_gzll_enable();
- }
- return update_ok;
-}
-
-void gzp_generate_channels(uint8_t* ch_dst, const uint8_t* system_address, uint8_t channel_tab_size)
-{
- uint8_t binsize, spacing, i;
-
- binsize = (GZP_CHANNEL_MAX - GZP_CHANNEL_MIN) / channel_tab_size;
-
- ch_dst[0] = GZP_CHANNEL_LOW;
- ch_dst[channel_tab_size - 1] = GZP_CHANNEL_HIGH;
-
- if (system_address != NULL)
- {
- for (i = 1; i < (channel_tab_size - 1); i++)
- {
- ch_dst[i] = (binsize * i) + (system_address[i % 4] % binsize);
- }
- }
-
- // If channels are too close, shift them to better positions
- for (i = 1; i < channel_tab_size; i++)
- {
- spacing = (ch_dst[i] - ch_dst[i - 1]);
- if (spacing < GZP_CHANNEL_SPACING_MIN)
- {
- ch_dst[i] += (GZP_CHANNEL_SPACING_MIN - spacing);
- }
- }
-}
-
-__INLINE void nrf_gzp_disable_gzll(void)
-{
- if (nrf_gzll_is_enabled())
- {
- nrf_gzll_disable();
- __WFI();
- while (nrf_gzll_is_enabled())
- {
- }
- }
-}
-
-#ifndef GZP_CRYPT_DISABLE
-
-void gzp_xor_cipher(uint8_t* dst, const uint8_t* src, const uint8_t* pad, uint8_t length)
-{
- uint8_t i;
-
- for (i = 0; i < length; i++)
- {
- *dst = *src ^ *pad;
- dst++;
- src++;
- pad++;
- }
-}
-
-bool gzp_validate_id(const uint8_t* id)
-{
- return (memcmp(id, (void*)gzp_validation_id, GZP_VALIDATION_ID_LENGTH) == 0);
-}
-
-void gzp_add_validation_id(uint8_t* dst)
-{
- memcpy(dst, (void const*)gzp_validation_id, GZP_VALIDATION_ID_LENGTH);
-}
-
-void gzp_crypt_set_session_token(const uint8_t * token)
-{
- memcpy(gzp_session_token, (void const*)token, GZP_SESSION_TOKEN_LENGTH);
-}
-
-void gzp_crypt_set_dyn_key(const uint8_t* key)
-{
- memcpy(gzp_dyn_key, (void const*)key, GZP_DYN_KEY_LENGTH);
-}
-
-void gzp_crypt_get_session_token(uint8_t * dst_token)
-{
- memcpy(dst_token, (void const*)gzp_session_token, GZP_SESSION_TOKEN_LENGTH);
-}
-
-void gzp_crypt_get_dyn_key(uint8_t* dst_key)
-{
- memcpy(dst_key, (void const*)gzp_dyn_key, GZP_DYN_KEY_LENGTH);
-}
-
-void gzp_crypt_select_key(gzp_key_select_t key_select)
-{
- gzp_key_select = key_select;
-}
-
-void gzp_crypt(uint8_t* dst, const uint8_t* src, uint8_t length)
-{
- uint8_t i;
- uint8_t key[16];
- uint8_t iv[16];
-
- // Build AES key based on "gzp_key_select"
-
- switch (gzp_key_select)
- {
- case GZP_ID_EXCHANGE:
- memcpy(key, (void const*)gzp_secret_key, 16);
- break;
- case GZP_KEY_EXCHANGE:
- memcpy(key, (void const*)gzp_secret_key, 16);
- gzp_get_host_id(key);
- break;
- case GZP_DATA_EXCHANGE:
- memcpy(key, (void const*)gzp_secret_key, 16);
- memcpy(key, (void const*)gzp_dyn_key, GZP_DYN_KEY_LENGTH);
- break;
- default:
- return;
- }
-
- // Build init vector from "gzp_session_token"
- for (i = 0; i < 16; i++)
- {
- if (i < GZP_SESSION_TOKEN_LENGTH)
- {
- iv[i] = gzp_session_token[i];
- }
- else
- {
- iv[i] = 0;
- }
- }
-
- // Set up hal_aes using new key and init vector
- (void)nrf_ecb_init();
- nrf_ecb_set_key(key);
- //hal_aes_setup(false, ECB, key, NULL); // Note, here we skip the IV as we use ECB mode
-
- // Encrypt IV using ECB mode
- (void)nrf_ecb_crypt(iv, iv);
-
- // Encrypt data by XOR'ing with AES output
- gzp_xor_cipher(dst, src, iv, length);
-
-}
-
-void gzp_random_numbers_generate(uint8_t * dst, uint8_t n)
-{
- uint8_t i;
-
- NRF_RNG->EVENTS_VALRDY=0;
- NRF_RNG->TASKS_START = 1;
- for (i = 0; i < n; i++)
- {
- while (NRF_RNG->EVENTS_VALRDY==0)
- {}
- dst[i] = (uint8_t)NRF_RNG->VALUE;
- NRF_RNG->EVENTS_VALRDY=0;
- }
- NRF_RNG->TASKS_STOP = 1;
-}
-
-
-/******************************************************************************/
-/** @name Implementation of nRF51 specific GZP functions
- * @{ */
-/******************************************************************************/
-
-/**
-* @brief Function for setting the Primask variable. Only necessary if ARMCC
-* compiler skips __set_PRIMASK at high optimization levels.
-*
-* @param primask The primask value. 1 to disable interrupts, 0 otherwise.
-*/
-static void nrf_gzp_set_primask(uint32_t primask)
-{
- #if defined(__CC_ARM)
- //lint -save -e10 -e618 -e438 -e550 -e526 -e628 -e526
- volatile register uint32_t __regPriMask __ASM("primask");
- __regPriMask = (primask);
- #else
- __set_PRIMASK(primask);
- #endif
- //lint -restore
-}
-
-void nrf_gzp_flush_rx_fifo(uint32_t pipe)
-{
- static uint8_t dummy_packet[NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH];
- uint32_t length;
-
- nrf_gzp_set_primask(1);
- while (nrf_gzll_get_rx_fifo_packet_count(pipe) >0)
- {
- length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
- (void)nrf_gzll_fetch_packet_from_rx_fifo(pipe,dummy_packet,&length);
- }
- nrf_gzp_set_primask(0);
-}
-/** @} */
-
-
-
-/******************************************************************************/
-/** @name Implementation of debug functions
- * @{ */
-/******************************************************************************/
-
-
-/** @} */
-
-/** @} */
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzp.h b/components/proprietary_rf/gzll/nrf_gzp.h
deleted file mode 100644
index def609d..0000000
--- a/components/proprietary_rf/gzll/nrf_gzp.h
+++ /dev/null
@@ -1,666 +0,0 @@
-/**
- * Copyright (c) 2012 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/**
- * @file
- * @brief Gazell Pairing API
- */
-
-#ifndef __GZP_H
-#define __GZP_H
-
-#include "nrf.h"
-#include "nrf_gzp_config.h"
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
-* @defgroup gzp_02_api Application Programming Interface (API)
-* @{
-* @ingroup modules_02_gzp
-* @brief Gazell Pairing API.
-*/
-
-
-/******************************************************************************/
-/** @name Pairing configuration defines
- * @{ */
-/******************************************************************************/
-
-
-#define GZP_PAIRING_PIPE 0 ///< Pipe reserved for initial pairing communication.
-#define GZP_DATA_PIPE 1 ///< Pipe reserved for GZP encrypted data communication (one pipe only).
-#define GZP_TX_RX_TRANS_DELAY 10 ///< Time to wait between request and fetch packets in RX_PERIODS (2 timeslot periods)
-#define GZP_SYSTEM_ADDRESS_WIDTH 4 ///< Must equal Gazell base address length.
-
-
-#define GZP_VALIDATION_ID {0x32, 0x53, 0x66} ///< Validation ID. Required to be shared by Host and Device. Not a secret.
-#define GZP_VALIDATION_ID_LENGTH 3 ///< Validation ID length in bytes.
-#define GZP_HOST_ID_LENGTH 5 ///< Host ID length in bytes.
-#define GZP_SESSION_TOKEN_LENGTH GZP_HOST_ID_LENGTH ///< Session token length in bytes.
-#define GZP_DYN_KEY_LENGTH (16 - GZP_VALIDATION_ID_LENGTH) ///< Dynamic key length in bytes.
-
-#define GZP_HOST_RX_POWER_THRESHOLD -64 ///< RSSI threshold for when signal strength in RX packet power is high enough.
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Device -> Host packet definitions
- * @{ */
-/******************************************************************************/
-
-#define GZP_CMD_HOST_ADDRESS_REQ_PAYLOAD_LENGTH 1 ///< "Host address request" packet, payload length
-
-#define GZP_CMD_HOST_ADDRESS_FETCH_PAYLOAD_LENGTH 1 ///< "Host address fetch" packet, payload length
-
-#define GZP_CMD_HOST_ID_REQ_SESSION_TOKEN 1 ///< "Host ID request" packet, session token position
-#define GZP_CMD_HOST_ID_REQ_PAYLOAD_LENGTH (GZP_CMD_HOST_ID_REQ_SESSION_TOKEN + GZP_SESSION_TOKEN_LENGTH) ///< "Host ID request" payload length
-
-#if (GZP_CMD_HOST_ID_REQ_PAYLOAD_LENGTH > 17)
-#error GZP_SESSION_TOKEN_LENGTH too long.
-#endif
-
-
-#define GZP_CMD_HOST_ID_FETCH_VALIDATION_ID 1 ///< "Host ID fetch" packet
-#define GZP_CMD_HOST_ID_FETCH_PAYLOAD_LENGTH (GZP_CMD_HOST_ID_FETCH_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH) ///< "Host ID fetch" payload length
-
-#if (GZP_CMD_HOST_ID_FETCH_PAYLOAD_LENGTH > 17)
-#error GZP_VALIDATION_ID_LENGTH set too long.
-#endif
-
-#define GZP_CMD_KEY_UPDATE_PREPARE_PAYLOAD_LENGTH 1 ///< "Key update prepare" payload length
-
-#define GZP_CMD_KEY_UPDATE_VALIDATION_ID 1 ///< "Key update" packet, validation ID position
-#define GZP_CMD_KEY_UPDATE_NEW_KEY (GZP_CMD_KEY_UPDATE_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH) ///< "Key update" packet, new key position
-#define GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH (GZP_CMD_KEY_UPDATE_NEW_KEY + GZP_DYN_KEY_LENGTH) ///< "Key update" packet, payload length
-
-#if (GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH > 17)
-#error Sum (GZP_VALIDATION_ID_LENGTH + GZP_DYN_KEY_LENGTH) too high.
-#endif
-
-
-#define GZP_CMD_ENCRYPTED_USER_DATA_VALIDATION_ID 1 ///< "Encrypted user data" packet, validation ID position
-#define GZP_CMD_ENCRYPTED_USER_DATA_PAYLOAD ((GZP_CMD_ENCRYPTED_USER_DATA_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH)) ///< "Encrypted user data" packet, user data position
-#define GZP_ENCRYPTED_USER_DATA_PACKET_OVERHEAD ( GZP_CMD_ENCRYPTED_USER_DATA_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH) ///< "Encrypted user data" packet, packet overhead length
-#define GZP_ENCRYPTED_USER_DATA_MAX_LENGTH (17 - GZP_ENCRYPTED_USER_DATA_PACKET_OVERHEAD) ///< "Encrypted user data" packet, max payload length
-
-#if (GZP_MAX_FW_PAYLOAD_LENGTH < 17)
- #error GZP_MAX_FW_PAYLOAD_LENGTH must be greater or equal to 17.
-#endif
-
-#define GZP_CMD_FETCH_RESP_PAYLOAD_LENGTH 1 ///< General "fetch response" packet, payload_length
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Host -> Device packet definitions
- * @{ */
-/******************************************************************************/
-
-
-#define GZP_CMD_HOST_ADDRESS_RESP_ADDRESS 1 ///< "Host address fetch" response packet, address position
-#define GZP_CMD_HOST_ADDRESS_RESP_PAYLOAD_LENGTH (GZP_CMD_HOST_ADDRESS_RESP_ADDRESS + GZP_SYSTEM_ADDRESS_WIDTH) ///< ///< "Host address fetch" response packet, payload length
-
-#if (GZP_MAX_ACK_PAYLOAD_LENGTH < GZP_CMD_HOST_ADDRESS_RESP_PAYLOAD_LENGTH)
- #error GZP_MAX_ACK_PAYLOAD_LENGTH must be greater or equal to GZP_CMD_HOST_ADDRESS_RESP_PAYLOAD_LENGTH.
-#endif
-
-
-#define GZP_CMD_HOST_ID_FETCH_RESP_VALIDATION_ID 1 ///< "Host ID fetch" response packet, validation ID position
-#define GZP_CMD_HOST_ID_FETCH_RESP_STATUS (GZP_CMD_HOST_ID_FETCH_RESP_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH) ///< "Host ID fetch" response packet, status position
-#define GZP_CMD_HOST_ID_FETCH_RESP_HOST_ID (GZP_CMD_HOST_ID_FETCH_RESP_STATUS + 1) ///< "Host ID fetch" response packet, Host ID position
-#define GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH (GZP_CMD_HOST_ID_FETCH_RESP_HOST_ID + GZP_HOST_ID_LENGTH) ///< "Host ID fetch" response packet, payload length
-
-#if (GZP_MAX_ACK_PAYLOAD_LENGTH < GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH)
- #error GZP_MAX_ACK_PAYLOAD_LENGTH must be greater or equal to GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH.
-#endif
-
-
-#define GZP_CMD_KEY_UPDATE_PREPARE_RESP_SESSION_TOKEN 1 ///< "Key update prepare" response packet, session token position
-#define GZP_CMD_KEY_UPDATE_PREPARE_RESP_PAYLOAD_LENGTH (GZP_CMD_KEY_UPDATE_PREPARE_RESP_SESSION_TOKEN + GZP_SESSION_TOKEN_LENGTH) ///< "Key update prepare" response packet, payload length position
-
-#if (GZP_MAX_ACK_PAYLOAD_LENGTH < GZP_CMD_KEY_UPDATE_PREPARE_RESP_PAYLOAD_LENGTH)
- #error GZP_MAX_ACK_PAYLOAD_LENGTH must be greater or equal to GZP_CMD_KEY_UPDATE_PREPARE_RESP_PAYLOAD_LENGTH.
-#endif
-
-
-#define GZP_CMD_ENCRYPTED_USER_DATA_RESP_SESSION_TOKEN 1 ///< "Encrypted user data" response packet, session token position
-#define GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID (GZP_CMD_ENCRYPTED_USER_DATA_RESP_SESSION_TOKEN + GZP_SESSION_TOKEN_LENGTH) ///< "Encrypted user data" response packet, validation ID position
-#define GZP_CMD_ENCRYPTED_USER_DATA_RESP_PAYLOAD_LENGTH (GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID + GZP_VALIDATION_ID_LENGTH) ///< "Encrypted user data" response packet, payload length position
-
-#if (GZP_MAX_ACK_PAYLOAD_LENGTH < GZP_CMD_ENCRYPTED_USER_DATA_RESP_PAYLOAD_LENGTH)
- #error GZP_MAX_ACK_PAYLOAD_LENGTH must be greater or equal to GZP_CMD_ENCRYPTED_USER_DATA_RESP_PAYLOAD_LENGTH.
-#endif
-
-#if (GZP_VALIDATION_ID_LENGTH > GZP_HOST_ID_LENGTH)
- #error GZP_HOST_ID_LENGTH should be greater or equal to GZP_VALIDATION_ID_LENGTH.
-#endif
-
-#if (GZP_SESSION_TOKEN_LENGTH != GZP_HOST_ID_LENGTH)
- #error GZP_SESSION_TOKEN_LENGTH must equal GZP_HOST_ID_LENGTH.
-#endif
-
-#ifdef GZLL_CRYPT_ENABLE
- #error Gazell encryption can not be enabled when using the Gazell pairing library. \
- GZLL_CRYPT_ENABLE must be undefined.
-#endif
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Typedefs
- * @{ */
-/******************************************************************************/
-
-
-/**
- * @enum gzp_key_select_t
- * @brief Enumerator used for selecting the key to be used for encryption.
- */
-typedef enum
-{
- GZP_ID_EXCHANGE, ///< "Secret key" only
- GZP_KEY_EXCHANGE, ///< "Secret key" and "Host ID"
- GZP_DATA_EXCHANGE ///< "Dynamic key" and "Host ID"
-} gzp_key_select_t;
-
-
-/**
- * @enum gzp_cmd_t
- * @brief Enumerator used in the first payload byte of each packet to
- * indicate the packet type.
- */
-typedef enum
-{
- GZP_CMD_HOST_ADDRESS_REQ = 0, ///< Host address request
- GZP_CMD_HOST_ADDRESS_FETCH, ///< Host address fetch
- GZP_CMD_HOST_ID_REQ, ///< Host ID request
- GZP_CMD_HOST_ID_FETCH, ///< Host ID fetch request
- GZP_CMD_KEY_UPDATE_PREPARE, ///< Key update prepare
- GZP_CMD_KEY_UPDATE, ///< Key update
- GZP_CMD_ENCRYPTED_USER_DATA, ///< Encrypted user data
- GZP_CMD_FETCH_RESP, ///< Fetch response
- GZP_CMD_HOST_ADDRESS_RESP, ///< Host address response
- GZP_CMD_HOST_ID_FETCH_RESP, ///< Host ID fetch response
- GZP_CMD_KEY_UPDATE_PREPARE_RESP, ///< Key update prepare
- GZP_CMD_ENCRYPTED_USER_DATA_RESP, ///< Encrypted user data response
-} gzp_cmd_t;
-
-
-/**
- * @enum gzp_id_req_res_t
- * @brief Enumerator used to identify the state of the current
- * Host ID request.
- */
-typedef enum
-{
- GZP_ID_RESP_PENDING, ///< ID response pending
- GZP_ID_RESP_GRANTED, ///< ID response granted
- GZP_ID_RESP_REJECTED, ///< ID response rejected
- GZP_ID_RESP_FAILED, ///< ID response failed
- GZP_ID_RESP_NO_REQUEST ///< Default value. No ID request has yet been received.
-} gzp_id_req_res_t;
-
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Misc. function prototypes
- * @{ */
-/******************************************************************************/
-
-/**
- * Set the session token.
- *
- * @param token Pointer to the session token to set.
- */
-void gzp_crypt_set_session_token(const uint8_t *token);
-
-
-/**
- * Get the session token.
- *
- * @param dst_token Pointer to write the session token.
- */
-void gzp_crypt_get_session_token(uint8_t *dst_token);
-
-
-/**
- * Set the dynamic key.
- *
- * @param dyn_key Pointer to the dynamic key to set.
- */
-void gzp_crypt_set_dyn_key(const uint8_t* dyn_key);
-
-
-/**
- * Get the dynamic key.
- *
- * @param dst_key Pointer to write the dynamic key too.
- */
-void gzp_crypt_get_dyn_key(uint8_t *dst_key);
-
-
-/**
- * Set the Host ID.
- *
- * @param src Pointer to the Host ID to set.
- */
-static void gzp_set_host_id(const uint8_t* src);
-
-
-/**
- * Get the Host ID.
- *
- * @param dst Pointer to write the Host ID to.
- */
-void gzp_get_host_id(uint8_t *dst);
-
-
-/**
- * Selecting what key-set that should be used when encrypting data
- * using gzp_crypt().
- *
- * @param key_select Key-set to use.
- */
-void gzp_crypt_select_key(gzp_key_select_t key_select);
-
-
-/**
- * Encypt / decrypt data.
- *
- * The current "session token" will be used as initialization vector (IV).
- * The AES key to be used is selected by gzp_crypt_select_key().
- * AES is a symmetric encryption scheme, this function can be used
- * to perform both encryption and decryption.
- *
- * @param dst Destination to write encrypted data to. Should be 16 bytes long.
- * @param src Source data to encrypt.
- * @param length Length in bytes of src.
- */
-void gzp_crypt(uint8_t* dst, const uint8_t* src, uint8_t length);
-
-
-/**
- * Compare the *src_id with a pre-defined validation ID.
- *
- * @param src_id Pointer to the source validation ID to compare to.
- *
- * @retval true If *src_id equals the pre-defined ID.
- * @retval false If *src_id does not equal the pre-defined ID.
- */
-bool gzp_validate_id(const uint8_t *src_id);
-
-
-/**
- * Add the pre-defined validation ID to dst_id.
- * GZP_VALIDATION_ID_LENGTH bytes will be added.
- *
- * @param dst_id Pointer to add the GZP validation ID to.
- */
-void gzp_add_validation_id(uint8_t *dst_id);
-
-
-/**
- * Generate random bytes.
- *
- * @param dst Destination to write the random bytes to.
- * @param n Number of bytes to generate.
- */
-void gzp_random_numbers_generate(uint8_t *dst, uint8_t n);
-
-
-/**
- * Update the channel table and the system address.
- *
- * The channel table is updated to pseudo-random set generated using the
- * system address. The channel table still includes GZP_CHANNEL_MAX and
- * GZP_CHANNEL_MIN.
- * The system address is applied to base address 1 and therefore applies
- * to pipes 1-7.
- *
- * @param system_address Pointer to the system_address to set.
- *
- * @retval true If theradio parameters were updated successfully.
- * @retval false If there was an error updated the radio parameters.
- */
-bool gzp_update_radio_params(const uint8_t *system_address);
-
-
-/**
- * Generate a set of channels from a 4 byte address.
- *
- * @param ch_dst Destination to write the channel set to. The channel set
- * includes GZP_CHANNEL_MAX and GZP_CHANNEL_MIN.
- * @param address Four byte address to generate the channel set from.
- * @param channel_set_size Size of the channel set to generate.
- */
-void gzp_generate_channels(uint8_t *ch_dst, const uint8_t * address, uint8_t channel_set_size);
-
-
-/**
- * Perform an XOR on two byte strings.
- *
- * @param dst Destination to write the result to. Should be of size length.
- * @param src
- * @param pad
- * @param length Number of bytes to perform the XOR operation on.
- */
-void gzp_xor_cipher(uint8_t* dst, const uint8_t* src, const uint8_t* pad, uint8_t length);
-
-
-/******************************************************************************/
-/** @name Common Device and Host functions
- * @{ */
-/******************************************************************************/
-
-
-/**
- * Initialization function. This function initializes the Gazell Pairing Library.
-
- * This function must be called before any of the other Gazell Pairing Library functions are
- * used and must be called @b after gzll_init() is called.
- *
- */
-void gzp_init(void);
-
-/**
- * Function for erasing all pairing data.
- */
-void gzp_erase_pairing_data(void);
-
-/**
- * Disable Gazell and sleep while waiting for nrf_gzll_disabled callback.
- */
-void nrf_gzp_disable_gzll(void);
-
-/**
- Function for cancelling an ongoing (pending) "Host ID request".
-
- After calling this function the "Host ID request" status will go to
- "ID request Idle".
-*/
-void gzp_id_req_cancel(void);
-
-/**
- * Flush the GZLL RX FIFO for a specific pipe while GZLL is disabled.
- *
- * @param pipe Pipe.
- */
-void nrf_gzp_flush_rx_fifo(uint32_t pipe);
-
-/**
-@name Device functions
-*/
-
-/**
- * Check whether current GZP packet transaction has completed.
- *
- * @retval true
- * @retval false
- */
-bool nrf_gzp_tx_complete(void);
-
-/**
- * Check whether previous GZP packet transaction was successful.
- *
- * @retval true
- * @retval false
- */
-bool nrf_gzp_tx_success(void);
-
-/**
- * Reset tx_complete status.
- */
-void nrf_gzp_reset_tx_complete(void);
-
-/**
- * Reset tx_success status.
- */
-void nrf_gzp_reset_tx_success(void);
-
-/**
-* Function to check whether a Device has existing pairing data, implying that it is
-* paired to a Host.
-*
-* @retval -2 The pairing database is empty.
-* @retval -1 The device has a system address but no Host ID.
-* @retval >=0 The device has a system address and HostID at this index value in the database.
-*/
-int8_t gzp_get_pairing_status(void);
-
-/**
- Function for sending a "system address" request to a Host.
-
- When calling this function the Device will attempt acquiring the "system address" from
- any Host within close proximity.
-
- If a host is located within close proximity and pairing is enabled in the Host,
- a "system address" will be sent in return to the Device.
-
- The new "system address" will apply immediately in the Device, and the new "system address"
- will be stored in non volatile (NV) memory.
-
- Note. Using OTP devices limits the number of times a new "system address" can
- be stored in NV memory.
-
- @return
-
- @retval true if new "system address" was received from a Host.
- @retval false if no "system address" was received from a Host.
-*/
-bool gzp_address_req_send(void);
-
-/**
- Function for sending a "Host ID request" to a Host.
-
- The "Host ID" is needed to be able to send encrypted data using
- gzp_crypt_data_send().
-
- The request will be sent using the "system address" previously received using
- gzp_address_req_send().
-
- It is not required that the Host is within close proximity in order to acquire the
- "Host ID".
-
- The new "Host ID" will apply immediately for the Device, and the new "Host ID"
- will be stored in non volatile (NV) memory.
-
- Note. Using OTP devices limits the number of times a new "Host ID" can
- be stored in NV memory.
-
- @return
-
- @retval GZP_ID_RESP_PENDING if a "Host ID request" has been sent to the Host, but the Host application has
- not yet decided whether to Grant or Reject the "ID request".
- @retval GZP_ID_RESP_GRANTED if the "Host ID" has been received from the Host. The received "Host ID" will be stored
- in non volatile memory.
- @retval GZP_ID_RESP_REJECTED if the Host application has rejected the "Host ID request".
- @retval GZP_ID_RESP_FAILED if failing to send a request or receive a response from the Host.
-*/
-gzp_id_req_res_t gzp_id_req_send(void);
-
-/**
- Function for sending encrypted user data to the Host.
-
- Before any data can be sent the Device must acquire both the Host's
- "system address" by using gzp_address_req_send() and the "Host ID" by using
- gzp_id_req_send().
-
- @param *src is a pointer to the data packet to be sent.
- @param length is the length of the data packet to be sent.
-
-
- @return
- @retval true if the data was successfully transmitted and decrypted by the Host.
- @retval false if data transmission failed or Host failed to decryption data correctly.
-*/
-bool gzp_crypt_data_send(const uint8_t *src, uint8_t length);
-
-
-/**
-@name Host functions
-*/
-
-/**
- Function for enabling/disabling pairing in a host. When pairing is enabled the host will
- be monitoring for "system address" and "Host ID" requests from Devices.
-
- A "system address request" received from a Device will always be granted.
- When a "host ID request" has been received, the Host application have to grant,
- reject or cancel this by using one of the following functions:
-
- - gzp_id_req_grant()
- - gzp_id_req_reject()
- - gzp_id_req_cancel()
-
- @param enable
- @arg true enables pairing.
- @arg false disables pairing.
-*/
-void gzp_pairing_enable(bool enable);
-
-/**
- * Execute the Gazell Pairing Library Host operation.
- *
- * This function must be called regularly by the Host application.
- */
-void gzp_host_execute(void);
-
-/**
- * Address exchanged check.
- *
- * @retval true If a "system address" was delivered to a requesting Device during the
- * previous call to gzp_host_execute();
- * @retval false Otherwise.
-*/
-bool gzp_address_exchanged(void);
-
-/**
- Function for checking if a "Host ID request" has been received from a Device.
-
- If a request has been received, the Pairing library will enter "ID request pending"
- state.
-
- The application is responsible for responding to this request by calling
- one of the following functions:
-
- - gzp_id_req_grant()
- - gzp_id_req_reject()
- - gzp_id_req_cancel()
-
- @retval true if a "Host ID request" has been received (internal state is "ID request pending")
- @retval false if no "Host ID request" has been received (internal state is "ID request idle")
-*/
-bool gzp_id_req_received(void);
-
-/**
- Function for rejecting the previously received "Host ID request". This function should be called
- only when a "Host ID request" has been received (internal state is "ID request pending").
-
- The internal state of the Pairing library will remain "ID request pending" until the a "reject" message
- has been successfully transmitted to the requesting Device. After this the internal state will
- change to "ID request idle".
-*/
-void gzp_id_req_reject(void);
-
-/**
- * Function for granting the previously received "Host ID request". This function should be called
- only when a "Host ID request" has been received (internal state is "ID request pending").
-
- The internal state of the Pairing library will remain "ID request pending" until the "Host ID" has
- been successfully transmitted to the requesting Device. After this the internal state will
- change to "ID request idle".
-*/
-void gzp_id_req_grant(void);
-
-
-/**
- * Check if user data has been received.
- *
- * @retval true If encrypted user data has been received.
- * @retval false Otherwise.
-*/
-bool gzp_crypt_user_data_received(void);
-
-/**
- Function for reading encrypted user data.
-
- Note that the read user data will be automatically decrypted. Only data
- that was decrypted correctly will be presented.
-
- @param dst* is a pointer to where the received data will be written.
- @param length* is a pointer for returning the number of bytes received. Only 1 byte will
- be writtem to length*.
-
- @return
- @retval true if data has been received and is written to dst*
- @retval false if no data has been received.
-*/
-bool gzp_crypt_user_data_read(uint8_t* dst, uint8_t* length);
-
-
-/**
- Function emulating behavior of gzll_rx_start() in legeacy nRF24xx Gaell
- linbrary.
-
- This functions sets Gazell in Host mode and starts reception (enable).
-*/
-void gzll_rx_start(void);
-
-
-/** @} */
-/** @} */
-/** @} */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzp_device.c b/components/proprietary_rf/gzll/nrf_gzp_device.c
deleted file mode 100644
index 21676f0..0000000
--- a/components/proprietary_rf/gzll/nrf_gzp_device.c
+++ /dev/null
@@ -1,1145 +0,0 @@
-/**
- * Copyright (c) 2009 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-/**
- * @file
- * @brief Implementation of Gazell Pairing Library (gzp), Device functions.
- * @defgroup gzp_source_device Gazell Pairing Device implementation.
- * @{
- * @ingroup gzp_04_source
- */
-
-
-#include
-#include
-#include
-
-#include "nrf_gzll.h"
-#include "nrf_gzp.h"
-#include "nrf_delay.h"
-#include "nrf_nvmc.h"
-
-#define SOURCE_FILE NRF_SOURCE_FILE_GZP_DEVICE ///< File identifer for asserts.
-
-/******************************************************************************/
-/** @name Misc. defines
- * @{ */
-/******************************************************************************/
-
-#define GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS 0 ///< System address position.
-#define GZP_PARAMS_DB_ELEMENT_HOST_ID (GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS + GZP_SYSTEM_ADDRESS_WIDTH) ///< Host ID position
-#define GZP_PARAMS_DB_ELEMENT_SIZE (GZP_SYSTEM_ADDRESS_WIDTH + GZP_HOST_ID_LENGTH)///< Total size
-#define GZP_PARAMS_DB_MAX_ENTRIES 14 ///< Maximum allowed entries in the database.
-
-/** @} */
-
-/******************************************************************************/
-/** @name Derived parameters
- * @{ */
-/******************************************************************************/
-
-//lint -esym(40, GZP_PARAMS_STORAGE_ADR) "Undeclare identifier"
-#define GZP_PARAMS_DB_ADR GZP_PARAMS_STORAGE_ADR ///<
-#define GZP_PARAMS_DB_SIZE (GZP_PARAMS_DB_MAX_ENTRIES * GZP_PARAMS_DB_ELEMENT_SIZE) ///<
-
-#define GZP_INDEX_DB_ADR (GZP_PARAMS_STORAGE_ADR + GZP_PARAMS_DB_SIZE) ///<
-#define GZP_INDEX_DB_SIZE (GZP_DEVICE_PARAMS_STORAGE_SIZE - GZP_PARAMS_DB_SIZE) ///<
-
-#if (GZP_DEVICE_PARAMS_STORAGE_SIZE < GZP_PARAMS_DB_SIZE)
- #error GZP_DEVICE_PARAMS_STORAGE_SIZE must be greater or equal to GZP_PAIRING_PARAMS_DB_SIZE
-#elif (GZP_DEVICE_PARAMS_STORAGE_SIZE == GZP_PARAMS_DB_SIZE )
- #warning GZP_DEVICE_PARAMS_STORAGE_SIZE to low to be able store any pairing parameters NV memory
-#endif
-/** @} */
-
-
-/******************************************************************************/
-/** @name Typedefs
- * @{ */
-/******************************************************************************/
-
-
-/**
- * Possible return values for the function gzp_tx_rx_transaction()
- */
-typedef enum
-{
- GZP_TX_RX_SUCCESS, ///< ACK received. Transaction successful.
- GZP_TX_RX_FAILED_TO_SEND, ///<
- GZP_TX_RX_NO_RESPONSE ///<
-} gzp_tx_rx_trans_result_t;
-/** @} */
-
-
-/******************************************************************************/
-/** @name Internal variables
- * @{ */
-/******************************************************************************/
-
-static uint8_t gzp_system_address[GZP_SYSTEM_ADDRESS_WIDTH]; ///<
-static uint8_t gzp_host_id[GZP_HOST_ID_LENGTH]; ///<
-static uint8_t dyn_key[GZP_DYN_KEY_LENGTH];
-static bool gzp_id_req_pending = false;
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Internal (static) function prototypes
- * @{ */
-/******************************************************************************/
-
-/**
- * Function for sending an encrypted packet.
- *
- * The function waits for the transmission to complete.
- *
- * @param tx_packet Pointer to the packet to be sent.
- * @param length Length of the packet to be sent.
- * @param pipe Pipe on which the packet should be sent.
- *
- * @retval true If the transmission succeeded.
- * @retval false If the transmission failed (timed out).
- */
-static bool gzp_tx_packet(const uint8_t* tx_packet, uint8_t length, uint8_t pipe);
-
-/**
- * Function sending the packet *tx_packet and a subsequent packet fetching the response
- * to *tx_packet.
- *
- * @param tx_packet is a pointer to the packet to be sent.
- * @param tx_length is the length of the packet to be sent.
- * @param rx_dst is a pointer to where the received response packet should be stored.
- * @param rx_length is a pointer to where the length of the received packet should be stored.
- * @param pipe is the pipe on which the packet should be sent.
- *
- * @return result of the transaction.
- */
- static gzp_tx_rx_trans_result_t gzp_tx_rx_transaction(const uint8_t *tx_packet, uint8_t tx_length, uint8_t *rx_dst, uint32_t *rx_length, uint8_t pipe);
-
-/**
- * Function for sending an encrypted packet. The function detects whether the correct
- * key was used, and attempts to send a "key update" to the host if the wrong key was being
- * used.
-
- * @param tx_packet is a pointer to the packet to be sent.
- * @param length is the length of the packet to be sent.
-
- * @retval true if transmission succeeded and packet was decrypted correctly by host.
- * @retval false if transmission failed or packet was not decrypted correctly by host.
- */
-static bool gzp_crypt_tx_transaction(const uint8_t *tx_packet, uint8_t length);
-
-/**
- * Function updateing the "dynamic key" and sending a "key update" to the host.
- *
- * @retval true if key update succeeded.
- * @retval false if if key update failed.
- */
-static bool gzp_key_update(void);
-
-/**
- * Function for adding an element to "parameters data base" in non volatile (NV) memory. An element is
- * GZP_PARAMS_ELEMENT_SYSTEM_ADDRESS bytes long, holding the "system address" and "host ID".
- *
- * The "parameters data base" can store up to GZP_DEVICE_PAIRING_PARAMS_DB_MAX_ENTRIES
- * elements.
- *
- * @param src_element is a pointer to the element.
- * @param index is a number between 0 and (GZP_PARAMS_DB_MAX_ENTRIES - 1)
- * selecting the location in which the element will be stored.
- */
-static void gzp_params_db_add(const uint8_t *src_element, uint8_t index);
-
-/**
- * Function for reading an element from "parameters data base" in non volatile (NV) memory. An element is
- * GZP_PARAMS_ELEMENT_SYSTEM_ADDRESS bytes long, holding the "system address" and "host ID".
- *
- * @param dst_element is a pointer where the read element should be stored.
- * @param index is a number between 0 and (GZP_PARAMS_DB_MAX_ENTRIES - 1).
- * selecting the location that should be read.
- */
-static void gzp_params_db_read(uint8_t* dst_element, uint8_t index);
-
-/**
- * Function for writing an index to the "index data base" in non volatile (NV) memory.
- *
- * @param index is the index to be written to the data base.
- */
-static void gzp_index_db_add(uint8_t index);
-
-/**
- * Function for reading the index previously written to the "index data base" in NV memory.
- *
- * @return
- */
-static uint8_t gzp_index_db_read(void);
-
-/**
- * Check "index data base" is full.
- *
- * @retval true
- * @retval false
- */
-static bool gzp_index_db_full(void);
-
-/**
- * Function returning @b true if the "index data base" is empty.
- *
- * @retval true
- * @retval false
- */
-static bool gzp_index_db_empty(void);
-
-/**
- * Function returning @b true if array contains only 1s (0xff).
- *
- * @param *src is a pointer to the array to be evaluated.
- * @param length is the length of the array to be evaluated.
- *
- * @retval true
- * @retval false
- */
-static bool gzp_array_is_set(const uint8_t* src, uint8_t length);
-
-/**
- * Function for storing the current "system address" and "host ID" in NV memory.
- *
- * @param store_all selects whether only "system address" or both "system address" and
- * "host ID" should be stored.
- * @arg true selects that both should be stored.
- * @arg false selects that only "system address" should be stored.
- *
- * @retval true
- * @retval false
- */
-static bool gzp_params_store(bool store_all);
-
-/**
- * Restore the "system address" and "host ID" from NV memory.
- * @retval true
- * @retval false
- */
-static bool gzp_params_restore(void);
-
-/**
- * Delay function. Will add a delay equal to GZLL_RX_PERIOD * rx_periods [us].
- *
- * @param rx_periods
- */
-void gzp_delay_rx_periods(uint32_t rx_periods);
-
-/**
- * Delay function. Will add a delay equal to GZLL_RX_PERIOD * rx_periods [us] using the
- * gazell timer and not a delay loop.
- *
- * @param rx_periods
- */
-void gzp_tick_sleep_rx_periods(uint32_t rx_periods);
-
-/*
- * Print debug string. By default does nothing.
- *
- * If GZP_DEBUG is defined then the print string function is required to
- * be implemented.
- */
-void print_string(char* p_expr);
-
-/** @} */
-
-/******************************************************************************/
-/** @name Internal (static) variables
- * @{ */
-/******************************************************************************/
-
-static nrf_gzll_device_tx_info_t latest_tx_info; ///< Information about the last TX attempt, e.g. RSSI of ACK.
-
-static volatile bool tx_complete; ///< Flag to indicate whether a GZLL TX attempt has completed.
-static bool tx_success; ///< Flag to indicate whether a GZLL TX attempt was successful.
-
-#if defined(__ICCARM__)
- #if GZP_PARAMS_DB_ADR == 0x1000
- static const uint32_t database[GZP_DEVICE_PARAMS_STORAGE_SIZE/4] @ "gzp_dev_data"
- #elif GZP_PARAMS_DB_ADR == 0x15000
- static const uint32_t database[GZP_DEVICE_PARAMS_STORAGE_SIZE/4] @ "gzp_dev_data_sd"
- #else
- #error
- #endif
-#else
-static const uint32_t database[GZP_DEVICE_PARAMS_STORAGE_SIZE / 4] __attribute__((at(GZP_PARAMS_DB_ADR)))
-#endif
-= {
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
-0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF
-}; ///< Database for storing keys.
-
-
-/** @} */
-
-
-/******************************************************************************/
-// Implementation: Device-specific API functions
-/******************************************************************************/
-
-
-void gzp_init()
-{
- gzp_id_req_pending = false;
-
-#ifndef GZP_NV_STORAGE_DISABLE
- (void)gzp_params_restore();
-#endif
-
- // Update radio parameters from gzp_system_address
- (void)gzp_update_radio_params(gzp_system_address);
-}
-
-
-void gzp_erase_pairing_data(void)
-{
- // Erase database flash page so that it can be later written to.
- nrf_nvmc_page_erase((uint32_t)database);
-}
-
-bool gzp_address_req_send()
-{
- //lint -save -e514 Unusual use of a Boolean expression (gzll_update_ok &= ...)
- uint8_t i;
- bool retval = false;
- bool success;
- uint8_t address_req[GZP_CMD_HOST_ADDRESS_REQ_PAYLOAD_LENGTH];
- uint8_t rx_payload[NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH];
- uint32_t rx_payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
- nrf_gzll_tx_power_t temp_power;
- uint32_t temp_max_tx_attempts;
- bool gzll_update_ok = true;
-
-
- // Store parameters that are temporarily changed
- temp_max_tx_attempts = nrf_gzll_get_max_tx_attempts();
- temp_power = nrf_gzll_get_tx_power();
-
- // Modify parameters
- nrf_gzp_disable_gzll();
- gzll_update_ok &= nrf_gzll_set_max_tx_attempts(GZP_REQ_TX_TIMEOUT);
- gzll_update_ok &= nrf_gzll_set_tx_power(GZP_POWER);
-
- // Flush RX FIFO
- gzll_update_ok &= nrf_gzll_flush_rx_fifo(GZP_PAIRING_PIPE);
- gzll_update_ok &= nrf_gzll_enable();
- // Build "request" packet
- address_req[0] = (uint8_t)GZP_CMD_HOST_ADDRESS_REQ;
-
- // Send a number of packets in order to broadcast that devices not within
- // close proximity must back off.
- for (i = 0; i < GZP_MAX_BACKOFF_PACKETS; i++)
- {
- success = gzp_tx_packet(address_req, GZP_CMD_HOST_ADDRESS_REQ_PAYLOAD_LENGTH, GZP_PAIRING_PIPE);
- if (success)
- {
- nrf_gzp_flush_rx_fifo(GZP_PAIRING_PIPE);
- }
- else
- {
- break;
- }
- }
-
- gzp_delay_rx_periods(GZP_TX_ACK_WAIT_TIMEOUT);
- // Send message for fetching pairing response from host.
- address_req[0] = (uint8_t)GZP_CMD_HOST_ADDRESS_FETCH;
-
- success = gzp_tx_packet(address_req, GZP_CMD_HOST_ADDRESS_REQ_PAYLOAD_LENGTH, GZP_PAIRING_PIPE);
- if (success && latest_tx_info.payload_received_in_ack)
- {
- // If pairing response received
- if (nrf_gzll_get_rx_fifo_packet_count(GZP_PAIRING_PIPE) > 0)
- {
- rx_payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH; //dummy placeholder
- if (nrf_gzll_fetch_packet_from_rx_fifo(GZP_PAIRING_PIPE, rx_payload, &rx_payload_length))
- {
- if (rx_payload[0] == (uint8_t)GZP_CMD_HOST_ADDRESS_RESP)
- {
- memcpy(gzp_system_address, &rx_payload[GZP_CMD_HOST_ADDRESS_RESP_ADDRESS], GZP_SYSTEM_ADDRESS_WIDTH);
- gzll_update_ok &= gzp_update_radio_params(&rx_payload[GZP_CMD_HOST_ADDRESS_RESP_ADDRESS]);
- #ifndef GZP_NV_STORAGE_DISABLE
- (void)gzp_params_store(false); // "False" indicates that only "system address" part of DB element will be stored
- #endif
- retval = true;
- }
- }
- }
- }
- else
- {
- gzp_delay_rx_periods(GZP_NOT_PROXIMITY_BACKOFF_RX_TIMEOUT - GZP_TX_ACK_WAIT_TIMEOUT);
- }
- gzp_delay_rx_periods(GZP_STEP1_RX_TIMEOUT);
-
- // Clean-up and restore parameters temporarily modified
- nrf_gzp_disable_gzll();
- gzll_update_ok &= nrf_gzll_flush_rx_fifo(GZP_PAIRING_PIPE);
- gzll_update_ok &= nrf_gzll_flush_tx_fifo(GZP_PAIRING_PIPE);
- gzll_update_ok &= nrf_gzll_set_max_tx_attempts(temp_max_tx_attempts);
- gzll_update_ok &= nrf_gzll_set_tx_power(temp_power);
- gzll_update_ok &= nrf_gzll_enable();
-
- if (!gzll_update_ok)
- {
- /*
- The update of the Gazell parameters failed. Use nrf_gzll_get_error_code()
- to investigate the cause.
- */
- }
-
- return retval;
- //lint -restore
-}
-
-#ifndef GZP_CRYPT_DISABLE
-
-gzp_id_req_res_t gzp_id_req_send()
-{
- uint8_t tx_packet[GZP_CMD_HOST_ID_REQ_PAYLOAD_LENGTH];
- uint8_t rx_packet[GZP_MAX_ACK_PAYLOAD_LENGTH];
- gzp_tx_rx_trans_result_t trans_result;
-
- // If no ID request is pending, send new "ID request"
- if (!gzp_id_req_pending)
- {
- // Build "Host ID request packet"
- tx_packet[0] = (uint8_t)GZP_CMD_HOST_ID_REQ;
-
- // Generate new session token
- gzp_random_numbers_generate(&tx_packet[GZP_CMD_HOST_ID_REQ_SESSION_TOKEN], GZP_SESSION_TOKEN_LENGTH);
-
- // Send "Host ID request"
- if (gzp_tx_packet(tx_packet, GZP_CMD_HOST_ID_REQ_PAYLOAD_LENGTH, GZP_DATA_PIPE))
- {
- // Update session token if "Host ID request" was successfully transmitted
- gzp_crypt_set_session_token(&tx_packet[GZP_CMD_HOST_ID_REQ_SESSION_TOKEN]);
- gzp_id_req_pending = true;
-
- return GZP_ID_RESP_PENDING;
- }
- }
- else // If "ID request is pending" send "fetch ID" packet
- {
- // Build "host ID fetch" packet
- tx_packet[0] = (uint8_t)GZP_CMD_HOST_ID_FETCH;
- gzp_add_validation_id(&tx_packet[GZP_CMD_HOST_ID_FETCH_VALIDATION_ID]);
-
- // Encrypt "host ID fetch" packet
- gzp_crypt_select_key(GZP_ID_EXCHANGE);
- gzp_crypt(&tx_packet[1], &tx_packet[1], GZP_CMD_HOST_ID_FETCH_PAYLOAD_LENGTH - 1);
-
- trans_result = gzp_tx_rx_transaction(tx_packet, GZP_CMD_HOST_ID_FETCH_PAYLOAD_LENGTH, rx_packet, NULL, GZP_DATA_PIPE);
- // If packet was successfully sent AND a response packet was received
- if (trans_result == GZP_TX_RX_SUCCESS)
- {
- // Validate response packet
- if (rx_packet[0] == (uint8_t)GZP_CMD_HOST_ID_FETCH_RESP)
- {
- gzp_crypt(&rx_packet[1], &rx_packet[1], GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH - 1);
- if (gzp_validate_id(&rx_packet[GZP_CMD_HOST_ID_FETCH_RESP_VALIDATION_ID]))
- {
- switch (rx_packet[GZP_CMD_HOST_ID_FETCH_RESP_STATUS])
- {
- case GZP_ID_RESP_PENDING:
- break;
- case GZP_ID_RESP_REJECTED:
- gzp_id_req_pending = false;
- break;
- case GZP_ID_RESP_GRANTED:
- gzp_set_host_id(&rx_packet[GZP_CMD_HOST_ID_FETCH_RESP_HOST_ID]);
- gzp_random_numbers_generate(dyn_key, GZP_DYN_KEY_LENGTH);
- gzp_crypt_set_dyn_key(dyn_key);
- #ifndef GZP_NV_STORAGE_DISABLE
- (void)gzp_params_store(true);
- #endif
- gzp_id_req_pending = false;
- break;
- default:
- break;
- }
-
- return (gzp_id_req_res_t)rx_packet[GZP_CMD_HOST_ID_FETCH_RESP_STATUS];
- }
- else
- {
- gzp_id_req_pending = false;
- return GZP_ID_RESP_REJECTED;
- }
- }
- }
- }
-
- gzp_id_req_pending = false;
- return GZP_ID_RESP_FAILED;
-}
-
-void gzp_id_req_cancel()
-{
- gzp_id_req_pending = false;
-}
-
-bool gzp_crypt_data_send(const uint8_t *src, uint8_t length)
-{
- if (length <= GZP_ENCRYPTED_USER_DATA_MAX_LENGTH)
- {
- if (gzp_crypt_tx_transaction(src, length))
- {
- return true;
- }
- else
- {
- //print_string("GZP_CRYPT_TX failed\r\n");
- // Attempt key update if user data transmission failed
- // during normal operation (!gzp_id_req_pending)
- if (!gzp_id_req_pending)
- {
- //print_string("KEY UPDATE\r\n");
- if (gzp_key_update())
- {
- return gzp_crypt_tx_transaction(src, length);
- }
- }
- return false;
- }
- }
- else
- {
- return false;
- }
-}
-
-#endif
-/** @} */
-
-
-/******************************************************************************/
-// Implementation: Internal (static) functions
-/******************************************************************************/
-
-static bool gzp_tx_packet(const uint8_t* tx_packet, uint8_t length, uint8_t pipe)
-{
- tx_complete = false;
- tx_success = false;
-
- if (nrf_gzll_add_packet_to_tx_fifo(pipe,(uint8_t *)tx_packet, length))
- {
- while (tx_complete == false)
- {
- __WFI();
- }
- return tx_success;
- }
- else
- {
- return false;
- }
-}
-
-static gzp_tx_rx_trans_result_t gzp_tx_rx_transaction(const uint8_t *tx_packet, uint8_t tx_length, uint8_t *rx_dst, uint32_t *rx_length, uint8_t pipe)
-{
-
- gzp_tx_rx_trans_result_t retval;
- uint8_t fetch_packet[GZP_CMD_FETCH_RESP_PAYLOAD_LENGTH];
- bool tx_packet_success;
- bool fetch_success;
- uint32_t local_rx_length = GZP_MAX_ACK_PAYLOAD_LENGTH;
- uint32_t temp_lifetime;
-
- nrf_gzp_flush_rx_fifo(pipe);
-
- retval = GZP_TX_RX_FAILED_TO_SEND;
-
- (void)nrf_gzll_disable();
- while (nrf_gzll_is_enabled())
- {}
- temp_lifetime = nrf_gzll_get_sync_lifetime();
- (void)nrf_gzll_set_sync_lifetime(GZP_TX_RX_TRANS_DELAY * 3); // 3 = RXPERIOD * 2 + margin
- (void)nrf_gzll_enable();
-
- tx_packet_success = gzp_tx_packet(tx_packet, tx_length, pipe);
-
- if (tx_packet_success)
- {
- retval = GZP_TX_RX_NO_RESPONSE;
-
- nrf_gzp_flush_rx_fifo(pipe);
-
- fetch_packet[0] = (uint8_t)GZP_CMD_FETCH_RESP;
-
- gzp_tick_sleep_rx_periods(GZP_TX_RX_TRANS_DELAY);
-
- tx_packet_success = gzp_tx_packet(fetch_packet, GZP_CMD_FETCH_RESP_PAYLOAD_LENGTH, pipe);
-
- if (tx_packet_success)
- {
- if (nrf_gzll_get_rx_fifo_packet_count(pipe))
- {
- local_rx_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
- fetch_success = nrf_gzll_fetch_packet_from_rx_fifo(pipe, rx_dst, &local_rx_length);
- }
- else
- {
- fetch_success = false;
- }
-
- if (fetch_success)
- {
- retval = GZP_TX_RX_SUCCESS;
- }
- else
- {
- //print_string("GZP_TX_FETCH_FAILED\r\n");
- }
- }
- else
- {
- //print_string("GZP_TX_FETCH_NO_ACK\r\n");
- }
- }
-
- (void)nrf_gzll_disable();
- while (nrf_gzll_is_enabled())
- {}
- (void)nrf_gzll_set_sync_lifetime(temp_lifetime);
- (void)nrf_gzll_enable();
-
- return retval;
-}
-
-#ifndef GZP_CRYPT_DISABLE
-
-static bool gzp_crypt_tx_transaction(const uint8_t *src, uint8_t length)
-{
- uint8_t tx_packet[GZP_MAX_FW_PAYLOAD_LENGTH];
- uint8_t rx_packet[GZP_MAX_ACK_PAYLOAD_LENGTH];
- uint8_t tx_packet_length;
-
- gzp_tx_rx_trans_result_t result;
-
- tx_packet_length = length + (uint8_t)GZP_ENCRYPTED_USER_DATA_PACKET_OVERHEAD;
-
- // Assemble tx packet
- tx_packet[0] = (uint8_t)GZP_CMD_ENCRYPTED_USER_DATA;
- gzp_add_validation_id(&tx_packet[GZP_CMD_ENCRYPTED_USER_DATA_VALIDATION_ID]);
- memcpy(&tx_packet[GZP_CMD_ENCRYPTED_USER_DATA_PAYLOAD], (uint8_t*)src, length);
-
- // Encrypt tx packet
- if (gzp_id_req_pending)
- {
- gzp_crypt_select_key(GZP_ID_EXCHANGE);
- }
- else
- {
- gzp_crypt_select_key(GZP_DATA_EXCHANGE);
- }
- gzp_crypt(&tx_packet[1], &tx_packet[1], tx_packet_length - 1);
-
- // If packet was successfully sent AND a response packet was received
- result = gzp_tx_rx_transaction(tx_packet, tx_packet_length, rx_packet, NULL, GZP_DATA_PIPE);
- if (result == GZP_TX_RX_SUCCESS)
- {
- if (rx_packet[0] == (uint8_t)GZP_CMD_ENCRYPTED_USER_DATA_RESP)
- {
- gzp_crypt(&rx_packet[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID], &rx_packet[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID], GZP_VALIDATION_ID_LENGTH);
-
- // Validate response in order to know whether packet was correctly decrypted by host
- if (gzp_validate_id(&rx_packet[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID]))
- {
- // Update session token if normal operation (!gzp_id_req_pending)
- if (!gzp_id_req_pending)
- {
- gzp_crypt_set_session_token(&rx_packet[GZP_CMD_ENCRYPTED_USER_DATA_RESP_SESSION_TOKEN]);
- }
- return true;
- }
- else
- {
- //print_string("GZP_CRYPT_TX_TRANS: Validation ID bad\r\n");
- return false;
- }
- }
- else
- {
- //print_string("GZP_CRYPT_TX_TRANS: Bad CMD. \r\n");
- return false;
- }
- }
- else
- {
- //print_string("GZP_CRYPT_TX_TRANS: gzp_tx_rx_trans not SUCCESS\r\n");
- return false;
- }
-}
-
-static bool gzp_key_update(void)
-{
- uint8_t tx_packet[GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH], rx_packet[GZP_MAX_ACK_PAYLOAD_LENGTH];
-
- // Send "prepare packet" to get session token to be used for key update
- tx_packet[0] = (uint8_t)GZP_CMD_KEY_UPDATE_PREPARE;
-
- // If packet was successfully sent AND a response packet was received
- if (gzp_tx_rx_transaction(tx_packet, GZP_CMD_KEY_UPDATE_PREPARE_PAYLOAD_LENGTH, rx_packet, NULL, GZP_DATA_PIPE) == GZP_TX_RX_SUCCESS)
- {
- if (rx_packet[0] == (uint8_t)GZP_CMD_KEY_UPDATE_PREPARE_RESP)
- {
- gzp_crypt_set_session_token(&rx_packet[GZP_CMD_KEY_UPDATE_PREPARE_RESP_SESSION_TOKEN]);
-
- // Build "key update" packet
- tx_packet[0] = (uint8_t)GZP_CMD_KEY_UPDATE;
- gzp_add_validation_id(&tx_packet[GZP_CMD_KEY_UPDATE_VALIDATION_ID]);
- gzp_random_numbers_generate(&tx_packet[GZP_CMD_KEY_UPDATE_NEW_KEY], GZP_DYN_KEY_LENGTH);
- gzp_crypt_set_dyn_key(&tx_packet[GZP_CMD_KEY_UPDATE_NEW_KEY]);
-
- // Encrypt "key update packet"
- gzp_crypt_select_key(GZP_KEY_EXCHANGE);
- gzp_crypt(&tx_packet[1], &tx_packet[1], GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH - 1);
-
- // Send "key update" packet
- if (gzp_tx_packet(tx_packet, GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH, GZP_DATA_PIPE))
- {
- return true;
- }
- }
- }
-
- return false;
-}
-
-#endif
-
-void gzp_set_host_id(const uint8_t * id)
-{
- memcpy(gzp_host_id, id, GZP_HOST_ID_LENGTH);
-}
-
-void gzp_get_host_id(uint8_t * dst_id)
-{
- memcpy(dst_id, gzp_host_id, GZP_HOST_ID_LENGTH);
-}
-
-static void gzp_params_db_add(const uint8_t* src_element, uint8_t index)
-{
- nrf_nvmc_write_bytes((GZP_PARAMS_DB_ADR + (index * GZP_PARAMS_DB_ELEMENT_SIZE)), src_element, (uint32_t)GZP_PARAMS_DB_ELEMENT_SIZE);
-}
-
-
-static void gzp_params_db_read(uint8_t* dst_element, uint8_t index)
-{
- memcpy(dst_element,(uint8_t*)(GZP_PARAMS_DB_ADR + (index * GZP_PARAMS_DB_ELEMENT_SIZE)), GZP_PARAMS_DB_ELEMENT_SIZE);
-}
-
-
-static void gzp_index_db_add(uint8_t val)
-{
- int16_t i;
- uint8_t temp_val;
- uint32_t addr;
-
- // Search for unwritten loacation in index DB
- for (i = 0; i < GZP_INDEX_DB_SIZE; i++)
- {
- temp_val = *(uint8_t*)(GZP_INDEX_DB_ADR + i);
-
- // Lower nibble
- if (i != (GZP_INDEX_DB_SIZE - 1))
- {
- if ((temp_val & 0x0f) == 0x0f)
- {
- temp_val = (temp_val & 0xf0) | val;
- break;
- }
- // Upper nibble
- else if ((temp_val & 0xf0) == 0xf0)
- {
- temp_val = (temp_val & 0x0f) | (val << 4);
- break;
- }
- }
- else
- {
- temp_val = (GZP_PARAMS_DB_MAX_ENTRIES << 4) | val;
- break;
- }
- }
-
- // Write index DB
- addr = (GZP_INDEX_DB_ADR + i);
- nrf_nvmc_write_byte(addr, temp_val);
-}
-
-static uint8_t gzp_index_db_read()
-{
- uint8_t retval;
- int16_t i;
-
- // Search for previously written location
- for (i = (GZP_INDEX_DB_SIZE - 1); i >= 0; i--)
- {
- retval = *(uint8_t*)(GZP_INDEX_DB_ADR + i);
-
- if (retval != 0xff)
- {
- break;
- }
- }
-
- if (retval == 0xff)
- {
- retval = GZP_PARAMS_DB_MAX_ENTRIES; // index db empty
- }
- else if ((retval & 0xf0) != 0xf0)
- {
- retval >>= 4;
- }
- else
- {
- retval &= 0x0f;
- }
-
- return retval;
-}
-
-int8_t gzp_get_pairing_status(void)
-{
- uint8_t db_byte;
- int8_t db_index;
- int16_t i;
- uint8_t temp_element[GZP_PARAMS_DB_ELEMENT_SIZE];
- uint8_t default_host_id[GZP_HOST_ID_LENGTH];
-
- db_index = -2;
-
- // Populate default Host ID with F's.
- for (i=0; i< GZP_HOST_ID_LENGTH; i++)
- {
- default_host_id[i] = 0xFF;
- }
-
- // Search for previously written location
- for (i = (GZP_INDEX_DB_SIZE - 1); i >= 0; i--)
- {
- db_byte = *(uint8_t*)(GZP_INDEX_DB_ADR + i);
-
- // Check if idx has been written to
- if (db_byte != 0xff)
- {
- // Convert 4-bit nibble to index
- if ((db_byte & 0xf0) != 0xf0)
- {
- db_byte = (db_byte >> 4) & 0x0f;
- }
- else
- {
- db_byte = db_byte & 0x0f;
- }
-
- // Retrieve database entry
- gzp_params_db_read(temp_element, db_byte);
-
- // Check if database entry is all F's
- if ( memcmp(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], default_host_id, GZP_HOST_ID_LENGTH) != 0)
- {
-
- db_index = db_byte;
- }
- else
- {
- db_index = -1;
- }
- break;
- }
- }
-
- return db_index;
-}
-
-
-static bool gzp_index_db_full()
-{
-#if (GZP_INDEX_DB_SIZE != 0)
- return ((*(uint8_t*)(GZP_INDEX_DB_ADR + (GZP_INDEX_DB_SIZE - 1)) != 0xff));
-#else
- return true;
-#endif
-}
-
-//lint -save -e506 Constant value boolean
-static bool gzp_index_db_empty()
-{
-#if (GZP_INDEX_DB_SIZE != 0)
- return ((GZP_INDEX_DB_SIZE == 0) || ((*(uint8_t*)(GZP_INDEX_DB_ADR)) == 0xff));
-#else
- return true;
-#endif
-}
-//lint -restore
-
-static bool gzp_array_is_set(const uint8_t* src, uint8_t length)
-{
- uint8_t i;
-
- for (i = 0; i < length; i++)
- {
- if (*(src++) != 0xff)
- {
- return false;
- }
- }
- return true;
-}
-
-static bool gzp_params_store(bool store_all)
-{
- uint8_t i;
- bool write_index_db = false;
- bool write_param_db = false;
- uint8_t new_db_index = 0;
- uint8_t temp_element[GZP_PARAMS_DB_ELEMENT_SIZE];
-
- // Search param DB to see if current setup exists
- if (store_all)
- {
- // Search for: Current system address and host ID exists
- for (i = 0; i < GZP_PARAMS_DB_MAX_ENTRIES; i++)
- {
- gzp_params_db_read(temp_element, i);
-
- if (((memcmp(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], gzp_system_address, GZP_SYSTEM_ADDRESS_WIDTH)) == 0) && ((memcmp(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], gzp_host_id, GZP_HOST_ID_LENGTH)) == 0))
- {
- write_index_db = true;
- new_db_index = i;
- break; // System address + host_id allready exists in database
- }
- }
-
- // Search for: Current system address and cleared host ID
- if (!write_index_db)
- {
- for (i = 0; i < GZP_PARAMS_DB_MAX_ENTRIES; i++)
- {
- gzp_params_db_read(temp_element, i);
-
- if (((memcmp(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], gzp_system_address, GZP_SYSTEM_ADDRESS_WIDTH)) == 0) && \
- (gzp_array_is_set(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], GZP_HOST_ID_LENGTH)))
- {
- memcpy(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], gzp_host_id, GZP_HOST_ID_LENGTH);
- new_db_index = i;
- write_index_db = true;
- write_param_db = true;
- break;
- }
- }
- }
-
- // Search for: Cleared system address and cleared host ID
- if (!write_index_db)
- {
- for (i = 0; i < GZP_PARAMS_DB_MAX_ENTRIES; i++)
- {
- gzp_params_db_read(temp_element, i);
-
- if (gzp_array_is_set(temp_element, GZP_PARAMS_DB_ELEMENT_SIZE))
- {
- memcpy(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], gzp_system_address, GZP_SYSTEM_ADDRESS_WIDTH);
- memcpy(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], gzp_host_id, GZP_HOST_ID_LENGTH);
- new_db_index = i;
- write_index_db = true;
- write_param_db = true;
- break;
- }
- }
- }
- }
- else
- {
- // Search for: System address + any host ID
- for (i = 0; i < GZP_PARAMS_DB_MAX_ENTRIES; i++)
- {
- gzp_params_db_read(temp_element, i);
-
- if ((memcmp(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], gzp_system_address, GZP_SYSTEM_ADDRESS_WIDTH)) == 0)
- {
- //memcpy(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID], gzp_host_id, GZP_HOST_ID_LENGTH);
- write_index_db = true;
- new_db_index = i;
- break;
- }
- }
-
- // Search for: System address cleared
- if (!write_index_db)
- {
- for (i = 0; i < GZP_PARAMS_DB_MAX_ENTRIES; i++)
- {
- gzp_params_db_read(temp_element, i);
-
- if (gzp_array_is_set(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], GZP_SYSTEM_ADDRESS_WIDTH))
- {
- memcpy(&temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], gzp_system_address, GZP_SYSTEM_ADDRESS_WIDTH);
- write_index_db = true;
- write_param_db = true;
- new_db_index = i;
- break;
- }
- }
- }
- }
-
- if (write_param_db)
- {
- gzp_params_db_add(temp_element, new_db_index);
- }
-
- if (write_index_db)
- {
- if (!gzp_index_db_full() && (new_db_index != gzp_index_db_read()) && (new_db_index != GZP_PARAMS_DB_MAX_ENTRIES))
- {
- gzp_index_db_add(new_db_index);
- return true;
- }
- }
-
- return false;
-}
-
-static bool gzp_params_restore(void)
-{
- uint8_t i;
- uint8_t temp_element[GZP_PARAMS_DB_ELEMENT_SIZE];
-
- if (!gzp_index_db_full() && !gzp_index_db_empty())
- {
- i = gzp_index_db_read();
-
- if (i < GZP_PARAMS_DB_MAX_ENTRIES)
- {
- gzp_params_db_read(temp_element, i);
- memcpy(gzp_system_address, &temp_element[GZP_PARAMS_DB_ELEMENT_SYSTEM_ADDRESS], GZP_SYSTEM_ADDRESS_WIDTH);
- gzp_set_host_id(&temp_element[GZP_PARAMS_DB_ELEMENT_HOST_ID]);
- return true;
- }
- }
-
- return false;
-}
-
-void gzp_delay_rx_periods(uint32_t rx_periods)
-{
- nrf_delay_us(rx_periods * 2 * nrf_gzll_get_timeslot_period());
-}
-
-void gzp_tick_sleep_rx_periods(uint32_t rx_periods)
-{
- nrf_gzll_clear_tick_count();
-
- while (nrf_gzll_get_tick_count() < 2 * rx_periods)
- {
- __WFI();
- }
-}
-
-
-void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
-{
- latest_tx_info = tx_info;
-
- tx_complete = true;
- tx_success = true;
-}
-
-void nrf_gzll_device_tx_failed(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
-{
- latest_tx_info = tx_info;
-
- tx_complete = true;
- tx_success = false;
-}
-
-bool nrf_gzp_tx_complete(void)
-{
- return tx_complete;
-}
-
-bool nrf_gzp_tx_success(void)
-{
- return tx_success;
-}
-
-void nrf_gzp_reset_tx_complete()
-{
- tx_complete = false;
-}
-
-void nrf_gzp_reset_tx_success()
-{
- tx_success = false;
-}
-
-void nrf_gzll_disabled(void)
-{
-}
-
-void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)
-{
-}
-
-/** @} */
-/** @} */
diff --git a/components/proprietary_rf/gzll/nrf_gzp_host.c b/components/proprietary_rf/gzll/nrf_gzp_host.c
deleted file mode 100644
index abee102..0000000
--- a/components/proprietary_rf/gzll/nrf_gzp_host.c
+++ /dev/null
@@ -1,789 +0,0 @@
-/**
- * Copyright (c) 2009 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-/**
- * @file
- * @brief Implementation of Gazell Pairing Library (gzp), Host functions.
- * @defgroup gzp_source_host Gazell Pairing Host implementation
- * @{
- * @ingroup gzp_04_source
- */
-
-
-#include "nrf_gzp.h"
-#include "nrf_gzll.h"
-#include
-#include
-#include
-#include "nrf_assert.h"
-#include "nrf_ecb.h"
-#include "nrf_nvmc.h"
-
-
-//lint -esym(40, GZP_PARAMS_STORAGE_ADR) "Undeclared identifier"
-
-
-/******************************************************************************/
-/** @name Typedefs
- * @{ */
-/******************************************************************************/
-
-/**
- * Definition of internal states.
- */
-typedef enum
-{
- GZP_ID_REQ_IDLE, ///< No Host ID request received from Device.
- GZP_ID_REQ_PENDING, ///< Host ID request received and waiting on application to grant/reject.
- GZP_ID_REQ_PENDING_AND_GRANTED, ///< Host ID request received and granted by application.
- GZP_ID_REQ_PENDING_AND_REJECTED, ///< Host ID request received and rejected by application.
-} gzp_id_req_stat_t;
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Internal (static) function prototypes
- * @{ */
-/******************************************************************************/
-
-
-/**
- * Function for incrementing internal session counter.
- */
-static void gzp_session_counter_inc(void);
-
-
-/**
- * Function for reading value of internal session counter.
- * @param dst Current session counter.
- */
-static void gzp_get_session_counter(uint8_t* dst);
-
-
-/**
- * Function processing received "system address request" from Device.
- *
- * @param gzp_req Pointer to RX payload containing system address request.
- */
-static void gzp_process_address_req(uint8_t* gzp_req);
-
-
-/**
- * Function to process Host ID request from device.
- *
- * The Host shall retrieve the Host ID from NVM, or shall generate if
- * it does not yet exist.
- *
- * @param rx_payload Pointer to rx_payload contaning Host ID request.
- */
-static void gzp_process_id_req(uint8_t* rx_payload);
-
-/**
- * Function to process Host ID fetch request from Device.
- *
- * The Device fetches the Host ID after the Host has generated/retrieved
- * the Host ID.
- *
- * @param rx_payload Pointer to rx_payload contaning Host ID fetch request.
- */
-static void gzp_process_id_fetch(uint8_t* rx_payload);
-
-
-/**
- * Function to process Key Update Prepare packet.
- *
- * Device requests the Session Token to be used for the Key Update request.
- */
-static void gzp_process_key_update_prepare(void);
-
-
-/**
- * Function to process Key Update packet.
- *
- * Device requests a Key Update and sends a new Dynamic Key. The Dynamic Key is
- * updated on the Host.
- *
- * @param rx_payload Pointer to rx_payload containing Key Update request.
- */
-static void gzp_process_key_update(uint8_t* rx_payload);
-
-
-/**
- * Function to process received Encrypted User packet.
- *
- * @param rx_payload Pointer to rx_payload containing the encrypted user data.
- * @param length Length of encrypted user data.
- */
-static void gzp_process_encrypted_user_data(uint8_t* rx_payload, uint8_t length);
-
-
-/**
- * Function to preload the payload for the next ACK.
- *
- * @param src Pointer to source payload.
- * @param length Length of source payload.
- * @param pipe Pipe for the ACK payload.
- */
-static void gzp_preload_ack(uint8_t* src, uint8_t length, uint8_t pipe);
-
-
-/**
- * Function for reading the Chip ID from non-volatile memory.
- *
- * The chip ID is used for the system address.
- *
- * If the Chip ID is not yet created a random Chip ID is created and
- * written to non-volatile memory. Note that the term chip ID is used as
- * the factory programmed chip sequence number was used for the system
- * address in nRF24LU ICs.
- *
- * @param dst Address to copy Host ID to.
- * @param[in] n Number of bytes in the Host ID.
- */
-void gzp_host_chip_id_read(uint8_t *dst, uint8_t n);
-
-
-/**
- * Function to set the Host ID.
- *
- * Writes the Host ID to non-volatile memory.
- * @param src Address of the Host ID to copy from.
- */
-static void gzp_set_host_id(const uint8_t* src);
-
-
-/**
- * Function to request disabling of Gazell and wait for it to be disabled.
- *
- * Emulates legacy gzll_goto_idle().
- */
-static void gzll_goto_idle(void);
-
-
-/**
- * Flush all TX FIFOs.
- *
- * Emulates legacy gzll_tx_fifo_flush().
- */
-static void gzll_tx_fifo_flush(void);
-
-
-/**
- * Flush all RX FIFOs.
- *
- * Emulates legacy gzll_rx_fifo_flush().
- */
-static void gzll_rx_fifo_flush(void);
-
-
-/**
- * Set a timeout for the reception of packets on the Gazell Host.
- *
- * Emulates legacy Gazell function: gzll_set_param(GZLL_PARAM_RX_TIMEOUT, x).
- *
- * @param timeout Timeout in number of legacy "RX periods"
- * (1 RX period = 2 timeslot periods).
- */
-static void gzll_set_rx_timeout(uint32_t timeout);
-
-/** @} */
-
-
-/******************************************************************************/
-/** @name Internal (static) variabls
- * @{ */
-/******************************************************************************/
-
-static gzp_id_req_stat_t gzp_id_req_stat; ///< Current state of Host ID request.
-static bool gzp_pairing_enabled_f; ///< True if Host is paired with a device.
-static bool gzp_address_exchanged_f; ///< True if Host has exchanged a system address with a device and thus pairing has begun.
-
-static uint8_t gzp_session_counter[GZP_SESSION_TOKEN_LENGTH]; ///< Session counter used for key generation and update.
-
-static bool gzp_encrypted_user_data[GZP_ENCRYPTED_USER_DATA_MAX_LENGTH]; ///< Placeholder for encrypted data from Device.
-static uint8_t gzp_encrypted_user_data_length; ///< Length of gzp_encrypted_user_data. Zero implies no data received.
-
-static nrf_gzll_host_rx_info_t prev_gzp_rx_info = {0, 0}; ///< RSSI and status of ACK payload transmission of previous Gazell packet.
-
-/** @} */
-
-
-/******************************************************************************/
-// Implementation: Host-specific API functions
-/******************************************************************************/
-
-void gzp_init()
-{
- uint8_t system_address[GZP_SYSTEM_ADDRESS_WIDTH];
-
- // Read "chip id", of which 4 bytes (GZP_SYSTEM_ADDRESS_WIDTH)
- // are used as system address
- gzp_host_chip_id_read(system_address, GZP_SYSTEM_ADDRESS_WIDTH);
-
- // Set up radio parameters (addresses and channel subset) from system_address
- (void)gzp_update_radio_params(system_address);
-
- // Only "data pipe" enabled by default
-
- (void)nrf_gzll_set_rx_pipes_enabled(nrf_gzll_get_rx_pipes_enabled() | (1 << GZP_DATA_PIPE));
-
- gzp_pairing_enabled_f = false;
- gzp_address_exchanged_f = false;
- gzp_id_req_stat = GZP_ID_REQ_IDLE;
- gzp_encrypted_user_data_length = 0;
-
- // Infinite RX timeout
- gzll_set_rx_timeout(0);
-}
-
-void gzp_pairing_enable(bool enable)
-{
- if (gzp_pairing_enabled_f != enable)
- {
- gzll_goto_idle();
-
- if (enable)
- {
- (void)nrf_gzll_set_rx_pipes_enabled(nrf_gzll_get_rx_pipes_enabled() | (1 << GZP_PAIRING_PIPE));
- }
- else
- {
- (void)nrf_gzll_set_rx_pipes_enabled(nrf_gzll_get_rx_pipes_enabled() & ~(1 << GZP_PAIRING_PIPE));
-
- gzp_id_req_stat = GZP_ID_REQ_IDLE;
- }
-
- gzp_pairing_enabled_f = enable;
-
- gzll_rx_start();
- }
-}
-
-void gzp_host_execute()
-{
- bool gzp_packet_received = false;
- uint32_t payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
- uint8_t rx_payload[NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH];
-
- gzp_address_exchanged_f = false;
-
- if (nrf_gzll_get_rx_fifo_packet_count(GZP_PAIRING_PIPE) > 0)
- {
- gzp_packet_received = nrf_gzll_fetch_packet_from_rx_fifo(GZP_PAIRING_PIPE, rx_payload, &payload_length);
- }
-
- if (!gzp_packet_received && (gzp_encrypted_user_data_length == 0))
- {
- if (nrf_gzll_get_rx_fifo_packet_count(GZP_DATA_PIPE) > 0)
- {
- gzp_packet_received = nrf_gzll_fetch_packet_from_rx_fifo(GZP_DATA_PIPE, rx_payload, &payload_length);
- }
- }
-
- if (gzp_packet_received)
- {
- //lint -save -esym(644,rx_payload) //may not have been initialized
- switch (rx_payload[0])
- {
- case GZP_CMD_HOST_ADDRESS_REQ:
- gzp_process_address_req(rx_payload);
- break;
-
- #ifndef GZP_CRYPT_DISABLE
-
- case GZP_CMD_HOST_ID_REQ:
- gzp_process_id_req(rx_payload);
- break;
- case GZP_CMD_HOST_ID_FETCH:
- gzp_process_id_fetch(rx_payload);
- break;
- case GZP_CMD_KEY_UPDATE_PREPARE:
- gzp_process_key_update_prepare();
- break;
- case GZP_CMD_KEY_UPDATE:
- gzp_process_key_update(rx_payload);
- break;
- case GZP_CMD_ENCRYPTED_USER_DATA:
- gzp_process_encrypted_user_data(rx_payload, payload_length);
- break;
-
- #endif
-
- case GZP_CMD_FETCH_RESP:
- default:
- break;
- }
- }
-
- // Restart reception if "not proximity backoff" period has elapsed
- if (!nrf_gzll_is_enabled())
- {
- gzll_set_rx_timeout(0);
-
- if (gzp_pairing_enabled_f)
- {
- (void)nrf_gzll_set_rx_pipes_enabled(nrf_gzll_get_rx_pipes_enabled() | (1 << GZP_PAIRING_PIPE));
- }
-
- gzll_rx_start();
- }
-
- #ifndef GZP_CRYPT_DISABLE
- gzp_session_counter_inc();
- #endif
-}
-
-void gzll_rx_start(void)
-{
- if (nrf_gzll_get_mode() != NRF_GZLL_MODE_HOST)
- {
- gzll_goto_idle();
- (void)nrf_gzll_set_mode(NRF_GZLL_MODE_HOST);
- }
-
- if (!nrf_gzll_is_enabled())
- {
- (void)nrf_gzll_enable();
- }
-}
-
-bool gzp_id_req_received()
-{
- return (gzp_id_req_stat != GZP_ID_REQ_IDLE);
-}
-
-void gzp_id_req_reject()
-{
- if (gzp_id_req_received())
- {
- gzp_id_req_stat = GZP_ID_REQ_PENDING_AND_REJECTED;
- }
-}
-
-void gzp_id_req_grant()
-{
- if (gzp_id_req_received())
- {
- gzp_id_req_stat = GZP_ID_REQ_PENDING_AND_GRANTED;
- }
-}
-
-void gzp_id_req_cancel()
-{
- if (gzp_id_req_received())
- {
- gzp_id_req_stat = GZP_ID_REQ_IDLE;
- }
-}
-
-//-----------------------------------------------------------------------------
-// Implementation: Static functions
-//-----------------------------------------------------------------------------
-
-static void gzp_process_address_req(uint8_t* gzp_req)
-{
- uint8_t temp_rx_pipes;
- uint8_t pairing_resp[GZP_CMD_HOST_ADDRESS_RESP_PAYLOAD_LENGTH];
- uint32_t rx_payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
-
- gzp_address_exchanged_f = false;
-
- gzll_goto_idle();
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- temp_rx_pipes = nrf_gzll_get_rx_pipes_enabled();
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- // If requesting Device within close proximity
- if (prev_gzp_rx_info.rssi >= GZP_HOST_RX_POWER_THRESHOLD)
- {
- (void)nrf_gzll_set_rx_pipes_enabled(0);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- gzll_set_rx_timeout(GZP_CLOSE_PROXIMITY_BACKOFF_RX_TIMEOUT);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- gzll_rx_fifo_flush();
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- // Start "proximity" back off period
- gzll_rx_start();
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-
- while (nrf_gzll_is_enabled())
- {}
-
- // Build pairing response packet
- pairing_resp[0] = (uint8_t)GZP_CMD_HOST_ADDRESS_RESP;
- gzp_host_chip_id_read(&pairing_resp[GZP_CMD_HOST_ADDRESS_RESP_ADDRESS], GZP_SYSTEM_ADDRESS_WIDTH);
-
- (void)nrf_gzll_add_packet_to_tx_fifo(0, &pairing_resp[0], GZP_CMD_HOST_ADDRESS_RESP_PAYLOAD_LENGTH);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
- gzll_set_rx_timeout(GZP_STEP1_RX_TIMEOUT);
-
- // Enable only pairing pipe when waiting for pairing request step 1
- (void)nrf_gzll_set_rx_pipes_enabled((1 << GZP_PAIRING_PIPE));
-
- gzll_rx_start();
-
- while (nrf_gzll_is_enabled())
- {
- if (nrf_gzll_get_rx_fifo_packet_count(GZP_PAIRING_PIPE))
- {
- (void)nrf_gzll_fetch_packet_from_rx_fifo(GZP_PAIRING_PIPE, &gzp_req[0], &rx_payload_length);
-
- // Validate step 1 of pairing request
- if (gzp_req[0] == (uint8_t)GZP_CMD_HOST_ADDRESS_FETCH)
- {
- gzp_address_exchanged_f = true;
- }
- }
- }
-
- gzll_tx_fifo_flush();
- gzll_rx_fifo_flush();
-
- gzll_set_rx_timeout(0);
-
- (void)nrf_gzll_set_rx_pipes_enabled(temp_rx_pipes);
-
- // Return to normal operation
- gzll_rx_start();
- }
- else
- {
- (void)nrf_gzll_set_rx_pipes_enabled(temp_rx_pipes & ~(1 << GZP_PAIRING_PIPE));
-
- gzll_set_rx_timeout(GZP_NOT_PROXIMITY_BACKOFF_RX_TIMEOUT);
-
- // Start "not proximity" backoff period
- gzll_rx_start();
- }
-}
-
-static void gzp_preload_ack(uint8_t* src, uint8_t length, uint8_t pipe)
-{
- gzll_goto_idle();
-
- gzll_tx_fifo_flush();
-
- (void)nrf_gzll_add_packet_to_tx_fifo(pipe, src, length);
-
- gzll_rx_start();
-}
-
-static void gzll_set_rx_timeout(uint32_t timeout)
-{
- timeout *= 2; // * 2 as gzll_set_rx_timeout() takes RX_PERIODS as input, which equals 2 timeslots.
- nrf_gzll_set_auto_disable(timeout);
-}
-
-bool gzp_address_exchanged()
-{
- return gzp_address_exchanged_f;
-}
-
-#ifndef GZP_CRYPT_DISABLE
-
-bool gzp_crypt_user_data_received()
-{
- return (gzp_encrypted_user_data_length > 0);
-}
-
-bool gzp_crypt_user_data_read(uint8_t* dst, uint8_t* length)
-{
- if (gzp_encrypted_user_data_length > 0)
- {
- memcpy(dst, (void*)gzp_encrypted_user_data, gzp_encrypted_user_data_length);
-
- if (length != NULL)
- {
- *length = gzp_encrypted_user_data_length;
- }
- gzp_encrypted_user_data_length = 0;
-
- return true;
- }
- else
- {
- return false;
- }
-}
-
-static void gzp_session_counter_inc()
-{
- uint8_t i;
-
- for (i = 0; i < GZP_SESSION_TOKEN_LENGTH; i++)
- {
- gzp_session_counter[i]++;
- if (gzp_session_counter[i] != 0)
- {
- break;
- }
- }
-}
-
-static void gzp_get_session_counter(uint8_t* dst)
-{
- memcpy(dst, (void*)gzp_session_counter, GZP_SESSION_TOKEN_LENGTH);
-}
-
-static void gzp_set_host_id(const uint8_t* src)
-{
- if (*((uint8_t*)GZP_PARAMS_STORAGE_ADR) == 0xff)
- {
- nrf_nvmc_write_bytes(GZP_PARAMS_STORAGE_ADR + 1, src, GZP_HOST_ID_LENGTH);
- nrf_nvmc_write_byte(GZP_PARAMS_STORAGE_ADR, 0x00);
- }
-}
-
-void gzp_get_host_id(uint8_t *dst)
-{
- memcpy(dst, (uint8_t*)GZP_PARAMS_STORAGE_ADR + 1, GZP_HOST_ID_LENGTH);
-}
-
-static void gzp_process_id_req(uint8_t* rx_payload)
-{
- int i;
- uint8_t temp_host_id[GZP_HOST_ID_LENGTH];
-
- if (gzp_pairing_enabled_f)
- {
- if (!gzp_id_req_received())
- {
- gzp_crypt_set_session_token(&rx_payload[GZP_CMD_HOST_ID_REQ_SESSION_TOKEN]);
- gzp_id_req_stat = GZP_ID_REQ_PENDING;
- }
-
- gzp_get_host_id(temp_host_id);
-
- // Added:
- for (i = 0; i < GZP_HOST_ID_LENGTH; i++)
- {
- if (temp_host_id[i] != 0xFF)
- {
- break;
- }
- }
-
- if (i == GZP_HOST_ID_LENGTH) // If host not generated yet
- {
- gzp_get_session_counter(temp_host_id);
-
-#if (GZP_HOST_ID_LENGTH > GZP_SESSION_TOKEN_LENGTH)
- gzp_xor_cipher(temp_host_id, temp_host_id, &rx_payload[GZP_CMD_HOST_ID_REQ_SESSION_TOKEN], GZP_SESSION_TOKEN_LENGTH);
-#else //(GZP_HOST_ID_LENGTH > GZP_SESSION_TOKEN_LENGTH)
- gzp_xor_cipher(temp_host_id, temp_host_id, &rx_payload[GZP_CMD_HOST_ID_REQ_SESSION_TOKEN], GZP_HOST_ID_LENGTH);
-#endif //(GZP_HOST_ID_LENGTH > GZP_SESSION_TOKEN_LENGTH)
-
- gzp_set_host_id(temp_host_id);
- }
- }
-}
-
-static void gzp_process_id_fetch(uint8_t* rx_payload)
-{
- uint8_t tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH];
-
- if (gzp_id_req_received())
- {
- gzp_crypt_select_key(GZP_ID_EXCHANGE);
- gzp_crypt(&rx_payload[1], &rx_payload[1], GZP_CMD_HOST_ID_FETCH_PAYLOAD_LENGTH - 1);
- if (gzp_validate_id(&rx_payload[GZP_CMD_HOST_ID_FETCH_VALIDATION_ID]))
- {
- switch (gzp_id_req_stat)
- {
- case GZP_ID_REQ_PENDING_AND_GRANTED:
- tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_STATUS] = (uint8_t)GZP_ID_RESP_GRANTED;
- gzp_get_host_id(&tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_HOST_ID]);
- gzp_id_req_stat = GZP_ID_REQ_IDLE;
- break;
- case GZP_ID_REQ_PENDING_AND_REJECTED:
- tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_STATUS] = (uint8_t)GZP_ID_RESP_REJECTED;
- gzp_id_req_stat = GZP_ID_REQ_IDLE;
- break;
- case GZP_ID_REQ_PENDING:
- default:
- tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_STATUS] = (uint8_t)GZP_ID_RESP_PENDING;
- break;
- }
-
- tx_payload[0] = (uint8_t)GZP_CMD_HOST_ID_FETCH_RESP;
- gzp_add_validation_id(&tx_payload[GZP_CMD_HOST_ID_FETCH_RESP_VALIDATION_ID]);
- gzp_crypt(&tx_payload[1], &tx_payload[1], GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH - 1);
-
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
- gzp_preload_ack(tx_payload, GZP_CMD_HOST_ID_FETCH_RESP_PAYLOAD_LENGTH, GZP_DATA_PIPE);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
- }
- }
-}
-
-static void gzp_process_key_update_prepare()
-{
- uint8_t tx_payload[GZP_CMD_KEY_UPDATE_PREPARE_RESP_PAYLOAD_LENGTH];
-
- tx_payload[0] = (uint8_t)GZP_CMD_KEY_UPDATE_PREPARE_RESP;
-
- gzp_get_session_counter(&tx_payload[GZP_CMD_KEY_UPDATE_PREPARE_RESP_SESSION_TOKEN]);
-
- // Update session token if no ID request is pending
- if (!gzp_id_req_received())
- {
- gzp_crypt_set_session_token(&tx_payload[GZP_CMD_KEY_UPDATE_PREPARE_RESP_SESSION_TOKEN]);
- }
-
- gzp_preload_ack(tx_payload, GZP_CMD_KEY_UPDATE_PREPARE_RESP_PAYLOAD_LENGTH, GZP_DATA_PIPE);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-}
-
-static void gzp_process_key_update(uint8_t* rx_payload)
-{
- gzp_crypt_select_key(GZP_KEY_EXCHANGE);
- gzp_crypt(&rx_payload[1], &rx_payload[1], GZP_CMD_KEY_UPDATE_PAYLOAD_LENGTH - 1);
- if (gzp_validate_id(&rx_payload[GZP_CMD_KEY_UPDATE_VALIDATION_ID]))
- {
- gzp_crypt_set_dyn_key(&rx_payload[GZP_CMD_KEY_UPDATE_NEW_KEY]);
- }
-}
-
-static void gzp_process_encrypted_user_data(uint8_t* rx_payload, uint8_t length)
-{
- uint8_t tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_PAYLOAD_LENGTH];
-
- if (gzp_id_req_received())
- {
- gzp_crypt_select_key(GZP_ID_EXCHANGE);
- }
- else
- {
- gzp_crypt_select_key(GZP_DATA_EXCHANGE);
- }
-
- gzp_crypt(&rx_payload[1], &rx_payload[1], length - 1);
- if (gzp_validate_id(&rx_payload[GZP_CMD_ENCRYPTED_USER_DATA_VALIDATION_ID]))
- {
- gzp_encrypted_user_data_length = length - GZP_ENCRYPTED_USER_DATA_PACKET_OVERHEAD;
- memcpy((void*)gzp_encrypted_user_data, &rx_payload[GZP_CMD_ENCRYPTED_USER_DATA_PAYLOAD], gzp_encrypted_user_data_length);
- }
-
- // Build response packet
- tx_payload[0] = (uint8_t)GZP_CMD_ENCRYPTED_USER_DATA_RESP;
- gzp_add_validation_id(&tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID]);
- gzp_crypt(&tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID], &tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_VALIDATION_ID], GZP_VALIDATION_ID_LENGTH);
- gzp_get_session_counter(&tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_SESSION_TOKEN]);
-
- // Update "session token" only if no ID request is pending
- if (!gzp_id_req_received())
- {
- gzp_crypt_set_session_token(&tx_payload[GZP_CMD_ENCRYPTED_USER_DATA_RESP_SESSION_TOKEN]);
- }
-
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
- gzp_preload_ack(tx_payload, GZP_CMD_ENCRYPTED_USER_DATA_RESP_PAYLOAD_LENGTH, GZP_DATA_PIPE);
- ASSERT(nrf_gzll_get_error_code() == NRF_GZLL_ERROR_CODE_NO_ERROR);
-}
-
-//-----------------------------------------------------------------------------
-// Function added during LE1 -> nRF51 port
-//-----------------------------------------------------------------------------
-
-static void gzll_goto_idle()
-{
- nrf_gzll_disable();
- while (nrf_gzll_is_enabled())
- {}
-}
-
-static void gzll_tx_fifo_flush(void)
-{
- int i;
-
- for (i = 0; i < NRF_GZLL_CONST_PIPE_COUNT; i++)
- {
- (void)nrf_gzll_flush_tx_fifo(i);
- }
-}
-
-static void gzll_rx_fifo_flush(void)
-{
- int i;
-
- for (i = 0; i < NRF_GZLL_CONST_PIPE_COUNT; i++)
- {
- (void)nrf_gzll_flush_rx_fifo(i);
- }
-}
-
-
-/******************************************************************************/
-// Implementation: Gazell callback functions
-/******************************************************************************/
-
-void nrf_gzll_device_tx_failed(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
-{
-}
-
-
-void nrf_gzll_device_tx_success(uint32_t pipe, nrf_gzll_device_tx_info_t tx_info)
-{
-}
-
-
-void nrf_gzll_disabled(void)
-{
-}
-
-
-void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info)
-{
- if (pipe == GZP_PAIRING_PIPE)
- {
- prev_gzp_rx_info = rx_info;
- }
-}
-
-/** @} */
-/** @} */
-
-#endif
diff --git a/components/proprietary_rf/gzll/nrf_gzp_host_nrf5x.c b/components/proprietary_rf/gzll/nrf_gzp_host_nrf5x.c
deleted file mode 100644
index 2c17777..0000000
--- a/components/proprietary_rf/gzll/nrf_gzp_host_nrf5x.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Copyright (c) 2009 - 2017, Nordic Semiconductor ASA
- *
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form, except as embedded into a Nordic
- * Semiconductor ASA integrated circuit in a product or a software update for
- * such product, must reproduce the above copyright notice, this list of
- * conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * 4. This software, with or without modification, must only be used with a
- * Nordic Semiconductor ASA integrated circuit.
- *
- * 5. Any software provided in binary form under this license must not be reverse
- * engineered, decompiled, modified and/or disassembled.
- *
- * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#include "nrf_gzp.h"
-#include "nrf_nvmc.h"
-
-/**
- * @file
- * @brief Implementation of Gazell Pairing Library (gzp), nRF5x specific Host functions.
- * @defgroup gzp_source_host_nrf5x Gazell Pairing Host nRF5x specific implementation
- * @{
- * @ingroup gzp_04_source
- */
-
-
-void gzp_host_chip_id_read(uint8_t *dst, uint8_t n)
-{
- uint8_t i;
- uint8_t random_number;
-
- if ( *((uint8_t*)(GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 1)) == 0xff)
- {
- nrf_nvmc_write_byte((GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 1) , 0x00);
-
- for (i = 0; i < n; i++)
- {
- gzp_random_numbers_generate(&random_number, 1);
- nrf_nvmc_write_byte((GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 2 + i) , random_number);
- }
- }
-
- for (i = 0; i < n; i++)
- {
- *(dst++) = *((uint8_t*)(GZP_PARAMS_STORAGE_ADR + GZP_HOST_ID_LENGTH + 2 + i));
- }
-}
-
-/** @} */