From 365cb3c5d0d50c71e7b543b18529f1ffc510f0ba Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Sun, 26 Jul 2020 22:12:41 +0100 Subject: [PATCH] remove generic, TPPs, nested namespaces --- .astyleignore | 3 +- .../BlueNrgMsHCIDriver.cpp | 18 +- .../FEATURE_BLE/.gitignore | 0 .../FEATURE_BLE/.mbedignore | 0 .../FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md | 0 .../FEATURE_BLE/LICENSE | 0 .../FEATURE_BLE/README.md | 0 .../FEATURE_BLE/apache-2.0.txt | 0 .../FEATURE_BLE/ble.doxyfile | 0 .../cordio}/TARGET_CORDIO/README.md | 0 .../TESTS/cordio_hci/driver/main.cpp | 0 .../TESTS/cordio_hci/transport/main.cpp | 12 +- .../TARGET_CORDIO/doc/HCIAbstraction.md | 0 .../cordio}/TARGET_CORDIO/doc/PortingGuide.md | 12 +- .../doc/resources/architecture.png | Bin .../doc/resources/architecture_layer.png | Bin .../TARGET_CORDIO/driver/CordioHCIDriver.cpp | 10 +- .../TARGET_CORDIO/driver/CordioHCIDriver.h | 7 +- .../driver/CordioHCITransportDriver.cpp | 4 - .../driver/CordioHCITransportDriver.h | 4 - .../driver/H4TransportDriver.cpp | 4 - .../TARGET_CORDIO/driver/H4TransportDriver.h | 4 - .../cordio}/TARGET_CORDIO/mbed_lib.json | 0 .../stack/ble-host/include/att_api.h | 0 .../stack/ble-host/include/att_defs.h | 0 .../stack/ble-host/include/att_handler.h | 0 .../stack/ble-host/include/att_uuid.h | 0 .../stack/ble-host/include/dm_api.h | 0 .../stack/ble-host/include/dm_handler.h | 0 .../stack/ble-host/include/eatt_api.h | 0 .../stack/ble-host/include/hci_api.h | 0 .../stack/ble-host/include/hci_cmd.h | 0 .../stack/ble-host/include/hci_core.h | 0 .../stack/ble-host/include/hci_drv.h | 0 .../stack/ble-host/include/hci_evt.h | 0 .../stack/ble-host/include/hci_handler.h | 0 .../stack/ble-host/include/hci_tr.h | 0 .../stack/ble-host/include/l2c_api.h | 0 .../stack/ble-host/include/l2c_defs.h | 0 .../stack/ble-host/include/l2c_handler.h | 0 .../stack/ble-host/include/sec_api.h | 0 .../stack/ble-host/include/smp_api.h | 0 .../stack/ble-host/include/smp_defs.h | 0 .../stack/ble-host/include/smp_handler.h | 0 .../stack/ble-host/include/svc_core.h | 0 .../ble-host/sources/hci/common/hci_core.c | 0 .../ble-host/sources/hci/dual_chip/hci_cmd.c | 0 .../sources/hci/dual_chip/hci_cmd_ae.c | 0 .../sources/hci/dual_chip/hci_cmd_bis.c | 0 .../sources/hci/dual_chip/hci_cmd_cis.c | 0 .../sources/hci/dual_chip/hci_cmd_cte.c | 0 .../sources/hci/dual_chip/hci_cmd_iso.c | 0 .../sources/hci/dual_chip/hci_cmd_past.c | 0 .../sources/hci/dual_chip/hci_cmd_phy.c | 0 .../sources/hci/dual_chip/hci_core_ps.c | 0 .../sources/hci/dual_chip/hci_core_ps.h | 0 .../ble-host/sources/hci/dual_chip/hci_evt.c | 0 .../sources/hci/dual_chip/hci_vs_ae.c | 0 .../ble-host/sources/sec/common/sec_aes.c | 0 .../ble-host/sources/sec/common/sec_aes_rev.c | 0 .../ble-host/sources/sec/common/sec_ccm_hci.c | 0 .../sources/sec/common/sec_cmac_hci.c | 0 .../sources/sec/common/sec_ecc_debug.c | 0 .../ble-host/sources/sec/common/sec_ecc_hci.c | 0 .../ble-host/sources/sec/common/sec_main.c | 0 .../ble-host/sources/sec/common/sec_main.h | 0 .../ble-host/sources/stack/att/att_eatt.c | 0 .../ble-host/sources/stack/att/att_eatt.h | 0 .../ble-host/sources/stack/att/att_main.c | 0 .../ble-host/sources/stack/att/att_main.h | 0 .../ble-host/sources/stack/att/att_sign.h | 0 .../ble-host/sources/stack/att/att_uuid.c | 0 .../ble-host/sources/stack/att/attc_disc.c | 0 .../ble-host/sources/stack/att/attc_eatt.c | 0 .../ble-host/sources/stack/att/attc_main.c | 0 .../ble-host/sources/stack/att/attc_main.h | 0 .../ble-host/sources/stack/att/attc_proc.c | 0 .../ble-host/sources/stack/att/attc_read.c | 0 .../ble-host/sources/stack/att/attc_sign.c | 0 .../ble-host/sources/stack/att/attc_write.c | 0 .../ble-host/sources/stack/att/atts_ccc.c | 0 .../ble-host/sources/stack/att/atts_csf.c | 0 .../ble-host/sources/stack/att/atts_dyn.c | 0 .../ble-host/sources/stack/att/atts_eatt.c | 0 .../ble-host/sources/stack/att/atts_ind.c | 0 .../ble-host/sources/stack/att/atts_main.c | 0 .../ble-host/sources/stack/att/atts_main.h | 0 .../ble-host/sources/stack/att/atts_proc.c | 0 .../ble-host/sources/stack/att/atts_read.c | 0 .../ble-host/sources/stack/att/atts_sign.c | 0 .../ble-host/sources/stack/att/atts_write.c | 0 .../ble-host/sources/stack/cfg/cfg_stack.c | 0 .../ble-host/sources/stack/cfg/cfg_stack.h | 0 .../stack/ble-host/sources/stack/dm/dm_adv.c | 0 .../stack/ble-host/sources/stack/dm/dm_adv.h | 0 .../ble-host/sources/stack/dm/dm_adv_ae.c | 0 .../ble-host/sources/stack/dm/dm_adv_leg.c | 0 .../ble-host/sources/stack/dm/dm_bis_master.c | 0 .../ble-host/sources/stack/dm/dm_bis_slave.c | 0 .../stack/ble-host/sources/stack/dm/dm_cis.c | 0 .../stack/ble-host/sources/stack/dm/dm_cis.h | 0 .../ble-host/sources/stack/dm/dm_cis_master.c | 0 .../ble-host/sources/stack/dm/dm_cis_slave.c | 0 .../ble-host/sources/stack/dm/dm_cis_sm.c | 0 .../stack/ble-host/sources/stack/dm/dm_conn.c | 0 .../stack/ble-host/sources/stack/dm/dm_conn.h | 0 .../ble-host/sources/stack/dm/dm_conn_cte.c | 0 .../sources/stack/dm/dm_conn_master.c | 0 .../sources/stack/dm/dm_conn_master_ae.c | 0 .../sources/stack/dm/dm_conn_master_leg.c | 0 .../ble-host/sources/stack/dm/dm_conn_slave.c | 0 .../sources/stack/dm/dm_conn_slave_ae.c | 0 .../sources/stack/dm/dm_conn_slave_leg.c | 0 .../ble-host/sources/stack/dm/dm_conn_sm.c | 0 .../stack/ble-host/sources/stack/dm/dm_dev.c | 0 .../stack/ble-host/sources/stack/dm/dm_dev.h | 0 .../ble-host/sources/stack/dm/dm_dev_priv.c | 0 .../stack/ble-host/sources/stack/dm/dm_iso.c | 0 .../stack/ble-host/sources/stack/dm/dm_main.c | 0 .../stack/ble-host/sources/stack/dm/dm_main.h | 0 .../stack/ble-host/sources/stack/dm/dm_past.c | 0 .../stack/ble-host/sources/stack/dm/dm_phy.c | 0 .../stack/ble-host/sources/stack/dm/dm_phy.h | 0 .../stack/ble-host/sources/stack/dm/dm_priv.c | 0 .../stack/ble-host/sources/stack/dm/dm_priv.h | 0 .../stack/ble-host/sources/stack/dm/dm_scan.c | 0 .../stack/ble-host/sources/stack/dm/dm_scan.h | 0 .../ble-host/sources/stack/dm/dm_scan_ae.c | 0 .../ble-host/sources/stack/dm/dm_scan_leg.c | 0 .../stack/ble-host/sources/stack/dm/dm_sec.c | 0 .../stack/ble-host/sources/stack/dm/dm_sec.h | 0 .../ble-host/sources/stack/dm/dm_sec_lesc.c | 0 .../ble-host/sources/stack/dm/dm_sec_master.c | 0 .../ble-host/sources/stack/dm/dm_sec_slave.c | 0 .../ble-host/sources/stack/dm/dm_sync_ae.c | 0 .../ble-host/sources/stack/hci/hci_main.c | 0 .../ble-host/sources/stack/hci/hci_main.h | 0 .../ble-host/sources/stack/l2c/l2c_coc.c | 0 .../ble-host/sources/stack/l2c/l2c_main.c | 0 .../ble-host/sources/stack/l2c/l2c_main.h | 0 .../ble-host/sources/stack/l2c/l2c_master.c | 0 .../ble-host/sources/stack/l2c/l2c_slave.c | 0 .../ble-host/sources/stack/smp/smp_act.c | 0 .../stack/ble-host/sources/stack/smp/smp_db.c | 0 .../ble-host/sources/stack/smp/smp_main.c | 0 .../ble-host/sources/stack/smp/smp_main.h | 0 .../ble-host/sources/stack/smp/smp_non.c | 0 .../ble-host/sources/stack/smp/smp_sc_act.c | 0 .../ble-host/sources/stack/smp/smp_sc_main.c | 0 .../ble-host/sources/stack/smp/smp_sc_main.h | 0 .../ble-host/sources/stack/smp/smpi_act.c | 0 .../ble-host/sources/stack/smp/smpi_main.h | 0 .../ble-host/sources/stack/smp/smpi_sc_act.c | 0 .../ble-host/sources/stack/smp/smpi_sc_sm.c | 0 .../ble-host/sources/stack/smp/smpi_sm.c | 0 .../ble-host/sources/stack/smp/smpr_act.c | 0 .../ble-host/sources/stack/smp/smpr_main.h | 0 .../ble-host/sources/stack/smp/smpr_sc_act.c | 0 .../ble-host/sources/stack/smp/smpr_sc_sm.c | 0 .../ble-host/sources/stack/smp/smpr_sm.c | 0 .../stack/platform/include/pal_bb.h | 0 .../stack/platform/include/pal_bb_154.h | 0 .../stack/platform/include/pal_bb_ble.h | 0 .../platform/include/pal_bb_ble_tester.h | 0 .../stack/platform/include/pal_btn.h | 0 .../stack/platform/include/pal_cfg.h | 0 .../stack/platform/include/pal_codec.h | 0 .../stack/platform/include/pal_crypto.h | 0 .../stack/platform/include/pal_flash.h | 0 .../stack/platform/include/pal_i2s.h | 0 .../stack/platform/include/pal_io_exp.h | 0 .../stack/platform/include/pal_led.h | 0 .../stack/platform/include/pal_radio.h | 0 .../stack/platform/include/pal_radio2.h | 0 .../stack/platform/include/pal_rtc.h | 0 .../stack/platform/include/pal_spi.h | 0 .../stack/platform/include/pal_sys.h | 0 .../stack/platform/include/pal_timer.h | 0 .../stack/platform/include/pal_twi.h | 0 .../stack/platform/include/pal_types.h | 0 .../stack/platform/include/pal_uart.h | 0 .../stack/wsf/include/hci_defs.h | 0 .../TARGET_CORDIO/stack/wsf/include/ll_defs.h | 0 .../stack/wsf/include/util/bda.h | 0 .../stack/wsf/include/util/bstream.h | 0 .../stack/wsf/include/util/calc128.h | 0 .../stack/wsf/include/util/crc32.h | 0 .../stack/wsf/include/util/fcs.h | 0 .../stack/wsf/include/util/prand.h | 0 .../stack/wsf/include/util/print.h | 0 .../stack/wsf/include/util/terminal.h | 0 .../stack/wsf/include/util/wstr.h | 0 .../stack/wsf/include/wsf_assert.h | 0 .../TARGET_CORDIO/stack/wsf/include/wsf_buf.h | 0 .../stack/wsf/include/wsf_bufio.h | 0 .../TARGET_CORDIO/stack/wsf/include/wsf_cs.h | 0 .../stack/wsf/include/wsf_detoken.h | 0 .../TARGET_CORDIO/stack/wsf/include/wsf_efs.h | 0 .../stack/wsf/include/wsf_heap.h | 0 .../stack/wsf/include/wsf_math.h | 0 .../TARGET_CORDIO/stack/wsf/include/wsf_msg.h | 0 .../TARGET_CORDIO/stack/wsf/include/wsf_os.h | 0 .../stack/wsf/include/wsf_queue.h | 0 .../stack/wsf/include/wsf_timer.h | 0 .../stack/wsf/include/wsf_trace.h | 2 +- .../stack/wsf/include/wsf_types.h | 0 .../wsf/sources/port/baremetal/wsf_assert.c | 0 .../wsf/sources/port/baremetal/wsf_buf.c | 0 .../wsf/sources/port/baremetal/wsf_bufio.c | 0 .../wsf/sources/port/baremetal/wsf_detoken.c | 0 .../wsf/sources/port/baremetal/wsf_efs.c | 0 .../wsf/sources/port/baremetal/wsf_heap.c | 0 .../wsf/sources/port/baremetal/wsf_msg.c | 0 .../wsf/sources/port/baremetal/wsf_queue.c | 0 .../wsf/sources/port/baremetal/wsf_timer.c | 0 .../wsf/sources/port/baremetal/wsf_trace.c | 0 .../stack/wsf/sources/util/bda.c | 0 .../stack/wsf/sources/util/bstream.c | 0 .../stack/wsf/sources/util/calc128.c | 0 .../stack/wsf/sources/util/crc32.c | 0 .../stack/wsf/sources/util/fcs.c | 0 .../stack/wsf/sources/util/prand.c | 0 .../stack/wsf/sources/util/print.c | 0 .../stack/wsf/sources/util/terminal.c | 0 .../stack/wsf/sources/util/wstr.c | 0 .../stack_adaptation/hci_mbed_os_adaptation.h | 0 .../TARGET_CORDIO/stack_adaptation/hci_tr.c | 0 .../TARGET_CORDIO/stack_adaptation/hci_vs.c | 0 .../pal_mbed_os_adaptation.cpp | 0 .../TARGET_CORDIO/stack_adaptation/wsf_cs.c | 0 .../stack_adaptation/wsf_mbed_os_adaptation.c | 0 .../stack_adaptation/wsf_mbed_os_adaptation.h | 0 .../TARGET_CORDIO/stack_adaptation/wsf_os.c | 0 .../cordio}/TARGET_CORDIO_LL/README.md | 0 .../cordio}/TARGET_CORDIO_LL/mbed_lib.json | 0 .../stack/controller/cordio_link_readme.md | 0 .../stack/controller/include/ble/bb_ble_api.h | 0 .../controller/include/ble/bb_ble_api_op.h | 0 .../include/ble/bb_ble_api_pdufilt.h | 0 .../include/ble/bb_ble_api_periodiclist.h | 0 .../include/ble/bb_ble_api_reslist.h | 0 .../include/ble/bb_ble_api_whitelist.h | 0 .../include/ble/bb_ble_sniffer_api.h | 0 .../stack/controller/include/ble/lhci_api.h | 0 .../stack/controller/include/ble/ll_api.h | 0 .../controller/include/ble/ll_init_api.h | 0 .../stack/controller/include/ble/ll_math.h | 0 .../controller/include/ble/sch_api_ble.h | 0 .../stack/controller/include/common/bb_api.h | 0 .../stack/controller/include/common/cfg_mac.h | 0 .../controller/include/common/cfg_mac_ble.h | 0 .../controller/include/common/chci_api.h | 0 .../stack/controller/include/common/chci_tr.h | 0 .../stack/controller/include/common/sch_api.h | 0 .../sources/ble/bb/bb_ble_adv_master.c | 0 .../sources/ble/bb/bb_ble_adv_master_ae.c | 0 .../sources/ble/bb/bb_ble_adv_slave.c | 0 .../sources/ble/bb/bb_ble_adv_slave_ae.c | 0 .../sources/ble/bb/bb_ble_bis_master.c | 0 .../sources/ble/bb/bb_ble_bis_slave.c | 0 .../controller/sources/ble/bb/bb_ble_cis.c | 0 .../sources/ble/bb/bb_ble_cis_master.c | 0 .../sources/ble/bb/bb_ble_cis_slave.c | 0 .../controller/sources/ble/bb/bb_ble_conn.c | 0 .../sources/ble/bb/bb_ble_conn_master.c | 0 .../sources/ble/bb/bb_ble_conn_slave.c | 0 .../controller/sources/ble/bb/bb_ble_dtm.c | 0 .../controller/sources/ble/bb/bb_ble_int.h | 0 .../controller/sources/ble/bb/bb_ble_main.c | 0 .../sources/ble/bb/bb_ble_pdufilt.c | 0 .../sources/ble/bb/bb_ble_periodiclist.c | 0 .../sources/ble/bb/bb_ble_reslist.c | 0 .../sources/ble/bb/bb_ble_sniffer.c | 0 .../sources/ble/bb/bb_ble_whitelist.c | 0 .../controller/sources/ble/include/lctr_api.h | 0 .../sources/ble/include/lctr_api_adv_acad.h | 0 .../sources/ble/include/lctr_api_adv_master.h | 0 .../ble/include/lctr_api_adv_master_ae.h | 0 .../sources/ble/include/lctr_api_adv_slave.h | 0 .../ble/include/lctr_api_adv_slave_ae.h | 0 .../sources/ble/include/lctr_api_bis_master.h | 0 .../sources/ble/include/lctr_api_bis_slave.h | 0 .../sources/ble/include/lctr_api_cis.h | 0 .../sources/ble/include/lctr_api_cis_master.h | 0 .../sources/ble/include/lctr_api_cis_slave.h | 0 .../sources/ble/include/lctr_api_conn.h | 0 .../sources/ble/include/lctr_api_conn_cs2.h | 0 .../ble/include/lctr_api_init_master.h | 0 .../ble/include/lctr_api_init_master_ae.h | 0 .../sources/ble/include/lctr_api_iso.h | 0 .../sources/ble/include/lctr_api_pc.h | 0 .../sources/ble/include/lctr_api_phy.h | 0 .../sources/ble/include/lctr_api_priv.h | 0 .../sources/ble/include/lctr_api_sc.h | 0 .../controller/sources/ble/include/lmgr_api.h | 0 .../sources/ble/include/lmgr_api_adv_master.h | 0 .../ble/include/lmgr_api_adv_master_ae.h | 0 .../sources/ble/include/lmgr_api_adv_slave.h | 0 .../ble/include/lmgr_api_adv_slave_ae.h | 0 .../sources/ble/include/lmgr_api_cis_master.h | 0 .../sources/ble/include/lmgr_api_cis_slave.h | 0 .../sources/ble/include/lmgr_api_conn.h | 0 .../sources/ble/include/lmgr_api_iso.h | 0 .../sources/ble/include/lmgr_api_priv.h | 0 .../sources/ble/include/lmgr_api_sc.h | 0 .../stack/controller/sources/ble/init/init.c | 0 .../controller/sources/ble/init/init_ctr.c | 0 .../sources/ble/lctr/lctr_act_adv_master.c | 0 .../sources/ble/lctr/lctr_act_adv_master_ae.c | 0 .../sources/ble/lctr/lctr_act_adv_slave.c | 0 .../sources/ble/lctr/lctr_act_adv_slave_ae.c | 0 .../sources/ble/lctr/lctr_act_bis_master.c | 0 .../sources/ble/lctr/lctr_act_bis_slave.c | 0 .../sources/ble/lctr/lctr_act_cis.c | 0 .../sources/ble/lctr/lctr_act_cis_master.c | 0 .../sources/ble/lctr/lctr_act_cis_slave.c | 0 .../sources/ble/lctr/lctr_act_conn.c | 0 .../sources/ble/lctr/lctr_act_conn_master.c | 0 .../ble/lctr/lctr_act_conn_master_ae.c | 0 .../sources/ble/lctr/lctr_act_conn_past.c | 0 .../sources/ble/lctr/lctr_act_enc.c | 0 .../sources/ble/lctr/lctr_act_enc_master.c | 0 .../sources/ble/lctr/lctr_act_init_master.c | 0 .../ble/lctr/lctr_act_init_master_ae.c | 0 .../controller/sources/ble/lctr/lctr_act_pc.c | 0 .../sources/ble/lctr/lctr_act_phy.c | 0 .../controller/sources/ble/lctr/lctr_int.h | 0 .../sources/ble/lctr/lctr_int_adv_ae.h | 0 .../sources/ble/lctr/lctr_int_adv_master.h | 0 .../sources/ble/lctr/lctr_int_adv_master_ae.h | 0 .../sources/ble/lctr/lctr_int_adv_slave.h | 0 .../sources/ble/lctr/lctr_int_adv_slave_ae.h | 0 .../sources/ble/lctr/lctr_int_bis.h | 0 .../sources/ble/lctr/lctr_int_bis_master.h | 0 .../sources/ble/lctr/lctr_int_bis_slave.h | 0 .../sources/ble/lctr/lctr_int_cis.h | 0 .../sources/ble/lctr/lctr_int_cis_master.h | 0 .../sources/ble/lctr/lctr_int_cis_slave.h | 0 .../sources/ble/lctr/lctr_int_conn.h | 0 .../sources/ble/lctr/lctr_int_conn_master.h | 0 .../sources/ble/lctr/lctr_int_conn_slave.h | 0 .../sources/ble/lctr/lctr_int_enc_master.h | 0 .../sources/ble/lctr/lctr_int_enc_slave.h | 0 .../sources/ble/lctr/lctr_int_init_master.h | 0 .../ble/lctr/lctr_int_init_master_ae.h | 0 .../sources/ble/lctr/lctr_int_iso.h | 0 .../sources/ble/lctr/lctr_int_master_phy.h | 0 .../controller/sources/ble/lctr/lctr_int_pc.h | 0 .../sources/ble/lctr/lctr_int_priv.h | 0 .../sources/ble/lctr/lctr_int_slave_phy.h | 0 .../sources/ble/lctr/lctr_isr_adv_master.c | 0 .../sources/ble/lctr/lctr_isr_adv_master_ae.c | 0 .../sources/ble/lctr/lctr_isr_adv_slave.c | 0 .../sources/ble/lctr/lctr_isr_adv_slave_ae.c | 0 .../sources/ble/lctr/lctr_isr_bis_master.c | 0 .../sources/ble/lctr/lctr_isr_bis_slave.c | 0 .../sources/ble/lctr/lctr_isr_cis.c | 0 .../sources/ble/lctr/lctr_isr_cis_master.c | 0 .../sources/ble/lctr/lctr_isr_cis_slave.c | 0 .../sources/ble/lctr/lctr_isr_conn.c | 0 .../sources/ble/lctr/lctr_isr_conn_master.c | 0 .../sources/ble/lctr/lctr_isr_conn_slave.c | 0 .../sources/ble/lctr/lctr_isr_init_master.c | 0 .../ble/lctr/lctr_isr_init_master_ae.c | 0 .../controller/sources/ble/lctr/lctr_main.c | 0 .../sources/ble/lctr/lctr_main_adv_master.c | 0 .../ble/lctr/lctr_main_adv_master_ae.c | 0 .../sources/ble/lctr/lctr_main_adv_slave.c | 0 .../sources/ble/lctr/lctr_main_adv_slave_ae.c | 0 .../sources/ble/lctr/lctr_main_bis.c | 0 .../sources/ble/lctr/lctr_main_bis_master.c | 0 .../sources/ble/lctr/lctr_main_bis_slave.c | 0 .../sources/ble/lctr/lctr_main_cis.c | 0 .../sources/ble/lctr/lctr_main_cis_master.c | 0 .../sources/ble/lctr/lctr_main_cis_slave.c | 0 .../sources/ble/lctr/lctr_main_conn.c | 0 .../sources/ble/lctr/lctr_main_conn_cs2.c | 0 .../sources/ble/lctr/lctr_main_conn_data.c | 0 .../sources/ble/lctr/lctr_main_conn_master.c | 0 .../sources/ble/lctr/lctr_main_conn_slave.c | 0 .../sources/ble/lctr/lctr_main_enc_master.c | 0 .../sources/ble/lctr/lctr_main_enc_slave.c | 0 .../sources/ble/lctr/lctr_main_init_master.c | 0 .../ble/lctr/lctr_main_init_master_ae.c | 0 .../sources/ble/lctr/lctr_main_iso.c | 0 .../sources/ble/lctr/lctr_main_iso_data.c | 0 .../sources/ble/lctr/lctr_main_master_phy.c | 0 .../sources/ble/lctr/lctr_main_past.c | 0 .../sources/ble/lctr/lctr_main_pc.c | 0 .../sources/ble/lctr/lctr_main_priv.c | 0 .../sources/ble/lctr/lctr_main_sc.c | 0 .../sources/ble/lctr/lctr_main_slave_phy.c | 0 .../sources/ble/lctr/lctr_pdu_adv.h | 0 .../sources/ble/lctr/lctr_pdu_adv_ae.h | 0 .../sources/ble/lctr/lctr_pdu_adv_master_ae.c | 0 .../sources/ble/lctr/lctr_pdu_adv_slave.c | 0 .../sources/ble/lctr/lctr_pdu_adv_slave_ae.c | 0 .../sources/ble/lctr/lctr_pdu_bis.c | 0 .../sources/ble/lctr/lctr_pdu_conn.c | 0 .../sources/ble/lctr/lctr_pdu_conn.h | 0 .../sources/ble/lctr/lctr_pdu_enc.c | 0 .../sources/ble/lctr/lctr_pdu_iso.c | 0 .../sources/ble/lctr/lctr_pdu_iso.h | 0 .../sources/ble/lctr/lctr_sm_adv_master.c | 0 .../sources/ble/lctr/lctr_sm_adv_master_ae.c | 0 .../sources/ble/lctr/lctr_sm_adv_slave.c | 0 .../sources/ble/lctr/lctr_sm_adv_slave_ae.c | 0 .../sources/ble/lctr/lctr_sm_bis_master.c | 0 .../sources/ble/lctr/lctr_sm_bis_slave.c | 0 .../controller/sources/ble/lctr/lctr_sm_cis.c | 0 .../sources/ble/lctr/lctr_sm_conn_master.c | 0 .../sources/ble/lctr/lctr_sm_conn_slave.c | 0 .../sources/ble/lctr/lctr_sm_init_master.c | 0 .../sources/ble/lctr/lctr_sm_init_master_ae.c | 0 .../sources/ble/lctr/lctr_sm_llcp_cis.c | 0 .../ble/lctr/lctr_sm_llcp_cis_master.c | 0 .../sources/ble/lctr/lctr_sm_llcp_cis_slave.c | 0 .../sources/ble/lctr/lctr_sm_llcp_conn.c | 0 .../ble/lctr/lctr_sm_llcp_conn_master.c | 0 .../ble/lctr/lctr_sm_llcp_conn_slave.c | 0 .../ble/lctr/lctr_sm_llcp_enc_master.c | 0 .../sources/ble/lctr/lctr_sm_llcp_enc_slave.c | 0 .../ble/lctr/lctr_sm_llcp_master_phy.c | 0 .../sources/ble/lctr/lctr_sm_llcp_pc.c | 0 .../sources/ble/lctr/lctr_sm_llcp_slave_phy.c | 0 .../controller/sources/ble/lhci/lhci_cmd.c | 0 .../sources/ble/lhci/lhci_cmd_adv_master.c | 0 .../sources/ble/lhci/lhci_cmd_adv_master_ae.c | 0 .../sources/ble/lhci/lhci_cmd_adv_priv.c | 0 .../sources/ble/lhci/lhci_cmd_adv_slave.c | 0 .../sources/ble/lhci/lhci_cmd_adv_slave_ae.c | 0 .../sources/ble/lhci/lhci_cmd_bis_master.c | 0 .../sources/ble/lhci/lhci_cmd_bis_slave.c | 0 .../sources/ble/lhci/lhci_cmd_cis_master.c | 0 .../sources/ble/lhci/lhci_cmd_cis_slave.c | 0 .../sources/ble/lhci/lhci_cmd_conn.c | 0 .../sources/ble/lhci/lhci_cmd_conn_master.c | 0 .../ble/lhci/lhci_cmd_conn_master_ae.c | 0 .../sources/ble/lhci/lhci_cmd_conn_priv.c | 0 .../sources/ble/lhci/lhci_cmd_enc_master.c | 0 .../sources/ble/lhci/lhci_cmd_enc_slave.c | 0 .../sources/ble/lhci/lhci_cmd_iso.c | 0 .../sources/ble/lhci/lhci_cmd_past.c | 0 .../controller/sources/ble/lhci/lhci_cmd_pc.c | 0 .../sources/ble/lhci/lhci_cmd_phy.c | 0 .../controller/sources/ble/lhci/lhci_cmd_sc.c | 0 .../controller/sources/ble/lhci/lhci_cmd_vs.c | 0 .../sources/ble/lhci/lhci_cmd_vs_adv_master.c | 0 .../ble/lhci/lhci_cmd_vs_adv_master_ae.c | 0 .../sources/ble/lhci/lhci_cmd_vs_adv_slave.c | 0 .../ble/lhci/lhci_cmd_vs_adv_slave_ae.c | 0 .../sources/ble/lhci/lhci_cmd_vs_conn.c | 0 .../ble/lhci/lhci_cmd_vs_conn_master.c | 0 .../sources/ble/lhci/lhci_cmd_vs_enc_slave.c | 0 .../sources/ble/lhci/lhci_cmd_vs_iso.c | 0 .../sources/ble/lhci/lhci_cmd_vs_sc.c | 0 .../controller/sources/ble/lhci/lhci_evt.c | 0 .../sources/ble/lhci/lhci_evt_adv_master.c | 0 .../sources/ble/lhci/lhci_evt_adv_master_ae.c | 0 .../sources/ble/lhci/lhci_evt_adv_slave.c | 0 .../sources/ble/lhci/lhci_evt_adv_slave_ae.c | 0 .../sources/ble/lhci/lhci_evt_bis_master.c | 0 .../sources/ble/lhci/lhci_evt_bis_slave.c | 0 .../sources/ble/lhci/lhci_evt_cis_master.c | 0 .../sources/ble/lhci/lhci_evt_cis_slave.c | 0 .../sources/ble/lhci/lhci_evt_conn.c | 0 .../sources/ble/lhci/lhci_evt_conn_cs2.c | 0 .../sources/ble/lhci/lhci_evt_conn_master.c | 0 .../sources/ble/lhci/lhci_evt_conn_priv.c | 0 .../sources/ble/lhci/lhci_evt_enc_master.c | 0 .../sources/ble/lhci/lhci_evt_enc_slave.c | 0 .../sources/ble/lhci/lhci_evt_iso.c | 0 .../controller/sources/ble/lhci/lhci_evt_pc.c | 0 .../sources/ble/lhci/lhci_evt_phy.c | 0 .../controller/sources/ble/lhci/lhci_evt_sc.c | 0 .../controller/sources/ble/lhci/lhci_evt_vs.c | 0 .../controller/sources/ble/lhci/lhci_init.c | 0 .../sources/ble/lhci/lhci_init_adv_master.c | 0 .../ble/lhci/lhci_init_adv_master_ae.c | 0 .../sources/ble/lhci/lhci_init_adv_priv.c | 0 .../sources/ble/lhci/lhci_init_adv_slave.c | 0 .../sources/ble/lhci/lhci_init_adv_slave_ae.c | 0 .../sources/ble/lhci/lhci_init_bis_master.c | 0 .../sources/ble/lhci/lhci_init_bis_slave.c | 0 .../sources/ble/lhci/lhci_init_cis_master.c | 0 .../sources/ble/lhci/lhci_init_cis_slave.c | 0 .../sources/ble/lhci/lhci_init_conn.c | 0 .../sources/ble/lhci/lhci_init_conn_cs2.c | 0 .../sources/ble/lhci/lhci_init_conn_master.c | 0 .../ble/lhci/lhci_init_conn_master_ae.c | 0 .../sources/ble/lhci/lhci_init_conn_priv.c | 0 .../sources/ble/lhci/lhci_init_enc_master.c | 0 .../sources/ble/lhci/lhci_init_enc_slave.c | 0 .../sources/ble/lhci/lhci_init_iso.c | 0 .../sources/ble/lhci/lhci_init_past.c | 0 .../sources/ble/lhci/lhci_init_pc.c | 0 .../sources/ble/lhci/lhci_init_phy.c | 0 .../sources/ble/lhci/lhci_init_sc.c | 0 .../controller/sources/ble/lhci/lhci_int.h | 0 .../controller/sources/ble/lhci/lhci_main.c | 0 .../sources/ble/lhci/lhci_main_iso.c | 0 .../stack/controller/sources/ble/ll/ll_init.c | 0 .../sources/ble/ll/ll_init_adv_master.c | 0 .../sources/ble/ll/ll_init_adv_master_ae.c | 0 .../sources/ble/ll/ll_init_adv_slave.c | 0 .../sources/ble/ll/ll_init_adv_slave_ae.c | 0 .../sources/ble/ll/ll_init_bis_master.c | 0 .../sources/ble/ll/ll_init_bis_slave.c | 0 .../sources/ble/ll/ll_init_cis_master.c | 0 .../sources/ble/ll/ll_init_cis_slave.c | 0 .../sources/ble/ll/ll_init_conn_cs2.c | 0 .../sources/ble/ll/ll_init_conn_master.c | 0 .../sources/ble/ll/ll_init_conn_slave.c | 0 .../sources/ble/ll/ll_init_enc_master.c | 0 .../sources/ble/ll/ll_init_enc_slave.c | 0 .../sources/ble/ll/ll_init_init_master.c | 0 .../sources/ble/ll/ll_init_init_master_ae.c | 0 .../controller/sources/ble/ll/ll_init_iso.c | 0 .../sources/ble/ll/ll_init_master_phy.c | 0 .../controller/sources/ble/ll/ll_init_past.c | 0 .../controller/sources/ble/ll/ll_init_pc.c | 0 .../controller/sources/ble/ll/ll_init_priv.c | 0 .../controller/sources/ble/ll/ll_init_sc.c | 0 .../sources/ble/ll/ll_init_slave_phy.c | 0 .../stack/controller/sources/ble/ll/ll_main.c | 0 .../sources/ble/ll/ll_main_adv_master.c | 0 .../sources/ble/ll/ll_main_adv_master_ae.c | 0 .../sources/ble/ll/ll_main_adv_slave.c | 0 .../sources/ble/ll/ll_main_adv_slave_ae.c | 0 .../sources/ble/ll/ll_main_bis_master.c | 0 .../sources/ble/ll/ll_main_bis_slave.c | 0 .../sources/ble/ll/ll_main_cis_master.c | 0 .../sources/ble/ll/ll_main_cis_slave.c | 0 .../controller/sources/ble/ll/ll_main_conn.c | 0 .../sources/ble/ll/ll_main_conn_master.c | 0 .../sources/ble/ll/ll_main_conn_master_ae.c | 0 .../sources/ble/ll/ll_main_conn_slave.c | 0 .../controller/sources/ble/ll/ll_main_diag.c | 0 .../controller/sources/ble/ll/ll_main_dtm.c | 0 .../sources/ble/ll/ll_main_enc_master.c | 0 .../sources/ble/ll/ll_main_enc_slave.c | 0 .../controller/sources/ble/ll/ll_main_iso.c | 0 .../controller/sources/ble/ll/ll_main_past.c | 0 .../controller/sources/ble/ll/ll_main_pc.c | 0 .../controller/sources/ble/ll/ll_main_phy.c | 0 .../controller/sources/ble/ll/ll_main_priv.c | 0 .../controller/sources/ble/ll/ll_main_sc.c | 0 .../stack/controller/sources/ble/ll/ll_math.c | 0 .../controller/sources/ble/lmgr/lmgr_events.c | 0 .../controller/sources/ble/lmgr/lmgr_main.c | 0 .../ble/lmgr/lmgr_main_adv_master_ae.c | 0 .../sources/ble/lmgr/lmgr_main_adv_slave_ae.c | 0 .../sources/ble/lmgr/lmgr_main_cis_master.c | 0 .../sources/ble/lmgr/lmgr_main_conn.c | 0 .../sources/ble/lmgr/lmgr_main_iso.c | 0 .../sources/ble/lmgr/lmgr_main_master.c | 0 .../sources/ble/lmgr/lmgr_main_priv.c | 0 .../sources/ble/lmgr/lmgr_main_sc.c | 0 .../sources/ble/lmgr/lmgr_main_slave.c | 0 .../controller/sources/ble/sch/sch_ble.c | 0 .../controller/sources/ble/sch/sch_int_rm.h | 0 .../controller/sources/ble/sch/sch_int_tm.h | 0 .../stack/controller/sources/ble/sch/sch_rm.c | 0 .../stack/controller/sources/ble/sch/sch_tm.c | 0 .../controller/sources/common/bb/bb_int.h | 0 .../controller/sources/common/bb/bb_main.c | 0 .../controller/sources/common/chci/chci_tr.c | 0 .../controller/sources/common/sch/sch_int.h | 0 .../controller/sources/common/sch/sch_list.c | 0 .../controller/sources/common/sch/sch_main.c | 0 .../components/boards/arduino_primo.h | 0 .../nordic-bsp/components/boards/boards.c | 0 .../nordic-bsp/components/boards/boards.h | 0 .../components/boards/d52_starterkit.h | 0 .../components/boards/n5_starterkit.h | 0 .../nordic-bsp/components/boards/nrf6310.h | 0 .../nordic-bsp/components/boards/pca10000.h | 0 .../nordic-bsp/components/boards/pca10001.h | 0 .../nordic-bsp/components/boards/pca10003.h | 0 .../nordic-bsp/components/boards/pca10028.h | 0 .../nordic-bsp/components/boards/pca10031.h | 0 .../nordic-bsp/components/boards/pca10036.h | 0 .../nordic-bsp/components/boards/pca10040.h | 0 .../nordic-bsp/components/boards/pca10056.h | 0 .../nordic-bsp/components/boards/pca10059.h | 0 .../nordic-bsp/components/boards/pca10100.h | 0 .../nordic-bsp/components/boards/pca20006.h | 0 .../nordic-bsp/components/boards/pca20020.h | 0 .../nordic-bsp/components/boards/wt51822.h | 0 .../stack/thirdparty/uecc/LICENSE.txt | 0 .../stack/thirdparty/uecc/README.txt | 0 .../stack/thirdparty/uecc/asm_arm.inc | 0 .../stack/thirdparty/uecc/uECC.c | 0 .../stack/thirdparty/uecc/uECC.h | 0 .../stack/thirdparty/uecc/uECC_ll.c | 0 .../stack/thirdparty/uecc/uECC_ll.h | 0 .../stack_adaptation/custom_chci_tr.cpp | 0 .../stack_adaptation/custom_chci_tr.h | 0 .../FEATURE_BLE/include}/ble/BLE.h | 59 +- .../FEATURE_BLE/include/ble}/Gap.h | 256 +---- .../FEATURE_BLE/include}/ble/GattClient.h | 245 ++--- .../FEATURE_BLE/include}/ble/GattServer.h | 366 ++----- .../include}/ble/SecurityManager.h | 306 +++--- .../FEATURE_BLE/include/ble/gap/Gap.h | 19 +- .../include/ble/internal}/BLEInstanceBase.h | 35 +- .../include/ble/internal}/FileSecurityDb.h | 9 +- .../internal}/FunctionPointerWithContext.h | 6 +- .../include/ble/internal}/KVStoreSecurityDb.h | 7 +- .../include/ble/internal}/MemorySecurityDb.h | 6 +- .../include/ble/internal}/SecurityDb.h | 14 +- .../internal/cordio/CordioBLEInstanceBase.h | 61 +- .../include/ble/internal/cordio/CordioGap.h | 603 ++++++++++++ .../ble/internal/cordio/CordioGattClient.h | 242 +++++ .../ble/internal/cordio/CordioGattServer.h | 388 ++++++++ .../ble/internal/cordio}/CordioPalAttClient.h | 352 +++---- .../ble/internal/cordio/CordioPalEventQueue.h | 26 +- .../ble/internal/cordio}/CordioPalGap.h | 166 ++-- .../ble/internal/cordio/CordioPalGattClient.h | 265 ++++++ .../cordio/CordioPalGenericAccessService.h | 61 ++ .../cordio}/CordioPalSecurityManager.h | 177 ++-- .../internal/cordio/CordioPalSigningMonitor.h | 28 +- .../internal/cordio/CordioSecurityManager.h | 619 ++++++++++++ .../ble/internal}/pal/AttServerMessage.h | 10 +- .../include/ble/internal}/pal/GapEvents.h | 12 +- .../include/ble/internal}/pal/GapTypes.h | 11 +- .../include/ble/internal/pal/PalAttClient.h | 328 +++---- .../ble/internal/pal/PalConnectionMonitor.h | 44 +- .../include/ble/internal/pal/PalEventQueue.h | 14 +- .../include/ble/internal}/pal/PalGap.h | 604 +++--------- .../include/ble/internal}/pal/PalGattClient.h | 211 +--- .../internal/pal/PalGenericAccessService.h | 29 +- .../ble/internal}/pal/PalSecurityManager.h | 436 +++------ .../ble/internal/pal/PalSigningMonitor.h | 47 +- .../internal/pal/PalSimpleAttServerMessage.h | 48 +- .../include}/ble/services/BatteryService.h | 7 +- .../ble/services/DeviceInformationService.h | 6 +- .../ble/services/EnvironmentalService.h | 6 +- .../ble/services/HealthThermometerService.h | 6 +- .../include}/ble/services/HeartRateService.h | 6 +- .../include}/ble/services/LinkLossService.h | 6 +- .../FEATURE_BLE/include/ble/types}/BLERoles.h | 18 + .../FEATURE_BLE/include/ble/types}/BLETypes.h | 18 +- .../FEATURE_BLE/include/ble/types}/Bounded.h | 4 +- .../CallChainOfFunctionPointersWithContext.h | 5 +- .../CharacteristicDescriptorDiscovery.h | 4 +- .../ble/types}/DiscoveredCharacteristic.h | 62 +- .../DiscoveredCharacteristicDescriptor.h | 34 +- .../include/ble/types}/DiscoveredService.h | 8 +- .../FEATURE_BLE/include/ble/types}/Duration.h | 4 +- .../include/ble/types}/GattAttribute.h | 8 +- .../ble/types}/GattCallbackParamTypes.h | 34 +- .../include/ble/types}/GattCharacteristic.h | 12 +- .../include/ble/types}/GattServerEvents.h | 4 +- .../include/ble/types}/GattService.h | 10 +- .../FEATURE_BLE/include/ble/types}/SafeBool.h | 4 +- .../FEATURE_BLE/include/ble/types}/SafeEnum.h | 4 +- .../include/ble/types}/ServiceDiscovery.h | 9 +- .../FEATURE_BLE/include/ble/types}/UUID.h | 6 +- .../include/ble/types}/blecommon.h | 4 +- .../ble/types}/gap/AdvertisingDataBuilder.h | 15 +- .../ble/types}/gap/AdvertisingDataParser.h | 8 +- .../types}/gap/AdvertisingDataSimpleBuilder.h | 9 +- .../ble/types}/gap/AdvertisingDataTypes.h | 6 +- .../ble/types}/gap/AdvertisingParameters.h | 14 +- .../ble/types}/gap/ConnectionParameters.h | 9 +- .../include/ble/types}/gap/Events.h | 10 +- .../include/ble/types}/gap/ScanParameters.h | 15 +- .../include/ble/types}/gap/Types.h | 10 +- .../FEATURE_BLE/mbed_lib.json | 12 +- .../FEATURE_BLE/source/BLE.cpp | 99 +- .../FEATURE_BLE/source/BLEInstanceBase.cpp | 6 +- .../source/DiscoveredCharacteristic.cpp | 38 +- .../FEATURE_BLE/source}/FileSecurityDb.cpp | 24 +- .../FEATURE_BLE/source}/KVStoreSecurityDb.cpp | 6 +- .../source/cordio/CordioBLEInstanceBase.cpp | 154 ++- .../FEATURE_BLE/source/cordio/CordioGap.cpp | 730 +++++++------- .../source/cordio/CordioGattClient.cpp | 502 ++++++---- .../source/cordio}/CordioGattServer.cpp | 251 ++++- .../source/cordio/CordioPalAttClient.cpp | 424 +++++++++ .../source/cordio/CordioPalGap.cpp | 295 +++--- .../source/cordio/CordioPalGattClient.cpp | 233 +++++ .../cordio/CordioPalGenericAccessService.cpp | 121 +++ .../cordio/CordioPalSecurityManager.cpp | 276 +++--- .../source/cordio/CordioPalSigningMonitor.cpp | 34 + .../source/cordio/CordioSecurityManager.cpp | 455 ++++----- .../source/gap/AdvertisingDataBuilder.cpp | 16 +- .../source/gap/AdvertisingParameters.cpp | 2 +- .../source/gap/ConnectionParameters.cpp | 0 .../CyH4TransportDriver.cpp | 0 .../COMPONENT_CYW43XXX/CyH4TransportDriver.h | 2 +- .../ble}/COMPONENT_CYW43XXX/HCIDriver.cpp | 12 +- .../TARGET_PSOC6/cy_bt_cordio_cfg.cpp | 2 +- .../w_bt_firmware_controller.c | 0 .../w_bt_firmware_controller.c | 0 .../w_bt_firmware_controller.c | 0 .../w_bt_firmware_controller.c | 0 .../drivers/ble}/TARGET_CY8C63XX/Psoc6BLE.cpp | 6 +- .../drivers/IPCPipeTransportDriver.cpp | 2 +- .../drivers/IPCPipeTransportDriver.h | 2 +- .../TARGET_MCU_NRF52840/mbed_lib.json | 0 .../TARGET_NRF5x/NRFCordioHCIDriver.cpp | 9 +- .../TARGET_NRF5x/NRFCordioHCIDriver.h | 13 +- .../NRFCordioHCITransportDriver.cpp | 8 +- .../NRFCordioHCITransportDriver.h | 7 +- .../TARGET_NRF5x/README.md | 0 .../TARGET_NRF5x/mbed_lib.json | 0 .../TARGET_NRF5x/stack/sources/pal_bb.c | 0 .../TARGET_NRF5x/stack/sources/pal_bb_ble.c | 0 .../stack/sources/pal_bb_ble_rf.c | 0 .../TARGET_NRF5x/stack/sources/pal_cfg.c | 0 .../TARGET_NRF5x/stack/sources/pal_crypto.c | 2 +- .../TARGET_NRF5x/stack/sources/pal_timer.c | 0 .../drivers/ble}/TARGET_STM32WB/HCIDriver.cpp | 22 +- .../TARGET_STM32WB/STM32Cube_FW/mbox_def.h | 0 .../ble}/TARGET_STM32WB/STM32Cube_FW/shci.c | 0 .../ble}/TARGET_STM32WB/STM32Cube_FW/shci.h | 0 .../TARGET_STM32WB/STM32Cube_FW/shci_tl.c | 0 .../TARGET_STM32WB/STM32Cube_FW/shci_tl.h | 0 .../STM32Cube_FW/stm32_wpan_common.h | 0 .../TARGET_STM32WB/STM32Cube_FW/stm_list.c | 0 .../TARGET_STM32WB/STM32Cube_FW/stm_list.h | 0 .../ble}/TARGET_STM32WB/STM32Cube_FW/tl.h | 0 .../TARGET_STM32WB/STM32Cube_FW/tl_mbox.c | 0 .../drivers/ble}/TARGET_STM32WB/hw_ipcc.c | 0 features/FEATURE_BLE/CHANGELOG.md | 393 -------- features/FEATURE_BLE/CONTRIBUTING.md | 7 - .../FEATURE_BLE/ble/common/StaticInterface.h | 55 -- features/FEATURE_BLE/ble/generic/GenericGap.h | 669 ------------- .../ble/generic/GenericGattClient.h | 191 ---- .../ble/generic/GenericSecurityManager.h | 795 ---------------- .../ble/pal/AttClientToGattClientAdapter.h | 298 ------ features/FEATURE_BLE/ble/pal/Deprecated.h | 41 - features/FEATURE_BLE/source/GattClient.tpp | 245 ----- features/FEATURE_BLE/source/GattServer.tpp | 209 ---- .../FEATURE_BLE/source/SecurityManager.tpp | 456 --------- features/FEATURE_BLE/source/gap/Gap.tpp | 898 ------------------ .../TARGET_CORDIO/BleImplementationForward.h | 165 ---- .../targets/TARGET_CORDIO/CordioGattServer.h | 301 ------ .../CordioPalGenericAccessService.h | 124 --- .../TARGET_CORDIO/SigningMonitorProxy.h | 37 - .../source/CordioImplementations.cpp | 122 --- .../source/CordioPalAttClient.cpp | 89 -- 742 files changed, 6118 insertions(+), 9317 deletions(-) rename {features => connectivity}/FEATURE_BLE/.gitignore (100%) rename {features => connectivity}/FEATURE_BLE/.mbedignore (100%) rename {features => connectivity}/FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md (100%) rename {features => connectivity}/FEATURE_BLE/LICENSE (100%) rename {features => connectivity}/FEATURE_BLE/README.md (100%) rename {features => connectivity}/FEATURE_BLE/apache-2.0.txt (100%) rename {features => connectivity}/FEATURE_BLE/ble.doxyfile (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/README.md (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp (96%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/doc/HCIAbstraction.md (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/doc/PortingGuide.md (97%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/doc/resources/architecture.png (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/doc/resources/architecture_layer.png (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/CordioHCIDriver.cpp (98%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/CordioHCIDriver.h (98%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp (94%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/CordioHCITransportDriver.h (96%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/H4TransportDriver.cpp (95%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/driver/H4TransportDriver.h (96%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/mbed_lib.json (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/att_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/att_defs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/att_handler.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/att_uuid.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/dm_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/dm_handler.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/eatt_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_cmd.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_core.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_drv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_evt.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_handler.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/hci_tr.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/l2c_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/l2c_defs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/l2c_handler.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/sec_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/smp_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/smp_defs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/smp_handler.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/include/svc_core.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/common/hci_core.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_bis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_evt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes_rev.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ccm_hci.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_cmac_hci.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_debug.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_hci.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_sign.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_uuid.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_disc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_eatt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_proc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_read.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_sign.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_write.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ccc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_csf.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_dyn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_eatt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ind.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_proc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_read.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_sign.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_cte.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_leg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_lesc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sync_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_coc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_db.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_non.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_main.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_act.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_bb.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_bb_154.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_bb_ble.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_bb_ble_tester.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_btn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_cfg.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_codec.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_crypto.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_flash.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_i2s.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_io_exp.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_led.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_radio.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_radio2.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_rtc.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_spi.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_sys.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_timer.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_twi.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_types.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/platform/include/pal_uart.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/hci_defs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/ll_defs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/bda.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/bstream.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/calc128.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/crc32.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/fcs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/prand.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/print.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/terminal.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/util/wstr.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_assert.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_buf.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_bufio.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_cs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_detoken.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_efs.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_heap.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_math.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_msg.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_os.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_queue.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_timer.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_trace.h (99%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/include/wsf_types.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_assert.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_buf.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_bufio.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_detoken.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_efs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_heap.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_msg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_queue.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_trace.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/bda.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/bstream.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/calc128.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/crc32.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/fcs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/prand.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/print.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/terminal.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack/wsf/sources/util/wstr.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/hci_mbed_os_adaptation.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/hci_tr.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/hci_vs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/wsf_cs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO/stack_adaptation/wsf_os.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/README.md (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/mbed_lib.json (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_pdufilt.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_periodiclist.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_reslist.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_whitelist.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_sniffer_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/lhci_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/ll_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/ll_init_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/ll_math.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/ble/sch_api_ble.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/bb_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac_ble.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/chci_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/chci_tr.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/include/common/sch_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_dtm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_int.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_pdufilt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_periodiclist.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_reslist.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_sniffer.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_whitelist.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_acad.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn_cs2.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_iso.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_pc.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_phy.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_priv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_sc.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_conn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_iso.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_priv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_sc.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init_ctr.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_slave.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_iso.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_master_phy.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_pc.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_priv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_slave_phy.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_data.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso_data.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_master_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_slave_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_ae.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_bis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_enc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_vs.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_int.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_cs2.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_master_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_slave_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_diag.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_dtm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_past.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_pc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_phy.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_math.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_events.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_conn.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_iso.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_master.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_priv.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_sc.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_slave.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_ble.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_rm.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_tm.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_rm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_tm.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_int.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_int.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_list.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_main.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/arduino_primo.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/d52_starterkit.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/n5_starterkit.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/nrf6310.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10000.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10001.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10003.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10028.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10031.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10036.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10040.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10056.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10059.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10100.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20006.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20020.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/wt51822.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/LICENSE.txt (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/README.txt (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/asm_arm.inc (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp (100%) rename {features/FEATURE_BLE/targets => connectivity/FEATURE_BLE/cordio}/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h (100%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/BLE.h (94%) rename {features/FEATURE_BLE/ble/gap => connectivity/FEATURE_BLE/include/ble}/Gap.h (88%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/GattClient.h (83%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/GattServer.h (77%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/SecurityManager.h (89%) rename features/FEATURE_BLE/ble/deprecate.h => connectivity/FEATURE_BLE/include/ble/gap/Gap.h (67%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/BLEInstanceBase.h (91%) rename {features/FEATURE_BLE/ble/generic => connectivity/FEATURE_BLE/include/ble/internal}/FileSecurityDb.h (97%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/FunctionPointerWithContext.h (99%) rename {features/FEATURE_BLE/ble/generic => connectivity/FEATURE_BLE/include/ble/internal}/KVStoreSecurityDb.h (98%) rename {features/FEATURE_BLE/ble/generic => connectivity/FEATURE_BLE/include/ble/internal}/MemorySecurityDb.h (98%) rename {features/FEATURE_BLE/ble/generic => connectivity/FEATURE_BLE/include/ble/internal}/SecurityDb.h (99%) rename features/FEATURE_BLE/targets/TARGET_CORDIO/CordioBLE.h => connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioBLEInstanceBase.h (73%) create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGap.h create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattClient.h create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattServer.h rename {features/FEATURE_BLE/targets/TARGET_CORDIO => connectivity/FEATURE_BLE/include/ble/internal/cordio}/CordioPalAttClient.h (57%) rename features/FEATURE_BLE/targets/TARGET_CORDIO/SimpleEventQueue.h => connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalEventQueue.h (89%) rename {features/FEATURE_BLE/targets/TARGET_CORDIO => connectivity/FEATURE_BLE/include/ble/internal/cordio}/CordioPalGap.h (75%) create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGattClient.h create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGenericAccessService.h rename {features/FEATURE_BLE/targets/TARGET_CORDIO => connectivity/FEATURE_BLE/include/ble/internal/cordio}/CordioPalSecurityManager.h (59%) rename features/FEATURE_BLE/ble/Gap.h => connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSigningMonitor.h (59%) create mode 100644 connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioSecurityManager.h rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/AttServerMessage.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/GapEvents.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/GapTypes.h (99%) rename features/FEATURE_BLE/ble/pal/AttClient.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalAttClient.h (69%) rename features/FEATURE_BLE/ble/pal/ConnectionEventMonitor.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalConnectionMonitor.h (75%) rename features/FEATURE_BLE/ble/pal/EventQueue.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalEventQueue.h (90%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/PalGap.h (82%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/PalGattClient.h (85%) rename features/FEATURE_BLE/ble/pal/GenericAccessService.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalGenericAccessService.h (78%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/internal}/pal/PalSecurityManager.h (78%) rename features/FEATURE_BLE/ble/pal/SigningEventMonitor.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalSigningMonitor.h (64%) rename features/FEATURE_BLE/ble/pal/SimpleAttServerMessage.h => connectivity/FEATURE_BLE/include/ble/internal/pal/PalSimpleAttServerMessage.h (82%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/BatteryService.h (97%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/DeviceInformationService.h (98%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/EnvironmentalService.h (97%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/HealthThermometerService.h (97%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/HeartRateService.h (98%) rename {features/FEATURE_BLE => connectivity/FEATURE_BLE/include}/ble/services/LinkLossService.h (96%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/BLERoles.h (77%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/BLETypes.h (97%) rename {features/FEATURE_BLE/ble/common => connectivity/FEATURE_BLE/include/ble/types}/Bounded.h (96%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/CallChainOfFunctionPointersWithContext.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/CharacteristicDescriptorDiscovery.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/DiscoveredCharacteristic.h (91%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/DiscoveredCharacteristicDescriptor.h (80%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/DiscoveredService.h (97%) rename {features/FEATURE_BLE/ble/common => connectivity/FEATURE_BLE/include/ble/types}/Duration.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/GattAttribute.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/GattCallbackParamTypes.h (92%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/GattCharacteristic.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/GattServerEvents.h (96%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/GattService.h (97%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/SafeBool.h (97%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/SafeEnum.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/ServiceDiscovery.h (97%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/UUID.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/blecommon.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/AdvertisingDataBuilder.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/AdvertisingDataParser.h (94%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/AdvertisingDataSimpleBuilder.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/AdvertisingDataTypes.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/AdvertisingParameters.h (98%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/ConnectionParameters.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/Events.h (99%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/ScanParameters.h (97%) rename {features/FEATURE_BLE/ble => connectivity/FEATURE_BLE/include/ble/types}/gap/Types.h (99%) rename {features => connectivity}/FEATURE_BLE/mbed_lib.json (88%) rename {features => connectivity}/FEATURE_BLE/source/BLE.cpp (71%) rename {features => connectivity}/FEATURE_BLE/source/BLEInstanceBase.cpp (86%) rename {features => connectivity}/FEATURE_BLE/source/DiscoveredCharacteristic.cpp (75%) rename {features/FEATURE_BLE/source/generic => connectivity/FEATURE_BLE/source}/FileSecurityDb.cpp (97%) rename {features/FEATURE_BLE/source/generic => connectivity/FEATURE_BLE/source}/KVStoreSecurityDb.cpp (99%) rename features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp => connectivity/FEATURE_BLE/source/cordio/CordioBLEInstanceBase.cpp (76%) rename features/FEATURE_BLE/source/generic/GenericGap.tpp => connectivity/FEATURE_BLE/source/cordio/CordioGap.cpp (67%) rename features/FEATURE_BLE/source/generic/GenericGattClient.tpp => connectivity/FEATURE_BLE/source/cordio/CordioGattClient.cpp (73%) rename {features/FEATURE_BLE/targets/TARGET_CORDIO/source => connectivity/FEATURE_BLE/source/cordio}/CordioGattServer.cpp (88%) create mode 100644 connectivity/FEATURE_BLE/source/cordio/CordioPalAttClient.cpp rename features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp => connectivity/FEATURE_BLE/source/cordio/CordioPalGap.cpp (85%) create mode 100644 connectivity/FEATURE_BLE/source/cordio/CordioPalGattClient.cpp create mode 100644 connectivity/FEATURE_BLE/source/cordio/CordioPalGenericAccessService.cpp rename features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp => connectivity/FEATURE_BLE/source/cordio/CordioPalSecurityManager.cpp (78%) create mode 100644 connectivity/FEATURE_BLE/source/cordio/CordioPalSigningMonitor.cpp rename features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp => connectivity/FEATURE_BLE/source/cordio/CordioSecurityManager.cpp (70%) rename {features => connectivity}/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp (98%) rename {features => connectivity}/FEATURE_BLE/source/gap/AdvertisingParameters.cpp (95%) rename {features => connectivity}/FEATURE_BLE/source/gap/ConnectionParameters.cpp (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/CyH4TransportDriver.h (98%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/HCIDriver.cpp (98%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp (99%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/w_bt_firmware_controller.c (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/w_bt_firmware_controller.c (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/w_bt_firmware_controller.c (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/w_bt_firmware_controller.c (100%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/TARGET_CY8C63XX/Psoc6BLE.cpp (93%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp (95%) rename {features/FEATURE_BLE/targets/TARGET_Cypress => connectivity/drivers/ble}/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h (95%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp (97%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h (85%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp (89%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h (91%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/README.md (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb.c (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble.c (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble_rf.c (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_cfg.c (100%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c (99%) rename {features/FEATURE_BLE/targets => connectivity/drivers/ble}/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_timer.c (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/HCIDriver.cpp (98%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/mbox_def.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/shci.c (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/shci.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/shci_tl.c (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/shci_tl.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/stm32_wpan_common.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/stm_list.c (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/stm_list.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/tl.h (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/STM32Cube_FW/tl_mbox.c (100%) rename {features/FEATURE_BLE/targets/TARGET_STM => connectivity/drivers/ble}/TARGET_STM32WB/hw_ipcc.c (100%) delete mode 100644 features/FEATURE_BLE/CHANGELOG.md delete mode 100644 features/FEATURE_BLE/CONTRIBUTING.md delete mode 100644 features/FEATURE_BLE/ble/common/StaticInterface.h delete mode 100644 features/FEATURE_BLE/ble/generic/GenericGap.h delete mode 100644 features/FEATURE_BLE/ble/generic/GenericGattClient.h delete mode 100644 features/FEATURE_BLE/ble/generic/GenericSecurityManager.h delete mode 100644 features/FEATURE_BLE/ble/pal/AttClientToGattClientAdapter.h delete mode 100644 features/FEATURE_BLE/ble/pal/Deprecated.h delete mode 100644 features/FEATURE_BLE/source/GattClient.tpp delete mode 100644 features/FEATURE_BLE/source/GattServer.tpp delete mode 100644 features/FEATURE_BLE/source/SecurityManager.tpp delete mode 100644 features/FEATURE_BLE/source/gap/Gap.tpp delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/BleImplementationForward.h delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/SigningMonitorProxy.h delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp delete mode 100644 features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalAttClient.cpp diff --git a/.astyleignore b/.astyleignore index 6c78beb611..c7c694314b 100644 --- a/.astyleignore +++ b/.astyleignore @@ -1,9 +1,10 @@ ^BUILD ^cmsis +^connectivity/drivers/ble +^connectivity/FEATURE_BLE ^connectivity/libraries/mbed-coap ^connectivity/libraries/ppp ^features/cryptocell -^features/FEATURE_BLE ^features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_MBED_PSA_SRV ^features/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM ^features/frameworks diff --git a/components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.cpp b/components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.cpp index a0d3d51252..74e5e7e9cb 100644 --- a/components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.cpp +++ b/components/BLE/COMPONENT_BlueNRG_MS/BlueNrgMsHCIDriver.cpp @@ -27,7 +27,7 @@ #include "platform/mbed_wait_api.h" // FEATURE_BLE/targets/TARGET_CORDIO -#include "CordioBLE.h" +#include "CordioBLEInstanceBase.h" #include "CordioHCIDriver.h" #include "CordioHCITransportDriver.h" #include "hci_api.h" @@ -64,17 +64,17 @@ namespace bluenrg_ms { /** * BlueNRG_MS HCI driver implementation. - * @see cordio::CordioHCIDriver + * @see CordioHCIDriver */ -class HCIDriver : public cordio::CordioHCIDriver { +class HCIDriver : public CordioHCIDriver { public: /** * Construction of the BlueNRG_MS HCIDriver. * @param transport: Transport of the HCI commands. * @param rst: Name of the reset pin */ - HCIDriver(cordio::CordioHCITransportDriver &transport_driver, PinName rst) : - cordio::CordioHCIDriver(transport_driver), rst(rst) { } + HCIDriver(CordioHCITransportDriver &transport_driver, PinName rst) : + CordioHCIDriver(transport_driver), rst(rst) { } /** * @see CordioHCIDriver::do_initialize @@ -87,10 +87,10 @@ public: /** * @see CordioHCIDriver::get_buffer_pool_description */ - ble::vendor::cordio::buf_pool_desc_t get_buffer_pool_description() + ble::buf_pool_desc_t get_buffer_pool_description() { // Use default buffer pool - return ble::vendor::cordio::CordioHCIDriver::get_default_buffer_pool_description(); + return ble::CordioHCIDriver::get_default_buffer_pool_description(); } /** @@ -435,7 +435,7 @@ private: * event from the stack. This might not be the best solution for all BLE chip; * especially this one. */ -class TransportDriver : public cordio::CordioHCITransportDriver { +class TransportDriver : public CordioHCITransportDriver { public: /** * Construct the transport driver required by a BlueNRG_MS module. @@ -607,7 +607,7 @@ exit: /** * Cordio HCI driver factory */ -ble::vendor::cordio::CordioHCIDriver &ble_cordio_get_hci_driver() +ble::CordioHCIDriver &ble_cordio_get_hci_driver() { static ble::vendor::bluenrg_ms::TransportDriver transport_driver( MBED_CONF_BLUENRG_MS_SPI_MOSI, diff --git a/features/FEATURE_BLE/.gitignore b/connectivity/FEATURE_BLE/.gitignore similarity index 100% rename from features/FEATURE_BLE/.gitignore rename to connectivity/FEATURE_BLE/.gitignore diff --git a/features/FEATURE_BLE/.mbedignore b/connectivity/FEATURE_BLE/.mbedignore similarity index 100% rename from features/FEATURE_BLE/.mbedignore rename to connectivity/FEATURE_BLE/.mbedignore diff --git a/features/FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md b/connectivity/FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md similarity index 100% rename from features/FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md rename to connectivity/FEATURE_BLE/DOXYGEN_FRONTPAGE_BLE.md diff --git a/features/FEATURE_BLE/LICENSE b/connectivity/FEATURE_BLE/LICENSE similarity index 100% rename from features/FEATURE_BLE/LICENSE rename to connectivity/FEATURE_BLE/LICENSE diff --git a/features/FEATURE_BLE/README.md b/connectivity/FEATURE_BLE/README.md similarity index 100% rename from features/FEATURE_BLE/README.md rename to connectivity/FEATURE_BLE/README.md diff --git a/features/FEATURE_BLE/apache-2.0.txt b/connectivity/FEATURE_BLE/apache-2.0.txt similarity index 100% rename from features/FEATURE_BLE/apache-2.0.txt rename to connectivity/FEATURE_BLE/apache-2.0.txt diff --git a/features/FEATURE_BLE/ble.doxyfile b/connectivity/FEATURE_BLE/ble.doxyfile similarity index 100% rename from features/FEATURE_BLE/ble.doxyfile rename to connectivity/FEATURE_BLE/ble.doxyfile diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/README.md b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/README.md similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/README.md rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/README.md diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/TESTS/cordio_hci/driver/main.cpp diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp similarity index 96% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp index dff9923a47..f98a3e7f54 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/TESTS/cordio_hci/transport/main.cpp @@ -32,18 +32,16 @@ using namespace utest::v1; -using ble::vendor::cordio::CordioHCIDriver; -using ble::vendor::cordio::CordioHCITransportDriver; +using ble::CordioHCIDriver; +using ble::CordioHCITransportDriver; -extern ble::vendor::cordio::CordioHCIDriver &ble_cordio_get_hci_driver(); +extern ble::CordioHCIDriver &ble_cordio_get_hci_driver(); #if CORDIO_ZERO_COPY_HCI #error [NOT_SUPPORTED] Test not relevant for zero copy hci. #else namespace ble { -namespace vendor { -namespace cordio { struct CordioHCIHook { static CordioHCIDriver &get_driver() @@ -62,11 +60,9 @@ struct CordioHCIHook { } }; -} // namespace cordio -} // namespace vendor } // namespace ble -using ble::vendor::cordio::CordioHCIHook; +using ble::CordioHCIHook; // // Handle signal mechanism diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/doc/HCIAbstraction.md b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/HCIAbstraction.md similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/doc/HCIAbstraction.md rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/HCIAbstraction.md diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/doc/PortingGuide.md b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/PortingGuide.md similarity index 97% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/doc/PortingGuide.md rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/PortingGuide.md index 683cad3dbb..dec8f7077e 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/doc/PortingGuide.md +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/PortingGuide.md @@ -53,7 +53,7 @@ More information about the architecture can be found in [HCI abstraction archite #### HCITransport -**Note:** If the Bluetooth controller uses an H4 communication interface and the host exposes serial flow control in Mbed, you can skip this step. Use the class `ble::vendor::cordio::H4TransportDriver` as the transport driver. +**Note:** If the Bluetooth controller uses an H4 communication interface and the host exposes serial flow control in Mbed, you can skip this step. Use the class `ble::H4TransportDriver` as the transport driver. The transport driver shall inherit publicly from the base class `CordioHCITransportDriver`. @@ -66,7 +66,7 @@ namespace ble { namespace vendor { namespace target_name { -class TransportDriver : public cordio::CordioHCITransportDriver { +class TransportDriver : public CordioHCITransportDriver { public: TransportDriver(/* specific constructor arguments*/); @@ -114,10 +114,10 @@ namespace ble { namespace vendor { namespace target_name { -class HCIDriver : public cordio::CordioHCIDriver { +class HCIDriver : public CordioHCIDriver { public: HCIDriver( - cordio::CordioHCITransportDriver& transport_driver, + CordioHCITransportDriver& transport_driver, /* specific constructor arguments*/ ); @@ -434,13 +434,13 @@ Given that the `CordioBLE` class doesn't know which class constructs the driver This function is in the global namespace, and its signature is: ``` -ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver(); +ble::CordioHCIDriver& ble_cordio_get_hci_driver(); ``` **Example:** ``` -ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() { +ble::CordioHCIDriver& ble_cordio_get_hci_driver() { static ble::vendor::target_name::TransportDriver transport_driver( /* transport parameters */ ); diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/doc/resources/architecture.png b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/resources/architecture.png similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/doc/resources/architecture.png rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/resources/architecture.png diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/doc/resources/architecture_layer.png b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/resources/architecture_layer.png similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/doc/resources/architecture_layer.png rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/doc/resources/architecture_layer.png diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.cpp similarity index 98% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.cpp index 741163cc16..e5648294f0 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.cpp +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.cpp @@ -17,7 +17,9 @@ #include #include -#include "CordioBLE.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" +#include "ble/BLE.h" +#include "ble/Gap.h" #include "CordioHCIDriver.h" #include "hci_api.h" #include "hci_cmd.h" @@ -28,8 +30,6 @@ #define HCI_RESET_RAND_CNT 4 namespace ble { -namespace vendor { -namespace cordio { namespace { @@ -98,7 +98,7 @@ buf_pool_desc_t CordioHCIDriver::get_default_buffer_pool_description() void CordioHCIDriver::set_random_static_address(const ble::address_t& address) { - ble_error_t err = cordio::BLE::deviceInstance().getGap().setRandomStaticAddress(address); + ble_error_t err = CordioBLEInstanceBase::deviceInstance().getGap().setRandomStaticAddress(address); MBED_ASSERT(err == BLE_ERROR_NONE); } @@ -368,6 +368,4 @@ ble_error_t CordioHCIDriver::set_tx_power(int8_t level_db) { return BLE_ERROR_NOT_IMPLEMENTED; } -} // namespace cordio -} // namespace vendor } // namespace ble diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.h similarity index 98% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.h index 3d53103157..f4fe47acec 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCIDriver.h +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCIDriver.h @@ -22,12 +22,10 @@ #include #include "wsf_buf.h" #include "CordioHCITransportDriver.h" -#include "ble/blecommon.h" +#include "ble/types/blecommon.h" #include "mbed.h" namespace ble { -namespace vendor { -namespace cordio { /** * Contain description of the memory pool used by the Cordio stack. @@ -229,9 +227,6 @@ private: CordioHCITransportDriver& _transport_driver; }; - -} // namespace cordio -} // namespace vendor } // namespace ble #endif /* CORDIO_HCI_DRIVER_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp similarity index 94% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp index ba4475b638..b2f27ed16e 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.cpp @@ -23,8 +23,6 @@ extern "C" void hciTrSerialRxIncoming(uint8_t *pBuf, uint8_t len); namespace ble { -namespace vendor { -namespace cordio { CordioHCITransportDriver::data_received_handler_t CordioHCITransportDriver::data_received_handler = hciTrSerialRxIncoming; @@ -44,6 +42,4 @@ void CordioHCITransportDriver::set_data_received_handler(data_received_handler_t data_received_handler = handler; } -} // namespace cordio -} // namespace vendor } // namespace ble diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.h similarity index 96% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.h index f2c9c788f1..d619a76258 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/CordioHCITransportDriver.h +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/CordioHCITransportDriver.h @@ -20,8 +20,6 @@ #include namespace ble { -namespace vendor { -namespace cordio { /** * Base class of the HCI transport driver. @@ -78,8 +76,6 @@ private: static void set_data_received_handler(data_received_handler_t handler); }; -} // namespace cordio -} // namespace vendor } // namespace ble #endif /* CORDIO_HCI_TRANSPORT_DRIVER_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.cpp similarity index 95% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.cpp index 8a61c102ad..c8a40a4b0e 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.cpp +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.cpp @@ -19,8 +19,6 @@ #include "H4TransportDriver.h" namespace ble { -namespace vendor { -namespace cordio { H4TransportDriver::H4TransportDriver(PinName tx, PinName rx, PinName cts, PinName rts, int baud) : uart(tx, rx, baud), cts(cts), rts(rts) { } @@ -69,8 +67,6 @@ void H4TransportDriver::on_controller_irq() } } -} // namespace cordio -} // namespace vendor } // namespace ble #endif diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.h similarity index 96% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.h index 6827d2756d..b52ac18790 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/driver/H4TransportDriver.h +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/driver/H4TransportDriver.h @@ -24,8 +24,6 @@ #include "CordioHCITransportDriver.h" namespace ble { -namespace vendor { -namespace cordio { /** * Implementation of the H4 driver. @@ -76,8 +74,6 @@ private: PinName rts; }; -} // namespace cordio -} // namespace vendor } // namespace ble #endif diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/mbed_lib.json similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/mbed_lib.json diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_defs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_defs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_defs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_defs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_handler.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_handler.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_handler.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_handler.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_uuid.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_uuid.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_uuid.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/att_uuid.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/dm_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/dm_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/dm_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/dm_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/dm_handler.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/dm_handler.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/dm_handler.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/dm_handler.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/eatt_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/eatt_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/eatt_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/eatt_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_cmd.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_cmd.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_cmd.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_cmd.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_core.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_core.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_core.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_core.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_drv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_drv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_drv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_drv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_evt.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_evt.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_evt.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_evt.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_handler.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_handler.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_handler.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_handler.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_tr.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_tr.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/hci_tr.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/hci_tr.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_defs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_defs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_defs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_defs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_handler.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_handler.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/l2c_handler.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/l2c_handler.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/sec_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/sec_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/sec_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/sec_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_defs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_defs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_defs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_defs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_handler.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_handler.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/smp_handler.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/smp_handler.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/svc_core.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/svc_core.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/svc_core.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/include/svc_core.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/common/hci_core.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/common/hci_core.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/common/hci_core.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/common/hci_core.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_bis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_bis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_bis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_bis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_cte.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_cmd_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_core_ps.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_evt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_evt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_evt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_evt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/hci/dual_chip/hci_vs_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes_rev.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes_rev.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes_rev.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_aes_rev.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ccm_hci.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ccm_hci.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ccm_hci.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ccm_hci.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_cmac_hci.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_cmac_hci.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_cmac_hci.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_cmac_hci.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_debug.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_debug.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_debug.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_debug.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_hci.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_hci.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_hci.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_ecc_hci.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/sec/common/sec_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_eatt.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_sign.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_sign.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_sign.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_sign.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_uuid.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_uuid.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_uuid.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/att_uuid.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_disc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_disc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_disc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_disc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_eatt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_eatt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_eatt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_eatt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_proc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_proc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_proc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_proc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_read.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_read.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_read.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_read.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_sign.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_sign.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_sign.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_sign.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_write.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_write.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_write.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/attc_write.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ccc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ccc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ccc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ccc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_csf.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_csf.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_csf.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_csf.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_dyn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_dyn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_dyn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_dyn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_eatt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_eatt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_eatt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_eatt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ind.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ind.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ind.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_ind.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_proc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_proc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_proc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_proc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_read.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_read.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_read.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_read.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_sign.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_sign.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_sign.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_sign.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/cfg/cfg_stack.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_adv_leg.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_cis_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_cte.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_cte.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_cte.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_cte.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_master_leg.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_slave_leg.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_conn_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_dev_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_phy.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_priv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_leg.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_leg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_leg.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_scan_leg.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_lesc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_lesc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_lesc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_lesc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sec_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sync_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sync_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sync_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/dm/dm_sync_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/hci/hci_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_coc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_coc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_coc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_coc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/l2c/l2c_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_db.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_db.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_db.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_db.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_non.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_non.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_non.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_non.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smp_sc_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sc_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpi_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_main.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_main.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_main.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_main.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_act.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_act.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_act.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_act.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sc_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/ble-host/sources/stack/smp/smpr_sm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_154.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_154.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_154.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_154.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_ble.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_ble.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_ble.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_ble.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_ble_tester.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_ble_tester.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_bb_ble_tester.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_bb_ble_tester.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_btn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_btn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_btn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_btn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_cfg.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_cfg.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_cfg.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_cfg.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_codec.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_codec.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_codec.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_codec.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_crypto.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_crypto.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_crypto.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_crypto.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_flash.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_flash.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_flash.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_flash.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_i2s.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_i2s.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_i2s.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_i2s.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_io_exp.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_io_exp.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_io_exp.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_io_exp.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_led.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_led.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_led.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_led.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_radio.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_radio.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_radio.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_radio.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_radio2.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_radio2.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_radio2.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_radio2.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_rtc.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_rtc.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_rtc.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_rtc.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_spi.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_spi.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_spi.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_spi.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_sys.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_sys.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_sys.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_sys.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_timer.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_timer.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_timer.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_timer.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_twi.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_twi.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_twi.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_twi.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_types.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_types.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_types.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_types.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_uart.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_uart.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/platform/include/pal_uart.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/platform/include/pal_uart.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/hci_defs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/hci_defs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/hci_defs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/hci_defs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/ll_defs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/ll_defs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/ll_defs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/ll_defs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/bda.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/bda.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/bda.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/bda.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/bstream.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/bstream.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/bstream.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/bstream.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/calc128.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/calc128.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/calc128.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/calc128.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/crc32.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/crc32.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/crc32.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/crc32.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/fcs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/fcs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/fcs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/fcs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/prand.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/prand.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/prand.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/prand.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/print.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/print.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/print.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/print.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/terminal.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/terminal.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/terminal.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/terminal.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/wstr.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/wstr.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/util/wstr.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/util/wstr.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_assert.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_assert.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_assert.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_assert.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_buf.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_buf.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_buf.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_buf.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_bufio.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_bufio.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_bufio.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_bufio.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_cs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_cs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_cs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_cs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_detoken.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_detoken.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_detoken.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_detoken.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_efs.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_efs.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_efs.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_efs.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_heap.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_heap.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_heap.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_heap.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_math.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_math.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_math.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_math.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_msg.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_msg.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_msg.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_msg.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_os.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_os.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_os.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_os.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_queue.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_queue.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_queue.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_queue.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_timer.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_timer.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_timer.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_timer.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_trace.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_trace.h similarity index 99% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_trace.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_trace.h index c9c7a4370e..3ccf6b8783 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_trace.h +++ b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_trace.h @@ -139,7 +139,7 @@ bool_t WsfTokenService(void); #ifdef TOKEN_GENERATION #define WSF_TOKEN(subsys, stat, msg) \ - __WSF_TOKEN_DEFINE__( \ + __WSF_TOKEN_DEFINE_( \ /* token: */ MODULE_ID, __LINE__, \ /* origin: */ __FILE__, subsys, \ /* message: */ stat, msg) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_types.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_types.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/include/wsf_types.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/include/wsf_types.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_assert.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_assert.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_assert.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_assert.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_buf.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_buf.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_buf.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_buf.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_bufio.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_bufio.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_bufio.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_bufio.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_detoken.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_detoken.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_detoken.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_detoken.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_efs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_efs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_efs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_efs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_heap.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_heap.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_heap.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_heap.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_msg.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_msg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_msg.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_msg.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_queue.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_queue.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_queue.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_queue.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_trace.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_trace.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_trace.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_trace.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/bda.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/bda.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/bda.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/bda.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/bstream.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/bstream.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/bstream.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/bstream.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/calc128.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/calc128.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/calc128.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/calc128.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/crc32.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/crc32.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/crc32.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/crc32.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/fcs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/fcs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/fcs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/fcs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/prand.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/prand.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/prand.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/prand.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/print.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/print.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/print.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/print.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/terminal.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/terminal.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/terminal.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/terminal.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/wstr.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/wstr.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/util/wstr.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack/wsf/sources/util/wstr.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_mbed_os_adaptation.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_mbed_os_adaptation.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_mbed_os_adaptation.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_mbed_os_adaptation.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_tr.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_tr.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_tr.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_vs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_vs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/hci_vs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/hci_vs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_cs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_cs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_cs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_cs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_mbed_os_adaptation.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_os.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_os.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/wsf_os.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO/stack_adaptation/wsf_os.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/README.md b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/README.md similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/README.md rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/README.md diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/mbed_lib.json b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/mbed_lib.json similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/mbed_lib.json rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/mbed_lib.json diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/cordio_link_readme.md diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_op.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_pdufilt.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_pdufilt.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_pdufilt.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_pdufilt.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_periodiclist.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_periodiclist.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_periodiclist.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_periodiclist.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_reslist.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_reslist.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_reslist.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_reslist.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_whitelist.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_whitelist.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_whitelist.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_api_whitelist.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_sniffer_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_sniffer_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_sniffer_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/bb_ble_sniffer_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/lhci_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/lhci_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/lhci_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/lhci_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_init_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_init_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_init_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_init_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_math.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_math.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/ll_math.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/ll_math.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/sch_api_ble.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/sch_api_ble.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/ble/sch_api_ble.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/ble/sch_api_ble.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/bb_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/bb_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/bb_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/bb_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac_ble.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac_ble.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac_ble.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/cfg_mac_ble.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/chci_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/chci_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/chci_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/chci_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/chci_tr.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/chci_tr.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/chci_tr.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/chci_tr.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/sch_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/sch_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/include/common/sch_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/include/common/sch_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_dtm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_dtm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_dtm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_dtm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_int.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_int.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_int.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_int.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_pdufilt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_pdufilt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_pdufilt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_pdufilt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_periodiclist.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_periodiclist.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_periodiclist.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_periodiclist.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_reslist.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_reslist.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_reslist.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_reslist.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_sniffer.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_sniffer.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_sniffer.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_sniffer.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_whitelist.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_whitelist.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_whitelist.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/bb/bb_ble_whitelist.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_acad.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_acad.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_acad.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_acad.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_master_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_adv_slave_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_bis_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_cis_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn_cs2.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn_cs2.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn_cs2.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_conn_cs2.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_init_master_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_iso.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_iso.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_iso.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_iso.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_pc.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_pc.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_pc.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_pc.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_phy.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_phy.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_phy.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_phy.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_priv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_priv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_priv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_priv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_sc.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_sc.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_sc.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lctr_api_sc.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_master_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_adv_slave_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_cis_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_conn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_conn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_conn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_conn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_iso.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_iso.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_iso.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_iso.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_priv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_priv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_priv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_priv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_sc.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_sc.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_sc.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/include/lmgr_api_sc.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init_ctr.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init_ctr.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init_ctr.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/init/init_ctr.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_conn_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_init_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_act_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_master_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_adv_slave_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_bis_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_cis_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_conn_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_slave.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_slave.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_slave.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_enc_slave.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_init_master_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_iso.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_iso.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_iso.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_iso.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_master_phy.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_master_phy.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_master_phy.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_master_phy.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_pc.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_pc.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_pc.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_pc.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_priv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_priv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_priv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_priv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_slave_phy.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_slave_phy.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_slave_phy.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_int_slave_phy.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_isr_init_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_cs2.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_data.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_data.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_data.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_data.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_init_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso_data.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso_data.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso_data.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_iso_data.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_master_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_master_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_master_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_master_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_slave_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_slave_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_slave_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_main_slave_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_ae.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_ae.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_ae.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_ae.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_bis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_bis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_bis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_bis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_conn.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_enc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_enc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_enc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_enc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_pdu_iso.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_init_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_master_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lctr/lctr_sm_llcp_slave_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_conn_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_cmd_vs_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_cs2.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_conn_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_vs.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_vs.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_vs.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_evt_vs.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_cs2.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_conn_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_init_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_int.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_int.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_int.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_int.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lhci/lhci_main_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_cs2.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_cs2.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_cs2.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_cs2.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_init_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_master_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_master_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_master_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_master_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_slave_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_slave_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_slave_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_init_slave_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_bis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_cis_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_conn_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_diag.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_diag.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_diag.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_diag.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_dtm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_dtm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_dtm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_dtm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_enc_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_past.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_past.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_past.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_past.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_pc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_pc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_pc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_pc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_phy.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_phy.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_phy.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_phy.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_main_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_math.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_math.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_math.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/ll/ll_math.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_events.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_events.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_events.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_events.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_master_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_adv_slave_ae.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_cis_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_conn.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_conn.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_conn.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_conn.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_iso.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_iso.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_iso.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_iso.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_master.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_master.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_master.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_master.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_priv.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_priv.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_priv.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_priv.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_sc.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_sc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_sc.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_sc.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_slave.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_slave.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_slave.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/lmgr/lmgr_main_slave.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_ble.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_ble.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_ble.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_ble.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_rm.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_rm.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_rm.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_rm.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_tm.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_tm.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_tm.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_int_tm.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_rm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_rm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_rm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_rm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_tm.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_tm.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_tm.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/ble/sch/sch_tm.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_int.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_int.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_int.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_int.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/bb/bb_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/chci/chci_tr.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_int.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_int.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_int.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_int.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_list.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_list.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_list.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_list.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_main.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_main.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_main.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/controller/sources/common/sch/sch_main.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/arduino_primo.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/arduino_primo.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/arduino_primo.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/arduino_primo.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/boards.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/d52_starterkit.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/d52_starterkit.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/d52_starterkit.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/d52_starterkit.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/n5_starterkit.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/n5_starterkit.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/n5_starterkit.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/n5_starterkit.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/nrf6310.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/nrf6310.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/nrf6310.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/nrf6310.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10000.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10000.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10000.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10000.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10001.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10001.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10001.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10001.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10003.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10003.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10003.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10003.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10028.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10028.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10028.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10028.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10031.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10031.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10031.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10031.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10036.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10036.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10036.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10036.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10040.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10040.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10040.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10040.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10056.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10056.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10056.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10056.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10059.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10059.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10059.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10059.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10100.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10100.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10100.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca10100.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20006.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20006.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20006.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20006.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20020.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20020.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20020.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/pca20020.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/wt51822.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/wt51822.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/wt51822.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/nordic-bsp/components/boards/wt51822.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/LICENSE.txt b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/LICENSE.txt similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/LICENSE.txt rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/LICENSE.txt diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/README.txt b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/README.txt similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/README.txt rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/README.txt diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/asm_arm.inc b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/asm_arm.inc similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/asm_arm.inc rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/asm_arm.inc diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.c diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack/thirdparty/uecc/uECC_ll.h diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.cpp diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h b/connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h rename to connectivity/FEATURE_BLE/cordio/TARGET_CORDIO_LL/stack_adaptation/custom_chci_tr.h diff --git a/features/FEATURE_BLE/ble/BLE.h b/connectivity/FEATURE_BLE/include/ble/BLE.h similarity index 94% rename from features/FEATURE_BLE/ble/BLE.h rename to connectivity/FEATURE_BLE/include/ble/BLE.h index 8529a15833..481030fefe 100644 --- a/features/FEATURE_BLE/ble/BLE.h +++ b/connectivity/FEATURE_BLE/include/ble/BLE.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,28 +19,24 @@ #ifndef MBED_BLE_H__ #define MBED_BLE_H__ -#include "BLERoles.h" - -#include "blecommon.h" -#include "ble/Gap.h" -#include "ble/GattServer.h" -#include "ble/GattClient.h" -#include "ble/SecurityManager.h" - -#include "ble/FunctionPointerWithContext.h" - -#ifdef YOTTA_CFG_MBED_OS -#include "mbed-drivers/mbed_error.h" -#else - +#include "FunctionPointerWithContext.h" #include "platform/mbed_error.h" - -#endif - +#include "platform/mbed_assert.h" #include "platform/mbed_toolchain.h" +#include "ble/types/BLERoles.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" + + /* Forward declaration for the implementation class */ class BLEInstanceBase; +namespace ble { +class Gap; +class GattClient; +class GattServer; +class SecurityManager; +} /** * @addtogroup ble @@ -148,17 +146,10 @@ public: */ static const InstanceID_t DEFAULT_INSTANCE = 0; -#ifndef YOTTA_CFG_BLE_INSTANCES_COUNT /** * The number of permitted BLE instances for the application. */ static const InstanceID_t NUM_INSTANCES = 1; -#else - /** - * The number of permitted BLE instances for the application. - */ - static const InstanceID_t NUM_INSTANCES = YOTTA_CFG_BLE_INSTANCES_COUNT; -#endif /** * Get a reference to the BLE singleton corresponding to a given interface. @@ -348,14 +339,14 @@ public: * * @return A reference to a Gap object associated to this BLE instance. */ - Gap &gap(); + ble::Gap &gap(); /** * A const alternative to gap(). * * @return A const reference to a Gap object associated to this BLE instance. */ - const Gap &gap() const; + const ble::Gap &gap() const; #if BLE_FEATURE_GATT_SERVER /** @@ -364,7 +355,7 @@ public: * * @return A reference to a GattServer object associated to this BLE instance. */ - GattServer &gattServer(); + ble::GattServer &gattServer(); /** * A const alternative to gattServer(). @@ -372,7 +363,7 @@ public: * @return A const reference to a GattServer object associated to this BLE * instance. */ - const GattServer &gattServer() const; + const ble::GattServer &gattServer() const; #endif // BLE_FEATURE_GATT_SERVER #if BLE_FEATURE_GATT_CLIENT @@ -382,7 +373,7 @@ public: * * @return A reference to a GattClient object associated to this BLE instance. */ - GattClient &gattClient(); + ble::GattClient &gattClient(); /** * A const alternative to gattClient(). @@ -390,7 +381,7 @@ public: * @return A const reference to a GattClient object associated to this BLE * instance. */ - const GattClient &gattClient() const; + const ble::GattClient &gattClient() const; #endif // BLE_FEATURE_GATT_CLIENT #if BLE_FEATURE_SECURITY @@ -401,7 +392,7 @@ public: * @return A reference to a SecurityManager object associated to this BLE * instance. */ - SecurityManager &securityManager(); + ble::SecurityManager &securityManager(); /** * A const alternative to securityManager(). @@ -409,7 +400,7 @@ public: * @return A const reference to a SecurityManager object associated to this * BLE instance. */ - const SecurityManager &securityManager() const; + const ble::SecurityManager &securityManager() const; #endif // BLE_FEATURE_SECURITY /** @@ -429,7 +420,7 @@ private: * are thin wrappers around a transport object (that is, ptr. to * BLEInstanceBase). * - * @param[in] instanceID BLE Instance ID to get. + * @param[in] instanceID BLE Instance ID to get. */ BLE(InstanceID_t instanceID = DEFAULT_INSTANCE); diff --git a/features/FEATURE_BLE/ble/gap/Gap.h b/connectivity/FEATURE_BLE/include/ble/Gap.h similarity index 88% rename from features/FEATURE_BLE/ble/gap/Gap.h rename to connectivity/FEATURE_BLE/include/ble/Gap.h index 4b93965698..cfaf3cbff2 100644 --- a/features/FEATURE_BLE/ble/gap/Gap.h +++ b/connectivity/FEATURE_BLE/include/ble/Gap.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,26 +14,33 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef BLE_GAP_GAP_H #define BLE_GAP_GAP_H -#include "BLERoles.h" -#include "ble/common/StaticInterface.h" -#include "ble/BLETypes.h" -#include "ble/CallChainOfFunctionPointersWithContext.h" -#include "ble/gap/AdvertisingDataBuilder.h" -#include "ble/gap/AdvertisingDataSimpleBuilder.h" -#include "ble/gap/ConnectionParameters.h" -#include "ble/gap/ScanParameters.h" -#include "ble/gap/AdvertisingParameters.h" -#include "ble/gap/Events.h" +#include "CallChainOfFunctionPointersWithContext.h" + +#include + +#include "drivers/LowPowerTimeout.h" +#include "drivers/LowPowerTicker.h" +#include "platform/mbed_error.h" + +#include "ble/types/BLERoles.h" +#include "ble/types/BLETypes.h" +#include "ble/types/gap/AdvertisingDataBuilder.h" +#include "ble/types/gap/AdvertisingDataParser.h" +#include "ble/types/gap/AdvertisingDataSimpleBuilder.h" +#include "ble/types/gap/AdvertisingDataTypes.h" +#include "ble/types/gap/AdvertisingParameters.h" +#include "ble/types/gap/ConnectionParameters.h" +#include "ble/types/gap/Events.h" +#include "ble/types/gap/ScanParameters.h" +#include "ble/types/gap/Types.h" namespace ble { -#if !defined(DOXYGEN_ONLY) -namespace interface { -#endif +class PalGenericAccessService; /** * @addtogroup ble @@ -271,14 +280,11 @@ namespace interface { * PHY and of any changes to PHYs which may be triggered autonomously by the * controller or by the peer. */ -#if defined(DOXYGEN_ONLY) +#if !defined(DOXYGEN_ONLY) +namespace interface { +#endif // !defined(DOXYGEN_ONLY) class Gap { -#else -template -class Gap : public StaticInterface { -#endif - using StaticInterface::impl; - +public: /** * Gap shutdown event handler. * @@ -295,7 +301,6 @@ class Gap : public StaticInterface { GapShutdownCallbackChain_t; public: - /** * Definition of the general handler of Gap related events. */ @@ -550,7 +555,7 @@ public: /** * Preferred connection parameter display in Generic Access Service. */ - typedef struct { + typedef struct PreferredConnectionParams_t { /** * Minimum interval between two connection events allowed for a * connection. @@ -600,10 +605,7 @@ public: * * @param handler Application implementation of an EventHandler. */ - void setEventHandler(EventHandler *handler) - { - _eventHandler = handler; - } + void setEventHandler(EventHandler *handler); /** Check controller support for a specific feature. * @@ -1218,19 +1220,6 @@ public: ); #endif // BLE_FEATURE_PHY_MANAGEMENT - /** - * Default peripheral privacy configuration. - */ - static const peripheral_privacy_configuration_t - default_peripheral_privacy_configuration; - - /** - * Default peripheral privacy configuration. - */ - static const central_privacy_configuration_t - default_central_privacy_configuration; - - #if BLE_FEATURE_PRIVACY /** * Enable or disable privacy mode of the local device. @@ -1431,10 +1420,7 @@ public: * @param[in] memberPtr Shutdown event handler to register. */ template - void onShutdown(T *objPtr, void (T::*memberPtr)(const Gap *)) - { - shutdownCallChain.add(objPtr, memberPtr); - } + void onShutdown(T *objPtr, void (T::*memberPtr)(const Gap *)); /** * Access the callchain of shutdown event handler. @@ -1454,175 +1440,6 @@ public: * forbidden by the Bluetooth specification. */ ble_error_t setRandomStaticAddress(const ble::address_t& address); - -protected: - - /** - * Construct a Gap instance. - */ - Gap(); - - - /* ----------------- API to override in derived class -------------- */ - - bool isFeatureSupported_(controller_supported_features_t feature); - uint8_t getMaxAdvertisingSetNumber_(); - uint16_t getMaxAdvertisingDataLength_(); - uint16_t getMaxConnectableAdvertisingDataLength_(); - uint16_t getMaxActiveSetAdvertisingDataLength_(); - ble_error_t createAdvertisingSet_( - advertising_handle_t *handle, - const AdvertisingParameters ¶meters - ); - ble_error_t destroyAdvertisingSet_(advertising_handle_t handle); - ble_error_t setAdvertisingParameters_( - advertising_handle_t handle, - const AdvertisingParameters ¶ms - ); - ble_error_t setAdvertisingPayload_( - advertising_handle_t handle, - mbed::Span payload - ); - ble_error_t setAdvertisingScanResponse_( - advertising_handle_t handle, - mbed::Span response - ); - ble_error_t startAdvertising_( - advertising_handle_t handle, - adv_duration_t maxDuration, - uint8_t maxEvents - ); - ble_error_t stopAdvertising_(advertising_handle_t handle); - bool isAdvertisingActive_(advertising_handle_t handle); - ble_error_t setPeriodicAdvertisingParameters_( - advertising_handle_t handle, - periodic_interval_t periodicAdvertisingIntervalMin, - periodic_interval_t periodicAdvertisingIntervalMax, - bool advertiseTxPower - ); - ble_error_t setPeriodicAdvertisingPayload_( - advertising_handle_t handle, - mbed::Span payload - ); - ble_error_t startPeriodicAdvertising_(advertising_handle_t handle); - ble_error_t stopPeriodicAdvertising_(advertising_handle_t handle); - bool isPeriodicAdvertisingActive_(advertising_handle_t handle); - ble_error_t setScanParameters_(const ScanParameters ¶ms); - ble_error_t startScan_( - scan_duration_t duration, - duplicates_filter_t filtering, - scan_period_t period - ); - ble_error_t stopScan_(); - ble_error_t createSync_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - uint8_t sid, - slave_latency_t maxPacketSkip, - sync_timeout_t timeout - ); - ble_error_t createSync_( - slave_latency_t maxPacketSkip, - sync_timeout_t timeout - ); - ble_error_t cancelCreateSync_(); - ble_error_t terminateSync_(periodic_sync_handle_t handle); - ble_error_t addDeviceToPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid - ); - ble_error_t removeDeviceFromPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid - ); - ble_error_t clearPeriodicAdvertiserList_(); - uint8_t getMaxPeriodicAdvertiserListSize_(); - ble_error_t connect_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - const ConnectionParameters &connectionParams - ); - ble_error_t cancelConnect_(); - ble_error_t updateConnectionParameters_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength - ); - ble_error_t manageConnectionParametersUpdateRequest_( - bool userManageConnectionUpdateRequest - ); - ble_error_t acceptConnectionParametersUpdate_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength - ); - ble_error_t rejectConnectionParametersUpdate_( - connection_handle_t connectionHandle - ); - ble_error_t disconnect_( - connection_handle_t connectionHandle, - local_disconnection_reason_t reason - ); - ble_error_t readPhy_(connection_handle_t connection); - ble_error_t setPreferredPhys_( - const phy_set_t *txPhys, - const phy_set_t *rxPhys - ); - ble_error_t setPhy_( - connection_handle_t connection, - const phy_set_t *txPhys, - const phy_set_t *rxPhys, - coded_symbol_per_bit_t codedSymbol - ); - ble_error_t enablePrivacy_(bool enable); - ble_error_t setPeripheralPrivacyConfiguration_( - const peripheral_privacy_configuration_t *configuration - ); - ble_error_t getPeripheralPrivacyConfiguration_( - peripheral_privacy_configuration_t *configuration - ); - ble_error_t setCentralPrivacyConfiguration_( - const central_privacy_configuration_t *configuration - ); - ble_error_t getCentralPrivacyConfiguration_( - central_privacy_configuration_t *configuration - ); - ble_error_t setRandomStaticAddress_(const ble::address_t& address); - uint8_t getMaxWhitelistSize_(void) const; - ble_error_t getWhitelist_(whitelist_t &whitelist) const; - ble_error_t setWhitelist_(const whitelist_t &whitelist); - - ble_error_t getAddress_( - own_address_type_t &typeP, - address_t &address - ); - - /* Note: Implementation must call the base class reset_ */ - ble_error_t reset_(void); - -protected: - - /** - * Callchain containing all registered callback handlers for shutdown - * events. - */ - GapShutdownCallbackChain_t shutdownCallChain; - - /** - * Event handler provided by the application. - */ - EventHandler *_eventHandler; - #endif // !defined(DOXYGEN_ONLY) }; @@ -1633,7 +1450,14 @@ protected: #if !defined(DOXYGEN_ONLY) } // namespace interface -#endif +#endif // !defined(DOXYGEN_ONLY) } // namespace ble -#endif //BLE_GAP_GAP_H + +#endif // BLE_GAP_GAP_H + +#if (BLE_STACK_IMPLEMENTATION == 1) +#include "ble/internal/cordio/CordioGap.h" +#else +#error "please provide alternate BLE implementation" +#endif diff --git a/features/FEATURE_BLE/ble/GattClient.h b/connectivity/FEATURE_BLE/include/ble/GattClient.h similarity index 83% rename from features/FEATURE_BLE/ble/GattClient.h rename to connectivity/FEATURE_BLE/include/ble/GattClient.h index 3eb9b63e85..b492837b95 100644 --- a/features/FEATURE_BLE/ble/GattClient.h +++ b/connectivity/FEATURE_BLE/include/ble/GattClient.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +16,23 @@ * limitations under the License. */ + #ifndef MBED_GATT_CLIENT_H__ + #define MBED_GATT_CLIENT_H__ -#include "ble/common/StaticInterface.h" -#include "ble/GattAttribute.h" -#include "ble/ServiceDiscovery.h" -#include "ble/CharacteristicDescriptorDiscovery.h" -#include "ble/GattCallbackParamTypes.h" -#include "ble/CallChainOfFunctionPointersWithContext.h" -#include "BleImplementationForward.h" +#include "CallChainOfFunctionPointersWithContext.h" +#include + +#include "ble/types/blecommon.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/ServiceDiscovery.h" +#include "ble/types/CharacteristicDescriptorDiscovery.h" +#include "ble/types/GattCallbackParamTypes.h" +#include "ble/types/DiscoveredService.h" +#include "ble/types/DiscoveredCharacteristic.h" -#if !defined(DOXYGEN_ONLY) namespace ble { -namespace interface { -#endif /** * @addtogroup ble @@ -85,17 +89,11 @@ namespace interface { * indicate properties are set. The client discovers that descriptor * if it intends to register to server initiated events. */ -#if defined(DOXYGEN_ONLY) +#if !defined(DOXYGEN_ONLY) +namespace interface { +#endif // !defined(DOXYGEN_ONLY) class GattClient { -#else -template -class GattClient : public StaticInterface { -#endif - - using StaticInterface::impl; - public: - /** * Definition of the general handler of GattClient related events. */ @@ -111,7 +109,16 @@ public: virtual void onAttMtuChange( ble::connection_handle_t connectionHandle, uint16_t attMtuSize - ) + ) { + (void)connectionHandle; + (void)attMtuSize; + } + protected: + /** + * Prevent polymorphic deletion and avoid unnecessary virtual destructor + * as the GattClient class will never delete the instance it contains. + */ + ~EventHandler() { } }; @@ -122,21 +129,20 @@ public: * * @param handler Application implementation of an EventHandler. */ - void setEventHandler(EventHandler *handler) - { - eventHandler = handler; - } + void setEventHandler(EventHandler *handler); /** * Attribute read event handler. * * @see GattClient::onDataRead(). + * @deprecated Use the version in global ble namespace. */ typedef FunctionPointerWithContext ReadCallback_t; /** * Callchain of attribute read event handlers. + * @deprecated Use the version in global ble namespace. */ typedef CallChainOfFunctionPointersWithContext ReadCallbackChain_t; @@ -172,9 +178,10 @@ public: }; /** - * Attribute write event handler. + * Attribute write event handler.ble::WriteCallback_t * * @see GattClient::onDataWrite(). + * @deprecated Use the version in global ble namespace. */ typedef FunctionPointerWithContext WriteCallback_t; @@ -183,6 +190,7 @@ public: * Callchain of attribute write event handlers. * * @see GattClient::onDataWrite(). + * @deprecated Use the version in global ble namespace. */ typedef CallChainOfFunctionPointersWithContext WriteCallbackChain_t; @@ -224,7 +232,6 @@ public: * The following functions are meant to be overridden in the platform * specific subclass. */ -public: ~GattClient() { } @@ -319,16 +326,7 @@ public: ble::connection_handle_t connectionHandle, ServiceDiscovery::ServiceCallback_t callback, const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN) - ) { - /* We take advantage of the property - * that providing NULL for the characteristic callback results in - * characteristic discovery being skipped for each matching - * service. This allows for an inexpensive method to discover only - * services. Porters are free to override this. */ - return launchServiceDiscovery( - connectionHandle, callback, NULL, matchingServiceUUID - ); - } + ); /** * Launch the service discovery procedure of a GATT server peer. @@ -462,7 +460,6 @@ public: ) const; /* Event callback handlers. */ -public: /** * Register an attribute read event handler. @@ -472,10 +469,7 @@ public: * * @param[in] callback Event handler being registered. */ - void onDataRead(ReadCallback_t callback) - { - onDataReadCallbackChain.add(callback); - } + void onDataRead(ble::ReadCallback_t callback); /** * Get the callchain of attribute read event handlers. @@ -488,10 +482,7 @@ public: * @note It is possible to unregister an handler by using * onDataRead().detach(callback). */ - ReadCallbackChain_t& onDataRead() - { - return onDataReadCallbackChain; - } + ble::ReadCallbackChain_t& onDataRead(); /** * Register an attribute write event handler. @@ -504,10 +495,7 @@ public: * @note Write commands (issued using writeWoResponse) don't generate a * response. */ - void onDataWritten(WriteCallback_t callback) - { - onDataWriteCallbackChain.add(callback); - } + void onDataWritten(ble::WriteCallback_t callback); /** * Get the callchain of attribute write event handlers. @@ -520,10 +508,7 @@ public: * @note It is possible to unregister an handler by using * onDataWritten().detach(callback). */ - WriteCallbackChain_t& onDataWritten() - { - return onDataWriteCallbackChain; - } + ble::WriteCallbackChain_t& onDataWritten(); /** * Register a service discovery termination event handler. @@ -611,10 +596,7 @@ public: * @note It is possible to unregister a callback by using * onHVX().detach(callbackToRemove). */ - void onHVX(HVXCallback_t callback) - { - onHVXCallbackChain.add(callback); - } + void onHVX(HVXCallback_t callback); /** * Register a shutdown event handler. @@ -630,10 +612,7 @@ public: * * @see BLE::shutdown() */ - void onShutdown(const GattClientShutdownCallback_t& callback) - { - shutdownCallChain.add(callback); - } + void onShutdown(const GattClientShutdownCallback_t& callback); /** * Register a shutdown event handler. @@ -646,10 +625,7 @@ public: * available. */ template - void onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *)) - { - shutdownCallChain.add(objPtr, memberPtr); - } + void onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *)); /** * Get the callchain of shutdown event handlers. @@ -660,10 +636,7 @@ public: * * @note onShutdown().detach(callback) may be used to unregister an handler. */ - GattClientShutdownCallbackChain_t& onShutdown() - { - return shutdownCallChain; - } + GattClientShutdownCallbackChain_t& onShutdown(); /** * @brief provide access to the callchain of HVX callbacks. @@ -674,11 +647,9 @@ public: * * @note It is possible to unregister callbacks using onHVX().detach(callback). */ - HVXCallbackChain_t& onHVX() { - return onHVXCallbackChain; - } + HVXCallbackChain_t& onHVX(); + -public: /** * Reset the state of the GattClient instance. * @@ -698,74 +669,8 @@ public: */ ble_error_t reset(void); -protected: - - /* --- Abstract calls to override --- */ - - /* Derived implementation must call the base class implementation */ - ble_error_t reset_(void); - - ble_error_t discoverServices_( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t callback, - GattAttribute::Handle_t startHandle, - GattAttribute::Handle_t endHandle - ); - - ble_error_t launchServiceDiscovery_( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t sc, - ServiceDiscovery::CharacteristicCallback_t cc, - const UUID &matchingServiceUUID, - const UUID &matchingCharacteristicUUIDIn - ); - - bool isServiceDiscoveryActive_(void) const; - - void terminateServiceDiscovery_(void); - - ble_error_t negotiateAttMtu_(ble::connection_handle_t connection); - - ble_error_t read_( - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - uint16_t offset - ) const; - - ble_error_t write_( - GattClient::WriteOp_t cmd, - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - size_t length, - const uint8_t *value - ) const; - - void onServiceDiscoveryTermination_( - ServiceDiscovery::TerminationCallback_t callback - ); - - ble_error_t discoverCharacteristicDescriptors_( - const DiscoveredCharacteristic& characteristic, - const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, - const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback - ); - - bool isCharacteristicDescriptorDiscoveryActive_( - const DiscoveredCharacteristic& characteristic - ) const; - - void terminateCharacteristicDescriptorDiscovery_( - const DiscoveredCharacteristic& characteristic - ); - -protected: - GattClient() : eventHandler(NULL) - { - /* Empty */ - } - /* Entry points for the underlying stack to report events back to the user. */ -public: + /** * Forward an attribute read event to all registered handlers. * @@ -774,10 +679,7 @@ public: * * @param[in] params Attribute read event to pass to the registered handlers. */ - void processReadResponse(const GattReadCallbackParams *params) - { - onDataReadCallbackChain(params); - } + void processReadResponse(const GattReadCallbackParams *params); /** * Forward an attribute written event to all registered handlers. @@ -788,10 +690,7 @@ public: * @param[in] params Attribute written event to pass to the registered * handlers. */ - void processWriteResponse(const GattWriteCallbackParams *params) - { - onDataWriteCallbackChain(params); - } + void processWriteResponse(const GattWriteCallbackParams *params); /** * Forward a handle value notification or indication event to all registered @@ -803,47 +702,7 @@ public: * @param[in] params Notification or Indication event to pass to the * registered handlers. */ - void processHVXEvent(const GattHVXCallbackParams *params) - { - if (onHVXCallbackChain) { - onHVXCallbackChain(params); - } - } - -protected: - /** - * Event handler provided by the application. - */ - EventHandler *eventHandler; - - /** - * Callchain containing all registered event handlers for data read - * events. - */ - ReadCallbackChain_t onDataReadCallbackChain; - - /** - * Callchain containing all registered event handlers for data write - * events. - */ - WriteCallbackChain_t onDataWriteCallbackChain; - - /** - * Callchain containing all registered event handlers for update - * events. - */ - HVXCallbackChain_t onHVXCallbackChain; - - /** - * Callchain containing all registered event handlers for shutdown - * events. - */ - GattClientShutdownCallbackChain_t shutdownCallChain; - -private: - /* Disallow copy and assignment. */ - GattClient(const GattClient &); - GattClient& operator=(const GattClient &); + void processHVXEvent(const GattHVXCallbackParams *params); }; /** @@ -854,9 +713,13 @@ private: #if !defined(DOXYGEN_ONLY) } // namespace interface +#endif // !defined(DOXYGEN_ONLY) } // namespace ble -using ble::impl::GattClient; +#if (BLE_STACK_IMPLEMENTATION == 1) +#include "ble/internal/cordio/CordioGattClient.h" +#else +#error "please provide alternate BLE implementation" #endif #endif /* ifndef MBED_GATT_CLIENT_H__ */ diff --git a/features/FEATURE_BLE/ble/GattServer.h b/connectivity/FEATURE_BLE/include/ble/GattServer.h similarity index 77% rename from features/FEATURE_BLE/ble/GattServer.h rename to connectivity/FEATURE_BLE/include/ble/GattServer.h index cdfb53d9fd..81e67622f5 100644 --- a/features/FEATURE_BLE/ble/GattServer.h +++ b/connectivity/FEATURE_BLE/include/ble/GattServer.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +16,32 @@ * limitations under the License. */ + #ifndef MBED_GATT_SERVER_H__ #define MBED_GATT_SERVER_H__ -#include "ble/common/StaticInterface.h" -#include "ble/GattService.h" -#include "ble/GattAttribute.h" -#include "ble/GattServerEvents.h" -#include "ble/GattCallbackParamTypes.h" -#include "ble/CallChainOfFunctionPointersWithContext.h" -#include "BleImplementationForward.h" +#include "CallChainOfFunctionPointersWithContext.h" + +#include "ble/types/GattService.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/GattServerEvents.h" +#include "ble/types/GattCallbackParamTypes.h" + +#include "ble/types/blecommon.h" +#include "ble/Gap.h" +#include "SecurityManager.h" + +#include "ble/BLE.h" + +/*! Maximum count of characteristics that can be stored for authorisation purposes */ +#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20 + +/*! client characteristic configuration descriptors settings */ +#define MAX_CCCD_CNT 20 -#if !defined(DOXYGEN_ONLY) namespace ble { -namespace interface { -#endif +class PalAttClient; +class BLE; /** * @addtogroup ble @@ -92,16 +105,10 @@ namespace interface { * the nature of the server initiated is not relevant. */ #if !defined(DOXYGEN_ONLY) -template -class GattServer : public StaticInterface { -#else +namespace interface { +#endif // !defined(DOXYGEN_ONLY) class GattServer { -#endif - - using StaticInterface::impl; - public: - /** * Definition of the general handler of GattServer related events. */ @@ -117,22 +124,20 @@ public: virtual void onAttMtuChange( ble::connection_handle_t connectionHandle, uint16_t attMtuSize - ) + ) { + (void)connectionHandle; + (void)attMtuSize; + } + protected: + /** + * Prevent polymorphic deletion and avoid unnecessary virtual destructor + * as the GattServer class will never delete the instance it contains. + */ + ~EventHandler() { } }; - /** - * Assign the event handler implementation that will be used by the - * module to signal events back to the application. - * - * @param handler Application implementation of an EventHandler. - */ - void setEventHandler(EventHandler *handler) - { - eventHandler = handler; - } - /** * Event handler invoked when the server has sent data to a client. * @@ -205,17 +210,28 @@ public: */ typedef FunctionPointerWithContext EventCallback_t; -protected: - /** - * Construct a GattServer instance. - */ - GattServer(); - - /* - * The following functions are meant to be overridden in the platform - * specific subclass. - */ public: + /** + * Assign the event handler implementation that will be used by the + * module to signal events back to the application. + * + * @param handler Application implementation of an EventHandler. + */ + void setEventHandler(EventHandler *handler); + + /** + * Shut down the GattServer instance. + * + * This function notifies all event handlers listening for shutdown events + * that the GattServer is about to be shut down; then it clears all + * GattServer state. + * + * @note This function is meant to be overridden in the platform-specific + * subclass. Overides must call the parent function before any cleanup. + * + * @return BLE_ERROR_NONE on success. + */ + ble_error_t reset(void); /** * Add a service declaration to the local attribute server table. @@ -388,10 +404,6 @@ public: */ bool isOnDataReadAvailable() const; - /* - * APIs with nonvirtual implementations. - */ -public: /** * Add an event handler that monitors emission of characteristic value * updates. @@ -401,10 +413,7 @@ public: * @note It is possible to chain together multiple onDataSent callbacks * (potentially from different modules of an application). */ - void onDataSent(const DataSentCallback_t &callback) - { - dataSentCallChain.add(callback); - } + void onDataSent(const DataSentCallback_t &callback); /** * Add an event handler that monitors emission of characteristic value @@ -416,20 +425,14 @@ public: * function. */ template - void onDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)) - { - dataSentCallChain.add(objPtr, memberPtr); - } + void onDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)); /** * Access the callchain of data sent event handlers. * * @return A reference to the DATA_SENT event callback chain. */ - DataSentCallbackChain_t &onDataSent() - { - return dataSentCallChain; - } + DataSentCallbackChain_t &onDataSent(); /** * Set an event handler that is called after @@ -440,10 +443,7 @@ public: * @attention It is possible to set multiple event handlers. Registered * handlers may be removed with onDataWritten().detach(callback). */ - void onDataWritten(const DataWrittenCallback_t &callback) - { - dataWrittenCallChain.add(callback); - } + void onDataWritten(const DataWrittenCallback_t &callback); /** * Set an event handler that is called after @@ -458,9 +458,7 @@ public: void onDataWritten( T *objPtr, void (T::*memberPtr)(const GattWriteCallbackParams *context) - ) { - dataWrittenCallChain.add(objPtr, memberPtr); - } + ); /** * Access the callchain of data written event handlers. @@ -473,10 +471,7 @@ public: * @note It is possible to unregister callbacks using * onDataWritten().detach(callback). */ - DataWrittenCallbackChain_t &onDataWritten() - { - return dataWrittenCallChain; - } + DataWrittenCallbackChain_t &onDataWritten(); /** * Set an event handler that monitors attribute reads from connected clients. @@ -496,15 +491,7 @@ public: * @attention It is possible to set multiple event handlers. Registered * handlers may be removed with onDataRead().detach(callback). */ - ble_error_t onDataRead(const DataReadCallback_t &callback) - { - if (!isOnDataReadAvailable()) { - return BLE_ERROR_NOT_IMPLEMENTED; - } - - dataReadCallChain.add(callback); - return BLE_ERROR_NONE; - } + ble_error_t onDataRead(const DataReadCallback_t &callback); /** * Set an event handler that monitors attribute reads from connected clients. @@ -518,14 +505,7 @@ public: ble_error_t onDataRead( T *objPtr, void (T::*memberPtr)(const GattReadCallbackParams *context) - ) { - if (!isOnDataReadAvailable()) { - return BLE_ERROR_NOT_IMPLEMENTED; - } - - dataReadCallChain.add(objPtr, memberPtr); - return BLE_ERROR_NONE; - } + ); /** * Access the callchain of data read event handlers. @@ -538,10 +518,7 @@ public: * @note It is possible to unregister callbacks using * onDataRead().detach(callback). */ - DataReadCallbackChain_t &onDataRead() - { - return dataReadCallChain; - } + DataReadCallbackChain_t &onDataRead(); /** * Set an event handler that monitors shutdown or reset of the GattServer. @@ -556,10 +533,7 @@ public: * @note It is possible to unregister a callback using * onShutdown().detach(callback) */ - void onShutdown(const GattServerShutdownCallback_t &callback) - { - shutdownCallChain.add(callback); - } + void onShutdown(const GattServerShutdownCallback_t &callback); /** * Set an event handler that monitors shutdown or reset of the GattServer. @@ -573,10 +547,7 @@ public: * function. */ template - void onShutdown(T *objPtr, void (T::*memberPtr)(const GattServer *)) - { - shutdownCallChain.add(objPtr, memberPtr); - } + void onShutdown(T *objPtr, void (T::*memberPtr)(const GattServer *)); /** * Access the callchain of shutdown event handlers. @@ -589,10 +560,7 @@ public: * @note It is possible to unregister callbacks using * onShutdown().detach(callback). */ - GattServerShutdownCallbackChain_t& onShutdown() - { - return shutdownCallChain; - } + GattServerShutdownCallbackChain_t& onShutdown(); /** * Set up an event handler that monitors subscription to characteristic @@ -600,10 +568,7 @@ public: * * @param[in] callback Event handler being registered. */ - void onUpdatesEnabled(EventCallback_t callback) - { - updatesEnabledCallback = callback; - } + void onUpdatesEnabled(EventCallback_t callback); /** * Set up an event handler that monitors unsubscription from characteristic @@ -611,10 +576,7 @@ public: * * @param[in] callback Event handler being registered. */ - void onUpdatesDisabled(EventCallback_t callback) - { - updatesDisabledCallback = callback; - } + void onUpdatesDisabled(EventCallback_t callback); /** * Set up an event handler that monitors notification acknowledgment. @@ -624,10 +586,7 @@ public: * * @param[in] callback Event handler being registered. */ - void onConfirmationReceived(EventCallback_t callback) - { - confirmationReceivedCallback = callback; - } + void onConfirmationReceived(EventCallback_t callback); /* Entry points for the underlying stack to report events back to the user. */ protected: @@ -641,10 +600,7 @@ protected: * @param[in] params The data written parameters passed to the registered * handlers. */ - void handleDataWrittenEvent(const GattWriteCallbackParams *params) - { - dataWrittenCallChain.call(params); - } + void handleDataWrittenEvent(const GattWriteCallbackParams *params); /** * Helper function that notifies all registered handlers of an occurrence @@ -656,10 +612,7 @@ protected: * @param[in] params The data read parameters passed to the registered * handlers. */ - void handleDataReadEvent(const GattReadCallbackParams *params) - { - dataReadCallChain.call(params); - } + void handleDataReadEvent(const GattReadCallbackParams *params); /** * Helper function that notifies the registered handler of an occurrence @@ -676,33 +629,7 @@ protected: void handleEvent( GattServerEvents::gattEvent_e type, GattAttribute::Handle_t attributeHandle - ) { - switch (type) { - case GattServerEvents::GATT_EVENT_UPDATES_ENABLED: - if (updatesEnabledCallback) { - updatesEnabledCallback(attributeHandle); - } - break; - case GattServerEvents::GATT_EVENT_UPDATES_DISABLED: - if (updatesDisabledCallback) { - updatesDisabledCallback(attributeHandle); - } - break; - case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED: - if (confirmationReceivedCallback) { - confirmationReceivedCallback(attributeHandle); - } - break; - - case GattServerEvents::GATT_EVENT_DATA_SENT: - // Called every time a notification or indication has been sent - handleDataSentEvent(1); - break; - - default: - break; - } - } + ); /** * Helper function that notifies all registered handlers of an occurrence @@ -713,135 +640,20 @@ protected: * * @param[in] count Number of packets sent. */ - void handleDataSentEvent(unsigned count) - { - dataSentCallChain.call(count); - } + void handleDataSentEvent(unsigned count); -public: /** - * Shut down the GattServer instance. + * Get preferred connection paramters. * - * This function notifies all event handlers listening for shutdown events - * that the GattServer is about to be shut down; then it clears all - * GattServer state. + */ + Gap::PreferredConnectionParams_t getPreferredConnectionParams(); + + /** + * Set preferred connection parameters. * - * @note This function is meant to be overridden in the platform-specific - * subclass. Overides must call the parent function before any cleanup. - * - * @return BLE_ERROR_NONE on success. + * @param[in] params Preferred connection parameter values to set. */ - ble_error_t reset(void); - -protected: - /* --- Abstract calls to override --- */ - - /* Derived implementation must call the base reset_ */ - ble_error_t reset_(void); - - ble_error_t addService_(GattService &service); - - ble_error_t read_( - GattAttribute::Handle_t attributeHandle, - uint8_t buffer[], - uint16_t *lengthP - ); - - ble_error_t read_( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - uint8_t *buffer, - uint16_t *lengthP - ); - - ble_error_t write_( - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly - ); - - ble_error_t write_( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly - ); - - ble_error_t areUpdatesEnabled_( - const GattCharacteristic &characteristic, - bool *enabledP - ); - - ble_error_t areUpdatesEnabled_( - ble::connection_handle_t connectionHandle, - const GattCharacteristic &characteristic, - bool *enabledP - ); - - bool isOnDataReadAvailable_() const; - -protected: - /** - * Event handler provided by the application. - */ - EventHandler *eventHandler; - - /** - * The total number of services added to the ATT table. - */ - uint8_t serviceCount; - - /** - * The total number of characteristics added to the ATT table. - */ - uint8_t characteristicCount; - -private: - /** - * Callchain containing all registered callback handlers for data sent - * events. - */ - DataSentCallbackChain_t dataSentCallChain; - - /** - * Callchain containing all registered callback handlers for data written - * events. - */ - DataWrittenCallbackChain_t dataWrittenCallChain; - - /** - * Callchain containing all registered callback handlers for data read - * events. - */ - DataReadCallbackChain_t dataReadCallChain; - - /** - * Callchain containing all registered callback handlers for shutdown - * events. - */ - GattServerShutdownCallbackChain_t shutdownCallChain; - - /** - * The registered callback handler for updates enabled events. - */ - EventCallback_t updatesEnabledCallback; - - /** - * The registered callback handler for updates disabled events. - */ - EventCallback_t updatesDisabledCallback; - - /** - * The registered callback handler for confirmation received events. - */ - EventCallback_t confirmationReceivedCallback; - -private: - /* Disallow copy and assignment. */ - GattServer(const GattServer &); - GattServer& operator=(const GattServer &); + void setPreferredConnectionParams(const Gap::PreferredConnectionParams_t& params); }; /** @@ -851,12 +663,14 @@ private: */ #if !defined(DOXYGEN_ONLY) -} // interface +} // namespace interface +#endif // !defined(DOXYGEN_ONLY) } // ble -typedef ble::impl::GattServer GattServer; - +#if (BLE_STACK_IMPLEMENTATION == 1) +#include "ble/internal/cordio/CordioGattServer.h" +#else +#error "please provide alternate BLE implementation" #endif - #endif /* ifndef MBED_GATT_SERVER_H__ */ diff --git a/features/FEATURE_BLE/ble/SecurityManager.h b/connectivity/FEATURE_BLE/include/ble/SecurityManager.h similarity index 89% rename from features/FEATURE_BLE/ble/SecurityManager.h rename to connectivity/FEATURE_BLE/include/ble/SecurityManager.h index 56313ec71d..aab46f6037 100644 --- a/features/FEATURE_BLE/ble/SecurityManager.h +++ b/connectivity/FEATURE_BLE/include/ble/SecurityManager.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,22 +16,24 @@ * limitations under the License. */ -#ifndef SECURITY_MANAGER_H_ -#define SECURITY_MANAGER_H_ +#ifndef BLE_SECURITY_MANAGER_H_ +#define BLE_SECURITY_MANAGER_H_ #include - -#include "ble/common/StaticInterface.h" -#include "ble/blecommon.h" -#include "ble/BLETypes.h" -#include "ble/Gap.h" #include "CallChainOfFunctionPointersWithContext.h" -#include "BleImplementationForward.h" +#include "platform/Callback.h" + +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/Gap.h" + +#include "ble/internal/pal/GapTypes.h" +#include "ble/types/BLETypes.h" +#include "ble/internal/SecurityDb.h" +#include "ble/internal/pal/PalConnectionMonitor.h" +#include "ble/internal/pal/PalSecurityManager.h" -#if !defined(DOXYGEN_ONLY) namespace ble { -namespace interface { -#endif /** * Overview @@ -185,24 +189,11 @@ namespace interface { * */ #if !defined(DOXYGEN_ONLY) -template -class SecurityManager : public StaticInterface { -#else -class SecurityManager { -#endif - - using StaticInterface::impl; - +namespace interface { +#endif // !defined(DOXYGEN_ONLY) +class SecurityManager +{ public: - /** events sent and received when passkey is being entered */ - enum Keypress_t { - KEYPRESS_STARTED, /**< Passkey entry started */ - KEYPRESS_ENTERED, /**< Passkey digit entered */ - KEYPRESS_ERASED, /**< Passkey digit erased */ - KEYPRESS_CLEARED, /**< Passkey cleared */ - KEYPRESS_COMPLETED, /**< Passkey entry completed */ - }; - /** level of security required from the link by the application */ enum SecurityMode_t { SECURITY_MODE_NO_ACCESS, @@ -257,9 +248,6 @@ public: * to set the interface implementation to be used. */ class EventHandler { public: - EventHandler() {}; - virtual ~EventHandler() {}; - //////////////////////////////////////////////////////////////////////////// // Pairing // @@ -339,7 +327,7 @@ public: * @param[in] connectionHandle connection connectionHandle * @param[in] passkey 6 digit passkey to be displayed */ - virtual void passkeyDisplay(ble::connection_handle_t connectionHandle, const SecurityManager::Passkey_t passkey) { + virtual void passkeyDisplay(ble::connection_handle_t connectionHandle, const Passkey_t passkey) { (void)connectionHandle; (void)passkey; } @@ -373,7 +361,7 @@ public: * @param[in] connectionHandle connection connectionHandle * @param[in] keypress type of keypress event */ - virtual void keypressNotification(ble::connection_handle_t connectionHandle, SecurityManager::Keypress_t keypress) { + virtual void keypressNotification(ble::connection_handle_t connectionHandle, ble::Keypress_t keypress) { (void)connectionHandle; (void)keypress; } @@ -431,6 +419,13 @@ public: (void)csrk; (void)authenticated; } + /** + * Prevent polymorphic deletion and avoid unnecessary virtual destructor + * as the SecurityManager class will never delete the instance it contains. + */ + ~EventHandler() + { + } }; /* @@ -461,7 +456,7 @@ public: * @return BLE_ERROR_NONE on success. */ ble_error_t init( - bool enableBonding = true, + bool enableBonding = true, bool requireMITM = true, SecurityIOCapabilities_t iocaps = IO_CAPS_NONE, const Passkey_t passkey = NULL, @@ -673,6 +668,34 @@ public: */ ble_error_t setHintFutureRoleReversal(bool enable = true); + /** + * Set the time after which an event will be generated unless we received a packet with + * a valid MIC. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[in] timeout_in_ms Timeout to set. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t setAuthenticationTimeout( + connection_handle_t connection, + uint32_t timeout_in_ms + ); + + /** + * Get the time after which an event will be generated unless we received a packet with + * a valid MIC. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[in] timeout_in_ms Returns the timeout. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t getAuthenticationTimeout( + connection_handle_t connection, + uint32_t *timeout_in_ms + ); + //////////////////////////////////////////////////////////////////////////// // Encryption // @@ -706,6 +729,19 @@ public: */ ble_error_t setEncryptionKeyRequirements(uint8_t minimumByteSize, uint8_t maximumByteSize); + /** + * Get encryption key size for given connection. + * + * @param[in] connectionHandle Handle to identify the connection. + * @param[out] size Returns the key size in bits. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t getEncryptionKeySize( + connection_handle_t connectionHandle, + uint8_t *size + ); + //////////////////////////////////////////////////////////////////////////// // Authentication // @@ -791,7 +827,7 @@ public: * @param[in] keypress Type of keypress event. * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. */ - ble_error_t sendKeypressNotification(ble::connection_handle_t connectionHandle, Keypress_t keypress); + ble_error_t sendKeypressNotification(ble::connection_handle_t connectionHandle, ble::Keypress_t keypress); /** * Supply the stack with the OOB data for legacy connections. @@ -830,6 +866,21 @@ public: */ ble_error_t getSigningKey(ble::connection_handle_t connectionHandle, bool authenticated); + //////////////////////////////////////////////////////////////////////////// + // Privacy + // + + /** + * Sets how often the address is rotated when privacy is enabled. + * + * @param[in] timeout_in_seconds How many seconds to wait before starting generation of a new address. + * + * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. + */ + ble_error_t setPrivateAddressTimeout( + uint16_t timeout_in_seconds + ); + /* Event callback handlers. */ public: /** @@ -846,13 +897,10 @@ public: * * @note It is possible to unregister a callback using onShutdown().detach(callback) */ - void onShutdown(const SecurityManagerShutdownCallback_t& callback) { - shutdownCallChain.add(callback); - } + void onShutdown(const SecurityManagerShutdownCallback_t& callback); + template - void onShutdown(T *objPtr, void (T::*memberPtr)(const SecurityManager *)) { - shutdownCallChain.add(objPtr, memberPtr); - } + void onShutdown(T *objPtr, void (T::*memberPtr)(const SecurityManager *)); /** * Provide access to the callchain of shutdown event callbacks. @@ -861,9 +909,7 @@ public: * * @return The shutdown event callbacks chain */ - SecurityManagerShutdownCallbackChain_t& onShutdown() { - return shutdownCallChain; - } + SecurityManagerShutdownCallbackChain_t& onShutdown(); /** * Assign the event handler implementation that will be used by the stack to signal events @@ -871,161 +917,31 @@ public: * * @param[in] handler Event Handler interface implementation. */ - void setSecurityManagerEventHandler(EventHandler* handler) { - if (handler) { - eventHandler = handler; - } else { - eventHandler = &defaultEventHandler; - } - } + void setSecurityManagerEventHandler(EventHandler* handler); -protected: - SecurityManager() { - eventHandler = &defaultEventHandler; - } - - ~SecurityManager() { }; - -protected: - /* --- _virtual_ implementations declaration --- */ - - /* Note: implementation must call the base class definition */ - ble_error_t reset_(); - - ble_error_t init_( - bool enableBonding, - bool requireMITM, - SecurityIOCapabilities_t iocaps, - const Passkey_t passkey, - bool signing, - const char *dbFilepath - ); - - ble_error_t setDatabaseFilepath_(const char *dbFilepath); - - ble_error_t preserveBondingStateOnReset_(bool enable); - - ble_error_t purgeAllBondingState_(void); - - ble_error_t generateWhitelistFromBondTable_( - ::ble::whitelist_t *whitelist - ) const; - - ble_error_t requestPairing_( - ble::connection_handle_t connectionHandle - ); - - ble_error_t acceptPairingRequest_( - ble::connection_handle_t connectionHandle - ); - - ble_error_t cancelPairingRequest_( - ble::connection_handle_t connectionHandle - ); - - ble_error_t getPeerIdentity_( - ble::connection_handle_t connectionHandle - ); - - ble_error_t setPairingRequestAuthorisation_( - bool required - ); - - ble_error_t allowLegacyPairing_(bool allow); - - ble_error_t getSecureConnectionsSupport_(bool *enabled); - - ble_error_t setIoCapability_(SecurityIOCapabilities_t iocaps); - - ble_error_t setDisplayPasskey_(const Passkey_t passkey); - - ble_error_t setLinkSecurity_( - ble::connection_handle_t connectionHandle, - SecurityMode_t securityMode - ); - - ble_error_t setKeypressNotification_(bool enabled); - - ble_error_t enableSigning_( - ble::connection_handle_t connectionHandle, - bool enabled - ); - - ble_error_t setHintFutureRoleReversal_(bool enable); - - ble_error_t getLinkEncryption_( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t *encryption - ); - - ble_error_t setLinkEncryption_( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t encryption - ); - - ble_error_t setEncryptionKeyRequirements_( - uint8_t minimumByteSize, - uint8_t maximumByteSize - ); - - ble_error_t requestAuthentication_( - ble::connection_handle_t connectionHandle - ); - - ble_error_t generateOOB_(const ble::address_t *address); - - ble_error_t setOOBDataUsage_( - ble::connection_handle_t connectionHandle, - bool useOOB, - bool OOBProvidesMITM - ); - - ble_error_t confirmationEntered_( - ble::connection_handle_t connectionHandle, - bool confirmation - ); - - ble_error_t passkeyEntered_( - ble::connection_handle_t connectionHandle, - Passkey_t passkey - ); - - ble_error_t sendKeypressNotification_( - ble::connection_handle_t connectionHandle, - Keypress_t keypress - ); - - ble_error_t legacyPairingOobReceived_( - const ble::address_t *address, - const ble::oob_tk_t *tk - ); - - ble_error_t oobReceived_( - const ble::address_t *address, - const ble::oob_lesc_value_t *random, - const ble::oob_confirm_t *confirm - ); - - ble_error_t getSigningKey_( - ble::connection_handle_t connectionHandle, - bool authenticated - ); - -private: - SecurityManagerShutdownCallbackChain_t shutdownCallChain; - -protected: - EventHandler* eventHandler; - EventHandler defaultEventHandler; +public: +#if !defined(DOXYGEN_ONLY) + /** For backwards compatibility. This enm is now in BLETypes.h + * @deprecated, use the enum in ble namespace */ + enum Keypress_t { + KEYPRESS_STARTED, /**< Passkey entry started */ + KEYPRESS_ENTERED, /**< Passkey digit entered */ + KEYPRESS_ERASED, /**< Passkey digit erased */ + KEYPRESS_CLEARED, /**< Passkey cleared */ + KEYPRESS_COMPLETED, /**< Passkey entry completed */ + }; +#endif // !defined(DOXYGEN_ONLY) }; - #if !defined(DOXYGEN_ONLY) -} // interface +} // namespace interface +#endif // !defined(DOXYGEN_ONLY) } // ble -using ble::impl::SecurityManager; +#if (BLE_STACK_IMPLEMENTATION == 1) +#include "ble/internal/cordio/CordioSecurityManager.h" +#else +#error "please provide alternate BLE implementation" #endif - -#endif /*SECURITY_MANAGER_H_*/ +#endif /*BLE_SECURITY_MANAGER_H_*/ diff --git a/features/FEATURE_BLE/ble/deprecate.h b/connectivity/FEATURE_BLE/include/ble/gap/Gap.h similarity index 67% rename from features/FEATURE_BLE/ble/deprecate.h rename to connectivity/FEATURE_BLE/include/ble/gap/Gap.h index e3b1edb7ee..dd24fc22de 100644 --- a/features/FEATURE_BLE/ble/deprecate.h +++ b/connectivity/FEATURE_BLE/include/ble/gap/Gap.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +16,5 @@ * limitations under the License. */ -#ifndef MBED_BLE_DEPRECATE_H__ -#define MBED_BLE_DEPRECATE_H__ - -#ifdef YOTTA_CFG_MBED_OS - #include "compiler-polyfill/attributes.h" -#else - /** - * Deprecated, use MBED_DEPRECATED instead. - */ - #define __deprecated_message(msg) -#endif - -#endif +#warning "This header is deprecated, please include ble/Gap.h directly" +#include "ble/Gap.h" diff --git a/features/FEATURE_BLE/ble/BLEInstanceBase.h b/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h similarity index 91% rename from features/FEATURE_BLE/ble/BLEInstanceBase.h rename to connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h index 4de5391a9c..946dc53d88 100644 --- a/features/FEATURE_BLE/ble/BLEInstanceBase.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,12 +24,13 @@ #define MBED_BLE_DEVICE_INSTANCE_BASE__ #include "ble/BLE.h" -#include "ble/Gap.h" -#include "ble/SecurityManager.h" -#include "ble/GattServer.h" -#include "ble/GattClient.h" - +namespace ble { +class SecurityManager; +class Gap; +class GattClient; +class GattServer; +} /** * @addtogroup ble @@ -171,7 +174,7 @@ public: * * @see BLE::gap() Gap */ - virtual Gap &getGap(void) = 0; + virtual ble::Gap &getGap(void) = 0; /** * Const alternative to getGap(). @@ -181,7 +184,7 @@ public: * * @see BLE::gap() Gap */ - virtual const Gap &getGap(void) const = 0; + virtual const ble::Gap &getGap(void) const = 0; #if BLE_FEATURE_GATT_SERVER @@ -193,7 +196,7 @@ public: * * @see BLE::gattServer() GattServer */ - virtual GattServer &getGattServer(void) = 0; + virtual ble::GattServer &getGattServer(void) = 0; /** * A const alternative to getGattServer(). @@ -203,7 +206,7 @@ public: * * @see BLE::gattServer() GattServer */ - virtual const GattServer &getGattServer(void) const = 0; + virtual const ble::GattServer &getGattServer(void) const = 0; #endif // BLE_FEATURE_GATT_SERVER #if BLE_FEATURE_GATT_CLIENT @@ -215,7 +218,7 @@ public: * * @see BLE::gattClient() GattClient */ - virtual GattClient &getGattClient(void) = 0; + virtual ble::GattClient &getGattClient(void) = 0; #endif #if BLE_FEATURE_SECURITY @@ -227,7 +230,7 @@ public: * * @see BLE::securityManager() SecurityManager */ - virtual SecurityManager &getSecurityManager(void) = 0; + virtual ble::SecurityManager &getSecurityManager(void) = 0; /** * A const alternative to getSecurityManager(). @@ -237,14 +240,8 @@ public: * * @see BLE::securityManager() SecurityManager */ - virtual const SecurityManager &getSecurityManager(void) const = 0; + virtual const ble::SecurityManager &getSecurityManager(void) const = 0; #endif // BLE_FEATURE_SECURITY - -private: - // this class is not a value type. - // prohibit copy construction and copy assignement - BLEInstanceBase(const BLEInstanceBase&); - BLEInstanceBase &operator=(const BLEInstanceBase&); }; /** diff --git a/features/FEATURE_BLE/ble/generic/FileSecurityDb.h b/connectivity/FEATURE_BLE/include/ble/internal/FileSecurityDb.h similarity index 97% rename from features/FEATURE_BLE/ble/generic/FileSecurityDb.h rename to connectivity/FEATURE_BLE/include/ble/internal/FileSecurityDb.h index 4503b497d4..59e043774e 100644 --- a/features/FEATURE_BLE/ble/generic/FileSecurityDb.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/FileSecurityDb.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -21,12 +21,11 @@ #if BLE_SECURITY_DATABASE_FILESYSTEM -#include "SecurityDb.h" - #include +#include "ble/internal/SecurityDb.h" + namespace ble { -namespace generic { /** Filesystem implementation */ class FileSecurityDb : public SecurityDb { @@ -168,7 +167,7 @@ private: uint8_t _buffer[sizeof(SecurityEntryKeys_t)]; }; -} /* namespace pal */ + } /* namespace ble */ #endif // BLE_SECURITY_DATABASE_FILESYSTEM diff --git a/features/FEATURE_BLE/ble/FunctionPointerWithContext.h b/connectivity/FEATURE_BLE/include/ble/internal/FunctionPointerWithContext.h similarity index 99% rename from features/FEATURE_BLE/ble/FunctionPointerWithContext.h rename to connectivity/FEATURE_BLE/include/ble/internal/FunctionPointerWithContext.h index 6ed7d1c41f..30025c303e 100644 --- a/features/FEATURE_BLE/ble/FunctionPointerWithContext.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/FunctionPointerWithContext.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -323,7 +325,7 @@ private: * * ReadHandler read_handler; * - * GattClient& client; + * PalGattClient& client; * * client.onDataRead( * makeFunctionPointer(&read_handler, &ReadHandler::on_data_read) diff --git a/features/FEATURE_BLE/ble/generic/KVStoreSecurityDb.h b/connectivity/FEATURE_BLE/include/ble/internal/KVStoreSecurityDb.h similarity index 98% rename from features/FEATURE_BLE/ble/generic/KVStoreSecurityDb.h rename to connectivity/FEATURE_BLE/include/ble/internal/KVStoreSecurityDb.h index 8ee56712b4..0f0dfe6516 100644 --- a/features/FEATURE_BLE/ble/generic/KVStoreSecurityDb.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/KVStoreSecurityDb.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -21,15 +21,15 @@ #ifndef GENERIC_KFSTORE_SECURITY_DB_H_ #define GENERIC_KFSTORE_SECURITY_DB_H_ -#include "SecurityDb.h" #include "kvstore_global_api.h" #include "mbed_error.h" +#include "ble/internal/SecurityDb.h" + #define STR_EXPAND(tok) #tok #define STR(tok) STR_EXPAND(tok) namespace ble { -namespace generic { /** Filesystem implementation */ class KVStoreSecurityDb : public SecurityDb { @@ -230,7 +230,6 @@ private: uint8_t _buffer[sizeof(SecurityEntryKeys_t)]; }; -} /* namespace pal */ } /* namespace ble */ #endif /*GENERIC_KFSTORE_SECURITY_DB_H_*/ diff --git a/features/FEATURE_BLE/ble/generic/MemorySecurityDb.h b/connectivity/FEATURE_BLE/include/ble/internal/MemorySecurityDb.h similarity index 98% rename from features/FEATURE_BLE/ble/generic/MemorySecurityDb.h rename to connectivity/FEATURE_BLE/include/ble/internal/MemorySecurityDb.h index 6978651784..37ad010dec 100644 --- a/features/FEATURE_BLE/ble/generic/MemorySecurityDb.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/MemorySecurityDb.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -19,10 +19,9 @@ #ifndef GENERIC_MEMORY_SECURITY_DB_H_ #define GENERIC_MEMORY_SECURITY_DB_H_ -#include "SecurityDb.h" +#include "ble/internal/SecurityDb.h" namespace ble { -namespace generic { /** Naive memory implementation for verification. */ class MemorySecurityDb : public SecurityDb { @@ -190,7 +189,6 @@ private: entry_t _entries[BLE_SECURITY_DATABASE_MAX_ENTRIES]; }; -} /* namespace pal */ } /* namespace ble */ #endif /*GENERIC_MEMORY_SECURITY_DB_H_*/ diff --git a/features/FEATURE_BLE/ble/generic/SecurityDb.h b/connectivity/FEATURE_BLE/include/ble/internal/SecurityDb.h similarity index 99% rename from features/FEATURE_BLE/ble/generic/SecurityDb.h rename to connectivity/FEATURE_BLE/include/ble/internal/SecurityDb.h index 3cd18e2f72..afc44ac6af 100644 --- a/features/FEATURE_BLE/ble/generic/SecurityDb.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/SecurityDb.h @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -19,15 +19,14 @@ #ifndef GENERIC_SECURITY_MANAGER_DB_H__ #define GENERIC_SECURITY_MANAGER_DB_H__ -#include "platform/Callback.h" -#include "ble/pal/GapTypes.h" -#include "ble/BLETypes.h" -#include "ble/Gap.h" #include +#include "platform/Callback.h" + +#include "ble/internal/pal/GapTypes.h" +#include "ble/types/BLETypes.h" +#include "ble/Gap.h" namespace ble { -namespace generic { - /** * Security flags associated with a bond. @@ -788,7 +787,6 @@ protected: sign_count_t _local_sign_counter; }; -} /* namespace pal */ } /* namespace ble */ #endif /*GENERIC_SECURITY_MANAGER_DB_H__*/ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioBLE.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioBLEInstanceBase.h similarity index 73% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/CordioBLE.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioBLEInstanceBase.h index fefe742f2e..d5b080f025 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioBLE.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioBLEInstanceBase.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,41 +20,40 @@ #define CORDIO_BLE_H_ #include "ble/BLE.h" -#include "ble/blecommon.h" -#include "ble/BLEInstanceBase.h" +#include "ble/types/blecommon.h" +#include "ble/internal/BLEInstanceBase.h" #include "CordioHCIDriver.h" -#include "CordioGattServer.h" +#include "ble/GattServer.h" #include "CordioPalAttClient.h" -#include "ble/pal/AttClientToGattClientAdapter.h" -#include "ble/generic/GenericGattClient.h" -#include "CordioPalGap.h" +#include "CordioPalGattClient.h" +#include "ble/GattClient.h" +#include "ble/internal/pal/PalGap.h" +#include "ble/Gap.h" #include "CordioPalGenericAccessService.h" -#include "ble/generic/GenericGap.h" -#include "ble/generic/GenericSecurityManager.h" -#include "SimpleEventQueue.h" +#include "ble/SecurityManager.h" +#include "CordioPalEventQueue.h" #include "drivers/LowPowerTimer.h" -#include "SigningMonitorProxy.h" -#include "CordioPalSecurityManager.h" -#include "BleImplementationForward.h" +#include "ble/internal/pal/PalSecurityManager.h" namespace ble { -namespace vendor { -namespace cordio { + +class PalSigningMonitor; /** * @see BLEInstanceBase */ -class BLE : public ::BLEInstanceBase { +class CordioBLEInstanceBase : public BLEInstanceBase { + friend PalSigningMonitor; /** * Construction with an HCI driver. */ - BLE(CordioHCIDriver& hci_driver); + CordioBLEInstanceBase(CordioHCIDriver& hci_driver); /** * Destructor */ - virtual ~BLE(); + virtual ~CordioBLEInstanceBase(); public: @@ -60,7 +61,7 @@ public: * Access to the singleton containing the implementation of BLEInstanceBase * for the Cordio stack. */ - static BLE& deviceInstance(); + static CordioBLEInstanceBase& deviceInstance(); /** * @see BLEInstanceBase::init @@ -88,12 +89,12 @@ public: /** * @see BLEInstanceBase::getGap */ - virtual impl::GenericGapImpl& getGap(); + virtual ble::Gap& getGap(); /** * @see BLEInstanceBase::getGap */ - virtual const impl::GenericGapImpl& getGap() const; + virtual const ble::Gap& getGap() const; #if BLE_FEATURE_GATT_SERVER /** @@ -111,26 +112,26 @@ public: /** * @see BLEInstanceBase::getGattClient */ - virtual impl::GenericGattClientImpl &getGattClient(); + virtual ble::GattClient &getGattClient(); /** * Get the PAL Gatt Client. * * @return PAL Gatt Client. */ - impl::PalGattClientImpl &getPalGattClient(); + PalGattClient &getPalGattClient(); #endif // BLE_FEATURE_GATT_CLIENT #if BLE_FEATURE_SECURITY /** * @see BLEInstanceBase::getSecurityManager */ - virtual SecurityManager &getSecurityManager(); + virtual ble::SecurityManager &getSecurityManager(); /** * @see BLEInstanceBase::getSecurityManager */ - virtual const SecurityManager &getSecurityManager() const; + virtual const ble::SecurityManager &getSecurityManager() const; #endif // BLE_FEATURE_SECURITY @@ -145,12 +146,6 @@ public: virtual void processEvents(); private: - /** - * Return singleton. - * @return GenericGap instance. - */ - const impl::GenericGapImpl& getGenericGap() const; - static void stack_handler(wsfEventMask_t event, wsfMsgHdr_t* msg); static void device_manager_cb(dmEvt_t* dm_event); static void connection_handler(dmEvt_t* dm_event); @@ -170,13 +165,11 @@ private: } initialization_status; ::BLE::InstanceID_t instanceID; - mutable SimpleEventQueue _event_queue; + mutable ble::PalEventQueue _event_queue; mbed::LowPowerTimer _timer; uint64_t _last_update_us; }; -} // namespace cordio -} // namespace vendor } // namespace ble diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGap.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGap.h new file mode 100644 index 0000000000..35d8b1d510 --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGap.h @@ -0,0 +1,603 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BLE_CORDIO_GAP_GAP_H +#define BLE_CORDIO_GAP_GAP_H + +#include "CallChainOfFunctionPointersWithContext.h" + +#include + +#include "drivers/LowPowerTimeout.h" +#include "drivers/LowPowerTicker.h" +#include "platform/mbed_error.h" + +#include "ble/types/BLERoles.h" +#include "ble/types/BLETypes.h" +#include "ble/types/gap/AdvertisingDataBuilder.h" +#include "ble/types/gap/AdvertisingDataSimpleBuilder.h" +#include "ble/types/gap/ConnectionParameters.h" +#include "ble/types/gap/ScanParameters.h" +#include "ble/types/gap/AdvertisingParameters.h" +#include "ble/types/gap/Events.h" + +#include "ble/internal/pal/PalGap.h" +#include "ble/internal/pal/GapEvents.h" +#include "ble/internal/pal/GapTypes.h" +#include "ble/internal/pal/PalEventQueue.h" +#include "ble/internal/pal/PalConnectionMonitor.h" +#include "CordioPalEventQueue.h" + +#include "ble/Gap.h" + +namespace ble { + +class PalGenericAccessService; +class PalSecurityManager; +class PalGap; +class CordioBLEInstanceBase; + +class Gap : + public ble::interface::Gap, + public PalConnectionMonitor, + public PalGapEventHandler +{ + friend PalConnectionMonitor; + friend PalGapEventHandler; + friend PalGap; + friend CordioBLEInstanceBase; +public: + /** + * Default peripheral privacy configuration. + */ + static const peripheral_privacy_configuration_t + default_peripheral_privacy_configuration; + + /** + * Default peripheral privacy configuration. + */ + static const central_privacy_configuration_t + default_central_privacy_configuration; + +public: + void setEventHandler(EventHandler *handler); + + bool isFeatureSupported(controller_supported_features_t feature); + + /* advertising */ +#if BLE_ROLE_BROADCASTER + + uint8_t getMaxAdvertisingSetNumber(); + + uint16_t getMaxAdvertisingDataLength(); + + uint16_t getMaxConnectableAdvertisingDataLength(); + + uint16_t getMaxActiveSetAdvertisingDataLength(); + +#if BLE_FEATURE_EXTENDED_ADVERTISING + + ble_error_t createAdvertisingSet( + advertising_handle_t *handle, + const AdvertisingParameters ¶meters + ); + + ble_error_t destroyAdvertisingSet(advertising_handle_t handle); +#endif // BLE_FEATURE_EXTENDED_ADVERTISING + + ble_error_t setAdvertisingParameters( + advertising_handle_t handle, + const AdvertisingParameters ¶ms + ); + + ble_error_t setAdvertisingPayload( + advertising_handle_t handle, + mbed::Span payload + ); + + ble_error_t setAdvertisingScanResponse( + advertising_handle_t handle, + mbed::Span response + ); + + ble_error_t startAdvertising( + advertising_handle_t handle, + adv_duration_t maxDuration = adv_duration_t::forever(), + uint8_t maxEvents = 0 + ); + + ble_error_t stopAdvertising(advertising_handle_t handle); + + bool isAdvertisingActive(advertising_handle_t handle); +#endif // BLE_ROLE_BROADCASTER + +#if BLE_ROLE_BROADCASTER +#if BLE_FEATURE_PERIODIC_ADVERTISING + + ble_error_t setPeriodicAdvertisingParameters( + advertising_handle_t handle, + periodic_interval_t periodicAdvertisingIntervalMin, + periodic_interval_t periodicAdvertisingIntervalMax, + bool advertiseTxPower = true + ); + + ble_error_t setPeriodicAdvertisingPayload( + advertising_handle_t handle, + mbed::Span payload + ); + + ble_error_t startPeriodicAdvertising(advertising_handle_t handle); + + ble_error_t stopPeriodicAdvertising(advertising_handle_t handle); + + bool isPeriodicAdvertisingActive(advertising_handle_t handle); +#endif // BLE_ROLE_BROADCASTER +#endif // BLE_FEATURE_PERIODIC_ADVERTISING + + /* scanning */ +#if BLE_ROLE_OBSERVER + + ble_error_t setScanParameters(const ScanParameters ¶ms); + + ble_error_t startScan( + scan_duration_t duration = scan_duration_t::forever(), + duplicates_filter_t filtering = duplicates_filter_t::DISABLE, + scan_period_t period = scan_period_t(0) + ); + + ble_error_t stopScan(); +#endif // BLE_ROLE_OBSERVER + +#if BLE_ROLE_OBSERVER +#if BLE_FEATURE_PERIODIC_ADVERTISING + + ble_error_t createSync( + peer_address_type_t peerAddressType, + const address_t &peerAddress, + uint8_t sid, + slave_latency_t maxPacketSkip, + sync_timeout_t timeout + ); + + ble_error_t createSync( + slave_latency_t maxPacketSkip, + sync_timeout_t timeout + ); + + ble_error_t cancelCreateSync(); + + ble_error_t terminateSync(periodic_sync_handle_t handle); + + ble_error_t addDeviceToPeriodicAdvertiserList( + peer_address_type_t peerAddressType, + const address_t &peerAddress, + advertising_sid_t sid + ); + + ble_error_t removeDeviceFromPeriodicAdvertiserList( + peer_address_type_t peerAddressType, + const address_t &peerAddress, + advertising_sid_t sid + ); + + ble_error_t clearPeriodicAdvertiserList(); + + uint8_t getMaxPeriodicAdvertiserListSize(); +#endif // BLE_ROLE_OBSERVER +#endif // BLE_FEATURE_PERIODIC_ADVERTISING + +#if BLE_ROLE_CENTRAL + + ble_error_t connect( + peer_address_type_t peerAddressType, + const address_t &peerAddress, + const ConnectionParameters &connectionParams + ); + + ble_error_t cancelConnect(); +#endif // BLE_ROLE_CENTRAL + +#if BLE_FEATURE_CONNECTABLE + + ble_error_t updateConnectionParameters( + connection_handle_t connectionHandle, + conn_interval_t minConnectionInterval, + conn_interval_t maxConnectionInterval, + slave_latency_t slaveLatency, + supervision_timeout_t supervision_timeout, + conn_event_length_t minConnectionEventLength = conn_event_length_t(0), + conn_event_length_t maxConnectionEventLength = conn_event_length_t(0) + ); + + ble_error_t manageConnectionParametersUpdateRequest( + bool userManageConnectionUpdateRequest + ); + + ble_error_t acceptConnectionParametersUpdate( + connection_handle_t connectionHandle, + conn_interval_t minConnectionInterval, + conn_interval_t maxConnectionInterval, + slave_latency_t slaveLatency, + supervision_timeout_t supervision_timeout, + conn_event_length_t minConnectionEventLength = conn_event_length_t(0), + conn_event_length_t maxConnectionEventLength = conn_event_length_t(0) + ); + + ble_error_t rejectConnectionParametersUpdate( + connection_handle_t connectionHandle + ); + + ble_error_t disconnect( + connection_handle_t connectionHandle, + local_disconnection_reason_t reason + ); +#endif // BLE_FEATURE_CONNECTABLE +#if BLE_FEATURE_PHY_MANAGEMENT + + ble_error_t readPhy(connection_handle_t connection); + + ble_error_t setPreferredPhys( + const phy_set_t *txPhys, + const phy_set_t *rxPhys + ); + + ble_error_t setPhy( + connection_handle_t connection, + const phy_set_t *txPhys, + const phy_set_t *rxPhys, + coded_symbol_per_bit_t codedSymbol + ); +#endif // BLE_FEATURE_PHY_MANAGEMENT + +#if BLE_FEATURE_PRIVACY + + ble_error_t enablePrivacy(bool enable); + +#if BLE_ROLE_BROADCASTER + + ble_error_t setPeripheralPrivacyConfiguration( + const peripheral_privacy_configuration_t *configuration + ); + + ble_error_t getPeripheralPrivacyConfiguration( + peripheral_privacy_configuration_t *configuration + ); +#endif // BLE_ROLE_BROADCASTER + +#if BLE_ROLE_OBSERVER + + ble_error_t setCentralPrivacyConfiguration( + const central_privacy_configuration_t *configuration + ); + + ble_error_t getCentralPrivacyConfiguration( + central_privacy_configuration_t *configuration + ); +#endif // BLE_ROLE_OBSERVER +#endif // BLE_FEATURE_PRIVACY + +#if BLE_FEATURE_WHITELIST + + uint8_t getMaxWhitelistSize(void) const; + + ble_error_t getWhitelist(whitelist_t &whitelist) const; + + ble_error_t setWhitelist(const whitelist_t &whitelist); + +#endif // BLE_FEATURE_WHITELIST + + ble_error_t getAddress( + own_address_type_t &typeP, + address_t &address + ); + + static ble_error_t getRandomAddressType( + const ble::address_t address, + ble::random_address_type_t *addressType + ); + + ble_error_t reset(void); + + void onShutdown(const GapShutdownCallback_t &callback); + + template + void onShutdown(T *objPtr, void (T::*memberPtr)(const Gap *)); + + GapShutdownCallbackChain_t &onShutdown(); + +#if !defined(DOXYGEN_ONLY) + /* + * API reserved for the controller driver to set the random static address. + * Setting a new random static address while the controller is operating is + * forbidden by the Bluetooth specification. + */ + ble_error_t setRandomStaticAddress(const ble::address_t& address); +#endif // !defined(DOXYGEN_ONLY) + + /* ===================================================================== */ + /* private implementation follows */ + +private: + /* Disallow copy and assignment. */ + Gap(const Gap &); + Gap& operator=(const Gap &); + + Gap( + PalEventQueue &event_queue, + PalGap &pal_gap, + PalGenericAccessService &generic_access_service, + PalSecurityManager &pal_sm + ); + + ~Gap(); + + ble_error_t setAdvertisingData( + advertising_handle_t handle, + Span payload, + bool minimiseFragmentation, + bool scan_response + ); + + void on_advertising_timeout(); + + void process_advertising_timeout(); + + void on_gap_event_received(const GapEvent &e); + + void on_advertising_report(const GapAdvertisingReportEvent &e); + + void on_connection_complete(const GapConnectionCompleteEvent &e); + + void on_disconnection_complete(const GapDisconnectionCompleteEvent &e); + + void on_connection_parameter_request( + const GapRemoteConnectionParameterRequestEvent &e + ); + + void on_connection_update(const GapConnectionUpdateEvent &e); + + void on_unexpected_error(const GapUnexpectedErrorEvent &e); + + enum AddressUseType_t { + CENTRAL_CONNECTION, + CENTRAL_SCAN, + PERIPHERAL_CONNECTABLE, + PERIPHERAL_NON_CONNECTABLE + }; + + own_address_type_t get_own_address_type(AddressUseType_t address_use_type); + + bool initialize_whitelist() const; + + ble_error_t update_address_resolution_setting(); + + void set_random_address_rotation(bool enable); + + void update_random_address(); + + bool getUnresolvableRandomAddress(ble::address_t &address); + + void on_address_rotation_timeout(); + + ble_error_t setExtendedAdvertisingParameters( + advertising_handle_t handle, + const AdvertisingParameters ¶meters + ); + + bool is_extended_advertising_available(); + + void prepare_legacy_advertising_set(); + + /* implements PalGap::EventHandler */ +private: + void on_read_phy( + hci_error_code_t hci_status, + connection_handle_t connection_handle, + phy_t tx_phy, + phy_t rx_phy + ); + + void on_data_length_change( + connection_handle_t connection_handle, + uint16_t tx_size, + uint16_t rx_size + ); + + void on_phy_update_complete( + hci_error_code_t hci_status, + connection_handle_t connection_handle, + phy_t tx_phy, + phy_t rx_phy + ); + + void on_enhanced_connection_complete( + hci_error_code_t status, + connection_handle_t connection_handle, + connection_role_t own_role, + connection_peer_address_type_t peer_address_type, + const ble::address_t &peer_address, + const ble::address_t &local_resolvable_private_address, + const ble::address_t &peer_resolvable_private_address, + uint16_t connection_interval, + uint16_t connection_latency, + uint16_t supervision_timeout, + clock_accuracy_t master_clock_accuracy + ); + + void on_extended_advertising_report( + advertising_event_t event_type, + const connection_peer_address_type_t *address_type, + const ble::address_t &address, + phy_t primary_phy, + const phy_t *secondary_phy, + advertising_sid_t advertising_sid, + advertising_power_t tx_power, + rssi_t rssi, + uint16_t periodic_advertising_interval, + direct_address_type_t direct_address_type, + const ble::address_t &direct_address, + uint8_t data_length, + const uint8_t *data + ); + + void on_periodic_advertising_sync_established( + hci_error_code_t error, + sync_handle_t sync_handle, + advertising_sid_t advertising_sid, + connection_peer_address_type_t advertiser_address_type, + const ble::address_t &advertiser_address, + phy_t advertiser_phy, + uint16_t periodic_advertising_interval, + clock_accuracy_t clock_accuracy + ); + + void on_periodic_advertising_report( + sync_handle_t sync_handle, + advertising_power_t tx_power, + rssi_t rssi, + advertising_data_status_t data_status, + uint8_t data_length, + const uint8_t *data + ); + + void on_periodic_advertising_sync_loss(sync_handle_t sync_handle); + + void on_advertising_set_terminated( + hci_error_code_t status, + advertising_handle_t advertising_handle, + connection_handle_t connection_handle, + uint8_t number_of_completed_extended_advertising_events + ); + + void on_scan_request_received( + advertising_handle_t advertising_handle, + connection_peer_address_type_t scanner_address_type, + const ble::address_t &address + ); + + void on_connection_update_complete( + hci_error_code_t status, + connection_handle_t connection_handle, + uint16_t connection_interval, + uint16_t connection_latency, + uint16_t supervision_timeout + ); + + void on_remote_connection_parameter( + connection_handle_t connection_handle, + uint16_t connection_interval_min, + uint16_t connection_interval_max, + uint16_t connection_latency, + uint16_t supervision_timeout + ); + + void on_scan_timeout(); + void process_legacy_scan_timeout(); + +private: + /** + * Callchain containing all registered callback handlers for shutdown + * events. + */ + GapShutdownCallbackChain_t shutdownCallChain; + + /** + * Event handler provided by the application. + */ + ble::Gap::EventHandler *_event_handler; + + PalEventQueue &_event_queue; + PalGap &_pal_gap; + PalGenericAccessService &_gap_service; + PalSecurityManager &_pal_sm; + ble::own_address_type_t _address_type; + ble::address_t _address; + initiator_policy_t _initiator_policy_mode; + scanning_filter_policy_t _scanning_filter_policy; + advertising_filter_policy_t _advertising_filter_policy; + mutable whitelist_t _whitelist; + + bool _privacy_enabled; + peripheral_privacy_configuration_t _peripheral_privacy_configuration; + central_privacy_configuration_t _central_privacy_configuration; + ble::address_t _random_static_identity_address; + bool _random_address_rotating; + + bool _scan_enabled; + mbed::LowPowerTimeout _advertising_timeout; + mbed::LowPowerTimeout _scan_timeout; + mbed::LowPowerTicker _address_rotation_ticker; + + template + struct BitArray { + BitArray() : data() + { + } + + bool get(size_t index) const + { + position p(index); + return (data[p.byte_index] >> p.bit_index) & 0x01; + } + + void set(size_t index) + { + position p(index); + data[p.byte_index] |= (0x01 << p.bit_index); + } + + void clear(size_t index) + { + position p(index); + data[p.byte_index] &= ~(0x01 << p.bit_index); + } + + void clear() + { + for (size_t i = 0; i < (bit_size / 8 + 1); ++i) { + data[i] = 0; + } + } + + private: + struct position { + position(size_t bit_number) : + byte_index(bit_number / 8), + bit_index(bit_number % 8) + { + } + + size_t byte_index; + uint8_t bit_index; + }; + + uint8_t data[bit_size / 8 + 1]; + }; + + BitArray _existing_sets; + BitArray _active_sets; + BitArray _active_periodic_sets; + BitArray _connectable_payload_size_exceeded; + BitArray _set_is_connectable; + + bool _user_manage_connection_parameter_requests : 1; +}; + +} // namespace ble + +#endif //BLE_CORDIO_GAP_GAP_H diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattClient.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattClient.h new file mode 100644 index 0000000000..a90f2155d5 --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattClient.h @@ -0,0 +1,242 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MBED_CORDIO_GATT_CLIENT_H__ +#define MBED_CORDIO_GATT_CLIENT_H__ + +#include "CallChainOfFunctionPointersWithContext.h" +#include + +#include "ble/types/blecommon.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/ServiceDiscovery.h" +#include "ble/types/CharacteristicDescriptorDiscovery.h" +#include "ble/types/GattCallbackParamTypes.h" +#include "ble/internal/cordio/CordioPalGattClient.h" +#include "ble/internal/cordio/CordioPalSigningMonitor.h" +#include "ble/GattClient.h" + +namespace ble { + +class GattClient : + public ble::interface::GattClient, + public PalSigningMonitor, + public PalGattClientEventHandler +{ + friend PalSigningMonitor; + friend CordioBLEInstanceBase; +public: + void setEventHandler(EventHandler *handler); + + ble_error_t launchServiceDiscovery( + ble::connection_handle_t connectionHandle, + ServiceDiscovery::ServiceCallback_t sc = NULL, + ServiceDiscovery::CharacteristicCallback_t cc = NULL, + const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN), + const UUID &matchingCharacteristicUUIDIn = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN) + ); + + ble_error_t discoverServices( + ble::connection_handle_t connectionHandle, + ServiceDiscovery::ServiceCallback_t callback, + const UUID &matchingServiceUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN) + ); + + ble_error_t discoverServices( + ble::connection_handle_t connectionHandle, + ServiceDiscovery::ServiceCallback_t callback, + GattAttribute::Handle_t startHandle, + GattAttribute::Handle_t endHandle + ); + + bool isServiceDiscoveryActive(void) const; + + void terminateServiceDiscovery(void); + + ble_error_t read( + ble::connection_handle_t connHandle, + GattAttribute::Handle_t attributeHandle, + uint16_t offset + ) const; + + ble_error_t write( + GattClient::WriteOp_t cmd, + ble::connection_handle_t connHandle, + GattAttribute::Handle_t attributeHandle, + size_t length, + const uint8_t *value + ) const; + + /* Event callback handlers. */ + + void onDataRead(ReadCallback_t callback); + + ReadCallbackChain_t& onDataRead(); + + void onDataWritten(WriteCallback_t callback); + + WriteCallbackChain_t& onDataWritten(); + + void onServiceDiscoveryTermination( + ServiceDiscovery::TerminationCallback_t callback + ); + + ble_error_t discoverCharacteristicDescriptors( + const DiscoveredCharacteristic& characteristic, + const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, + const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback + ); + + bool isCharacteristicDescriptorDiscoveryActive( + const DiscoveredCharacteristic& characteristic + ) const; + + void terminateCharacteristicDescriptorDiscovery( + const DiscoveredCharacteristic& characteristic + ); + + ble_error_t negotiateAttMtu(ble::connection_handle_t connection); + + /** + * Register an handler for Handle Value Notification/Indication events. + * + * @param callback Event handler to register. + * + * @note It is possible to unregister a callback by using + * onHVX().detach(callbackToRemove). + */ + void onHVX(HVXCallback_t callback); + + void onShutdown(const GattClientShutdownCallback_t& callback); + + template + void onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *)); + + GattClientShutdownCallbackChain_t& onShutdown(); + + HVXCallbackChain_t& onHVX(); + + ble_error_t reset(void); + + /* Entry points for the underlying stack to report events back to the user. */ + + void processReadResponse(const GattReadCallbackParams *params); + + void processWriteResponse(const GattWriteCallbackParams *params); + + void processHVXEvent(const GattHVXCallbackParams *params); + +private: + /* Disallow copy and assignment. */ + GattClient(const GattClient &); + GattClient& operator=(const GattClient &); + + /* ===================================================================== */ + /* private implementation follows */ + +private: + /** + * @see ble::PalSigningMonitor::set_signing_event_handler + */ + void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler); + + /** + * @see PalGattClient::EventHandler::on_att_mtu_change + */ + void on_att_mtu_change( + ble::connection_handle_t connection_handle, + uint16_t att_mtu_size + ); + + /** + * @see PalGattClient::EventHandler::on_write_command_sent + */ + void on_write_command_sent( + ble::connection_handle_t connection_handle, + ble::attribute_handle_t attribute_handle, + uint8_t status + ); + +private: + struct ProcedureControlBlock; + struct DiscoveryControlBlock; + struct ReadControlBlock; + struct WriteControlBlock; + struct DescriptorDiscoveryControlBlock; + + ProcedureControlBlock* get_control_block(connection_handle_t connection); + const ProcedureControlBlock* get_control_block(connection_handle_t connection) const; + void insert_control_block(ProcedureControlBlock* cb) const; + void remove_control_block(ProcedureControlBlock* cb) const; + + void on_termination(connection_handle_t connection_handle); + void on_server_message_received(connection_handle_t, const AttServerMessage&); + void on_server_response(connection_handle_t, const AttServerMessage&); + void on_server_event(connection_handle_t, const AttServerMessage&); + void on_transaction_timeout(connection_handle_t); + + uint16_t get_mtu(connection_handle_t connection) const; + +private: + /** + * Event handler provided by the application. + */ + EventHandler *eventHandler; + + /** + * Callchain containing all registered event handlers for data read + * events. + */ + ReadCallbackChain_t onDataReadCallbackChain; + + /** + * Callchain containing all registered event handlers for data write + * events. + */ + WriteCallbackChain_t onDataWriteCallbackChain; + + /** + * Callchain containing all registered event handlers for update + * events. + */ + HVXCallbackChain_t onHVXCallbackChain; + + /** + * Callchain containing all registered event handlers for shutdown + * events. + */ + GattClientShutdownCallbackChain_t shutdownCallChain; + + PalGattClient& _pal_client; + ServiceDiscovery::TerminationCallback_t _termination_callback; + PalSigningMonitorEventHandler* _signing_event_handler; + mutable ProcedureControlBlock* control_blocks; + bool _is_reseting; + +private: + /** + * Create a PalGattClient from a PalGattClient + */ + GattClient(PalGattClient& pal_client); + + ~GattClient() { } +}; + +} // namespace ble + +#endif /* ifndef MBED_CORDIO_GATT_CLIENT_H__ */ diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattServer.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattServer.h new file mode 100644 index 0000000000..a9a96274fb --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioGattServer.h @@ -0,0 +1,388 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MBED_CORDIO_GATT_SERVER_H__ +#define MBED_CORDIO_GATT_SERVER_H__ + +#include "CallChainOfFunctionPointersWithContext.h" + +#include "ble/types/GattService.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/GattServerEvents.h" +#include "ble/types/GattCallbackParamTypes.h" + +#include +#include "ble/types/blecommon.h" +#include "ble/Gap.h" +#include "wsf_types.h" +#include "att_api.h" +#include "SecurityManager.h" + +#include "ble/BLE.h" +#include "ble/types/GattCallbackParamTypes.h" +#include "ble/internal/cordio/CordioPalSigningMonitor.h" + +/*! Maximum count of characteristics that can be stored for authorisation purposes */ +#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20 + +/*! client characteristic configuration descriptors settings */ +#define MAX_CCCD_CNT 20 + +namespace ble { + +// fwd declaration of PalAttClient and BLE +class PalAttClient; +class BLE; + +class GattServer : + public ble::interface::GattServer, + public PalSigningMonitor +{ + friend ble::BLE; + friend ble::PalAttClient; + friend PalSigningMonitor; + friend CordioBLEInstanceBase; + friend PalGenericAccessService; + +// inherited typedefs have the wrong types so we have to redefine them +public: + + typedef FunctionPointerWithContext + GattServerShutdownCallback_t; + + typedef CallChainOfFunctionPointersWithContext + GattServerShutdownCallbackChain_t; +public: + + void setEventHandler(EventHandler *handler); + + ble_error_t reset(void); + + ble_error_t addService(GattService &service); + + ble_error_t read( + GattAttribute::Handle_t attributeHandle, + uint8_t buffer[], + uint16_t *lengthP + ); + + ble_error_t read( + ble::connection_handle_t connectionHandle, + GattAttribute::Handle_t attributeHandle, + uint8_t *buffer, + uint16_t *lengthP + ); + + ble_error_t write( + GattAttribute::Handle_t attributeHandle, + const uint8_t *value, + uint16_t size, + bool localOnly = false + ); + + ble_error_t write( + ble::connection_handle_t connectionHandle, + GattAttribute::Handle_t attributeHandle, + const uint8_t *value, + uint16_t size, + bool localOnly = false + ); + + ble_error_t areUpdatesEnabled( + const GattCharacteristic &characteristic, + bool *enabledP + ); + + ble_error_t areUpdatesEnabled( + ble::connection_handle_t connectionHandle, + const GattCharacteristic &characteristic, + bool *enabledP + ); + + Gap::PreferredConnectionParams_t getPreferredConnectionParams(); + + void setPreferredConnectionParams(const Gap::PreferredConnectionParams_t& params); + + bool isOnDataReadAvailable() const; + + void onDataSent(const DataSentCallback_t &callback); + + template + void onDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)); + + DataSentCallbackChain_t &onDataSent(); + + void onDataWritten(const DataWrittenCallback_t &callback) { + dataWrittenCallChain.add(callback); + } + + template + void onDataWritten( + T *objPtr, + void (T::*memberPtr)(const GattWriteCallbackParams *context) + ) { + dataWrittenCallChain.add(objPtr, memberPtr); + }; + + DataWrittenCallbackChain_t &onDataWritten(); + + ble_error_t onDataRead(const DataReadCallback_t &callback); + + template + ble_error_t onDataRead( + T *objPtr, + void (T::*memberPtr)(const GattReadCallbackParams *context) + ); + + DataReadCallbackChain_t &onDataRead(); + + void onShutdown(const GattServerShutdownCallback_t &callback); + + template + void onShutdown(T *objPtr, void (T::*memberPtr)(const GattServer *)); + + GattServerShutdownCallbackChain_t& onShutdown(); + + void onUpdatesEnabled(EventCallback_t callback); + + void onUpdatesDisabled(EventCallback_t callback); + + void onConfirmationReceived(EventCallback_t callback); + + /* Entry points for the underlying stack to report events back to the user. */ +protected: + + void handleDataWrittenEvent(const GattWriteCallbackParams *params); + + void handleDataReadEvent(const GattReadCallbackParams *params); + + void handleEvent( + GattServerEvents::gattEvent_e type, + GattAttribute::Handle_t attributeHandle + ); + + void handleDataSentEvent(unsigned count); + + /* ===================================================================== */ + /* private implementation follows */ + +#if 0 // Disabled until reworked and reintroduced to GattServer API +public: + /** + * @see ble::GattServer::setDeviceName + */ + ble_error_t setDeviceName(const uint8_t *deviceName); + + /** + * @see ble::GattServer::getDeviceName + */ + void getDeviceName(const uint8_t*& name, uint16_t& length); + + /** + * @see ble::GattServer::setAppearance + */ + void setAppearance(GapAdvertisingData::Appearance appearance); + + /** + * @see ble::GattServer::getAppearance + */ + GapAdvertisingData::Appearance getAppearance(); + +#endif // Disabled until reworked and reintroduced to GattServer API + +private: + GattServer(); + + GattServer(const GattServer &); + const GattServer& operator=(const GattServer &); + + /** + * Return the singleton of the Cordio implementation of ble::GattServer. + */ + static GattServer &getInstance(); + + /** + * Initialize the GattServer and add mandatory services (generic access and + * generic attribute service). + */ + void initialize(); + + void set_signing_event_handler( + PalSigningMonitorEventHandler *signing_event_handler + ); + + EventHandler* getEventHandler(); + + void add_default_services(); + + static uint16_t compute_attributes_count(GattService& service); + + void insert_service_attribute( + GattService& service, + attsAttr_t *&attribute_it + ); + + ble_error_t insert_characteristic( + GattCharacteristic *characteristic, + attsAttr_t *&attribute_it + ); + + bool is_characteristic_valid(GattCharacteristic *characteristic); + + void insert_characteristic_declaration_attribute( + GattCharacteristic *characteristic, + attsAttr_t *&attribute_it + ); + + ble_error_t insert_characteristic_value_attribute( + GattCharacteristic *characteristic, + attsAttr_t *&attribute_it + ); + + ble_error_t insert_descriptor( + GattCharacteristic *characteristic, + GattAttribute* descriptor, + attsAttr_t *&attribute_it, + bool& cccd_created + ); + + ble_error_t insert_cccd( + GattCharacteristic *characteristic, + attsAttr_t *&attribute_it + ); + + static void cccd_cb(attsCccEvt_t *pEvt); + static void att_cb(const attEvt_t *pEvt); + static uint8_t atts_read_cb(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr); + static uint8_t atts_write_cb(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr); + static uint8_t atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t handle); + void add_generic_access_service(); + void add_generic_attribute_service(); + void* alloc_block(size_t block_size); + GattCharacteristic* get_auth_char(uint16_t value_handle); + bool get_cccd_index_by_cccd_handle(GattAttribute::Handle_t cccd_handle, uint8_t& idx) const; + bool get_cccd_index_by_value_handle(GattAttribute::Handle_t char_handle, uint8_t& idx) const; + bool is_update_authorized(connection_handle_t connection, GattAttribute::Handle_t value_handle); + + struct alloc_block_t { + alloc_block_t* next; + uint8_t data[1]; + }; + + struct internal_service_t { + attsGroup_t attGroup; + internal_service_t *next; + }; + +private: + /** + * Event handler provided by the application. + */ + EventHandler *eventHandler; + + /** + * The total number of services added to the ATT table. + */ + uint8_t serviceCount; + + /** + * The total number of characteristics added to the ATT table. + */ + uint8_t characteristicCount; + + /** + * Callchain containing all registered callback handlers for data sent + * events. + */ + DataSentCallbackChain_t dataSentCallChain; + + /** + * Callchain containing all registered callback handlers for data written + * events. + */ + DataWrittenCallbackChain_t dataWrittenCallChain; + + /** + * Callchain containing all registered callback handlers for data read + * events. + */ + DataReadCallbackChain_t dataReadCallChain; + + /** + * Callchain containing all registered callback handlers for shutdown + * events. + */ + GattServerShutdownCallbackChain_t shutdownCallChain; + + /** + * The registered callback handler for updates enabled events. + */ + EventCallback_t updatesEnabledCallback; + + /** + * The registered callback handler for updates disabled events. + */ + EventCallback_t updatesDisabledCallback; + + /** + * The registered callback handler for confirmation received events. + */ + EventCallback_t confirmationReceivedCallback; + + PalSigningMonitorEventHandler *_signing_event_handler; + + attsCccSet_t cccds[MAX_CCCD_CNT]; + uint16_t cccd_values[MAX_CCCD_CNT]; + uint16_t cccd_handles[MAX_CCCD_CNT]; + uint8_t cccd_cnt; + + GattCharacteristic *_auth_char[MAX_CHARACTERISTIC_AUTHORIZATION_CNT]; + uint8_t _auth_char_count; + + struct { + attsGroup_t service; + attsAttr_t attributes[7]; + uint8_t device_name_declaration_value[5]; + uint16_t device_name_length; + uint8_t appearance_declaration_value[5]; + uint16_t appearance; + uint8_t ppcp_declaration_value[5]; + uint8_t ppcp[8]; + + uint8_t*& device_name_value() { + return attributes[2].pValue; + } + } generic_access_service; + + struct { + attsGroup_t service; + attsAttr_t attributes[4]; + uint8_t service_changed_declaration[5]; + } generic_attribute_service; + + internal_service_t* registered_service; + alloc_block_t* allocated_blocks; + + uint16_t currentHandle; + + bool default_services_added; +}; + +} // ble + +#endif /* ifndef MBED_CORDIO_GATT_SERVER_H__ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalAttClient.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalAttClient.h similarity index 57% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalAttClient.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalAttClient.h index ea25bcc922..ee7ef59dfb 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalAttClient.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalAttClient.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,219 +19,119 @@ #ifndef CORDIO_PAL_ATT_CLIENT_ #define CORDIO_PAL_ATT_CLIENT_ -#include "CordioGattServer.h" -#include "ble/pal/AttClient.h" -#include "ble/pal/AttClientToGattClientAdapter.h" -#include "ble/pal/SimpleAttServerMessage.h" +#include "PalSimpleAttServerMessage.h" #include "att_api.h" -#include "att_defs.h" -#include "ble/pal/PalGap.h" -#include "CordioPalGap.h" -#include "PalGattClient.h" -#include "CordioBLE.h" +#include "ble/internal/pal/PalAttClient.h" namespace ble { -namespace pal { -namespace vendor { -namespace cordio { -class CordioAttClient : public ::ble::pal::AttClient { +class PalAttClient : public interface::PalAttClient { public: - CordioAttClient() : ::ble::pal::AttClient(), _local_sign_counter(0) { } + PalAttClient(); - ~CordioAttClient() { } + ~PalAttClient(); /** - * @see ble::pal::AttClient::exchange_mtu_request + * @see ble::PalAttClient::exchange_mtu_request */ - ble_error_t exchange_mtu_request_(connection_handle_t connection) - { - AttcMtuReq(connection, pAttCfg->mtu); - return BLE_ERROR_NONE; - } + ble_error_t exchange_mtu_request(connection_handle_t connection); /** - * @see ble::pal::GattClient::get_mtu_size + * @see ble::PalGattClient::get_mtu_size */ - ble_error_t get_mtu_size_( + ble_error_t get_mtu_size( connection_handle_t connection_handle, uint16_t& mtu_size - ) { - mtu_size = AttGetMtu(connection_handle); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::find_information_request + * @see ble::PalAttClient::find_information_request */ - ble_error_t find_information_request_( + ble_error_t find_information_request( connection_handle_t connection_handle, attribute_handle_range_t discovery_range - ) { - AttcFindInfoReq( - connection_handle, - discovery_range.begin, - discovery_range.end, - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::find_by_type_value_request + * @see ble::PalAttClient::find_by_type_value_request */ - ble_error_t find_by_type_value_request_( + ble_error_t find_by_type_value_request( connection_handle_t connection_handle, attribute_handle_range_t discovery_range, uint16_t type, const Span& value - ) { - AttcFindByTypeValueReq( - connection_handle, - discovery_range.begin, - discovery_range.end, - type, - value.size(), - const_cast(value.data()), - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::read_by_type_request + * @see ble::PalAttClient::read_by_type_request */ - ble_error_t read_by_type_request_( + ble_error_t read_by_type_request( connection_handle_t connection_handle, attribute_handle_range_t read_range, const UUID& type - ) { - AttcReadByTypeReq( - connection_handle, - read_range.begin, - read_range.end, - type.getLen(), - const_cast(type.getBaseUUID()), - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::read_request + * @see ble::PalAttClient::read_request */ - ble_error_t read_request_( + ble_error_t read_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle - ) { - AttcReadReq(connection_handle, attribute_handle); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::read_blob_request + * @see ble::PalAttClient::read_blob_request */ - ble_error_t read_blob_request_( + ble_error_t read_blob_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, uint16_t offset - ) { - AttcReadLongReq( - connection_handle, - attribute_handle, - offset, - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::read_multiple_request + * @see ble::PalAttClient::read_multiple_request */ - ble_error_t read_multiple_request_( + ble_error_t read_multiple_request( connection_handle_t connection_handle, const Span& attribute_handles - ) { - AttcReadMultipleReq( - connection_handle, - attribute_handles.size(), - const_cast(attribute_handles.data()) - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::read_by_group_type_request + * @see ble::PalAttClient::read_by_group_type_request */ - ble_error_t read_by_group_type_request_( + ble_error_t read_by_group_type_request( connection_handle_t connection_handle, attribute_handle_range_t read_range, const UUID& group_type - ) { - AttcReadByGroupTypeReq( - connection_handle, - read_range.begin, - read_range.end, - group_type.getLen(), - const_cast(group_type.getBaseUUID()), - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::write_request + * @see ble::PalAttClient::write_request */ - ble_error_t write_request_( + ble_error_t write_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - AttcWriteReq( - connection_handle, - attribute_handle, - value.size(), - const_cast(value.data()) - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::write_command + * @see ble::PalAttClient::write_command */ - ble_error_t write_command_( + ble_error_t write_command( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - AttcWriteCmd( - connection_handle, - attribute_handle, - value.size(), - const_cast(value.data()) - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::signed_write_command + * @see ble::PalAttClient::signed_write_command */ - ble_error_t signed_write_command_( + ble_error_t signed_write_command( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - AttcSignedWriteCmd( - connection_handle, - attribute_handle, - _local_sign_counter, - value.size(), - const_cast(value.data()) - ); - _local_sign_counter++; - return BLE_ERROR_NONE; - } + ); /** * Initialises the counter used to sign messages. Counter will be incremented every @@ -237,78 +139,52 @@ public: * * @param sign_counter initialise the signing counter to this value */ - void set_sign_counter_( + void set_sign_counter( sign_count_t sign_counter - ) { - _local_sign_counter = sign_counter; - } + ); /** - * @see ble::pal::AttClient::prepare_write_request + * @see ble::PalAttClient::prepare_write_request */ - ble_error_t prepare_write_request_( + ble_error_t prepare_write_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, uint16_t offset, const Span& value - ) { - AttcPrepareWriteReq( - connection_handle, - attribute_handle, - offset, - value.size(), - const_cast(value.data()), - false, - false - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::execute_write_request + * @see ble::PalAttClient::execute_write_request */ - ble_error_t execute_write_request_( + ble_error_t execute_write_request( connection_handle_t connection_handle, bool execute - ) { - AttcExecuteWriteReq( - connection_handle, - execute - ); - return BLE_ERROR_NONE; - } + ); /** - * @see ble::pal::AttClient::initialize + * @see ble::PalAttClient::initialize */ - ble_error_t initialize_() - { - return BLE_ERROR_NONE; - } + ble_error_t initialize(); /** - * @see ble::pal::AttClient::terminate + * @see ble::PalAttClient::terminate */ - ble_error_t terminate_() - { - return BLE_ERROR_NONE; - } + ble_error_t terminate(); // singleton of the ARM Cordio client - static CordioAttClient& get_client() - { - static CordioAttClient _client; - return _client; - } + static PalAttClient& get_client(); + + void when_server_message_received( + mbed::Callback cb + ); + + void when_transaction_timeout( + mbed::Callback cb + ); private: // convert an array of byte to an uint16_t - static uint16_t to_uint16_t(const uint8_t* array) - { - uint16_t result; - memcpy(&result, array, sizeof(result)); - return result; - } + static uint16_t to_uint16_t(const uint8_t* array); /** * Type of an event handler. @@ -336,34 +212,14 @@ private: * @return */ template - static bool event_handler(const attEvt_t* event) - { - if (T::can_convert(event)) { - generated_handler(event, T::convert); - return true; - } - return false; - } + static bool event_handler(const attEvt_t* event); - static bool timeout_event_handler(const attEvt_t* event) - { - if(event->hdr.status != ATT_ERR_TIMEOUT) { - return false; - } - - get_client().on_transaction_timeout(event->hdr.param); - return true; - } + static bool timeout_event_handler(const attEvt_t* event); template static void generated_handler( const attEvt_t* event, ResultType (*convert)(const attEvt_t*) - ) { - get_client().on_server_event( - event->hdr.param, - convert(event) - ); - } + ); /** * Traits defining can_convert for non ErrorResponse events. @@ -402,13 +258,13 @@ private: }; /** - * Converter for a SimpleAttFindInformationResponse. + * Converter for a PalSimpleAttFindInformationResponse. */ struct FindInformationResponseConverter : ResponseConverter { - static SimpleAttFindInformationResponse convert(const attEvt_t* event) + static PalSimpleAttFindInformationResponse convert(const attEvt_t* event) { - return SimpleAttFindInformationResponse( - static_cast(event->pValue[0]), + return PalSimpleAttFindInformationResponse( + static_cast(event->pValue[0]), make_const_Span( event->pValue + 1, event->valueLen - 1 @@ -418,12 +274,12 @@ private: }; /** - * Converter for a SimpleAttFindByTypeValueResponse. + * Converter for a PalSimpleAttFindByTypeValueResponse. */ struct FindByTypeValueResponseConverter : ResponseConverter { - static SimpleAttFindByTypeValueResponse convert(const attEvt_t* event) + static PalSimpleAttFindByTypeValueResponse convert(const attEvt_t* event) { - return SimpleAttFindByTypeValueResponse( + return PalSimpleAttFindByTypeValueResponse( make_const_Span( event->pValue, event->valueLen @@ -433,12 +289,12 @@ private: }; /** - * Converter for a SimpleAttReadByTypeResponse. + * Converter for a PalSimpleAttReadByTypeResponse. */ struct ReadByTypeResponseConverter : ResponseConverter { - static SimpleAttReadByTypeResponse convert(const attEvt_t* event) + static PalSimpleAttReadByTypeResponse convert(const attEvt_t* event) { - return SimpleAttReadByTypeResponse( + return PalSimpleAttReadByTypeResponse( event->pValue[0], make_const_Span( event->pValue + 1, @@ -494,12 +350,12 @@ private: }; /** - * Converter for a SimpleAttReadByGroupTypeResponse. + * Converter for a PalSimpleAttReadByGroupTypeResponse. */ struct ReadBygroupTypeResponseConverter : ResponseConverter { - static SimpleAttReadByGroupTypeResponse convert(const attEvt_t* event) + static PalSimpleAttReadByGroupTypeResponse convert(const attEvt_t* event) { - return SimpleAttReadByGroupTypeResponse( + return PalSimpleAttReadByGroupTypeResponse( event->pValue[0], make_const_Span( event->pValue + 1, @@ -579,22 +435,44 @@ private: ); } }; +private: + /** + * Upon server message reception an implementation shall call this function. + * + * @param connection_handle The handle of the connection which has received + * the server message. + * @param server_message The message received from the server. + */ + void on_server_event( + connection_handle_t connection_handle, + const AttServerMessage& server_message + ); + + /** + * Upon transaction timeout an implementation shall call this function. + * + * @param connection_handle The handle of the connection of the transaction + * which has times out. + * + * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.3.3 + */ + void on_transaction_timeout( + connection_handle_t connection_handle + ); private: sign_count_t _local_sign_counter; + + /** + * Callback called when the client receive a message from the server. + */ + mbed::Callback _server_message_cb; + + /** + * Callback called when a transaction times out. + */ + mbed::Callback _transaction_timeout_cb; }; -template -struct CordioGattClient : pal::AttClientToGattClientAdapter { - CordioGattClient(CordioAttClient& att_client) : - pal::AttClientToGattClientAdapter(att_client) - { } - - typedef EH EventHandler; -}; - -} // cordio -} // vendor -} // pal } // ble #endif /* CORDIO_PAL_ATT_CLIENT_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/SimpleEventQueue.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalEventQueue.h similarity index 89% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/SimpleEventQueue.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalEventQueue.h index 2ed1aa34ba..9bddab0ffd 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/SimpleEventQueue.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalEventQueue.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,18 +20,18 @@ #define BLE_PAL_SIMPLE_EVENT_QUEUE_H_ #include -#include "ble/pal/EventQueue.h" -#include "ble/BLEInstanceBase.h" +#include "pal/PalEventQueue.h" +#include "ble/internal/BLEInstanceBase.h" #include "ble/BLE.h" +#include "wsf_buf.h" + namespace ble { -namespace vendor { -namespace cordio { /** - * Simple implementation of the pal::EventQueue. + * Simple implementation of the EventQueue. */ -struct SimpleEventQueue : pal::EventQueue { +struct PalEventQueue : interface::PalEventQueue { typedef mbed::Callback event_t; @@ -41,7 +43,7 @@ struct SimpleEventQueue : pal::EventQueue { * @param ble_instance_id The id of the ble instance associated with that * event queue. */ - SimpleEventQueue() : + PalEventQueue() : _ble_base(NULL), _ble_instance_id(0), _events(NULL) { } /** @@ -59,15 +61,15 @@ struct SimpleEventQueue : pal::EventQueue { } /** - * @see ble::pal::EventQueue + * @see ble::EventQueue */ - ~SimpleEventQueue() + ~PalEventQueue() { clear(); } /** - * @see ble::pal::post + * @see ble::post */ virtual bool post(const mbed::Callback& event) { @@ -144,8 +146,6 @@ private: EventNode* _events; }; -} // namespace cordio -} // namespace vendor } // namespace ble #endif /* BLE_PAL_SIMPLE_EVENT_QUEUE_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGap.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGap.h similarity index 75% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGap.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGap.h index 7fde262a64..3b94f6b23c 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGap.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGap.h @@ -1,38 +1,52 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #ifndef CORDIO_PAL_GAP_ #define CORDIO_PAL_GAP_ -#include "ble/pal/PalGap.h" +#include "ble/internal/pal/PalGap.h" #include "dm_api.h" namespace ble { -namespace pal { -namespace vendor { -namespace cordio { /** - * Implementation of ble::pal::Gap for the Cordio stack. + * Implementation of ble::PalGap for the Cordio stack. */ -template -class Gap : public ::ble::pal::Gap, EH> { - typedef ::ble::pal::Gap, EH> Base; +class PalGap : public interface::PalGap { public: - typedef EH EventHandler; + PalGap() : use_active_scanning(false), _pal_event_handler(NULL) { }; + ~PalGap() { }; - bool is_feature_supported_( + bool is_feature_supported( ble::controller_supported_features_t feature ); - ble_error_t initialize_(); + ble_error_t initialize(); - ble_error_t terminate_(); + ble_error_t terminate(); - address_t get_device_address_(); + address_t get_device_address(); - address_t get_random_address_(); + address_t get_random_address(); - ble_error_t set_random_address_(const address_t& address); + ble_error_t set_random_address(const address_t& address); - ble_error_t set_advertising_parameters_( + ble_error_t set_advertising_parameters( uint16_t advertising_interval_min, uint16_t advertising_interval_max, advertising_type_t advertising_type, @@ -43,19 +57,19 @@ public: advertising_filter_policy_t advertising_filter_policy ); - ble_error_t set_advertising_data_( + ble_error_t set_advertising_data( uint8_t advertising_data_length, const advertising_data_t& advertising_data ); - ble_error_t set_scan_response_data_( + ble_error_t set_scan_response_data( uint8_t scan_response_data_length, const advertising_data_t& scan_response_data ); - ble_error_t advertising_enable_(bool enable); + ble_error_t advertising_enable(bool enable); - ble_error_t set_scan_parameters_( + ble_error_t set_scan_parameters( bool active_scanning, uint16_t scan_interval, uint16_t scan_window, @@ -63,12 +77,12 @@ public: scanning_filter_policy_t filter_policy ); - ble_error_t scan_enable_( + ble_error_t scan_enable( bool enable, bool filter_duplicates ); - ble_error_t create_connection_( + ble_error_t create_connection( uint16_t scan_interval, uint16_t scan_window, initiator_policy_t initiator_policy, @@ -83,23 +97,23 @@ public: uint16_t maximum_connection_event_length ); - ble_error_t cancel_connection_creation_(); + ble_error_t cancel_connection_creation(); - uint8_t read_white_list_capacity_(); + uint8_t read_white_list_capacity(); - ble_error_t clear_whitelist_(); + ble_error_t clear_whitelist(); - ble_error_t add_device_to_whitelist_( + ble_error_t add_device_to_whitelist( whitelist_address_type_t address_type, address_t address ); - ble_error_t remove_device_from_whitelist_( + ble_error_t remove_device_from_whitelist( whitelist_address_type_t address_type, address_t address ); - ble_error_t connection_parameters_update_( + ble_error_t connection_parameters_update( connection_handle_t connection, uint16_t connection_interval_min, uint16_t connection_interval_max, @@ -109,7 +123,7 @@ public: uint16_t maximum_connection_event_length ); - ble_error_t accept_connection_parameter_request_( + ble_error_t accept_connection_parameter_request( connection_handle_t connection_handle, uint16_t interval_min, uint16_t interval_max, @@ -119,30 +133,30 @@ public: uint16_t maximum_connection_event_length ); - ble_error_t reject_connection_parameter_request_( + ble_error_t reject_connection_parameter_request( connection_handle_t connection_handle, hci_error_code_t rejection_reason ); - ble_error_t disconnect_( + ble_error_t disconnect( connection_handle_t connection, local_disconnection_reason_t disconnection_reason ); - bool is_privacy_supported_(); + bool is_privacy_supported(); - ble_error_t set_address_resolution_( + ble_error_t set_address_resolution( bool enable ); - ble_error_t read_phy_(connection_handle_t connection); + ble_error_t read_phy(connection_handle_t connection); - ble_error_t set_preferred_phys_( + ble_error_t set_preferred_phys( const phy_set_t& tx_phys, const phy_set_t& rx_phys ); - ble_error_t set_phy_( + ble_error_t set_phy( connection_handle_t connection, const phy_set_t& tx_phys, const phy_set_t& rx_phys, @@ -150,19 +164,19 @@ public: ); // singleton of the ARM Cordio client - static Gap& get_gap(); + static PalGap& get_gap(); /** * Callback which handle wsfMsgHdr_t and forward them to emit_gap_event. */ static void gap_handler(const wsfMsgHdr_t* msg); - ble_error_t set_advertising_set_random_address_( + ble_error_t set_advertising_set_random_address( advertising_handle_t advertising_handle, const address_t &address ); - ble_error_t set_extended_advertising_parameters_( + ble_error_t set_extended_advertising_parameters( advertising_handle_t advertising_handle, advertising_event_properties_t event_properties, advertising_interval_t primary_advertising_interval_min, @@ -180,14 +194,14 @@ public: bool scan_request_notification ); - ble_error_t set_periodic_advertising_parameters_( + ble_error_t set_periodic_advertising_parameters( advertising_handle_t advertising_handle, periodic_advertising_interval_t periodic_advertising_min, periodic_advertising_interval_t periodic_advertising_max, bool advertise_power ); - ble_error_t set_extended_advertising_data_( + ble_error_t set_extended_advertising_data( advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, @@ -195,14 +209,14 @@ public: const uint8_t *advertising_data ); - ble_error_t set_periodic_advertising_data_( + ble_error_t set_periodic_advertising_data( advertising_handle_t advertising_handle, advertising_fragment_description_t fragment_description, uint8_t advertising_data_size, const uint8_t *advertising_data ); - ble_error_t set_extended_scan_response_data_( + ble_error_t set_extended_scan_response_data( advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, @@ -210,7 +224,7 @@ public: const uint8_t *scan_response_data ); - ble_error_t extended_advertising_enable_( + ble_error_t extended_advertising_enable( bool enable, uint8_t number_of_sets, const advertising_handle_t *handles, @@ -218,26 +232,26 @@ public: const uint8_t *max_extended_advertising_events ); - ble_error_t periodic_advertising_enable_( + ble_error_t periodic_advertising_enable( bool enable, advertising_handle_t advertising_handle ); - uint16_t get_maximum_advertising_data_length_(); + uint16_t get_maximum_advertising_data_length(); - uint16_t get_maximum_connectable_advertising_data_length_(); + uint16_t get_maximum_connectable_advertising_data_length(); - uint8_t get_maximum_hci_advertising_data_length_(); + uint8_t get_maximum_hci_advertising_data_length(); - uint8_t get_max_number_of_advertising_sets_(); + uint8_t get_max_number_of_advertising_sets(); - ble_error_t remove_advertising_set_( + ble_error_t remove_advertising_set( advertising_handle_t advertising_handle ); - ble_error_t clear_advertising_sets_(); + ble_error_t clear_advertising_sets(); - ble_error_t set_extended_scan_parameters_( + ble_error_t set_extended_scan_parameters( own_address_type_t own_address_type, scanning_filter_policy_t filter_policy, phy_set_t scanning_phys, @@ -246,14 +260,14 @@ public: const uint16_t *scan_window ); - ble_error_t extended_scan_enable_( + ble_error_t extended_scan_enable( bool enable, duplicates_filter_t filter_duplicates, uint16_t duration, uint16_t period ); - ble_error_t periodic_advertising_create_sync_( + ble_error_t periodic_advertising_create_sync( bool use_periodic_advertiser_list, uint8_t advertising_sid, peer_address_type_t peer_address_type, @@ -262,29 +276,29 @@ public: uint16_t sync_timeout ); - ble_error_t cancel_periodic_advertising_create_sync_(); + ble_error_t cancel_periodic_advertising_create_sync(); - ble_error_t periodic_advertising_terminate_sync_( + ble_error_t periodic_advertising_terminate_sync( sync_handle_t sync_handle ); - ble_error_t add_device_to_periodic_advertiser_list_( + ble_error_t add_device_to_periodic_advertiser_list( advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid ); - ble_error_t remove_device_from_periodic_advertiser_list_( + ble_error_t remove_device_from_periodic_advertiser_list( advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid ); - ble_error_t clear_periodic_advertiser_list_(); + ble_error_t clear_periodic_advertiser_list(); - uint8_t read_periodic_advertiser_list_size_(); + uint8_t read_periodic_advertiser_list_size(); - ble_error_t extended_create_connection_( + ble_error_t extended_create_connection( initiator_policy_t initiator_policy, own_address_type_t own_address_type, peer_address_type_t peer_address_type, @@ -300,7 +314,28 @@ public: const uint16_t *maximum_connection_event_lengths ); + void when_gap_event_received(mbed::Callback cb); + + /** + * Sets the event handler that us called by the PAL porters to notify the stack of events + * which will in turn be passed onto the user application when appropriate. + * + * @param[in] event_handler the new event handler interface implementation. Memory + * owned by caller who is responsible for updating this pointer if interface changes. + */ + void set_event_handler(PalGapEventHandler *event_handler); + + PalGapEventHandler *get_event_handler(); + private: + + void emit_gap_event(const GapEvent &gap_event) + { + if (_gap_event_cb) { + _gap_event_cb(gap_event); + } + } + /** * T shall define a can_convert and convert function and a type */ @@ -462,16 +497,19 @@ private: ); private: + PalGapEventHandler* _pal_event_handler; address_t device_random_address; bool use_active_scanning; uint8_t extended_scan_type[3]; phy_set_t scanning_phys; direct_adv_cb_t direct_adv_cb[DM_NUM_ADV_SETS]; + + /** + * Callback called when an event is emitted by the LE subsystem. + */ + mbed::Callback _gap_event_cb; }; -} // cordio -} // vendor -} // pal } // ble #endif /* CORDIO_PAL_GAP_ */ diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGattClient.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGattClient.h new file mode 100644 index 0000000000..8b9092af09 --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGattClient.h @@ -0,0 +1,265 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ +#define BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ + +#include "ble/internal/pal/PalGattClient.h" + +namespace ble { + +class PalAttClient; + +/** + * Adapt a PalAttClient into a PalGattClient. + * + * This class let vendors define their abstraction layer in term of an PalAttClient + * and adapt any PalAttClient into a PalGattClient. + */ +class PalGattClient : public interface::PalGattClient { +public: + static const uint16_t END_ATTRIBUTE_HANDLE = 0xFFFF; + static const uint16_t SERVICE_TYPE_UUID = 0x2800; + static const uint16_t INCLUDE_TYPE_UUID = 0x2802; + static const uint16_t CHARACTERISTIC_TYPE_UUID = 0x2803; + + /** + * Construct an instance of PalGattClient from an instance of PalAttClient. + * @param client The client to adapt. + */ + PalGattClient(PalAttClient& client); + + /** + * @see ble::PalGattClient::exchange_mtu + */ + ble_error_t exchange_mtu(connection_handle_t connection); + + /** + * @see ble::PalGattClient::get_mtu_size + */ + ble_error_t get_mtu_size( + connection_handle_t connection_handle, + uint16_t& mtu_size + ); + + /** + * @see ble::PalGattClient::discover_primary_service + */ + ble_error_t discover_primary_service( + connection_handle_t connection, + attribute_handle_t discovery_range_begining + ); + + /** + * @see ble::PalGattClient::discover_primary_service_by_service_uuid + */ + ble_error_t discover_primary_service_by_service_uuid( + connection_handle_t connection_handle, + attribute_handle_t discovery_range_begining, + const UUID& uuid + ); + + /** + * @see ble::PalGattClient::find_included_service + */ + ble_error_t find_included_service( + connection_handle_t connection_handle, + attribute_handle_range_t service_range + ); + + /** + * @see ble::PalGattClient::discover_characteristics_of_a_service + */ + ble_error_t discover_characteristics_of_a_service( + connection_handle_t connection_handle, + attribute_handle_range_t discovery_range + ); + + /** + * @see ble::PalGattClient::discover_characteristics_descriptors + */ + ble_error_t discover_characteristics_descriptors( + connection_handle_t connection_handle, + attribute_handle_range_t descriptors_discovery_range + ); + + /** + * @see ble::PalGattClient::read_attribute_value + */ + ble_error_t read_attribute_value( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle + ); + + /** + * @see ble::PalGattClient::read_using_characteristic_uuid + */ + ble_error_t read_using_characteristic_uuid( + connection_handle_t connection_handle, + attribute_handle_range_t read_range, + const UUID& uuid + ); + + /** + * @see ble::PalGattClient::read_attribute_blob + */ + ble_error_t read_attribute_blob( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + uint16_t offset + ); + + /** + * @see ble::PalGattClient::read_multiple_characteristic_values + */ + ble_error_t read_multiple_characteristic_values( + connection_handle_t connection_handle, + const Span& characteristic_value_handles + ); + + /** + * @see ble::PalGattClient::write_without_response + */ + ble_error_t write_without_response( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value + ); + + /** + * @see ble::PalGattClient::signed_write_without_response + */ + ble_error_t signed_write_without_response( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value + ); + + /** + * @see ble::PalGattClient::write_attribute + */ + ble_error_t write_attribute( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + const Span& value + ); + + /** + * @see ble::PalGattClient::queue_prepare_write + */ + ble_error_t queue_prepare_write( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value, + uint16_t offset + ); + + /** + * @see ble::PalGattClient::execute_write_queue + */ + ble_error_t execute_write_queue( + connection_handle_t connection_handle, + bool execute + ); + + /** + * @see ble::PalGattClient::initialize + */ + ble_error_t initialize(); + + /** + * @see ble::PalGattClient::terminate + */ + ble_error_t terminate(); + + + /** + * @see ble::PalGattClient::when_server_message_received + */ + void when_server_message_received( + mbed::Callback cb + ) { + _server_message_cb = cb; + } + + + /** + * @see ble::PalGattClient::when_transaction_timeout + */ + void when_transaction_timeout( + mbed::Callback cb + ) { + _transaction_timeout_cb = cb; + } + + /** + * @see ble::PalGattClient::set_event_handler + */ + void set_event_handler(PalGattClientEventHandler* event_handler) { + _event_handler = event_handler; + } + + /** + * @see ble::PalGattClient::get_event_handler + */ + PalGattClientEventHandler* get_event_handler() { + return _event_handler; + } + +private: + /** + * @see ble::PalGattClient::on_server_event + */ + void on_server_event( + connection_handle_t connection_handle, + const AttServerMessage& server_message + ) { + if (_server_message_cb) { + _server_message_cb(connection_handle, server_message); + } + } + + /** + * @see ble::PalGattClient::on_transaction_timeout + */ + void on_transaction_timeout( + connection_handle_t connection_handle + ) { + if (_transaction_timeout_cb) { + _transaction_timeout_cb(connection_handle); + } + } + + PalGattClientEventHandler* _event_handler; + + /** + * Callback called when the client receive a message from the server. + */ + mbed::Callback _server_message_cb; + + /** + * Callback called when a transaction times out. + */ + mbed::Callback _transaction_timeout_cb; + + PalAttClient& _client; +}; + +} // namespace ble + +#endif /* BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ */ diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGenericAccessService.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGenericAccessService.h new file mode 100644 index 0000000000..69c8ee85bc --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalGenericAccessService.h @@ -0,0 +1,61 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CORDIO_PAL_GENERIC_ACCESS_SERVICE_ +#define CORDIO_PAL_GENERIC_ACCESS_SERVICE_ + +#include "ble/internal/pal/PalGenericAccessService.h" +#include "ble/GattServer.h" +#include "ble/Gap.h" + +namespace ble { + +/** + * Implementation of ble::PalGenericAccessService for the Cordio stack. + */ +class PalGenericAccessService : public interface::PalGenericAccessService { +public: + PalGenericAccessService() { } + + virtual ~PalGenericAccessService() { } + +#if 0 // Disabled until reworked and reintroduced to GattServer API + virtual ble_error_t get_device_name_length(uint8_t& length); + virtual ble_error_t get_device_name(Span& array); + virtual ble_error_t set_device_name(const uint8_t* device_name); + virtual ble_error_t get_appearance(GapAdvertisingData::Appearance& appearance); + virtual ble_error_t set_appearance(GapAdvertisingData::Appearance appearance); +#endif // Disabled until reworked and reintroduced to GattServer API + + virtual ble_error_t get_peripheral_preferred_connection_parameters( + ble::Gap::PreferredConnectionParams_t& parameters + ); + + virtual ble_error_t set_peripheral_preferred_connection_parameters( + const ble::Gap::PreferredConnectionParams_t& parameters + ); + +private: +#if BLE_FEATURE_GATT_SERVER + ble::GattServer& gatt_server(); +#endif // BLE_FEATURE_GATT_SERVER +}; + +} // ble + +#endif /* CORDIO_PAL_GENERIC_ACCESS_SERVICE_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSecurityManager.h similarity index 59% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSecurityManager.h index c75bc86000..bdd776409c 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSecurityManager.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +19,8 @@ #ifndef CORDIO_PAL_SECURITY_MANAGER_ #define CORDIO_PAL_SECURITY_MANAGER_ -#include "ble/pal/PalSecurityManager.h" +#include "ble/internal/pal/PalSecurityManager.h" +#include "ble/types/blecommon.h" #include "wsf_types.h" #include "wsf_os.h" #include "sec_api.h" @@ -25,77 +28,72 @@ #include "cfg_stack.h" namespace ble { -namespace pal { -namespace vendor { -namespace cordio { -template -class CordioSecurityManager : public ::ble::pal::SecurityManager, EventHandler> { +class PalSecurityManager : public interface::PalSecurityManager { public: - typedef ::ble::pal::SecurityManager, EventHandler> Base; - CordioSecurityManager(); + PalSecurityManager(); - ~CordioSecurityManager(); + ~PalSecurityManager(); //////////////////////////////////////////////////////////////////////////// // SM lifecycle management // /** - * @see ::ble::pal::SecurityManager::initialize + * @see ::ble::PalSecurityManager::initialize */ - ble_error_t initialize_(); + ble_error_t initialize(); /** - * @see ::ble::pal::SecurityManager::terminate + * @see ::ble::PalSecurityManager::terminate */ - ble_error_t terminate_(); + ble_error_t terminate(); /** - * @see ::ble::pal::SecurityManager::reset + * @see ::ble::PalSecurityManager::reset */ - ble_error_t reset_(); + ble_error_t reset(); //////////////////////////////////////////////////////////////////////////// // Resolving list management // /** - * @see ::ble::pal::SecurityManager::read_resolving_list_capacity + * @see ::ble::PalSecurityManager::read_resolving_list_capacity */ - uint8_t read_resolving_list_capacity_(); + uint8_t read_resolving_list_capacity(); /** - * @see ::ble::pal::SecurityManager::add_device_to_resolving_list + * @see ::ble::PalSecurityManager::add_device_to_resolving_list */ - ble_error_t add_device_to_resolving_list_( + ble_error_t add_device_to_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address, const irk_t &peer_irk ); /** - * @see ::ble::pal::SecurityManager::remove_device_from_resolving_list + * @see ::ble::PalSecurityManager::remove_device_from_resolving_list */ - ble_error_t remove_device_from_resolving_list_( + ble_error_t remove_device_from_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address ); /** - * @see ::ble::pal::SecurityManager::clear_resolving_list + * @see ::ble::PalSecurityManager::clear_resolving_list */ - ble_error_t clear_resolving_list_(); + ble_error_t clear_resolving_list(); //////////////////////////////////////////////////////////////////////////// // Pairing // /** - * @see ::ble::pal::SecurityManager::send_pairing_request + * @see ::ble::PalSecurityManager::send_pairing_request */ - ble_error_t send_pairing_request_( + ble_error_t send_pairing_request( connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, @@ -104,9 +102,9 @@ public: ); /** - * @see ::ble::pal::SecurityManager::send_pairing_response + * @see ::ble::PalSecurityManager::send_pairing_response */ - ble_error_t send_pairing_response_( + ble_error_t send_pairing_response( connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, @@ -115,9 +113,9 @@ public: ); /** - * @see ::ble::pal::SecurityManager::cancel_pairing + * @see ::ble::PalSecurityManager::cancel_pairing */ - ble_error_t cancel_pairing_( + ble_error_t cancel_pairing( connection_handle_t connection, pairing_failure_t reason ); @@ -126,47 +124,47 @@ public: // /** - * @see ::ble::pal::SecurityManager::get_secure_connections_support + * @see ::ble::PalSecurityManager::get_secure_connections_support */ - ble_error_t get_secure_connections_support_( + ble_error_t get_secure_connections_support( bool &enabled ); /** - * @see ::ble::pal::SecurityManager::set_io_capability + * @see ::ble::PalSecurityManager::set_io_capability */ - ble_error_t set_io_capability_(io_capability_t io_capability); + ble_error_t set_io_capability(io_capability_t io_capability); //////////////////////////////////////////////////////////////////////////// // Security settings // /** - * @see ::ble::pal::SecurityManager::set_authentication_timeout + * @see ::ble::PalSecurityManager::set_authentication_timeout */ - ble_error_t set_authentication_timeout_( + ble_error_t set_authentication_timeout( connection_handle_t, uint16_t timeout_in_10ms ); /** - * @see ::ble::pal::SecurityManager::get_authentication_timeout + * @see ::ble::PalSecurityManager::get_authentication_timeout */ - ble_error_t get_authentication_timeout_( + ble_error_t get_authentication_timeout( connection_handle_t, uint16_t &timeout_in_10ms ); /** - * @see ::ble::pal::SecurityManager::set_encryption_key_requirements + * @see ::ble::PalSecurityManager::set_encryption_key_requirements */ - ble_error_t set_encryption_key_requirements_( + ble_error_t set_encryption_key_requirements( uint8_t min_encryption_key_size, uint8_t max_encryption_key_size ); /** - * @see ::ble::pal::SecurityManager::slave_security_request + * @see ::ble::PalSecurityManager::slave_security_request */ - ble_error_t slave_security_request_( + ble_error_t slave_security_request( connection_handle_t connection, AuthenticationMask authentication ); @@ -176,9 +174,9 @@ public: // /** - * @see ::ble::pal::SecurityManager::enable_encryption + * @see ::ble::PalSecurityManager::enable_encryption */ - ble_error_t enable_encryption_( + ble_error_t enable_encryption( connection_handle_t connection, const ltk_t <k, const rand_t &rand, @@ -187,18 +185,18 @@ public: ); /** - * @see ::ble::pal::SecurityManager::enable_encryption + * @see ::ble::PalSecurityManager::enable_encryption */ - ble_error_t enable_encryption_( + ble_error_t enable_encryption( connection_handle_t connection, const ltk_t <k, bool mitm ); /** - * @see ::ble::pal::SecurityManager::encrypt_data + * @see ::ble::PalSecurityManager::encrypt_data */ - ble_error_t encrypt_data_( + ble_error_t encrypt_data( const byte_array_t<16> &key, encryption_block_t &data ); @@ -208,23 +206,23 @@ public: // /** - * @see ::ble::pal::SecurityManager::set_private_address_timeout + * @see ::ble::PalSecurityManager::set_private_address_timeout */ - ble_error_t set_private_address_timeout_(uint16_t timeout_in_seconds); + ble_error_t set_private_address_timeout(uint16_t timeout_in_seconds); /** - * @see ::ble::pal::SecurityManager::get_identity_address + * @see ::ble::PalSecurityManager::get_identity_address */ - ble_error_t get_identity_address_(address_t& address, bool& public_address); + ble_error_t get_identity_address(address_t& address, bool& public_address); //////////////////////////////////////////////////////////////////////////// // Keys // /** - * @see ::ble::pal::SecurityManager::set_ltk + * @see ::ble::PalSecurityManager::set_ltk */ - ble_error_t set_ltk_( + ble_error_t set_ltk( connection_handle_t connection, const ltk_t <k, bool mitm, @@ -232,67 +230,67 @@ public: ); /** - * @see ::ble::pal::SecurityManager::set_ltk_not_found + * @see ::ble::PalSecurityManager::set_ltk_not_found */ - ble_error_t set_ltk_not_found_( + ble_error_t set_ltk_not_found( connection_handle_t connection ); /** - * @see ::ble::pal::SecurityManager::set_irk + * @see ::ble::PalSecurityManager::set_irk */ - ble_error_t set_irk_(const irk_t &irk); + ble_error_t set_irk(const irk_t &irk); /** - * @see ::ble::pal::SecurityManager::set_csrk + * @see ::ble::PalSecurityManager::set_csrk */ - ble_error_t set_csrk_( + ble_error_t set_csrk( const csrk_t &csrk, sign_count_t sign_counter ); /** - * @see ::ble::pal::SecurityManager::set_peer_csrk + * @see ::ble::PalSecurityManager::set_peer_csrk */ - ble_error_t set_peer_csrk_( + ble_error_t set_peer_csrk( connection_handle_t connection, const csrk_t &csrk, bool authenticated, sign_count_t sign_counter ); - ble_error_t remove_peer_csrk_(connection_handle_t connection); + ble_error_t remove_peer_csrk(connection_handle_t connection); //////////////////////////////////////////////////////////////////////////// // Authentication // /** - * @see ::ble::pal::SecurityManager::get_random_data + * @see ::ble::PalSecurityManager::get_random_data */ - ble_error_t get_random_data_(byte_array_t<8> &random_data); + ble_error_t get_random_data(byte_array_t<8> &random_data); //////////////////////////////////////////////////////////////////////////// // MITM // /** - * @see ::ble::pal::SecurityManager::set_display_passkey + * @see ::ble::PalSecurityManager::set_display_passkey */ - ble_error_t set_display_passkey_(passkey_num_t passkey); + ble_error_t set_display_passkey(passkey_num_t passkey); /** - * @see ::ble::pal::SecurityManager::passkey_request_reply + * @see ::ble::PalSecurityManager::passkey_request_reply */ - ble_error_t passkey_request_reply_( + ble_error_t passkey_request_reply( connection_handle_t connection, passkey_num_t passkey ); /** - * @see ::ble::pal::SecurityManager::secure_connections_oob_request_reply + * @see ::ble::PalSecurityManager::secure_connections_oob_request_reply */ - ble_error_t secure_connections_oob_request_reply_( + ble_error_t secure_connections_oob_request_reply( connection_handle_t connection, const oob_lesc_value_t &local_random, const oob_lesc_value_t &peer_random, @@ -300,41 +298,49 @@ public: ); /** - * @see ::ble::pal::SecurityManager::legacy_pairing_oob_request_reply + * @see ::ble::PalSecurityManager::legacy_pairing_oob_request_reply */ - ble_error_t legacy_pairing_oob_request_reply_( + ble_error_t legacy_pairing_oob_request_reply( connection_handle_t connection, const oob_tk_t &oob_data ); /** - * @see ::ble::pal::SecurityManager::confirmation_entered + * @see ::ble::PalSecurityManager::confirmation_entered */ - ble_error_t confirmation_entered_( + ble_error_t confirmation_entered( connection_handle_t connection, bool confirmation ); /** - * @see ::ble::pal::SecurityManager::send_keypress_notification + * @see ::ble::PalSecurityManager::send_keypress_notification */ - ble_error_t send_keypress_notification_( - connection_handle_t connection, Keypress_t keypress + ble_error_t send_keypress_notification( + connection_handle_t connection, ble::Keypress_t keypress ); /** - * @see ::ble::pal::SecurityManager::generate_secure_connections_oob + * @see ::ble::PalSecurityManager::generate_secure_connections_oob */ - ble_error_t generate_secure_connections_oob_(); + ble_error_t generate_secure_connections_oob(); + + /** + * @see ::ble::PalSecurityManager::set_event_handler + */ + void set_event_handler(PalSecurityManagerEventHandler *event_handler); + + /** + * @see ::ble::PalSecurityManager::get_event_handler + */ + PalSecurityManagerEventHandler* get_event_handler(); // singleton of the ARM Cordio Security Manager - static CordioSecurityManager &get_security_manager(); + static PalSecurityManager &get_security_manager(); // Event handler static bool sm_handler(const wsfMsgHdr_t* msg); private: - using Base::initialize; - using Base::read_resolving_list_capacity; struct PrivacyControlBlock; struct PrivacyClearResListControlBlock; @@ -369,6 +375,8 @@ private: void cleanup_peer_csrks(); + PalSecurityManagerEventHandler* _pal_event_handler; + bool _use_default_passkey; passkey_num_t _default_passkey; bool _lesc_keys_generated; @@ -381,9 +389,6 @@ private: csrk_t* _peer_csrks[DM_CONN_MAX]; }; -} // cordio -} // vendor -} // pal } // ble #endif /* CORDIO_PAL_SECURITY_MANAGER_ */ diff --git a/features/FEATURE_BLE/ble/Gap.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSigningMonitor.h similarity index 59% rename from features/FEATURE_BLE/ble/Gap.h rename to connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSigningMonitor.h index a6d97f232e..025215a9f9 100644 --- a/features/FEATURE_BLE/ble/Gap.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioPalSigningMonitor.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +16,20 @@ * limitations under the License. */ -#ifndef MBED_BLE_GAP_H__ -#define MBED_BLE_GAP_H__ +#ifndef CORDIO_PAL_SIGNING_MONITOR_H_ +#define CORDIO_PAL_SIGNING_MONITOR_H_ -#include "ble/gap/Gap.h" -#include "BleImplementationForward.h" +#include "ble/internal/pal/PalSigningMonitor.h" -// import Gap implementation into global namespace -typedef ble::impl::Gap Gap; - -// import Gap implementation into ble namespace namespace ble { -typedef impl::Gap Gap; -} -#endif // ifndef MBED_BLE_GAP_H__ +class SecurityManager; + +class PalSigningMonitor : public interface::PalSigningMonitor { +public: + void set_signing_event_handler(SecurityManager *handler); +}; + +} // ble + +#endif // CORDIO_PAL_SIGNING_MONITOR_H_ diff --git a/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioSecurityManager.h b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioSecurityManager.h new file mode 100644 index 0000000000..4b1c665acb --- /dev/null +++ b/connectivity/FEATURE_BLE/include/ble/internal/cordio/CordioSecurityManager.h @@ -0,0 +1,619 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef BLE_CORDIO_SECURITY_MANAGER_H_ +#define BLE_CORDIO_SECURITY_MANAGER_H_ + +#include +#include "CallChainOfFunctionPointersWithContext.h" +#include "platform/Callback.h" + +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/Gap.h" + +#include "ble/internal/pal/GapTypes.h" +#include "ble/types/BLETypes.h" +#include "ble/internal/SecurityDb.h" +#include "ble/internal/pal/PalConnectionMonitor.h" +#include "ble/internal/cordio/CordioPalSigningMonitor.h" +#include "ble/internal/cordio/CordioPalSecurityManager.h" +#include "ble/SecurityManager.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" + +namespace ble { + +class SecurityManager : + public ble::interface::SecurityManager, + public ble::PalSecurityManagerEventHandler, + public ble::PalConnectionMonitorEventHandler, + public ble::PalSigningMonitorEventHandler +{ + friend class ble::PalConnectionMonitorEventHandler; + friend CordioBLEInstanceBase; + friend PalGenericAccessService; + friend PalSecurityManager; + +public: + //////////////////////////////////////////////////////////////////////////// + // SM lifecycle management + // + + ble_error_t init( + bool enableBonding = true, + bool requireMITM = true, + SecurityIOCapabilities_t iocaps = IO_CAPS_NONE, + const Passkey_t passkey = NULL, + bool signing = true, + const char *dbFilepath = NULL + ); + + ble_error_t setDatabaseFilepath(const char *dbFilepath = NULL); + + ble_error_t reset(void); + + ble_error_t preserveBondingStateOnReset(bool enable); + + //////////////////////////////////////////////////////////////////////////// + // List management + // + + ble_error_t purgeAllBondingState(void); + + ble_error_t generateWhitelistFromBondTable(::ble::whitelist_t *whitelist) const; + + //////////////////////////////////////////////////////////////////////////// + // Pairing + // + + ble_error_t requestPairing(ble::connection_handle_t connectionHandle); + + ble_error_t acceptPairingRequest(ble::connection_handle_t connectionHandle); + + ble_error_t cancelPairingRequest(ble::connection_handle_t connectionHandle); + + ble_error_t setPairingRequestAuthorisation(bool required = true); + + ble_error_t getPeerIdentity(ble::connection_handle_t connectionHandle); + + //////////////////////////////////////////////////////////////////////////// + // Feature support + // + + ble_error_t allowLegacyPairing(bool allow = true); + + ble_error_t getSecureConnectionsSupport(bool *enabled); + + //////////////////////////////////////////////////////////////////////////// + // Security settings + // + + ble_error_t setIoCapability(SecurityIOCapabilities_t iocaps); + + ble_error_t setDisplayPasskey(const Passkey_t passkey); + + ble_error_t setLinkSecurity(ble::connection_handle_t connectionHandle, SecurityMode_t securityMode); + + ble_error_t setKeypressNotification(bool enabled = true); + +#if BLE_FEATURE_SIGNING + + ble_error_t enableSigning(ble::connection_handle_t connectionHandle, bool enabled = true); +#endif // BLE_FEATURE_SIGNING + + ble_error_t setHintFutureRoleReversal(bool enable = true); + + ble_error_t setAuthenticationTimeout( + connection_handle_t connection, + uint32_t timeout_in_ms + ); + + ble_error_t getAuthenticationTimeout( + connection_handle_t connection, + uint32_t *timeout_in_ms + ); + + //////////////////////////////////////////////////////////////////////////// + // Encryption + // + + ble_error_t getLinkEncryption(ble::connection_handle_t connectionHandle, ble::link_encryption_t *encryption); + + ble_error_t setLinkEncryption(ble::connection_handle_t connectionHandle, ble::link_encryption_t encryption); + + ble_error_t setEncryptionKeyRequirements(uint8_t minimumByteSize, uint8_t maximumByteSize); + + ble_error_t getEncryptionKeySize( + connection_handle_t connectionHandle, + uint8_t *size + ); + + //////////////////////////////////////////////////////////////////////////// + // Authentication + // + + ble_error_t requestAuthentication(ble::connection_handle_t connectionHandle); + + //////////////////////////////////////////////////////////////////////////// + // MITM + // + + ble_error_t generateOOB(const ble::address_t *address); + + ble_error_t setOOBDataUsage(ble::connection_handle_t connectionHandle, bool useOOB, bool OOBProvidesMITM = true); + + ble_error_t confirmationEntered(ble::connection_handle_t connectionHandle, bool confirmation); + + ble_error_t passkeyEntered(ble::connection_handle_t connectionHandle, Passkey_t passkey); + + ble_error_t sendKeypressNotification(ble::connection_handle_t connectionHandle, ble::Keypress_t keypress); + + ble_error_t legacyPairingOobReceived(const ble::address_t *address, const ble::oob_tk_t *tk); + + ble_error_t oobReceived(const ble::address_t *address, const ble::oob_lesc_value_t *random, const ble::oob_confirm_t *confirm); + + //////////////////////////////////////////////////////////////////////////// + // Keys + // + + ble_error_t getSigningKey(ble::connection_handle_t connectionHandle, bool authenticated); + + //////////////////////////////////////////////////////////////////////////// + // Privacy + // + + ble_error_t setPrivateAddressTimeout( + uint16_t timeout_in_seconds + ); + + /* Event callback handlers. */ +public: + + void onShutdown(const SecurityManagerShutdownCallback_t& callback); + + template + void onShutdown(T *objPtr, void (T::*memberPtr)(const SecurityManager *)); + + SecurityManagerShutdownCallbackChain_t& onShutdown(); + + void setSecurityManagerEventHandler(EventHandler* handler); + + /* ===================================================================== */ + /* private implementation follows */ + + /* implements PalSecurityManager::EventHandler */ +private: + //////////////////////////////////////////////////////////////////////////// + // Pairing + // + + /** @copydoc PalSecurityManager::on_pairing_request + */ + void on_pairing_request( + connection_handle_t connection, + bool use_oob, + AuthenticationMask authentication, + KeyDistribution initiator_dist, + KeyDistribution responder_dist + ); + + /** @copydoc PalSecurityManager::on_pairing_error + */ + void on_pairing_error( + connection_handle_t connection, + pairing_failure_t error + ); + + /** @copydoc PalSecurityManager::on_pairing_timed_out + */ + void on_pairing_timed_out( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_pairing_completed + */ + void on_pairing_completed( + connection_handle_t connection + ); + + //////////////////////////////////////////////////////////////////////////// + // Security + // + + /** @copydoc PalSecurityManager::on_valid_mic_timeout + */ + void on_valid_mic_timeout( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_signed_write_received + */ + void on_signed_write_received( + connection_handle_t connection, + uint32_t sign_coutner + ); + + /** @copydoc PalSecurityManager::on_signed_write_verification_failure + */ + void on_signed_write_verification_failure( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_signed_write + */ + void on_signed_write(); + + /** @copydoc PalSecurityManager::on_slave_security_request + */ + void on_slave_security_request( + connection_handle_t connection, + AuthenticationMask authentication + ); + + //////////////////////////////////////////////////////////////////////////// + // Encryption + // + + /** @copydoc PalSecurityManager::on_link_encryption_result + */ + void on_link_encryption_result( + connection_handle_t connection, + link_encryption_t result + ); + + /** @copydoc PalSecurityManager::on_link_encryption_request_timed_out + */ + void on_link_encryption_request_timed_out( + connection_handle_t connection + ); + + //////////////////////////////////////////////////////////////////////////// + // MITM + // + + /** @copydoc PalSecurityManager::on_passkey_display + */ + void on_passkey_display( + connection_handle_t connection, + passkey_num_t passkey + ); + + /** @copydoc PalSecurityManager::on_keypress_notification + */ + void on_keypress_notification( + connection_handle_t connection, + ble::Keypress_t keypress + ); + + /** @copydoc PalSecurityManager::on_passkey_request + */ + void on_passkey_request( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_confirmation_request + */ + void on_confirmation_request( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_secure_connections_oob_request + */ + void on_secure_connections_oob_request( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_legacy_pairing_oob_request + */ + void on_legacy_pairing_oob_request( + connection_handle_t connection + ); + + /** @copydoc PalSecurityManager::on_secure_connections_oob_generated + */ + void on_secure_connections_oob_generated( + const oob_lesc_value_t &random, + const oob_confirm_t &confirm + ); + + //////////////////////////////////////////////////////////////////////////// + // Keys + // + + /** @copydoc PalSecurityManager::on_secure_connections_ltk_generated + */ + void on_secure_connections_ltk_generated( + connection_handle_t connection, + const ltk_t <k + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_ltk + */ + void on_keys_distributed_ltk( + connection_handle_t connection, + const ltk_t <k + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_ediv_rand + */ + void on_keys_distributed_ediv_rand( + connection_handle_t connection, + const ediv_t &ediv, + const rand_t &rand + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_local_ltk + */ + void on_keys_distributed_local_ltk( + connection_handle_t connection, + const ltk_t <k + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_local_ediv_rand + */ + void on_keys_distributed_local_ediv_rand( + connection_handle_t connection, + const ediv_t &ediv, + const rand_t &rand + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_irk + */ + void on_keys_distributed_irk( + connection_handle_t connection, + const irk_t &irk + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_bdaddr + */ + void on_keys_distributed_bdaddr( + connection_handle_t connection, + advertising_peer_address_type_t peer_address_type, + const address_t &peer_identity_address + ); + + /** @copydoc PalSecurityManager::on_keys_distributed_csrk + */ + void on_keys_distributed_csrk( + connection_handle_t connection, + const csrk_t &csrk + ); + + /** @copydoc PalSecurityManager::on_ltk_requeston_ltk_request + */ + void on_ltk_request( + connection_handle_t connection, + const ediv_t &ediv, + const rand_t &rand + ); + + /** @copydoc PalSecurityManager::on_ltk_requeston_ltk_request + */ + void on_ltk_request( + connection_handle_t connection + ); + + /* end implements PalSecurityManager::EventHandler */ + +private: + /* Disallow copy and assignment. */ + SecurityManager(const SecurityManager &); + SecurityManager& operator=(const SecurityManager &); + + SecurityManager( + PalSecurityManager &palImpl, + PalConnectionMonitor &connMonitorImpl, + PalSigningMonitor &signingMonitorImpl + ) : _pal(palImpl), + _connection_monitor(connMonitorImpl), + _signing_monitor(signingMonitorImpl), + _db(NULL), + _default_authentication(0), + _default_key_distribution(KeyDistribution::KEY_DISTRIBUTION_ALL), + _pairing_authorisation_required(false), + _legacy_pairing_allowed(true), + _master_sends_keys(false), + eventHandler(NULL) + { + eventHandler = &defaultEventHandler; + _pal.set_event_handler(this); + + /* We create a fake value for oob to allow creation of the next oob which needs + * the last process to finish first before restarting (this is to simplify checking). + * This fake value will not be used as the oob address is currently invalid */ + _oob_local_random[0] = 1; + } + + ~SecurityManager() + { + delete _db; + } + + //////////////////////////////////////////////////////////////////////////// + // Helper functions + // + +private: + + ble_error_t init_database(const char *db_path = NULL); + + ble_error_t init_resolving_list(); + + ble_error_t init_signing(); + + ble_error_t init_identity(); + + ble_error_t get_random_data( + uint8_t *buffer, + size_t size + ); + + ble_error_t slave_security_request( + connection_handle_t connection + ); + + ble_error_t enable_encryption( + connection_handle_t connection + ); + + void enable_encryption_cb( + SecurityDb::entry_handle_t entry, + const SecurityEntryKeys_t* entryKeys + ); + + void set_ltk_cb( + SecurityDb::entry_handle_t entry, + const SecurityEntryKeys_t* entryKeys + ); + + void return_csrk_cb( + SecurityDb::entry_handle_t connection, + const SecurityEntrySigning_t *signing + ); + + void set_peer_csrk_cb( + SecurityDb::entry_handle_t connection, + const SecurityEntrySigning_t *signing + ); + + void update_oob_presence( + connection_handle_t connection + ); + + void set_mitm_performed( + connection_handle_t connection, + bool enable = true + ); + + void on_connected( + connection_handle_t connection, + connection_role_t role, + peer_address_type_t peer_address_type, + address_t peer_address, + own_address_type_t local_address_type, + address_t local_address + ); + + void on_disconnected( + connection_handle_t connection, + disconnection_reason_t reason + ); + + void on_security_entry_retrieved( + SecurityDb::entry_handle_t entry, + const SecurityEntryIdentity_t* identity + ); + + void on_identity_list_retrieved( + Span& identity_list, + size_t count + ); + +private: + struct ControlBlock_t { + ControlBlock_t(); + + KeyDistribution get_initiator_key_distribution() { + return KeyDistribution(initiator_key_distribution); + }; + KeyDistribution get_responder_key_distribution() { + return KeyDistribution(responder_key_distribution); + }; + void set_initiator_key_distribution(KeyDistribution mask) { + initiator_key_distribution = mask.value(); + }; + void set_responder_key_distribution(KeyDistribution mask) { + responder_key_distribution = mask.value(); + }; + + connection_handle_t connection; + SecurityDb::entry_handle_t db_entry; + + address_t local_address; /**< address used for connection, possibly different from identity */ + + private: + uint8_t initiator_key_distribution:4; + uint8_t responder_key_distribution:4; + public: + uint8_t connected:1; + uint8_t authenticated:1; /**< have we turned encryption on during this connection */ + uint8_t is_master:1; + + uint8_t encryption_requested:1; + uint8_t encryption_failed:1; + uint8_t encrypted:1; + uint8_t signing_requested:1; + uint8_t signing_override_default:1; + + uint8_t mitm_requested:1; + uint8_t mitm_performed:1; /**< keys exchange will have MITM protection */ + + uint8_t attempt_oob:1; + uint8_t oob_mitm_protection:1; + uint8_t oob_present:1; + uint8_t legacy_pairing_oob_request_pending:1; + + uint8_t csrk_failures:2; + }; + + /* list management */ + + ControlBlock_t* acquire_control_block(connection_handle_t connection); + + ControlBlock_t* get_control_block(connection_handle_t connection); + + ControlBlock_t* get_control_block(const address_t &peer_address); + + ControlBlock_t* get_control_block(SecurityDb::entry_handle_t db_entry); + + void release_control_block(ControlBlock_t* entry); + +private: + SecurityManagerShutdownCallbackChain_t shutdownCallChain; + EventHandler* eventHandler; + EventHandler defaultEventHandler; + + PalSecurityManager &_pal; + PalConnectionMonitor &_connection_monitor; + PalSigningMonitor &_signing_monitor; + + SecurityDb *_db; + + /* OOB data */ + address_t _oob_local_address; + address_t _oob_peer_address; + oob_lesc_value_t _oob_peer_random; + oob_confirm_t _oob_peer_confirm; + oob_lesc_value_t _oob_local_random; + address_t _oob_temporary_key_creator_address; /**< device which generated and sent the TK */ + oob_tk_t _oob_temporary_key; /**< used for legacy pairing */ + + AuthenticationMask _default_authentication; + KeyDistribution _default_key_distribution; + + bool _pairing_authorisation_required; + bool _legacy_pairing_allowed; + bool _master_sends_keys; + + static const size_t MAX_CONTROL_BLOCKS = 5; + ControlBlock_t _control_blocks[MAX_CONTROL_BLOCKS]; +}; + +} // ble + +#endif /*BLE_CORDIO_SECURITY_MANAGER_H_*/ diff --git a/features/FEATURE_BLE/ble/pal/AttServerMessage.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/AttServerMessage.h similarity index 99% rename from features/FEATURE_BLE/ble/pal/AttServerMessage.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/AttServerMessage.h index a6e4e27634..8ee379e7e5 100644 --- a/features/FEATURE_BLE/ble/pal/AttServerMessage.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/AttServerMessage.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +19,10 @@ #ifndef BLE_PAL_ATT_SERVER_MESSAGE_H_ #define BLE_PAL_ATT_SERVER_MESSAGE_H_ -#include "ble/BLETypes.h" +#include "ble/types/BLETypes.h" +#include "ble/types/UUID.h" namespace ble { -namespace pal { /** * Operation code defined for attribute operations @@ -763,8 +765,6 @@ struct AttHandleValueIndication : public AttServerMessage { const Span attribute_value; }; - -} // namespace pal } // namespace ble #endif /* BLE_PAL_ATT_SERVER_MESSAGE_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/GapEvents.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/GapEvents.h similarity index 98% rename from features/FEATURE_BLE/ble/pal/GapEvents.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/GapEvents.h index 79eb8fcce3..81b89d4565 100644 --- a/features/FEATURE_BLE/ble/pal/GapEvents.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/GapEvents.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +19,10 @@ #ifndef BLE_PAL_GAP_MESSAGE_H_ #define BLE_PAL_GAP_MESSAGE_H_ -#include "GapTypes.h" -#include "ble/BLETypes.h" +#include "ble/internal/pal/GapTypes.h" +#include "ble/types/BLETypes.h" namespace ble { -namespace pal { /** * Enumeration of GAP event types @@ -64,7 +65,7 @@ struct GapEventType : SafeEnum { /** - * Base class of a Gap Event. + * Base class of a PalGap Event. * * Client should use the field type to deduce the actual type of the event. */ @@ -514,7 +515,6 @@ struct GapDisconnectionCompleteEvent : public GapEvent { const uint8_t reason; }; -} // namespace pal } // namespace ble #endif /* BLE_PAL_GAP_MESSAGE_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/GapTypes.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/GapTypes.h similarity index 99% rename from features/FEATURE_BLE/ble/pal/GapTypes.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/GapTypes.h index feb71f0261..5f7309adad 100644 --- a/features/FEATURE_BLE/ble/pal/GapTypes.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/GapTypes.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,11 +20,11 @@ #define BLE_PAL_GAP_TYPES_H_ #include -#include "ble/BLETypes.h" -#include "ble/SafeEnum.h" + +#include "ble/types/BLETypes.h" +#include "ble/types/SafeEnum.h" namespace ble { -namespace pal { typedef ble::advertising_type_t advertising_type_t; @@ -650,7 +652,6 @@ struct direct_address_type_t : SafeEnum { typedef ble::clock_accuracy_t clock_accuracy_t; -} // namespace pal } // namespace ble #endif /* BLE_PAL_GAP_TYPES_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/AttClient.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalAttClient.h similarity index 69% rename from features/FEATURE_BLE/ble/pal/AttClient.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalAttClient.h index 40ba77b7bf..460b20783c 100644 --- a/features/FEATURE_BLE/ble/pal/AttClient.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalAttClient.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,15 +19,15 @@ #ifndef BLE_PAL_ATTCLIENT_H_ #define BLE_PAL_ATTCLIENT_H_ -#include "ble/common/StaticInterface.h" -#include "ble/UUID.h" -#include "ble/BLETypes.h" -#include "ble/blecommon.h" #include "platform/Callback.h" -#include "AttServerMessage.h" + +#include "ble/types/UUID.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/internal/pal/AttServerMessage.h" namespace ble { -namespace pal { +namespace interface { /** * Send attribute protocol requests to an ATT server. It also handle reception @@ -39,15 +41,8 @@ namespace pal { * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F */ -template -struct AttClient : public StaticInterface { -private: - - using StaticInterface::impl; - +class PalAttClient { public: - - /** * Initialization of the instance. An implementation can use this function * to initialise the subsystems needed to realize the ATT operations of this @@ -58,9 +53,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t initialize() { - return impl()->initialize_(); - } + virtual ble_error_t initialize() = 0; /** * Termination of the instance. An implementation can use this function @@ -73,9 +66,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t terminate() { - return impl()->terminate_(); - } + virtual ble_error_t terminate() = 0; /** * Send an exchange MTU request which negotiate the size of the MTU used by @@ -94,16 +85,14 @@ public: * @return BLE_ERROR_NONE if the request has been succesfully sent or the * appropriate error otherwise. * - * @see ble::pal::AttExchangeMTUResponse The type of response received from + * @see ble::AttExchangeMTUResponse The type of response received from * the server - * @see ble::pal::AttErrorResponse::REQUEST_NOT_SUPPORTED The error code + * @see ble::AttErrorResponse::REQUEST_NOT_SUPPORTED The error code * returned by the server in case of error. * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.2.1 */ - ble_error_t exchange_mtu_request(connection_handle_t connection) { - return impl()->exchange_mtu_request_(connection); - } + virtual ble_error_t exchange_mtu_request(connection_handle_t connection) = 0; /** * Acquire the size of the mtu for a given connection. @@ -116,18 +105,16 @@ public: * @return BLE_ERROR_NONE if the MTU size has been acquired or the * appropriate error otherwise. */ - ble_error_t get_mtu_size( + virtual ble_error_t get_mtu_size( connection_handle_t connection_handle, uint16_t& mtu_size - ) { - return impl()->get_mtu_size_(connection_handle, mtu_size); - } + ) = 0; /** * Send a find information request to a server in order to obtain the * mapping of attribute handles with their associated types. * - * The server will reply with a ble::pal::AttFindInformationResponse + * The server will reply with a ble::AttFindInformationResponse * containing at least one [attribute handle, attribute type] pair. If the * last handle in the response is not equal to the end handle of the finding * range then this request can be issued again with an updated range (begin @@ -136,13 +123,13 @@ public: * To discover the whole ATT server, the first find information request * should have a discovery range of [0x0001 - 0xFFFF]. * - * The server can send a ble::pal::AttErrorResponse with the code - * ble::pal::AttErrorResponse::ATTRIBUTE_NOT_FOUND if no attributes have + * The server can send a ble::AttErrorResponse with the code + * ble::AttErrorResponse::ATTRIBUTE_NOT_FOUND if no attributes have * been found in the range specified. The attribute handle in the response * is then equal to the first handle of the discovery range. * * If the range is malformed the server will reply a - * ble::pal::AttErrorResponse with the error code ble::pal::INVALID_HANDLE. + * ble::AttErrorResponse with the error code ble::INVALID_HANDLE. * * @param connection_handle The handle of the connection to send this * request to. @@ -154,31 +141,29 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.3.1 */ - ble_error_t find_information_request( + virtual ble_error_t find_information_request( connection_handle_t connection_handle, attribute_handle_range_t discovery_range - ) { - return impl()->find_information_request_(connection_handle, discovery_range); - } + ) = 0; /** * Send a Find By Type Value Request which retrieve the handles of attributes * that have known 16-bit UUID attribute type and known attribute value. * - * The server should reply with a ble::pal::AttFindByTypeValueResponse + * The server should reply with a ble::AttFindByTypeValueResponse * containing the handle (or handle range in case of grouping attributes) of * the attribute found. * * If not all attributes can be contained in the response it is necessary to * send again this request with an updated range to continue the discovery. * - * The server can send a ble::pal::AttErrorResponse with the code - * ble::pal::AttErrorResponse::ATTRIBUTE_NOT_FOUND if no attributes have + * The server can send a ble::AttErrorResponse with the code + * ble::AttErrorResponse::ATTRIBUTE_NOT_FOUND if no attributes have * been found in the range specified. The attribute handle in the response * is then equal to the first handle of the discovery range. * * If the range is malformed the server will reply a - * ble::pal::AttErrorResponse with the error code ble::pal::INVALID_HANDLE. + * ble::AttErrorResponse with the error code ble::INVALID_HANDLE. * * @param connection_handle The handle of the connection to send this * request to. @@ -192,44 +177,37 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.3.3 */ - ble_error_t find_by_type_value_request( + virtual ble_error_t find_by_type_value_request( connection_handle_t connection_handle, attribute_handle_range_t discovery_range, uint16_t type, const Span& value - ) { - return impl()->find_by_type_value_request_( - connection_handle, - discovery_range, - type, - value - ); - } + ) = 0; /** * Send a Read By Type Request used to obtain the values of attributes where * the attribute type is known but the handle is not known. * * If attributes with the type requested are present in the range, the server - * should reply with a ble::pal::AttReadByTypeResponse. If the response does + * should reply with a ble::AttReadByTypeResponse. If the response does * not cover the full range, the request should be sent again with an updated * range. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::ATTRIBUTE_NOT_FOUND: If there is no + * - ble::AttErrorResponse::ATTRIBUTE_NOT_FOUND: If there is no * attributes matching type in the range. - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the range is + * - ble::AttErrorResponse::INVALID_HANDLE: If the range is * invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption. - * - ble::pal::AttErrorResponse::READ_NOT_PERMITTED: If the attribute + * - ble::AttErrorResponse::READ_NOT_PERMITTED: If the attribute * value cannot be read. * * @param connection_handle The handle of the connection to send this @@ -243,35 +221,33 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.4.1 */ - ble_error_t read_by_type_request( + virtual ble_error_t read_by_type_request( connection_handle_t connection_handle, attribute_handle_range_t read_range, const UUID& type - ) { - return impl()->read_by_type_request_(connection_handle, read_range, type); - } + ) = 0; /** * Send a Read Request to read the value of an attribute in the server. * - * In case of success, the server will reply with a ble::pal::AttReadResponse. + * In case of success, the server will reply with a ble::AttReadResponse. * containing the value of the attribute. If the length of the value in the * response is equal to (mtu - 1) then the remaining part of the value can * be obtained by a read_blob_request. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the attribute handle + * - ble::AttErrorResponse::INVALID_HANDLE: If the attribute handle * is invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption. - * - ble::pal::AttErrorResponse::READ_NOT_PERMITTED: If the attribute + * - ble::AttErrorResponse::READ_NOT_PERMITTED: If the attribute * value cannot be read. * Higher layer can also set an application error code (0x80 - 0x9F). * @@ -284,41 +260,39 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.4.3 */ - ble_error_t read_request( + virtual ble_error_t read_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle - ) { - return impl()->read_request_(connection_handle, attribute_handle); - } + ) = 0; /** * Send a read blob request to a server to read a part of the value of an * attribute at a given offset. * - * In case of success, the server will reply with a ble::pal::AttReadBlobResponse + * In case of success, the server will reply with a ble::AttReadBlobResponse * containing the value read. If the value of the attribute starting at the * offset requested is longer than (mtu - 1) octets then only the first * (mtu - 1) octets will be present in the response. * The remaining octets can be acquired by another Read Blob Request with an * updated index. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the attribute handle + * - ble::AttErrorResponse::INVALID_HANDLE: If the attribute handle * is invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption. - * - ble::pal::AttErrorResponse::READ_NOT_PERMITTED: If the attribute + * - ble::AttErrorResponse::READ_NOT_PERMITTED: If the attribute * value cannot be read. - * - ble::pal::AttErrorResponse::INVALID_OFFSET: If the offset is greater + * - ble::AttErrorResponse::INVALID_OFFSET: If the offset is greater * than the attribute length. - * - ble::pal::AttErrorResponse::ATTRIBUTE_NOT_LONG: If the attribute + * - ble::AttErrorResponse::ATTRIBUTE_NOT_LONG: If the attribute * value has a length that is less than or equal to (mtu - 1). * Higher layer can also set an application error code (0x80 - 0x9F). * @@ -332,38 +306,36 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.4.5 */ - ble_error_t read_blob_request( + virtual ble_error_t read_blob_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, uint16_t offset - ) { - return impl()->read_blob_request_(connection_handle, attribute_handle, offset); - } + ) = 0; /** * Send a read multiple request to the server. It is used to read two or more * attributes values at once. * * In case of success, the server will reply with a - * ble::pal::AttReadMultipleResponse containing the concatenation of the + * ble::AttReadMultipleResponse containing the concatenation of the * values read. Given that values are concatained, all attributes values * should be of fixed size except for the last one. The concatained value * is also truncated to (mtu - 1) if it doesn't fit in the response. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If any of the attribute + * - ble::AttErrorResponse::INVALID_HANDLE: If any of the attribute * handle is invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient to read any of the attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient to read any of the attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size to read any of the * attributes. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption required to read any of the attributes. - * - ble::pal::AttErrorResponse::READ_NOT_PERMITTED: If any of the + * - ble::AttErrorResponse::READ_NOT_PERMITTED: If any of the * attributes value cannot be read. * The first attribute causing the error is reporter in the handle_in_error * field in the error response. @@ -378,18 +350,16 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.4.7 */ - ble_error_t read_multiple_request( + virtual ble_error_t read_multiple_request( connection_handle_t connection_handle, const Span& attribute_handles - ) { - return impl()->read_multiple_request_(connection_handle, attribute_handles); - } + ) = 0; /** * Send a read by group type request to the server. It is used to get * informations about grouping attribute of a given type on a server. * - * The server will reply with a ble::pal::ReadByGroupTypeResponse containing + * The server will reply with a ble::ReadByGroupTypeResponse containing * informations about the grouping attribute found. Informations are: * - handle of the grouping attribute. * - last handle of the group . @@ -399,24 +369,24 @@ public: * then it is necessary to send another request with a discovery range * updated to: [last handle + 1 : end]. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the range of handle + * - ble::AttErrorResponse::INVALID_HANDLE: If the range of handle * provided is invalid. - * - ble::pal::AttErrorResponse::UNSUPPORTED_GROUP_TYPE: if the group type + * - ble::AttErrorResponse::UNSUPPORTED_GROUP_TYPE: if the group type * is not a supported grouping attribute. - * - ble::pal::AttErrorResponse::ATTRIBUTE_NOT_FOUND: If no attribute with + * - ble::AttErrorResponse::ATTRIBUTE_NOT_FOUND: If no attribute with * the given type exists within the range provided. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient to read the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient to read the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size to read the requested * attributes. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption required to read the requested attributes. - * - ble::pal::AttErrorResponse::READ_NOT_PERMITTED: If any of the + * - ble::AttErrorResponse::READ_NOT_PERMITTED: If any of the * attributes value cannot be read. * Higher layer can also set an application error code (0x80 - 0x9F). * @@ -430,19 +400,17 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.4.9 */ - ble_error_t read_by_group_type_request( + virtual ble_error_t read_by_group_type_request( connection_handle_t connection_handle, attribute_handle_range_t read_range, const UUID& group_type - ) { - return impl()->read_by_group_type_request_(connection_handle, read_range, group_type); - } + ) = 0; /** * Send a write request to the server to write the value of an attribute. * * In case of success, the server will reply with a - * ble::pal::AttWriteResponse to acknowledge that the write operation went + * ble::AttWriteResponse to acknowledge that the write operation went * well. * * If the attribute value has a variable length, then the attribute value @@ -454,22 +422,22 @@ public: * attribute value parameter length shall be written; all other octets in this attribute * value shall be unchanged. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the handle to write is + * - ble::AttErrorResponse::INVALID_HANDLE: If the handle to write is * invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient to write the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient to write the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size to write the requested * attributes. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption required to write the requested attributes. - * - ble::pal::AttErrorResponse::WRITE_NOT_PERMITTED: If the attribute + * - ble::AttErrorResponse::WRITE_NOT_PERMITTED: If the attribute * value cannot be written due to permission. - * - ble::pal::AttErrorResponse::INVALID_ATTRIBUTE_VALUE_LENGTH: If the + * - ble::AttErrorResponse::INVALID_ATTRIBUTE_VALUE_LENGTH: If the * value to write exceeds the maximum valid length or of the attribute * value; whether the attribute has a variable length value or a fixed * length value. @@ -485,13 +453,11 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.5.1 */ - ble_error_t write_request( + virtual ble_error_t write_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - return impl()->write_request_(connection_handle, attribute_handle, value); - } + ) = 0; /** * Send a write command to the server. A write command is similar to a write @@ -507,13 +473,11 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.5.3 */ - ble_error_t write_command( + virtual ble_error_t write_command( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - return impl()->write_command_(connection_handle, attribute_handle, value); - } + ) = 0; /** * Send a signed write command to the server. Behaviour is similar to a write @@ -534,13 +498,11 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.5.4 */ - ble_error_t signed_write_command( + virtual ble_error_t signed_write_command( connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - return impl()->signed_write_command_(connection_handle, attribute_handle, value); - } + ) = 0; /** * The Prepare Write Request is used to request the server to prepare to @@ -550,28 +512,28 @@ public: * in the queue. * * In case of success the server will respond with a - * ble::pal::AttPrepareWriteResponse containing the values (attribute handle, + * ble::AttPrepareWriteResponse containing the values (attribute handle, * offset and value) present in the write request. * * If a prepare write request is rejected by the server, the state queue of * the prepare write request queue remains unaltered. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_HANDLE: If the handle to write is + * - ble::AttErrorResponse::INVALID_HANDLE: If the handle to write is * invalid. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHENTICATION: If the client * security is not sufficient to write the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_AUTHORIZATION: If the client * authorization is not sufficient to write the requested attribute. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION_KEY_SIZE: If the * client has an insufficient encryption key size to write the requested * attributes. - * - ble::pal::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client + * - ble::AttErrorResponse::INSUFFICIENT_ENCRYPTION: If the client * has not enabled encryption required to write the requested attributes. - * - ble::pal::AttErrorResponse::WRITE_NOT_PERMITTED: If the attribute + * - ble::AttErrorResponse::WRITE_NOT_PERMITTED: If the attribute * value cannot be written due to permission. - * - ble::pal::PREPARE_QUEUE_FULL: If the queue of prepare write request + * - ble::PREPARE_QUEUE_FULL: If the queue of prepare write request * is full. * Higher layer can also set an application error code (0x80 - 0x9F). * @@ -588,19 +550,12 @@ public: * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.6.1 * */ - ble_error_t prepare_write_request( + virtual ble_error_t prepare_write_request( connection_handle_t connection_handle, attribute_handle_t attribute_handle, uint16_t offset, const Span& value - ) { - return impl()->prepare_write_request_( - connection_handle, - attribute_handle, - offset, - value - ); - } + ) = 0; /** * Send an Execute Write Request to the server. This request will instruct @@ -612,14 +567,14 @@ public: * server should cancel the requests in the queue. * * In case of success, the server will respond with a - * ble::pal::AttExecuteWriteResponse indicating that the request was correctly + * ble::AttExecuteWriteResponse indicating that the request was correctly * handled. * - * In case of error, the server will send a ble::pal::AttErrorResponse. The + * In case of error, the server will send a ble::AttErrorResponse. The * error code depends on the situation: - * - ble::pal::AttErrorResponse::INVALID_OFFSET: If the value offset is + * - ble::AttErrorResponse::INVALID_OFFSET: If the value offset is * greater than the current length of the attribute to write. - * - ble::pal::AttErrorResponse::INVALID_ATTRIBUTE_VALUE_LENGTH: If the + * - ble::AttErrorResponse::INVALID_ATTRIBUTE_VALUE_LENGTH: If the * length of the value write exceeds the length of the attribute value * about to be written. * Higher layer can also set an application error code (0x80 - 0x9F). @@ -639,12 +594,10 @@ public: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.4.6.3 */ - ble_error_t execute_write_request( + virtual ble_error_t execute_write_request( connection_handle_t connection_handle, bool execute - ) { - return impl()->execute_write_request_(connection_handle, execute); - } + ) = 0; /** * Register a callback which will handle messages from the server. @@ -654,11 +607,9 @@ public: * message was received and the message received. Real type of the message * can be obtained from its opcode. */ - void when_server_message_received( + virtual void when_server_message_received( mbed::Callback cb - ) { - _server_message_cb = cb; - } + ) = 0; /** * Register a callback handling transaction timeout. @@ -671,17 +622,11 @@ public: * timeout. To send a new ATT message, the conenction should be * reestablished. */ - void when_transaction_timeout( + virtual void when_transaction_timeout( mbed::Callback cb - ) { - _transaction_timeout_cb = cb; - } + ) = 0; protected: - AttClient() { } - - ~AttClient() { } - /** * Upon server message reception an implementation shall call this function. * @@ -689,14 +634,10 @@ protected: * the server message. * @param server_message The message received from the server. */ - void on_server_event( + virtual void on_server_event( connection_handle_t connection_handle, const AttServerMessage& server_message - ) { - if (_server_message_cb) { - _server_message_cb(connection_handle, server_message); - } - } + ) = 0; /** * Upon transaction timeout an implementation shall call this function. @@ -706,32 +647,13 @@ protected: * * @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.3.3 */ - void on_transaction_timeout( + virtual void on_transaction_timeout( connection_handle_t connection_handle - ) { - if (_transaction_timeout_cb) { - _transaction_timeout_cb(connection_handle); - } - } - -private: - /** - * Callback called when the client receive a message from the server. - */ - mbed::Callback _server_message_cb; - - /** - * Callback called when a transaction times out. - */ - mbed::Callback _transaction_timeout_cb; - - // Disallow copy construction and copy assignment. - AttClient(const AttClient&); - AttClient& operator=(const AttClient&); + ) = 0; }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* BLE_PAL_ATTCLIENT_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/ConnectionEventMonitor.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalConnectionMonitor.h similarity index 75% rename from features/FEATURE_BLE/ble/pal/ConnectionEventMonitor.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalConnectionMonitor.h index cd48998e8c..236fa9d6cf 100644 --- a/features/FEATURE_BLE/ble/pal/ConnectionEventMonitor.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalConnectionMonitor.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +20,15 @@ #define MBED_BLE_CONNECTION_EVENT_MONITOR #include "ble/Gap.h" -#include "ble/BLETypes.h" +#include "ble/types/BLETypes.h" namespace ble { -namespace pal { /** * Implemented by classes that are reacting to connection changes. - * @see ConnectionEventMonitor + * @see PalConnectionMonitor */ -template -class ConnectionEventMonitorEventHandler { - Impl* self() { - return static_cast(this); - } +class PalConnectionMonitorEventHandler { public: /** * Inform the Security manager of a new connection. This will create @@ -48,23 +45,14 @@ public: * @param[in] resolved_peer_address resolved address of the peer; may * be NULL. */ - void on_connected( + virtual void on_connected( connection_handle_t connection, connection_role_t role, ble::peer_address_type_t peer_address_type, address_t peer_address, own_address_type_t local_address_type, const address_t local_address - ) { - self()->on_connected_( - connection, - role, - peer_address_type, - peer_address, - local_address_type, - local_address - ); - } + ) { }; /** * Inform the monitor about a disconnection. @@ -72,12 +60,10 @@ public: * @param[in] connectionHandle Handle to identify the connection. * @param[in] reason Reason for the disconnection. */ - void on_disconnected( + virtual void on_disconnected( connection_handle_t connection, ble::disconnection_reason_t reason - ) { - self()->on_disconnected_(connection, reason); - } + ) { }; }; @@ -85,13 +71,12 @@ public: * Implemented by classes that need to be notified of connection changes. * Notification is done by calling functions in the passed in event handler */ -template -class ConnectionEventMonitor { +class PalConnectionMonitor { protected: - ConnectionEventMonitor() : _connection_event_handler(NULL) { } + PalConnectionMonitor() : _connection_event_handler(NULL) { } - EventHandler* _connection_event_handler; + PalConnectionMonitorEventHandler* _connection_event_handler; public: /** @@ -99,12 +84,11 @@ public: * * @param[in] connection_event_handler Event handler being registered. */ - void set_connection_event_handler(EventHandler *connection_event_handler) { + void set_connection_event_handler(PalConnectionMonitorEventHandler *connection_event_handler) { _connection_event_handler = connection_event_handler; } }; -} // namespace pal } // namespace ble #endif /* MBED_BLE_CONNECTION_EVENT_MONITOR */ diff --git a/features/FEATURE_BLE/ble/pal/EventQueue.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalEventQueue.h similarity index 90% rename from features/FEATURE_BLE/ble/pal/EventQueue.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalEventQueue.h index ead56dd36a..c96f767f61 100644 --- a/features/FEATURE_BLE/ble/pal/EventQueue.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalEventQueue.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +22,7 @@ #include "platform/Callback.h" namespace ble { -namespace pal { +namespace interface { /** * Simple interface which allow upper layer to post an event into the event @@ -36,16 +38,16 @@ namespace pal { * Events in the queue shall be processed at the next invocation of * BLEInstanceBase::processEvents. */ -struct EventQueue { +struct PalEventQueue { /** * Base constructor of an event queue. */ - EventQueue() { } + PalEventQueue() { } /** * Destructor, needs to be overiden in implementation */ - ~EventQueue() { } + virtual ~PalEventQueue() { } /** * Post an event into the event queue. @@ -62,7 +64,7 @@ struct EventQueue { virtual bool post(const mbed::Callback& event) = 0; }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* BLE_PAL_EVENT_QUEUE_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/PalGap.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGap.h similarity index 82% rename from features/FEATURE_BLE/ble/pal/PalGap.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalGap.h index 07abd815cf..40a6908f64 100644 --- a/features/FEATURE_BLE/ble/pal/PalGap.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGap.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,58 +19,49 @@ #ifndef BLE_PAL_GAP_H_ #define BLE_PAL_GAP_H_ -#include "ble/common/StaticInterface.h" #include "platform/Callback.h" -#include "ble/pal/GapTypes.h" -#include "GapEvents.h" -#include "blecommon.h" + +#include "ble/internal/pal/GapTypes.h" +#include "ble/internal/pal/GapEvents.h" +#include "ble/types/blecommon.h" + +#include "dm_api.h" namespace ble { -namespace pal { - -template -struct GapEventHandler : StaticInterface { - - using StaticInterface::impl; +struct PalGapEventHandler { public: /** - * @copydoc Gap::EventHandler::onReadPhy + * @copydoc PalGap::EventHandler::onReadPhy */ - void on_read_phy( - pal::hci_error_code_t status, + virtual void on_read_phy( + hci_error_code_t status, connection_handle_t connectionHandle, ble::phy_t tx_phy, ble::phy_t rx_phy - ) { - impl()->on_read_phy_(status, connectionHandle, tx_phy, rx_phy); - } + ) = 0; /** - * @copydoc Gap::EventHandler::onDataLengthChange + * @copydoc PalGap::EventHandler::onDataLengthChange */ - void on_data_length_change( + virtual void on_data_length_change( connection_handle_t connection_handle, uint16_t tx_size, uint16_t rx_size - ) { - impl()->on_data_length_change_(connection_handle, tx_size, rx_size); - } + ) = 0; /** - * @copydoc Gap::EventHandler::onPhyUpdateComplete + * @copydoc PalGap::EventHandler::onPhyUpdateComplete */ - void on_phy_update_complete( - pal::hci_error_code_t status, + virtual void on_phy_update_complete( + hci_error_code_t status, connection_handle_t connection_handle, ble::phy_t tx_phy, ble::phy_t rx_phy - ) { - impl()->on_phy_update_complete_(status, connection_handle, tx_phy, rx_phy); - } + ) = 0; /** - * Should be invoked by the Gap implementation when an enhanced + * Should be invoked by the PalGap implementation when an enhanced * connection complete event happens. * * @param status hci_error_code::SUCCESS in case of success or an error @@ -106,7 +99,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.10 LE enhanced connection * complete event. */ - void on_enhanced_connection_complete( + virtual void on_enhanced_connection_complete( hci_error_code_t status, connection_handle_t connection_handle, connection_role_t own_role, @@ -118,21 +111,7 @@ public: uint16_t connection_latency, uint16_t supervision_timeout, clock_accuracy_t master_clock_accuracy - ) { - impl()->on_enhanced_connection_complete_( - status, - connection_handle, - own_role, - peer_address_type, - peer_address, - local_resolvable_private_address, - peer_resolvable_private_address, - connection_interval, - connection_latency, - supervision_timeout, - master_clock_accuracy - ); - } + ) = 0; /** Called on advertising report event. * @@ -153,7 +132,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.13 LE extended advertising * report event. */ - void on_extended_advertising_report( + virtual void on_extended_advertising_report( advertising_event_t event_type, const connection_peer_address_type_t *address_type, const address_t &address, @@ -167,23 +146,7 @@ public: const address_t &direct_address, uint8_t data_length, const uint8_t *data_size - ) { - impl()->on_extended_advertising_report_( - event_type, - address_type, - address, - primary_phy, - secondary_phy, - advertising_sid, - tx_power, - rssi, - periodic_advertising_interval, - direct_address_type, - direct_address, - data_length, - data_size - ); - } + ) = 0; /** Called on advertising sync event. * @@ -196,27 +159,16 @@ public: * @param periodic_advertising_interval Periodic advertising interval. * @param clock_accuracy Peer clock accuracy. */ - void on_periodic_advertising_sync_established( - pal::hci_error_code_t error, - pal::sync_handle_t sync_handle, + virtual void on_periodic_advertising_sync_established( + hci_error_code_t error, + sync_handle_t sync_handle, advertising_sid_t advertising_sid, connection_peer_address_type_t advertiser_address_type, const ble::address_t &advertiser_address, phy_t advertiser_phy, uint16_t periodic_advertising_interval, - pal::clock_accuracy_t clock_accuracy - ) { - impl()->on_periodic_advertising_sync_established_( - error, - sync_handle, - advertising_sid, - advertiser_address_type, - advertiser_address, - advertiser_phy, - periodic_advertising_interval, - clock_accuracy - ); - } + clock_accuracy_t clock_accuracy + ) = 0; /** Called after a periodic advertising report event. * @@ -227,39 +179,26 @@ public: * @param data_length Periodic advertisement payload length. * @param data Periodic advertisement payload. */ - void on_periodic_advertising_report( + virtual void on_periodic_advertising_report( sync_handle_t sync_handle, advertising_power_t tx_power, rssi_t rssi, advertising_data_status_t data_status, uint8_t data_length, const uint8_t *data - ) { - impl()->on_periodic_advertising_report_( - sync_handle, - tx_power, - rssi, - data_status, - data_length, - data - ); - } + ) = 0; /** Called on periodic advertising sync loss event. * * @param sync_handle Advertising sync handle' */ - void on_periodic_advertising_sync_loss( + virtual void on_periodic_advertising_sync_loss( sync_handle_t sync_handle - ) { - impl()->on_periodic_advertising_sync_loss_(sync_handle); - } + ) = 0; /** Called when scanning times out. */ - void on_scan_timeout() { - impl()->on_scan_timeout_(); - } + virtual void on_scan_timeout( ) = 0; /** Called when advertising set stops advertising. * @@ -268,19 +207,12 @@ public: * @param advertising_handle Connection handle. * @param number_of_completed_extended_advertising_events Number of events created during before advertising end. */ - void on_advertising_set_terminated( + virtual void on_advertising_set_terminated( hci_error_code_t status, advertising_handle_t advertising_handle, connection_handle_t connection_handle, uint8_t number_of_completed_extended_advertising_events - ) { - impl()->on_advertising_set_terminated_( - status, - advertising_handle, - connection_handle, - number_of_completed_extended_advertising_events - ); - } + ) = 0; /** Called when a device receives a scan request from an active scanning device. * @@ -288,51 +220,30 @@ public: * @param scanner_address_type Peer address type. * @param address Peer address. */ - void on_scan_request_received( + virtual void on_scan_request_received( advertising_handle_t advertising_handle, connection_peer_address_type_t scanner_address_type, const address_t &address - ) { - impl()->on_scan_request_received_( - advertising_handle, - scanner_address_type, - address - ); - } + ) = 0; - void on_connection_update_complete( + virtual void on_connection_update_complete( hci_error_code_t status, connection_handle_t connection_handle, uint16_t connection_interval, uint16_t connection_latency, uint16_t supervision_timeout - ) { - impl()->on_connection_update_complete_( - status, - connection_handle, - connection_interval, - connection_latency, - supervision_timeout - ); - } + ) = 0; - void on_remote_connection_parameter( + virtual void on_remote_connection_parameter( connection_handle_t connection_handle, uint16_t connection_interval_min, uint16_t connection_interval_max, uint16_t connection_latency, uint16_t supervision_timeout - ) { - impl()->on_remote_connection_parameter_( - connection_handle, - connection_interval_min, - connection_interval_max, - connection_latency, - supervision_timeout - ); - } + ) = 0; }; +namespace interface { /** * Adaptation interface for the GAP layer. * @@ -340,14 +251,7 @@ public: * follow closely the definition of the HCI commands and events used * by that layer. */ -template -struct Gap { -private: - - Impl* impl() { - return static_cast(this); - } - +class PalGap { public: /** @@ -360,9 +264,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t initialize() { - return impl()->initialize_(); - } + ble_error_t initialize(); /** * Termination of the instance. An implementation can use this function @@ -375,9 +277,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t terminate() { - return impl()->terminate_(); - } + ble_error_t terminate(); /** * Return the public device address. @@ -387,9 +287,7 @@ public: * * @return the public device address. */ - address_t get_device_address() { - return impl()->get_device_address_(); - } + address_t get_device_address(); /** * Return the current random address. @@ -399,9 +297,7 @@ public: * * @return the random device address. */ - address_t get_random_address() { - return impl()->get_random_address_(); - } + address_t get_random_address(); /** * Set the random address which will used be during scan, connection or @@ -415,9 +311,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t set_random_address(const address_t &address) { - return impl()->set_random_address_(address); - } + ble_error_t set_random_address(const address_t &address); /** * Set the random device address used by an advertising set. @@ -442,12 +336,7 @@ public: ble_error_t set_advertising_set_random_address( advertising_handle_t advertising_handle, const address_t &address - ) { - return impl()->set_advertising_set_random_address_( - advertising_handle, - address - ); - } + ); /** * Set the advertising parameters which will be used during the advertising @@ -515,18 +404,7 @@ public: const address_t &peer_address, advertising_channel_map_t advertising_channel_map, advertising_filter_policy_t advertising_filter_policy - ) { - return impl()->set_advertising_parameters_( - advertising_interval_min, - advertising_interval_max, - advertising_type, - own_address_type, - peer_address_type, - peer_address, - advertising_channel_map, - advertising_filter_policy - ); - } + ); /** * Define the advertising parameters of an advertising set. @@ -603,25 +481,7 @@ public: phy_t secondary_phy, uint8_t advertising_sid, bool scan_request_notification - ) { - return impl()->set_extended_advertising_parameters_( - advertising_handle, - event_properties, - primary_advertising_interval_min, - primary_advertising_interval_max, - primary_advertising_channel_map, - own_address_type, - peer_address_type, - peer_address, - advertising_filter_policy, - advertising_power, - primary_advertising_phy, - secondary_advertising_max_skip, - secondary_phy, - advertising_sid, - scan_request_notification - ); - } + ); /** * Configure periodic advertising parameters of an advertising set. @@ -654,14 +514,7 @@ public: periodic_advertising_interval_t periodic_advertising_min, periodic_advertising_interval_t periodic_advertising_max, bool advertise_power - ) { - return impl()->set_periodic_advertising_parameters_( - advertising_handle, - periodic_advertising_min, - periodic_advertising_max, - advertise_power - ); - } + ); /** * Set the data sends in advertising packet. If the advertising is @@ -683,12 +536,7 @@ public: ble_error_t set_advertising_data( uint8_t advertising_data_length, const advertising_data_t &advertising_data - ) { - return impl()->set_advertising_data_( - advertising_data_length, - advertising_data - ); - } + ); /** * Set data in advertising PDUs. @@ -727,15 +575,7 @@ public: bool minimize_fragmentation, uint8_t advertising_data_size, const uint8_t *advertising_data - ) { - return impl()->set_extended_advertising_data_( - advertising_handle, - operation, - minimize_fragmentation, - advertising_data_size, - advertising_data - ); - } + ); /** * Set the data used in periodic advertising PDUs. @@ -767,14 +607,7 @@ public: advertising_fragment_description_t fragment_description, uint8_t advertising_data_size, const uint8_t *advertising_data - ) { - return impl()->set_periodic_advertising_data_( - advertising_handle, - fragment_description, - advertising_data_size, - advertising_data - ); - } + ); /** * Set the data sends in scan response packets. If the advertising is @@ -796,12 +629,7 @@ public: ble_error_t set_scan_response_data( uint8_t scan_response_data_length, const advertising_data_t &scan_response_data - ) { - return impl()->set_scan_response_data_( - scan_response_data_length, - scan_response_data - ); - } + ); /** * Set the data sends in extended scan response packets. If the advertising @@ -834,15 +662,7 @@ public: bool minimize_fragmentation, uint8_t scan_response_data_size, const uint8_t *scan_response_data - ) { - return impl()->set_extended_scan_response_data_( - advertising_handle, - operation, - minimize_fragmentation, - scan_response_data_size, - scan_response_data - ); - } + ); /** * Start or stop advertising. @@ -884,9 +704,7 @@ public: * @note Successfull connection shall emit a ConnectionComplete event. It * also means advertising is disabled. */ - ble_error_t advertising_enable(bool enable) { - return impl()->advertising_enable_(enable); - } + ble_error_t advertising_enable(bool enable); /** * Start of stop advertising of extended advertising sets. @@ -929,15 +747,7 @@ public: const advertising_handle_t *handles, const uint16_t *durations, const uint8_t *max_extended_advertising_events - ) { - return impl()->extended_advertising_enable_( - enable, - number_of_sets, - handles, - durations, - max_extended_advertising_events - ); - } + ); /** * Enable or disable periodic advertising of an advertising set. @@ -957,9 +767,7 @@ public: ble_error_t periodic_advertising_enable( bool enable, advertising_handle_t advertising_handle - ) { - return impl()->periodic_advertising_enable_(enable, advertising_handle); - } + ); /** * Query the maximum data length the controller supports in an advertising @@ -971,9 +779,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.57 LE read maximum advertising * data length command. */ - uint16_t get_maximum_advertising_data_length() { - return impl()->get_maximum_advertising_data_length_(); - } + uint16_t get_maximum_advertising_data_length(); /** * Query the maximum data length the controller supports in an advertising set @@ -982,9 +788,7 @@ public: * @return The length in byte the controller can support in an advertising set * for connectable advertising. */ - uint16_t get_maximum_connectable_advertising_data_length() { - return impl()->get_maximum_connectable_advertising_data_length_(); - } + uint16_t get_maximum_connectable_advertising_data_length(); /** * Query the maximum payload length for a single HCI packet carrying partial @@ -992,9 +796,7 @@ public: * * @return Max size of the HCI packet transporting the data. */ - uint8_t get_maximum_hci_advertising_data_length() { - return impl()->get_maximum_hci_advertising_data_length_(); - } + uint8_t get_maximum_hci_advertising_data_length(); /** * Query the maximum number of concurrent advertising sets that is supported @@ -1006,9 +808,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.58 LE number of supported * advertising sets command. */ - uint8_t get_max_number_of_advertising_sets() { - return impl()->get_max_number_of_advertising_sets_(); - } + uint8_t get_max_number_of_advertising_sets(); /** * Remove an advertising set from the controller. @@ -1030,9 +830,7 @@ public: */ ble_error_t remove_advertising_set( advertising_handle_t advertising_handle - ) { - return impl()->remove_advertising_set_(advertising_handle); - } + ); /** * Remove all advertising sets maintained by the controller. @@ -1045,9 +843,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.60 LE clear advertising sets * command. */ - ble_error_t clear_advertising_sets() { - return impl()->clear_advertising_sets_(); - } + ble_error_t clear_advertising_sets(); /** @@ -1083,15 +879,7 @@ public: uint16_t scan_window, own_address_type_t own_address_type, scanning_filter_policy_t filter_policy - ) { - return impl()->set_scan_parameters_( - active_scanning, - scan_interval, - scan_window, - own_address_type, - filter_policy - ); - } + ); /** * Set extended scan parameters to be used on advertising channels. @@ -1128,16 +916,7 @@ public: const bool *active_scanning, const uint16_t *scan_interval, const uint16_t *scan_window - ) { - return impl()->set_extended_scan_parameters_( - own_address_type, - filter_policy, - scanning_phys, - active_scanning, - scan_interval, - scan_window - ); - } + ); /** * Start/stop scanning process. @@ -1163,9 +942,7 @@ public: ble_error_t scan_enable( bool enable, bool filter_duplicates - ) { - return impl()->scan_enable_(enable, filter_duplicates); - } + ); /** * Enable or disable extended scanning. @@ -1193,14 +970,7 @@ public: duplicates_filter_t filter_duplicates, uint16_t duration, uint16_t period - ) { - return impl()->extended_scan_enable_( - enable, - filter_duplicates, - duration, - period - ); - } + ); /** * Synchronize an observer with a periodic advertising broadcaster. @@ -1238,16 +1008,7 @@ public: const address_t &peer_address, uint16_t allowed_skip, uint16_t sync_timeout - ) { - return impl()->periodic_advertising_create_sync_( - use_periodic_advertiser_list, - advertising_sid, - peer_address_type, - peer_address, - allowed_skip, - sync_timeout - ); - } + ); /** * Cancel the establishment of synchronization with a periodic advertising @@ -1261,9 +1022,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.68 LE periodic advertising create * sync cancel command. */ - ble_error_t cancel_periodic_advertising_create_sync() { - return impl()->cancel_periodic_advertising_create_sync_(); - } + ble_error_t cancel_periodic_advertising_create_sync(); /** * Stop reception of the periodic advertising identified by @p sync_handle. @@ -1280,9 +1039,7 @@ public: */ ble_error_t periodic_advertising_terminate_sync( sync_handle_t sync_handle - ) { - return impl()->periodic_advertising_terminate_sync_(sync_handle); - } + ); /** * Add a device to the periodic advertiser list stored in the controller. @@ -1311,13 +1068,7 @@ public: advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid - ) { - return impl()->add_device_to_periodic_advertiser_list_( - advertiser_address_type, - advertiser_address, - advertising_sid - ); - } + ); /** * Remove a device from the periodic advertiser list. @@ -1341,13 +1092,7 @@ public: advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid - ) { - return impl()->remove_device_from_periodic_advertiser_list_( - advertiser_address_type, - advertiser_address, - advertising_sid - ); - } + ); /** * Clear all devices from the list of periodic advertisers. @@ -1360,9 +1105,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.72 LE clear periodic advertising * list command. */ - ble_error_t clear_periodic_advertiser_list() { - return impl()->clear_periodic_advertiser_list_(); - } + ble_error_t clear_periodic_advertiser_list(); /** * Return the total number of entries that can be stored by the periodic @@ -1372,9 +1115,7 @@ public: * * @note We (wrongfully) assume that value doesn't change over time. */ - uint8_t read_periodic_advertiser_list_size() { - return impl()->read_periodic_advertiser_list_size_(); - } + uint8_t read_periodic_advertiser_list_size(); /** * Create a new le connection to a connectable advertiser. @@ -1460,22 +1201,7 @@ public: uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length - ) { - return impl()->create_connection_( - scan_interval, - scan_window, - initiator_policy, - peer_address_type, - peer_address, - own_address_type, - connection_interval_min, - connection_interval_max, - connection_latency, - supervision_timeout, - minimum_connection_event_length, - maximum_connection_event_length - ); - } + ); /** * Create a new le connection to a connectable advertiser. @@ -1568,23 +1294,7 @@ public: const uint16_t *supervision_timeouts, const uint16_t *minimum_connection_event_lengths, const uint16_t *maximum_connection_event_lengths - ) { - return impl()->extended_create_connection_( - initiator_policy, - own_address_type, - peer_address_type, - peer_address, - initiating_phys, - scan_intervals, - scan_windows, - connection_intervals_min, - connection_intervals_max, - connection_latencies, - supervision_timeouts, - minimum_connection_event_lengths, - maximum_connection_event_lengths - ); - } + ); /** * Cancel the ongoing connection creation process. @@ -1595,9 +1305,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.13 LE create connection cancel * command. */ - ble_error_t cancel_connection_creation() { - return impl()->cancel_connection_creation_(); - } + ble_error_t cancel_connection_creation(); /** * Return the number of total whitelist entries that can be stored in the @@ -1611,9 +1319,7 @@ public: * @note: See Bluetooth 5 Vol 2 PartE: 7.8.14 LE read white list size * command. */ - uint8_t read_white_list_capacity() { - return impl()->read_white_list_capacity_(); - } + uint8_t read_white_list_capacity(); /** * Clear the whitelist stored in the LE subsystem. @@ -1626,9 +1332,7 @@ public: * * @note: See Bluetooth 5 Vol 2 PartE: 7.8.15 LE clear white list command. */ - ble_error_t clear_whitelist() { - return impl()->clear_whitelist_(); - } + ble_error_t clear_whitelist(); /** * Add a device to the LE subsystem Whitelist. @@ -1650,12 +1354,7 @@ public: ble_error_t add_device_to_whitelist( whitelist_address_type_t address_type, address_t address - ) { - return impl()->add_device_to_whitelist_( - address_type, - address - ); - } + ); /** * Remove a device from the LE subsystem Whitelist. @@ -1677,12 +1376,7 @@ public: ble_error_t remove_device_from_whitelist( whitelist_address_type_t address_type, address_t address - ) { - return impl()->remove_device_from_whitelist_( - address_type, - address - ); - } + ); /** * Start a connection update procedure. @@ -1749,17 +1443,7 @@ public: uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length - ) { - return impl()->connection_parameters_update_( - connection, - connection_interval_min, - connection_interval_max, - connection_latency, - supervision_timeout, - minimum_connection_event_length, - maximum_connection_event_length - ); - } + ); /** * Accept connection parameter request. @@ -1826,17 +1510,7 @@ public: uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length - ) { - return impl()->accept_connection_parameter_request_( - connection_handle, - interval_min, - interval_max, - latency, - supervision_timeout, - minimum_connection_event_length, - maximum_connection_event_length - ); - } + ); /** * Reject a connection parameter update request. @@ -1856,12 +1530,7 @@ public: ble_error_t reject_connection_parameter_request( connection_handle_t connection_handle, hci_error_code_t rejection_reason - ) { - return impl()->reject_connection_parameter_request_( - connection_handle, - rejection_reason - ); - } + ); /** * Start a disconnection procedure. @@ -1882,9 +1551,7 @@ public: ble_error_t disconnect( connection_handle_t connection, local_disconnection_reason_t disconnection_reason - ) { - return impl()->disconnect_(connection, disconnection_reason); - } + ); /** Check if privacy feature is supported by implementation * @@ -1892,9 +1559,7 @@ public: * * @note: See Bluetooth 5 Vol 3 Part C: 10.7 Privacy feature. */ - bool is_privacy_supported() { - return impl()->is_privacy_supported_(); - } + bool is_privacy_supported(); /** Enable or disable private addresses resolution * @@ -1907,9 +1572,7 @@ public: */ ble_error_t set_address_resolution( bool enable - ) { - return impl()->set_address_resolution_(enable); - } + ); /** * Checked support for a feature in the link controller. @@ -1919,57 +1582,40 @@ public: */ bool is_feature_supported( controller_supported_features_t feature - ) { - return impl()->is_feature_supported_(feature); - } + ); /** - * @see Gap::readPhy + * @see PalGap::readPhy */ - ble_error_t read_phy(connection_handle_t connection) { - return impl()->read_phy_(connection); - } + ble_error_t read_phy(connection_handle_t connection); /** - * @see Gap::setPreferredPhys + * @see PalGap::setPreferredPhys */ ble_error_t set_preferred_phys( const phy_set_t &tx_phys, const phy_set_t &rx_phys - ) { - return impl()->set_preferred_phys_(tx_phys, rx_phys); - } + ); /** - * @see Gap::setPhy + * @see PalGap::setPhy */ ble_error_t set_phy( connection_handle_t connection, const phy_set_t &tx_phys, const phy_set_t &rx_phys, coded_symbol_per_bit_t coded_symbol - ) { - return impl()->set_phy_( - connection, - tx_phys, - rx_phys, - coded_symbol - ); - } + ); /** - * Register a callback which will handle Gap events. + * Register a callback which will handle PalGap events. * - * @param cb The callback object which will handle Gap events from the + * @param cb The callback object which will handle PalGap events from the * LE subsystem. * It accept a single parameter in input: The event received. */ - void when_gap_event_received(mbed::Callback cb) - { - _gap_event_cb = cb; - } + void when_gap_event_received(mbed::Callback cb); -public: /** * Sets the event handler that us called by the PAL porters to notify the stack of events * which will in turn be passed onto the user application when appropriate. @@ -1977,40 +1623,21 @@ public: * @param[in] event_handler the new event handler interface implementation. Memory * owned by caller who is responsible for updating this pointer if interface changes. */ - void set_event_handler(EventHandler *event_handler) - { - _pal_event_handler = event_handler; - } + void set_event_handler(PalGapEventHandler *event_handler); - EventHandler *get_event_handler() - { - return _pal_event_handler; - } + PalGapEventHandler *get_event_handler(); protected: - EventHandler *_pal_event_handler; - -protected: - Gap() : _pal_event_handler(NULL) - { - } - - ~Gap() - { - } + PalGap() { }; + ~PalGap() { }; /** * Implementation shall call this function whenever the LE subsystem - * generate a Gap event. + * generate a PalGap event. * * @param gap_event The event to emit to higher layer. */ - void emit_gap_event(const GapEvent &gap_event) - { - if (_gap_event_cb) { - _gap_event_cb(gap_event); - } - } + void emit_gap_event(const GapEvent &gap_event); public: /** @@ -2034,20 +1661,13 @@ public: return all_phys; } -private: - /** - * Callback called when an event is emitted by the LE subsystem. - */ - mbed::Callback _gap_event_cb; - private: // Disallow copy construction and copy assignment. - Gap(const Gap &); - - Gap &operator=(const Gap &); + PalGap(const PalGap &); + PalGap &operator=(const PalGap &); }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* BLE_PAL_GAP_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/PalGattClient.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGattClient.h similarity index 85% rename from features/FEATURE_BLE/ble/pal/PalGattClient.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalGattClient.h index 390f614c57..e1fed84744 100644 --- a/features/FEATURE_BLE/ble/pal/PalGattClient.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGattClient.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,26 +19,19 @@ #ifndef BLE_PAL_GATT_CLIENT_H_ #define BLE_PAL_GATT_CLIENT_H_ -#include "ble/common/StaticInterface.h" -#include "ble/UUID.h" -#include "ble/BLETypes.h" -#include "ble/blecommon.h" - #include "platform/Callback.h" -#include "AttServerMessage.h" +#include "ble/types/UUID.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/internal/pal/AttServerMessage.h" namespace ble { -namespace pal { /** - * Definition of the general handler of GattClient related events. + * Definition of the general handler of PalGattClient related events. */ -template -struct GattClientEventHandler : StaticInterface { - - using StaticInterface::impl; - +struct PalGattClientEventHandler { /** * Function invoked when the connections changes the ATT_MTU which controls * the maximum size of an attribute that can be read in a single L2CAP packet @@ -45,12 +40,10 @@ struct GattClientEventHandler : StaticInterface { * @param connectionHandle The handle of the connection that changed the size. * @param attMtuSize */ - void on_att_mtu_change( + virtual void on_att_mtu_change( ble::connection_handle_t connection_handle, uint16_t att_mtu_size - ) { - impl()->on_att_mtu_change_(connection_handle, att_mtu_size); - } + ) = 0; /** * Function invoked when a write command has been sent out of the stack @@ -60,20 +53,15 @@ struct GattClientEventHandler : StaticInterface { * @param attribute_handle Attribute written * @param status HCI status of the operation. */ - void on_write_command_sent( + virtual void on_write_command_sent( ble::connection_handle_t connection_handle, ble::attribute_handle_t attribute_handle, uint8_t status - ) { - impl()->on_write_command_sent_( - connection_handle, - attribute_handle, - status - ); - } + ) = 0; }; +namespace interface { /** * Adaptation layer for a GATT client. * @@ -96,16 +84,10 @@ struct GattClientEventHandler : StaticInterface { * level using the primitives defined in this adaptation layer. * * If a stack expose the complete ATT layer then it is possible to provide an - * implementation for GattClient by subclassing the AttClient class and use - * the class AttClientToGattClientAdapter + * implementation for PalGattClient by subclassing the PalAttClient class and use + * the class PalGattClient */ -template -class GattClient { - - Impl* self() { - return static_cast(this); - } - +class PalGattClient { public: /** @@ -118,9 +100,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t initialize() { - return self()->initialize_(); - } + ble_error_t initialize(); /** * Termination of the instance. An implementation can use this function @@ -133,9 +113,7 @@ public: * @return BLE_ERROR_NONE if the request has been successfully sent or the * appropriate error otherwise. */ - ble_error_t terminate() { - return self()->terminate_(); - } + ble_error_t terminate(); /** * Negotiate the mtu to use by this connection. @@ -154,9 +132,7 @@ public: * @param connection The handle of the connection to send this request to. * @return BLE_ERROR_NONE or an appropriate error. */ - ble_error_t exchange_mtu(connection_handle_t connection) { - return self()->exchange_mtu_(connection); - } + ble_error_t exchange_mtu(connection_handle_t connection); /** * Acquire the size of the mtu for a given connection. @@ -172,9 +148,7 @@ public: ble_error_t get_mtu_size( connection_handle_t connection_handle, uint16_t& mtu_size - ) { - return self()->get_mtu_size_(connection_handle, mtu_size); - } + ); /** * Discover primary services in the range [begin - 0xFFFF]. @@ -210,12 +184,7 @@ public: ble_error_t discover_primary_service( connection_handle_t connection, attribute_handle_t discovery_range_begining - ) { - return self()->discover_primary_service_( - connection, - discovery_range_begining - ); - } + ); /** * Discover primary services by UUID in the range [discovery_range_begining - 0xFFFF]. @@ -251,13 +220,7 @@ public: connection_handle_t connection_handle, attribute_handle_t discovery_range_beginning, const UUID& uuid - ) { - return self()->discover_primary_service_by_service_uuid_( - connection_handle, - discovery_range_beginning, - uuid - ); - } + ); /** * Find included services within a service. @@ -298,12 +261,7 @@ public: ble_error_t find_included_service( connection_handle_t connection_handle, attribute_handle_range_t service_range - ) { - return self()->find_included_service_( - connection_handle, - service_range - ); - } + ); /** * Find characteristic declarations within a service definition. @@ -344,12 +302,7 @@ public: ble_error_t discover_characteristics_of_a_service( connection_handle_t connection_handle, attribute_handle_range_t discovery_range - ) { - return self()->discover_characteristics_of_a_service_( - connection_handle, - discovery_range - ); - } + ); /** * Discover characteristic descriptors of a characteristic. @@ -383,12 +336,7 @@ public: ble_error_t discover_characteristics_descriptors( connection_handle_t connection_handle, attribute_handle_range_t descriptors_discovery_range - ) { - return self()->discover_characteristics_descriptors_( - connection_handle, - descriptors_discovery_range - ); - } + ); /** * Read the value of an attribute. @@ -414,9 +362,7 @@ public: ble_error_t read_attribute_value( connection_handle_t connection_handle, attribute_handle_t attribute_handle - ) { - return self()->read_attribute_value_(connection_handle, attribute_handle); - } + ); /** * Read a characteristic value using its UUID (type). @@ -451,13 +397,7 @@ public: connection_handle_t connection_handle, attribute_handle_range_t read_range, const UUID& uuid - ) { - return self()->read_using_characteristic_uuid_( - connection_handle, - read_range, - uuid - ); - } + ); /** * Read a partial value of an attribute. @@ -489,9 +429,7 @@ public: connection_handle_t connection_handle, attribute_handle_t attribute_handle, uint16_t offset - ) { - return self()->read_attribute_blob_(connection_handle, attribute_handle, offset); - } + ); /** * Read atomically multiple characteristics values. @@ -516,12 +454,7 @@ public: ble_error_t read_multiple_characteristic_values( connection_handle_t connection_handle, const Span& characteristic_value_handles - ) { - return self()->read_multiple_characteristic_values_( - connection_handle, - characteristic_value_handles - ); - } + ); /** * Send a write command to the server. @@ -540,13 +473,7 @@ public: connection_handle_t connection_handle, attribute_handle_t characteristic_value_handle, const Span& value - ) { - return self()->write_without_response_( - connection_handle, - characteristic_value_handle, - value - ); - } + ); /** * Send a Signed Write without Response command to the server. @@ -568,13 +495,7 @@ public: connection_handle_t connection_handle, attribute_handle_t characteristic_value_handle, const Span& value - ) { - return self()->signed_write_without_response_( - connection_handle, - characteristic_value_handle, - value - ); - } + ); /** * Send a write request to the server. @@ -600,9 +521,7 @@ public: connection_handle_t connection_handle, attribute_handle_t attribute_handle, const Span& value - ) { - return self()->write_attribute_(connection_handle, attribute_handle, value); - } + ); /** * Send a prepare write request to the server. @@ -638,14 +557,7 @@ public: attribute_handle_t characteristic_value_handle, const Span& value, uint16_t offset - ) { - return self()->queue_prepare_write_( - connection_handle, - characteristic_value_handle, - value, - offset - ); - } + ); /** * Send a request to the server to execute the queue of prepared write @@ -670,9 +582,7 @@ public: ble_error_t execute_write_queue( connection_handle_t connection_handle, bool execute - ) { - return self()->execute_write_queue_(connection_handle, execute); - } + ); /** * Register a callback which will handle messages from the server. @@ -684,9 +594,7 @@ public: */ void when_server_message_received( mbed::Callback cb - ) { - _server_message_cb = cb; - } + ); /** * Register a callback handling transaction timeout. @@ -701,9 +609,7 @@ public: */ void when_transaction_timeout( mbed::Callback cb - ) { - _transaction_timeout_cb = cb; - } + ); /** * Sets the event handler that us called by the PAL porters to notify the stack of events @@ -711,24 +617,16 @@ public: * * @param event_handler The new event handler interface implementation. */ - void set_event_handler(EventHandler* event_handler) { - _event_handler = event_handler; - } + void set_event_handler(PalGattClientEventHandler* event_handler); /** * Get the currently registered event handler. * * @return Currently registered event handler. NULL if no event handler is present. */ - EventHandler* get_event_handler() { - return _event_handler; - } + PalGattClientEventHandler* get_event_handler(); protected: - GattClient() : _event_handler(NULL) { } - - ~GattClient() { } - /** * Upon server message reception an implementation shall call this function. * @@ -739,11 +637,7 @@ protected: void on_server_event( connection_handle_t connection_handle, const AttServerMessage& server_message - ) { - if (_server_message_cb) { - _server_message_cb(connection_handle, server_message); - } - } + ); /** * Upon transaction timeout an implementation shall call this function. @@ -756,31 +650,10 @@ protected: */ void on_transaction_timeout( connection_handle_t connection_handle - ) { - if (_transaction_timeout_cb) { - _transaction_timeout_cb(connection_handle); - } - } - -private: - EventHandler* _event_handler; - - /** - * Callback called when the client receive a message from the server. - */ - mbed::Callback _server_message_cb; - - /** - * Callback called when a transaction times out. - */ - mbed::Callback _transaction_timeout_cb; - - // Disallow copy construction and copy assignment. - GattClient(const GattClient&); - GattClient& operator=(const GattClient&); + ); }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* BLE_PAL_GATT_CLIENT_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/GenericAccessService.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGenericAccessService.h similarity index 78% rename from features/FEATURE_BLE/ble/pal/GenericAccessService.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalGenericAccessService.h index 39d93208c4..bf754c34e6 100644 --- a/features/FEATURE_BLE/ble/pal/GenericAccessService.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalGenericAccessService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,13 +19,13 @@ #ifndef BLE_PAL_GENERIC_ACCESS_SERVICE_H_ #define BLE_PAL_GENERIC_ACCESS_SERVICE_H_ -#include "GapTypes.h" -#include "ble/BLETypes.h" -#include "ble/blecommon.h" +#include "ble/internal/pal/GapTypes.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" #include "ble/Gap.h" namespace ble { -namespace pal { +namespace interface { /** * Manage state of the GAP service exposed by the GATT server. @@ -31,17 +33,16 @@ namespace pal { * @see Bluetooth 4.2 Vol 3 PartC: 12 - GAP service and characteristics for GATT * server. */ -struct GenericAccessService { - +struct PalGenericAccessService { /** * Empty, default, constructor */ - GenericAccessService() { } + PalGenericAccessService() { } /** * Virtual destructor */ - virtual ~GenericAccessService() { } + virtual ~PalGenericAccessService() { } /** * Acquire the peripheral preferred connection parameters stored in the GAP @@ -57,7 +58,7 @@ struct GenericAccessService { * Parameters Characteristic */ virtual ble_error_t get_peripheral_preferred_connection_parameters( - ::Gap::PreferredConnectionParams_t& parameters + ble::Gap::PreferredConnectionParams_t& parameters ) = 0; /** @@ -74,15 +75,15 @@ struct GenericAccessService { * Parameters Characteristic */ virtual ble_error_t set_peripheral_preferred_connection_parameters( - const ::Gap::PreferredConnectionParams_t& parameters + const ble::Gap::PreferredConnectionParams_t& parameters ) = 0; private: - GenericAccessService(const GenericAccessService&); - GenericAccessService& operator=(const GenericAccessService&); + PalGenericAccessService(const PalGenericAccessService&); + PalGenericAccessService& operator=(const PalGenericAccessService&); }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* BLE_PAL_GENERIC_ACCESS_SERVICE_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSecurityManager.h similarity index 78% rename from features/FEATURE_BLE/ble/pal/PalSecurityManager.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalSecurityManager.h index 31d6643209..ed2e0159a8 100644 --- a/features/FEATURE_BLE/ble/pal/PalSecurityManager.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSecurityManager.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,19 +19,19 @@ #ifndef MBED_OS_FEATURES_FEATURE_BLE_BLE_PAL_PALSM_H_ #define MBED_OS_FEATURES_FEATURE_BLE_BLE_PAL_PALSM_H_ -#include "ble/common/StaticInterface.h" #include "platform/Callback.h" #include "platform/NonCopyable.h" -#include "ble/BLETypes.h" -#include "ble/SecurityManager.h" -#include "ble/pal/GapTypes.h" + +#include "ble/types/BLETypes.h" +#include "ble/internal/pal/GapTypes.h" + +#include "wsf_types.h" +#include "wsf_os.h" +#include "sec_api.h" +#include "smp_defs.h" +#include "cfg_stack.h" namespace ble { -namespace pal { - -typedef ::SecurityManager::SecurityCompletionStatus_t SecurityCompletionStatus_t; -typedef ::SecurityManager::SecurityMode_t SecurityMode_t; -typedef ::SecurityManager::Keypress_t Keypress_t; /** * Key distribution as required by the SMP with convenient setters and getters, @@ -201,14 +203,9 @@ private: }; /** - * Handle events generated by ble::pal::SecurityManager + * Handle events generated by ble::PalSecurityManager */ -template -class SecurityManagerEventHandler : - public StaticInterface -{ - using StaticInterface::impl; - +class PalSecurityManagerEventHandler { public: //////////////////////////////////////////////////////////////////////////// // Pairing @@ -225,21 +222,13 @@ public: * @param[in] initiator_dist key distribution * @param[in] responder_dist key distribution */ - void on_pairing_request( + virtual void on_pairing_request( connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist - ) { - impl()->on_pairing_request_( - connection, - oob_data_flag, - authentication_requirements, - initiator_dist, - responder_dist - ); - } + ) = 0; /** * Indicate that the pairing has failed. @@ -249,34 +238,28 @@ public: * @param[in] connection connection handle * @param[in] error reason for the failed pairing */ - void on_pairing_error( + virtual void on_pairing_error( connection_handle_t connection, pairing_failure_t error - ) { - impl()->on_pairing_error_(connection, error); - } + ) = 0; /** * Indicate that the pairing has timed out. * * @param[in] connection connection handle */ - void on_pairing_timed_out( + virtual void on_pairing_timed_out( connection_handle_t connection - ) { - impl()->on_pairing_timed_out_(connection); - } + ) = 0; /** * Indicate that the pairing for the link has completed. * * @param[in] connection connection handle */ - void on_pairing_completed( + virtual void on_pairing_completed( connection_handle_t connection - ) { - impl()->on_pairing_completed_(connection); - } + ) = 0; //////////////////////////////////////////////////////////////////////////// // Security @@ -289,11 +272,9 @@ public: * @param[in] connection connection handle * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B, 5.4 */ - void on_valid_mic_timeout( + virtual void on_valid_mic_timeout( connection_handle_t connection - ) { - impl()->on_valid_mic_timeout_(connection); - } + ) = 0; /** * Ask the stack to evaluate the security request received from the slave. @@ -302,12 +283,10 @@ public: * @param[in] connection connection handle * @param[in] authentication authentication requirements from the slave */ - void on_slave_security_request( + virtual void on_slave_security_request( connection_handle_t connection, AuthenticationMask authentication - ) { - impl()->on_slave_security_request_(connection, authentication); - } + ) = 0; //////////////////////////////////////////////////////////////////////////// // Encryption @@ -321,23 +300,19 @@ public: * @param[in] connection connection handle * @param[in] result encryption state of the link */ - void on_link_encryption_result( + virtual void on_link_encryption_result( connection_handle_t connection, link_encryption_t result - ) { - impl()->on_link_encryption_result_(connection, result); - } + ) = 0; /** * Indicate that the encryption request failed due to timeout. * * @param[in] connection connection handle */ - void on_link_encryption_request_timed_out( + virtual void on_link_encryption_request_timed_out( connection_handle_t connection - ) { - impl()->on_link_encryption_request_timed_out_(connection); - } + ) = 0; //////////////////////////////////////////////////////////////////////////// // MITM @@ -349,15 +324,10 @@ public: * @param[in] connection connection handle * @param[in] passkey passkey to be displayed */ - void on_passkey_display( + virtual void on_passkey_display( connection_handle_t connection, passkey_num_t passkey - ) { - impl()->on_passkey_display_( - connection, - passkey - ); - } + ) = 0; /** * Indicate that user confirmation is required to confirm matching @@ -366,24 +336,20 @@ public: * @param[in] connection connection handle * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E, 7.7.42 */ - void on_confirmation_request( + virtual void on_confirmation_request( connection_handle_t connection - ) { - impl()->on_confirmation_request_(connection); - } + ) = 0; /** * Request the passkey entered during pairing. * - * @note shall be followed by: pal::SecurityManager::passkey_request_reply + * @note shall be followed by: PalSecurityManager::passkey_request_reply * @param[in] connection connection handle * or a cancellation of the procedure. */ - void on_passkey_request( + virtual void on_passkey_request( connection_handle_t connection - ) { - impl()->on_passkey_request_(connection); - } + ) = 0; /** * Indicate that a key has been pressed by the peer. @@ -392,38 +358,32 @@ public: * @param[in] keypress type of keypress event * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part H, 3.5.8 */ - void on_keypress_notification( + virtual void on_keypress_notification( connection_handle_t connection, - Keypress_t keypress - ) { - impl()->on_keypress_notification_(connection, keypress); - } + ble::Keypress_t keypress + ) = 0; /** * Request OOB data from the user application. * * @param[in] connection connection handle - * @note shall be followed by: pal::SecurityManager::secure_connections_oob_request_reply + * @note shall be followed by: PalSecurityManager::secure_connections_oob_request_reply * or a cancellation of the procedure. */ - void on_secure_connections_oob_request( + virtual void on_secure_connections_oob_request( connection_handle_t connection - ) { - impl()->on_secure_connections_oob_request_(connection); - } + ) = 0; /** * Request OOB data from the user application. * * @param[in] connection connection handle - * @note shall be followed by: pal::SecurityManager::legacy_pairing_oob_request_reply + * @note shall be followed by: PalSecurityManager::legacy_pairing_oob_request_reply * or a cancellation of the procedure. */ - void on_legacy_pairing_oob_request( + virtual void on_legacy_pairing_oob_request( connection_handle_t connection - ) { - impl()->on_legacy_pairing_oob_request_(connection); - } + ) = 0; /** * Send OOB data to the application for transport to the peer. @@ -434,12 +394,10 @@ public: * in secure connections pairing * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. */ - void on_secure_connections_oob_generated( + virtual void on_secure_connections_oob_generated( const oob_lesc_value_t &random, const oob_confirm_t &confirm - ) { - impl()->on_secure_connections_oob_generated_(random, confirm); - } + ) = 0; //////////////////////////////////////////////////////////////////////////// // Keys @@ -452,12 +410,10 @@ public: * @param[in] connection connection handle * @param[in] ltk long term key from the peer */ - void on_secure_connections_ltk_generated( + virtual void on_secure_connections_ltk_generated( connection_handle_t connection, const ltk_t <k - ) { - impl()->on_secure_connections_ltk_generated_(connection, ltk); - } + ) = 0; /** * Store the results of key distribution after LTK has been received. @@ -465,12 +421,10 @@ public: * @param[in] connection connection handle * @param[in] ltk long term key from the peer */ - void on_keys_distributed_ltk( + virtual void on_keys_distributed_ltk( connection_handle_t connection, const ltk_t <k - ) { - impl()->on_keys_distributed_ltk_(connection, ltk); - } + ) = 0; /** * Store the results of key distribution after EDIV and RAND has been received. @@ -478,13 +432,11 @@ public: * @param[in] connection connection handle * @param[in] ltk long term key from the peer */ - void on_keys_distributed_ediv_rand( + virtual void on_keys_distributed_ediv_rand( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand - ) { - impl()->on_keys_distributed_ediv_rand_(connection, ediv, rand); - } + ) = 0; /** * Store the local key, if we are slave now or in the future @@ -493,12 +445,10 @@ public: * @param[in] connection connection handle * @param[in] ltk key sent to the peer */ - void on_keys_distributed_local_ltk( + virtual void on_keys_distributed_local_ltk( connection_handle_t connection, const ltk_t <k - ) { - impl()->on_keys_distributed_local_ltk_(connection, ltk); - } + ) = 0; /** * Store the EDIV and RAND that will be used to identify @@ -510,13 +460,11 @@ public: * @param[in] ediv identifies LTK * @param[in] rand identifies LTK */ - void on_keys_distributed_local_ediv_rand( + virtual void on_keys_distributed_local_ediv_rand( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand - ) { - impl()->on_keys_distributed_local_ediv_rand_(connection, ediv, rand); - } + ) = 0; /** * Store the results of key distribution after IRK has been received. @@ -524,12 +472,10 @@ public: * @param[in] connection connection handle * @param[in] irk identity resolution key */ - void on_keys_distributed_irk( + virtual void on_keys_distributed_irk( connection_handle_t connection, const irk_t &irk - ) { - impl()->on_keys_distributed_irk_(connection, irk); - } + ) = 0; /** * Store the identity address of the peer after it has been distributed. @@ -538,13 +484,11 @@ public: * @param[in] peer_identity_address_type public or private address indication * @param[in] peer_identity_address peer address */ - void on_keys_distributed_bdaddr( + virtual void on_keys_distributed_bdaddr( connection_handle_t connection, advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address - ) { - impl()->on_keys_distributed_bdaddr_(connection, peer_identity_address_type, peer_identity_address); - } + ) = 0; /** * Store the peer's CSRK after it has been distributed. @@ -552,12 +496,10 @@ public: * @param[in] connection connection handle * @param[in] csrk signing key */ - void on_keys_distributed_csrk( + virtual void on_keys_distributed_csrk( connection_handle_t connection, const csrk_t &csrk - ) { - impl()->on_keys_distributed_csrk_(connection, csrk); - } + ) = 0; /** * Request the LTK since the peer is asking us to encrypt the link. We need to @@ -568,13 +510,11 @@ public: * @param[in] ediv identifies LTK * @param[in] rand identifies LTK */ - void on_ltk_request( + virtual void on_ltk_request( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand - ) { - impl()->on_ltk_request_(connection, ediv, rand); - } + ) = 0; /** * Request the LTK since the peer is asking us to encrypt the link. @@ -583,29 +523,22 @@ public: * * @param[in] connection connection handle */ - void on_ltk_request( + virtual void on_ltk_request( connection_handle_t connection - ) { - impl()->on_ltk_request_(connection); - } + ) = 0; }; - +namespace interface { /** * Adaptation layer of the Security Manager. */ -template -class SecurityManager : private mbed::NonCopyable > { +class PalSecurityManager { - Impl* impl() { - return static_cast(this); - } +protected: + PalSecurityManager() { }; + ~PalSecurityManager() { }; public: - SecurityManager() : _pal_event_handler(NULL) { }; - - ~SecurityManager() { }; - //////////////////////////////////////////////////////////////////////////// // SM lifecycle management // @@ -615,27 +548,21 @@ public: * * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - ble_error_t initialize() { - return impl()->initialize_(); - } + ble_error_t initialize(); /** * Finalise all actions. Called before shutdown. * * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - ble_error_t terminate() { - return impl()->terminate_(); - } + ble_error_t terminate(); /** * Reset to same state as after initialize. * * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - ble_error_t reset() { - return impl()->reset_(); - } + ble_error_t reset(); //////////////////////////////////////////////////////////////////////////// // Resolving list management @@ -649,9 +576,7 @@ public: * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E: 7.8.41 * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - uint8_t read_resolving_list_capacity() { - return impl()->read_resolving_list_capacity_(); - } + uint8_t read_resolving_list_capacity(); /** * Add a device definition into the resolving list of the LE subsystem. @@ -666,13 +591,7 @@ public: advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address, const irk_t &peer_irk - ) { - return impl()->add_device_to_resolving_list_( - peer_identity_address_type, - peer_identity_address, - peer_irk - ); - } + ); /** * Add a device definition from the resolving list of the LE subsystem. @@ -685,12 +604,7 @@ public: ble_error_t remove_device_from_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address - ) { - return impl()->remove_device_from_resolving_list_( - peer_identity_address_type, - peer_identity_address - ); - } + ); /** * Remove all devices from the resolving list. @@ -698,9 +612,7 @@ public: * @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E: 7.8.40 * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - ble_error_t clear_resolving_list() { - return impl()->clear_resolving_list_(); - } + ble_error_t clear_resolving_list(); //////////////////////////////////////////////////////////////////////////// // Pairing @@ -723,15 +635,7 @@ public: AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist - ) { - return impl()->send_pairing_request_( - connection, - oob_data_flag, - authentication_requirements, - initiator_dist, - responder_dist - ); - } + ); /** * Send a pairing response to a master. @@ -750,15 +654,7 @@ public: AuthenticationMask authentication_requirements, KeyDistribution initiator_dist, KeyDistribution responder_dist - ) { - return impl()->send_pairing_response_( - connection, - oob_data_flag, - authentication_requirements, - initiator_dist, - responder_dist - ); - } + ); /** * Cancel an ongoing pairing. @@ -771,12 +667,7 @@ public: ble_error_t cancel_pairing( connection_handle_t connection, pairing_failure_t reason - ) { - return impl()->cancel_pairing_( - connection, - reason - ); - } + ); //////////////////////////////////////////////////////////////////////////// // Feature support @@ -790,9 +681,7 @@ public: */ ble_error_t get_secure_connections_support( bool &enabled - ) { - return impl()->get_secure_connections_support_(enabled); - } + ); /** * Set the IO capability that will be used during pairing feature exchange. @@ -802,9 +691,7 @@ public: */ ble_error_t set_io_capability( io_capability_t io_capability - ) { - return impl()->set_io_capability_(io_capability); - } + ); //////////////////////////////////////////////////////////////////////////// // Security settings @@ -821,12 +708,7 @@ public: ble_error_t set_authentication_timeout( connection_handle_t connection, uint16_t timeout_in_10ms - ) { - return impl()->set_authentication_timeout_( - connection, - timeout_in_10ms - ); - } + ); /** * Get the time after which an event will be generated unless we received a packet with @@ -839,12 +721,7 @@ public: ble_error_t get_authentication_timeout( connection_handle_t connection, uint16_t &timeout_in_10ms - ) { - return impl()->get_authentication_timeout_( - connection, - timeout_in_10ms - ); - } + ); /** * Set the key size boundaries that will be used during pairing feature @@ -862,12 +739,7 @@ public: ble_error_t set_encryption_key_requirements( uint8_t min_encryption_key_size, uint8_t max_encryption_key_size - ) { - return impl()->set_encryption_key_requirements_( - min_encryption_key_size, - max_encryption_key_size - ); - } + ); /** * Request change of security level from the master. This is called by the slave when @@ -882,12 +754,7 @@ public: ble_error_t slave_security_request( connection_handle_t connection, AuthenticationMask authentication - ) { - return impl()->slave_security_request_( - connection, - authentication - ); - } + ); //////////////////////////////////////////////////////////////////////////// // Encryption @@ -911,15 +778,7 @@ public: const rand_t &rand, const ediv_t &ediv, bool mitm - ) { - return impl()->enable_encryption_( - connection, - ltk, - rand, - ediv, - mitm - ); - } + ); /** * Enabled encryption using the LTK given on a connection established with secure @@ -934,13 +793,7 @@ public: connection_handle_t connection, const ltk_t <k, bool mitm - ) { - return impl()->enable_encryption_( - connection, - ltk, - mitm - ); - } + ); /** * Encrypt data with a given key. This uses the facility on the controller to @@ -953,9 +806,7 @@ public: ble_error_t encrypt_data( const byte_array_t<16> &key, encryption_block_t &data - ) { - return impl()->encrypt_data_(key, data); - } + ); //////////////////////////////////////////////////////////////////////////// // Privacy @@ -963,9 +814,7 @@ public: ble_error_t set_private_address_timeout( uint16_t timeout_in_seconds - ) { - return impl()->set_private_address_timeout_(timeout_in_seconds); - } + ); /** * Retrieve the identity address used by the controller @@ -979,9 +828,7 @@ public: ble_error_t get_identity_address( address_t& address, bool& public_address - ) { - return impl()->get_identity_address_(address, public_address); - } + ); //////////////////////////////////////////////////////////////////////////// // Keys @@ -1001,9 +848,7 @@ public: const ltk_t <k, bool mitm, bool secure_connections - ) { - return impl()->set_ltk_(connection, ltk, mitm, secure_connections); - } + ); /** * Inform the stack we don't have the LTK. @@ -1013,9 +858,7 @@ public: */ ble_error_t set_ltk_not_found( connection_handle_t connection - ) { - return impl()->set_ltk_not_found_(connection); - } + ); /** * Set the local IRK. @@ -1025,10 +868,7 @@ public: */ ble_error_t set_irk( const irk_t &irk - ) { - return impl()->set_irk_(irk); - } - + ); /** * Set the local CSRK. * @@ -1039,9 +879,7 @@ public: ble_error_t set_csrk( const csrk_t &csrk, sign_count_t sign_counter - ) { - return impl()->set_csrk_(csrk, sign_counter); - } + ); /** * Set the peer CSRK for particular connection. @@ -1057,18 +895,9 @@ public: const csrk_t &csrk, bool authenticated, sign_count_t sign_counter - ) { - return impl()->set_peer_csrk_( - connection, - csrk, - authenticated, - sign_counter - ); - } + ); - ble_error_t remove_peer_csrk(connection_handle_t connection) { - return impl()->remove_peer_csrk_(connection); - } + ble_error_t remove_peer_csrk(connection_handle_t connection); //////////////////////////////////////////////////////////////////////////// // Authentication @@ -1083,9 +912,7 @@ public: */ ble_error_t get_random_data( byte_array_t<8> &random_data - ) { - return impl()->get_random_data_(random_data); - } + ); //////////////////////////////////////////////////////////////////////////// // MITM @@ -1097,7 +924,7 @@ public: * * By default, the pal security manager generates a random passkey when a * passkey has to be displayed by the application. A call to this function - * with a valid passkey alter this behaviour and the SecurityManager shall + * with a valid passkey alter this behaviour and the PalSecurityManager shall * pass the passkey set into SecurityManagerEvent::on_passkey_display . * * A call to this function with a zero value will reset the behaviour and @@ -1113,24 +940,20 @@ public: */ ble_error_t set_display_passkey( passkey_num_t passkey - ) { - return impl()->set_display_passkey_(passkey); - } + ); /** - * Reply to a passkey request received from the SecurityManagerEventHandler. + * Reply to a passkey request received from the EventHandler. * * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ ble_error_t passkey_request_reply( connection_handle_t connection, passkey_num_t passkey - ) { - return impl()->passkey_request_reply_(connection, passkey); - } + ); /** - * Reply to a Secure Connections oob data request received from the SecurityManagerEventHandler. + * Reply to a Secure Connections oob data request received from the EventHandler. * * @param[in] connection connection handle * @param[in] local_random local random number used for the last oob exchange @@ -1144,17 +967,10 @@ public: const oob_lesc_value_t &local_random, const oob_lesc_value_t &peer_random, const oob_confirm_t &peer_confirm - ) { - return impl()->secure_connections_oob_request_reply_( - connection, - local_random, - peer_random, - peer_confirm - ); - } + ); /** - * Reply to a legacy pairing oob data request received from the SecurityManagerEventHandler. + * Reply to a legacy pairing oob data request received from the EventHandler. * * @param[in] connection connection handle * @param[in] oob_data pointer to out of band data @@ -1163,9 +979,7 @@ public: ble_error_t legacy_pairing_oob_request_reply( connection_handle_t connection, const oob_tk_t &oob_data - ) { - return impl()->legacy_pairing_oob_request_reply_(connection, oob_data); - } + ); /** * Notify the stack that the user has confirmed the values during numerical @@ -1178,9 +992,7 @@ public: ble_error_t confirmation_entered( connection_handle_t connection, bool confirmation - ) { - return impl()->confirmation_entered_(connection, confirmation); - } + ); /** * Notify the stack that the user pressed a key. This will be sent to the peer and create @@ -1192,21 +1004,17 @@ public: */ ble_error_t send_keypress_notification( connection_handle_t connection, - Keypress_t keypress - ) { - return impl()->send_keypress_notification_(connection, keypress); - } + ble::Keypress_t keypress + ); /** * Generate local OOB data to be sent to the application which sends it to the peer. * @return BLE_ERROR_NONE On success, else an error code indicating reason for failure */ - ble_error_t generate_secure_connections_oob() { - return impl()->generate_secure_connections_oob_(); - } + ble_error_t generate_secure_connections_oob(); /* Entry points for the underlying stack to report events back to the user. */ -public: + /** * Sets the event handler that us called by the PAL porters to notify the stack of events * which will in turn be passed onto the user application when appropriate. @@ -1214,22 +1022,12 @@ public: * @param[in] event_handler the new event handler interface implementation. Memory * owned by caller who is responsible for updating this pointer if interface changes. */ - void set_event_handler( - EventHandler *event_handler - ) { - _pal_event_handler = event_handler; - } - - EventHandler* get_event_handler() { - return _pal_event_handler; - } - -private: - EventHandler *_pal_event_handler; + void set_event_handler(PalSecurityManagerEventHandler *event_handler); + PalSecurityManagerEventHandler* get_event_handler(); }; -} /* namespace pal */ +} /* namespace interface */ } /* namespace ble */ #endif /* MBED_OS_FEATURES_FEATURE_BLE_BLE_PAL_PALSM_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/SigningEventMonitor.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSigningMonitor.h similarity index 64% rename from features/FEATURE_BLE/ble/pal/SigningEventMonitor.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalSigningMonitor.h index 432053904c..8102f1abb9 100644 --- a/features/FEATURE_BLE/ble/pal/SigningEventMonitor.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSigningMonitor.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,20 +19,14 @@ #ifndef MBED_BLE_SIGNING_EVENT_MONITOR #define MBED_BLE_SIGNING_EVENT_MONITOR -#include "ble/common/StaticInterface.h" -#include "ble/BLETypes.h" +#include "ble/types/BLETypes.h" namespace ble { -namespace pal { /** * Implemented by classes that are reacting to signing events. */ -template -class SigningMonitorEventHandler : public StaticInterface { - - using StaticInterface::impl; - +class PalSigningMonitorEventHandler { public: /** * Set new signed write peer counter. @@ -38,15 +34,11 @@ public: * @param[in] connection connection handle * @param[in] sign_coutner counter received from peer */ - void on_signed_write_received( + virtual void on_signed_write_received( connection_handle_t connection, uint32_t sign_coutner ) { - impl()->on_signed_write_received_( - connection, - sign_coutner - ); - } + }; /** * Indicate that signed data was rejected due to verification failure. This could @@ -54,45 +46,34 @@ public: * * @param[in] connection connection handle */ - void on_signed_write_verification_failure( + virtual void on_signed_write_verification_failure( connection_handle_t connection ) { - impl()->on_signed_write_verification_failure_(connection); } /** * Notify a new signed write cmd was executed. */ - void on_signed_write() { - impl()->on_signed_write_(); - } + virtual void on_signed_write() { + }; }; - - +namespace interface { /** * Implemented by classes that need to be notified of signing events. * Notification is done by calling functions in the passed in event handler */ -template -class SigningEventMonitor { - Impl* impl() { - return static_cast(this); - } - +class PalSigningMonitor { public: /** * Register a handler for singing events to be used internally and serviced first. * * @param[in] signing_event_handler Event handler being registered. */ - void set_signing_event_handler(EventHandler *signing_event_handler) - { - impl()->set_signing_event_handler_(signing_event_handler); - } + void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler); }; -} // namespace pal +} // namespace interface } // namespace ble #endif /* MBED_BLE_SIGNING_EVENT_MONITOR */ diff --git a/features/FEATURE_BLE/ble/pal/SimpleAttServerMessage.h b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSimpleAttServerMessage.h similarity index 82% rename from features/FEATURE_BLE/ble/pal/SimpleAttServerMessage.h rename to connectivity/FEATURE_BLE/include/ble/internal/pal/PalSimpleAttServerMessage.h index b408d008ea..593b59c7b9 100644 --- a/features/FEATURE_BLE/ble/pal/SimpleAttServerMessage.h +++ b/connectivity/FEATURE_BLE/include/ble/internal/pal/PalSimpleAttServerMessage.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,16 +19,15 @@ #ifndef BLE_PAL_SIMPLEATTSERVERMESSAGE_H_ #define BLE_PAL_SIMPLEATTSERVERMESSAGE_H_ -#include "AttServerMessage.h" +#include "ble/internal/pal/AttServerMessage.h" namespace ble { -namespace pal { /** - * Simple implementation of ble::pal::AttFindInformationResponse. + * Simple implementation of ble::AttFindInformationResponse. * It should fit for any vendor stack exposing a proper ATT interface. */ -struct SimpleAttFindInformationResponse : public AttFindInformationResponse { +struct PalSimpleAttFindInformationResponse : public AttFindInformationResponse { /** * Format of the UUID in the response. */ @@ -42,7 +43,7 @@ struct SimpleAttFindInformationResponse : public AttFindInformationResponse { * @param information_data The information data whose format is determined * by the Format field */ - SimpleAttFindInformationResponse( + PalSimpleAttFindInformationResponse( Format format, Span information_data ) : AttFindInformationResponse(), _format(format), _information_data(information_data), @@ -50,14 +51,14 @@ struct SimpleAttFindInformationResponse : public AttFindInformationResponse { } /** - * @see ble::pal::AttFindInformationResponse::size + * @see ble::AttFindInformationResponse::size */ virtual size_t size() const { return _information_data.size() / _item_size; } /** - * @see ble::pal::AttFindInformationResponse::operator[] + * @see ble::AttFindInformationResponse::operator[] */ virtual information_data_t operator[](size_t index) const { const uint8_t* item = &_information_data[index * _item_size]; @@ -88,28 +89,28 @@ private: /** - * Simple implementation of ble::pal::AttFindByTypeValueResponse. + * Simple implementation of ble::AttFindByTypeValueResponse. * It should fit for any vendor stack exposing a proper ATT interface. */ -struct SimpleAttFindByTypeValueResponse : public AttFindByTypeValueResponse { +struct PalSimpleAttFindByTypeValueResponse : public AttFindByTypeValueResponse { /** * Construct a AttFindByTypeValueResponse from a raw array containing the * Handle Informations. * @param handles raw array containing one or more Handle Informations. */ - SimpleAttFindByTypeValueResponse(Span handles) : + PalSimpleAttFindByTypeValueResponse(Span handles) : AttFindByTypeValueResponse(), _handles(handles) { } /** - * @see ble::pal::AttFindByTypeValueResponse::size + * @see ble::AttFindByTypeValueResponse::size */ virtual std::size_t size() const { return _handles.size() / item_size; } /** - * @see ble::pal::AttFindByTypeValueResponse::operator[] + * @see ble::AttFindByTypeValueResponse::operator[] */ virtual attribute_handle_range_t operator[](size_t index) const { attribute_handle_range_t result; @@ -126,10 +127,10 @@ private: /** - * Simple implementation of ble::pal::AttReadByTypeResponse. + * Simple implementation of ble::AttReadByTypeResponse. * It should fit for any vendor stack exposing a proper ATT interface. */ -struct SimpleAttReadByTypeResponse : public AttReadByTypeResponse { +struct PalSimpleAttReadByTypeResponse : public AttReadByTypeResponse { /** * Construct an AttReadByTypeResponse from the size of each attribute * handle-value pair and a list of attribute data. @@ -137,21 +138,21 @@ struct SimpleAttReadByTypeResponse : public AttReadByTypeResponse { * @param attribute_data Raw bytes array containing the list of attribute * data. */ - SimpleAttReadByTypeResponse( + PalSimpleAttReadByTypeResponse( uint8_t element_size, Span attribute_data ) : AttReadByTypeResponse(), _attribute_data(attribute_data), _element_size(element_size) { } /** - * @see ble::pal::AttReadByTypeResponse::size + * @see ble::AttReadByTypeResponse::size */ virtual size_t size() const { return _attribute_data.size() / _element_size; } /** - * @see ble::pal::AttReadByTypeResponse::operator[] + * @see ble::AttReadByTypeResponse::operator[] */ virtual attribute_data_t operator[](size_t index) const { const uint8_t* item = &_attribute_data[index * _element_size]; @@ -176,31 +177,31 @@ private: /** - * Simple implementation of ble::pal::AttReadByGroupTypeResponse. + * Simple implementation of ble::AttReadByGroupTypeResponse. * It should fit for any vendor stack exposing a proper ATT interface. */ -struct SimpleAttReadByGroupTypeResponse : public AttReadByGroupTypeResponse { +struct PalSimpleAttReadByGroupTypeResponse : public AttReadByGroupTypeResponse { /** * Construct an instance of AttReadByGroupTypeResponse from the size of each * attribute data and a byte array containing the list of attribute data. * @param element_size The size of each Attribute Data * @param attribute_data Byte array containing the list of Attribute Data. */ - SimpleAttReadByGroupTypeResponse( + PalSimpleAttReadByGroupTypeResponse( uint8_t element_size, Span attribute_data ) : AttReadByGroupTypeResponse(), _attribute_data(attribute_data), _element_size(element_size) { } /** - * @see ble::pal::AttReadByGroupTypeResponse::size + * @see ble::AttReadByGroupTypeResponse::size */ virtual size_t size() const { return _attribute_data.size() / _element_size; } /** - * @see ble::pal::AttReadByGroupTypeResponse::operator[] + * @see ble::AttReadByGroupTypeResponse::operator[] */ virtual attribute_data_t operator[](size_t index) const { const uint8_t* item = &_attribute_data[index * _element_size]; @@ -226,7 +227,6 @@ private: uint8_t _element_size; }; -} // namespace pal } // namespace ble #endif /* BLE_PAL_SIMPLEATTSERVERMESSAGE_H_ */ diff --git a/features/FEATURE_BLE/ble/services/BatteryService.h b/connectivity/FEATURE_BLE/include/ble/services/BatteryService.h similarity index 97% rename from features/FEATURE_BLE/ble/services/BatteryService.h rename to connectivity/FEATURE_BLE/include/ble/services/BatteryService.h index 1d60092d8a..4c5adabe8f 100644 --- a/features/FEATURE_BLE/ble/services/BatteryService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/BatteryService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +22,10 @@ #if BLE_FEATURE_GATT_SERVER #include "platform/mbed_assert.h" + #include "ble/BLE.h" +#include "ble/Gap.h" +#include "ble/GattServer.h" /** * BLE Battery service. diff --git a/features/FEATURE_BLE/ble/services/DeviceInformationService.h b/connectivity/FEATURE_BLE/include/ble/services/DeviceInformationService.h similarity index 98% rename from features/FEATURE_BLE/ble/services/DeviceInformationService.h rename to connectivity/FEATURE_BLE/include/ble/services/DeviceInformationService.h index d9d04f4f5c..4672d7f281 100644 --- a/features/FEATURE_BLE/ble/services/DeviceInformationService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/DeviceInformationService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +20,8 @@ #define __BLE_DEVICE_INFORMATION_SERVICE_H__ #include "ble/BLE.h" +#include "ble/Gap.h" +#include "ble/GattServer.h" #if BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/ble/services/EnvironmentalService.h b/connectivity/FEATURE_BLE/include/ble/services/EnvironmentalService.h similarity index 97% rename from features/FEATURE_BLE/ble/services/EnvironmentalService.h rename to connectivity/FEATURE_BLE/include/ble/services/EnvironmentalService.h index ab864c3608..402dcc9163 100644 --- a/features/FEATURE_BLE/ble/services/EnvironmentalService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/EnvironmentalService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +20,8 @@ #define __BLE_ENVIRONMENTAL_SERVICE_H__ #include "ble/BLE.h" +#include "ble/Gap.h" +#include "ble/GattServer.h" #if BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/ble/services/HealthThermometerService.h b/connectivity/FEATURE_BLE/include/ble/services/HealthThermometerService.h similarity index 97% rename from features/FEATURE_BLE/ble/services/HealthThermometerService.h rename to connectivity/FEATURE_BLE/include/ble/services/HealthThermometerService.h index f50cab7d42..a1ad710ad0 100644 --- a/features/FEATURE_BLE/ble/services/HealthThermometerService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/HealthThermometerService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +20,8 @@ #define __BLE_HEALTH_THERMOMETER_SERVICE_H__ #include "ble/BLE.h" +#include "ble/Gap.h" +#include "ble/GattServer.h" #if BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/ble/services/HeartRateService.h b/connectivity/FEATURE_BLE/include/ble/services/HeartRateService.h similarity index 98% rename from features/FEATURE_BLE/ble/services/HeartRateService.h rename to connectivity/FEATURE_BLE/include/ble/services/HeartRateService.h index 1433b81499..d4d871b8ea 100644 --- a/features/FEATURE_BLE/ble/services/HeartRateService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/HeartRateService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +20,8 @@ #define MBED_BLE_HEART_RATE_SERVICE_H__ #include "ble/BLE.h" +#include "ble/Gap.h" +#include "ble/GattServer.h" #if BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/ble/services/LinkLossService.h b/connectivity/FEATURE_BLE/include/ble/services/LinkLossService.h similarity index 96% rename from features/FEATURE_BLE/ble/services/LinkLossService.h rename to connectivity/FEATURE_BLE/include/ble/services/LinkLossService.h index eec1f256fd..01d64b6302 100644 --- a/features/FEATURE_BLE/ble/services/LinkLossService.h +++ b/connectivity/FEATURE_BLE/include/ble/services/LinkLossService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +19,9 @@ #ifndef __BLE_LINK_LOSS_SERVICE_H__ #define __BLE_LINK_LOSS_SERVICE_H__ +#include "ble/BLE.h" #include "ble/Gap.h" +#include "ble/GattServer.h" #if BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/ble/BLERoles.h b/connectivity/FEATURE_BLE/include/ble/types/BLERoles.h similarity index 77% rename from features/FEATURE_BLE/ble/BLERoles.h rename to connectivity/FEATURE_BLE/include/ble/types/BLERoles.h index 8692ec5d33..2c28eadbd5 100644 --- a/features/FEATURE_BLE/ble/BLERoles.h +++ b/connectivity/FEATURE_BLE/include/ble/types/BLERoles.h @@ -1,3 +1,21 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #ifndef MBED_BLE_ROLES_H__ #define MBED_BLE_ROLES_H__ diff --git a/features/FEATURE_BLE/ble/BLETypes.h b/connectivity/FEATURE_BLE/include/ble/types/BLETypes.h similarity index 97% rename from features/FEATURE_BLE/ble/BLETypes.h rename to connectivity/FEATURE_BLE/include/ble/types/BLETypes.h index f6d2a1a351..2b2b8663d3 100644 --- a/features/FEATURE_BLE/ble/BLETypes.h +++ b/connectivity/FEATURE_BLE/include/ble/types/BLETypes.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +22,10 @@ #include #include #include -#include "ble/SafeEnum.h" +#include "SafeEnum.h" #include "platform/Span.h" -#include "ble/gap/Types.h" + +#include "ble/types/gap/Types.h" /** * @addtogroup ble @@ -895,6 +898,15 @@ struct whitelist_t { uint8_t capacity; }; +/** events sent and received when passkey is being entered */ +enum Keypress_t { + KEYPRESS_STARTED, /**< Passkey entry started */ + KEYPRESS_ENTERED, /**< Passkey digit entered */ + KEYPRESS_ERASED, /**< Passkey digit erased */ + KEYPRESS_CLEARED, /**< Passkey cleared */ + KEYPRESS_COMPLETED, /**< Passkey entry completed */ +}; + } // namespace ble /** diff --git a/features/FEATURE_BLE/ble/common/Bounded.h b/connectivity/FEATURE_BLE/include/ble/types/Bounded.h similarity index 96% rename from features/FEATURE_BLE/ble/common/Bounded.h rename to connectivity/FEATURE_BLE/include/ble/types/Bounded.h index 85b62cf386..a124fd5aac 100644 --- a/features/FEATURE_BLE/ble/common/Bounded.h +++ b/connectivity/FEATURE_BLE/include/ble/types/Bounded.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/CallChainOfFunctionPointersWithContext.h b/connectivity/FEATURE_BLE/include/ble/types/CallChainOfFunctionPointersWithContext.h similarity index 99% rename from features/FEATURE_BLE/ble/CallChainOfFunctionPointersWithContext.h rename to connectivity/FEATURE_BLE/include/ble/types/CallChainOfFunctionPointersWithContext.h index 96887ddb1a..ac2431e012 100644 --- a/features/FEATURE_BLE/ble/CallChainOfFunctionPointersWithContext.h +++ b/connectivity/FEATURE_BLE/include/ble/types/CallChainOfFunctionPointersWithContext.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef MBED_CALLCHAIN_OF_FUNCTION_POINTERS_WITH_CONTEXT_H #define MBED_CALLCHAIN_OF_FUNCTION_POINTERS_WITH_CONTEXT_H diff --git a/features/FEATURE_BLE/ble/CharacteristicDescriptorDiscovery.h b/connectivity/FEATURE_BLE/include/ble/types/CharacteristicDescriptorDiscovery.h similarity index 98% rename from features/FEATURE_BLE/ble/CharacteristicDescriptorDiscovery.h rename to connectivity/FEATURE_BLE/include/ble/types/CharacteristicDescriptorDiscovery.h index fff183fdaf..996f38fa51 100644 --- a/features/FEATURE_BLE/ble/CharacteristicDescriptorDiscovery.h +++ b/connectivity/FEATURE_BLE/include/ble/types/CharacteristicDescriptorDiscovery.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2015 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/DiscoveredCharacteristic.h b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h similarity index 91% rename from features/FEATURE_BLE/ble/DiscoveredCharacteristic.h rename to connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h index 5e1e71bfd5..1935ad65eb 100644 --- a/features/FEATURE_BLE/ble/DiscoveredCharacteristic.h +++ b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristic.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +19,14 @@ #ifndef MBED_DISCOVERED_CHARACTERISTIC_H__ #define MBED_DISCOVERED_CHARACTERISTIC_H__ -#include "UUID.h" -#include "ble/Gap.h" -#include "GattAttribute.h" -#include "GattClient.h" -#include "CharacteristicDescriptorDiscovery.h" -#include "DiscoveredCharacteristicDescriptor.h" +#include "ble/types/UUID.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/CharacteristicDescriptorDiscovery.h" +#include "ble/types/DiscoveredCharacteristicDescriptor.h" + +namespace ble { +class GattClient; +} /** * @addtogroup ble @@ -36,8 +40,8 @@ /** * Representation of a characteristic discovered. * - * The GattClient discovery procedure initiated with - * GattClient::launchServiceDiscovery() generates instances of this class. + * The ble::GattClient discovery procedure initiated with + * ble::GattClient::launchServiceDiscovery() generates instances of this class. * * It exposes the main attributes of the discovered characteristic: * - The UUID of the characteristic, it can be retrieved by a call to the @@ -58,14 +62,14 @@ * fashions: * * If the user has a callback registered for the data read operation in the - * GattClient, then a call to the read(uint16_t) function will initiate a read of + * ble::GattClient, then a call to the read(uint16_t) function will initiate a read of * the characteristic. Results of the operation will be pass on the callback - * registered by GattClient::onDataRead(), which processes all the responses to + * registered by ble::GattClient::onDataRead(), which processes all the responses to * read requests. The read request for a given characteristic can be identified * by the connection handle and the attribute handle, which are present in * GattReadCallbackParams. * - * Another overload (read(uint16_t, const GattClient::ReadCallback_t&)) of the + * Another overload (read(uint16_t, const ble::ReadCallback_t&)) of the * read function accepts a completion callback as a last parameter. That * completion callback will be invoked automatically once the response to the * read request for that given characteristic has been received. However, @@ -74,7 +78,7 @@ * * Similarly, two versions of the write() API are exposed. One where the user * has to register a callback handling write response through the function - * GattClient::onDataWritten() and another one that accepts a completion + * ble::GattClient::onDataWritten() and another one that accepts a completion * callback in input. * * It is also possible to send a write command, which is not acknowledged by the @@ -82,7 +86,7 @@ * * Finally, descriptors of the characteristic can be discovered by invoking the * function discoverDescriptors, which is shorthand for calling - * GattClient::discoverCharacteristicDescriptors. That discovery is necessary to + * ble::GattClient::discoverCharacteristicDescriptors. That discovery is necessary to * enable or disable characteristic notification or indication that is achieved * by writing on the Client Characteristic Configuration Descriptor (CCCD). */ @@ -284,7 +288,7 @@ public: * of the characteristic. * * Read responses will be passed to the callback registered in - * GattClient::onDataRead(). Read responses to read requests that this function + * ble::GattClient::onDataRead(). Read responses to read requests that this function * call initiates will have their GattReadCallbackParams::connHandle * field equal to the value returned by getConnectionHandle() and their * GattReadCallbackParams::handle field equal to the value returned by @@ -325,7 +329,7 @@ public: */ ble_error_t read( uint16_t offset, - const GattClient::ReadCallback_t &onRead + const ble::ReadCallback_t &onRead ) const; /** @@ -364,10 +368,10 @@ public: * else an appropriate error. * * @note This function is shorthand for - * GattClient::discoverCharacteristicDescriptors; therefore, - * GattClient::isCharacteristicDescriptorDiscoveryActive can be used to + * ble::GattClient::discoverCharacteristicDescriptors; therefore, + * ble::GattClient::isCharacteristicDescriptorDiscoveryActive can be used to * determine the descriptor discovery and - * GattClient::terminateCharacteristicDescriptorDiscovery can be used to + * ble::GattClient::terminateCharacteristicDescriptorDiscovery can be used to * end the discovery process. */ ble_error_t discoverDescriptors( @@ -381,7 +385,7 @@ public: * Unlike write without responses (see writeWoResponse()), an acknowledgment * is expected for this procedure. The response of the peer GATT server to * the write request is passed to callbacks registered in - * GattClient::onDataWritten(). + * ble::GattClient::onDataWritten(). * * Similarly to read responses, responses to write request of this * characteristic can be identified by their connection handle ( @@ -429,7 +433,7 @@ public: ble_error_t write( uint16_t length, const uint8_t *value, - const GattClient::WriteCallback_t &onWrite + const ble::WriteCallback_t &onWrite ) const; void setupLongUUID(UUID::LongUUIDBytes_t longUUID, UUID::ByteOrder_t order = UUID::MSB) { @@ -511,21 +515,21 @@ public: } /** - * Get the GattClient, which can operate on this characteristic. + * Get the ble::GattClient, which can operate on this characteristic. * - * @return The GattClient, which can operate on this characteristic. + * @return The ble::GattClient, which can operate on this characteristic. */ - GattClient* getGattClient() + ble::GattClient* getGattClient() { return gattc; } /** - * Get the GattClient, which can operate on this characteristic. + * Get the ble::GattClient, which can operate on this characteristic. * - * @return The GattClient, which can operate on this characteristic. + * @return The ble::GattClient, which can operate on this characteristic. */ - const GattClient* getGattClient() const + const ble::GattClient* getGattClient() const { return gattc; } @@ -589,10 +593,10 @@ public: protected: /** - * Pointer to the underlying GattClient for this DiscoveredCharacteristic + * Pointer to the underlying ble::GattClient for this DiscoveredCharacteristic * object. */ - GattClient *gattc; + ble::GattClient *gattc; protected: /** diff --git a/features/FEATURE_BLE/ble/DiscoveredCharacteristicDescriptor.h b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h similarity index 80% rename from features/FEATURE_BLE/ble/DiscoveredCharacteristicDescriptor.h rename to connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h index f5260d7b9f..a35daad625 100644 --- a/features/FEATURE_BLE/ble/DiscoveredCharacteristicDescriptor.h +++ b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredCharacteristicDescriptor.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +19,11 @@ #ifndef MBED_DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__ #define MBED_DISCOVERED_CHARACTERISTIC_DESCRIPTOR_H__ -#include "UUID.h" +#include "ble/types/UUID.h" #include "ble/Gap.h" -#include "GattAttribute.h" -#include "GattClient.h" -#include "CharacteristicDescriptorDiscovery.h" +#include "ble/types/GattAttribute.h" +#include "ble/GattClient.h" +#include "ble/types/CharacteristicDescriptorDiscovery.h" /** * @addtogroup ble @@ -42,14 +44,14 @@ * * The descriptors of a characterstic are discovered by a Characteristic * Descriptor Discovery Procedure, which can be initiated by either - * GattClient::discoverCharacteristicDescriptors() or + * ble::GattClient::discoverCharacteristicDescriptors() or * DiscoveredCharacteristic::discoverDescriptors(). * * The discovery procedure returns the UUID of the descriptor (its type) and its * handle. * * Read and write of the descriptor value can be initiated by - * GattClient::read and GattClient::write. + * ble::GattClient::read and ble::GattClient::write. * * @todo read member function * @todo write member function @@ -69,10 +71,10 @@ public: * @param[in] uuid UUID of the descriptor. * * @note This constructor is not meant to be called directly by application - * code. The Gattclient class generates descriptors discovered. + * code. The ble::GattClient class generates descriptors discovered. */ DiscoveredCharacteristicDescriptor( - GattClient *client, + ble::GattClient *client, ble::connection_handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const UUID &uuid @@ -83,21 +85,21 @@ public: } /** - * Return the GattClient, which can operate on this descriptor. + * Return the ble::GattClient, which can operate on this descriptor. * - * @return GattClient, which can operate on this descriptor. + * @return ble::GattClient, which can operate on this descriptor. */ - GattClient* getGattClient() + ble::GattClient* getGattClient() { return _client; } /** - * Return the GattClient, which can operate on this descriptor. + * Return the ble::GattClient, which can operate on this descriptor. * - * @return GattClient, which can operate on this descriptor. + * @return ble::GattClient, which can operate on this descriptor. */ - const GattClient* getGattClient() const + const ble::GattClient* getGattClient() const { return _client; } @@ -138,7 +140,7 @@ public: } private: - GattClient *_client; + ble::GattClient *_client; ble::connection_handle_t _connectionHandle; UUID _uuid; GattAttribute::Handle_t _gattHandle; diff --git a/features/FEATURE_BLE/ble/DiscoveredService.h b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredService.h similarity index 97% rename from features/FEATURE_BLE/ble/DiscoveredService.h rename to connectivity/FEATURE_BLE/include/ble/types/DiscoveredService.h index 867c286eb0..d837a13f2b 100644 --- a/features/FEATURE_BLE/ble/DiscoveredService.h +++ b/connectivity/FEATURE_BLE/include/ble/types/DiscoveredService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +19,8 @@ #ifndef MBED_DISCOVERED_SERVICE_H__ #define MBED_DISCOVERED_SERVICE_H__ -#include "UUID.h" -#include "GattAttribute.h" +#include "ble/types/UUID.h" +#include "ble/types/GattAttribute.h" /** * @addtogroup ble diff --git a/features/FEATURE_BLE/ble/common/Duration.h b/connectivity/FEATURE_BLE/include/ble/types/Duration.h similarity index 99% rename from features/FEATURE_BLE/ble/common/Duration.h rename to connectivity/FEATURE_BLE/include/ble/types/Duration.h index e6c4f6bafa..7d78bdebcd 100644 --- a/features/FEATURE_BLE/ble/common/Duration.h +++ b/connectivity/FEATURE_BLE/include/ble/types/Duration.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/GattAttribute.h b/connectivity/FEATURE_BLE/include/ble/types/GattAttribute.h similarity index 98% rename from features/FEATURE_BLE/ble/GattAttribute.h rename to connectivity/FEATURE_BLE/include/ble/types/GattAttribute.h index b9c6c32e66..5111d81867 100644 --- a/features/FEATURE_BLE/ble/GattAttribute.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattAttribute.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +19,8 @@ #ifndef MBED_GATT_ATTRIBUTE_H__ #define MBED_GATT_ATTRIBUTE_H__ -#include "UUID.h" -#include "BLETypes.h" +#include "ble/types/UUID.h" +#include "ble/types/BLETypes.h" /** * @addtogroup ble diff --git a/features/FEATURE_BLE/ble/GattCallbackParamTypes.h b/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h similarity index 92% rename from features/FEATURE_BLE/ble/GattCallbackParamTypes.h rename to connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h index 66804b95ec..b49281278c 100644 --- a/features/FEATURE_BLE/ble/GattCallbackParamTypes.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattCallbackParamTypes.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -381,6 +383,36 @@ struct GattHVXCallbackParams { }; +namespace ble { + +/** + * Attribute read event handler. + * + * @see GattClient::onDataRead(). + */ +typedef FunctionPointerWithContext ReadCallback_t; + +/** + * Callchain of attribute read event handlers. + */ +typedef CallChainOfFunctionPointersWithContext ReadCallbackChain_t; + +/** + * Attribute write event handler. + * + * @see GattClient::onDataWrite(). + */ +typedef FunctionPointerWithContext WriteCallback_t; + +/** + * Callchain of attribute write event handlers. + * + * @see GattClient::onDataWrite(). + */ +typedef CallChainOfFunctionPointersWithContext WriteCallbackChain_t; + +} + /** * @} * @} diff --git a/features/FEATURE_BLE/ble/GattCharacteristic.h b/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h similarity index 99% rename from features/FEATURE_BLE/ble/GattCharacteristic.h rename to connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h index 96ab7f685d..a6620e8f53 100644 --- a/features/FEATURE_BLE/ble/GattCharacteristic.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattCharacteristic.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,12 +19,12 @@ #ifndef __GATT_CHARACTERISTIC_H__ #define __GATT_CHARACTERISTIC_H__ -#include "ble/Gap.h" -#include "ble/SecurityManager.h" -#include "GattAttribute.h" -#include "GattCallbackParamTypes.h" #include "FunctionPointerWithContext.h" +#include "ble/Gap.h" +#include "ble/types/GattAttribute.h" +#include "ble/types/GattCallbackParamTypes.h" + /** * @addtogroup ble * @{ diff --git a/features/FEATURE_BLE/ble/GattServerEvents.h b/connectivity/FEATURE_BLE/include/ble/types/GattServerEvents.h similarity index 96% rename from features/FEATURE_BLE/ble/GattServerEvents.h rename to connectivity/FEATURE_BLE/include/ble/types/GattServerEvents.h index 8aea1e05fb..aff507e3a6 100644 --- a/features/FEATURE_BLE/ble/GattServerEvents.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattServerEvents.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/GattService.h b/connectivity/FEATURE_BLE/include/ble/types/GattService.h similarity index 97% rename from features/FEATURE_BLE/ble/GattService.h rename to connectivity/FEATURE_BLE/include/ble/types/GattService.h index 2148be1dcb..3497c50a18 100644 --- a/features/FEATURE_BLE/ble/GattService.h +++ b/connectivity/FEATURE_BLE/include/ble/types/GattService.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,13 +14,13 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef MBED_GATT_SERVICE_H__ #define MBED_GATT_SERVICE_H__ -#include "UUID.h" -#include "GattCharacteristic.h" +#include "ble/types/UUID.h" +#include "ble/types/GattCharacteristic.h" /** * @addtogroup ble diff --git a/features/FEATURE_BLE/ble/SafeBool.h b/connectivity/FEATURE_BLE/include/ble/types/SafeBool.h similarity index 97% rename from features/FEATURE_BLE/ble/SafeBool.h rename to connectivity/FEATURE_BLE/include/ble/types/SafeBool.h index 8b135b5e5f..3fde8413aa 100644 --- a/features/FEATURE_BLE/ble/SafeBool.h +++ b/connectivity/FEATURE_BLE/include/ble/types/SafeBool.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/SafeEnum.h b/connectivity/FEATURE_BLE/include/ble/types/SafeEnum.h similarity index 98% rename from features/FEATURE_BLE/ble/SafeEnum.h rename to connectivity/FEATURE_BLE/include/ble/types/SafeEnum.h index 8e00a707f4..c0d1727d93 100644 --- a/features/FEATURE_BLE/ble/SafeEnum.h +++ b/connectivity/FEATURE_BLE/include/ble/types/SafeEnum.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/ServiceDiscovery.h b/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h similarity index 97% rename from features/FEATURE_BLE/ble/ServiceDiscovery.h rename to connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h index f390470602..5d590a8d5e 100644 --- a/features/FEATURE_BLE/ble/ServiceDiscovery.h +++ b/connectivity/FEATURE_BLE/include/ble/types/ServiceDiscovery.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +19,10 @@ #ifndef MBED_BLE_SERVICE_DISOVERY_H__ #define MBED_BLE_SERVICE_DISOVERY_H__ -#include "UUID.h" +#include "ble/types/blecommon.h" +#include "ble/types/UUID.h" #include "ble/Gap.h" -#include "GattAttribute.h" +#include "ble/types/GattAttribute.h" class DiscoveredService; class DiscoveredCharacteristic; diff --git a/features/FEATURE_BLE/ble/UUID.h b/connectivity/FEATURE_BLE/include/ble/types/UUID.h similarity index 98% rename from features/FEATURE_BLE/ble/UUID.h rename to connectivity/FEATURE_BLE/include/ble/types/UUID.h index 19acda27f5..c8c38c5bb3 100644 --- a/features/FEATURE_BLE/ble/UUID.h +++ b/connectivity/FEATURE_BLE/include/ble/types/UUID.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +24,7 @@ #include #include -#include "blecommon.h" +#include "ble/types/blecommon.h" /** * @file diff --git a/features/FEATURE_BLE/ble/blecommon.h b/connectivity/FEATURE_BLE/include/ble/types/blecommon.h similarity index 98% rename from features/FEATURE_BLE/ble/blecommon.h rename to connectivity/FEATURE_BLE/include/ble/types/blecommon.h index c390d7f867..ee74592205 100644 --- a/features/FEATURE_BLE/ble/blecommon.h +++ b/connectivity/FEATURE_BLE/include/ble/types/blecommon.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingDataBuilder.h b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataBuilder.h similarity index 98% rename from features/FEATURE_BLE/ble/gap/AdvertisingDataBuilder.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataBuilder.h index 803e5c59ae..8cb7e75d4b 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingDataBuilder.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataBuilder.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,14 +22,13 @@ #include #include #include - -#include "ble/BLETypes.h" #include "platform/NonCopyable.h" -#include "ble/blecommon.h" -#include "UUID.h" -#include "ble/gap/AdvertisingDataTypes.h" -#include "ble/gap/Types.h" +#include "ble/types/UUID.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/types/gap/AdvertisingDataTypes.h" +#include "ble/types/gap/Types.h" namespace ble { diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataParser.h similarity index 94% rename from features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataParser.h index c0559f1bff..320bd09f95 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataParser.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +20,9 @@ #define BLE_GAP_ADVERTISINGDATAPARSER_H #include -#include "ble/gap/AdvertisingDataTypes.h" +#include "platform/Span.h" + +#include "ble/types/gap/AdvertisingDataTypes.h" namespace ble { diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingDataSimpleBuilder.h b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataSimpleBuilder.h similarity index 98% rename from features/FEATURE_BLE/ble/gap/AdvertisingDataSimpleBuilder.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataSimpleBuilder.h index 3a4595ce98..eb07e84c50 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingDataSimpleBuilder.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataSimpleBuilder.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +19,10 @@ #ifndef BLE_GAP_SIMPLEADVERTISINGDATABUILDER_H #define BLE_GAP_SIMPLEADVERTISINGDATABUILDER_H -#include "ble/gap/AdvertisingDataBuilder.h" +#include "platform/Span.h" + +#include "ble/types/UUID.h" +#include "ble/types/gap/AdvertisingDataBuilder.h" namespace ble { diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingDataTypes.h b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataTypes.h similarity index 99% rename from features/FEATURE_BLE/ble/gap/AdvertisingDataTypes.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataTypes.h index d6a123d793..d9ac572a40 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingDataTypes.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingDataTypes.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +19,7 @@ #ifndef BLE_GAP_ADVERTISINGDATATYPES_H #define BLE_GAP_ADVERTISINGDATATYPES_H -#include "ble/SafeEnum.h" +#include "ble/types/SafeEnum.h" namespace ble { diff --git a/features/FEATURE_BLE/ble/gap/AdvertisingParameters.h b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingParameters.h similarity index 98% rename from features/FEATURE_BLE/ble/gap/AdvertisingParameters.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingParameters.h index b6a47ae381..25c9ad91c4 100644 --- a/features/FEATURE_BLE/ble/gap/AdvertisingParameters.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/AdvertisingParameters.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,16 +14,16 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef MBED_ADVERTISING_PARAMETERS_H__ #define MBED_ADVERTISING_PARAMETERS_H__ #include -#include "BLETypes.h" -#include "blecommon.h" -#include "SafeEnum.h" +#include "ble/types/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/types/SafeEnum.h" namespace ble { @@ -78,7 +80,7 @@ namespace ble { * chained. * * @code - void setAdvertisingParameters(ble::Gap& gap) { + void setAdvertisingParameters(ble::PalGap& gap) { using namespace ble; gap.setAdvertisingParameters( LEGACY_ADVERTISING_HANDLE, diff --git a/features/FEATURE_BLE/ble/gap/ConnectionParameters.h b/connectivity/FEATURE_BLE/include/ble/types/gap/ConnectionParameters.h similarity index 99% rename from features/FEATURE_BLE/ble/gap/ConnectionParameters.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/ConnectionParameters.h index 03fc57b98c..22776f497b 100644 --- a/features/FEATURE_BLE/ble/gap/ConnectionParameters.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/ConnectionParameters.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,14 +14,15 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef MBED_EXTENDED_CONNECT_PARAMETERS_H__ #define MBED_EXTENDED_CONNECT_PARAMETERS_H__ -#include "ble/BLETypes.h" #include "mbed_assert.h" +#include "ble/types/BLETypes.h" + namespace ble { /** diff --git a/features/FEATURE_BLE/ble/gap/Events.h b/connectivity/FEATURE_BLE/include/ble/types/gap/Events.h similarity index 99% rename from features/FEATURE_BLE/ble/gap/Events.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/Events.h index f5660654a0..56bb213c9a 100644 --- a/features/FEATURE_BLE/ble/gap/Events.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/Events.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,13 +14,13 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef BLE_GAP_EVENTS_H #define BLE_GAP_EVENTS_H -#include "ble/blecommon.h" -#include "ble/BLETypes.h" +#include "ble/types/blecommon.h" +#include "ble/types/BLETypes.h" namespace ble { diff --git a/features/FEATURE_BLE/ble/gap/ScanParameters.h b/connectivity/FEATURE_BLE/include/ble/types/gap/ScanParameters.h similarity index 97% rename from features/FEATURE_BLE/ble/gap/ScanParameters.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/ScanParameters.h index bffee5de9f..544d6c084a 100644 --- a/features/FEATURE_BLE/ble/gap/ScanParameters.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/ScanParameters.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,14 +14,15 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ #ifndef MBED_GAP_SCAN_PARAMETERS_H__ #define MBED_GAP_SCAN_PARAMETERS_H__ #include -#include "ble/blecommon.h" -#include "BLETypes.h" + +#include "ble/types/blecommon.h" +#include "ble/types/BLETypes.h" namespace ble { @@ -101,8 +104,8 @@ public: } private: - scan_window_t interval; - scan_interval_t window; + scan_interval_t interval; + scan_window_t window; bool active_scanning; }; diff --git a/features/FEATURE_BLE/ble/gap/Types.h b/connectivity/FEATURE_BLE/include/ble/types/gap/Types.h similarity index 99% rename from features/FEATURE_BLE/ble/gap/Types.h rename to connectivity/FEATURE_BLE/include/ble/types/gap/Types.h index ec4da0d16a..fe177f9a68 100644 --- a/features/FEATURE_BLE/ble/gap/Types.h +++ b/connectivity/FEATURE_BLE/include/ble/types/gap/Types.h @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,9 +19,9 @@ #ifndef BLE_GAP_TYPES_H #define BLE_GAP_TYPES_H -#include "ble/common/Duration.h" -#include "ble/common/Bounded.h" -#include "ble/SafeEnum.h" +#include "ble/types/Duration.h" +#include "ble/types/Bounded.h" +#include "ble/types/SafeEnum.h" namespace ble { diff --git a/features/FEATURE_BLE/mbed_lib.json b/connectivity/FEATURE_BLE/mbed_lib.json similarity index 88% rename from features/FEATURE_BLE/mbed_lib.json rename to connectivity/FEATURE_BLE/mbed_lib.json index f44622dda1..43d41d4225 100644 --- a/features/FEATURE_BLE/mbed_lib.json +++ b/connectivity/FEATURE_BLE/mbed_lib.json @@ -2,6 +2,11 @@ "name": "ble", "config": { "present": 1, + "ble-stack-implementation": { + "help": "What BLE stack is used. Available options: 1 (Cordio). You may add more. See headers in include/ble.", + "value": 1, + "macro_name": "BLE_STACK_IMPLEMENTATION" + }, "ble-role-observer": { "help": "Include observer BLE role support (scanning for and processing advertising packets).", "value": true, @@ -86,6 +91,11 @@ "help": "How many entries can be stored in the db, depends on security manager.", "value": 5, "macro_name": "BLE_SECURITY_DATABASE_MAX_ENTRIES" + }, + "ble-gap-max-advertising-sets": { + "help": "How many advertising sets the API can handle (this limits how much the stack can handle). Must be non-zero", + "value": 15, + "macro_name": "BLE_GAP_MAX_ADVERTISING_SETS" } } -} \ No newline at end of file +} diff --git a/features/FEATURE_BLE/source/BLE.cpp b/connectivity/FEATURE_BLE/source/BLE.cpp similarity index 71% rename from features/FEATURE_BLE/source/BLE.cpp rename to connectivity/FEATURE_BLE/source/BLE.cpp index ba5c598630..e1d0bf4fee 100644 --- a/features/FEATURE_BLE/source/BLE.cpp +++ b/connectivity/FEATURE_BLE/source/BLE.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +17,17 @@ */ #include -#include "ble/BLE.h" -#include "ble/BLEInstanceBase.h" #include "platform/mbed_critical.h" #if defined(TARGET_OTA_ENABLED) -#include "ble/services/DFUService.h" +#include "services/DFUService.h" #endif -#ifdef YOTTA_CFG_MBED_OS -#include -#endif - -#if !defined(YOTTA_CFG_MBED_OS) #include #include -#endif + +#include "ble/BLE.h" +#include "ble/internal/BLEInstanceBase.h" static const char* error_strings[] = { "BLE_ERROR_NONE: No error", @@ -73,70 +70,26 @@ BLE::initImplementation(FunctionPointerWithContextble, &BLE::processEvents); -} -#else -#define defaultSchedulingCallback NULL -#endif +#define defaultSchedulingCallback nullptr bool BLE::hasInitialized(void) const { @@ -192,7 +139,7 @@ const char *BLE::getVersion(void) return transport->getVersion(); } -const Gap &BLE::gap() const +const ble::Gap &BLE::gap() const { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -201,7 +148,7 @@ const Gap &BLE::gap() const return transport->getGap(); } -Gap &BLE::gap() +ble::Gap &BLE::gap() { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -212,7 +159,7 @@ Gap &BLE::gap() #if BLE_FEATURE_GATT_SERVER -const GattServer& BLE::gattServer() const +const ble::GattServer& BLE::gattServer() const { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -221,7 +168,7 @@ const GattServer& BLE::gattServer() const return transport->getGattServer(); } -GattServer& BLE::gattServer() +ble::GattServer& BLE::gattServer() { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -234,7 +181,7 @@ GattServer& BLE::gattServer() #if BLE_FEATURE_GATT_CLIENT -const GattClient& BLE::gattClient() const +const ble::GattClient& BLE::gattClient() const { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -243,7 +190,7 @@ const GattClient& BLE::gattClient() const return transport->getGattClient(); } -GattClient& BLE::gattClient() +ble::GattClient& BLE::gattClient() { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -256,7 +203,7 @@ GattClient& BLE::gattClient() #if BLE_FEATURE_SECURITY -const SecurityManager& BLE::securityManager() const +const ble::SecurityManager& BLE::securityManager() const { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -265,7 +212,7 @@ const SecurityManager& BLE::securityManager() const return transport->getSecurityManager(); } -SecurityManager& BLE::securityManager() +ble::SecurityManager& BLE::securityManager() { if (!transport) { MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_BLE, MBED_ERROR_CODE_BLE_BACKEND_NOT_INITIALIZED), "bad handle to underlying transport"); @@ -339,7 +286,7 @@ BLE::BLE(InstanceID_t instanceIDIn) : instanceID(instanceIDIn), transport(), } transport = transportInstances[instanceID]; } else { - transport = NULL; + transport = nullptr; } } diff --git a/features/FEATURE_BLE/source/BLEInstanceBase.cpp b/connectivity/FEATURE_BLE/source/BLEInstanceBase.cpp similarity index 86% rename from features/FEATURE_BLE/source/BLEInstanceBase.cpp rename to connectivity/FEATURE_BLE/source/BLEInstanceBase.cpp index b1d73c6c9b..e900a68d15 100644 --- a/features/FEATURE_BLE/source/BLEInstanceBase.cpp +++ b/connectivity/FEATURE_BLE/source/BLEInstanceBase.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +17,7 @@ */ #include "ble/BLE.h" -#include "ble/BLEInstanceBase.h" +#include "ble/internal/BLEInstanceBase.h" BLEInstanceBase::~BLEInstanceBase() { diff --git a/features/FEATURE_BLE/source/DiscoveredCharacteristic.cpp b/connectivity/FEATURE_BLE/source/DiscoveredCharacteristic.cpp similarity index 75% rename from features/FEATURE_BLE/source/DiscoveredCharacteristic.cpp rename to connectivity/FEATURE_BLE/source/DiscoveredCharacteristic.cpp index 402fe6868b..5888885f2c 100644 --- a/features/FEATURE_BLE/source/DiscoveredCharacteristic.cpp +++ b/connectivity/FEATURE_BLE/source/DiscoveredCharacteristic.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +16,7 @@ * limitations under the License. */ -#include "ble/DiscoveredCharacteristic.h" +#include "ble/types/DiscoveredCharacteristic.h" #include "ble/GattClient.h" ble_error_t @@ -32,16 +34,16 @@ DiscoveredCharacteristic::read(uint16_t offset) const } struct OneShotReadCallback { - static void launch(GattClient* client, ble::connection_handle_t connHandle, - GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) { + static void launch(ble::GattClient* client, ble::connection_handle_t connHandle, + GattAttribute::Handle_t handle, const ble::GattClient::ReadCallback_t& cb) { OneShotReadCallback* oneShot = new OneShotReadCallback(client, connHandle, handle, cb); oneShot->attach(); // delete will be made when this callback is called } private: - OneShotReadCallback(GattClient* client, ble::connection_handle_t connHandle, - GattAttribute::Handle_t handle, const GattClient::ReadCallback_t& cb) : + OneShotReadCallback(ble::GattClient* client, ble::connection_handle_t connHandle, + GattAttribute::Handle_t handle, const ble::GattClient::ReadCallback_t& cb) : _client(client), _connHandle(connHandle), _handle(handle), @@ -60,13 +62,13 @@ private: } } - GattClient* _client; + ble::GattClient* _client; ble::connection_handle_t _connHandle; GattAttribute::Handle_t _handle; - GattClient::ReadCallback_t _callback; + ble::GattClient::ReadCallback_t _callback; }; -ble_error_t DiscoveredCharacteristic::read(uint16_t offset, const GattClient::ReadCallback_t& onRead) const { +ble_error_t DiscoveredCharacteristic::read(uint16_t offset, const ble::GattClient::ReadCallback_t& onRead) const { ble_error_t error = read(offset); if (error) { return error; @@ -88,7 +90,7 @@ DiscoveredCharacteristic::write(uint16_t length, const uint8_t *value) const return BLE_ERROR_INVALID_STATE; } - return gattc->write(GattClient::GATT_OP_WRITE_REQ, connHandle, valueHandle, length, value); + return gattc->write(ble::GattClient::GATT_OP_WRITE_REQ, connHandle, valueHandle, length, value); } ble_error_t @@ -102,20 +104,20 @@ DiscoveredCharacteristic::writeWoResponse(uint16_t length, const uint8_t *value) return BLE_ERROR_INVALID_STATE; } - return gattc->write(GattClient::GATT_OP_WRITE_CMD, connHandle, valueHandle, length, value); + return gattc->write(ble::GattClient::GATT_OP_WRITE_CMD, connHandle, valueHandle, length, value); } struct OneShotWriteCallback { - static void launch(GattClient* client, ble::connection_handle_t connHandle, - GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) { + static void launch(ble::GattClient* client, ble::connection_handle_t connHandle, + GattAttribute::Handle_t handle, const ble::GattClient::WriteCallback_t& cb) { OneShotWriteCallback* oneShot = new OneShotWriteCallback(client, connHandle, handle, cb); oneShot->attach(); // delete will be made when this callback is called } private: - OneShotWriteCallback(GattClient* client, ble::connection_handle_t connHandle, - GattAttribute::Handle_t handle, const GattClient::WriteCallback_t& cb) : + OneShotWriteCallback(ble::GattClient* client, ble::connection_handle_t connHandle, + GattAttribute::Handle_t handle, const ble::GattClient::WriteCallback_t& cb) : _client(client), _connHandle(connHandle), _handle(handle), @@ -134,13 +136,13 @@ private: } } - GattClient* _client; + ble::GattClient* _client; ble::connection_handle_t _connHandle; GattAttribute::Handle_t _handle; - GattClient::WriteCallback_t _callback; + ble::GattClient::WriteCallback_t _callback; }; -ble_error_t DiscoveredCharacteristic::write(uint16_t length, const uint8_t *value, const GattClient::WriteCallback_t& onRead) const { +ble_error_t DiscoveredCharacteristic::write(uint16_t length, const uint8_t *value, const ble::GattClient::WriteCallback_t& onRead) const { ble_error_t error = write(length, value); if (error) { return error; diff --git a/features/FEATURE_BLE/source/generic/FileSecurityDb.cpp b/connectivity/FEATURE_BLE/source/FileSecurityDb.cpp similarity index 97% rename from features/FEATURE_BLE/source/generic/FileSecurityDb.cpp rename to connectivity/FEATURE_BLE/source/FileSecurityDb.cpp index 80517dd071..e24aa976a3 100644 --- a/features/FEATURE_BLE/source/generic/FileSecurityDb.cpp +++ b/connectivity/FEATURE_BLE/source/FileSecurityDb.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -18,10 +18,9 @@ #if BLE_SECURITY_DATABASE_FILESYSTEM -#include "FileSecurityDb.h" +#include "ble/internal/FileSecurityDb.h" namespace ble { -namespace generic { const uint16_t DB_VERSION = 1; @@ -86,7 +85,7 @@ FileSecurityDb::~FileSecurityDb() { FILE* FileSecurityDb::open_db_file(const char *db_path) { if (!db_path) { - return NULL; + return nullptr; } /* try to open an existing file */ @@ -99,7 +98,7 @@ FILE* FileSecurityDb::open_db_file(const char *db_path) { if (!db_file) { /* failed to create a file, abort */ - return NULL; + return nullptr; } /* we will check the db file and if the version or size doesn't match @@ -136,13 +135,13 @@ FILE* FileSecurityDb::erase_db_file(FILE* db_file) { while (count--) { if (fwrite(&zero, sizeof(zero), 1, db_file) != 1) { fclose(db_file); - return NULL; + return nullptr; } } if (fflush(db_file)) { fclose(db_file); - return NULL; + return nullptr; } return db_file; @@ -336,7 +335,7 @@ SecurityDistributionFlags_t* FileSecurityDb::get_entry_handle_by_index(uint8_t i if (index < BLE_SECURITY_DATABASE_MAX_ENTRIES) { return &_entries[index].flags; } else { - return NULL; + return nullptr; } } @@ -360,7 +359,7 @@ void FileSecurityDb::reset_entry(entry_handle_t db_entry) { SecurityEntryIdentity_t* FileSecurityDb::read_in_entry_peer_identity(entry_handle_t db_entry) { entry_t *entry = as_entry(db_entry); if (!entry) { - return NULL; + return nullptr; } SecurityEntryIdentity_t* identity = reinterpret_cast(_buffer); @@ -372,7 +371,7 @@ SecurityEntryIdentity_t* FileSecurityDb::read_in_entry_peer_identity(entry_handl SecurityEntryKeys_t* FileSecurityDb::read_in_entry_peer_keys(entry_handle_t db_entry) { entry_t *entry = as_entry(db_entry); if (!entry) { - return NULL; + return nullptr; } SecurityEntryKeys_t* keys = reinterpret_cast(_buffer); @@ -384,7 +383,7 @@ SecurityEntryKeys_t* FileSecurityDb::read_in_entry_peer_keys(entry_handle_t db_e SecurityEntryKeys_t* FileSecurityDb::read_in_entry_local_keys(entry_handle_t db_entry) { entry_t *entry = as_entry(db_entry); if (!entry) { - return NULL; + return nullptr; } SecurityEntryKeys_t* keys = reinterpret_cast(_buffer); @@ -396,7 +395,7 @@ SecurityEntryKeys_t* FileSecurityDb::read_in_entry_local_keys(entry_handle_t db_ SecurityEntrySigning_t* FileSecurityDb::read_in_entry_peer_signing(entry_handle_t db_entry) { entry_t *entry = as_entry(db_entry); if (!entry) { - return NULL; + return nullptr; } /* only read in the csrk */ @@ -411,7 +410,6 @@ SecurityEntrySigning_t* FileSecurityDb::read_in_entry_peer_signing(entry_handle_ return signing; }; -} /* namespace pal */ } /* namespace ble */ #endif // BLE_SECURITY_DATABASE_FILESYSTEM diff --git a/features/FEATURE_BLE/source/generic/KVStoreSecurityDb.cpp b/connectivity/FEATURE_BLE/source/KVStoreSecurityDb.cpp similarity index 99% rename from features/FEATURE_BLE/source/generic/KVStoreSecurityDb.cpp rename to connectivity/FEATURE_BLE/source/KVStoreSecurityDb.cpp index bd65446ea0..db7fc4cfaf 100644 --- a/features/FEATURE_BLE/source/generic/KVStoreSecurityDb.cpp +++ b/connectivity/FEATURE_BLE/source/KVStoreSecurityDb.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -18,10 +18,9 @@ #if BLE_SECURITY_DATABASE_KVSTORE -#include "KVStoreSecurityDb.h" +#include "ble/internal/KVStoreSecurityDb.h" namespace ble { -namespace generic { #if BLE_SECURITY_DATABASE_MAX_ENTRIES > 9 #error "BLE_SECURITY_DATABASE_MAX_ENTRIES must be only one digit long" @@ -399,7 +398,6 @@ SecurityEntrySigning_t* KVStoreSecurityDb::read_in_entry_peer_signing(entry_hand return signing; }; -} /* namespace ble */ } /* namespace generic */ #endif // BLE_SECURITY_DATABASE_KVSTORE diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioBLEInstanceBase.cpp similarity index 76% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp rename to connectivity/FEATURE_BLE/source/cordio/CordioBLEInstanceBase.cpp index e4db7af621..1af587052c 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioBLEInstanceBase.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +18,7 @@ #include "mbed.h" #include "us_ticker_api.h" -#include "BLE.h" +#include "ble/BLE.h" #include "CriticalSectionLock.h" #include "wsf_types.h" #include "wsf_msg.h" @@ -32,12 +34,15 @@ #include "att_api.h" #include "smp_api.h" #include "hci_drv.h" -#include "CordioBLE.h" #include "mbed_assert.h" #include "bstream.h" -#include "CordioPalAttClient.h" -#include "CordioPalSecurityManager.h" +#include "ble/internal/cordio/CordioPalAttClient.h" +#include "ble/internal/cordio/CordioPalSecurityManager.h" +#include "ble/internal/cordio/CordioPalGap.h" +#include "ble/internal/cordio/CordioPalSigningMonitor.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" +#include "CordioHCIDriver.h" using namespace std::chrono; @@ -53,11 +58,11 @@ uint32_t SystemHeapSize; * A runtime error is generated if the user does not define any * ble_cordio_get_hci_driver. */ -MBED_WEAK ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() +MBED_WEAK ble::CordioHCIDriver& ble_cordio_get_hci_driver() { MBED_ASSERT("No HCI driver"); printf("Please provide an implementation for the HCI driver"); - ble::vendor::cordio::CordioHCIDriver* bad_instance = NULL; + ble::CordioHCIDriver* bad_instance = nullptr; return *bad_instance; } @@ -85,7 +90,7 @@ extern "C" void hci_mbed_os_handle_reset_sequence(uint8_t* msg) */ extern "C" MBED_WEAK void wsf_mbed_ble_signal_event(void) { - ble::vendor::cordio::BLE::deviceInstance().signalEventsToProcess(::BLE::DEFAULT_INSTANCE); + ble::CordioBLEInstanceBase::deviceInstance().signalEventsToProcess(::BLE::DEFAULT_INSTANCE); } /** @@ -94,14 +99,12 @@ extern "C" MBED_WEAK void wsf_mbed_ble_signal_event(void) */ BLEInstanceBase *createBLEInstance() { - return (&(ble::vendor::cordio::BLE::deviceInstance())); + return (&(ble::CordioBLEInstanceBase::deviceInstance())); } namespace ble { -namespace vendor { -namespace cordio { -BLE::BLE(CordioHCIDriver& hci_driver) : +CordioBLEInstanceBase::CordioBLEInstanceBase(CordioHCIDriver& hci_driver) : initialization_status(NOT_INITIALIZED), instanceID(::BLE::DEFAULT_INSTANCE), _event_queue(), @@ -111,20 +114,20 @@ BLE::BLE(CordioHCIDriver& hci_driver) : stack_setup(); } -BLE::~BLE() { } +CordioBLEInstanceBase::~CordioBLEInstanceBase() { } /** * The singleton which represents the BLE transport for the BLE. */ -BLE& BLE::deviceInstance() +CordioBLEInstanceBase& CordioBLEInstanceBase::deviceInstance() { - static BLE instance( + static CordioBLEInstanceBase instance( ble_cordio_get_hci_driver() ); return instance; } -ble_error_t BLE::init( +ble_error_t CordioBLEInstanceBase::init( ::BLE::InstanceID_t instanceID, FunctionPointerWithContext< ::BLE::InitializationCompleteCallbackContext *> initCallback) { @@ -148,12 +151,12 @@ ble_error_t BLE::init( } } -bool BLE::hasInitialized() const +bool CordioBLEInstanceBase::hasInitialized() const { return initialization_status == INITIALIZED; } -ble_error_t BLE::shutdown() +ble_error_t CordioBLEInstanceBase::shutdown() { if (initialization_status != INITIALIZED) { return BLE_ERROR_INITIALIZATION_INCOMPLETE; @@ -176,67 +179,64 @@ ble_error_t BLE::shutdown() return BLE_ERROR_NONE; } -const char* BLE::getVersion() +const char* CordioBLEInstanceBase::getVersion() { static const char version[] = "generic-cordio"; return version; } -impl::GenericGapImpl& BLE::getGap() +ble::Gap& CordioBLEInstanceBase::getGap() { - static pal::vendor::cordio::GenericAccessService cordio_gap_service; - static impl::GenericGapImpl gap( + static ble::PalGenericAccessService cordio_gap_service; + static ble::Gap gap( _event_queue, - impl::PalGapImpl::get_gap(), + ble::PalGap::get_gap(), cordio_gap_service, - impl::PalSecurityManagerImpl::get_security_manager() + ble::PalSecurityManager::get_security_manager() ); return gap; } -const impl::GenericGapImpl& BLE::getGap() const +const ble::Gap& CordioBLEInstanceBase::getGap() const { - BLE &self = const_cast(*this); - return const_cast(self.getGap()); + CordioBLEInstanceBase &self = const_cast(*this); + return const_cast(self.getGap()); }; #if BLE_FEATURE_GATT_SERVER -GattServer& BLE::getGattServer() +GattServer& CordioBLEInstanceBase::getGattServer() { - return cordio::GattServer::getInstance(); + return GattServer::getInstance(); } -const GattServer& BLE::getGattServer() const +const GattServer& CordioBLEInstanceBase::getGattServer() const { - return cordio::GattServer::getInstance(); + return GattServer::getInstance(); } #endif // BLE_FEATURE_GATT_SERVER #if BLE_FEATURE_GATT_CLIENT -impl::GenericGattClientImpl& BLE::getGattClient() +ble::GattClient& CordioBLEInstanceBase::getGattClient() { - static impl::GenericGattClientImpl gatt_client(&getPalGattClient()); + static ble::GattClient gatt_client(getPalGattClient()); return gatt_client; } -impl::PalGattClientImpl& BLE::getPalGattClient() +PalGattClient& CordioBLEInstanceBase::getPalGattClient() { - static impl::PalGattClientImpl pal_client( - pal::vendor::cordio::CordioAttClient::get_client() - ); - - return pal_client; + static PalGattClient pal_gatt_client(PalAttClient::get_client()); + return pal_gatt_client; } #endif // BLE_FEATURE_GATT_CLIENT #if BLE_FEATURE_SECURITY -SecurityManager& BLE::getSecurityManager() +SecurityManager& CordioBLEInstanceBase::getSecurityManager() { - static vendor::cordio::SigningEventMonitor signing_event_monitor; - static impl::GenericSecurityManagerImpl m_instance( - impl::PalSecurityManagerImpl::get_security_manager(), + static PalSigningMonitor signing_event_monitor; + static ble::SecurityManager m_instance( + ble::PalSecurityManager::get_security_manager(), getGap(), signing_event_monitor ); @@ -244,14 +244,14 @@ SecurityManager& BLE::getSecurityManager() return m_instance; } -const SecurityManager& BLE::getSecurityManager() const +const SecurityManager& CordioBLEInstanceBase::getSecurityManager() const { - const BLE &self = const_cast(*this); + const CordioBLEInstanceBase &self = const_cast(*this); return const_cast(self.getSecurityManager()); } #endif // BLE_FEATURE_SECURITY -void BLE::waitForEvent() +void CordioBLEInstanceBase::waitForEvent() { static Timeout nextTimeout; timestamp_t nextTimestamp; @@ -268,19 +268,19 @@ void BLE::waitForEvent() } } -void BLE::processEvents() +void CordioBLEInstanceBase::processEvents() { callDispatcher(); } - void BLE::stack_handler(wsfEventMask_t event, wsfMsgHdr_t* msg) + void CordioBLEInstanceBase::stack_handler(wsfEventMask_t event, wsfMsgHdr_t* msg) { - if (msg == NULL) { + if (msg == nullptr) { return; } #if BLE_FEATURE_SECURITY - if (impl::PalSecurityManagerImpl::get_security_manager().sm_handler(msg)) { + if (ble::PalSecurityManager::get_security_manager().sm_handler(msg)) { return; } #endif // BLE_FEATURE_SECURITY @@ -328,21 +328,21 @@ void BLE::processEvents() _hci_driver->handle_test_end(status == 0, packet_number); return; } - } + } break; #endif // MBED_CONF_CORDIO_ROUTE_UNHANDLED_COMMAND_COMPLETE_EVENTS default: - impl::PalGapImpl::gap_handler(msg); + ble::PalGap::gap_handler(msg); break; } } -void BLE::device_manager_cb(dmEvt_t* dm_event) +void CordioBLEInstanceBase::device_manager_cb(dmEvt_t* dm_event) { if (dm_event->hdr.status == HCI_SUCCESS && dm_event->hdr.event == DM_CONN_DATA_LEN_CHANGE_IND) { // this event can only happen after a connection has been established therefore gap is present - impl::PalGapImpl::EventHandler *handler; - handler = impl::PalGapImpl::get_gap().get_event_handler(); + ble::PalGapEventHandler *handler; + handler = ble::PalGap::get_gap().get_event_handler(); if (handler) { handler->on_data_length_change( dm_event->hdr.param, @@ -353,7 +353,7 @@ void BLE::device_manager_cb(dmEvt_t* dm_event) return; } - BLE::deviceInstance().stack_handler(0, &dm_event->hdr); + CordioBLEInstanceBase::deviceInstance().stack_handler(0, &dm_event->hdr); } /* @@ -361,14 +361,14 @@ void BLE::device_manager_cb(dmEvt_t* dm_event) * the CCC Table of the ATT Server when a remote peer requests to Open * or Close the connection. */ - void BLE::connection_handler(dmEvt_t* dm_event) + void CordioBLEInstanceBase::connection_handler(dmEvt_t* dm_event) { dmConnId_t connId = (dmConnId_t)dm_event->hdr.param; switch (dm_event->hdr.event) { case DM_CONN_OPEN_IND: /* set up CCC table with uninitialized (all zero) values */ - AttsCccInitTable(connId, NULL); + AttsCccInitTable(connId, nullptr); break; case DM_CONN_CLOSE_IND: /* clear CCC table on connection close */ @@ -379,14 +379,14 @@ void BLE::device_manager_cb(dmEvt_t* dm_event) } } -void BLE::timeoutCallback() +void CordioBLEInstanceBase::timeoutCallback() { wsf_mbed_ble_signal_event(); } -void BLE::stack_setup() +void CordioBLEInstanceBase::stack_setup() { - MBED_ASSERT(_hci_driver != NULL); + MBED_ASSERT(_hci_driver != nullptr); wsfHandlerId_t handlerId; @@ -527,35 +527,35 @@ void BLE::stack_setup() #endif // BLE_FEATURE_SECURITY - stack_handler_id = WsfOsSetNextHandler(&BLE::stack_handler); + stack_handler_id = WsfOsSetNextHandler(&CordioBLEInstanceBase::stack_handler); HciSetMaxRxAclLen(MBED_CONF_CORDIO_RX_ACL_BUFFER_SIZE); - DmRegister(BLE::device_manager_cb); + DmRegister(CordioBLEInstanceBase::device_manager_cb); #if BLE_FEATURE_CONNECTABLE - DmConnRegister(DM_CLIENT_ID_APP, BLE::device_manager_cb); + DmConnRegister(DM_CLIENT_ID_APP, CordioBLEInstanceBase::device_manager_cb); #endif #if BLE_FEATURE_GATT_SERVER - AttConnRegister(BLE::connection_handler); + AttConnRegister(CordioBLEInstanceBase::connection_handler); #endif #if BLE_FEATURE_ATT #if BLE_FEATURE_GATT_CLIENT - AttRegister((attCback_t) ble::pal::vendor::cordio::CordioAttClient::att_client_handler); + AttRegister((attCback_t) ble::PalAttClient::att_client_handler); #else - AttRegister((attCback_t) ble::vendor::cordio::GattServer::att_cb); + AttRegister((attCback_t) ble::GattServer::att_cb); #endif // BLE_FEATURE_GATT_CLIENT #endif } -void BLE::start_stack_reset() +void CordioBLEInstanceBase::start_stack_reset() { _hci_driver->initialize(); DmDevReset(); } -void BLE::callDispatcher() +void CordioBLEInstanceBase::callDispatcher() { // process the external event queue _event_queue.process(); @@ -590,20 +590,8 @@ void BLE::callDispatcher() } } -CordioHCIDriver* BLE::_hci_driver = NULL; +CordioHCIDriver* CordioBLEInstanceBase::_hci_driver = nullptr; -FunctionPointerWithContext< ::BLE::InitializationCompleteCallbackContext*> BLE::_init_callback; +FunctionPointerWithContext< ::BLE::InitializationCompleteCallbackContext*> CordioBLEInstanceBase::_init_callback; -template<> -void SigningEventMonitor::set_signing_event_handler_(impl::GenericSecurityManagerImpl *handler) { -#if BLE_FEATURE_GATT_CLIENT - BLE::deviceInstance().getGattClient().set_signing_event_handler(handler); -#endif // BLE_FEATURE_GATT_CLIENT -#if BLE_FEATURE_GATT_SERVER - BLE::deviceInstance().getGattServer().set_signing_event_handler(handler); -#endif // BLE_FEATURE_GATT_SERVER -} - -} // namespace cordio -} // namespace vendor } // namespace ble diff --git a/features/FEATURE_BLE/source/generic/GenericGap.tpp b/connectivity/FEATURE_BLE/source/cordio/CordioGap.cpp similarity index 67% rename from features/FEATURE_BLE/source/generic/GenericGap.tpp rename to connectivity/FEATURE_BLE/source/cordio/CordioGap.cpp index b2aeea2c12..7aa85437c4 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.tpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioGap.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -18,23 +18,27 @@ #include #include +#include -#include "ble/BLEInstanceBase.h" + +#include "ble/internal/BLEInstanceBase.h" #include "ble/Gap.h" -#include "ble/pal/PalGap.h" -#include "ble/pal/GapEvents.h" -#include "ble/pal/GapTypes.h" -#include "ble/pal/GenericAccessService.h" -#include "ble/generic/GenericGap.h" +#include "ble/SecurityManager.h" +#include "ble/internal/pal/PalGap.h" +#include "ble/internal/pal/GapEvents.h" +#include "ble/internal/pal/GapTypes.h" +#include "ble/internal/pal/PalGenericAccessService.h" +#include "ble/internal/cordio/CordioPalEventQueue.h" +#include "ble/internal/cordio/CordioPalGap.h" #include "drivers/Timeout.h" using namespace std::chrono; -namespace ble { -namespace generic { +MBED_STATIC_ASSERT(BLE_GAP_MAX_ADVERTISING_SETS < 0xFF, "BLE_GAP_MAX_ADVERTISING_SETS must be less than 255"); +MBED_STATIC_ASSERT(BLE_GAP_MAX_ADVERTISING_SETS > 0, "BLE_GAP_MAX_ADVERTISING_SETS must be a positive number"); -using pal::connection_peer_address_type_t; +namespace ble { namespace { @@ -77,9 +81,9 @@ static bool is_in_range(T value, T lower_bound, T higher_bound) * timeout to be equal to 0xFFFF. When it is the case that value can be * interpreted as "non specific". */ -static bool is_preferred_connection_params_valid(const ::Gap::PreferredConnectionParams_t *params) +static bool is_preferred_connection_params_valid(const Gap::PreferredConnectionParams_t *params) { - if (params == NULL) { + if (params == nullptr) { return false; } @@ -273,16 +277,16 @@ static bool is_in_whitelist( } /* - * Convert a peer_address_type_t into a pal::whitelist_address_type_t. + * Convert a peer_address_type_t into a whitelist_address_type_t. */ -static pal::whitelist_address_type_t to_whitelist_address_type( +static whitelist_address_type_t to_whitelist_address_type( peer_address_type_t address_type ) { return (address_type == peer_address_type_t::PUBLIC || address_type == peer_address_type_t::PUBLIC_IDENTITY) ? - pal::whitelist_address_type_t::PUBLIC_DEVICE_ADDRESS : - pal::whitelist_address_type_t::RANDOM_DEVICE_ADDRESS; + whitelist_address_type_t::PUBLIC_DEVICE_ADDRESS : + whitelist_address_type_t::RANDOM_DEVICE_ADDRESS; } microsecond_t minSupervisionTimeout( @@ -297,20 +301,30 @@ microsecond_t minSupervisionTimeout( } // end of anonymous namespace -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -GenericGap::GenericGap( - pal::EventQueue &event_queue, - PalGapImpl &pal_gap, - pal::GenericAccessService &generic_access_service, +const peripheral_privacy_configuration_t Gap::default_peripheral_privacy_configuration = { + /* use_non_resolvable_random_address */ false, + /* resolution_strategy */ peripheral_privacy_configuration_t::PERFORM_PAIRING_PROCEDURE +}; + + +const central_privacy_configuration_t Gap::default_central_privacy_configuration = { + /* use_non_resolvable_random_address */ false, + /* resolution_strategy */ central_privacy_configuration_t::RESOLVE_AND_FORWARD +}; + +Gap::Gap( + PalEventQueue &event_queue, + PalGap &pal_gap, + PalGenericAccessService &generic_access_service, PalSecurityManager &pal_sm ) : _event_queue(event_queue), _pal_gap(pal_gap), _gap_service(generic_access_service), _pal_sm(pal_sm), _address_type(own_address_type_t::PUBLIC), - _initiator_policy_mode(pal::initiator_policy_t::NO_FILTER), - _scanning_filter_policy(pal::scanning_filter_policy_t::NO_FILTER), - _advertising_filter_policy(pal::advertising_filter_policy_t::NO_FILTER), + _initiator_policy_mode(initiator_policy_t::NO_FILTER), + _scanning_filter_policy(scanning_filter_policy_t::NO_FILTER), + _advertising_filter_policy(advertising_filter_policy_t::NO_FILTER), _whitelist(), _privacy_enabled(false), _peripheral_privacy_configuration(default_peripheral_privacy_configuration), @@ -324,7 +338,7 @@ GenericGap:: _pal_gap.initialize(); _pal_gap.when_gap_event_received( - mbed::callback(this, &GenericGap::on_gap_event_received) + mbed::callback(this, &Gap::on_gap_event_received) ); // Recover static random identity @@ -333,19 +347,45 @@ GenericGap:: _pal_gap.set_event_handler(this); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -GenericGap::~GenericGap() + +Gap::~Gap() { } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::isFeatureSupported_(controller_supported_features_t feature) + +bool Gap::isFeatureSupported(controller_supported_features_t feature) { +#if !BLE_FEATURE_PHY_MANAGEMENT + if (feature == ble::controller_supported_features_t::LE_CODED_PHY || + feature == ble::controller_supported_features_t::LE_2M_PHY + ) { + return false; + } +#endif + +#if !BLE_FEATURE_EXTENDED_ADVERTISING + if (feature == ble::controller_supported_features_t::LE_EXTENDED_ADVERTISING) { + return false; + } +#endif + +#if !BLE_FEATURE_PERIODIC_ADVERTISING + if (feature == ble::controller_supported_features_t::LE_PERIODIC_ADVERTISING) { + return false; + } +#endif + +#if !BLE_FEATURE_PRIVACY + if (feature == ble::controller_supported_features_t::LL_PRIVACY) { + return false; + } +#endif + return _pal_gap.is_feature_supported(feature); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setRandomStaticAddress_( + +ble_error_t Gap::setRandomStaticAddress( const ble::address_t& address ) { @@ -364,8 +404,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::getAddress_( + +ble_error_t Gap::getAddress( own_address_type_t &type, address_t &address ) @@ -381,8 +421,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::getRandomAddressType( + +ble_error_t Gap::getRandomAddressType( const address_t address, ble::random_address_type_t* type ) { @@ -403,8 +443,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::stopScan_() + +ble_error_t Gap::stopScan() { ble_error_t err; @@ -415,7 +455,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::connect_( + +ble_error_t Gap::connect( peer_address_type_t peerAddressType, const ble::address_t &peerAddress, const ConnectionParameters &connectionParams @@ -474,7 +514,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::manageConnectionParametersUpdateRequest_(bool flag) + +ble_error_t Gap::manageConnectionParametersUpdateRequest(bool flag) { _user_manage_connection_parameter_requests = flag; return BLE_ERROR_NONE; } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::updateConnectionParameters_( + +ble_error_t Gap::updateConnectionParameters( connection_handle_t connectionHandle, conn_interval_t minConnectionInterval, conn_interval_t maxConnectionInterval, @@ -548,8 +588,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::acceptConnectionParametersUpdate_( + +ble_error_t Gap::acceptConnectionParametersUpdate( connection_handle_t connectionHandle, conn_interval_t minConnectionInterval, conn_interval_t maxConnectionInterval, @@ -574,31 +614,31 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::rejectConnectionParametersUpdate_( + +ble_error_t Gap::rejectConnectionParametersUpdate( connection_handle_t connectionHandle ) { return _pal_gap.reject_connection_parameter_request( connectionHandle, - pal::hci_error_code_t::UNACCEPTABLE_CONNECTION_PARAMETERS + hci_error_code_t::UNACCEPTABLE_CONNECTION_PARAMETERS ); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::cancelConnect_() + +ble_error_t Gap::cancelConnect() { return _pal_gap.cancel_connection_creation(); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::readPhy_(ble::connection_handle_t connection) + +ble_error_t Gap::readPhy(ble::connection_handle_t connection) { return _pal_gap.read_phy(connection); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setPreferredPhys_( + +ble_error_t Gap::setPreferredPhys( const phy_set_t *txPhys, const phy_set_t *rxPhys ) @@ -608,8 +648,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setPhy_( + +ble_error_t Gap::setPhy( ble::connection_handle_t connection, const phy_set_t *txPhys, const phy_set_t *rxPhys, @@ -621,56 +661,56 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_read_phy_( - pal::hci_error_code_t hci_status, + +void Gap::on_read_phy( + hci_error_code_t hci_status, ble::connection_handle_t connection_handle, phy_t tx_phy, phy_t rx_phy ) { ble_error_t status = BLE_ERROR_NONE; - if (hci_status != pal::hci_error_code_t::SUCCESS) { + if (hci_status != hci_error_code_t::SUCCESS) { status = BLE_ERROR_UNSPECIFIED; } - if (_eventHandler) { - _eventHandler->onPhyUpdateComplete(status, connection_handle, tx_phy, rx_phy); + if (_event_handler) { + _event_handler->onPhyUpdateComplete(status, connection_handle, tx_phy, rx_phy); } } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_data_length_change_( + +void Gap::on_data_length_change( connection_handle_t connection_handle, uint16_t tx_size, uint16_t rx_size ) { - if (_eventHandler) { - _eventHandler->onDataLengthChange(connection_handle, tx_size, rx_size); + if (_event_handler) { + _event_handler->onDataLengthChange(connection_handle, tx_size, rx_size); } } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_phy_update_complete_( - pal::hci_error_code_t hci_status, + +void Gap::on_phy_update_complete( + hci_error_code_t hci_status, ble::connection_handle_t connection_handle, phy_t tx_phy, phy_t rx_phy ) { ble_error_t status = BLE_ERROR_NONE; - if (hci_status != pal::hci_error_code_t::SUCCESS) { + if (hci_status != hci_error_code_t::SUCCESS) { status = BLE_ERROR_UNSPECIFIED; } - if (_eventHandler) { - _eventHandler->onPhyUpdateComplete(status, connection_handle, tx_phy, rx_phy); + if (_event_handler) { + _event_handler->onPhyUpdateComplete(status, connection_handle, tx_phy, rx_phy); } } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::disconnect_( + +ble_error_t Gap::disconnect( connection_handle_t connectionHandle, local_disconnection_reason_t reason ) @@ -678,14 +718,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint8_t GenericGap::getMaxWhitelistSize_(void) const + +uint8_t Gap::getMaxWhitelistSize(void) const { return _pal_gap.read_white_list_capacity(); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::getWhitelist_(whitelist_t &whitelist) const + +ble_error_t Gap::getWhitelist(whitelist_t &whitelist) const { if (initialize_whitelist() == false) { return BLE_ERROR_INVALID_STATE; @@ -703,8 +743,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setWhitelist_(const whitelist_t &whitelist) + +ble_error_t Gap::setWhitelist(const whitelist_t &whitelist) { if (is_whitelist_valid(whitelist) == false) { return BLE_ERROR_INVALID_PARAM; @@ -796,8 +836,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::enablePrivacy_(bool enable) + +ble_error_t Gap::enablePrivacy(bool enable) { if (enable == _privacy_enabled) { // No change @@ -816,8 +856,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setPeripheralPrivacyConfiguration_( + +ble_error_t Gap::setPeripheralPrivacyConfiguration( const peripheral_privacy_configuration_t *configuration ) { @@ -828,8 +868,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::getPeripheralPrivacyConfiguration_( + +ble_error_t Gap::getPeripheralPrivacyConfiguration( peripheral_privacy_configuration_t *configuration ) { @@ -838,8 +878,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setCentralPrivacyConfiguration_( + +ble_error_t Gap::setCentralPrivacyConfiguration( const central_privacy_configuration_t *configuration ) { @@ -850,8 +890,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::getCentralPrivacyConfiguration_( + +ble_error_t Gap::getCentralPrivacyConfiguration( central_privacy_configuration_t *configuration ) { @@ -860,10 +900,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::reset_(void) + +ble_error_t Gap::reset(void) { - Gap::reset_(); + /* Notify that the instance is about to shut down */ + shutdownCallChain.call(this); + shutdownCallChain.clear(); + + _event_handler = nullptr; #if BLE_ROLE_BROADCASTER _advertising_timeout.detach(); @@ -875,14 +919,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_scan_timeout_() + +void Gap::on_scan_timeout() { if (!_scan_enabled) { return; @@ -938,18 +982,18 @@ void GenericGaponScanTimeout(ScanTimeoutEvent()); + if (_event_handler) { + _event_handler->onScanTimeout(ScanTimeoutEvent()); } } } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::process_legacy_scan_timeout() + +void Gap::process_legacy_scan_timeout() { /* legacy scanning timed out is based on timer so we need to stop the scan manually */ _pal_gap.scan_enable(false, false); @@ -957,19 +1001,19 @@ void GenericGaponScanTimeout(ScanTimeoutEvent()); + if (_event_handler) { + _event_handler->onScanTimeout(ScanTimeoutEvent()); } } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_advertising_timeout() + +void Gap::on_advertising_timeout() { - _event_queue.post(mbed::callback(this, &GenericGap::process_advertising_timeout)); + _event_queue.post(mbed::callback(this, &Gap::process_advertising_timeout)); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::process_advertising_timeout() + +void Gap::process_advertising_timeout() { // This will signal timeout via onAdvertisingEnd() ble_error_t err = _pal_gap.advertising_enable(false); @@ -983,34 +1027,34 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_gap_event_received(const pal::GapEvent &e) + +void Gap::on_gap_event_received(const GapEvent &e) { switch (e.type.value()) { #if BLE_ROLE_OBSERVER - case pal::GapEventType::ADVERTISING_REPORT: - on_advertising_report(static_cast(e)); + case GapEventType::ADVERTISING_REPORT: + on_advertising_report(static_cast(e)); break; #endif // BLE_ROLE_OBSERVER #if BLE_FEATURE_CONNECTABLE - case pal::GapEventType::CONNECTION_COMPLETE: - on_connection_complete(static_cast(e)); + case GapEventType::CONNECTION_COMPLETE: + on_connection_complete(static_cast(e)); break; - case pal::GapEventType::CONNECTION_UPDATE: - on_connection_update(static_cast(e)); + case GapEventType::CONNECTION_UPDATE: + on_connection_update(static_cast(e)); break; - case pal::GapEventType::DISCONNECTION_COMPLETE: - on_disconnection_complete(static_cast(e)); + case GapEventType::DISCONNECTION_COMPLETE: + on_disconnection_complete(static_cast(e)); break; - case pal::GapEventType::REMOTE_CONNECTION_PARAMETER_REQUEST: - on_connection_parameter_request(static_cast(e)); + case GapEventType::REMOTE_CONNECTION_PARAMETER_REQUEST: + on_connection_parameter_request(static_cast(e)); break; #endif // BLE_FEATURE_CONNECTABLE - case pal::GapEventType::UNEXPECTED_ERROR: - on_unexpected_error(static_cast(e)); + case GapEventType::UNEXPECTED_ERROR: + on_unexpected_error(static_cast(e)); break; default: @@ -1018,17 +1062,17 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_advertising_report(const pal::GapAdvertisingReportEvent &e) + +void Gap::on_advertising_report(const GapAdvertisingReportEvent &e) { for (size_t i = 0; i < e.size(); ++i) { - pal::GapAdvertisingReportEvent::advertising_t advertising = e[i]; + GapAdvertisingReportEvent::advertising_t advertising = e[i]; #if BLE_FEATURE_PRIVACY // Check if the address hasn't been resolved if (_privacy_enabled && _central_privacy_configuration.resolution_strategy == central_privacy_configuration_t::RESOLVE_AND_FILTER && - advertising.address_type == pal::connection_peer_address_type_t::RANDOM_ADDRESS && + advertising.address_type == connection_peer_address_type_t::RANDOM_ADDRESS && is_random_private_resolvable_address(advertising.address.data()) ) { // Filter it out @@ -1042,30 +1086,30 @@ void GenericGap(advertising.address_type.value()); // report in new event handler - if (_eventHandler) { + if (_event_handler) { uint8_t event_type = 0; // Conversion table available at BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E // 7.7.65.13 switch (advertising.type.value()) { - case pal::received_advertising_type_t::ADV_IND: + case received_advertising_type_t::ADV_IND: event_type = 0x13; break; - case pal::received_advertising_type_t::ADV_DIRECT_IND: + case received_advertising_type_t::ADV_DIRECT_IND: event_type = 0x15; break; - case pal::received_advertising_type_t::ADV_SCAN_IND: + case received_advertising_type_t::ADV_SCAN_IND: event_type = 0x12; break; - case pal::received_advertising_type_t::ADV_NONCONN_IND: + case received_advertising_type_t::ADV_NONCONN_IND: event_type = 0x10; break; - case pal::received_advertising_type_t::SCAN_RESPONSE: + case received_advertising_type_t::SCAN_RESPONSE: event_type = 0x1B; break; } - _eventHandler->onAdvertisingReport( + _event_handler->onAdvertisingReport( AdvertisingReportEvent( advertising_event_t(event_type), peer_address_type, @@ -1085,12 +1129,12 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_connection_complete(const pal::GapConnectionCompleteEvent &e) + +void Gap::on_connection_complete(const GapConnectionCompleteEvent &e) { - if (e.status != pal::hci_error_code_t::SUCCESS) { - if (_eventHandler) { - _eventHandler->onConnectionComplete( + if (e.status != hci_error_code_t::SUCCESS) { + if (_event_handler) { + _event_handler->onConnectionComplete( ConnectionCompleteEvent( BLE_ERROR_NOT_FOUND, INVALID_ADVERTISING_HANDLE, @@ -1133,7 +1177,7 @@ void GenericGaponConnectionComplete( + if (_event_handler) { + _event_handler->onConnectionComplete( ConnectionCompleteEvent( BLE_ERROR_NONE, e.connection_handle, @@ -1204,7 +1248,7 @@ void GenericGapgetSecurityManager(); + ble::SecurityManager &sm = createBLEInstance()->getSecurityManager(); // Request authentication to start pairing procedure sm.requestAuthentication(e.connection_handle); } else if (needs_authentication) { @@ -1214,10 +1258,10 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_disconnection_complete(const pal::GapDisconnectionCompleteEvent &e) + +void Gap::on_disconnection_complete(const GapDisconnectionCompleteEvent &e) { - if (e.status == pal::hci_error_code_t::SUCCESS) { + if (e.status == hci_error_code_t::SUCCESS) { // signal internal stack if (_connection_event_handler) { _connection_event_handler->on_disconnected( @@ -1227,8 +1271,8 @@ void GenericGaponDisconnectionComplete( + if (_event_handler) { + _event_handler->onDisconnectionComplete( DisconnectionCompleteEvent( (connection_handle_t) e.connection_handle, (disconnection_reason_t::type) e.reason @@ -1240,12 +1284,12 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_connection_parameter_request(const pal::GapRemoteConnectionParameterRequestEvent &e) + +void Gap::on_connection_parameter_request(const GapRemoteConnectionParameterRequestEvent &e) { if (_user_manage_connection_parameter_requests) { - if (_eventHandler) { - _eventHandler->onUpdateConnectionParametersRequest( + if (_event_handler) { + _event_handler->onUpdateConnectionParametersRequest( UpdateConnectionParametersRequestEvent( e.connection_handle, conn_interval_t(e.min_connection_interval), @@ -1270,16 +1314,16 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_connection_update(const pal::GapConnectionUpdateEvent &e) + +void Gap::on_connection_update(const GapConnectionUpdateEvent &e) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onConnectionParametersUpdateComplete( + _event_handler->onConnectionParametersUpdateComplete( ConnectionParametersUpdateCompleteEvent( - e.status == pal::hci_error_code_t::SUCCESS ? BLE_ERROR_NONE : BLE_ERROR_UNSPECIFIED, + e.status == hci_error_code_t::SUCCESS ? BLE_ERROR_NONE : BLE_ERROR_UNSPECIFIED, e.connection_handle, conn_interval_t(e.connection_interval), e.connection_latency, @@ -1288,15 +1332,15 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_unexpected_error(const pal::GapUnexpectedErrorEvent &e) + +void Gap::on_unexpected_error(const GapUnexpectedErrorEvent &e) { // TODO: add feature in interface to notify the user that the connection // has been updated. } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -pal::own_address_type_t GenericGap::get_own_address_type(AddressUseType_t address_use_type) + +own_address_type_t Gap::get_own_address_type(AddressUseType_t address_use_type) { #if BLE_FEATURE_PRIVACY if (_privacy_enabled) { @@ -1314,30 +1358,30 @@ pal::own_address_type_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::initialize_whitelist() const + +bool Gap::initialize_whitelist() const { - if (_whitelist.addresses != NULL) { + if (_whitelist.addresses != nullptr) { return true; } @@ -1348,7 +1392,7 @@ bool GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::update_address_resolution_setting() + +ble_error_t Gap::update_address_resolution_setting() { // enable if privacy is enabled and resolution is requested in either central or peripheral mode bool enable = false; @@ -1380,8 +1424,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::set_random_address_rotation(bool enable) + +void Gap::set_random_address_rotation(bool enable) { if (enable == _random_address_rotating) { return; @@ -1395,7 +1439,7 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::update_random_address() + +void Gap::update_random_address() { if (!_random_address_rotating) { // This event might have been queued before we disabled address rotation @@ -1418,7 +1462,7 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::getUnresolvableRandomAddress(ble::address_t &address) + +bool Gap::getUnresolvableRandomAddress(ble::address_t &address) { do { byte_array_t<8> random_data; @@ -1490,22 +1534,18 @@ bool GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_address_rotation_timeout() + +void Gap::on_address_rotation_timeout() { - _event_queue.post(mbed::callback(this, &GenericGap::update_random_address)); + _event_queue.post(mbed::callback(this, &Gap::update_random_address)); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -const uint8_t GenericGap::MAX_ADVERTISING_SETS; - -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint8_t GenericGap::getMaxAdvertisingSetNumber_() +uint8_t Gap::getMaxAdvertisingSetNumber() { #if BLE_FEATURE_EXTENDED_ADVERTISING if (is_extended_advertising_available()) { uint8_t set_number = _pal_gap.get_max_number_of_advertising_sets(); - return std::min(MAX_ADVERTISING_SETS, set_number); + return std::min((uint8_t)BLE_GAP_MAX_ADVERTISING_SETS, set_number); } else #endif // BLE_FEATURE_EXTENDED_ADVERTISING { @@ -1513,26 +1553,26 @@ uint8_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint16_t GenericGap::getMaxAdvertisingDataLength_() + +uint16_t Gap::getMaxAdvertisingDataLength() { return _pal_gap.get_maximum_advertising_data_length(); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint16_t GenericGap::getMaxConnectableAdvertisingDataLength_() + +uint16_t Gap::getMaxConnectableAdvertisingDataLength() { return _pal_gap.get_maximum_connectable_advertising_data_length(); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint16_t GenericGap::getMaxActiveSetAdvertisingDataLength_() + +uint16_t Gap::getMaxActiveSetAdvertisingDataLength() { return _pal_gap.get_maximum_hci_advertising_data_length(); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::createAdvertisingSet_( + +ble_error_t Gap::createAdvertisingSet( advertising_handle_t *handle, const AdvertisingParameters ¶meters ) @@ -1542,7 +1582,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::destroyAdvertisingSet_(advertising_handle_t handle) + +ble_error_t Gap::destroyAdvertisingSet(advertising_handle_t handle) { if (is_extended_advertising_available() == false) { return BLE_ERROR_OPERATION_NOT_PERMITTED; @@ -1577,7 +1617,7 @@ ble_error_t GenericGap= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1605,14 +1645,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setAdvertisingParameters_( + +ble_error_t Gap::setAdvertisingParameters( advertising_handle_t handle, const AdvertisingParameters ¶ms ) { #if BLE_FEATURE_EXTENDED_ADVERTISING - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1633,7 +1673,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setExtendedAdvertisingParameters( + +ble_error_t Gap::setExtendedAdvertisingParameters( advertising_handle_t handle, const AdvertisingParameters ¶ms ) { - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1674,12 +1714,12 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setAdvertisingPayload_( + +ble_error_t Gap::setAdvertisingPayload( advertising_handle_t handle, Span payload ) @@ -1733,8 +1773,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setAdvertisingScanResponse_( + +ble_error_t Gap::setAdvertisingScanResponse( advertising_handle_t handle, Span response ) @@ -1747,8 +1787,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setAdvertisingData( + +ble_error_t Gap::setAdvertisingData( advertising_handle_t handle, Span payload, bool minimiseFragmentation, @@ -1756,10 +1796,10 @@ ble_error_t GenericGap= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1801,7 +1841,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::startAdvertising_( + +ble_error_t Gap::startAdvertising( advertising_handle_t handle, adv_duration_t maxDuration, uint8_t maxEvents @@ -1882,7 +1922,7 @@ ble_error_t GenericGap= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1922,7 +1962,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::stopAdvertising_(advertising_handle_t handle) + +ble_error_t Gap::stopAdvertising(advertising_handle_t handle) { ble_error_t status; #if BLE_FEATURE_EXTENDED_ADVERTISING - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -1958,8 +1998,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::isAdvertisingActive_(advertising_handle_t handle) + +bool Gap::isAdvertisingActive(advertising_handle_t handle) { - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return false; } return _active_sets.get(handle); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setPeriodicAdvertisingParameters_( + +ble_error_t Gap::setPeriodicAdvertisingParameters( advertising_handle_t handle, periodic_interval_t periodicAdvertisingIntervalMin, periodic_interval_t periodicAdvertisingIntervalMax, @@ -2012,7 +2052,7 @@ ble_error_t GenericGap= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -2028,8 +2068,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setPeriodicAdvertisingPayload_( + +ble_error_t Gap::setPeriodicAdvertisingPayload( advertising_handle_t handle, Span payload ) @@ -2038,7 +2078,7 @@ ble_error_t GenericGap= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -2046,11 +2086,11 @@ ble_error_t GenericGap getMaxAdvertisingDataLength_()) { + if (payload.size() > getMaxAdvertisingDataLength()) { return BLE_ERROR_INVALID_PARAM; } - typedef pal::advertising_fragment_description_t op_t; + typedef advertising_fragment_description_t op_t; const size_t hci_length = _pal_gap.get_maximum_hci_advertising_data_length(); size_t i = 0; @@ -2091,14 +2131,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::startPeriodicAdvertising_(advertising_handle_t handle) + +ble_error_t Gap::startPeriodicAdvertising(advertising_handle_t handle) { if (handle == LEGACY_ADVERTISING_HANDLE) { return BLE_ERROR_INVALID_PARAM; } - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -2123,14 +2163,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::stopPeriodicAdvertising_(advertising_handle_t handle) + +ble_error_t Gap::stopPeriodicAdvertising(advertising_handle_t handle) { if (handle == LEGACY_ADVERTISING_HANDLE) { return BLE_ERROR_INVALID_PARAM; } - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return BLE_ERROR_INVALID_PARAM; } @@ -2151,38 +2191,38 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::isPeriodicAdvertisingActive_(advertising_handle_t handle) + +bool Gap::isPeriodicAdvertisingActive(advertising_handle_t handle) { - if (handle >= getMaxAdvertisingSetNumber_()) { + if (handle >= getMaxAdvertisingSetNumber()) { return false; } return _active_periodic_sets.get(handle); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_enhanced_connection_complete_( - pal::hci_error_code_t status, + +void Gap::on_enhanced_connection_complete( + hci_error_code_t status, connection_handle_t connection_handle, - pal::connection_role_t own_role, - pal::connection_peer_address_type_t peer_address_type, + connection_role_t own_role, + connection_peer_address_type_t peer_address_type, const ble::address_t &peer_address, const ble::address_t &local_resolvable_private_address, const ble::address_t &peer_resolvable_private_address, uint16_t connection_interval, uint16_t connection_latency, uint16_t supervision_timeout, - pal::clock_accuracy_t master_clock_accuracy + clock_accuracy_t master_clock_accuracy ) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onConnectionComplete( + _event_handler->onConnectionComplete( ConnectionCompleteEvent( - (status == pal::hci_error_code_t::SUCCESS) ? BLE_ERROR_NONE : BLE_ERROR_INTERNAL_STACK_FAILURE, + (status == hci_error_code_t::SUCCESS) ? BLE_ERROR_NONE : BLE_ERROR_INTERNAL_STACK_FAILURE, (connection_handle_t) connection_handle, own_role, (peer_address_type_t::type) peer_address_type.value(), @@ -2197,18 +2237,18 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_extended_advertising_report_( + +void Gap::on_extended_advertising_report( advertising_event_t event_type, - const pal::connection_peer_address_type_t *address_type, + const connection_peer_address_type_t *address_type, const ble::address_t &address, phy_t primary_phy, const phy_t *secondary_phy, advertising_sid_t advertising_sid, - pal::advertising_power_t tx_power, - pal::rssi_t rssi, + advertising_power_t tx_power, + rssi_t rssi, uint16_t periodic_advertising_interval, - pal::direct_address_type_t direct_address_type, + direct_address_type_t direct_address_type, const ble::address_t &direct_address, uint8_t data_length, const uint8_t *data @@ -2218,19 +2258,19 @@ void GenericGaponAdvertisingReport( + _event_handler->onAdvertisingReport( AdvertisingReportEvent( event_type, address_type ? @@ -2250,25 +2290,25 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_periodic_advertising_sync_established_( - pal::hci_error_code_t error, - pal::sync_handle_t sync_handle, + +void Gap::on_periodic_advertising_sync_established( + hci_error_code_t error, + sync_handle_t sync_handle, advertising_sid_t advertising_sid, - pal::connection_peer_address_type_t advertiser_address_type, + connection_peer_address_type_t advertiser_address_type, const ble::address_t &advertiser_address, phy_t advertiser_phy, uint16_t periodic_advertising_interval, - pal::clock_accuracy_t clock_accuracy + clock_accuracy_t clock_accuracy ) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onPeriodicAdvertisingSyncEstablished( + _event_handler->onPeriodicAdvertisingSyncEstablished( PeriodicAdvertisingSyncEstablishedEvent( - (error == pal::hci_error_code_t::SUCCESS) ? BLE_ERROR_NONE : BLE_ERROR_INTERNAL_STACK_FAILURE, + (error == hci_error_code_t::SUCCESS) ? BLE_ERROR_NONE : BLE_ERROR_INTERNAL_STACK_FAILURE, sync_handle, advertising_sid, static_cast(advertiser_address_type.value()), @@ -2280,21 +2320,21 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_periodic_advertising_report_( - pal::sync_handle_t sync_handle, - pal::advertising_power_t tx_power, - pal::rssi_t rssi, - pal::advertising_data_status_t data_status, + +void Gap::on_periodic_advertising_report( + sync_handle_t sync_handle, + advertising_power_t tx_power, + rssi_t rssi, + advertising_data_status_t data_status, uint8_t data_length, const uint8_t *data ) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onPeriodicAdvertisingReport( + _event_handler->onPeriodicAdvertisingReport( PeriodicAdvertisingReportEvent( sync_handle, tx_power, @@ -2305,21 +2345,21 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_periodic_advertising_sync_loss_(pal::sync_handle_t sync_handle) + +void Gap::on_periodic_advertising_sync_loss(sync_handle_t sync_handle) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onPeriodicAdvertisingSyncLoss( + _event_handler->onPeriodicAdvertisingSyncLoss( PeriodicAdvertisingSyncLoss(sync_handle) ); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_advertising_set_terminated_( - pal::hci_error_code_t status, + +void Gap::on_advertising_set_terminated( + hci_error_code_t status, advertising_handle_t advertising_handle, connection_handle_t connection_handle, uint8_t number_of_completed_extended_advertising_events @@ -2327,32 +2367,32 @@ void GenericGaponAdvertisingEnd( + _event_handler->onAdvertisingEnd( AdvertisingEndEvent( advertising_handle, connection_handle, number_of_completed_extended_advertising_events, - status == pal::hci_error_code_t::SUCCESS + status == hci_error_code_t::SUCCESS ) ); } -template class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_scan_request_received_( + +void Gap::on_scan_request_received( advertising_handle_t advertising_handle, - pal::connection_peer_address_type_t scanner_address_type, + connection_peer_address_type_t scanner_address_type, const ble::address_t &address ) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onScanRequestReceived( + _event_handler->onScanRequestReceived( ScanRequestEvent( advertising_handle, (peer_address_type_t::type) scanner_address_type.value(), @@ -2361,22 +2401,22 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_connection_update_complete_( - pal::hci_error_code_t status, + +void Gap::on_connection_update_complete( + hci_error_code_t status, connection_handle_t connection_handle, uint16_t connection_interval, uint16_t connection_latency, uint16_t supervision_timeout ) { - if (!_eventHandler) { + if (!_event_handler) { return; } - _eventHandler->onConnectionParametersUpdateComplete( + _event_handler->onConnectionParametersUpdateComplete( ConnectionParametersUpdateCompleteEvent( - status == pal::hci_error_code_t::SUCCESS ? BLE_ERROR_NONE : BLE_ERROR_UNSPECIFIED, + status == hci_error_code_t::SUCCESS ? BLE_ERROR_NONE : BLE_ERROR_UNSPECIFIED, connection_handle, conn_interval_t(connection_interval), slave_latency_t(connection_latency), @@ -2385,8 +2425,8 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::on_remote_connection_parameter_( + +void Gap::on_remote_connection_parameter( connection_handle_t connection_handle, uint16_t connection_interval_min, uint16_t connection_interval_max, @@ -2395,8 +2435,8 @@ void GenericGaponUpdateConnectionParametersRequest( + if (_event_handler) { + _event_handler->onUpdateConnectionParametersRequest( UpdateConnectionParametersRequestEvent(connection_handle, conn_interval_t(connection_interval_min), conn_interval_t(connection_interval_max), @@ -2417,8 +2457,8 @@ void GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::setScanParameters_(const ScanParameters ¶ms) + +ble_error_t Gap::setScanParameters(const ScanParameters ¶ms) { if (is_extended_advertising_available()) { bool active_scanning[] = { @@ -2462,8 +2502,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::startScan_( + +ble_error_t Gap::startScan( scan_duration_t duration, duplicates_filter_t filtering, scan_period_t period @@ -2505,7 +2545,7 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::createSync_( + +ble_error_t Gap::createSync( peer_address_type_t peerAddressType, const ble::address_t &peerAddress, advertising_sid_t sid, @@ -2549,8 +2589,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::createSync_( + +ble_error_t Gap::createSync( slave_latency_t maxPacketSkip, sync_timeout_t timeout ) @@ -2569,8 +2609,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::cancelCreateSync_() + +ble_error_t Gap::cancelCreateSync() { if (is_extended_advertising_available() == false) { return BLE_ERROR_NOT_IMPLEMENTED; @@ -2579,8 +2619,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::terminateSync_(periodic_sync_handle_t handle) + +ble_error_t Gap::terminateSync(periodic_sync_handle_t handle) { if (is_extended_advertising_available() == false) { return BLE_ERROR_NOT_IMPLEMENTED; @@ -2589,8 +2629,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::addDeviceToPeriodicAdvertiserList_( + +ble_error_t Gap::addDeviceToPeriodicAdvertiserList( peer_address_type_t peerAddressType, const ble::address_t &peerAddress, advertising_sid_t sid @@ -2611,14 +2651,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::removeDeviceFromPeriodicAdvertiserList_( + +ble_error_t Gap::removeDeviceFromPeriodicAdvertiserList( peer_address_type_t peerAddressType, const ble::address_t &peerAddress, advertising_sid_t sid @@ -2639,14 +2679,14 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -ble_error_t GenericGap::clearPeriodicAdvertiserList_() + +ble_error_t Gap::clearPeriodicAdvertiserList() { if (is_extended_advertising_available() == false) { return BLE_ERROR_NOT_IMPLEMENTED; @@ -2655,8 +2695,8 @@ ble_error_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -uint8_t GenericGap::getMaxPeriodicAdvertiserListSize_() + +uint8_t Gap::getMaxPeriodicAdvertiserListSize() { if (is_extended_advertising_available() == false) { return BLE_ERROR_NOT_IMPLEMENTED; @@ -2665,8 +2705,8 @@ uint8_t GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -bool GenericGap::is_extended_advertising_available() + +bool Gap::is_extended_advertising_available() { #if BLE_FEATURE_EXTENDED_ADVERTISING return isFeatureSupported( @@ -2677,8 +2717,8 @@ bool GenericGap class PalGapImpl, class PalSecurityManager, class ConnectionEventMonitorEventHandler> -void GenericGap::prepare_legacy_advertising_set() + +void Gap::prepare_legacy_advertising_set() { if (_existing_sets.get(LEGACY_ADVERTISING_HANDLE)) { return; @@ -2691,6 +2731,8 @@ void GenericGap #include -#include "ble/pal/AttServerMessage.h" +#include "pal/AttServerMessage.h" +#include +#include #include "ble/GattClient.h" -#include -#include -#include "ble/generic/GenericGattClient.h" -#include "ble/blecommon.h" -#include "ble/BLEInstanceBase.h" +#include "ble/types/blecommon.h" +#include "ble/internal/BLEInstanceBase.h" +#include "ble/SecurityManager.h" #include -using ble::pal::AttServerMessage; -using ble::pal::AttReadResponse; -using ble::pal::AttReadBlobResponse; -using ble::pal::AttReadByTypeResponse; -using ble::pal::AttReadByGroupTypeResponse; -using ble::pal::AttFindByTypeValueResponse; -using ble::pal::AttErrorResponse; -using ble::pal::AttributeOpcode; -using ble::pal::AttWriteResponse; -using ble::pal::AttPrepareWriteResponse; -using ble::pal::AttExecuteWriteResponse; -using ble::pal::AttHandleValueIndication; -using ble::pal::AttHandleValueNotification; -using ble::pal::AttFindInformationResponse; +using ble::AttServerMessage; +using ble::AttReadResponse; +using ble::AttReadBlobResponse; +using ble::AttReadByTypeResponse; +using ble::AttReadByGroupTypeResponse; +using ble::AttFindByTypeValueResponse; +using ble::AttErrorResponse; +using ble::AttributeOpcode; +using ble::AttWriteResponse; +using ble::AttPrepareWriteResponse; +using ble::AttExecuteWriteResponse; +using ble::AttHandleValueIndication; +using ble::AttHandleValueNotification; +using ble::AttFindInformationResponse; #define PREPARE_WRITE_HEADER_LENGTH 5 #define WRITE_HEADER_LENGTH 3 @@ -53,7 +53,6 @@ using ble::pal::AttFindInformationResponse; #define MAC_COUNTER_LENGTH 4 namespace ble { -namespace generic { /* * Type of procedures which can be launched by the client. @@ -69,30 +68,30 @@ enum procedure_type_t { /* * Base class for a procedure control block */ -template class TPalGattClient, class SigningMonitorEventHandler> -struct GenericGattClient::ProcedureControlBlock { + +struct GattClient::ProcedureControlBlock { /* * Base constructor for procedure control block. */ ProcedureControlBlock(procedure_type_t type, connection_handle_t handle) : - type(type), connection_handle(handle), next(NULL) { } + type(type), connection_handle(handle), next(nullptr) { } virtual ~ProcedureControlBlock() { } /* * Entry point of the control block stack machine. */ - virtual void handle(GenericGattClient* client, const AttServerMessage& message) = 0; + virtual void handle(GattClient* client, const AttServerMessage& message) = 0; /* * Function call in case of timeout */ - virtual void handle_timeout_error(GenericGattClient* client) = 0; + virtual void handle_timeout_error(GattClient* client) = 0; /** * Function called when the procedure is aborted */ - virtual void abort(GenericGattClient *client) = 0; + virtual void abort(GattClient *client) = 0; procedure_type_t type; connection_handle_t connection_handle; @@ -103,8 +102,8 @@ struct GenericGattClient::ProcedureC /* * Procedure control block for the discovery process. */ -template class TPalGattClient, class SigningMonitorEventHandler> -struct GenericGattClient::DiscoveryControlBlock : public ProcedureControlBlock { + +struct GattClient::DiscoveryControlBlock : public ProcedureControlBlock { using ProcedureControlBlock::connection_handle; DiscoveryControlBlock( @@ -118,7 +117,7 @@ struct GenericGattClient::DiscoveryC characteristic_callback(characteristic_callback), matching_service_uuid(matching_service_uuid), matching_characteristic_uuid(matching_characteristic_uuid), - services_discovered(NULL), + services_discovered(nullptr), done(false) { } @@ -130,15 +129,15 @@ struct GenericGattClient::DiscoveryC } } - virtual void handle_timeout_error(GenericGattClient* client) { + virtual void handle_timeout_error(GattClient* client) { terminate(client); } - virtual void abort(GenericGattClient *client) { + virtual void abort(GattClient *client) { terminate(client); } - virtual void handle(GenericGattClient* client, const AttServerMessage& message) { + virtual void handle(GattClient* client, const AttServerMessage& message) { // if end of discovery has been requested, ends it immediately if (done) { terminate(client); @@ -188,7 +187,7 @@ struct GenericGattClient::DiscoveryC } template - void handle_service_discovered(GenericGattClient* client, const Response& response) { + void handle_service_discovered(GattClient* client, const Response& response) { if (!response.size()) { terminate(client); return; @@ -209,7 +208,7 @@ struct GenericGattClient::DiscoveryC start_handle, end_handle, uuid ); - if (discovered_service == NULL) { + if (discovered_service == nullptr) { terminate(client); return; } @@ -221,7 +220,7 @@ struct GenericGattClient::DiscoveryC if (end_handle == 0xFFFF) { start_characteristic_discovery(client); } else { - ble_error_t err = client->_pal_client->discover_primary_service( + ble_error_t err = client->_pal_client.discover_primary_service( connection_handle, end_handle + 1 ); @@ -231,7 +230,7 @@ struct GenericGattClient::DiscoveryC } } - void start_characteristic_discovery(GenericGattClient* client) { + void start_characteristic_discovery(GattClient* client) { if (!services_discovered) { terminate(client); return; @@ -253,7 +252,7 @@ struct GenericGattClient::DiscoveryC } last_characteristic = characteristic_t(); - client->_pal_client->discover_characteristics_of_a_service( + client->_pal_client.discover_characteristics_of_a_service( connection_handle, attribute_handle_range( services_discovered->begin, @@ -262,7 +261,7 @@ struct GenericGattClient::DiscoveryC ); } - void handle_characteristic_discovered(GenericGattClient* client, const AttReadByTypeResponse& response) { + void handle_characteristic_discovered(GattClient* client, const AttReadByTypeResponse& response) { for (size_t i = 0; i < response.size(); ++i) { if (last_characteristic.is_valid() == false) { last_characteristic.set_last_handle(response[i].handle - 1); @@ -281,7 +280,7 @@ struct GenericGattClient::DiscoveryC if (last_characteristic.getValueHandle() == services_discovered->end) { handle_all_characteristics_discovered(client); } else { - ble_error_t err = client->_pal_client->discover_characteristics_of_a_service( + ble_error_t err = client->_pal_client.discover_characteristics_of_a_service( connection_handle, attribute_handle_range( last_characteristic.getValueHandle() + 1, @@ -295,7 +294,7 @@ struct GenericGattClient::DiscoveryC } } - void handle_all_characteristics_discovered(GenericGattClient* client) { + void handle_all_characteristics_discovered(GattClient* client) { if (last_characteristic.is_valid() == false) { if (matching_characteristic_uuid == UUID() || matching_characteristic_uuid == last_characteristic.getUUID()) { @@ -315,7 +314,7 @@ struct GenericGattClient::DiscoveryC } } - void terminate(GenericGattClient* client) { + void terminate(GattClient* client) { // unknown error, terminate the procedure immediately client->remove_control_block(this); connection_handle_t handle = connection_handle; @@ -353,7 +352,7 @@ struct GenericGattClient::DiscoveryC struct service_t { service_t(uint16_t begin, uint16_t end, const UUID& uuid) : - begin(begin), end(end), uuid(uuid), next(NULL) { } + begin(begin), end(end), uuid(uuid), next(nullptr) { } uint16_t begin; uint16_t end; UUID uuid; @@ -415,7 +414,7 @@ struct GenericGattClient::DiscoveryC }; void insert_service(service_t* service) { - if (services_discovered == NULL) { + if (services_discovered == nullptr) { services_discovered = service; return; } @@ -437,56 +436,54 @@ struct GenericGattClient::DiscoveryC }; -template class TPalGattClient, class SigningMonitorEventHandler> -struct GenericGattClient::ReadControlBlock : public ProcedureControlBlock { + +struct GattClient::ReadControlBlock : public ProcedureControlBlock { using ProcedureControlBlock::connection_handle; ReadControlBlock( connection_handle_t connection_handle, uint16_t attribute_handle, uint16_t offset ) : ProcedureControlBlock(READ_PROCEDURE, connection_handle), attribute_handle(attribute_handle), - offset(offset), current_offset(offset), data(NULL) { + offset(offset), current_offset(offset), data(nullptr) { } virtual ~ReadControlBlock() { - if (data != NULL) { + if (data != nullptr) { free(data); } } - virtual void handle_timeout_error(GenericGattClient* client) { + virtual void handle_timeout_error(GattClient* client) { GattReadCallbackParams response = { connection_handle, attribute_handle, offset, 0, // size of 0 - NULL, // no data - BLE_ERROR_UNSPECIFIED, - + nullptr, // no data + BLE_ERROR_UNSPECIFIED }; terminate(client, response); } - virtual void abort(GenericGattClient *client) { + virtual void abort(GattClient *client) { GattReadCallbackParams response = { connection_handle, attribute_handle, offset, 0, // size of 0 - NULL, // no data - BLE_ERROR_INVALID_STATE, - + nullptr, // no data + BLE_ERROR_INVALID_STATE }; terminate(client, response); } - void terminate(GenericGattClient* client, const GattReadCallbackParams& response) { + void terminate(GattClient* client, const GattReadCallbackParams& response) { client->remove_control_block(this); client->processReadResponse(&response); delete this; } - virtual void handle(GenericGattClient* client, const AttServerMessage& message) { + virtual void handle(GattClient* client, const AttServerMessage& message) { switch(message.opcode) { case AttributeOpcode::ERROR_RESPONSE: handle_error(client, static_cast(message)); @@ -508,9 +505,8 @@ struct GenericGattClient::ReadContro attribute_handle, AttErrorResponse::UNLIKELY_ERROR, 0, // size of 0 - NULL, // no data - BLE_ERROR_UNSPECIFIED, - + nullptr, // no data + BLE_ERROR_UNSPECIFIED }; terminate(client, response); } break; @@ -518,7 +514,7 @@ struct GenericGattClient::ReadContro } template - void handle_read_response(GenericGattClient* client, const ResponseType& read_response) { + void handle_read_response(GattClient* client, const ResponseType& read_response) { uint16_t mtu_size = client->get_mtu(connection_handle); // end of responses ? @@ -528,13 +524,13 @@ struct GenericGattClient::ReadContro attribute_handle, offset, 0, // size of 0 - NULL, // no data - BLE_ERROR_NONE, + nullptr, // no data + BLE_ERROR_NONE }; // is it the first response, or is there any other response already // in the object ? - if (data == NULL) { + if (data == nullptr) { response.len = (uint16_t) read_response.size(); response.data = read_response.data(); } else { @@ -547,14 +543,14 @@ struct GenericGattClient::ReadContro } else { // allocation which will contain the response data plus the next one. data = (uint8_t*) realloc(data, (current_offset - offset) + ((mtu_size - 1) * 2)); - if (data == NULL) { + if (data == nullptr) { GattReadCallbackParams response = { connection_handle, attribute_handle, offset, AttErrorResponse::INSUFFICIENT_RESOURCES, - NULL, - BLE_ERROR_NO_MEM, + nullptr, + BLE_ERROR_NO_MEM }; terminate(client, response); return; @@ -562,7 +558,7 @@ struct GenericGattClient::ReadContro memcpy(data + (current_offset - offset), read_response.data(), read_response.size()); current_offset = current_offset + read_response.size(); - ble_error_t err = client->_pal_client->read_attribute_blob( + ble_error_t err = client->_pal_client.read_attribute_blob( connection_handle, attribute_handle, current_offset @@ -574,16 +570,15 @@ struct GenericGattClient::ReadContro attribute_handle, AttErrorResponse::UNLIKELY_ERROR, 0, // size of 0 - NULL, // no data - BLE_ERROR_UNSPECIFIED, - + nullptr, // no data + BLE_ERROR_UNSPECIFIED }; terminate(client, response); } } } - void handle_error(GenericGattClient* client, const AttErrorResponse& error) { + void handle_error(GattClient* client, const AttErrorResponse& error) { ble_error_t status = BLE_ERROR_UNSPECIFIED; switch (error.error_code) { @@ -621,7 +616,7 @@ struct GenericGattClient::ReadContro attribute_handle, offset, error.error_code, - /* data */ NULL, + /* data */ nullptr, status }; @@ -637,8 +632,8 @@ struct GenericGattClient::ReadContro /* * Control block for the write process */ -template class TPalGattClient, class SigningMonitorEventHandler> -struct GenericGattClient::WriteControlBlock : public ProcedureControlBlock { + +struct GattClient::WriteControlBlock : public ProcedureControlBlock { using ProcedureControlBlock::connection_handle; WriteControlBlock( @@ -653,7 +648,7 @@ struct GenericGattClient::WriteContr free(data); } - virtual void handle_timeout_error(GenericGattClient* client) { + virtual void handle_timeout_error(GattClient* client) { GattWriteCallbackParams response = { connection_handle, attribute_handle, @@ -664,7 +659,7 @@ struct GenericGattClient::WriteContr terminate(client, response); } - virtual void abort(GenericGattClient *client) { + virtual void abort(GattClient *client) { GattWriteCallbackParams response = { connection_handle, attribute_handle, @@ -675,13 +670,13 @@ struct GenericGattClient::WriteContr terminate(client, response); } - void terminate(GenericGattClient* client, const GattWriteCallbackParams& response) { + void terminate(GattClient* client, const GattWriteCallbackParams& response) { client->remove_control_block(this); client->processWriteResponse(&response); delete this; } - virtual void handle(GenericGattClient* client, const AttServerMessage& message) { + virtual void handle(GattClient* client, const AttServerMessage& message) { switch(message.opcode) { case AttributeOpcode::ERROR_RESPONSE: handle_error(client, static_cast(message)); @@ -713,23 +708,25 @@ struct GenericGattClient::WriteContr } } - void handle_write_response(GenericGattClient* client, const AttWriteResponse& write_response) { + void handle_write_response(GattClient* client, const AttWriteResponse& write_response) { GattWriteCallbackParams response = { - connection_handle, attribute_handle, + connection_handle, + attribute_handle, GattWriteCallbackParams::OP_WRITE_REQ, - BLE_ERROR_NONE, 0x00 + BLE_ERROR_NONE, + 0x00 }; terminate(client, response); } - void handle_prepare_write_response(GenericGattClient* client, const AttPrepareWriteResponse& write_response) { + void handle_prepare_write_response(GattClient* client, const AttPrepareWriteResponse& write_response) { ble_error_t err = BLE_ERROR_UNSPECIFIED; uint16_t mtu_size = client->get_mtu(connection_handle); offset = write_response.offset + write_response.partial_value.size(); if (offset < len) { - err = client->_pal_client->queue_prepare_write( + err = client->_pal_client.queue_prepare_write( connection_handle, attribute_handle, make_const_Span( data + offset, @@ -738,7 +735,7 @@ struct GenericGattClient::WriteContr offset ); } else { - err = client->_pal_client->execute_write_queue( + err = client->_pal_client.execute_write_queue( connection_handle, true ); } @@ -748,7 +745,7 @@ struct GenericGattClient::WriteContr } } - void handle_execute_write_response(GenericGattClient* client, const AttExecuteWriteResponse& execute_response) { + void handle_execute_write_response(GattClient* client, const AttExecuteWriteResponse& execute_response) { if (prepare_success) { status = BLE_ERROR_NONE; error_code = 0x00; @@ -765,11 +762,11 @@ struct GenericGattClient::WriteContr terminate(client, response); } - void clear_prepare_queue(GenericGattClient* client, ble_error_t s, uint8_t e) { + void clear_prepare_queue(GattClient* client, ble_error_t s, uint8_t e) { prepare_success = false; status = s; error_code = e; - ble_error_t err = client->_pal_client->execute_write_queue( + ble_error_t err = client->_pal_client.execute_write_queue( connection_handle, false ); @@ -786,7 +783,7 @@ struct GenericGattClient::WriteContr } } - void handle_error(GenericGattClient* client, const AttErrorResponse& error) { + void handle_error(GattClient* client, const AttErrorResponse& error) { ble_error_t status = BLE_ERROR_UNSPECIFIED; switch (error.error_code) { @@ -843,8 +840,8 @@ struct GenericGattClient::WriteContr /* * Control block for the descriptor discovery process */ -template class TPalGattClient, class SigningMonitorEventHandler> -struct GenericGattClient::DescriptorDiscoveryControlBlock : public ProcedureControlBlock { + +struct GattClient::DescriptorDiscoveryControlBlock : public ProcedureControlBlock { using ProcedureControlBlock::connection_handle; DescriptorDiscoveryControlBlock( @@ -861,8 +858,8 @@ struct GenericGattClient::Descriptor virtual ~DescriptorDiscoveryControlBlock() { } - ble_error_t start(GenericGattClient* client) { - return client->_pal_client->discover_characteristics_descriptors( + ble_error_t start(GattClient* client) { + return client->_pal_client.discover_characteristics_descriptors( connection_handle, attribute_handle_range( next_handle, @@ -871,15 +868,15 @@ struct GenericGattClient::Descriptor ); } - virtual void handle_timeout_error(GenericGattClient* client) { + virtual void handle_timeout_error(GattClient* client) { terminate(client, BLE_ERROR_UNSPECIFIED); } - virtual void abort(GenericGattClient *client) { + virtual void abort(GattClient *client) { terminate(client, BLE_ERROR_INVALID_STATE); } - virtual void handle(GenericGattClient* client, const AttServerMessage& message) { + virtual void handle(GattClient* client, const AttServerMessage& message) { if (done) { terminate(client, BLE_ERROR_NONE); return; @@ -899,7 +896,7 @@ struct GenericGattClient::Descriptor } } - void handle_error(GenericGattClient* client, const AttErrorResponse& error) { + void handle_error(GattClient* client, const AttErrorResponse& error) { if (error.error_code == AttErrorResponse::ATTRIBUTE_NOT_FOUND) { terminate(client, BLE_ERROR_NONE); } else { @@ -907,7 +904,7 @@ struct GenericGattClient::Descriptor } } - void handle_response(GenericGattClient* client, const AttFindInformationResponse& response) { + void handle_response(GattClient* client, const AttFindInformationResponse& response) { for (size_t i = 0; i < response.size(); ++i) { DiscoveredCharacteristicDescriptor descriptor( client, connection_handle, response[i].handle, response[i].uuid @@ -935,7 +932,7 @@ struct GenericGattClient::Descriptor } } - void terminate(GenericGattClient* client, ble_error_t status, uint8_t error_code = 0x00) { + void terminate(GattClient* client, ble_error_t status, uint8_t error_code = 0x00) { client->remove_control_block(this); CharacteristicDescriptorDiscovery::TerminationCallbackParams_t params = { characteristic, @@ -953,26 +950,27 @@ struct GenericGattClient::Descriptor bool done; }; -template class TPalGattClient, class SigningMonitorEventHandler> -GenericGattClient::GenericGattClient(PalGattClient* pal_client) : + +GattClient::GattClient(PalGattClient& pal_client) : + eventHandler(nullptr), _pal_client(pal_client), _termination_callback(), #if BLE_FEATURE_SIGNING - _signing_event_handler(NULL), + _signing_event_handler(nullptr), #endif - control_blocks(NULL), + control_blocks(nullptr), _is_reseting(false) { - _pal_client->when_server_message_received( - mbed::callback(this, &GenericGattClient::on_server_message_received) + _pal_client.when_server_message_received( + mbed::callback(this, &GattClient::on_server_message_received) ); - _pal_client->when_transaction_timeout( - mbed::callback(this, &GenericGattClient::on_transaction_timeout) + _pal_client.when_transaction_timeout( + mbed::callback(this, &GattClient::on_transaction_timeout) ); - _pal_client->set_event_handler(this); + _pal_client.set_event_handler(this); } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::launchServiceDiscovery_( + +ble_error_t GattClient::launchServiceDiscovery( connection_handle_t connection_handle, ServiceDiscovery::ServiceCallback_t service_callback, ServiceDiscovery::CharacteristicCallback_t characteristic_callback, @@ -998,7 +996,7 @@ ble_error_t GenericGattClient::launc matching_characteristic_uuid ); - if (discovery_pcb == NULL) { + if (discovery_pcb == nullptr) { return BLE_ERROR_NO_MEM; } @@ -1009,12 +1007,12 @@ ble_error_t GenericGattClient::launc // launch the request ble_error_t err = BLE_ERROR_UNSPECIFIED; if (matching_service_uuid == UUID()) { - err = _pal_client->discover_primary_service( + err = _pal_client.discover_primary_service( connection_handle, 0x0001 ); } else { - err = _pal_client->discover_primary_service_by_service_uuid( + err = _pal_client.discover_primary_service_by_service_uuid( connection_handle, 0x0001, matching_service_uuid @@ -1029,8 +1027,22 @@ ble_error_t GenericGattClient::launc return err; } -template class TPalGattClient, class SigningMonitorEventHandler> -bool GenericGattClient::isServiceDiscoveryActive_() const { +ble_error_t GattClient::discoverServices( + ble::connection_handle_t connectionHandle, + ServiceDiscovery::ServiceCallback_t callback, + const UUID &matchingServiceUUID +) { + /* We take advantage of the property + * that providing nullptr for the characteristic callback results in + * characteristic discovery being skipped for each matching + * service. This allows for an inexpensive method to discover only + * services. Porters are free to override this. */ + return launchServiceDiscovery( + connectionHandle, callback, nullptr, matchingServiceUUID + ); +} + +bool GattClient::isServiceDiscoveryActive() const { ProcedureControlBlock* pcb = control_blocks; while (pcb) { @@ -1043,8 +1055,8 @@ bool GenericGattClient::isServiceDis return false; } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::terminateServiceDiscovery_() + +void GattClient::terminateServiceDiscovery() { ProcedureControlBlock* pcb = control_blocks; while (pcb) { @@ -1055,8 +1067,8 @@ void GenericGattClient::terminateSer } } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::read_( + +ble_error_t GattClient::read( connection_handle_t connection_handle, GattAttribute::Handle_t attribute_handle, uint16_t offset) const @@ -1072,7 +1084,7 @@ ble_error_t GenericGattClient::read_ offset ); - if (read_pcb == NULL) { + if (read_pcb == nullptr) { return BLE_ERROR_NO_MEM; } @@ -1081,11 +1093,11 @@ ble_error_t GenericGattClient::read_ ble_error_t err = BLE_ERROR_NONE; if (offset == 0) { - err = _pal_client->read_attribute_value( + err = _pal_client.read_attribute_value( connection_handle, attribute_handle ); } else { - err = _pal_client->read_attribute_blob( + err = _pal_client.read_attribute_blob( connection_handle, attribute_handle, offset ); } @@ -1098,8 +1110,8 @@ ble_error_t GenericGattClient::read_ return err; } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::write_( + +ble_error_t GattClient::write( WriteOp_t cmd, connection_handle_t connection_handle, GattAttribute::Handle_t attribute_handle, @@ -1115,7 +1127,7 @@ ble_error_t GenericGattClient::write #if BLE_FEATURE_SIGNING /* if link is encrypted signed writes should be normal writes */ - if (cmd == Base::GATT_OP_SIGNED_WRITE_CMD) { + if (cmd == GATT_OP_SIGNED_WRITE_CMD) { ble::link_encryption_t encryption(ble::link_encryption_t::NOT_ENCRYPTED); // FIXME: use security manager or a template if applicable SecurityManager &sm = createBLEInstance()->getSecurityManager(); @@ -1125,26 +1137,26 @@ ble_error_t GenericGattClient::write encryption == link_encryption_t::ENCRYPTED_WITH_MITM || encryption == link_encryption_t::ENCRYPTED_WITH_SC_AND_MITM) ) { - cmd = Base::GATT_OP_WRITE_CMD; + cmd = GATT_OP_WRITE_CMD; } } #endif // BLE_FEATURE_SIGNING - if (cmd == Base::GATT_OP_WRITE_CMD) { + if (cmd == GATT_OP_WRITE_CMD) { if (length > (uint16_t) (mtu - WRITE_HEADER_LENGTH)) { return BLE_ERROR_PARAM_OUT_OF_RANGE; } - return _pal_client->write_without_response( + return _pal_client.write_without_response( connection_handle, attribute_handle, make_const_Span(value, length) ); #if BLE_FEATURE_SIGNING - } else if (cmd == Base::GATT_OP_SIGNED_WRITE_CMD) { + } else if (cmd == GATT_OP_SIGNED_WRITE_CMD) { if (length > (uint16_t) (mtu - WRITE_HEADER_LENGTH - CMAC_LENGTH - MAC_COUNTER_LENGTH)) { return BLE_ERROR_PARAM_OUT_OF_RANGE; } - ble_error_t status = _pal_client->signed_write_without_response( + ble_error_t status = _pal_client.signed_write_without_response( connection_handle, attribute_handle, make_const_Span(value, length) @@ -1156,11 +1168,11 @@ ble_error_t GenericGattClient::write return status; #endif // BLE_FEATURE_SIGNING } else if (cmd == GattClient::GATT_OP_WRITE_REQ) { - uint8_t* data = NULL; + uint8_t* data = nullptr; if (length > (uint16_t) (mtu - WRITE_HEADER_LENGTH)) { data = (uint8_t*) malloc(length); - if (data == NULL) { + if (data == nullptr) { return BLE_ERROR_NO_MEM; } memcpy(data, value, length); @@ -1173,7 +1185,7 @@ ble_error_t GenericGattClient::write length ); - if (write_pcb == NULL) { + if (write_pcb == nullptr) { free(data); return BLE_ERROR_NO_MEM; } @@ -1182,14 +1194,14 @@ ble_error_t GenericGattClient::write ble_error_t err = BLE_ERROR_UNSPECIFIED; if (data) { - err = _pal_client->queue_prepare_write( + err = _pal_client.queue_prepare_write( connection_handle, attribute_handle, make_const_Span(value, mtu - PREPARE_WRITE_HEADER_LENGTH), /* offset */0 ); } else { - err = _pal_client->write_attribute( + err = _pal_client.write_attribute( connection_handle, attribute_handle, make_const_Span(value, length) @@ -1207,15 +1219,15 @@ ble_error_t GenericGattClient::write return BLE_ERROR_NOT_IMPLEMENTED; } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::onServiceDiscoveryTermination_( + +void GattClient::onServiceDiscoveryTermination( ServiceDiscovery::TerminationCallback_t callback ) { _termination_callback = callback; } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::discoverCharacteristicDescriptors_( + +ble_error_t GattClient::discoverCharacteristicDescriptors( const DiscoveredCharacteristic& characteristic, const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback @@ -1243,7 +1255,7 @@ ble_error_t GenericGattClient::disco terminationCallback ); - if (discovery_pcb == NULL) { + if (discovery_pcb == nullptr) { return BLE_ERROR_NO_MEM; } @@ -1259,8 +1271,8 @@ ble_error_t GenericGattClient::disco return err; } -template class TPalGattClient, class SigningMonitorEventHandler> -bool GenericGattClient::isCharacteristicDescriptorDiscoveryActive_( + +bool GattClient::isCharacteristicDescriptorDiscoveryActive( const DiscoveredCharacteristic& characteristic ) const { ProcedureControlBlock* pcb = control_blocks; @@ -1276,8 +1288,8 @@ bool GenericGattClient::isCharacteri return false; } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::terminateCharacteristicDescriptorDiscovery_( + +void GattClient::terminateCharacteristicDescriptorDiscovery( const DiscoveredCharacteristic& characteristic ) { ProcedureControlBlock* pcb = control_blocks; @@ -1297,17 +1309,22 @@ void GenericGattClient::terminateCha } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::negotiateAttMtu_( + +ble_error_t GattClient::negotiateAttMtu( connection_handle_t connection ) { - return _pal_client->exchange_mtu(connection); + return _pal_client.exchange_mtu(connection); } -template class TPalGattClient, class SigningMonitorEventHandler> -ble_error_t GenericGattClient::reset_(void) { - Base::reset_(); +ble_error_t GattClient::reset(void) { + /* Notify that the instance is about to shut down. */ + shutdownCallChain.call(this); + shutdownCallChain.clear(); + + onDataReadCallbackChain.clear(); + onDataWriteCallbackChain.clear(); + onHVXCallbackChain.clear(); // _is_reseting prevent executions of new procedure while the instance resets. // otherwise new procedures can be launched from callbacks generated by the @@ -1322,16 +1339,16 @@ ble_error_t GenericGattClient::reset } #if BLE_FEATURE_SIGNING -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::set_signing_event_handler_( - SigningMonitorEventHandler *signing_event_handler + +void GattClient::set_signing_event_handler( + PalSigningMonitorEventHandler *signing_event_handler ) { _signing_event_handler = signing_event_handler; } #endif // BLE_FEATURE_SIGNING -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_att_mtu_change_( + +void GattClient::on_att_mtu_change( ble::connection_handle_t connection_handle, uint16_t att_mtu_size ) @@ -1341,8 +1358,8 @@ void GenericGattClient::on_att_mtu_c } } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_write_command_sent_( + +void GattClient::on_write_command_sent( ble::connection_handle_t connection_handle, ble::attribute_handle_t attribute_handle, uint8_t status @@ -1359,15 +1376,15 @@ void GenericGattClient::on_write_com } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_termination(connection_handle_t connection_handle) { + +void GattClient::on_termination(connection_handle_t connection_handle) { if (_termination_callback) { _termination_callback(connection_handle); } } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_server_message_received( + +void GattClient::on_server_message_received( connection_handle_t connection_handle, const AttServerMessage& message ) { @@ -1398,21 +1415,21 @@ void GenericGattClient::on_server_me } } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_server_response( + +void GattClient::on_server_response( connection_handle_t connection, const AttServerMessage& message ) { ProcedureControlBlock* pcb = get_control_block(connection); - if (pcb == NULL) { + if (pcb == nullptr) { return; } pcb->handle(this, message); } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_server_event(connection_handle_t connection, const AttServerMessage& message) { + +void GattClient::on_server_event(connection_handle_t connection, const AttServerMessage& message) { GattHVXCallbackParams callbacks_params = { (connection_handle_t) connection, 0 }; @@ -1440,22 +1457,22 @@ void GenericGattClient::on_server_ev return; } - Base::processHVXEvent(&callbacks_params); + processHVXEvent(&callbacks_params); } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::on_transaction_timeout(connection_handle_t connection) { + +void GattClient::on_transaction_timeout(connection_handle_t connection) { ProcedureControlBlock* pcb = get_control_block(connection); - if (pcb == NULL) { + if (pcb == nullptr) { return; } pcb->handle_timeout_error(this); } -template class TPalGattClient, class SigningMonitorEventHandler> -typename GenericGattClient::ProcedureControlBlock* -GenericGattClient::get_control_block(connection_handle_t connection) { + +typename GattClient::ProcedureControlBlock* +GattClient::get_control_block(connection_handle_t connection) { ProcedureControlBlock* it = control_blocks; while (it && it->connection_handle != connection) { it = it->next; @@ -1463,9 +1480,9 @@ GenericGattClient::get_control_block return it; } -template class TPalGattClient, class SigningMonitorEventHandler> -const typename GenericGattClient::ProcedureControlBlock* -GenericGattClient::get_control_block(connection_handle_t connection) const { + +const typename GattClient::ProcedureControlBlock* +GattClient::get_control_block(connection_handle_t connection) const { ProcedureControlBlock* it = control_blocks; while (it && it->connection_handle != connection) { it = it->next; @@ -1473,9 +1490,9 @@ GenericGattClient::get_control_block return it; } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::insert_control_block(ProcedureControlBlock* cb) const { - if (control_blocks == NULL) { + +void GattClient::insert_control_block(ProcedureControlBlock* cb) const { + if (control_blocks == nullptr) { control_blocks = cb; return; } @@ -1487,9 +1504,9 @@ void GenericGattClient::insert_contr current->next = cb; } -template class TPalGattClient, class SigningMonitorEventHandler> -void GenericGattClient::remove_control_block(ProcedureControlBlock* cb) const { - if (control_blocks == NULL) { + +void GattClient::remove_control_block(ProcedureControlBlock* cb) const { + if (control_blocks == nullptr) { return; } @@ -1503,24 +1520,129 @@ void GenericGattClient::remove_contr current = current->next; } - if (current->next == NULL) { + if (current->next == nullptr) { return; } current->next = cb->next; - cb->next = NULL; + cb->next = nullptr; } -template class TPalGattClient, class SigningMonitorEventHandler> -uint16_t GenericGattClient::get_mtu(connection_handle_t connection) const { + +uint16_t GattClient::get_mtu(connection_handle_t connection) const { uint16_t result = 23; - if(_pal_client->get_mtu_size((connection_handle_t) connection, result) != BLE_ERROR_NONE) { + if(_pal_client.get_mtu_size((connection_handle_t) connection, result) != BLE_ERROR_NONE) { result = 23; } return result; } -} // namespace pal +/** + * @see GattClient::setEventHandler + */ +void GattClient::setEventHandler(EventHandler *handler) +{ + eventHandler = handler; +} + +/** + * @see GattClient::onDataRead + */ +void GattClient::onDataRead(ReadCallback_t callback) +{ + onDataReadCallbackChain.add(callback); +} + +/** + * @see GattClient::onDataRead + */ +GattClient::ReadCallbackChain_t& GattClient::onDataRead() +{ + return onDataReadCallbackChain; +} + +/** + * @see GattClient::onDataWritten + */ +void GattClient::onDataWritten(WriteCallback_t callback) +{ + onDataWriteCallbackChain.add(callback); +} + +/** + * @see GattClient::onDataWritten + */ +GattClient::WriteCallbackChain_t& GattClient::onDataWritten() +{ + return onDataWriteCallbackChain; +} + +/** + * @see GattClient::onHVX + */ +void GattClient::onHVX(HVXCallback_t callback) +{ + onHVXCallbackChain.add(callback); +} + +/** + * @see GattClient::onShutdown + */ +void GattClient::onShutdown(const GattClientShutdownCallback_t& callback) +{ + shutdownCallChain.add(callback); +} + +/** + * @see GattClient::onShutdown + */ +template +void GattClient::onShutdown(T *objPtr, void (T::*memberPtr)(const GattClient *)) +{ + shutdownCallChain.add(objPtr, memberPtr); +} + +/** + * @see GattClient::onShutdown + */ +GattClient::GattClientShutdownCallbackChain_t& GattClient::onShutdown() +{ + return shutdownCallChain; +} + +/** + * @see GattClient::onHVX + */ +GattClient::HVXCallbackChain_t& GattClient::onHVX() { + return onHVXCallbackChain; +} + +/** + * @see GattClient::processReadResponse + */ +void GattClient::processReadResponse(const GattReadCallbackParams *params) +{ + onDataReadCallbackChain(params); +} + +/** + * @see GattClient::processWriteResponse + */ +void GattClient::processWriteResponse(const GattWriteCallbackParams *params) +{ + onDataWriteCallbackChain(params); +} + +/** + * @see GattClient::processHVXEvent + */ +void GattClient::processHVXEvent(const GattHVXCallbackParams *params) +{ + if (onHVXCallbackChain) { + onHVXCallbackChain(params); + } +} + } // namespace ble #endif // BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioGattServer.cpp similarity index 88% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp rename to connectivity/FEATURE_BLE/source/cordio/CordioGattServer.cpp index 6ac7d13f59..b9b333e390 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioGattServer.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,21 +15,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "BLERoles.h" +#include "BLERoles.h" #include -#include "CordioBLE.h" -#include "CordioGattServer.h" -#include "source/GattServer.tpp" +#include "ble/GattServer.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" #include "mbed.h" #include "wsf_types.h" #include "att_api.h" -template class ble::interface::GattServer; - namespace ble { -namespace vendor { -namespace cordio { namespace { @@ -83,12 +80,12 @@ void GattServer::add_default_services() } } -ble_error_t GattServer::addService_(GattService &service) +ble_error_t GattServer::addService(GattService &service) { add_default_services(); // create and fill the service structure internal_service_t *att_service = new internal_service_t; - att_service->attGroup.pNext = NULL; + att_service->attGroup.pNext = nullptr; att_service->attGroup.readCback = atts_read_cb; att_service->attGroup.writeCback = atts_write_cb; @@ -98,7 +95,7 @@ ble_error_t GattServer::addService_(GattService &service) // Create cordio attribute list att_service->attGroup.pAttr = (attsAttr_t*) alloc_block(attributes_count * sizeof(attsAttr_t)); - if (att_service->attGroup.pAttr == NULL) { + if (att_service->attGroup.pAttr == nullptr) { delete att_service; return BLE_ERROR_BUFFER_OVERFLOW; } @@ -132,7 +129,7 @@ ble_error_t GattServer::addService_(GattService &service) if (registered_service) { att_service->next = registered_service; } else { - att_service->next = NULL; + att_service->next = nullptr; } registered_service = att_service; @@ -240,7 +237,7 @@ bool GattServer::is_characteristic_valid(GattCharacteristic *characteristic) { uint8_t properties = characteristic->getProperties(); // nothing to read while the characteristic is flagged as readable - if ((characteristic->getValueAttribute().getValuePtr() == NULL) && + if ((characteristic->getValueAttribute().getValuePtr() == nullptr) && (characteristic->getValueAttribute().getMaxLength() == 0) && (properties == READ_PROPERTY) && (characteristic->isReadAuthorizationEnabled() == false) @@ -249,7 +246,7 @@ bool GattServer::is_characteristic_valid(GattCharacteristic *characteristic) { } // nothing to write while the characteristic is flagged as writable - if ((characteristic->getValueAttribute().getValuePtr() == NULL) && + if ((characteristic->getValueAttribute().getValuePtr() == nullptr) && (characteristic->getValueAttribute().getMaxLength() == 0) && (properties & WRITABLE_PROPERTIES) && (characteristic->isWriteAuthorizationEnabled() == false) @@ -588,13 +585,13 @@ ble_error_t GattServer::insert_cccd( return BLE_ERROR_NONE; } -ble_error_t GattServer::read_( +ble_error_t GattServer::read( GattAttribute::Handle_t att_handle, uint8_t buffer[], uint16_t * buffer_length ) { uint16_t att_length = 0; - uint8_t* att_value = NULL; + uint8_t* att_value = nullptr; if (AttsGetAttr(att_handle, &att_length, &att_value) != ATT_SUCCESS) { return BLE_ERROR_PARAM_OUT_OF_RANGE; @@ -609,7 +606,7 @@ ble_error_t GattServer::read_( return BLE_ERROR_NONE; } -ble_error_t GattServer::read_( +ble_error_t GattServer::read( connection_handle_t connection, GattAttribute::Handle_t att_handle, uint8_t buffer[], @@ -636,7 +633,7 @@ ble_error_t GattServer::read_( return read(att_handle, buffer, buffer_length); } -ble_error_t GattServer::write_( +ble_error_t GattServer::write( GattAttribute::Handle_t att_handle, const uint8_t buffer[], uint16_t len, @@ -698,7 +695,7 @@ ble_error_t GattServer::write_( return BLE_ERROR_NONE; } -ble_error_t GattServer::write_( +ble_error_t GattServer::write( connection_handle_t connection, GattAttribute::Handle_t att_handle, const uint8_t buffer[], @@ -748,7 +745,7 @@ ble_error_t GattServer::write_( return BLE_ERROR_NONE; } -ble_error_t GattServer::areUpdatesEnabled_( +ble_error_t GattServer::areUpdatesEnabled( const GattCharacteristic &characteristic, bool *enabled ) { @@ -772,7 +769,7 @@ ble_error_t GattServer::areUpdatesEnabled_( return BLE_ERROR_PARAM_OUT_OF_RANGE; } -ble_error_t GattServer::areUpdatesEnabled_( +ble_error_t GattServer::areUpdatesEnabled( connection_handle_t connectionHandle, const GattCharacteristic &characteristic, bool *enabled @@ -795,14 +792,14 @@ ble_error_t GattServer::areUpdatesEnabled_( return BLE_ERROR_PARAM_OUT_OF_RANGE; } -bool GattServer::isOnDataReadAvailable_() const +bool GattServer::isOnDataReadAvailable() const { return true; } -::Gap::PreferredConnectionParams_t GattServer::getPreferredConnectionParams() +Gap::PreferredConnectionParams_t GattServer::getPreferredConnectionParams() { - ::Gap::PreferredConnectionParams_t params = { 0 }; + Gap::PreferredConnectionParams_t params = { 0 }; memcpy(¶ms.minConnectionInterval, generic_access_service.ppcp, 2); memcpy(¶ms.maxConnectionInterval, generic_access_service.ppcp + 2, 2); memcpy(¶ms.slaveLatency, generic_access_service.ppcp + 4, 2); @@ -810,7 +807,7 @@ bool GattServer::isOnDataReadAvailable_() const return params; } -void GattServer::setPreferredConnectionParams(const ::Gap::PreferredConnectionParams_t& params) +void GattServer::setPreferredConnectionParams(const Gap::PreferredConnectionParams_t& params) { memcpy(generic_access_service.ppcp, ¶ms.minConnectionInterval, 2); memcpy(generic_access_service.ppcp + 2, ¶ms.maxConnectionInterval, 2); @@ -824,7 +821,7 @@ ble_error_t GattServer::setDeviceName(const uint8_t *deviceName) { size_t length = 0; - if (deviceName != NULL) { + if (deviceName != nullptr) { length = strlen((const char*)deviceName); } @@ -832,7 +829,7 @@ ble_error_t GattServer::setDeviceName(const uint8_t *deviceName) free(generic_access_service.device_name_value()); } else { uint8_t* res = (uint8_t*) realloc(generic_access_service.device_name_value(), length); - if (res == NULL) { + if (res == nullptr) { return BLE_ERROR_NO_MEM; } @@ -863,9 +860,21 @@ GapAdvertisingData::Appearance GattServer::getAppearance() #endif // Disabled until reworked and reintroduced to GattServer API -ble_error_t GattServer::reset_(void) +ble_error_t GattServer::reset(void) { - Base::reset_(); + /* Notify that the instance is about to shutdown */ + shutdownCallChain.call(this); + shutdownCallChain.clear(); + + serviceCount = 0; + characteristicCount = 0; + + dataSentCallChain.clear(); + dataWrittenCallChain.clear(); + dataReadCallChain.clear(); + updatesEnabledCallback = nullptr; + updatesDisabledCallback = nullptr; + confirmationReceivedCallback = nullptr; while (registered_service) { internal_service_t* s = registered_service; @@ -907,7 +916,7 @@ void GattServer::cccd_cb(attsCccEvt_t *evt) void GattServer::att_cb(const attEvt_t *evt) { if (evt->hdr.status == ATT_SUCCESS && evt->hdr.event == ATT_MTU_UPDATE_IND) { - ::GattServer::EventHandler *handler = getInstance().getEventHandler(); + ble::GattServer::EventHandler *handler = getInstance().getEventHandler(); if (handler) { handler->onAttMtuChange(evt->hdr.param, evt->mtu); } @@ -930,7 +939,7 @@ uint8_t GattServer::atts_read_cb( handle, offset, /* len */ 0, - /* data */ NULL, + /* data */ nullptr, AUTH_CALLBACK_REPLY_SUCCESS }; @@ -1038,7 +1047,7 @@ uint8_t GattServer::atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t han #if BLE_FEATURE_SECURITY // this CB is triggered when read or write of an attribute (either a value // handle or a descriptor) requires secure connection security. - SecurityManager& security_manager = BLE::deviceInstance().getSecurityManager(); + SecurityManager& security_manager = CordioBLEInstanceBase::deviceInstance().getSecurityManager(); link_encryption_t encryption(link_encryption_t::NOT_ENCRYPTED); ble_error_t err = security_manager.getLinkEncryption(connId, &encryption); @@ -1060,7 +1069,7 @@ uint8_t GattServer::atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t han void GattServer::add_generic_access_service() { ++currentHandle; - generic_access_service.service.pNext = NULL; + generic_access_service.service.pNext = nullptr; generic_access_service.service.startHandle = currentHandle; generic_access_service.service.readCback = atts_read_cb; generic_access_service.service.writeCback = atts_write_cb; @@ -1102,7 +1111,7 @@ void GattServer::add_generic_access_service() current_attribute->pUuid = attDnChUuid; current_attribute->maxLen = 248; current_attribute->pLen = &generic_access_service.device_name_length; - current_attribute->pValue = NULL; + current_attribute->pValue = nullptr; current_attribute->settings = ATTS_SET_VARIABLE_LEN; current_attribute->permissions = ATTS_PERMIT_READ; @@ -1176,7 +1185,7 @@ void GattServer::add_generic_access_service() void GattServer::add_generic_attribute_service() { ++currentHandle; - generic_attribute_service.service.pNext = NULL; + generic_attribute_service.service.pNext = nullptr; generic_attribute_service.service.startHandle = currentHandle; generic_attribute_service.service.readCback = atts_read_cb; generic_attribute_service.service.writeCback = atts_write_cb; @@ -1217,7 +1226,7 @@ void GattServer::add_generic_attribute_service() current_attribute->pUuid = attScChUuid; current_attribute->maxLen = 0; current_attribute->pLen = ¤t_attribute->maxLen; - current_attribute->pValue = NULL; + current_attribute->pValue = nullptr; current_attribute->settings = 0; current_attribute->permissions = 0; @@ -1243,14 +1252,14 @@ void GattServer::add_generic_attribute_service() void* GattServer::alloc_block(size_t block_size) { alloc_block_t* block = (alloc_block_t*) malloc(sizeof(alloc_block_t) + block_size); - if (block == NULL) { - return NULL; + if (block == nullptr) { + return nullptr; } if (allocated_blocks) { block->next = allocated_blocks; } else { - block->next = NULL; + block->next = nullptr; } allocated_blocks = block; @@ -1265,7 +1274,7 @@ GattCharacteristic* GattServer::get_auth_char(uint16_t value_handle) return _auth_char[i]; } } - return NULL; + return nullptr; } bool GattServer::get_cccd_index_by_cccd_handle(GattAttribute::Handle_t cccd_handle, uint8_t& idx) const @@ -1305,7 +1314,7 @@ bool GattServer::is_update_authorized( } #if BLE_FEATURE_SECURITY - SecurityManager& security_manager = BLE::deviceInstance().getSecurityManager(); + SecurityManager& security_manager = CordioBLEInstanceBase::deviceInstance().getSecurityManager(); link_encryption_t encryption(link_encryption_t::NOT_ENCRYPTED); ble_error_t err = security_manager.getLinkEncryption(connection, &encryption); if (err) { @@ -1340,7 +1349,16 @@ bool GattServer::is_update_authorized( } GattServer::GattServer() : - _signing_event_handler(NULL), + serviceCount(0), + characteristicCount(0), + eventHandler(nullptr), + dataSentCallChain(), + dataWrittenCallChain(), + dataReadCallChain(), + updatesEnabledCallback(nullptr), + updatesDisabledCallback(nullptr), + confirmationReceivedCallback(nullptr), + _signing_event_handler(nullptr), cccds(), cccd_values(), cccd_handles(), @@ -1349,13 +1367,152 @@ GattServer::GattServer() : _auth_char_count(0), generic_access_service(), generic_attribute_service(), - registered_service(NULL), - allocated_blocks(NULL), + registered_service(nullptr), + allocated_blocks(nullptr), currentHandle(0), default_services_added(false) { } -} // namespace cordio -} // namespace vendor +void GattServer::set_signing_event_handler( + PalSigningMonitorEventHandler *signing_event_handler +) { + _signing_event_handler = signing_event_handler; +} + +void GattServer::onDataSent(const DataSentCallback_t &callback) +{ + dataSentCallChain.add(callback); +} + +template +void GattServer::onDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)) +{ + dataSentCallChain.add(objPtr, memberPtr); +} + +ble::GattServer::DataSentCallbackChain_t &GattServer::onDataSent() +{ + return dataSentCallChain; +} + +ble::GattServer::DataWrittenCallbackChain_t &GattServer::onDataWritten() +{ + return dataWrittenCallChain; +} + +ble_error_t GattServer::onDataRead(const DataReadCallback_t &callback) +{ + if (!isOnDataReadAvailable()) { + return BLE_ERROR_NOT_IMPLEMENTED; + } + + dataReadCallChain.add(callback); + return BLE_ERROR_NONE; +} + +template +ble_error_t GattServer::onDataRead( + T *objPtr, + void (T::*memberPtr)(const GattReadCallbackParams *context) +) { + if (!isOnDataReadAvailable()) { + return BLE_ERROR_NOT_IMPLEMENTED; + } + + dataReadCallChain.add(objPtr, memberPtr); + return BLE_ERROR_NONE; +} + +ble::GattServer::DataReadCallbackChain_t &GattServer::onDataRead() +{ + return dataReadCallChain; +} + +void GattServer::onShutdown(const GattServerShutdownCallback_t &callback) +{ + shutdownCallChain.add(callback); +} + +template +void GattServer::onShutdown(T *objPtr, void (T::*memberPtr)(const ble::GattServer *)) +{ + shutdownCallChain.add(objPtr, memberPtr); +} + +ble::GattServer::GattServerShutdownCallbackChain_t& GattServer::onShutdown() +{ + return shutdownCallChain; +} + +void GattServer::onUpdatesEnabled(EventCallback_t callback) +{ + updatesEnabledCallback = callback; +} + +void GattServer::onUpdatesDisabled(EventCallback_t callback) +{ + updatesDisabledCallback = callback; +} + +void GattServer::onConfirmationReceived(EventCallback_t callback) +{ + confirmationReceivedCallback = callback; +} + +void GattServer::setEventHandler(EventHandler *handler) +{ + eventHandler = handler; +} + +GattServer::EventHandler* GattServer::getEventHandler() { + return eventHandler; +} + +void GattServer::handleDataWrittenEvent(const GattWriteCallbackParams *params) +{ + dataWrittenCallChain.call(params); +} + +void GattServer::handleDataReadEvent(const GattReadCallbackParams *params) +{ + dataReadCallChain.call(params); +} + +void GattServer::handleEvent( + GattServerEvents::gattEvent_e type, + GattAttribute::Handle_t attributeHandle +) { + switch (type) { + case GattServerEvents::GATT_EVENT_UPDATES_ENABLED: + if (updatesEnabledCallback) { + updatesEnabledCallback(attributeHandle); + } + break; + case GattServerEvents::GATT_EVENT_UPDATES_DISABLED: + if (updatesDisabledCallback) { + updatesDisabledCallback(attributeHandle); + } + break; + case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED: + if (confirmationReceivedCallback) { + confirmationReceivedCallback(attributeHandle); + } + break; + + case GattServerEvents::GATT_EVENT_DATA_SENT: + // Called every time a notification or indication has been sent + handleDataSentEvent(1); + break; + + default: + break; + } +} + +void GattServer::handleDataSentEvent(unsigned count) +{ + dataSentCallChain.call(count); +} + } // namespace ble diff --git a/connectivity/FEATURE_BLE/source/cordio/CordioPalAttClient.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalAttClient.cpp new file mode 100644 index 0000000000..a6064395bd --- /dev/null +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalAttClient.cpp @@ -0,0 +1,424 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ble/internal/cordio/CordioPalAttClient.h" +#include "ble/GattServer.h" +#include "ble/internal/pal/PalSimpleAttServerMessage.h" +#include "ble/internal/cordio/CordioPalGap.h" +#include "ble/internal/cordio/CordioPalGattClient.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" + +#include "att_api.h" +#include "att_defs.h" + +namespace ble { + +PalAttClient::PalAttClient() : _local_sign_counter(0) {} + +PalAttClient::~PalAttClient() {} + +/** +* @see ble::PalAttClient::exchange_mtu_request +*/ +ble_error_t PalAttClient::exchange_mtu_request(connection_handle_t connection) { + AttcMtuReq(connection, pAttCfg->mtu); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalGattClient::get_mtu_size +*/ +ble_error_t PalAttClient::get_mtu_size( + connection_handle_t connection_handle, + uint16_t &mtu_size +) { + mtu_size = AttGetMtu(connection_handle); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::find_information_request +*/ +ble_error_t PalAttClient::find_information_request( + connection_handle_t connection_handle, + attribute_handle_range_t discovery_range +) { + AttcFindInfoReq( + connection_handle, + discovery_range.begin, + discovery_range.end, + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::find_by_type_value_request +*/ +ble_error_t PalAttClient::find_by_type_value_request( + connection_handle_t connection_handle, + attribute_handle_range_t discovery_range, + uint16_t type, + const Span &value +) { + AttcFindByTypeValueReq( + connection_handle, + discovery_range.begin, + discovery_range.end, + type, + value.size(), + const_cast(value.data()), + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::read_by_type_request +*/ +ble_error_t PalAttClient::read_by_type_request( + connection_handle_t connection_handle, + attribute_handle_range_t read_range, + const UUID &type +) { + AttcReadByTypeReq( + connection_handle, + read_range.begin, + read_range.end, + type.getLen(), + const_cast(type.getBaseUUID()), + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::read_request +*/ +ble_error_t PalAttClient::read_request( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle +) { + AttcReadReq(connection_handle, attribute_handle); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::read_blob_request +*/ +ble_error_t PalAttClient::read_blob_request( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + uint16_t offset +) { + AttcReadLongReq( + connection_handle, + attribute_handle, + offset, + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::read_multiple_request +*/ +ble_error_t PalAttClient::read_multiple_request( + connection_handle_t connection_handle, + const Span &attribute_handles +) { + AttcReadMultipleReq( + connection_handle, + attribute_handles.size(), + const_cast(attribute_handles.data()) + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::read_by_group_type_request +*/ +ble_error_t PalAttClient::read_by_group_type_request( + connection_handle_t connection_handle, + attribute_handle_range_t read_range, + const UUID &group_type +) { + AttcReadByGroupTypeReq( + connection_handle, + read_range.begin, + read_range.end, + group_type.getLen(), + const_cast(group_type.getBaseUUID()), + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::write_request +*/ +ble_error_t PalAttClient::write_request( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + const Span &value +) { + AttcWriteReq( + connection_handle, + attribute_handle, + value.size(), + const_cast(value.data()) + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::write_command +*/ +ble_error_t PalAttClient::write_command( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + const Span &value +) { + AttcWriteCmd( + connection_handle, + attribute_handle, + value.size(), + const_cast(value.data()) + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::signed_write_command +*/ +ble_error_t PalAttClient::signed_write_command( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + const Span &value +) { + AttcSignedWriteCmd( + connection_handle, + attribute_handle, + _local_sign_counter, + value.size(), + const_cast(value.data()) + ); + _local_sign_counter++; + return BLE_ERROR_NONE; +} + +/** +* Initialises the counter used to sign messages. Counter will be incremented every +* time a message is signed. +* +* @param sign_counter initialise the signing counter to this value +*/ +void PalAttClient::set_sign_counter( + sign_count_t sign_counter +) { + _local_sign_counter = sign_counter; +} + +/** +* @see ble::PalAttClient::prepare_write_request +*/ +ble_error_t PalAttClient::prepare_write_request( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + uint16_t offset, + const Span &value +) { + AttcPrepareWriteReq( + connection_handle, + attribute_handle, + offset, + value.size(), + const_cast(value.data()), + false, + false + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::execute_write_request +*/ +ble_error_t PalAttClient::execute_write_request( + connection_handle_t connection_handle, + bool execute +) { + AttcExecuteWriteReq( + connection_handle, + execute + ); + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::initialize +*/ +ble_error_t PalAttClient::initialize() { + return BLE_ERROR_NONE; +} + +/** +* @see ble::PalAttClient::terminate +*/ +ble_error_t PalAttClient::terminate() { + return BLE_ERROR_NONE; +} + +// singleton of the ARM Cordio client +PalAttClient &PalAttClient::get_client() { + static PalAttClient _client; + return _client; +} + +void PalAttClient::when_server_message_received( + mbed::Callback cb +) { + _server_message_cb = cb; +} + +void PalAttClient::when_transaction_timeout( + mbed::Callback cb +) { + _transaction_timeout_cb = cb; +} + +// convert an array of byte to an uint16_t +uint16_t PalAttClient::to_uint16_t(const uint8_t *array) { + uint16_t result; + memcpy(&result, array, sizeof(result)); + return result; +} + +template +bool PalAttClient::event_handler(const attEvt_t *event) { + if (T::can_convert(event)) { + generated_handler(event, T::convert); + return true; + } + return false; +} + +bool PalAttClient::timeout_event_handler(const attEvt_t *event) { + if (event->hdr.status != ATT_ERR_TIMEOUT) { + return false; + } + + get_client().on_transaction_timeout(event->hdr.param); + return true; +} + + +template +void PalAttClient::generated_handler( + const attEvt_t *event, ResultType (*convert)(const attEvt_t *) +) { + get_client().on_server_event( + event->hdr.param, + convert(event) + ); +} + +void PalAttClient::on_server_event( + connection_handle_t connection_handle, + const AttServerMessage &server_message +) { + if (_server_message_cb) { + _server_message_cb(connection_handle, server_message); + } +} + +/** +* Upon transaction timeout an implementation shall call this function. +* +* @param connection_handle The handle of the connection of the transaction +* which has times out. +* +* @note see BLUETOOTH SPECIFICATION Version 5.0 | Vol 3, Part F Section 3.3.3 +*/ +void PalAttClient::on_transaction_timeout( + connection_handle_t connection_handle +) { + if (_transaction_timeout_cb) { + _transaction_timeout_cb(connection_handle); + } +} + +void PalAttClient::att_client_handler(const attEvt_t *event) { +#if BLE_FEATURE_GATT_CLIENT + if (event->hdr.status == ATT_SUCCESS && event->hdr.event == ATT_MTU_UPDATE_IND) { + ble::CordioBLEInstanceBase &ble = ble::CordioBLEInstanceBase::deviceInstance(); + PalGattClientEventHandler *handler = ble.getPalGattClient().get_event_handler(); + if (handler) { + handler->on_att_mtu_change(event->hdr.param, event->mtu); + } + } else if (event->hdr.event == ATTC_WRITE_CMD_RSP) { + ble::CordioBLEInstanceBase &ble = ble::CordioBLEInstanceBase::deviceInstance(); + PalGattClientEventHandler *handler = ble.getPalGattClient().get_event_handler(); + if (handler) { + handler->on_write_command_sent( + event->hdr.param, + event->handle, + event->hdr.status + ); + } + } else { + // all handlers are stored in a static array + static const event_handler_t handlers[] = { + &timeout_event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler, + &event_handler + }; + + // event->hdr.param: connection handle + // event->header.event: opcode from the request + // event->header.status: success or error code ... + // event->pValue: starting after opcode for response; starting after opcode + handle for server initiated responses. + // event->handle: handle for server initiated responses + + // traverse all handlers and execute them with the event in input. + // exit if an handler has handled the event. + for (size_t i = 0; i < (sizeof(handlers) / sizeof(handlers[0])); ++i) { + if (handlers[i](event)) { + return; + } + } + } +#endif // BLE_FEATURE_GATT_CLIENT + +#if BLE_FEATURE_GATT_SERVER + // pass events not handled to the server side + ble::GattServer::getInstance().att_cb(event); +#endif // BLE_FEATURE_GATT_SERVER +} + +} // ble diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalGap.cpp similarity index 85% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp rename to connectivity/FEATURE_BLE/source/cordio/CordioPalGap.cpp index cc5ff264de..ed9c36d609 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalGap.tpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalGap.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,9 +21,6 @@ #include "dm_api.h" namespace ble { -namespace pal { -namespace vendor { -namespace cordio { namespace { bool dummy_gap_event_handler(const wsfMsgHdr_t *msg) @@ -30,8 +29,8 @@ bool dummy_gap_event_handler(const wsfMsgHdr_t *msg) } } -template -bool Gap::is_feature_supported_( + +bool PalGap::is_feature_supported( ble::controller_supported_features_t feature ) { @@ -64,8 +63,8 @@ bool Gap::is_feature_supported_( return (HciGetLeSupFeat() & (1 << feature.value())); } -template -ble_error_t Gap::initialize_() + +ble_error_t PalGap::initialize() { for (size_t i = 0; i < DM_NUM_ADV_SETS; ++i) { direct_adv_cb[i] = direct_adv_cb_t(); @@ -73,8 +72,8 @@ ble_error_t Gap::initialize_() return BLE_ERROR_NONE; } -template -ble_error_t Gap::terminate_() + +ble_error_t PalGap::terminate() { for (size_t i = 0; i < DM_NUM_ADV_SETS; ++i) { direct_adv_cb[i] = direct_adv_cb_t(); @@ -82,28 +81,28 @@ ble_error_t Gap::terminate_() return BLE_ERROR_NONE; } -template -address_t Gap::get_device_address_() + +address_t PalGap::get_device_address() { return address_t(HciGetBdAddr()); } -template -address_t Gap::get_random_address_() + +address_t PalGap::get_random_address() { return device_random_address; } -template -ble_error_t Gap::set_random_address_(const address_t &address) + +ble_error_t PalGap::set_random_address(const address_t &address) { device_random_address = address; DmDevSetRandAddr(const_cast(address.data())); return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_advertising_parameters_( + +ble_error_t PalGap::set_advertising_parameters( uint16_t advertising_interval_min, uint16_t advertising_interval_max, advertising_type_t advertising_type, @@ -149,8 +148,8 @@ ble_error_t Gap::set_advertising_parameters_( ); } -template -ble_error_t Gap::set_advertising_data_( + +ble_error_t PalGap::set_advertising_data( uint8_t advertising_data_length, const advertising_data_t &advertising_data ) @@ -165,8 +164,8 @@ ble_error_t Gap::set_advertising_data_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_scan_response_data_( + +ble_error_t PalGap::set_scan_response_data( uint8_t scan_response_data_length, const advertising_data_t &scan_response_data ) @@ -181,8 +180,8 @@ ble_error_t Gap::set_scan_response_data_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::advertising_enable_(bool enable) + +ble_error_t PalGap::advertising_enable(bool enable) { if (enable) { // The Cordio stack requires to start direct advertising with @@ -232,8 +231,8 @@ ble_error_t Gap::advertising_enable_(bool enable) return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_scan_parameters_( + +ble_error_t PalGap::set_scan_parameters( bool active_scanning, uint16_t scan_interval, uint16_t scan_window, @@ -253,8 +252,8 @@ ble_error_t Gap::set_scan_parameters_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::scan_enable_( + +ble_error_t PalGap::scan_enable( bool enable, bool filter_duplicates ) @@ -275,8 +274,8 @@ ble_error_t Gap::scan_enable_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::create_connection_( + +ble_error_t PalGap::create_connection( uint16_t scan_interval, uint16_t scan_window, initiator_policy_t initiator_policy, @@ -321,8 +320,8 @@ ble_error_t Gap::create_connection_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::cancel_connection_creation_() + +ble_error_t PalGap::cancel_connection_creation() { DmConnClose( DM_CLIENT_ID_APP, @@ -332,21 +331,21 @@ ble_error_t Gap::cancel_connection_creation_() return BLE_ERROR_NONE; } -template -uint8_t Gap::read_white_list_capacity_() + +uint8_t PalGap::read_white_list_capacity() { return HciGetWhiteListSize(); } -template -ble_error_t Gap::clear_whitelist_() + +ble_error_t PalGap::clear_whitelist() { DmDevWhiteListClear(); return BLE_ERROR_NONE; } -template -ble_error_t Gap::add_device_to_whitelist_( + +ble_error_t PalGap::add_device_to_whitelist( whitelist_address_type_t address_type, address_t address ) @@ -358,8 +357,8 @@ ble_error_t Gap::add_device_to_whitelist_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::remove_device_from_whitelist_( + +ble_error_t PalGap::remove_device_from_whitelist( whitelist_address_type_t address_type, address_t address ) @@ -371,8 +370,8 @@ ble_error_t Gap::remove_device_from_whitelist_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::connection_parameters_update_( + +ble_error_t PalGap::connection_parameters_update( connection_handle_t connection, uint16_t connection_interval_min, uint16_t connection_interval_max, @@ -402,8 +401,8 @@ ble_error_t Gap::connection_parameters_update_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::accept_connection_parameter_request_( + +ble_error_t PalGap::accept_connection_parameter_request( connection_handle_t connection_handle, uint16_t interval_min, uint16_t interval_max, @@ -425,8 +424,8 @@ ble_error_t Gap::accept_connection_parameter_request_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::reject_connection_parameter_request_( + +ble_error_t PalGap::reject_connection_parameter_request( connection_handle_t connection_handle, hci_error_code_t rejection_reason ) @@ -438,8 +437,8 @@ ble_error_t Gap::reject_connection_parameter_request_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::disconnect_( + +ble_error_t PalGap::disconnect( connection_handle_t connection, local_disconnection_reason_t disconnection_reason ) @@ -452,15 +451,15 @@ ble_error_t Gap::disconnect_( return BLE_ERROR_NONE; } -template -bool Gap::is_privacy_supported_() + +bool PalGap::is_privacy_supported() { // We only support controller-based privacy, so return whether the controller supports it return HciLlPrivacySupported(); } -template -ble_error_t Gap::set_address_resolution_( + +ble_error_t PalGap::set_address_resolution( bool enable ) { @@ -468,25 +467,25 @@ ble_error_t Gap::set_address_resolution_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::read_phy_(connection_handle_t connection) + +ble_error_t PalGap::read_phy(connection_handle_t connection) { - if (Base::is_feature_supported(controller_supported_features_t::LE_2M_PHY) - || Base::is_feature_supported(controller_supported_features_t::LE_CODED_PHY)) { + if (is_feature_supported(controller_supported_features_t::LE_2M_PHY) + || is_feature_supported(controller_supported_features_t::LE_CODED_PHY)) { DmReadPhy(connection); return BLE_ERROR_NONE; } return BLE_ERROR_NOT_IMPLEMENTED; } -template -ble_error_t Gap::set_preferred_phys_( + +ble_error_t PalGap::set_preferred_phys( const phy_set_t &tx_phys, const phy_set_t &rx_phys ) { DmSetDefaultPhy( - Base::create_all_phys_value(tx_phys, rx_phys), + create_all_phys_value(tx_phys, rx_phys), tx_phys.value(), rx_phys.value() ); @@ -494,8 +493,8 @@ ble_error_t Gap::set_preferred_phys_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_phy_( + +ble_error_t PalGap::set_phy( connection_handle_t connection, const phy_set_t &tx_phys, const phy_set_t &rx_phys, @@ -513,7 +512,7 @@ ble_error_t Gap::set_phy_( DmSetPhy( connection, - Base::create_all_phys_value(tx_phys, rx_phys), + create_all_phys_value(tx_phys, rx_phys), tx_phys.value(), rx_phys.value(), coded_symbol.value() @@ -523,27 +522,27 @@ ble_error_t Gap::set_phy_( } // singleton of the ARM Cordio client -template -Gap &Gap::get_gap() + +PalGap &PalGap::get_gap() { - static Gap _gap; + static PalGap _gap; return _gap; } /** * Callback which handle wsfMsgHdr_t and forward them to emit_gap_event. */ -template -void Gap::gap_handler(const wsfMsgHdr_t *msg) + +void PalGap::gap_handler(const wsfMsgHdr_t *msg) { typedef bool (*event_handler_t)(const wsfMsgHdr_t *msg); - if (msg == NULL) { + if (msg == nullptr) { return; } connection_handle_t handle = (connection_handle_t) msg->param; - EventHandler *handler = get_gap()._pal_event_handler; + ble::PalGapEventHandler *handler = get_gap()._pal_event_handler; switch (msg->event) { @@ -692,10 +691,10 @@ void Gap::gap_handler(const wsfMsgHdr_t *msg) handler->on_extended_advertising_report( advertising_event_t(evt->eventType), - (evt->addrType == HCI_ADDR_TYPE_ANONYMOUS) ? NULL : &addr_type, + (evt->addrType == HCI_ADDR_TYPE_ANONYMOUS) ? nullptr : &addr_type, evt->addr, phy_t(evt->priPhy), - evt->secPhy == HCI_ADV_RPT_PHY_SEC_NONE ? NULL : &sec_phy, + evt->secPhy == HCI_ADV_RPT_PHY_SEC_NONE ? nullptr : &sec_phy, evt->advSid, evt->txPower, evt->rssi, @@ -791,9 +790,9 @@ void Gap::gap_handler(const wsfMsgHdr_t *msg) /** * T shall define a can_convert and convert function and a type */ -template + template -bool Gap::event_handler(const wsfMsgHdr_t *msg) +bool PalGap::event_handler(const wsfMsgHdr_t *msg) { if (T::can_convert(msg)) { get_gap().emit_gap_event(T::convert((const typename T::type *) msg)); @@ -802,8 +801,8 @@ bool Gap::event_handler(const wsfMsgHdr_t *msg) return false; } -template -ble_error_t Gap::set_advertising_set_random_address_( + +ble_error_t PalGap::set_advertising_set_random_address( advertising_handle_t advertising_handle, const address_t &address ) @@ -812,8 +811,8 @@ ble_error_t Gap::set_advertising_set_random_address_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_extended_advertising_parameters_( + +ble_error_t PalGap::set_extended_advertising_parameters( advertising_handle_t advertising_handle, advertising_event_properties_t event_properties, advertising_interval_t primary_advertising_interval_min, @@ -953,8 +952,8 @@ ble_error_t Gap::set_extended_advertising_parameters_( ); } -template -ble_error_t Gap::set_periodic_advertising_parameters_( + +ble_error_t PalGap::set_periodic_advertising_parameters( advertising_handle_t advertising_handle, periodic_advertising_interval_t periodic_advertising_min, periodic_advertising_interval_t periodic_advertising_max, @@ -972,8 +971,8 @@ ble_error_t Gap::set_periodic_advertising_parameters_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_extended_advertising_data_( + +ble_error_t PalGap::set_extended_advertising_data( advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, @@ -997,8 +996,8 @@ ble_error_t Gap::set_extended_advertising_data_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_periodic_advertising_data_( + +ble_error_t PalGap::set_periodic_advertising_data( advertising_handle_t advertising_handle, advertising_fragment_description_t fragment_description, uint8_t advertising_data_size, @@ -1014,8 +1013,8 @@ ble_error_t Gap::set_periodic_advertising_data_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_extended_scan_response_data_( + +ble_error_t PalGap::set_extended_scan_response_data( advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, @@ -1039,8 +1038,8 @@ ble_error_t Gap::set_extended_scan_response_data_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::extended_advertising_enable_( + +ble_error_t PalGap::extended_advertising_enable( bool enable, uint8_t number_of_sets, const advertising_handle_t *in_handles, @@ -1130,8 +1129,8 @@ ble_error_t Gap::extended_advertising_enable_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::periodic_advertising_enable_( + +ble_error_t PalGap::periodic_advertising_enable( bool enable, advertising_handle_t advertising_handle ) @@ -1145,46 +1144,46 @@ ble_error_t Gap::periodic_advertising_enable_( return BLE_ERROR_NONE; } -template -uint16_t Gap::get_maximum_advertising_data_length_() + +uint16_t PalGap::get_maximum_advertising_data_length() { return HciGetMaxAdvDataLen(); } -template -uint16_t Gap::get_maximum_connectable_advertising_data_length_() + +uint16_t PalGap::get_maximum_connectable_advertising_data_length() { return HCI_EXT_ADV_CONN_DATA_LEN; } -template -uint8_t Gap::get_maximum_hci_advertising_data_length_() + +uint8_t PalGap::get_maximum_hci_advertising_data_length() { return HCI_EXT_ADV_DATA_LEN; } -template -uint8_t Gap::get_max_number_of_advertising_sets_() + +uint8_t PalGap::get_max_number_of_advertising_sets() { return std::min(HciGetNumSupAdvSets(), (uint8_t) DM_NUM_ADV_SETS); } -template -ble_error_t Gap::remove_advertising_set_(advertising_handle_t advertising_handle) + +ble_error_t PalGap::remove_advertising_set(advertising_handle_t advertising_handle) { DmAdvRemoveAdvSet(advertising_handle); return BLE_ERROR_NONE; } -template -ble_error_t Gap::clear_advertising_sets_() + +ble_error_t PalGap::clear_advertising_sets() { DmAdvClearAdvSets(); return BLE_ERROR_NONE; } -template -ble_error_t Gap::set_extended_scan_parameters_( + +ble_error_t PalGap::set_extended_scan_parameters( own_address_type_t own_address_type, scanning_filter_policy_t filter_policy, phy_set_t scanning_phys, @@ -1219,8 +1218,8 @@ ble_error_t Gap::set_extended_scan_parameters_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::extended_scan_enable_( + +ble_error_t PalGap::extended_scan_enable( bool enable, duplicates_filter_t filter_duplicates, uint16_t duration, @@ -1245,8 +1244,8 @@ ble_error_t Gap::extended_scan_enable_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::periodic_advertising_create_sync_( + +ble_error_t PalGap::periodic_advertising_create_sync( bool use_periodic_advertiser_list, uint8_t advertising_sid, peer_address_type_t peer_address_type, @@ -1276,23 +1275,23 @@ ble_error_t Gap::periodic_advertising_create_sync_( } } -template -ble_error_t Gap::cancel_periodic_advertising_create_sync_() + +ble_error_t PalGap::cancel_periodic_advertising_create_sync() { // FIXME: Find a way to use it! // Function not directly exposed by the cordio stack. return BLE_ERROR_NOT_IMPLEMENTED; } -template -ble_error_t Gap::periodic_advertising_terminate_sync_(sync_handle_t sync_handle) + +ble_error_t PalGap::periodic_advertising_terminate_sync(sync_handle_t sync_handle) { DmSyncStop(sync_handle); return BLE_ERROR_NONE; } -template -ble_error_t Gap::add_device_to_periodic_advertiser_list_( + +ble_error_t PalGap::add_device_to_periodic_advertiser_list( advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid @@ -1306,8 +1305,8 @@ ble_error_t Gap::add_device_to_periodic_advertiser_list_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::remove_device_from_periodic_advertiser_list_( + +ble_error_t PalGap::remove_device_from_periodic_advertiser_list( advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid @@ -1321,21 +1320,21 @@ ble_error_t Gap::remove_device_from_periodic_advertiser_list_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::clear_periodic_advertiser_list_() + +ble_error_t PalGap::clear_periodic_advertiser_list() { DmClearPerAdvList(); return BLE_ERROR_NONE; } -template -uint8_t Gap::read_periodic_advertiser_list_size_() + +uint8_t PalGap::read_periodic_advertiser_list_size() { return HciGetPerAdvListSize(); } -template -ble_error_t Gap::extended_create_connection_( + +ble_error_t PalGap::extended_create_connection( initiator_policy_t initiator_policy, own_address_type_t own_address_type, peer_address_type_t peer_address_type, @@ -1388,8 +1387,8 @@ ble_error_t Gap::extended_create_connection_( return BLE_ERROR_NONE; } -template -ble_error_t Gap::update_direct_advertising_parameters( + +ble_error_t PalGap::update_direct_advertising_parameters( advertising_handle_t advertising_handle, uint8_t advertising_type, address_t peer_address, @@ -1438,22 +1437,22 @@ ble_error_t Gap::update_direct_advertising_parameters( return BLE_ERROR_NONE; } -template + template -typename Gap::direct_adv_cb_t* -Gap::get_adv_cb(const Predicate& predicate) +typename PalGap::direct_adv_cb_t* +PalGap::get_adv_cb(const Predicate& predicate) { for (size_t i = 0; i < DM_NUM_ADV_SETS; ++i) { if (predicate(direct_adv_cb[i])) { return direct_adv_cb + i; } } - return NULL; + return nullptr; } -template -typename Gap::direct_adv_cb_t* -Gap::get_running_direct_adv_cb(advertising_handle_t adv_handle) + +typename PalGap::direct_adv_cb_t* +PalGap::get_running_direct_adv_cb(advertising_handle_t adv_handle) { return get_adv_cb([adv_handle] (const direct_adv_cb_t& cb) { return cb.state == direct_adv_cb_t::running && @@ -1461,9 +1460,9 @@ Gap::get_running_direct_adv_cb(advertising_handle_t adv_handle) }); } -template -typename Gap::direct_adv_cb_t* -Gap::get_running_conn_direct_adv_cb(connection_handle_t conn_handle) + +typename PalGap::direct_adv_cb_t* +PalGap::get_running_conn_direct_adv_cb(connection_handle_t conn_handle) { return get_adv_cb([conn_handle] (const direct_adv_cb_t& cb) { return cb.state == direct_adv_cb_t::running && @@ -1471,9 +1470,9 @@ Gap::get_running_conn_direct_adv_cb(connection_handle_t conn_handl }); } -template -typename Gap::direct_adv_cb_t* -Gap::get_pending_direct_adv_cb(advertising_handle_t adv_handle) + +typename PalGap::direct_adv_cb_t* +PalGap::get_pending_direct_adv_cb(advertising_handle_t adv_handle) { return get_adv_cb([adv_handle] (const direct_adv_cb_t& cb) { return cb.state == direct_adv_cb_t::pending && @@ -1481,16 +1480,28 @@ Gap::get_pending_direct_adv_cb(advertising_handle_t adv_handle) }); } -template -typename Gap::direct_adv_cb_t* -Gap::get_free_direct_adv_cb() + +typename PalGap::direct_adv_cb_t* +PalGap::get_free_direct_adv_cb() { return get_adv_cb([](const direct_adv_cb_t& cb) { return cb.state == direct_adv_cb_t::free; }); } -} // cordio -} // vendor -} // pal +void PalGap::when_gap_event_received(mbed::Callback cb) +{ + _gap_event_cb = cb; +} + +void PalGap::set_event_handler(PalGapEventHandler *event_handler) +{ + _pal_event_handler = event_handler; +} + +PalGapEventHandler* PalGap::get_event_handler() +{ + return _pal_event_handler; +} + } // ble diff --git a/connectivity/FEATURE_BLE/source/cordio/CordioPalGattClient.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalGattClient.cpp new file mode 100644 index 0000000000..1b0ad05aec --- /dev/null +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalGattClient.cpp @@ -0,0 +1,233 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ble/internal/cordio/CordioPalGattClient.h" +#include "ble/internal/cordio/CordioPalAttClient.h" + +namespace ble { + +PalGattClient::PalGattClient(PalAttClient& client) : _event_handler(nullptr), _client(client) +{ + _client.when_server_message_received( + mbed::callback(this, &PalGattClient::on_server_event) + ); + _client.when_transaction_timeout( + mbed::callback( + this, &PalGattClient::on_transaction_timeout + ) + ); +} + + +ble_error_t PalGattClient::exchange_mtu(connection_handle_t connection) { + return _client.exchange_mtu_request(connection); +} + + +ble_error_t PalGattClient::get_mtu_size( + connection_handle_t connection_handle, + uint16_t& mtu_size +) { + return _client.get_mtu_size(connection_handle, mtu_size); +} + + +ble_error_t PalGattClient::discover_primary_service( + connection_handle_t connection, + attribute_handle_t discovery_range_begining +) { + return _client.read_by_group_type_request( + connection, + attribute_handle_range(discovery_range_begining, END_ATTRIBUTE_HANDLE), + SERVICE_TYPE_UUID + ); +} + + +ble_error_t PalGattClient::discover_primary_service_by_service_uuid( + connection_handle_t connection_handle, + attribute_handle_t discovery_range_begining, + const UUID& uuid +) { + return _client.find_by_type_value_request( + connection_handle, + attribute_handle_range(discovery_range_begining, END_ATTRIBUTE_HANDLE), + SERVICE_TYPE_UUID, + Span( + uuid.getBaseUUID(), + (uuid.shortOrLong() == UUID::UUID_TYPE_SHORT) ? 2 : UUID::LENGTH_OF_LONG_UUID + ) + ); +} + + +ble_error_t PalGattClient::find_included_service( + connection_handle_t connection_handle, + attribute_handle_range_t service_range +) { + return _client.read_by_type_request( + connection_handle, + service_range, + INCLUDE_TYPE_UUID + ); +} + + +ble_error_t PalGattClient::discover_characteristics_of_a_service( + connection_handle_t connection_handle, + attribute_handle_range_t discovery_range +) { + return _client.read_by_type_request( + connection_handle, + discovery_range, + CHARACTERISTIC_TYPE_UUID + ); +} + + +ble_error_t PalGattClient::discover_characteristics_descriptors( + connection_handle_t connection_handle, + attribute_handle_range_t descriptors_discovery_range +) { + return _client.find_information_request( + connection_handle, + descriptors_discovery_range + ); +} + + +ble_error_t PalGattClient::read_attribute_value( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle +) { + return _client.read_request( + connection_handle, + attribute_handle + ); +} + + +ble_error_t PalGattClient::read_using_characteristic_uuid( + connection_handle_t connection_handle, + attribute_handle_range_t read_range, + const UUID& uuid +) { + return _client.read_by_type_request( + connection_handle, + read_range, + uuid + ); +} + + +ble_error_t PalGattClient::read_attribute_blob( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + uint16_t offset +) { + return _client.read_blob_request( + connection_handle, + attribute_handle, + offset + ); +} + + +ble_error_t PalGattClient::read_multiple_characteristic_values( + connection_handle_t connection_handle, + const Span& characteristic_value_handles +) { + return _client.read_multiple_request( + connection_handle, + characteristic_value_handles + ); +} + + +ble_error_t PalGattClient::write_without_response( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value +) { + return _client.write_command( + connection_handle, + characteristic_value_handle, + value + ); +} + + +ble_error_t PalGattClient::signed_write_without_response( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value +) { + return _client.signed_write_command( + connection_handle, + characteristic_value_handle, + value + ); +} + + +ble_error_t PalGattClient::write_attribute( + connection_handle_t connection_handle, + attribute_handle_t attribute_handle, + const Span& value +) { + return _client.write_request( + connection_handle, + attribute_handle, + value + ); +} + + +ble_error_t PalGattClient::queue_prepare_write( + connection_handle_t connection_handle, + attribute_handle_t characteristic_value_handle, + const Span& value, + uint16_t offset +) { + return _client.prepare_write_request( + connection_handle, + characteristic_value_handle, + offset, + value + ); +} + + +ble_error_t PalGattClient::execute_write_queue( + connection_handle_t connection_handle, + bool execute +) { + return _client.execute_write_request(connection_handle, execute); +} + + +ble_error_t PalGattClient::initialize() { + return _client.initialize(); +} + + +ble_error_t PalGattClient::terminate() { + return _client.initialize(); +} + +} // ble diff --git a/connectivity/FEATURE_BLE/source/cordio/CordioPalGenericAccessService.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalGenericAccessService.cpp new file mode 100644 index 0000000000..79c9655ba6 --- /dev/null +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalGenericAccessService.cpp @@ -0,0 +1,121 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ble/internal/cordio/CordioPalGenericAccessService.h" + +namespace ble { + +#if 0 // Disabled until reworked and reintroduced to GattServer API + +virtual ble_error_t PalGenericAccessService::get_device_name_length(uint8_t& length) { +#if BLE_FEATURE_GATT_SERVER + const uint8_t* name = nullptr; + uint16_t actual_length = 0; + + gatt_server().getDeviceName(name, actual_length); + length = actual_length; + + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif + } + + virtual ble_error_t PalGenericAccessService::get_device_name(Span& array) { +#if BLE_FEATURE_GATT_SERVER + const uint8_t* name = nullptr; + uint16_t length = 0; + + gatt_server().getDeviceName(name, length); + + if (length > array.size()) { + return BLE_ERROR_PARAM_OUT_OF_RANGE; + } + + memcpy(array.data(), name, length); + + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER + } + + virtual ble_error_t PalGenericAccessService::set_device_name(const uint8_t* device_name) { +#if BLE_FEATURE_GATT_SERVER + return gatt_server().setDeviceName(device_name); +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER + } + + virtual ble_error_t PalGenericAccessService::get_appearance( + GapAdvertisingData::Appearance& appearance + ) { +#if BLE_FEATURE_GATT_SERVER + appearance = gatt_server().getAppearance(); + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER + } + + virtual ble_error_t PalGenericAccessService::set_appearance( + GapAdvertisingData::Appearance appearance + ) { +#if BLE_FEATURE_GATT_SERVER + gatt_server().setAppearance(appearance); + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER + } + +#endif // Disabled until reworked and reintroduced to GattServer API + + +ble_error_t PalGenericAccessService::get_peripheral_preferred_connection_parameters( + ble::Gap::PreferredConnectionParams_t& parameters +) { +#if BLE_FEATURE_GATT_SERVER + parameters = gatt_server().getPreferredConnectionParams(); + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER +} + +ble_error_t PalGenericAccessService::set_peripheral_preferred_connection_parameters( + const ble::Gap::PreferredConnectionParams_t& parameters +) { +#if BLE_FEATURE_GATT_SERVER + gatt_server().setPreferredConnectionParams(parameters); + return BLE_ERROR_NONE; +#else + return BLE_ERROR_NOT_IMPLEMENTED; +#endif // BLE_FEATURE_GATT_SERVER +} + + +#if BLE_FEATURE_GATT_SERVER +ble::GattServer& PalGenericAccessService::gatt_server() { + return ble::GattServer::getInstance(); +} + +} + +#endif // BLE_FEATURE_GATT_SERVER diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalSecurityManager.cpp similarity index 78% rename from features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp rename to connectivity/FEATURE_BLE/source/cordio/CordioPalSecurityManager.cpp index 479a847708..1f40070d86 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalSecurityManager.cpp @@ -1,5 +1,7 @@ /* mbed Microcontroller Library - * Copyright (c) 2018-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +20,9 @@ #include -#include "CordioPalSecurityManager.h" +#include "ble/types/blecommon.h" +#include "ble/internal/cordio/CordioPalSecurityManager.h" +#include "ble/internal/cordio/CordioPalAttClient.h" #include "dm_api.h" #include "att_api.h" #include "smp_api.h" @@ -26,24 +30,20 @@ #include "hci_core.h" namespace ble { -namespace pal { -namespace vendor { -namespace cordio { -template -CordioSecurityManager::CordioSecurityManager() : +PalSecurityManager::PalSecurityManager() : + _pal_event_handler(nullptr), _use_default_passkey(false), _default_passkey(0), _lesc_keys_generated(false), _public_key_x(), - _pending_privacy_control_blocks(NULL), + _pending_privacy_control_blocks(nullptr), _processing_privacy_control_block(false), _peer_csrks() { } -template -CordioSecurityManager::~CordioSecurityManager() +PalSecurityManager::~PalSecurityManager() { #if BLE_FEATURE_PRIVACY clear_privacy_control_blocks(); @@ -54,8 +54,8 @@ CordioSecurityManager::~CordioSecurityManager() // SM lifecycle management // -template -ble_error_t CordioSecurityManager::initialize_() + +ble_error_t PalSecurityManager::initialize() { // reset local state _use_default_passkey = false; @@ -74,8 +74,8 @@ ble_error_t CordioSecurityManager::initialize_() return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::terminate_() + +ble_error_t PalSecurityManager::terminate() { #if BLE_FEATURE_SIGNING cleanup_peer_csrks(); @@ -83,8 +83,8 @@ ble_error_t CordioSecurityManager::terminate_() return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::reset_() + +ble_error_t PalSecurityManager::reset() { #if BLE_FEATURE_SIGNING cleanup_peer_csrks(); @@ -97,8 +97,8 @@ ble_error_t CordioSecurityManager::reset_() // Resolving list management // -template -uint8_t CordioSecurityManager::read_resolving_list_capacity_() + +uint8_t PalSecurityManager::read_resolving_list_capacity() { // The Cordio stack requests this from the controller during initialization return hciCoreCb.resListSize; @@ -106,8 +106,8 @@ uint8_t CordioSecurityManager::read_resolving_list_capacity_() // As the Cordio stack can only handle one of these methods at a time, we need to create a list of control blocks // that are dequeued one after the other on completion of the previous one -template -ble_error_t CordioSecurityManager::add_device_to_resolving_list_( + +ble_error_t PalSecurityManager::add_device_to_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address, const irk_t &peer_irk @@ -124,8 +124,8 @@ ble_error_t CordioSecurityManager::add_device_to_resolving_list_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::remove_device_from_resolving_list_( + +ble_error_t PalSecurityManager::remove_device_from_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t& peer_identity_address ) { @@ -141,8 +141,8 @@ ble_error_t CordioSecurityManager::remove_device_from_resolving_li return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::clear_resolving_list_() + +ble_error_t PalSecurityManager::clear_resolving_list() { if( read_resolving_list_capacity() == 0 ) { @@ -162,8 +162,8 @@ ble_error_t CordioSecurityManager::clear_resolving_list_() // FIXME: Enable when new function available in the pal. #if 0 -template -ble_error_t CordioSecurityManager::set_secure_connections_support( + +ble_error_t PalSecurityManager::set_secure_connections_support( bool enabled, bool secure_connections_only ) { // secure connection support is enabled automatically at the stack level. @@ -176,8 +176,8 @@ ble_error_t CordioSecurityManager::set_secure_connections_support( } #endif -template -ble_error_t CordioSecurityManager::get_secure_connections_support_( + +ble_error_t PalSecurityManager::get_secure_connections_support( bool &enabled ) { // FIXME: should depend of the controller @@ -189,24 +189,24 @@ ble_error_t CordioSecurityManager::get_secure_connections_support_ // Security settings // -template -ble_error_t CordioSecurityManager::set_authentication_timeout_( + +ble_error_t PalSecurityManager::set_authentication_timeout( connection_handle_t connection, uint16_t timeout_in_10ms ) { DmWriteAuthPayloadTimeout(connection, timeout_in_10ms); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::get_authentication_timeout_( + +ble_error_t PalSecurityManager::get_authentication_timeout( connection_handle_t connection, uint16_t &timeout_in_10ms ) { // FIXME: Is it usefull to add dynamic timeout management for all connections ? return BLE_ERROR_NOT_IMPLEMENTED; } -template -ble_error_t CordioSecurityManager::slave_security_request_( + +ble_error_t PalSecurityManager::slave_security_request( connection_handle_t connection, AuthenticationMask authentication ) { @@ -218,8 +218,8 @@ ble_error_t CordioSecurityManager::slave_security_request_( // Encryption // -template -ble_error_t CordioSecurityManager::enable_encryption_( + +ble_error_t PalSecurityManager::enable_encryption( connection_handle_t connection, const ltk_t <k, const rand_t &rand, @@ -240,8 +240,8 @@ ble_error_t CordioSecurityManager::enable_encryption_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::enable_encryption_( + +ble_error_t PalSecurityManager::enable_encryption( connection_handle_t connection, const ltk_t <k, bool mitm @@ -259,8 +259,8 @@ ble_error_t CordioSecurityManager::enable_encryption_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::encrypt_data_( + +ble_error_t PalSecurityManager::encrypt_data( const byte_array_t<16> &key, encryption_block_t &data ) { @@ -271,8 +271,8 @@ ble_error_t CordioSecurityManager::encrypt_data_( // Privacy // -template -ble_error_t CordioSecurityManager::set_private_address_timeout_( + +ble_error_t PalSecurityManager::set_private_address_timeout( uint16_t timeout_in_seconds ) { DmPrivSetResolvablePrivateAddrTimeout(timeout_in_seconds); @@ -280,10 +280,10 @@ ble_error_t CordioSecurityManager::set_private_address_timeout_( } /** - * @see ::ble::pal::SecurityManager::get_identity_address + * @see ::ble::PalSecurityManager::get_identity_address */ -template -ble_error_t CordioSecurityManager::get_identity_address_( + +ble_error_t PalSecurityManager::get_identity_address( address_t& address, bool& public_address ) { @@ -297,8 +297,8 @@ ble_error_t CordioSecurityManager::get_identity_address_( // Keys // -template -ble_error_t CordioSecurityManager::set_ltk_( + +ble_error_t PalSecurityManager::set_ltk( connection_handle_t connection, const ltk_t& ltk, bool mitm, @@ -322,43 +322,43 @@ ble_error_t CordioSecurityManager::set_ltk_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_ltk_not_found_( + +ble_error_t PalSecurityManager::set_ltk_not_found( connection_handle_t connection ) { DmSecLtkRsp( connection, /* key found */ false, /* sec level */ DM_SEC_LEVEL_NONE, - NULL + nullptr ); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_irk_(const irk_t& irk) + +ble_error_t PalSecurityManager::set_irk(const irk_t& irk) { _irk = irk; DmSecSetLocalIrk(_irk.data()); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_csrk_( + +ble_error_t PalSecurityManager::set_csrk( const csrk_t& csrk, sign_count_t sign_counter ) { _csrk = csrk; DmSecSetLocalCsrk(_csrk.data()); // extra set the sign counter used by the client - CordioAttClient::get_client().set_sign_counter_(sign_counter); + PalAttClient::get_client().set_sign_counter(sign_counter); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_peer_csrk_( + +ble_error_t PalSecurityManager::set_peer_csrk( connection_handle_t connection, const csrk_t &csrk, bool authenticated, @@ -374,7 +374,7 @@ ble_error_t CordioSecurityManager::set_peer_csrk_( *_peer_csrks[connection_index] = csrk; } else { _peer_csrks[connection_index] = new (std::nothrow) csrk_t(csrk); - if (_peer_csrks[connection_index] == NULL) { + if (_peer_csrks[connection_index] == nullptr) { return BLE_ERROR_NO_MEM; } } @@ -384,8 +384,8 @@ ble_error_t CordioSecurityManager::set_peer_csrk_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::remove_peer_csrk_(connection_handle_t connection) + +ble_error_t PalSecurityManager::remove_peer_csrk(connection_handle_t connection) { if (connection == 0 || connection > DM_CONN_MAX) { return BLE_ERROR_INVALID_PARAM; @@ -395,10 +395,10 @@ ble_error_t CordioSecurityManager::remove_peer_csrk_(connection_ha if (_peer_csrks[connection_index]) { delete _peer_csrks[connection_index]; - _peer_csrks[connection_index] = NULL; + _peer_csrks[connection_index] = nullptr; } - AttsSetCsrk(connection, NULL, false); + AttsSetCsrk(connection, nullptr, false); return BLE_ERROR_NONE; } @@ -406,8 +406,8 @@ ble_error_t CordioSecurityManager::remove_peer_csrk_(connection_ha // Global parameters // -template -ble_error_t CordioSecurityManager::set_display_passkey_(passkey_num_t passkey) + +ble_error_t PalSecurityManager::set_display_passkey(passkey_num_t passkey) { if (passkey) { _use_default_passkey = true; @@ -418,15 +418,15 @@ ble_error_t CordioSecurityManager::set_display_passkey_(passkey_nu return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_io_capability_(io_capability_t io_capability) + +ble_error_t PalSecurityManager::set_io_capability(io_capability_t io_capability) { pSmpCfg->ioCap = io_capability.value(); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::set_encryption_key_requirements_( + +ble_error_t PalSecurityManager::set_encryption_key_requirements( uint8_t min_encryption_key_size, uint8_t max_encryption_key_size ) { @@ -445,8 +445,8 @@ ble_error_t CordioSecurityManager::set_encryption_key_requirements // Authentication // -template -ble_error_t CordioSecurityManager::send_pairing_request_( + +ble_error_t PalSecurityManager::send_pairing_request( connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, @@ -464,8 +464,8 @@ ble_error_t CordioSecurityManager::send_pairing_request_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::send_pairing_response_( + +ble_error_t PalSecurityManager::send_pairing_response( connection_handle_t connection, bool oob_data_flag, AuthenticationMask authentication_requirements, @@ -483,16 +483,16 @@ ble_error_t CordioSecurityManager::send_pairing_response_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::cancel_pairing_( + +ble_error_t PalSecurityManager::cancel_pairing( connection_handle_t connection, pairing_failure_t reason ) { DmSecCancelReq(connection, reason.value()); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::get_random_data_(byte_array_t<8> &random_data) + +ble_error_t PalSecurityManager::get_random_data(byte_array_t<8> &random_data) { SecRand(random_data.data(), random_data.size()); return BLE_ERROR_NONE; @@ -502,8 +502,8 @@ ble_error_t CordioSecurityManager::get_random_data_(byte_array_t<8 // MITM // -template -ble_error_t CordioSecurityManager::passkey_request_reply_( + +ble_error_t PalSecurityManager::passkey_request_reply( connection_handle_t connection, passkey_num_t passkey ) { DmSecAuthRsp( @@ -515,8 +515,8 @@ ble_error_t CordioSecurityManager::passkey_request_reply_( return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::legacy_pairing_oob_request_reply_( + +ble_error_t PalSecurityManager::legacy_pairing_oob_request_reply( connection_handle_t connection, const oob_tk_t &oob_data ) { @@ -529,8 +529,8 @@ ble_error_t CordioSecurityManager::legacy_pairing_oob_request_repl return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::confirmation_entered_( + +ble_error_t PalSecurityManager::confirmation_entered( connection_handle_t connection, bool confirmation ) { DmSecCompareRsp(connection, confirmation); @@ -540,25 +540,25 @@ ble_error_t CordioSecurityManager::confirmation_entered_( // FIXME: remove when declaration from the stack is available extern "C" void DmSecKeypressReq(dmConnId_t connId, uint8_t keypressType); -template -ble_error_t CordioSecurityManager::send_keypress_notification_( - connection_handle_t connection, Keypress_t keypress + +ble_error_t PalSecurityManager::send_keypress_notification( + connection_handle_t connection, ble::Keypress_t keypress ) { DmSecKeypressReq(connection, keypress); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::generate_secure_connections_oob_() { + +ble_error_t PalSecurityManager::generate_secure_connections_oob() { uint8_t oobLocalRandom[SMP_RAND_LEN]; SecRand(oobLocalRandom, SMP_RAND_LEN); DmSecCalcOobReq(oobLocalRandom, _public_key_x); return BLE_ERROR_NONE; } -template -ble_error_t CordioSecurityManager::secure_connections_oob_request_reply_( + +ble_error_t PalSecurityManager::secure_connections_oob_request_reply( connection_handle_t connection, const oob_lesc_value_t &local_random, const oob_lesc_value_t &peer_random, @@ -573,24 +573,24 @@ ble_error_t CordioSecurityManager::secure_connections_oob_request_ memcpy(oob_config.peerConfirm, peer_confirm.data(), peer_confirm.size()); DmSecSetOob(connection, &oob_config); - DmSecAuthRsp(connection, 0, NULL); + DmSecAuthRsp(connection, 0, nullptr); return BLE_ERROR_NONE; } -template -CordioSecurityManager& CordioSecurityManager::get_security_manager() + +PalSecurityManager& PalSecurityManager::get_security_manager() { - static CordioSecurityManager _security_manager; + static PalSecurityManager _security_manager; return _security_manager; } -template -bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { - CordioSecurityManager& self = get_security_manager(); - EventHandler* handler = self.get_event_handler(); - if ((msg == NULL) || (handler == NULL)) { +bool PalSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { + PalSecurityManager& self = get_security_manager(); + PalSecurityManagerEventHandler* handler = self.get_event_handler(); + + if ((msg == nullptr) || (handler == nullptr)) { return false; } @@ -654,7 +654,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { // requested. // To set secure connection OOB: // - DmSecSetOob(connection, oob_data) - // - DmSecAuthRsp(connection, 0, NULL) + // - DmSecAuthRsp(connection, 0, nullptr) handler->on_legacy_pairing_oob_request(connection); } else if (evt->display) { if (get_security_manager()._use_default_passkey) { @@ -813,7 +813,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { dmSecKeypressIndEvt_t* evt = (dmSecKeypressIndEvt_t*) msg; handler->on_keypress_notification( /* connection */ evt->hdr.param, - (Keypress_t) evt->notificationType + (ble::Keypress_t) evt->notificationType ); return true; } @@ -823,7 +823,7 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { case DM_PRIV_ADD_DEV_TO_RES_LIST_IND: // Device added to resolving list case DM_PRIV_REM_DEV_FROM_RES_LIST_IND: // Device removed from resolving list case DM_PRIV_CLEAR_RES_LIST_IND: // Resolving list cleared - { + { // Previous command completed, we can move to the next control block self.process_privacy_control_blocks(true); return true; @@ -834,10 +834,10 @@ bool CordioSecurityManager::sm_handler(const wsfMsgHdr_t* msg) { } } -template -struct CordioSecurityManager::PrivacyControlBlock + +struct PalSecurityManager::PrivacyControlBlock { - PrivacyControlBlock() : _next(NULL) {} + PrivacyControlBlock() : _next(nullptr) {} virtual ~PrivacyControlBlock() {} @@ -855,8 +855,8 @@ private: PrivacyControlBlock* _next; }; -template -struct CordioSecurityManager::PrivacyClearResListControlBlock : CordioSecurityManager::PrivacyControlBlock + +struct PalSecurityManager::PrivacyClearResListControlBlock : PalSecurityManager::PrivacyControlBlock { PrivacyClearResListControlBlock() : PrivacyControlBlock() {} @@ -869,8 +869,8 @@ struct CordioSecurityManager::PrivacyClearResListControlBlock : Co } }; -template -struct CordioSecurityManager::PrivacyAddDevToResListControlBlock : CordioSecurityManager::PrivacyControlBlock + +struct PalSecurityManager::PrivacyAddDevToResListControlBlock : PalSecurityManager::PrivacyControlBlock { PrivacyAddDevToResListControlBlock( advertising_peer_address_type_t peer_identity_address_type, @@ -895,8 +895,8 @@ private: irk_t _peer_irk; }; -template -struct CordioSecurityManager::PrivacyRemoveDevFromResListControlBlock : CordioSecurityManager::PrivacyControlBlock + +struct PalSecurityManager::PrivacyRemoveDevFromResListControlBlock : PalSecurityManager::PrivacyControlBlock { PrivacyRemoveDevFromResListControlBlock( advertising_peer_address_type_t peer_identity_address_type, @@ -921,8 +921,8 @@ private: }; // Helper functions for privacy -template -void CordioSecurityManager::queue_add_device_to_resolving_list( + +void PalSecurityManager::queue_add_device_to_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address, const irk_t &peer_irk @@ -930,7 +930,7 @@ void CordioSecurityManager::queue_add_device_to_resolving_list( { PrivacyAddDevToResListControlBlock* cb = new (std::nothrow) PrivacyAddDevToResListControlBlock(peer_identity_address_type, peer_identity_address, peer_irk); - if( cb == NULL ) + if( cb == nullptr ) { // Cannot go further return; @@ -939,15 +939,15 @@ void CordioSecurityManager::queue_add_device_to_resolving_list( queue_privacy_control_block(cb); } -template -void CordioSecurityManager::queue_remove_device_from_resolving_list( + +void PalSecurityManager::queue_remove_device_from_resolving_list( advertising_peer_address_type_t peer_identity_address_type, const address_t &peer_identity_address ) { PrivacyRemoveDevFromResListControlBlock* cb = new (std::nothrow) PrivacyRemoveDevFromResListControlBlock(peer_identity_address_type, peer_identity_address); - if( cb == NULL ) + if( cb == nullptr ) { // Cannot go further return; @@ -956,14 +956,14 @@ void CordioSecurityManager::queue_remove_device_from_resolving_lis queue_privacy_control_block(cb); } -template -void CordioSecurityManager::queue_clear_resolving_list() { + +void PalSecurityManager::queue_clear_resolving_list() { // Remove any pending control blocks, there's no point executing them as we're about to queue the list clear_privacy_control_blocks(); PrivacyClearResListControlBlock* cb = new (std::nothrow) PrivacyClearResListControlBlock(); - if( cb == NULL ) + if( cb == nullptr ) { // Cannot go further return; @@ -972,9 +972,9 @@ void CordioSecurityManager::queue_clear_resolving_list() { queue_privacy_control_block(cb); } -template -void CordioSecurityManager::clear_privacy_control_blocks() { - while(_pending_privacy_control_blocks != NULL) + +void PalSecurityManager::clear_privacy_control_blocks() { + while(_pending_privacy_control_blocks != nullptr) { PrivacyControlBlock* next = _pending_privacy_control_blocks->next(); delete _pending_privacy_control_blocks; @@ -982,15 +982,15 @@ void CordioSecurityManager::clear_privacy_control_blocks() { } } -template -void CordioSecurityManager::queue_privacy_control_block(PrivacyControlBlock* block) + +void PalSecurityManager::queue_privacy_control_block(PrivacyControlBlock* block) { - if( _pending_privacy_control_blocks == NULL ) { + if( _pending_privacy_control_blocks == nullptr ) { _pending_privacy_control_blocks = block; } else { PrivacyControlBlock* node = _pending_privacy_control_blocks; - while(node->next() != NULL) { + while(node->next() != nullptr) { node = node->next(); } node->set_next(block); @@ -1000,8 +1000,8 @@ void CordioSecurityManager::queue_privacy_control_block(PrivacyCon } // If cb_completed is set to true, it means the previous control block has completed -template -void CordioSecurityManager::process_privacy_control_blocks(bool cb_completed) + +void PalSecurityManager::process_privacy_control_blocks(bool cb_completed) { if( (_processing_privacy_control_block == true) && !cb_completed ) { @@ -1010,7 +1010,7 @@ void CordioSecurityManager::process_privacy_control_blocks(bool cb } PrivacyControlBlock* cb = _pending_privacy_control_blocks; - if(cb == NULL) { + if(cb == nullptr) { // All control blocks processed _processing_privacy_control_block = false; return; @@ -1025,17 +1025,23 @@ void CordioSecurityManager::process_privacy_control_blocks(bool cb _pending_privacy_control_blocks = next; } -template -void CordioSecurityManager::cleanup_peer_csrks() { + +void PalSecurityManager::cleanup_peer_csrks() { for (size_t i = 0; i < DM_CONN_MAX; ++i) { if (_peer_csrks[i]) { delete _peer_csrks[i]; - _peer_csrks[i] = NULL; + _peer_csrks[i] = nullptr; } } } -} // cordio -} // vendor -} // pal +void PalSecurityManager::set_event_handler(PalSecurityManagerEventHandler *event_handler +) { + _pal_event_handler = event_handler; +} + +PalSecurityManagerEventHandler* PalSecurityManager::get_event_handler() { + return _pal_event_handler; +} + } // ble diff --git a/connectivity/FEATURE_BLE/source/cordio/CordioPalSigningMonitor.cpp b/connectivity/FEATURE_BLE/source/cordio/CordioPalSigningMonitor.cpp new file mode 100644 index 0000000000..5fef81c386 --- /dev/null +++ b/connectivity/FEATURE_BLE/source/cordio/CordioPalSigningMonitor.cpp @@ -0,0 +1,34 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2020 ARM Limited + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ble/internal/cordio/CordioPalSigningMonitor.h" +#include "ble/internal/cordio/CordioBLEInstanceBase.h" +#include "ble/internal/cordio/CordioGattClient.h" + +namespace ble { + +void PalSigningMonitor::set_signing_event_handler(SecurityManager *handler) { +#if BLE_FEATURE_GATT_CLIENT + CordioBLEInstanceBase::deviceInstance().getGattClient().set_signing_event_handler(handler); +#endif // BLE_FEATURE_GATT_CLIENT +#if BLE_FEATURE_GATT_SERVER + CordioBLEInstanceBase::deviceInstance().getGattServer().set_signing_event_handler(handler); +#endif // BLE_FEATURE_GATT_SERVER +} + +} diff --git a/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp b/connectivity/FEATURE_BLE/source/cordio/CordioSecurityManager.cpp similarity index 70% rename from features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp rename to connectivity/FEATURE_BLE/source/cordio/CordioSecurityManager.cpp index 6a62a2faa1..4bd0279fc6 100644 --- a/features/FEATURE_BLE/source/generic/GenericSecurityManager.tpp +++ b/connectivity/FEATURE_BLE/source/cordio/CordioSecurityManager.cpp @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2017-2018 ARM Limited + * Copyright (c) 2006-2020 ARM Limited * * SPDX-License-Identifier: Apache-2.0 * @@ -19,28 +19,25 @@ #include "BLERoles.h" #include "ble/SecurityManager.h" -#include "ble/pal/PalSecurityManager.h" -#include "ble/generic/GenericSecurityManager.h" -#include "ble/generic/MemorySecurityDb.h" -#include "ble/generic/FileSecurityDb.h" -#include "ble/generic/KVStoreSecurityDb.h" +#include "ble/internal/pal/PalSecurityManager.h" +#include "ble/internal/MemorySecurityDb.h" +#include "ble/internal/FileSecurityDb.h" +#include "ble/internal/KVStoreSecurityDb.h" -using ble::pal::advertising_peer_address_type_t; -using ble::pal::AuthenticationMask; -using ble::pal::KeyDistribution; -using ble::pal::connection_peer_address_type_t; +using ble::advertising_peer_address_type_t; +using ble::AuthenticationMask; +using ble::KeyDistribution; +using ble::connection_peer_address_type_t; namespace ble { -namespace generic { -/* Implements SecurityManager */ +/* Implements PalSecurityManager */ //////////////////////////////////////////////////////////////////////////// // SM lifecycle management // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::init_( +ble_error_t SecurityManager::init( bool bondable, bool mitm, SecurityIOCapabilities_t iocaps, @@ -114,14 +111,14 @@ ble_error_t GenericSecurityManager::init_( if (result != BLE_ERROR_NONE) { delete _db; - _db = NULL; + _db = nullptr; } return result; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setDatabaseFilepath_( + +ble_error_t SecurityManager::setDatabaseFilepath( const char *db_path ) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; @@ -145,18 +142,22 @@ ble_error_t GenericSecurityManager::setData return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::reset_(void) { + +ble_error_t SecurityManager::reset(void) { delete _db; - _db = NULL; + _db = nullptr; _pal.reset(); - SecurityManager::reset_(); + + /* Notify that the instance is about to shutdown */ + shutdownCallChain.call(this); + shutdownCallChain.clear(); + eventHandler = &defaultEventHandler; return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::preserveBondingStateOnReset_(bool enabled) { + +ble_error_t SecurityManager::preserveBondingStateOnReset(bool enabled) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; _db->set_restore(enabled); return BLE_ERROR_NONE; @@ -166,8 +167,8 @@ ble_error_t GenericSecurityManager::preserv // List management // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::purgeAllBondingState_(void) { + +ble_error_t SecurityManager::purgeAllBondingState(void) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; _db->clear_entries(); @@ -187,15 +188,15 @@ ble_error_t GenericSecurityManager::purgeAl return ret; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::generateWhitelistFromBondTable_(::ble::whitelist_t *whitelist) const { + +ble_error_t SecurityManager::generateWhitelistFromBondTable(::ble::whitelist_t *whitelist) const { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; if (eventHandler) { if (!whitelist) { return BLE_ERROR_INVALID_PARAM; } _db->generate_whitelist_from_bond_table( - mbed::callback(eventHandler, &SecurityManagerEventHandler::whitelistFromBondTable), + mbed::callback(eventHandler, &EventHandler::whitelistFromBondTable), whitelist ); } @@ -206,8 +207,8 @@ ble_error_t GenericSecurityManager::generat // Pairing // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::requestPairing_(connection_handle_t connection) { + +ble_error_t SecurityManager::requestPairing(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -260,8 +261,8 @@ ble_error_t GenericSecurityManager::request ); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::acceptPairingRequest_(connection_handle_t connection) { + +ble_error_t SecurityManager::acceptPairingRequest(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -319,21 +320,21 @@ ble_error_t GenericSecurityManager::acceptP ); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::cancelPairingRequest_(connection_handle_t connection) { + +ble_error_t SecurityManager::cancelPairingRequest(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; return _pal.cancel_pairing(connection, pairing_failure_t::UNSPECIFIED_REASON); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setPairingRequestAuthorisation_(bool required) { + +ble_error_t SecurityManager::setPairingRequestAuthorisation(bool required) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; _pairing_authorisation_required = required; return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getPeerIdentity_(connection_handle_t connection) { + +ble_error_t SecurityManager::getPeerIdentity(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; if (eventHandler) { ControlBlock_t *cb = get_control_block(connection); @@ -363,14 +364,14 @@ ble_error_t GenericSecurityManager::getPeer // Feature support // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::allowLegacyPairing_(bool allow) { + +ble_error_t SecurityManager::allowLegacyPairing(bool allow) { _legacy_pairing_allowed = allow; return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getSecureConnectionsSupport_(bool *enabled) { + +ble_error_t SecurityManager::getSecureConnectionsSupport(bool *enabled) { return _pal.get_secure_connections_support(*enabled); } @@ -378,20 +379,20 @@ ble_error_t GenericSecurityManager::getSecu // Security settings // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setIoCapability_(SecurityIOCapabilities_t iocaps) { + +ble_error_t SecurityManager::setIoCapability(SecurityIOCapabilities_t iocaps) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; return _pal.set_io_capability((io_capability_t::type) iocaps); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setDisplayPasskey_(const uint8_t* passkey) { + +ble_error_t SecurityManager::setDisplayPasskey(const uint8_t* passkey) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; return _pal.set_display_passkey(PasskeyAscii::to_num(passkey)); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setAuthenticationTimeout_( + +ble_error_t SecurityManager::setAuthenticationTimeout( connection_handle_t connection, uint32_t timeout_in_ms ) { @@ -399,8 +400,8 @@ ble_error_t GenericSecurityManager::setAuth return _pal.set_authentication_timeout(connection, timeout_in_ms / 10); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getAuthenticationTimeout_( + +ble_error_t SecurityManager::getAuthenticationTimeout( connection_handle_t connection, uint32_t *timeout_in_ms ) { @@ -411,8 +412,8 @@ ble_error_t GenericSecurityManager::getAuth return status; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setLinkSecurity_( + +ble_error_t SecurityManager::setLinkSecurity( connection_handle_t connection, SecurityMode_t securityMode ) { @@ -428,34 +429,34 @@ ble_error_t GenericSecurityManager::setLink switch (securityMode) { case SECURITY_MODE_ENCRYPTION_OPEN_LINK: - return setLinkEncryption_(connection, link_encryption_t::NOT_ENCRYPTED); + return setLinkEncryption(connection, link_encryption_t::NOT_ENCRYPTED); case SECURITY_MODE_ENCRYPTION_NO_MITM: - return setLinkEncryption_(connection, link_encryption_t::ENCRYPTED); + return setLinkEncryption(connection, link_encryption_t::ENCRYPTED); case SECURITY_MODE_ENCRYPTION_WITH_MITM: - return setLinkEncryption_(connection, link_encryption_t::ENCRYPTED_WITH_MITM); + return setLinkEncryption(connection, link_encryption_t::ENCRYPTED_WITH_MITM); case SECURITY_MODE_SIGNED_NO_MITM: - return getSigningKey_(connection, false); + return getSigningKey(connection, false); case SECURITY_MODE_SIGNED_WITH_MITM: - return getSigningKey_(connection, true); + return getSigningKey(connection, true); default: return BLE_ERROR_INVALID_PARAM; } } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setKeypressNotification_(bool enabled) { + +ble_error_t SecurityManager::setKeypressNotification(bool enabled) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; _default_authentication.set_keypress_notification(enabled); return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::enableSigning_( + +ble_error_t SecurityManager::enableSigning( connection_handle_t connection, bool enabled ) { @@ -477,14 +478,14 @@ ble_error_t GenericSecurityManager::enableS if (flags->csrk_stored) { /* used the stored ones when available */ _db->get_entry_peer_csrk( - mbed::callback(this, &GenericSecurityManager::set_peer_csrk_cb), + mbed::callback(this, &SecurityManager::set_peer_csrk_cb), cb->db_entry ); } else { /* create keys if needed and exchange them */ init_signing(); if (cb->is_master) { - return requestPairing_(connection); + return requestPairing(connection); } else { return slave_security_request(connection); } @@ -496,8 +497,8 @@ ble_error_t GenericSecurityManager::enableS return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setHintFutureRoleReversal_(bool enable) { + +ble_error_t SecurityManager::setHintFutureRoleReversal(bool enable) { _master_sends_keys = enable; return BLE_ERROR_NONE; } @@ -506,8 +507,8 @@ ble_error_t GenericSecurityManager::setHint // Encryption // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getLinkEncryption_( + +ble_error_t SecurityManager::getLinkEncryption( connection_handle_t connection, link_encryption_t *encryption ) { @@ -541,8 +542,8 @@ ble_error_t GenericSecurityManager::getLink return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setLinkEncryption_( + +ble_error_t SecurityManager::setLinkEncryption( connection_handle_t connection, link_encryption_t encryption ) { @@ -613,13 +614,13 @@ ble_error_t GenericSecurityManager::setLink return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getEncryptionKeySize_( - connection_handle_t connection, + +ble_error_t SecurityManager::getEncryptionKeySize( + connection_handle_t connectionHandle, uint8_t *size ) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; - ControlBlock_t *cb = get_control_block(connection); + ControlBlock_t *cb = get_control_block(connectionHandle); if (!cb) { return BLE_ERROR_INVALID_PARAM; } @@ -633,8 +634,8 @@ ble_error_t GenericSecurityManager::getEncr return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setEncryptionKeyRequirements_( + +ble_error_t SecurityManager::setEncryptionKeyRequirements( uint8_t minimumByteSize, uint8_t maximumByteSize ) { @@ -645,8 +646,8 @@ ble_error_t GenericSecurityManager::setEncr //////////////////////////////////////////////////////////////////////////// // Keys // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::getSigningKey_(connection_handle_t connection, bool authenticated) { + +ble_error_t SecurityManager::getSigningKey(connection_handle_t connection, bool authenticated) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -662,7 +663,7 @@ ble_error_t GenericSecurityManager::getSign /* we have a key that is either authenticated or we don't care if it is * so retrieve it from the db now */ _db->get_entry_peer_csrk( - mbed::callback(this, &GenericSecurityManager::return_csrk_cb), + mbed::callback(this, &SecurityManager::return_csrk_cb), cb->db_entry ); return BLE_ERROR_NONE; @@ -684,8 +685,8 @@ ble_error_t GenericSecurityManager::getSign // Privacy // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setPrivateAddressTimeout_(uint16_t timeout_in_seconds) { + +ble_error_t SecurityManager::setPrivateAddressTimeout(uint16_t timeout_in_seconds) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; return _pal.set_private_address_timeout(timeout_in_seconds); } @@ -694,8 +695,8 @@ ble_error_t GenericSecurityManager::setPriv // Authentication // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::requestAuthentication_(connection_handle_t connection) { + +ble_error_t SecurityManager::requestAuthentication(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -728,8 +729,8 @@ ble_error_t GenericSecurityManager::request // MITM // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::generateOOB_( + +ble_error_t SecurityManager::generateOOB( const address_t *address ) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; @@ -773,8 +774,8 @@ ble_error_t GenericSecurityManager::generat return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::setOOBDataUsage_( + +ble_error_t SecurityManager::setOOBDataUsage( connection_handle_t connection, bool useOOB, bool OOBProvidesMITM @@ -795,8 +796,8 @@ ble_error_t GenericSecurityManager::setOOBD } } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::confirmationEntered_( + +ble_error_t SecurityManager::confirmationEntered( connection_handle_t connection, bool confirmation ) { @@ -804,8 +805,8 @@ ble_error_t GenericSecurityManager::confirm return _pal.confirmation_entered(connection, confirmation); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::passkeyEntered_( + +ble_error_t SecurityManager::passkeyEntered( connection_handle_t connection, Passkey_t passkey ) { @@ -816,17 +817,17 @@ ble_error_t GenericSecurityManager::passkey ); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::sendKeypressNotification_( + +ble_error_t SecurityManager::sendKeypressNotification( connection_handle_t connection, - Keypress_t keypress + ble::Keypress_t keypress ) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; return _pal.send_keypress_notification(connection, keypress); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::legacyPairingOobReceived_( + +ble_error_t SecurityManager::legacyPairingOobReceived( const address_t *address, const oob_tk_t *tk ) { @@ -850,7 +851,7 @@ ble_error_t GenericSecurityManager::legacyP } if (cb->legacy_pairing_oob_request_pending) { - on_legacy_pairing_oob_request_(cb->connection); + on_legacy_pairing_oob_request(cb->connection); /* legacy_pairing_oob_request_pending stops us from * going into a loop of asking the user for oob * so this reset needs to happen after the call above */ @@ -860,8 +861,8 @@ ble_error_t GenericSecurityManager::legacyP return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::oobReceived_( + +ble_error_t SecurityManager::oobReceived( const address_t *address, const oob_lesc_value_t *random, const oob_confirm_t *confirm @@ -881,8 +882,8 @@ ble_error_t GenericSecurityManager::oobRece // Helper functions // -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::init_database( + +ble_error_t SecurityManager::init_database( const char *db_path ) { delete _db; @@ -912,8 +913,8 @@ ble_error_t GenericSecurityManager::init_da return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::init_resolving_list() { + +ble_error_t SecurityManager::init_resolving_list() { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; /* match the resolving list to the currently stored set of IRKs */ @@ -928,7 +929,7 @@ ble_error_t GenericSecurityManager::init_re ); _db->get_identity_list( - mbed::callback(this, &GenericSecurityManager::on_identity_list_retrieved), + mbed::callback(this, &SecurityManager::on_identity_list_retrieved), identity_list ); } else { @@ -938,8 +939,8 @@ ble_error_t GenericSecurityManager::init_re return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::init_signing() { + +ble_error_t SecurityManager::init_signing() { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; const csrk_t *pcsrk = _db->get_local_csrk(); sign_count_t local_sign_counter = _db->get_local_sign_counter(); @@ -959,8 +960,8 @@ ble_error_t GenericSecurityManager::init_si return _pal.set_csrk(*pcsrk, local_sign_counter); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::init_identity() { + +ble_error_t SecurityManager::init_identity() { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; const irk_t *pirk = nullptr; @@ -986,8 +987,8 @@ ble_error_t GenericSecurityManager::init_id return _pal.set_irk(*pirk); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::get_random_data(uint8_t *buffer, size_t size) { + +ble_error_t SecurityManager::get_random_data(uint8_t *buffer, size_t size) { byte_array_t<8> random_data; while (size) { @@ -1006,8 +1007,8 @@ ble_error_t GenericSecurityManager::get_ran return BLE_ERROR_NONE; } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::slave_security_request(connection_handle_t connection) { + +ble_error_t SecurityManager::slave_security_request(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -1018,8 +1019,8 @@ ble_error_t GenericSecurityManager::slave_s return _pal.slave_security_request(connection, link_authentication); } -template class TPalSecurityManager, template class SigningMonitor> -ble_error_t GenericSecurityManager::enable_encryption(connection_handle_t connection) { + +ble_error_t SecurityManager::enable_encryption(connection_handle_t connection) { if (!_db) return BLE_ERROR_INITIALIZATION_INCOMPLETE; ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -1034,7 +1035,7 @@ ble_error_t GenericSecurityManager::enable_ if (cb->is_master) { if (flags->ltk_stored) { _db->get_entry_peer_keys( - mbed::callback(this, &GenericSecurityManager::enable_encryption_cb), + mbed::callback(this, &SecurityManager::enable_encryption_cb), cb->db_entry ); return BLE_ERROR_NONE; @@ -1046,8 +1047,8 @@ ble_error_t GenericSecurityManager::enable_ } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::enable_encryption_cb( + +void SecurityManager::enable_encryption_cb( SecurityDb::entry_handle_t db_entry, const SecurityEntryKeys_t* entryKeys ) { @@ -1071,8 +1072,8 @@ void GenericSecurityManager::enable_encrypt } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::set_ltk_cb( + +void SecurityManager::set_ltk_cb( SecurityDb::entry_handle_t db_entry, const SecurityEntryKeys_t* entryKeys ) { @@ -1099,8 +1100,8 @@ void GenericSecurityManager::set_ltk_cb( } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::set_peer_csrk_cb( + +void SecurityManager::set_peer_csrk_cb( SecurityDb::entry_handle_t db_entry, const SecurityEntrySigning_t* signing ) { @@ -1122,8 +1123,8 @@ void GenericSecurityManager::set_peer_csrk_ ); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::return_csrk_cb( + +void SecurityManager::return_csrk_cb( SecurityDb::entry_handle_t db_entry, const SecurityEntrySigning_t *signing ) { @@ -1145,8 +1146,8 @@ void GenericSecurityManager::return_csrk_cb ); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::update_oob_presence(connection_handle_t connection) { + +void SecurityManager::update_oob_presence(connection_handle_t connection) { MBED_ASSERT(_db); ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -1173,8 +1174,8 @@ void GenericSecurityManager::update_oob_pre } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) { + +void SecurityManager::set_mitm_performed(connection_handle_t connection, bool enable) { ControlBlock_t *cb = get_control_block(connection); if (cb) { cb->mitm_performed = enable; @@ -1186,8 +1187,8 @@ void GenericSecurityManager::set_mitm_perfo } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_connected_( + +void SecurityManager::on_connected( connection_handle_t connection, connection_role_t role, peer_address_type_t peer_address_type, @@ -1223,7 +1224,7 @@ void GenericSecurityManager::on_connected_( if (signing && flags->csrk_stored) { _db->get_entry_peer_csrk( - mbed::callback(this, &GenericSecurityManager::set_peer_csrk_cb), + mbed::callback(this, &SecurityManager::set_peer_csrk_cb), cb->db_entry ); } @@ -1231,8 +1232,8 @@ void GenericSecurityManager::on_connected_( #endif // BLE_FEATURE_SECURITY } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_disconnected_( + +void SecurityManager::on_disconnected( connection_handle_t connection, disconnection_reason_t reason ) { @@ -1251,8 +1252,8 @@ void GenericSecurityManager::on_disconnecte #endif // BLE_FEATURE_SECURITY } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_security_entry_retrieved( + +void SecurityManager::on_security_entry_retrieved( SecurityDb::entry_handle_t entry, const SecurityEntryIdentity_t* identity ) { @@ -1272,8 +1273,8 @@ void GenericSecurityManager::on_security_en #endif // BLE_FEATURE_PRIVACY } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_identity_list_retrieved( + +void SecurityManager::on_identity_list_retrieved( Span& identity_list, size_t count ) { @@ -1293,14 +1294,14 @@ void GenericSecurityManager::on_identity_li delete [] identity_list.data(); } -/* Implements ble::pal::SecurityManagerEventHandler */ +/* Implements ble::PalSecurityManagerEventHandler */ //////////////////////////////////////////////////////////////////////////// // Pairing // -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_pairing_request_( + +void SecurityManager::on_pairing_request( connection_handle_t connection, bool use_oob, AuthenticationMask authentication, @@ -1330,8 +1331,8 @@ void GenericSecurityManager::on_pairing_req } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_pairing_error_( + +void SecurityManager::on_pairing_error( connection_handle_t connection, pairing_failure_t error ) { @@ -1353,8 +1354,8 @@ void GenericSecurityManager::on_pairing_err } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_pairing_timed_out_(connection_handle_t connection) { + +void SecurityManager::on_pairing_timed_out(connection_handle_t connection) { set_mitm_performed(connection, false); eventHandler->pairingResult( @@ -1363,13 +1364,13 @@ void GenericSecurityManager::on_pairing_tim ); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_pairing_completed_(connection_handle_t connection) { + +void SecurityManager::on_pairing_completed(connection_handle_t connection) { MBED_ASSERT(_db); ControlBlock_t *cb = get_control_block(connection); if (cb) { _db->get_entry_identity( - mbed::callback(this, &GenericSecurityManager::on_security_entry_retrieved), + mbed::callback(this, &SecurityManager::on_security_entry_retrieved), cb->db_entry ); } @@ -1384,13 +1385,13 @@ void GenericSecurityManager::on_pairing_com // Security // -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_valid_mic_timeout_(connection_handle_t connection) { + +void SecurityManager::on_valid_mic_timeout(connection_handle_t connection) { (void)connection; } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_signed_write_received_( + +void SecurityManager::on_signed_write_received( connection_handle_t connection, sign_count_t sign_counter ) { @@ -1402,8 +1403,8 @@ void GenericSecurityManager::on_signed_writ _db->set_entry_peer_sign_counter(cb->db_entry, sign_counter); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_signed_write_verification_failure_( + +void SecurityManager::on_signed_write_verification_failure( connection_handle_t connection ) { ControlBlock_t *cb = get_control_block(connection); @@ -1428,14 +1429,14 @@ void GenericSecurityManager::on_signed_writ } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_signed_write_() { + +void SecurityManager::on_signed_write() { MBED_ASSERT(_db); _db->set_local_sign_counter(_db->get_local_sign_counter() + 1); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_slave_security_request_( + +void SecurityManager::on_slave_security_request( connection_handle_t connection, AuthenticationMask authentication ) { @@ -1474,8 +1475,8 @@ void GenericSecurityManager::on_slave_secur // Encryption // -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_link_encryption_result_( + +void SecurityManager::on_link_encryption_result( connection_handle_t connection, link_encryption_t result ) { @@ -1516,8 +1517,8 @@ void GenericSecurityManager::on_link_encryp eventHandler->linkEncryptionResult(connection, result); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_link_encryption_request_timed_out_( + +void SecurityManager::on_link_encryption_request_timed_out( connection_handle_t connection ) { eventHandler->linkEncryptionResult( @@ -1530,8 +1531,8 @@ void GenericSecurityManager::on_link_encryp // MITM // -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_passkey_display_( + +void SecurityManager::on_passkey_display( connection_handle_t connection, passkey_num_t passkey ) { @@ -1539,29 +1540,29 @@ void GenericSecurityManager::on_passkey_dis eventHandler->passkeyDisplay(connection, PasskeyAscii(passkey).value()); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keypress_notification_( + +void SecurityManager::on_keypress_notification( connection_handle_t connection, - Keypress_t keypress + ble::Keypress_t keypress ) { set_mitm_performed(connection); eventHandler->keypressNotification(connection, keypress); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_passkey_request_(connection_handle_t connection) { + +void SecurityManager::on_passkey_request(connection_handle_t connection) { set_mitm_performed(connection); eventHandler->passkeyRequest(connection); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_confirmation_request_(connection_handle_t connection) { + +void SecurityManager::on_confirmation_request(connection_handle_t connection) { set_mitm_performed(connection); eventHandler->confirmationRequest(connection); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_secure_connections_oob_request_(connection_handle_t connection) { + +void SecurityManager::on_secure_connections_oob_request(connection_handle_t connection) { set_mitm_performed(connection); ControlBlock_t *cb = get_control_block(connection); @@ -1583,8 +1584,8 @@ void GenericSecurityManager::on_secure_conn } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_legacy_pairing_oob_request_(connection_handle_t connection) { + +void SecurityManager::on_legacy_pairing_oob_request(connection_handle_t connection) { MBED_ASSERT(_db); ControlBlock_t *cb = get_control_block(connection); if (!cb) { @@ -1615,8 +1616,8 @@ void GenericSecurityManager::on_legacy_pair } } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_secure_connections_oob_generated_( + +void SecurityManager::on_secure_connections_oob_generated( const oob_lesc_value_t &random, const oob_confirm_t &confirm ) { @@ -1628,8 +1629,8 @@ void GenericSecurityManager::on_secure_conn // Keys // -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_secure_connections_ltk_generated_( + +void SecurityManager::on_secure_connections_ltk_generated( connection_handle_t connection, const ltk_t <k ) { @@ -1651,8 +1652,8 @@ void GenericSecurityManager::on_secure_conn _db->set_entry_local_ltk(cb->db_entry, ltk); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_ltk_( + +void SecurityManager::on_keys_distributed_ltk( connection_handle_t connection, const ltk_t <k ) { @@ -1672,8 +1673,8 @@ void GenericSecurityManager::on_keys_distri _db->set_entry_peer_ltk(cb->db_entry, ltk); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_ediv_rand_( + +void SecurityManager::on_keys_distributed_ediv_rand( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand @@ -1687,8 +1688,8 @@ void GenericSecurityManager::on_keys_distri _db->set_entry_peer_ediv_rand(cb->db_entry, ediv, rand); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_local_ltk_( + +void SecurityManager::on_keys_distributed_local_ltk( connection_handle_t connection, const ltk_t <k ) { @@ -1706,8 +1707,8 @@ void GenericSecurityManager::on_keys_distri _db->set_entry_local_ltk(cb->db_entry, ltk); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_local_ediv_rand_( + +void SecurityManager::on_keys_distributed_local_ediv_rand( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand @@ -1721,8 +1722,8 @@ void GenericSecurityManager::on_keys_distri _db->set_entry_local_ediv_rand(cb->db_entry, ediv, rand); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_irk_( + +void SecurityManager::on_keys_distributed_irk( connection_handle_t connection, const irk_t &irk ) { @@ -1740,8 +1741,8 @@ void GenericSecurityManager::on_keys_distri _db->set_entry_peer_irk(cb->db_entry, irk); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_bdaddr_( + +void SecurityManager::on_keys_distributed_bdaddr( connection_handle_t connection, advertising_peer_address_type_t peer_address_type, const address_t &peer_identity_address @@ -1759,8 +1760,8 @@ void GenericSecurityManager::on_keys_distri ); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_keys_distributed_csrk_( + +void SecurityManager::on_keys_distributed_csrk( connection_handle_t connection, const csrk_t &csrk ) { @@ -1785,8 +1786,8 @@ void GenericSecurityManager::on_keys_distri ); } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_ltk_request_( + +void SecurityManager::on_ltk_request( connection_handle_t connection, const ediv_t &ediv, const rand_t &rand @@ -1803,7 +1804,7 @@ void GenericSecurityManager::on_ltk_request } _db->get_entry_local_keys( - mbed::callback(this, &GenericSecurityManager::set_ltk_cb), + mbed::callback(this, &SecurityManager::set_ltk_cb), cb->db_entry, ediv, rand @@ -1812,8 +1813,8 @@ void GenericSecurityManager::on_ltk_request /* control blocks list management */ -template class TPalSecurityManager, template class SigningMonitor> -GenericSecurityManager::ControlBlock_t::ControlBlock_t() : + +SecurityManager::ControlBlock_t::ControlBlock_t() : connection(0), db_entry(0), local_address(), @@ -1833,8 +1834,8 @@ GenericSecurityManager::ControlBlock_t::Con legacy_pairing_oob_request_pending(false), csrk_failures(0) { } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::on_ltk_request_(connection_handle_t connection) + +void SecurityManager::on_ltk_request(connection_handle_t connection) { MBED_ASSERT(_db); ControlBlock_t *cb = get_control_block(connection); @@ -1843,14 +1844,14 @@ void GenericSecurityManager::on_ltk_request } _db->get_entry_local_keys( - mbed::callback(this, &GenericSecurityManager::set_ltk_cb), + mbed::callback(this, &SecurityManager::set_ltk_cb), cb->db_entry ); } -template class TPalSecurityManager, template class SigningMonitor> -typename GenericSecurityManager::ControlBlock_t* -GenericSecurityManager::acquire_control_block(connection_handle_t connection) + +typename SecurityManager::ControlBlock_t* +SecurityManager::acquire_control_block(connection_handle_t connection) { /* grab the first disconnected slot*/ for (size_t i = 0; i < MAX_CONTROL_BLOCKS; i++) { @@ -1862,12 +1863,12 @@ GenericSecurityManager::acquire_control_blo } } - return NULL; + return nullptr; } -template class TPalSecurityManager, template class SigningMonitor> -typename GenericSecurityManager::ControlBlock_t* -GenericSecurityManager::get_control_block( + +typename SecurityManager::ControlBlock_t* +SecurityManager::get_control_block( connection_handle_t connection ) { for (size_t i = 0; i < MAX_CONTROL_BLOCKS; i++) { @@ -1877,12 +1878,12 @@ GenericSecurityManager::get_control_block( return &_control_blocks[i]; } } - return NULL; + return nullptr; } -template class TPalSecurityManager, template class SigningMonitor> -typename GenericSecurityManager::ControlBlock_t* -GenericSecurityManager::get_control_block( + +typename SecurityManager::ControlBlock_t* +SecurityManager::get_control_block( const address_t &peer_address ) { MBED_ASSERT(_db); @@ -1895,12 +1896,12 @@ GenericSecurityManager::get_control_block( } } } - return NULL; + return nullptr; } -template class TPalSecurityManager, template class SigningMonitor> -typename GenericSecurityManager::ControlBlock_t* -GenericSecurityManager::get_control_block( + +typename SecurityManager::ControlBlock_t* +SecurityManager::get_control_block( SecurityDb::entry_handle_t db_entry ) { for (size_t i = 0; i < MAX_CONTROL_BLOCKS; i++) { @@ -1910,15 +1911,35 @@ GenericSecurityManager::get_control_block( return &_control_blocks[i]; } } - return NULL; + return nullptr; } -template class TPalSecurityManager, template class SigningMonitor> -void GenericSecurityManager::release_control_block(ControlBlock_t* cb) + +void SecurityManager::release_control_block(ControlBlock_t* cb) { *cb = ControlBlock_t(); } -} /* namespace generic */ +void SecurityManager::onShutdown(const SecurityManagerShutdownCallback_t& callback) { + shutdownCallChain.add(callback); +} + +template +void SecurityManager::onShutdown(T *objPtr, void (T::*memberPtr)(const SecurityManager *)) { + shutdownCallChain.add(objPtr, memberPtr); +} + +SecurityManager::SecurityManagerShutdownCallbackChain_t& SecurityManager::onShutdown() { + return shutdownCallChain; +} + +void SecurityManager::setSecurityManagerEventHandler(EventHandler* handler) { + if (handler) { + eventHandler = handler; + } else { + eventHandler = &defaultEventHandler; + } +} + } /* namespace ble */ diff --git a/features/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp b/connectivity/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp similarity index 98% rename from features/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp rename to connectivity/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp index 14aee492b1..feee82e019 100644 --- a/features/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp +++ b/connectivity/FEATURE_BLE/source/gap/AdvertisingDataBuilder.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ble/gap/AdvertisingDataBuilder.h" +#include "gap/AdvertisingDataBuilder.h" // Implementation notes // Advertising data are organized as follow: @@ -79,7 +79,7 @@ ble_error_t AdvertisingDataBuilder::addData( mbed::Span fieldData ) { - if (findField(advDataType) != NULL) { + if (findField(advDataType) != nullptr) { return BLE_ERROR_OPERATION_NOT_PERMITTED; } else { return addField(advDataType, fieldData); @@ -93,7 +93,7 @@ ble_error_t AdvertisingDataBuilder::replaceData( { uint8_t *field = findField(advDataType); - if (field == NULL) { + if (field == nullptr) { return BLE_ERROR_NOT_FOUND; } @@ -107,7 +107,7 @@ ble_error_t AdvertisingDataBuilder::appendData( { uint8_t *field = findField(advDataType); - if (field == NULL) { + if (field == nullptr) { return BLE_ERROR_NOT_FOUND; } @@ -120,7 +120,7 @@ ble_error_t AdvertisingDataBuilder::removeData( { uint8_t *field = findField(advDataType); - if (field == NULL) { + if (field == nullptr) { return BLE_ERROR_NOT_FOUND; } @@ -134,7 +134,7 @@ ble_error_t AdvertisingDataBuilder::addOrReplaceData( { uint8_t *field = findField(advDataType); - if (field != NULL) { + if (field != nullptr) { return replaceField(advDataType, fieldData, field); } else { return addField(advDataType, fieldData); @@ -148,7 +148,7 @@ ble_error_t AdvertisingDataBuilder::addOrAppendData( { uint8_t *field = findField(advDataType); - if (field != NULL) { + if (field != nullptr) { return appendToField(fieldData, field); } else { return addField(advDataType, fieldData); @@ -339,7 +339,7 @@ uint8_t *AdvertisingDataBuilder::findField(adv_data_type_t type) idx += _buffer[idx] + 1; } - return NULL; + return nullptr; } uint8_t AdvertisingDataBuilder::getFieldSize(adv_data_type_t type) diff --git a/features/FEATURE_BLE/source/gap/AdvertisingParameters.cpp b/connectivity/FEATURE_BLE/source/gap/AdvertisingParameters.cpp similarity index 95% rename from features/FEATURE_BLE/source/gap/AdvertisingParameters.cpp rename to connectivity/FEATURE_BLE/source/gap/AdvertisingParameters.cpp index 907d6e2097..e229579738 100644 --- a/features/FEATURE_BLE/source/gap/AdvertisingParameters.cpp +++ b/connectivity/FEATURE_BLE/source/gap/AdvertisingParameters.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "ble/gap/AdvertisingParameters.h" +#include "gap/AdvertisingParameters.h" namespace ble { diff --git a/features/FEATURE_BLE/source/gap/ConnectionParameters.cpp b/connectivity/FEATURE_BLE/source/gap/ConnectionParameters.cpp similarity index 100% rename from features/FEATURE_BLE/source/gap/ConnectionParameters.cpp rename to connectivity/FEATURE_BLE/source/gap/ConnectionParameters.cpp diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp b/connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.cpp diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/CyH4TransportDriver.h b/connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.h similarity index 98% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/CyH4TransportDriver.h rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.h index ab6bde192b..e07b2c8a22 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/CyH4TransportDriver.h +++ b/connectivity/drivers/ble/COMPONENT_CYW43XXX/CyH4TransportDriver.h @@ -34,7 +34,7 @@ using namespace ble::vendor; /** * Implementation of the H4 driver over Cypress based chips. */ -class CyH4TransportDriver : public cordio::CordioHCITransportDriver { +class CyH4TransportDriver : public CordioHCITransportDriver { public: /** * Initialize the transport driver. diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/HCIDriver.cpp b/connectivity/drivers/ble/COMPONENT_CYW43XXX/HCIDriver.cpp similarity index 98% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/HCIDriver.cpp rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/HCIDriver.cpp index f9d6bd8094..a41a2a9616 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/HCIDriver.cpp +++ b/connectivity/drivers/ble/COMPONENT_CYW43XXX/HCIDriver.cpp @@ -16,7 +16,7 @@ */ #include -#include "CordioBLE.h" +#include "CordioBLEInstanceBase.h" #include "CordioHCIDriver.h" #include "hci_api.h" #include "hci_cmd.h" @@ -67,7 +67,7 @@ namespace ble { namespace vendor { namespace cypress { -class HCIDriver : public cordio::CordioHCIDriver { +class HCIDriver : public CordioHCIDriver { public: HCIDriver( ble::vendor::cypress_ble::CyH4TransportDriver& transport_driver, @@ -75,7 +75,7 @@ public: bool ps_enabled, uint8_t host_wake_irq, uint8_t dev_wake_irq - ) : cordio::CordioHCIDriver(transport_driver), + ) : CordioHCIDriver(transport_driver), bt_power_name(bt_power_name), bt_power(bt_power_name, PIN_OUTPUT, PullUp, 0), is_powersave_enabled(ps_enabled), @@ -89,10 +89,10 @@ public: cy_transport_driver(transport_driver) { } - virtual cordio::buf_pool_desc_t get_buffer_pool_description() + virtual buf_pool_desc_t get_buffer_pool_description() { // Use default buffer pool - return cordio::CordioHCIDriver::get_default_buffer_pool_description(); + return CordioHCIDriver::get_default_buffer_pool_description(); } virtual void do_initialize() @@ -541,7 +541,7 @@ private: } // namespace vendor } // namespace ble -ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() +ble::CordioHCIDriver& ble_cordio_get_hci_driver() { static ble::vendor::cypress_ble::CyH4TransportDriver& transport_driver = ble_cordio_get_h4_transport_driver(); diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp b/connectivity/drivers/ble/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp similarity index 99% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp index fea385d37c..0fd3db0b89 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp +++ b/connectivity/drivers/ble/COMPONENT_CYW43XXX/TARGET_PSOC6/cy_bt_cordio_cfg.cpp @@ -24,7 +24,7 @@ *******************************************************************************/ #include -#include "CordioBLE.h" +#include "CordioBLEInstanceBase.h" #include "CordioHCIDriver.h" #include "hci_api.h" #include "hci_cmd.h" diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/w_bt_firmware_controller.c b/connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/w_bt_firmware_controller.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/w_bt_firmware_controller.c rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_43012/w_bt_firmware_controller.c diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/w_bt_firmware_controller.c b/connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/w_bt_firmware_controller.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/w_bt_firmware_controller.c rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_43438/w_bt_firmware_controller.c diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/w_bt_firmware_controller.c b/connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/w_bt_firmware_controller.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/w_bt_firmware_controller.c rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/COMPONENT_4343W/w_bt_firmware_controller.c diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/w_bt_firmware_controller.c b/connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/w_bt_firmware_controller.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_Cypress/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/w_bt_firmware_controller.c rename to connectivity/drivers/ble/COMPONENT_CYW43XXX/firmware/TARGET_CYW9P62S1_43012EVB_01/w_bt_firmware_controller.c diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/Psoc6BLE.cpp b/connectivity/drivers/ble/TARGET_CY8C63XX/Psoc6BLE.cpp similarity index 93% rename from features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/Psoc6BLE.cpp rename to connectivity/drivers/ble/TARGET_CY8C63XX/Psoc6BLE.cpp index 57724d2960..c89bc5ad4e 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/Psoc6BLE.cpp +++ b/connectivity/drivers/ble/TARGET_CY8C63XX/Psoc6BLE.cpp @@ -47,7 +47,7 @@ private: BdAddress() : addr_type(0) {} }; - virtual cordio::buf_pool_desc_t get_buffer_pool_description(); + virtual buf_pool_desc_t get_buffer_pool_description(); /** * Initialize the chip. @@ -66,10 +66,10 @@ private: BdAddress bd_address; }; -cordio::buf_pool_desc_t Psoc6HCIDriver::get_buffer_pool_description() +buf_pool_desc_t Psoc6HCIDriver::get_buffer_pool_description() { // Use default buffer pool - return ble::vendor::cordio::CordioHCIDriver::get_default_buffer_pool_description(); + return ble::CordioHCIDriver::get_default_buffer_pool_description(); } diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp b/connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp similarity index 95% rename from features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp rename to connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp index eff25f0941..69aa032408 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp +++ b/connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.cpp @@ -46,7 +46,7 @@ void ipc_h4_receive(uint32_t *ptr) // printf("BLE received: "); // h4_dump_buffer(buffer->message.data, buffer->message.length); - cordio::CordioHCITransportDriver::on_data_received(message->data, message->data_length); + CordioHCITransportDriver::on_data_received(message->data, message->data_length); } IPCPipeTransportDriver::IPCPipeTransportDriver() diff --git a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h b/connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h similarity index 95% rename from features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h rename to connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h index 02f7fe69e0..6a60f8df49 100644 --- a/features/FEATURE_BLE/targets/TARGET_Cypress/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h +++ b/connectivity/drivers/ble/TARGET_CY8C63XX/drivers/IPCPipeTransportDriver.h @@ -34,7 +34,7 @@ using namespace ble::vendor; /** * Implementation of the H4 driver over PSoC6 IPC pipe. */ -class IPCPipeTransportDriver : public cordio::CordioHCITransportDriver { +class IPCPipeTransportDriver : public CordioHCITransportDriver { public: /** * Initialize the transport driver. diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_MCU_NRF52840/mbed_lib.json diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp similarity index 97% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp index 0aa9286269..61cc2c674c 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp +++ b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.cpp @@ -52,8 +52,7 @@ #define DBG_WARN(...) #endif -using namespace ble::vendor::nordic; -using namespace ble::vendor::cordio; +using namespace ble; /*! \brief Memory that should be reserved for the stack. */ #if defined(NRF52840_XXAA) @@ -200,7 +199,7 @@ const LlRtCfg_t NRFCordioHCIDriver::_ll_cfg = { extern "C" void TIMER0_IRQHandler(void); extern "C" void TIMER2_IRQHandler(void); -NRFCordioHCIDriver::NRFCordioHCIDriver(CordioHCITransportDriver& transport_driver) : cordio::CordioHCIDriver(transport_driver), _is_init(false), _stack_buffer(NULL) +NRFCordioHCIDriver::NRFCordioHCIDriver(CordioHCITransportDriver& transport_driver) : CordioHCIDriver(transport_driver), _is_init(false), _stack_buffer(NULL) { _stack_buffer = (uint8_t*)malloc(CORDIO_LL_MEMORY_FOOTPRINT); MBED_ASSERT(_stack_buffer != NULL); @@ -230,7 +229,7 @@ NRFCordioHCIDriver::~NRFCordioHCIDriver() MBED_ASSERT(_stack_buffer == NULL); } -ble::vendor::cordio::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_description() +ble::buf_pool_desc_t NRFCordioHCIDriver::get_buffer_pool_description() { static union { #if defined(NRF52840_XXAA) @@ -365,7 +364,7 @@ bool NRFCordioHCIDriver::get_random_static_address(ble::address_t& address) return true; } -ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() { +ble::CordioHCIDriver& ble_cordio_get_hci_driver() { static NRFCordioHCITransportDriver transport_driver; static NRFCordioHCIDriver hci_driver( diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h similarity index 85% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h index 0904d2bd22..4c14429c39 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h +++ b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCIDriver.h @@ -20,20 +20,17 @@ #include "CordioHCIDriver.h" namespace ble { -namespace vendor { -namespace nordic { - /** * Nordic port of CordioHCIDriver */ -class NRFCordioHCIDriver : public cordio::CordioHCIDriver { +class NRFCordioHCIDriver : public CordioHCIDriver { public: /** * Construct a new instance of an HCI driver. * @param transport_driver The driver used to communicate with the chip. */ - NRFCordioHCIDriver(cordio::CordioHCITransportDriver& transport_driver); + NRFCordioHCIDriver(CordioHCITransportDriver& transport_driver); /** * Driver destructor @@ -43,7 +40,7 @@ public: /** * Return the set of memory pool which will be used by the Cordio stack */ - virtual cordio::buf_pool_desc_t get_buffer_pool_description(); + virtual buf_pool_desc_t get_buffer_pool_description(); /** * Start the reset sequence of the BLE module. @@ -60,7 +57,7 @@ public: //virtual void handle_reset_sequence(uint8_t *msg); /** - * @copydoc cordio::CordioHCIDriver::get_random_static_address + * @copydoc CordioHCIDriver::get_random_static_address */ virtual bool get_random_static_address(ble::address_t& address); @@ -84,8 +81,6 @@ private: uint8_t* _stack_buffer; }; -} // namespace nordic -} // namespace vendor } // namespace ble #endif /* NRF_CORDIO_HCI_DRIVER_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp similarity index 89% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp index b367ada564..f4becdec25 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp +++ b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.cpp @@ -28,9 +28,9 @@ #include #include "NRFCordioHCITransportDriver.h" +#include "CordioHCITransportDriver.h" -using namespace ble::vendor::nordic; -using namespace ble::vendor::cordio; +using namespace ble; NRFCordioHCITransportDriver::~NRFCordioHCITransportDriver() { } @@ -60,8 +60,8 @@ extern "C" uint16_t ControllerToHostWrite(uint8_t prot, uint8_t hci_type, uint16 { WSF_ASSERT(prot == CHCI_TR_PROT_BLE); - CordioHCITransportDriver::on_data_received(&hci_type, 1); - CordioHCITransportDriver::on_data_received(pData, len); + ble::CordioHCITransportDriver::on_data_received(&hci_type, 1); + ble::CordioHCITransportDriver::on_data_received(pData, len); return len; } diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h similarity index 91% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h index 9352da0c47..0377037cdc 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h +++ b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/NRFCordioHCITransportDriver.h @@ -20,14 +20,12 @@ #include "CordioHCITransportDriver.h" namespace ble { -namespace vendor { -namespace nordic { /** * Nordic port of CordioHCITransportDriver */ -class NRFCordioHCITransportDriver : public cordio::CordioHCITransportDriver { +class NRFCordioHCITransportDriver : public CordioHCITransportDriver { public: /** * Driver destructor. @@ -59,9 +57,6 @@ public: virtual uint16_t write(uint8_t type, uint16_t len, uint8_t *pData); }; - -} // namespace nordic -} // namespace vendor } // namespace ble #endif /* NRF_CORDIO_HCI_TRANSPORT_DRIVER_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/README.md b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/README.md similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/README.md rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/README.md diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/mbed_lib.json diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb.c diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble.c diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble_rf.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble_rf.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble_rf.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_bb_ble_rf.c diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_cfg.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_cfg.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_cfg.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_cfg.c diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c similarity index 99% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c index c484ab4d06..dd012a505a 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c +++ b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_crypto.c @@ -388,7 +388,7 @@ static void palCryptoAuthPdu(uint8_t type, palCryptoCipherBlk_t *pBx, uint8_t *p { size_t len = (pldLen < (offset + 16)) ? (pldLen - offset) : 16; - /* X_i := ECB(K, X_(i-1) XOR B_(i-1) for i=3..n */ + /* X_i := ECB(K, X(i-1) XOR B(i-1) for i=3..n */ palCryptoEcb.w.clear[0] = 0; palCryptoEcb.w.clear[1] = 0; palCryptoEcb.w.clear[2] = 0; diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_timer.c b/connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_timer.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_timer.c rename to connectivity/drivers/ble/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_timer.c diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/HCIDriver.cpp b/connectivity/drivers/ble/TARGET_STM32WB/HCIDriver.cpp similarity index 98% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/HCIDriver.cpp rename to connectivity/drivers/ble/TARGET_STM32WB/HCIDriver.cpp index 487ab0fc17..97774c7f0c 100644 --- a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/HCIDriver.cpp +++ b/connectivity/drivers/ble/TARGET_STM32WB/HCIDriver.cpp @@ -17,8 +17,8 @@ */ #include -#include "ble/blecommon.h" -#include "CordioBLE.h" +#include "ble/types/blecommon.h" +#include "CordioBLEInstanceBase.h" #include "CordioHCIDriver.h" #include "CordioHCITransportDriver.h" #include "mbed.h" @@ -94,9 +94,9 @@ namespace stm32wb { /** * stm32wb HCI driver implementation - * @see cordio::CordioHCIDriver + * @see CordioHCIDriver */ -class HCIDriver : public cordio::CordioHCIDriver { +class HCIDriver : public CordioHCIDriver { public: /** * Construction of the HCIDriver. @@ -104,10 +104,10 @@ public: * @param rst: Name of the reset pin */ HCIDriver( - cordio::CordioHCITransportDriver &transport_driver - ) : cordio::CordioHCIDriver(transport_driver) { } + CordioHCITransportDriver &transport_driver + ) : CordioHCIDriver(transport_driver) { } - virtual cordio::buf_pool_desc_t get_buffer_pool_description(); + virtual buf_pool_desc_t get_buffer_pool_description(); /** * @see CordioHCIDriver::do_initialize */ @@ -449,15 +449,15 @@ private: } }; -ble::vendor::cordio::buf_pool_desc_t ble::vendor::stm32wb::HCIDriver::get_buffer_pool_description() +ble::buf_pool_desc_t ble::vendor::stm32wb::HCIDriver::get_buffer_pool_description() { // Use default buffer pool - return ble::vendor::cordio::CordioHCIDriver::get_default_buffer_pool_description(); + return ble::CordioHCIDriver::get_default_buffer_pool_description(); } -class TransportDriver : public cordio::CordioHCITransportDriver { +class TransportDriver : public CordioHCITransportDriver { public: TransportDriver(TL_CmdPacket_t *BleCmdBuffer, TL_CmdPacket_t *SystemCmdBuffer, uint8_t *EvtPool, uint8_t *SystemSpareEvtBuffer, uint8_t *BleSpareEvtBuffer, uint8_t *HciAclDataBuffer) { @@ -711,7 +711,7 @@ PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t BleSpareEvtBuffer[sizeof /** * Cordio HCI driver factory */ -ble::vendor::cordio::CordioHCIDriver &ble_cordio_get_hci_driver() +ble::CordioHCIDriver &ble_cordio_get_hci_driver() { static ble::vendor::stm32wb::TransportDriver transport_driver( &BleCmdBuffer, diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/mbox_def.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/mbox_def.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/mbox_def.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/mbox_def.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.c b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.c rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci.c diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci_tl.c b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci_tl.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci_tl.c rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci_tl.c diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci_tl.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci_tl.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/shci_tl.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/shci_tl.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm32_wpan_common.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm32_wpan_common.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm32_wpan_common.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm32_wpan_common.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm_list.c b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm_list.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm_list.c rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm_list.c diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm_list.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm_list.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/stm_list.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/stm_list.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/tl.h b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/tl.h similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/tl.h rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/tl.h diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/tl_mbox.c b/connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/tl_mbox.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/tl_mbox.c rename to connectivity/drivers/ble/TARGET_STM32WB/STM32Cube_FW/tl_mbox.c diff --git a/features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/hw_ipcc.c b/connectivity/drivers/ble/TARGET_STM32WB/hw_ipcc.c similarity index 100% rename from features/FEATURE_BLE/targets/TARGET_STM/TARGET_STM32WB/hw_ipcc.c rename to connectivity/drivers/ble/TARGET_STM32WB/hw_ipcc.c diff --git a/features/FEATURE_BLE/CHANGELOG.md b/features/FEATURE_BLE/CHANGELOG.md deleted file mode 100644 index 03a73ff954..0000000000 --- a/features/FEATURE_BLE/CHANGELOG.md +++ /dev/null @@ -1,393 +0,0 @@ -# Change Log - -## [v2.5.2](https://github.com/ARMmbed/ble/tree/v2.5.2) (2016-03-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.5.1...v2.5.2) - -**Closed issues:** - -- Infinite busy [\#69](https://github.com/ARMmbed/ble/issues/69) - -## [v2.5.1](https://github.com/ARMmbed/ble/tree/v2.5.1) (2016-01-27) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.5.0...v2.5.1) - -**Closed issues:** - -- Gap state is not updated when the advertising stop after the timeout [\#80](https://github.com/ARMmbed/ble/issues/80) -- crash on memory allocation [\#26](https://github.com/ARMmbed/ble/issues/26) - -**Merged pull requests:** - -- Change onShutdown\(obj, func\) definition [\#174](https://github.com/ARMmbed/ble/pull/174) ([andresag01](https://github.com/andresag01)) -- Invalid adv payloads are not committed before checking [\#171](https://github.com/ARMmbed/ble/pull/171) ([andresag01](https://github.com/andresag01)) -- Update Gap state in startAdvertising\(\) [\#170](https://github.com/ARMmbed/ble/pull/170) ([andresag01](https://github.com/andresag01)) -- Improve doxygen documentation: [\#169](https://github.com/ARMmbed/ble/pull/169) ([pan-](https://github.com/pan-)) -- Update Gap state after advertising times out [\#168](https://github.com/ARMmbed/ble/pull/168) ([andresag01](https://github.com/andresag01)) -- merge version 2.5.0 into master [\#163](https://github.com/ARMmbed/ble/pull/163) ([pan-](https://github.com/pan-)) -- Fix doxygen warnings for BLE API [\#162](https://github.com/ARMmbed/ble/pull/162) ([andresag01](https://github.com/andresag01)) - -## [v2.5.0](https://github.com/ARMmbed/ble/tree/v2.5.0) (2016-01-12) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.4.0...v2.5.0) - -**Merged pull requests:** - -- merge branch develop \(v2.4.0\) [\#161](https://github.com/ARMmbed/ble/pull/161) ([pan-](https://github.com/pan-)) -- Add API to get addresses of peers in bond table [\#160](https://github.com/ARMmbed/ble/pull/160) ([andresag01](https://github.com/andresag01)) - -## [v2.4.0](https://github.com/ARMmbed/ble/tree/v2.4.0) (2016-01-07) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.3.0...v2.4.0) - -**Merged pull requests:** - -- Whitelisting experimental API [\#159](https://github.com/ARMmbed/ble/pull/159) ([andresag01](https://github.com/andresag01)) - -## [v2.3.0](https://github.com/ARMmbed/ble/tree/v2.3.0) (2015-12-23) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.2.3...v2.3.0) - -**Merged pull requests:** - -- Characteristic descriptor discovery [\#105](https://github.com/ARMmbed/ble/pull/105) ([pan-](https://github.com/pan-)) - -## [v2.2.3](https://github.com/ARMmbed/ble/tree/v2.2.3) (2015-12-23) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.2.2...v2.2.3) - -**Closed issues:** - -- Two different enum list of BLE appearances [\#136](https://github.com/ARMmbed/ble/issues/136) -- Gap::updateAdvertisingPayload should work for different length of data [\#84](https://github.com/ARMmbed/ble/issues/84) - -**Merged pull requests:** - -- Hotfix for backward compatibility [\#158](https://github.com/ARMmbed/ble/pull/158) ([LiyouZhou](https://github.com/LiyouZhou)) -- Clean up code in DiscoveredCharacteristic.cpp [\#154](https://github.com/ARMmbed/ble/pull/154) ([andresag01](https://github.com/andresag01)) -- Modify functions that manipulate adv payload [\#153](https://github.com/ARMmbed/ble/pull/153) ([andresag01](https://github.com/andresag01)) - -## [v2.2.2](https://github.com/ARMmbed/ble/tree/v2.2.2) (2015-12-21) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.2.1...v2.2.2) - -**Merged pull requests:** - -- Add BLE\_ERROR\_INTERNAL\_STACK\_FAILURE error code [\#155](https://github.com/ARMmbed/ble/pull/155) ([andresag01](https://github.com/andresag01)) - -## [v2.2.1](https://github.com/ARMmbed/ble/tree/v2.2.1) (2015-12-18) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.2.0...v2.2.1) - -**Merged pull requests:** - -- Remove deprecated appearance enum from blecommon.h [\#150](https://github.com/ARMmbed/ble/pull/150) ([andresag01](https://github.com/andresag01)) - -## [v2.2.0](https://github.com/ARMmbed/ble/tree/v2.2.0) (2015-12-17) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.16...v2.2.0) - -**Merged pull requests:** - -- Add onShutdown to register callbacks [\#146](https://github.com/ARMmbed/ble/pull/146) ([andresag01](https://github.com/andresag01)) -- transparenly support existing applications which may have used Gap::ADDR\_TYPE\_\* [\#145](https://github.com/ARMmbed/ble/pull/145) ([rgrover](https://github.com/rgrover)) - -## [v2.1.16](https://github.com/ARMmbed/ble/tree/v2.1.16) (2015-12-16) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.15...v2.1.16) - -**Merged pull requests:** - -- Improve API to facilitate full shutdown procedure [\#141](https://github.com/ARMmbed/ble/pull/141) ([andresag01](https://github.com/andresag01)) - -## [v2.1.15](https://github.com/ARMmbed/ble/tree/v2.1.15) (2015-12-15) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.14...v2.1.15) - -**Merged pull requests:** - -- Extract Adress related types from Gap.h into BLEProtocol.h [\#142](https://github.com/ARMmbed/ble/pull/142) ([rgrover](https://github.com/rgrover)) - -## [v2.1.14](https://github.com/ARMmbed/ble/tree/v2.1.14) (2015-12-11) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.13...v2.1.14) - -## [v2.1.13](https://github.com/ARMmbed/ble/tree/v2.1.13) (2015-12-11) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.11...v2.1.13) - -**Merged pull requests:** - -- Added SecurityManager::setLinkSecurity call for elevating security settings on a particular connection. [\#140](https://github.com/ARMmbed/ble/pull/140) ([marcuschangarm](https://github.com/marcuschangarm)) - -## [v2.1.11](https://github.com/ARMmbed/ble/tree/v2.1.11) (2015-12-10) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.10...v2.1.11) - -## [v2.1.10](https://github.com/ARMmbed/ble/tree/v2.1.10) (2015-12-07) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.9...v2.1.10) - -**Merged pull requests:** - -- WIP: UUID endian change [\#128](https://github.com/ARMmbed/ble/pull/128) ([marcuschangarm](https://github.com/marcuschangarm)) - -## [v2.1.9](https://github.com/ARMmbed/ble/tree/v2.1.9) (2015-12-04) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.8...v2.1.9) - -**Merged pull requests:** - -- Fix documentation for advertising interval getters [\#134](https://github.com/ARMmbed/ble/pull/134) ([andresag01](https://github.com/andresag01)) -- I change the service description [\#132](https://github.com/ARMmbed/ble/pull/132) ([iriark01](https://github.com/iriark01)) -- Add a doxyfile that warns for undocumented elements [\#131](https://github.com/ARMmbed/ble/pull/131) ([bremoran](https://github.com/bremoran)) - -## [v2.1.8](https://github.com/ARMmbed/ble/tree/v2.1.8) (2015-12-03) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.7...v2.1.8) - -**Merged pull requests:** - -- Edit [\#130](https://github.com/ARMmbed/ble/pull/130) ([iriark01](https://github.com/iriark01)) -- Edit [\#129](https://github.com/ARMmbed/ble/pull/129) ([iriark01](https://github.com/iriark01)) - -## [v2.1.7](https://github.com/ARMmbed/ble/tree/v2.1.7) (2015-12-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.6...v2.1.7) - -## [v2.1.6](https://github.com/ARMmbed/ble/tree/v2.1.6) (2015-12-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.5...v2.1.6) - -**Closed issues:** - -- Terrible handling of initLen / minLen and variable length characteristics. [\#93](https://github.com/ARMmbed/ble/issues/93) - -**Merged pull requests:** - -- Allow GattAttributes to have variable length [\#127](https://github.com/ARMmbed/ble/pull/127) ([andresag01](https://github.com/andresag01)) - -## [v2.1.5](https://github.com/ARMmbed/ble/tree/v2.1.5) (2015-12-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.4...v2.1.5) - -**Merged pull requests:** - -- Edit [\#126](https://github.com/ARMmbed/ble/pull/126) ([iriark01](https://github.com/iriark01)) -- Edit [\#125](https://github.com/ARMmbed/ble/pull/125) ([iriark01](https://github.com/iriark01)) -- Edit [\#124](https://github.com/ARMmbed/ble/pull/124) ([iriark01](https://github.com/iriark01)) -- Edit [\#123](https://github.com/ARMmbed/ble/pull/123) ([iriark01](https://github.com/iriark01)) -- Separate the concept of minlen and len in GattAttr [\#122](https://github.com/ARMmbed/ble/pull/122) ([andresag01](https://github.com/andresag01)) -- Doxygen fixes [\#120](https://github.com/ARMmbed/ble/pull/120) ([metc](https://github.com/metc)) -- Minor edits [\#114](https://github.com/ARMmbed/ble/pull/114) ([iriark01](https://github.com/iriark01)) - -## [v2.1.4](https://github.com/ARMmbed/ble/tree/v2.1.4) (2015-11-26) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.3...v2.1.4) - -**Merged pull requests:** - -- Guard nordic specific implementation with \#ifdef TARGET\_NRF51822 [\#119](https://github.com/ARMmbed/ble/pull/119) ([LiyouZhou](https://github.com/LiyouZhou)) - -## [v2.1.3](https://github.com/ARMmbed/ble/tree/v2.1.3) (2015-11-26) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.2...v2.1.3) - -**Merged pull requests:** - -- Call bootloader\_start implicitly trough a event handler call [\#118](https://github.com/ARMmbed/ble/pull/118) ([LiyouZhou](https://github.com/LiyouZhou)) - -## [v2.1.2](https://github.com/ARMmbed/ble/tree/v2.1.2) (2015-11-26) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.1...v2.1.2) - -**Merged pull requests:** - -- Reintroduce old Eddystone with deprecated warnings [\#117](https://github.com/ARMmbed/ble/pull/117) ([andresag01](https://github.com/andresag01)) - -## [v2.1.1](https://github.com/ARMmbed/ble/tree/v2.1.1) (2015-11-26) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.1.0...v2.1.1) - -## [v2.1.0](https://github.com/ARMmbed/ble/tree/v2.1.0) (2015-11-26) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.5...v2.1.0) - -**Closed issues:** - -- All BLE event handling should happen in thread mode [\#89](https://github.com/ARMmbed/ble/issues/89) - -**Merged pull requests:** - -- First Doxygen output [\#116](https://github.com/ARMmbed/ble/pull/116) ([metc](https://github.com/metc)) -- Minor doc changes [\#113](https://github.com/ARMmbed/ble/pull/113) ([metc](https://github.com/metc)) -- Minor edits [\#112](https://github.com/ARMmbed/ble/pull/112) ([iriark01](https://github.com/iriark01)) -- Minor edits [\#111](https://github.com/ARMmbed/ble/pull/111) ([iriark01](https://github.com/iriark01)) -- Minor edits [\#110](https://github.com/ARMmbed/ble/pull/110) ([iriark01](https://github.com/iriark01)) -- Remove persistant callbacks [\#109](https://github.com/ARMmbed/ble/pull/109) ([pan-](https://github.com/pan-)) -- Changed GapAdvertisingData.addData to take current fields into account when adding data. [\#108](https://github.com/ARMmbed/ble/pull/108) ([marcuschangarm](https://github.com/marcuschangarm)) -- Remove Eddystone implementation in ble/services [\#107](https://github.com/ARMmbed/ble/pull/107) ([andresag01](https://github.com/andresag01)) - -## [v2.0.5](https://github.com/ARMmbed/ble/tree/v2.0.5) (2015-11-16) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.4...v2.0.5) - -**Merged pull requests:** - -- Edits - with a couple of comments [\#104](https://github.com/ARMmbed/ble/pull/104) ([iriark01](https://github.com/iriark01)) - -## [v2.0.4](https://github.com/ARMmbed/ble/tree/v2.0.4) (2015-11-13) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.3...v2.0.4) - -**Merged pull requests:** - -- Edits [\#102](https://github.com/ARMmbed/ble/pull/102) ([iriark01](https://github.com/iriark01)) - -## [v2.0.3](https://github.com/ARMmbed/ble/tree/v2.0.3) (2015-11-03) -[Full Changelog](https://github.com/ARMmbed/ble/compare/mbedos-release-15-11...v2.0.3) - -## [mbedos-release-15-11](https://github.com/ARMmbed/ble/tree/mbedos-release-15-11) (2015-11-03) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.2...mbedos-release-15-11) - -## [v2.0.2](https://github.com/ARMmbed/ble/tree/v2.0.2) (2015-11-03) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.1...v2.0.2) - -**Merged pull requests:** - -- BLE::init\(\) should also be able to take an \ tuple for its callback [\#97](https://github.com/ARMmbed/ble/pull/97) ([rgrover](https://github.com/rgrover)) - -## [v2.0.1](https://github.com/ARMmbed/ble/tree/v2.0.1) (2015-11-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v2.0.0...v2.0.1) - -**Merged pull requests:** - -- Fix beaconPeriod and defaults for voltage/temp [\#94](https://github.com/ARMmbed/ble/pull/94) ([andresag01](https://github.com/andresag01)) - -## [v2.0.0](https://github.com/ARMmbed/ble/tree/v2.0.0) (2015-11-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/mbedos-techcon-oob2...v2.0.0) - -**Closed issues:** - -- BLE::init\(\) should be non-blocking [\#90](https://github.com/ARMmbed/ble/issues/90) -- Wrong include file in HealthTermometerService.h:20:17 [\#86](https://github.com/ARMmbed/ble/issues/86) -- Return error on write request when locked [\#19](https://github.com/ARMmbed/ble/issues/19) - -**Merged pull requests:** - -- Introduced fixes to Eddystone implementation [\#92](https://github.com/ARMmbed/ble/pull/92) ([andresag01](https://github.com/andresag01)) -- BLE::init\(\) now takes in a callback paramter [\#91](https://github.com/ARMmbed/ble/pull/91) ([rgrover](https://github.com/rgrover)) -- Fixed include problem in HealthThermometer header [\#87](https://github.com/ARMmbed/ble/pull/87) ([andresag01](https://github.com/andresag01)) -- use the github url public url in module.json [\#82](https://github.com/ARMmbed/ble/pull/82) ([jrobeson](https://github.com/jrobeson)) -- Reduce the memory consumed by FunctionPointerWithContext instances [\#81](https://github.com/ARMmbed/ble/pull/81) ([pan-](https://github.com/pan-)) -- Introduced fix for defect IOTSFW-1058 [\#79](https://github.com/ARMmbed/ble/pull/79) ([andresag01](https://github.com/andresag01)) - -## [mbedos-techcon-oob2](https://github.com/ARMmbed/ble/tree/mbedos-techcon-oob2) (2015-10-19) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v1.0.0...mbedos-techcon-oob2) - -## [v1.0.0](https://github.com/ARMmbed/ble/tree/v1.0.0) (2015-10-19) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.8...v1.0.0) - -**Closed issues:** - -- add support for Eddystone [\#57](https://github.com/ARMmbed/ble/issues/57) - -**Merged pull requests:** - -- Add st-ble-shield as a possible target dependency. [\#76](https://github.com/ARMmbed/ble/pull/76) ([pan-](https://github.com/pan-)) -- Support for Environmental Service \(temperature, pressure and humidity\) [\#75](https://github.com/ARMmbed/ble/pull/75) ([crespum](https://github.com/crespum)) - -## [v0.4.8](https://github.com/ARMmbed/ble/tree/v0.4.8) (2015-09-29) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.7...v0.4.8) - -**Closed issues:** - -- ERROR: undefined reference to `createBLEInstance\(\)' [\#68](https://github.com/ARMmbed/ble/issues/68) - -**Merged pull requests:** - -- Adding Eddystone Support [\#74](https://github.com/ARMmbed/ble/pull/74) ([BlackstoneEngineering](https://github.com/BlackstoneEngineering)) -- Changed onConnection and onDisconnection to accept object/methods and… [\#72](https://github.com/ARMmbed/ble/pull/72) ([marcuschangarm](https://github.com/marcuschangarm)) -- adding an initial prototype for a yotta-config based initialization f… [\#71](https://github.com/ARMmbed/ble/pull/71) ([rgrover](https://github.com/rgrover)) -- Gap.h - Added onConnection callback chain simarly to the currently pr… [\#70](https://github.com/ARMmbed/ble/pull/70) ([marcuschangarm](https://github.com/marcuschangarm)) - -## [v0.4.7](https://github.com/ARMmbed/ble/tree/v0.4.7) (2015-08-13) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.6...v0.4.7) - -## [v0.4.6](https://github.com/ARMmbed/ble/tree/v0.4.6) (2015-08-11) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.5...v0.4.6) - -**Merged pull requests:** - -- Eddystone Service Working [\#66](https://github.com/ARMmbed/ble/pull/66) ([BlackstoneEngineering](https://github.com/BlackstoneEngineering)) - -## [v0.4.5](https://github.com/ARMmbed/ble/tree/v0.4.5) (2015-08-10) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.4...v0.4.5) - -## [v0.4.4](https://github.com/ARMmbed/ble/tree/v0.4.4) (2015-08-07) -[Full Changelog](https://github.com/ARMmbed/ble/compare/v0.4.3...v0.4.4) - -**Closed issues:** - -- GapAdvertisingData::getPayload\(\) should not return NULL if payloadLen == 0 [\#64](https://github.com/ARMmbed/ble/issues/64) -- enableActiveScanning\(\) [\#60](https://github.com/ARMmbed/ble/issues/60) -- add central role for s130 [\#58](https://github.com/ARMmbed/ble/issues/58) -- Clash With Definition and Enum Naming [\#46](https://github.com/ARMmbed/ble/issues/46) -- URIBeacon2Service Needs initial AdvertisedTxPowerLevels [\#17](https://github.com/ARMmbed/ble/issues/17) - -**Merged pull requests:** - -- Conversion from advertisement duration units to ms moved from Gap to … [\#63](https://github.com/ARMmbed/ble/pull/63) ([jslater8](https://github.com/jslater8)) -- Add a new function updateAdvertisingPayload\(\) [\#61](https://github.com/ARMmbed/ble/pull/61) ([sunsmilearm](https://github.com/sunsmilearm)) -- minor corrections to the comments [\#59](https://github.com/ARMmbed/ble/pull/59) ([ddavidebor](https://github.com/ddavidebor)) - -## [v0.4.3](https://github.com/ARMmbed/ble/tree/v0.4.3) (2015-07-22) -[Full Changelog](https://github.com/ARMmbed/ble/compare/0.4.1...v0.4.3) - -**Closed issues:** - -- add GattClient::onHVX [\#53](https://github.com/ARMmbed/ble/issues/53) -- Need some help regarding the development of BLE network simulator [\#52](https://github.com/ARMmbed/ble/issues/52) - -**Merged pull requests:** - -- expose descriptors optional arg in derived GattChar. constructors [\#56](https://github.com/ARMmbed/ble/pull/56) ([OJFord](https://github.com/OJFord)) -- Change DiscoveredCharacteristic API to return long or short UUIDs. [\#55](https://github.com/ARMmbed/ble/pull/55) ([adfernandes](https://github.com/adfernandes)) -- Refactor using new include paths [\#51](https://github.com/ARMmbed/ble/pull/51) ([rosterloh](https://github.com/rosterloh)) -- Revert "use mbed-classic as mbed dependency" [\#50](https://github.com/ARMmbed/ble/pull/50) ([rgrover](https://github.com/rgrover)) -- use mbed-classic as mbed dependency [\#45](https://github.com/ARMmbed/ble/pull/45) ([autopulated](https://github.com/autopulated)) - -## [0.4.1](https://github.com/ARMmbed/ble/tree/0.4.1) (2015-07-02) -[Full Changelog](https://github.com/ARMmbed/ble/compare/workingOldBootloader...0.4.1) - -**Closed issues:** - -- DiscoveredCharacteristic::setupOnDataRead\(\) should be GattClient::onDataRead\(\) instead [\#49](https://github.com/ARMmbed/ble/issues/49) -- CONNECTION\_TIMEOUT should be added to DisconnectionReason\_t [\#43](https://github.com/ARMmbed/ble/issues/43) -- Typo in definition of UNIT\_0\_625\_MS in Gap.h [\#40](https://github.com/ARMmbed/ble/issues/40) -- Initial value for \_requiredSecurity member of GattCharacteristic class breaks existing code [\#39](https://github.com/ARMmbed/ble/issues/39) -- Allow adding a User Description descriptor to a GattCharacteristic. [\#38](https://github.com/ARMmbed/ble/issues/38) -- The example code in GattAttribute.h does not refer to GattAttribute [\#37](https://github.com/ARMmbed/ble/issues/37) -- BLEDevice::clearAdvertisingPayload doesn't clear the scan response PDU [\#36](https://github.com/ARMmbed/ble/issues/36) - -**Merged pull requests:** - -- Added get/set methods for advertisement payload and parameters. [\#42](https://github.com/ARMmbed/ble/pull/42) ([marcuschangarm](https://github.com/marcuschangarm)) - -## [workingOldBootloader](https://github.com/ARMmbed/ble/tree/workingOldBootloader) (2015-03-02) -**Implemented enhancements:** - -- Which are the allowed values for txPower? \> BLEDevice::setTxPower\(int8\_t txPower\) [\#30](https://github.com/ARMmbed/ble/issues/30) -- Modes: UriBeacon and UriBeaconConfig [\#15](https://github.com/ARMmbed/ble/issues/15) -- URIBeacon2Service.h should be called UriBeaconConfigService.h [\#11](https://github.com/ARMmbed/ble/issues/11) -- Lock and Unlock missing from URIBeacon2Service.h [\#10](https://github.com/ARMmbed/ble/issues/10) -- Service Characteristics [\#9](https://github.com/ARMmbed/ble/issues/9) -- URIBeacon2Service.h missing TX Power Mode [\#8](https://github.com/ARMmbed/ble/issues/8) - -**Fixed bugs:** - -- URIBeacon2Service configure\(\) [\#14](https://github.com/ARMmbed/ble/issues/14) -- URIBeacon2Service.h does not reset to defaults [\#7](https://github.com/ARMmbed/ble/issues/7) -- Uri Data Length and semantics [\#6](https://github.com/ARMmbed/ble/issues/6) - -**Closed issues:** - -- Inconsistent use of uint\_16\_t and Handle\_t [\#34](https://github.com/ARMmbed/ble/issues/34) -- Incorrect documentation on void setAdvertisingType\(\)? [\#29](https://github.com/ARMmbed/ble/issues/29) -- URIBeacon2Service setTxPowerLevel should follow specification [\#16](https://github.com/ARMmbed/ble/issues/16) -- URIBeacon2Service does not advertise UriBeacon [\#13](https://github.com/ARMmbed/ble/issues/13) -- Roadmap [\#3](https://github.com/ARMmbed/ble/issues/3) -- nRF51822 advertising interval problem [\#2](https://github.com/ARMmbed/ble/issues/2) -- nRF51822 low-power operation [\#1](https://github.com/ARMmbed/ble/issues/1) - -**Merged pull requests:** - -- Added callback on characteristic reads [\#33](https://github.com/ARMmbed/ble/pull/33) ([jeremybrodt](https://github.com/jeremybrodt)) -- Updated UUID class to get length and pointer. Added UUID comparison. [\#32](https://github.com/ARMmbed/ble/pull/32) ([jeremybrodt](https://github.com/jeremybrodt)) -- Extended attribute length handling to support dynamic length. [\#31](https://github.com/ARMmbed/ble/pull/31) ([jeremybrodt](https://github.com/jeremybrodt)) -- added API for creating iBeacons [\#28](https://github.com/ARMmbed/ble/pull/28) ([BlackstoneEngineering](https://github.com/BlackstoneEngineering)) -- Uribeacon update [\#25](https://github.com/ARMmbed/ble/pull/25) ([schilit](https://github.com/schilit)) -- Fix README links [\#23](https://github.com/ARMmbed/ble/pull/23) ([shirishb](https://github.com/shirishb)) -- Added optional data and length fields to the return struct for authorize... [\#22](https://github.com/ARMmbed/ble/pull/22) ([marcuschangarm](https://github.com/marcuschangarm)) -- Chained callbacks for onDataSent [\#21](https://github.com/ARMmbed/ble/pull/21) ([marcuschangarm](https://github.com/marcuschangarm)) -- Updated Readme [\#20](https://github.com/ARMmbed/ble/pull/20) ([BlackstoneEngineering](https://github.com/BlackstoneEngineering)) -- Add getHandle for readability [\#18](https://github.com/ARMmbed/ble/pull/18) ([schilit](https://github.com/schilit)) -- make the library less dependent on the mbed.h header [\#5](https://github.com/ARMmbed/ble/pull/5) ([xiongyihui](https://github.com/xiongyihui)) -- adding initial readme with references to developer.mbed.org [\#4](https://github.com/ARMmbed/ble/pull/4) ([BlackstoneEngineering](https://github.com/BlackstoneEngineering)) - - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/features/FEATURE_BLE/CONTRIBUTING.md b/features/FEATURE_BLE/CONTRIBUTING.md deleted file mode 100644 index 6ddc4304e4..0000000000 --- a/features/FEATURE_BLE/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Hello! -We are an open source project of [ARM mbed](https://www.mbed.com). Contributions via [pull request](https://github.com/ARMmbed/ble/pulls), and [bug reports](https://github.com/ARMmbed/ble/issues) are welcome! - -Please submit your pull request to the `develop` branch of [this module](https://github.com/ARMmbed/ble/tree/develop). Commits to develop will be merge into the master branch at the time of the next release. - -# Contributor agreement -For your pull request to be accepted, we will need you to agree to our [contributor agreement](https://developer.mbed.org/contributor_agreement/) to give us the necessary rights to use and distribute your contributions. (To click through the agreement create an account on mbed.com and log in.) diff --git a/features/FEATURE_BLE/ble/common/StaticInterface.h b/features/FEATURE_BLE/ble/common/StaticInterface.h deleted file mode 100644 index d71616d764..0000000000 --- a/features/FEATURE_BLE/ble/common/StaticInterface.h +++ /dev/null @@ -1,55 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef BLE_COMMON_STATICINTERFACE_H -#define BLE_COMMON_STATICINTERFACE_H - -namespace ble { - -/** - * Static Interface helper class. - * - * @tparam Impl Implementation class. - * @tparam Interface Interface template - */ -template class Interface> -struct StaticInterface -{ - /** - * @return A pointer to the implementation class. - */ - Impl* impl() - { - return static_cast(this); - } - - /** - * @return A pointer to the implementation class. - */ - const Impl* impl() const - { - return static_cast(this); - } - -private: - StaticInterface() {} - friend Interface; -}; - -} // namespace ble - -#endif //BLE_COMMON_STATICINTERFACE_H diff --git a/features/FEATURE_BLE/ble/generic/GenericGap.h b/features/FEATURE_BLE/ble/generic/GenericGap.h deleted file mode 100644 index bda5dd2020..0000000000 --- a/features/FEATURE_BLE/ble/generic/GenericGap.h +++ /dev/null @@ -1,669 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBED_BLE_GENERIC_GAP -#define MBED_BLE_GENERIC_GAP - -#include - -#include "ble/Gap.h" -#include "ble/pal/PalGap.h" -#include "ble/pal/GapEvents.h" -#include "ble/pal/GapTypes.h" -#include "ble/BLETypes.h" -#include "ble/pal/GenericAccessService.h" -#include "ble/pal/EventQueue.h" -#include "ble/pal/ConnectionEventMonitor.h" - -#include "drivers/LowPowerTimeout.h" -#include "drivers/LowPowerTicker.h" -#include "platform/mbed_error.h" - -namespace ble { -namespace generic { -/** - * Generic implementation of the Gap class. - * It requires a pal::Gap and a pal::GenericAccessService injected at - * construction site. - * - * @attention: Not part of the public interface of BLE API. - */ -template< - template class TPalGap, - class PalSecurityManager, - class ConnectionEventMonitorEventHandler -> -class GenericGap : - public interface::Gap< - GenericGap - >, - public pal::ConnectionEventMonitor< - ConnectionEventMonitorEventHandler - >, - public pal::GapEventHandler< - GenericGap - > -{ - // Typedef of base and companion classes . - typedef ::ble::interface::Gap Gap; - typedef pal::ConnectionEventMonitor ConnectionEventMonitor; - typedef TPalGap PalGap; - typedef pal::GapEventHandler PalGapEventHandler; - - // Friendship with base classes - friend Gap; - friend ConnectionEventMonitor; - friend pal::GapEventHandler; - friend PalGap; - - // Imports from LegacyGap - using Gap::_eventHandler; - using Gap::default_peripheral_privacy_configuration; - using Gap::default_central_privacy_configuration; - - typedef typename ble::whitelist_t whitelist_t; - typedef typename Gap::PreferredConnectionParams_t PreferredConnectionParams_t; - - // Imports from Gap -#if BLE_ROLE_BROADCASTER - using ble::interface::Gap::getMaxAdvertisingSetNumber; - using ble::interface::Gap::getMaxAdvertisingDataLength; -#endif // BLE_ROLE_BROADCASTER - using ble::interface::Gap::isFeatureSupported; - - // Imports from PalGap EventHandler - using PalGapEventHandler::on_scan_timeout; - - // Imports from ConnectionEventMonitor - using ConnectionEventMonitor::_connection_event_handler; - using ConnectionEventMonitor::set_connection_event_handler; - -public: - /* TODO: move to config */ - static const uint8_t MAX_ADVERTISING_SETS = 15; - - /** - * Construct a GenericGap. - * - * @param event_queue Event queue used to serialise execution. - * - * @param pal_gap GAP Platform abstraction instance containing the base GAP - * primitives. - * - * @param generic_access_service Platform abstraction instance managing - * the GATT generic access service. - * - * @param pal_sm Security Manager Platform abstraction instance containing the base - * Security Manager primitives. - */ - GenericGap( - pal::EventQueue &event_queue, - PalGap &pal_gap, - pal::GenericAccessService &generic_access_service, - PalSecurityManager &pal_sm - ); - - /** - * @see Gap::~Gap - */ - ~GenericGap(); - - /** @copydoc Gap::IsFeatureSupported - */ - bool isFeatureSupported_( - controller_supported_features_t feature - ); - - /** @copydoc Gap::getMaxAdvertisingSetNumber - */ - uint8_t getMaxAdvertisingSetNumber_(); - - /** @copydoc Gap::getMaxAdvertisingDataLength - */ - uint16_t getMaxAdvertisingDataLength_(); - - /** @copydoc Gap::getMaxConnectableAdvertisingDataLength - */ - uint16_t getMaxConnectableAdvertisingDataLength_(); - - /** @copydoc Gap::getMaxActiveSetAdvertisingDataLength - */ - uint16_t getMaxActiveSetAdvertisingDataLength_(); - - /** @copydoc Gap::createAdvertisingSet - */ - ble_error_t createAdvertisingSet_( - advertising_handle_t *handle, - const AdvertisingParameters ¶meters - ); - - /** @copydoc Gap::destroyAdvertisingSet - */ - ble_error_t destroyAdvertisingSet_(advertising_handle_t handle); - - /** @copydoc Gap::setAdvertisingParams - */ - ble_error_t setAdvertisingParameters_( - advertising_handle_t handle, - const AdvertisingParameters ¶ms - ); - - /** @copydoc Gap::setAdvertisingPayload - */ - ble_error_t setAdvertisingPayload_( - advertising_handle_t handle, - Span payload - ); - - /** @copydoc Gap::setAdvertisingScanResponse - */ - ble_error_t setAdvertisingScanResponse_( - advertising_handle_t handle, - Span response - ); - - /** @copydoc Gap::startAdvertising - */ - ble_error_t startAdvertising_( - advertising_handle_t handle, - adv_duration_t maxDuration, - uint8_t maxEvents - ); - - /** @copydoc Gap::stopAdvertising - */ - ble_error_t stopAdvertising_(advertising_handle_t handle); - - /** @copydoc Gap::isAdvertisingActive - */ - bool isAdvertisingActive_(advertising_handle_t handle); - - /** @copydoc Gap::setPeriodicAdvertisingParameters - */ - ble_error_t setPeriodicAdvertisingParameters_( - advertising_handle_t handle, - periodic_interval_t periodicAdvertisingIntervalMin, - periodic_interval_t periodicAdvertisingIntervalMax, - bool advertiseTxPower - ); - - /** @copydoc Gap::setPeriodicAdvertisingPayload - */ - ble_error_t setPeriodicAdvertisingPayload_( - advertising_handle_t handle, - Span payload - ); - - /** @copydoc Gap::startPeriodicAdvertising - */ - ble_error_t startPeriodicAdvertising_(advertising_handle_t handle); - - /** @copydoc Gap::stopPeriodicAdvertising - */ - ble_error_t stopPeriodicAdvertising_(advertising_handle_t handle); - - /** @copydoc Gap::isPeriodicAdvertisingActive - */ - bool isPeriodicAdvertisingActive_(advertising_handle_t handle); - - /** @copydoc Gap::setScanParameters - */ - ble_error_t setScanParameters_(const ScanParameters ¶ms); - - /** @copydoc Gap::startScan - */ - ble_error_t startScan_( - scan_duration_t duration, - duplicates_filter_t filtering, - scan_period_t period - ); - - /** @copydoc Gap::createSync - */ - ble_error_t createSync_( - peer_address_type_t peerAddressType, - const ble::address_t &peerAddress, - advertising_sid_t sid, - slave_latency_t maxPacketSkip, - sync_timeout_t timeout - ); - - /** @copydoc Gap::createSync - */ - ble_error_t createSync_( - slave_latency_t maxPacketSkip, - sync_timeout_t timeout - ); - - /** @copydoc Gap::cancelCreateSync - */ - ble_error_t cancelCreateSync_(); - - /** @copydoc Gap::terminateSync - */ - ble_error_t terminateSync_(periodic_sync_handle_t handle); - - /** @copydoc Gap::addDeviceToPeriodicAdvertiserList - */ - ble_error_t addDeviceToPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const ble::address_t &peerAddress, - advertising_sid_t sid - ); - - /** @copydoc Gap::removeDeviceFromPeriodicAdvertiserList - */ - ble_error_t removeDeviceFromPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const ble::address_t &peerAddress, - advertising_sid_t sid - ); - - /** @copydoc Gap::clearPeriodicAdvertiserList - */ - ble_error_t clearPeriodicAdvertiserList_(); - - /** @copydoc Gap::getMaxPeriodicAdvertiserListSize - */ - uint8_t getMaxPeriodicAdvertiserListSize_(); - - /** - * @see Gap::setRandomStaticAddress - */ - ble_error_t setRandomStaticAddress_(const ble::address_t& address); - - /** - * @see Gap::getAddress - */ - ble_error_t getAddress_( - own_address_type_t &type, - address_t &address - ); - - /** - * @see Gap::stopScan - */ - ble_error_t stopScan_(); - - /** - * @see Gap::connect - */ - ble_error_t connect_( - peer_address_type_t peerAddressType, - const ble::address_t &peerAddress, - const ConnectionParameters &connectionParams - ); - - /** - * @see Gap::cancelConnect - */ - ble_error_t cancelConnect_(); - - ble_error_t manageConnectionParametersUpdateRequest_( - bool userManageConnectionUpdateRequest - ); - - ble_error_t updateConnectionParameters_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervisionTimeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength - ); - - ble_error_t acceptConnectionParametersUpdate_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervisionTimeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength - ); - - ble_error_t rejectConnectionParametersUpdate_( - connection_handle_t connectionHandle - ); - - /** - * @see Gap::readPhy - */ - ble_error_t readPhy_(connection_handle_t connection); - - /** - * @see Gap::setPreferredPhys - */ - ble_error_t setPreferredPhys_( - const phy_set_t *txPhys, - const phy_set_t *rxPhys - ); - - /** - * @see Gap::setPhy - */ - ble_error_t setPhy_( - connection_handle_t connection, - const phy_set_t *txPhys, - const phy_set_t *rxPhys, - ble::coded_symbol_per_bit_t codedSymbol - ); - - ble_error_t disconnect_( - connection_handle_t connectionHandle, - local_disconnection_reason_t reason - ); - - /** - * @see Gap::getMaxWhitelistSize - */ - uint8_t getMaxWhitelistSize_(void) const; - - /** - * @see Gap::getWhitelist - */ - ble_error_t getWhitelist_(whitelist_t &whitelist) const; - - /** - * @see Gap::setWhitelist - */ - ble_error_t setWhitelist_(const whitelist_t &whitelist); - - /** - * @see Gap::enablePrivacy - */ - ble_error_t enablePrivacy_(bool enable); - - - ble_error_t setPeripheralPrivacyConfiguration_( - const peripheral_privacy_configuration_t *configuration - ); - ble_error_t getPeripheralPrivacyConfiguration_( - peripheral_privacy_configuration_t *configuration - ); - ble_error_t setCentralPrivacyConfiguration_( - const central_privacy_configuration_t *configuration - ); - ble_error_t getCentralPrivacyConfiguration_( - central_privacy_configuration_t *configuration - ); - - ble_error_t getAddress( - own_address_type_t &typeP, - address_t &address - ); - - static ble_error_t getRandomAddressType( - const ble::address_t address, - ble::random_address_type_t *addressType - ); - - /** - * @see Gap::reset - */ - ble_error_t reset_(void); - - -private: - ble_error_t setAdvertisingData( - advertising_handle_t handle, - Span payload, - bool minimiseFragmentation, - bool scan_response - ); - - void on_advertising_timeout(); - - void process_advertising_timeout(); - - void on_gap_event_received(const pal::GapEvent &e); - - void on_advertising_report(const pal::GapAdvertisingReportEvent &e); - - void on_connection_complete(const pal::GapConnectionCompleteEvent &e); - - void on_disconnection_complete(const pal::GapDisconnectionCompleteEvent &e); - - void on_connection_parameter_request( - const pal::GapRemoteConnectionParameterRequestEvent &e - ); - - void on_connection_update(const pal::GapConnectionUpdateEvent &e); - - void on_unexpected_error(const pal::GapUnexpectedErrorEvent &e); - - enum AddressUseType_t { - CENTRAL_CONNECTION, - CENTRAL_SCAN, - PERIPHERAL_CONNECTABLE, - PERIPHERAL_NON_CONNECTABLE - }; - - pal::own_address_type_t get_own_address_type(AddressUseType_t address_use_type); - - bool initialize_whitelist() const; - - ble_error_t update_address_resolution_setting(); - - void set_random_address_rotation(bool enable); - - void update_random_address(); - - bool getUnresolvableRandomAddress(ble::address_t &address); - - void on_address_rotation_timeout(); - - /* implements pal::Gap::EventHandler */ -private: - void on_read_phy_( - pal::hci_error_code_t hci_status, - connection_handle_t connection_handle, - phy_t tx_phy, - phy_t rx_phy - ); - - void on_data_length_change_( - connection_handle_t connection_handle, - uint16_t tx_size, - uint16_t rx_size - ); - - void on_phy_update_complete_( - pal::hci_error_code_t hci_status, - connection_handle_t connection_handle, - phy_t tx_phy, - phy_t rx_phy - ); - - void on_enhanced_connection_complete_( - pal::hci_error_code_t status, - connection_handle_t connection_handle, - pal::connection_role_t own_role, - pal::connection_peer_address_type_t peer_address_type, - const ble::address_t &peer_address, - const ble::address_t &local_resolvable_private_address, - const ble::address_t &peer_resolvable_private_address, - uint16_t connection_interval, - uint16_t connection_latency, - uint16_t supervision_timeout, - pal::clock_accuracy_t master_clock_accuracy - ); - - void on_extended_advertising_report_( - advertising_event_t event_type, - const pal::connection_peer_address_type_t *address_type, - const ble::address_t &address, - phy_t primary_phy, - const phy_t *secondary_phy, - advertising_sid_t advertising_sid, - pal::advertising_power_t tx_power, - pal::rssi_t rssi, - uint16_t periodic_advertising_interval, - pal::direct_address_type_t direct_address_type, - const ble::address_t &direct_address, - uint8_t data_length, - const uint8_t *data - ); - - void on_periodic_advertising_sync_established_( - pal::hci_error_code_t error, - pal::sync_handle_t sync_handle, - advertising_sid_t advertising_sid, - pal::connection_peer_address_type_t advertiser_address_type, - const ble::address_t &advertiser_address, - phy_t advertiser_phy, - uint16_t periodic_advertising_interval, - pal::clock_accuracy_t clock_accuracy - ); - - void on_periodic_advertising_report_( - pal::sync_handle_t sync_handle, - pal::advertising_power_t tx_power, - pal::rssi_t rssi, - pal::advertising_data_status_t data_status, - uint8_t data_length, - const uint8_t *data - ); - - void on_periodic_advertising_sync_loss_(pal::sync_handle_t sync_handle); - - void on_advertising_set_terminated_( - pal::hci_error_code_t status, - advertising_handle_t advertising_handle, - connection_handle_t connection_handle, - uint8_t number_of_completed_extended_advertising_events - ); - - void on_scan_request_received_( - advertising_handle_t advertising_handle, - pal::connection_peer_address_type_t scanner_address_type, - const ble::address_t &address - ); - - void on_connection_update_complete_( - pal::hci_error_code_t status, - connection_handle_t connection_handle, - uint16_t connection_interval, - uint16_t connection_latency, - uint16_t supervision_timeout - ); - - void on_remote_connection_parameter_( - connection_handle_t connection_handle, - uint16_t connection_interval_min, - uint16_t connection_interval_max, - uint16_t connection_latency, - uint16_t supervision_timeout - ); - - void on_scan_timeout_(); - void process_legacy_scan_timeout(); - -private: - pal::EventQueue &_event_queue; - PalGap &_pal_gap; - pal::GenericAccessService &_gap_service; - PalSecurityManager &_pal_sm; - ble::own_address_type_t _address_type; - ble::address_t _address; - pal::initiator_policy_t _initiator_policy_mode; - pal::scanning_filter_policy_t _scanning_filter_policy; - pal::advertising_filter_policy_t _advertising_filter_policy; - mutable whitelist_t _whitelist; - - bool _privacy_enabled; - peripheral_privacy_configuration_t _peripheral_privacy_configuration; - central_privacy_configuration_t _central_privacy_configuration; - ble::address_t _random_static_identity_address; - bool _random_address_rotating; - - bool _scan_enabled; - mbed::LowPowerTimeout _advertising_timeout; - mbed::LowPowerTimeout _scan_timeout; - mbed::LowPowerTicker _address_rotation_ticker; - - template - struct BitArray { - BitArray() : data() - { - } - - bool get(size_t index) const - { - position p(index); - return (data[p.byte_index] >> p.bit_index) & 0x01; - } - - void set(size_t index) - { - position p(index); - data[p.byte_index] |= (0x01 << p.bit_index); - } - - void clear(size_t index) - { - position p(index); - data[p.byte_index] &= ~(0x01 << p.bit_index); - } - - void clear() - { - for (size_t i = 0; i < (bit_size / 8 + 1); ++i) { - data[i] = 0; - } - } - - private: - struct position { - position(size_t bit_number) : - byte_index(bit_number / 8), - bit_index(bit_number % 8) - { - } - - size_t byte_index; - uint8_t bit_index; - }; - - uint8_t data[bit_size / 8 + 1]; - }; - - BitArray _existing_sets; - BitArray _active_sets; - BitArray _active_periodic_sets; - BitArray _connectable_payload_size_exceeded; - BitArray _set_is_connectable; - - bool _user_manage_connection_parameter_requests : 1; - -private: - ble_error_t setExtendedAdvertisingParameters( - advertising_handle_t handle, - const AdvertisingParameters ¶meters - ); - - bool is_extended_advertising_available(); - - void prepare_legacy_advertising_set(); -}; - -} // namespace generic -} // namespace ble - -#endif /* MBED_BLE_GENERIC_GAP */ diff --git a/features/FEATURE_BLE/ble/generic/GenericGattClient.h b/features/FEATURE_BLE/ble/generic/GenericGattClient.h deleted file mode 100644 index 50822aa4d5..0000000000 --- a/features/FEATURE_BLE/ble/generic/GenericGattClient.h +++ /dev/null @@ -1,191 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBED_BLE_GENERIC_GATT_CLIENT -#define MBED_BLE_GENERIC_GATT_CLIENT - -#include -#include "ble/GattClient.h" -#include "ble/pal/PalGattClient.h" -#include "ble/pal/SigningEventMonitor.h" - -// IMPORTANT: private header. Not part of the public interface. - -namespace ble { -namespace generic { - -/** - * Generic implementation of the GattClient. - * It requires a pal::GattClient injected at construction site. - * @attention: Not part of the public interface of BLE API. - */ -template class TPalGattClient, class SigningMonitorEventHandler> -class GenericGattClient : - public interface::GattClient >, - public pal::SigningEventMonitor, SigningMonitorEventHandler>, - public pal::GattClientEventHandler > { - - using interface::GattClient >::eventHandler; - -public: - - typedef interface::GattClient > Base; - typedef TPalGattClient PalGattClient; - typedef typename Base::WriteOp_t WriteOp_t; - - /** - * Create a GenericGattClient from a pal::GattClient - */ - GenericGattClient(PalGattClient* pal_client); - - /** - * @see GattClient::launchServiceDiscovery - */ - ble_error_t launchServiceDiscovery_( - connection_handle_t connection_handle, - ServiceDiscovery::ServiceCallback_t service_callback, - ServiceDiscovery::CharacteristicCallback_t characteristic_callback, - const UUID& matching_service_uuid, - const UUID& matching_characteristic_uuid - ); - - /** - * @see GattClient::isServiceDiscoveryActive - */ - bool isServiceDiscoveryActive_() const; - - /** - * @see GattClient::terminateServiceDiscovery - */ - void terminateServiceDiscovery_(); - - /** - * @see GattClient::read - */ - ble_error_t read_( - connection_handle_t connection_handle, - GattAttribute::Handle_t attribute_handle, - uint16_t offset - ) const; - - /** - * @see GattClient::write - */ - ble_error_t write_( - WriteOp_t cmd, - connection_handle_t connection_handle, - GattAttribute::Handle_t attribute_handle, - size_t length, - const uint8_t* value - ) const; - - /** - * @see GattClient::onServiceDiscoveryTermination - */ - void onServiceDiscoveryTermination_( - ServiceDiscovery::TerminationCallback_t callback - ); - - /** - * @see GattClient::discoverCharacteristicDescriptors - */ - ble_error_t discoverCharacteristicDescriptors_( - const DiscoveredCharacteristic& characteristic, - const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, - const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback - ); - - /** - * @see GattClient::isCharacteristicDescriptorDiscoveryActive - */ - bool isCharacteristicDescriptorDiscoveryActive_( - const DiscoveredCharacteristic& characteristic - ) const; - - /** - * @see GattClient::terminateCharacteristicDescriptorDiscovery - */ - void terminateCharacteristicDescriptorDiscovery_( - const DiscoveredCharacteristic& characteristic - ); - - /** - * @see GattClient::negotiateAttMtu - */ - ble_error_t negotiateAttMtu_( - connection_handle_t connection - ); - - /** - * @see GattClient::reset - */ - ble_error_t reset_(void); - - /** - * @see ble::pal::SigningEventMonitor::set_signing_event_handler - */ - void set_signing_event_handler_(SigningMonitorEventHandler *signing_event_handler); - - /** - * @see pal::GattClient::EventHandler::on_att_mtu_change - */ - void on_att_mtu_change_( - ble::connection_handle_t connection_handle, - uint16_t att_mtu_size - ); - - /** - * @see pal::GattClient::EventHandler::on_write_command_sent - */ - void on_write_command_sent_( - ble::connection_handle_t connection_handle, - ble::attribute_handle_t attribute_handle, - uint8_t status - ); - -private: - struct ProcedureControlBlock; - struct DiscoveryControlBlock; - struct ReadControlBlock; - struct WriteControlBlock; - struct DescriptorDiscoveryControlBlock; - - ProcedureControlBlock* get_control_block(connection_handle_t connection); - const ProcedureControlBlock* get_control_block(connection_handle_t connection) const; - void insert_control_block(ProcedureControlBlock* cb) const; - void remove_control_block(ProcedureControlBlock* cb) const; - - void on_termination(connection_handle_t connection_handle); - void on_server_message_received(connection_handle_t, const pal::AttServerMessage&); - void on_server_response(connection_handle_t, const pal::AttServerMessage&); - void on_server_event(connection_handle_t, const pal::AttServerMessage&); - void on_transaction_timeout(connection_handle_t); - - uint16_t get_mtu(connection_handle_t connection) const; - - PalGattClient* const _pal_client; - ServiceDiscovery::TerminationCallback_t _termination_callback; - SigningMonitorEventHandler* _signing_event_handler; - mutable ProcedureControlBlock* control_blocks; - bool _is_reseting; -}; - -} // generic -} // ble - -#endif /* MBED_BLE_GENERIC_GATT_CLIENT */ diff --git a/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h b/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h deleted file mode 100644 index 3a1651b4d1..0000000000 --- a/features/FEATURE_BLE/ble/generic/GenericSecurityManager.h +++ /dev/null @@ -1,795 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _GENERIC_SECURITY_MANAGER_H_ -#define _GENERIC_SECURITY_MANAGER_H_ - -#include "ble/SecurityManager.h" -#include "ble/pal/GapTypes.h" -#include "ble/BLETypes.h" -#include "ble/generic/SecurityDb.h" -#include "platform/Callback.h" -#include "ble/pal/ConnectionEventMonitor.h" -#include "ble/pal/SigningEventMonitor.h" -#include "ble/generic/GenericGap.h" -#include "ble/pal/PalSecurityManager.h" - -namespace ble { -namespace generic { - -template class TPalSecurityManager, template class SigningMonitor> -class GenericSecurityManager : - public interface::SecurityManager >, // SecurityManager - public pal::SecurityManagerEventHandler >, // PalSmEventHandler - public pal::ConnectionEventMonitorEventHandler >, // ConnectionObserver - public pal::SigningMonitorEventHandler > //SigningObserver -{ - // typedefs - typedef interface::SecurityManager SecurityManager; - typedef SigningMonitor SigningEventMonitor; - typedef typename TPalSecurityManager::Base PalSecurityManager; - - // friends - friend class pal::ConnectionEventMonitorEventHandler; - - // imports from SecurityManager - typedef typename SecurityManager::SecurityIOCapabilities_t SecurityIOCapabilities_t; - typedef typename SecurityManager::SecurityMode_t SecurityMode_t; - typedef typename SecurityManager::SecurityCompletionStatus_t SecurityCompletionStatus_t; - typedef typename SecurityManager::Passkey_t Passkey_t; - typedef typename SecurityManager::Keypress_t Keypress_t; - typedef typename SecurityManager::EventHandler SecurityManagerEventHandler; - - using SecurityManager::SECURITY_MODE_ENCRYPTION_OPEN_LINK; - using SecurityManager::SECURITY_MODE_ENCRYPTION_NO_MITM; - using SecurityManager::SECURITY_MODE_ENCRYPTION_WITH_MITM; - using SecurityManager::SECURITY_MODE_SIGNED_NO_MITM; - using SecurityManager::SECURITY_MODE_SIGNED_WITH_MITM; - using SecurityManager::SEC_STATUS_TIMEOUT; - using SecurityManager::SEC_STATUS_SUCCESS; - - using SecurityManager::eventHandler; - using SecurityManager::requestPairing; - using SecurityManager::getLinkEncryption; - using SecurityManager::requestAuthentication; - using SecurityManager::generateOOB; - using SecurityManager::cancelPairingRequest; - using SecurityManager::acceptPairingRequest; - -public: - - /* implements SecurityManager */ - - //////////////////////////////////////////////////////////////////////////// - // SM lifecycle management - // - - ble_error_t init_( - bool bondable, - bool mitm, - SecurityIOCapabilities_t iocaps, - const uint8_t* passkey, - bool signing, - const char* db_path - ); - - ble_error_t setDatabaseFilepath_(const char *db_path = NULL); - - ble_error_t reset_(); - - ble_error_t preserveBondingStateOnReset_( - bool enabled - ); - - //////////////////////////////////////////////////////////////////////////// - // List management - // - - ble_error_t purgeAllBondingState_(); - - ble_error_t generateWhitelistFromBondTable_( - ::ble::whitelist_t *whitelist - ) const; - - //////////////////////////////////////////////////////////////////////////// - // Pairing - // - - ble_error_t requestPairing_( - connection_handle_t connection - ); - - ble_error_t acceptPairingRequest_( - connection_handle_t connection - ); - - ble_error_t cancelPairingRequest_( - connection_handle_t connection - ); - - ble_error_t setPairingRequestAuthorisation_( - bool required = true - ); - - ble_error_t getPeerIdentity_( - connection_handle_t connection - ); - - //////////////////////////////////////////////////////////////////////////// - // Feature support - // - - ble_error_t allowLegacyPairing_( - bool allow = true - ); - - ble_error_t getSecureConnectionsSupport_( - bool *enabled - ); - - //////////////////////////////////////////////////////////////////////////// - // Security settings - // - - ble_error_t setIoCapability_( - SecurityIOCapabilities_t iocaps - ); - - ble_error_t setDisplayPasskey_( - const uint8_t* passkey - ); - - ble_error_t setAuthenticationTimeout_( - connection_handle_t connection, - uint32_t timeout_in_ms - ); - - ble_error_t getAuthenticationTimeout_( - connection_handle_t connection, - uint32_t *timeout_in_ms - ); - - ble_error_t setLinkSecurity_( - connection_handle_t connection, - SecurityMode_t securityMode - ); - - ble_error_t setKeypressNotification_( - bool enabled - ); - - ble_error_t enableSigning_( - connection_handle_t connection, - bool enabled - ); - - ble_error_t setHintFutureRoleReversal_( - bool enable - ); - - //////////////////////////////////////////////////////////////////////////// - // Encryption - // - - ble_error_t getLinkEncryption_( - connection_handle_t connection, - link_encryption_t *encryption - ); - - ble_error_t setLinkEncryption_( - connection_handle_t connection, - link_encryption_t encryption - ); - - ble_error_t getEncryptionKeySize_( - connection_handle_t connection, - uint8_t *size - ); - - ble_error_t setEncryptionKeyRequirements_( - uint8_t minimumByteSize, - uint8_t maximumByteSize - ); - - //////////////////////////////////////////////////////////////////////////// - // Privacy - // - - ble_error_t setPrivateAddressTimeout_( - uint16_t timeout_in_seconds - ); - - //////////////////////////////////////////////////////////////////////////// - // Keys - // - - ble_error_t getSigningKey_( - connection_handle_t connection, - bool authenticated - ); - - //////////////////////////////////////////////////////////////////////////// - // Authentication - // - - ble_error_t requestAuthentication_( - connection_handle_t connection - ); - - //////////////////////////////////////////////////////////////////////////// - // MITM - // - - ble_error_t generateOOB_( - const address_t *address - ); - - ble_error_t setOOBDataUsage_( - connection_handle_t connection, - bool useOOB, - bool OOBProvidesMITM - ); - - ble_error_t confirmationEntered_( - connection_handle_t connection, - bool confirmation - ); - - ble_error_t passkeyEntered_( - connection_handle_t connection, - Passkey_t passkey - ); - - ble_error_t sendKeypressNotification_( - connection_handle_t connection, - Keypress_t keypress - ); - - ble_error_t legacyPairingOobReceived_( - const address_t *address, - const oob_tk_t *tk - ); - - ble_error_t oobReceived_( - const address_t *address, - const oob_lesc_value_t *random, - const oob_confirm_t *confirm - ); - - /* ends implements SecurityManager */ - -public: - GenericSecurityManager( - PalSecurityManager &palImpl, - pal::ConnectionEventMonitor &connMonitorImpl, - SigningEventMonitor &signingMonitorImpl - ) : _pal(palImpl), - _connection_monitor(connMonitorImpl), - _signing_monitor(signingMonitorImpl), - _db(NULL), - _default_authentication(0), - _default_key_distribution(pal::KeyDistribution::KEY_DISTRIBUTION_ALL), - _pairing_authorisation_required(false), - _legacy_pairing_allowed(true), - _master_sends_keys(false) { - _pal.set_event_handler(this); - - /* We create a fake value for oob to allow creation of the next oob which needs - * the last process to finish first before restarting (this is to simplify checking). - * This fake value will not be used as the oob address is currently invalid */ - _oob_local_random[0] = 1; - } - - ~GenericSecurityManager() { - delete _db; - } - - //////////////////////////////////////////////////////////////////////////// - // Helper functions - // - -private: - - /** - * Initialise the database, if database already exists it will close it and open the new one. - * - * @param db_path path to file to store secure db - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t init_database(const char *db_path = NULL); - - /** - * Generate identity list based on the database of IRK and apply it to the resolving list. - * - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t init_resolving_list(); - - /** - * Generate the CSRK if needed. - * - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t init_signing(); - - /** - * Generate the IRK if needed. - * - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t init_identity(); - - /** - * Fills the buffer with the specified number of bytes of random data - * produced by the link controller - * - * @param[out] buffer buffer to be filled with random data - * @param[in] size number of bytes to fill with random data - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t get_random_data( - uint8_t *buffer, - size_t size - ); - - /** - * Send slave security request based on current link settings. - * - * @param[in] connectionHandle Handle to identify the connection. - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t slave_security_request( - connection_handle_t connection - ); - - /** - * Enable encryption on the link, depending on whether device is master or slave. - * - * @param[in] connectionHandle Handle to identify the connection. - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - ble_error_t enable_encryption( - connection_handle_t connection - ); - - /** - * Returns the requested LTK to the PAL. Called by the security db. - * - * @param[in] entry security entry returned by the database. - * @param[in] entryKeys security entry containing keys. - */ - void enable_encryption_cb( - SecurityDb::entry_handle_t entry, - const SecurityEntryKeys_t* entryKeys - ); - - /** - * Returns the requested LTK to the PAL. Called by the security db. - * - * @param[in] entry security entry returned by the database. - * @param[in] entryKeys security entry containing keys. - */ - void set_ltk_cb( - SecurityDb::entry_handle_t entry, - const SecurityEntryKeys_t* entryKeys - ); - - /** - * Returns the CSRK for the connection. Called by the security db. - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] signing connection signature resolving key and counter. - */ - void return_csrk_cb( - SecurityDb::entry_handle_t connection, - const SecurityEntrySigning_t *signing - ); - - /** - * Set the peer CSRK for the connection. Called by the security db. - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] signing connection signature resolving key and counter. - */ - void set_peer_csrk_cb( - SecurityDb::entry_handle_t connection, - const SecurityEntrySigning_t *signing - ); - - /** - * Updates the entry for the connection with OOB data presence. - * - * @param[in] connectionHandle Handle to identify the connection. - */ - void update_oob_presence( - connection_handle_t connection - ); - - /** - * Set the MITM protection setting on the database entry - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] enable if true set the MITM protection to on. - */ - void set_mitm_performed( - connection_handle_t connection, - bool enable = true - ); - - /** - * Inform the Security manager of a new connection. This will create - * or retrieve an existing security manager entry for the connected device. - * Called by GAP. - * - * @param[in] connectionHandle Handle to identify the connection. - * @param[in] is_master True if device is the master. - * @param[in] peer_address_type type of address. - * @param[in] peer_address Address of the connected device. - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - void on_connected_( - connection_handle_t connection, - connection_role_t role, - peer_address_type_t peer_address_type, - address_t peer_address, - own_address_type_t local_address_type, - address_t local_address - ); - - /** - * Inform the security manager that a device has been disconnected and its - * entry can be put in NVM storage. Called by GAP. - * - * @param[in] connectionHandle Handle to identify the connection. - * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason. - */ - void on_disconnected_( - connection_handle_t connection, - disconnection_reason_t reason - ); - - /** - * Callback invoked by the secure DB when an identity entry has been - * retrieved. - * @param entry Handle of the entry. - * @param identity The identity associated with the entry; may be NULL. - */ - void on_security_entry_retrieved( - SecurityDb::entry_handle_t entry, - const SecurityEntryIdentity_t* identity - ); - - /** - * Callback invoked by the secure DB when the identity list has been - * retrieved. - * - * @param identity View to the array passed to the secure DB. It contains - * identity entries retrieved. - * - * @param count Number of identities entries retrieved. - */ - void on_identity_list_retrieved( - Span& identity_list, - size_t count - ); - -private: - struct ControlBlock_t { - ControlBlock_t(); - - pal::KeyDistribution get_initiator_key_distribution() { - return pal::KeyDistribution(initiator_key_distribution); - }; - pal::KeyDistribution get_responder_key_distribution() { - return pal::KeyDistribution(responder_key_distribution); - }; - void set_initiator_key_distribution(pal::KeyDistribution mask) { - initiator_key_distribution = mask.value(); - }; - void set_responder_key_distribution(pal::KeyDistribution mask) { - responder_key_distribution = mask.value(); - }; - - connection_handle_t connection; - SecurityDb::entry_handle_t db_entry; - - address_t local_address; /**< address used for connection, possibly different from identity */ - - private: - uint8_t initiator_key_distribution:4; - uint8_t responder_key_distribution:4; - public: - uint8_t connected:1; - uint8_t authenticated:1; /**< have we turned encryption on during this connection */ - uint8_t is_master:1; - - uint8_t encryption_requested:1; - uint8_t encryption_failed:1; - uint8_t encrypted:1; - uint8_t signing_requested:1; - uint8_t signing_override_default:1; - - uint8_t mitm_requested:1; - uint8_t mitm_performed:1; /**< keys exchange will have MITM protection */ - - uint8_t attempt_oob:1; - uint8_t oob_mitm_protection:1; - uint8_t oob_present:1; - uint8_t legacy_pairing_oob_request_pending:1; - - uint8_t csrk_failures:2; - }; - - PalSecurityManager &_pal; - pal::ConnectionEventMonitor &_connection_monitor; - SigningEventMonitor &_signing_monitor; - - SecurityDb *_db; - - /* OOB data */ - address_t _oob_local_address; - address_t _oob_peer_address; - oob_lesc_value_t _oob_peer_random; - oob_confirm_t _oob_peer_confirm; - oob_lesc_value_t _oob_local_random; - address_t _oob_temporary_key_creator_address; /**< device which generated and sent the TK */ - oob_tk_t _oob_temporary_key; /**< used for legacy pairing */ - - pal::AuthenticationMask _default_authentication; - pal::KeyDistribution _default_key_distribution; - - bool _pairing_authorisation_required; - bool _legacy_pairing_allowed; - bool _master_sends_keys; - - static const size_t MAX_CONTROL_BLOCKS = 5; - ControlBlock_t _control_blocks[MAX_CONTROL_BLOCKS]; - - /* implements ble::pal::SecurityManager::EventHandler */ -public: - //////////////////////////////////////////////////////////////////////////// - // Pairing - // - - /** @copydoc ble::pal::SecurityManager::on_pairing_request - */ - void on_pairing_request_( - connection_handle_t connection, - bool use_oob, - pal::AuthenticationMask authentication, - pal::KeyDistribution initiator_dist, - pal::KeyDistribution responder_dist - ); - - /** @copydoc ble::pal::SecurityManager::on_pairing_error - */ - void on_pairing_error_( - connection_handle_t connection, - pairing_failure_t error - ); - - /** @copydoc ble::pal::SecurityManager::on_pairing_timed_out - */ - void on_pairing_timed_out_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_pairing_completed - */ - void on_pairing_completed_( - connection_handle_t connection - ); - - //////////////////////////////////////////////////////////////////////////// - // Security - // - - /** @copydoc ble::pal::SecurityManager::on_valid_mic_timeout - */ - void on_valid_mic_timeout_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_signed_write_received - */ - void on_signed_write_received_( - connection_handle_t connection, - uint32_t sign_coutner - ); - - /** @copydoc ble::pal::SecurityManager::on_signed_write_verification_failure - */ - void on_signed_write_verification_failure_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_signed_write - */ - void on_signed_write_(); - - /** @copydoc ble::pal::SecurityManager::on_slave_security_request - */ - void on_slave_security_request_( - connection_handle_t connection, - pal::AuthenticationMask authentication - ); - - //////////////////////////////////////////////////////////////////////////// - // Encryption - // - - /** @copydoc ble::pal::SecurityManager::on_link_encryption_result - */ - void on_link_encryption_result_( - connection_handle_t connection, - link_encryption_t result - ); - - /** @copydoc ble::pal::SecurityManager::on_link_encryption_request_timed_out - */ - void on_link_encryption_request_timed_out_( - connection_handle_t connection - ); - - //////////////////////////////////////////////////////////////////////////// - // MITM - // - - /** @copydoc ble::pal::SecurityManager::on_passkey_display - */ - void on_passkey_display_( - connection_handle_t connection, - passkey_num_t passkey - ); - - /** @copydoc ble::pal::SecurityManager::on_keypress_notification - */ - void on_keypress_notification_( - connection_handle_t connection, - Keypress_t keypress - ); - - /** @copydoc ble::pal::SecurityManager::on_passkey_request - */ - void on_passkey_request_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_confirmation_request - */ - void on_confirmation_request_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_secure_connections_oob_request - */ - void on_secure_connections_oob_request_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_legacy_pairing_oob_request - */ - void on_legacy_pairing_oob_request_( - connection_handle_t connection - ); - - /** @copydoc ble::pal::SecurityManager::on_secure_connections_oob_generated - */ - void on_secure_connections_oob_generated_( - const oob_lesc_value_t &random, - const oob_confirm_t &confirm - ); - - //////////////////////////////////////////////////////////////////////////// - // Keys - // - - /** @copydoc ble::pal::SecurityManager::on_secure_connections_ltk_generated - */ - void on_secure_connections_ltk_generated_( - connection_handle_t connection, - const ltk_t <k - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_ltk - */ - void on_keys_distributed_ltk_( - connection_handle_t connection, - const ltk_t <k - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_ediv_rand - */ - void on_keys_distributed_ediv_rand_( - connection_handle_t connection, - const ediv_t &ediv, - const rand_t &rand - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_local_ltk - */ - void on_keys_distributed_local_ltk_( - connection_handle_t connection, - const ltk_t <k - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_local_ediv_rand - */ - void on_keys_distributed_local_ediv_rand_( - connection_handle_t connection, - const ediv_t &ediv, - const rand_t &rand - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_irk - */ - void on_keys_distributed_irk_( - connection_handle_t connection, - const irk_t &irk - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_bdaddr - */ - void on_keys_distributed_bdaddr_( - connection_handle_t connection, - pal::advertising_peer_address_type_t peer_address_type, - const address_t &peer_identity_address - ); - - /** @copydoc ble::pal::SecurityManager::on_keys_distributed_csrk - */ - void on_keys_distributed_csrk_( - connection_handle_t connection, - const csrk_t &csrk - ); - - /** @copydoc ble::pal::SecurityManager::on_ltk_requeston_ltk_request - */ - void on_ltk_request_( - connection_handle_t connection, - const ediv_t &ediv, - const rand_t &rand - ); - - /** @copydoc ble::pal::SecurityManager::on_ltk_requeston_ltk_request - */ - void on_ltk_request_( - connection_handle_t connection - ); - - /* end implements ble::pal::SecurityManager::EventHandler */ - - /* list management */ - - ControlBlock_t* acquire_control_block(connection_handle_t connection); - - ControlBlock_t* get_control_block(connection_handle_t connection); - - ControlBlock_t* get_control_block(const address_t &peer_address); - - ControlBlock_t* get_control_block(SecurityDb::entry_handle_t db_entry); - - void release_control_block(ControlBlock_t* entry); -}; - - -} /* namespace generic */ -} /* namespace ble */ - - -#endif /*_GENERIC_SECURITY_MANAGER_H_*/ diff --git a/features/FEATURE_BLE/ble/pal/AttClientToGattClientAdapter.h b/features/FEATURE_BLE/ble/pal/AttClientToGattClientAdapter.h deleted file mode 100644 index 53025f5fa9..0000000000 --- a/features/FEATURE_BLE/ble/pal/AttClientToGattClientAdapter.h +++ /dev/null @@ -1,298 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ -#define BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ - -#include "AttClient.h" -#include "PalGattClient.h" - -namespace ble { -namespace pal { - -/** - * Adapt a pal::AttClient into a pal::GattClient. - * - * This class let vendors define their abstraction layer in term of an AttClient - * and adapt any AttClient into a GattClient. - */ -template -class AttClientToGattClientAdapter : public GattClient, EventHandler > { - -public: - static const uint16_t END_ATTRIBUTE_HANDLE = 0xFFFF; - static const uint16_t SERVICE_TYPE_UUID = 0x2800; - static const uint16_t INCLUDE_TYPE_UUID = 0x2802; - static const uint16_t CHARACTERISTIC_TYPE_UUID = 0x2803; - - /** - * Construct an instance of GattClient from an instance of AttClient. - * @param client The client to adapt. - */ - AttClientToGattClientAdapter(AttClient& client) : - _client(client) { - _client.when_server_message_received( - mbed::callback(this, &AttClientToGattClientAdapter::on_server_event) - ); - _client.when_transaction_timeout( - mbed::callback( - this, &AttClientToGattClientAdapter::on_transaction_timeout - ) - ); - } - - /** - * @see ble::pal::GattClient::exchange_mtu - */ - ble_error_t exchange_mtu_(connection_handle_t connection) { - return _client.exchange_mtu_request(connection); - } - - /** - * @see ble::pal::GattClient::get_mtu_size - */ - ble_error_t get_mtu_size_( - connection_handle_t connection_handle, - uint16_t& mtu_size - ) { - return _client.get_mtu_size(connection_handle, mtu_size); - } - - /** - * @see ble::pal::GattClient::discover_primary_service - */ - ble_error_t discover_primary_service_( - connection_handle_t connection, - attribute_handle_t discovery_range_begining - ) { - return _client.read_by_group_type_request( - connection, - attribute_handle_range(discovery_range_begining, END_ATTRIBUTE_HANDLE), - SERVICE_TYPE_UUID - ); - } - - /** - * @see ble::pal::GattClient::discover_primary_service_by_service_uuid - */ - ble_error_t discover_primary_service_by_service_uuid_( - connection_handle_t connection_handle, - attribute_handle_t discovery_range_begining, - const UUID& uuid - ) { - return _client.find_by_type_value_request( - connection_handle, - attribute_handle_range(discovery_range_begining, END_ATTRIBUTE_HANDLE), - SERVICE_TYPE_UUID, - Span( - uuid.getBaseUUID(), - (uuid.shortOrLong() == UUID::UUID_TYPE_SHORT) ? 2 : UUID::LENGTH_OF_LONG_UUID - ) - ); - } - - /** - * @see ble::pal::GattClient::find_included_service - */ - ble_error_t find_included_service_( - connection_handle_t connection_handle, - attribute_handle_range_t service_range - ) { - return _client.read_by_type_request( - connection_handle, - service_range, - INCLUDE_TYPE_UUID - ); - } - - /** - * @see ble::pal::GattClient::discover_characteristics_of_a_service - */ - ble_error_t discover_characteristics_of_a_service_( - connection_handle_t connection_handle, - attribute_handle_range_t discovery_range - ) { - return _client.read_by_type_request( - connection_handle, - discovery_range, - CHARACTERISTIC_TYPE_UUID - ); - } - - /** - * @see ble::pal::GattClient::discover_characteristics_descriptors - */ - ble_error_t discover_characteristics_descriptors_( - connection_handle_t connection_handle, - attribute_handle_range_t descriptors_discovery_range - ) { - return _client.find_information_request( - connection_handle, - descriptors_discovery_range - ); - } - - /** - * @see ble::pal::GattClient::read_attribute_value - */ - ble_error_t read_attribute_value_( - connection_handle_t connection_handle, - attribute_handle_t attribute_handle - ) { - return _client.read_request( - connection_handle, - attribute_handle - ); - } - - /** - * @see ble::pal::GattClient::read_using_characteristic_uuid - */ - ble_error_t read_using_characteristic_uuid_( - connection_handle_t connection_handle, - attribute_handle_range_t read_range, - const UUID& uuid - ) { - return _client.read_by_type_request( - connection_handle, - read_range, - uuid - ); - } - - /** - * @see ble::pal::GattClient::read_attribute_blob - */ - ble_error_t read_attribute_blob_( - connection_handle_t connection_handle, - attribute_handle_t attribute_handle, - uint16_t offset - ) { - return _client.read_blob_request( - connection_handle, - attribute_handle, - offset - ); - } - - /** - * @see ble::pal::GattClient::read_multiple_characteristic_values - */ - ble_error_t read_multiple_characteristic_values_( - connection_handle_t connection_handle, - const Span& characteristic_value_handles - ) { - return _client.read_multiple_request( - connection_handle, - characteristic_value_handles - ); - } - - /** - * @see ble::pal::GattClient::write_without_response - */ - ble_error_t write_without_response_( - connection_handle_t connection_handle, - attribute_handle_t characteristic_value_handle, - const Span& value - ) { - return _client.write_command( - connection_handle, - characteristic_value_handle, - value - ); - } - - /** - * @see ble::pal::GattClient::signed_write_without_response - */ - ble_error_t signed_write_without_response_( - connection_handle_t connection_handle, - attribute_handle_t characteristic_value_handle, - const Span& value - ) { - return _client.signed_write_command( - connection_handle, - characteristic_value_handle, - value - ); - } - - /** - * @see ble::pal::GattClient::write_attribute - */ - ble_error_t write_attribute_( - connection_handle_t connection_handle, - attribute_handle_t attribute_handle, - const Span& value - ) { - return _client.write_request( - connection_handle, - attribute_handle, - value - ); - } - - /** - * @see ble::pal::GattClient::queue_prepare_write - */ - ble_error_t queue_prepare_write_( - connection_handle_t connection_handle, - attribute_handle_t characteristic_value_handle, - const Span& value, - uint16_t offset - ) { - return _client.prepare_write_request( - connection_handle, - characteristic_value_handle, - offset, - value - ); - } - - /** - * @see ble::pal::GattClient::execute_write_queue - */ - ble_error_t execute_write_queue_( - connection_handle_t connection_handle, - bool execute - ) { - return _client.execute_write_request(connection_handle, execute); - } - - /** - * @see ble::pal::GattClient::initialize - */ - ble_error_t initialize_() { - return _client.initialize(); - } - - /** - * @see ble::pal::GattClient::terminate - */ - ble_error_t terminate_() { - return _client.initialize(); - } - -private: - AttClient& _client; -}; - -} // namespace pal -} // namespace ble - - -#endif /* BLE_PAL_ATTCLIENTTOGATTCLIENTADAPTER_H_ */ diff --git a/features/FEATURE_BLE/ble/pal/Deprecated.h b/features/FEATURE_BLE/ble/pal/Deprecated.h deleted file mode 100644 index 5695c35748..0000000000 --- a/features/FEATURE_BLE/ble/pal/Deprecated.h +++ /dev/null @@ -1,41 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef BLE_PAL_DEPRECATED_H -#define BLE_PAL_DEPRECATED_H - -/** - * Declare the beginning of a code block that uses a deprecated API - */ -#if defined(__GNUC__) -#define BLE_DEPRECATED_API_USE_BEGIN() \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -#else -#define BLE_DEPRECATED_API_USE_BEGIN() -#endif - -/** - * Declare the end of a code block that uses a deprecated API - */ -#if defined(__GNUC__) -#define BLE_DEPRECATED_API_USE_END() \ - _Pragma("GCC diagnostic pop") -#else -#define BLE_DEPRECATED_API_USE_END() -#endif - - -#endif //BLE_PAL_DEPRECATED_H diff --git a/features/FEATURE_BLE/source/GattClient.tpp b/features/FEATURE_BLE/source/GattClient.tpp deleted file mode 100644 index 8f68af097e..0000000000 --- a/features/FEATURE_BLE/source/GattClient.tpp +++ /dev/null @@ -1,245 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ble/GattClient.h" - -namespace ble { -namespace interface { - -template -ble_error_t GattClient::launchServiceDiscovery( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t sc, - ServiceDiscovery::CharacteristicCallback_t cc, - const UUID &matchingServiceUUID, - const UUID &matchingCharacteristicUUIDIn -) { - return impl()->launchServiceDiscovery_( - connectionHandle, - sc, - cc, - matchingServiceUUID, - matchingCharacteristicUUIDIn - ); -} - -template -ble_error_t GattClient::discoverServices( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t callback, - GattAttribute::Handle_t startHandle, - GattAttribute::Handle_t endHandle -) { - return impl()->discoverServices_( - connectionHandle, - callback, - startHandle, - endHandle - ); -} - -template -bool GattClient::isServiceDiscoveryActive(void) const -{ - return impl()->isServiceDiscoveryActive_(); -} - -template -void GattClient::terminateServiceDiscovery(void) -{ - return impl()->terminateServiceDiscovery_(); -} - -template -ble_error_t GattClient::read( - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - uint16_t offset -) const { - return impl()->read_(connHandle, attributeHandle, offset); -} - -template -ble_error_t GattClient::write( - GattClient::WriteOp_t cmd, - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - size_t length, - const uint8_t *value -) const { - return impl()->write_( - cmd, - connHandle, - attributeHandle, - length, - value - ); -} - -template -void GattClient::onServiceDiscoveryTermination( - ServiceDiscovery::TerminationCallback_t callback -) { - return impl()->onServiceDiscoveryTermination_(callback); -} - -template -ble_error_t GattClient::discoverCharacteristicDescriptors( - const DiscoveredCharacteristic& characteristic, - const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, - const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback -) { - return impl()->discoverCharacteristicDescriptors_( - characteristic, - discoveryCallback, - terminationCallback - ); -} - -template -bool GattClient::isCharacteristicDescriptorDiscoveryActive( - const DiscoveredCharacteristic& characteristic -) const { - return impl()->isCharacteristicDescriptorDiscoveryActive_(characteristic); -} - -template -void GattClient::terminateCharacteristicDescriptorDiscovery( - const DiscoveredCharacteristic& characteristic -) { - return impl()->terminateCharacteristicDescriptorDiscovery_(characteristic); -} - -template -ble_error_t GattClient::negotiateAttMtu( - ble::connection_handle_t connHandle -) { - return impl()->negotiateAttMtu_(connHandle); -} - -template -ble_error_t GattClient::reset(void) -{ - return impl()->reset_(); -} - -/* ------------------------ Default implementations ------------------------- */ - - -template -ble_error_t GattClient::reset_(void) -{ - /* Notify that the instance is about to shut down. */ - shutdownCallChain.call(this); - shutdownCallChain.clear(); - - onDataReadCallbackChain.clear(); - onDataWriteCallbackChain.clear(); - onHVXCallbackChain.clear(); - - return BLE_ERROR_NONE; -} - -template -ble_error_t GattClient::discoverServices_( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t callback, - GattAttribute::Handle_t startHandle, - GattAttribute::Handle_t endHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattClient::launchServiceDiscovery_( - ble::connection_handle_t connectionHandle, - ServiceDiscovery::ServiceCallback_t sc, - ServiceDiscovery::CharacteristicCallback_t cc, - const UUID &matchingServiceUUID, - const UUID &matchingCharacteristicUUIDIn -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -bool GattClient::isServiceDiscoveryActive_(void) const -{ - return false; -} - -template -void GattClient::terminateServiceDiscovery_(void) -{ -} - -template -ble_error_t GattClient::negotiateAttMtu_( - ble::connection_handle_t connHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattClient::read_( - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - uint16_t offset -) const { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattClient::write_( - GattClient::WriteOp_t cmd, - ble::connection_handle_t connHandle, - GattAttribute::Handle_t attributeHandle, - size_t length, - const uint8_t *value -) const { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -void GattClient::onServiceDiscoveryTermination_( - ServiceDiscovery::TerminationCallback_t callback -) { -} - -template -ble_error_t GattClient::discoverCharacteristicDescriptors_( - const DiscoveredCharacteristic& characteristic, - const CharacteristicDescriptorDiscovery::DiscoveryCallback_t& discoveryCallback, - const CharacteristicDescriptorDiscovery::TerminationCallback_t& terminationCallback -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -bool GattClient::isCharacteristicDescriptorDiscoveryActive_( - const DiscoveredCharacteristic& characteristic -) const { - return false; -} - -template -void GattClient::terminateCharacteristicDescriptorDiscovery_( - const DiscoveredCharacteristic& characteristic -) { -} - -} // interface -} // ble diff --git a/features/FEATURE_BLE/source/GattServer.tpp b/features/FEATURE_BLE/source/GattServer.tpp deleted file mode 100644 index 3a17c2b3f7..0000000000 --- a/features/FEATURE_BLE/source/GattServer.tpp +++ /dev/null @@ -1,209 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ble/GattServer.h" - -namespace ble { -namespace interface { - -template -GattServer::GattServer() : - serviceCount(0), - characteristicCount(0), - eventHandler(NULL), - dataSentCallChain(), - dataWrittenCallChain(), - dataReadCallChain(), - updatesEnabledCallback(NULL), - updatesDisabledCallback(NULL), - confirmationReceivedCallback(NULL) { -} - -template -ble_error_t GattServer::addService(GattService &service) -{ - return impl()->addService_(service); -} - -template -ble_error_t GattServer::read( - GattAttribute::Handle_t attributeHandle, - uint8_t buffer[], - uint16_t *lengthP -) { - return impl()->read_(attributeHandle, buffer, lengthP); -} - -template -ble_error_t GattServer::read( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - uint8_t *buffer, - uint16_t *lengthP -) { - return impl()->read_(connectionHandle, attributeHandle, buffer, lengthP); -} - -template -ble_error_t GattServer::write( - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly -) { - return impl()->write_(attributeHandle, value, size, localOnly); -} - -template -ble_error_t GattServer::write( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly -) { - return impl()->write_( - connectionHandle, - attributeHandle, - value, - size, - localOnly - ); -} - -template -ble_error_t GattServer::areUpdatesEnabled( - const GattCharacteristic &characteristic, - bool *enabledP -) { - return impl()->areUpdatesEnabled_(characteristic, enabledP); -} - -template -ble_error_t GattServer::areUpdatesEnabled( - ble::connection_handle_t connectionHandle, - const GattCharacteristic &characteristic, - bool *enabledP -) { - return impl()->areUpdatesEnabled_(connectionHandle, characteristic, enabledP); -} - -template -bool GattServer::isOnDataReadAvailable() const -{ - return impl()->isOnDataReadAvailable_(); -} - -template -ble_error_t GattServer::reset(void) -{ - return impl()->reset_(); -} - -template -ble_error_t GattServer::reset_(void) -{ - /* Notify that the instance is about to shutdown */ - shutdownCallChain.call(this); - shutdownCallChain.clear(); - - serviceCount = 0; - characteristicCount = 0; - - dataSentCallChain.clear(); - dataWrittenCallChain.clear(); - dataReadCallChain.clear(); - updatesEnabledCallback = NULL; - updatesDisabledCallback = NULL; - confirmationReceivedCallback = NULL; - - return BLE_ERROR_NONE; -} - -/* -------------------------- Dummy implementation -------------------------- */ - -template -ble_error_t GattServer::addService_(GattService &service) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::read_( - GattAttribute::Handle_t attributeHandle, - uint8_t buffer[], - uint16_t *lengthP -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::read_( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - uint8_t *buffer, - uint16_t *lengthP -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::write_( - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::write_( - ble::connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - const uint8_t *value, - uint16_t size, - bool localOnly -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::areUpdatesEnabled_( - const GattCharacteristic &characteristic, - bool *enabledP -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t GattServer::areUpdatesEnabled_( - ble::connection_handle_t connectionHandle, - const GattCharacteristic &characteristic, - bool *enabledP -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -bool GattServer::isOnDataReadAvailable_() const -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -} // interface -} // ble diff --git a/features/FEATURE_BLE/source/SecurityManager.tpp b/features/FEATURE_BLE/source/SecurityManager.tpp deleted file mode 100644 index 24753bb13e..0000000000 --- a/features/FEATURE_BLE/source/SecurityManager.tpp +++ /dev/null @@ -1,456 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ble/SecurityManager.h" - - -namespace ble { -namespace interface { - -template -ble_error_t SecurityManager::init( - bool enableBonding, - bool requireMITM, - SecurityIOCapabilities_t iocaps, - const Passkey_t passkey, - bool signing, - const char *dbFilepath -) { - return impl()->init_( - enableBonding, - requireMITM, - iocaps, - passkey, - signing, - dbFilepath - ); -} - -template -ble_error_t SecurityManager::setDatabaseFilepath(const char *dbFilepath) { - return impl()->setDatabaseFilepath_(dbFilepath); -} - -template -ble_error_t SecurityManager::reset(void) { - return impl()->reset_(); -} - -template -ble_error_t SecurityManager::reset_() { - /* Notify that the instance is about to shutdown */ - shutdownCallChain.call(this); - shutdownCallChain.clear(); - eventHandler = &defaultEventHandler; - - return BLE_ERROR_NONE; -} - -template -ble_error_t SecurityManager::preserveBondingStateOnReset(bool enable) { - return impl()->preserveBondingStateOnReset_(enable); -} - -template -ble_error_t SecurityManager::purgeAllBondingState(void) { - return impl()->purgeAllBondingState_(); -} - -template -ble_error_t SecurityManager::generateWhitelistFromBondTable( - ::ble::whitelist_t *whitelist -) const { - return impl()->generateWhitelistFromBondTable_(whitelist); -} - -template -ble_error_t SecurityManager::requestPairing( - ble::connection_handle_t connectionHandle -) { - return impl()->requestPairing_(connectionHandle); -} - -template -ble_error_t SecurityManager::acceptPairingRequest( - ble::connection_handle_t connectionHandle -) { - return impl()->acceptPairingRequest_(connectionHandle); -} - -template -ble_error_t SecurityManager::cancelPairingRequest( - ble::connection_handle_t connectionHandle -) { - return impl()->cancelPairingRequest_(connectionHandle); -} - -template -ble_error_t SecurityManager::setPairingRequestAuthorisation( - bool required -) { - return impl()->setPairingRequestAuthorisation_(required); -} - -template -ble_error_t SecurityManager::allowLegacyPairing(bool allow) { - return impl()->allowLegacyPairing_(allow); -} - -template -ble_error_t SecurityManager::getSecureConnectionsSupport(bool *enabled) { - return impl()->getSecureConnectionsSupport_(enabled); -} - -template -ble_error_t SecurityManager::setIoCapability(SecurityIOCapabilities_t iocaps) { - return impl()->setIoCapability_(iocaps); -} - -template -ble_error_t SecurityManager::setDisplayPasskey(const Passkey_t passkey) { - return impl()->setDisplayPasskey_(passkey); -} - -template -ble_error_t SecurityManager::setLinkSecurity( - ble::connection_handle_t connectionHandle, - SecurityMode_t securityMode -) { - return impl()->setLinkSecurity_(connectionHandle, securityMode); -} - -template -ble_error_t SecurityManager::setKeypressNotification(bool enabled) { - return impl()->setKeypressNotification_(enabled); -} - -#if BLE_FEATURE_SIGNING -template -ble_error_t SecurityManager::enableSigning( - ble::connection_handle_t connectionHandle, - bool enabled -) { - return impl()->enableSigning_(connectionHandle, enabled); -} -#endif // BLE_FEATURE_SIGNING - -template -ble_error_t SecurityManager::setHintFutureRoleReversal(bool enable) { - return impl()->setHintFutureRoleReversal_(enable); -} - -template -ble_error_t SecurityManager::getLinkEncryption( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t *encryption -) { - return impl()->getLinkEncryption_(connectionHandle, encryption); -} - - -template -ble_error_t SecurityManager::setLinkEncryption( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t encryption -) { - return impl()->setLinkEncryption_(connectionHandle, encryption); -} - -template -ble_error_t SecurityManager::setEncryptionKeyRequirements( - uint8_t minimumByteSize, - uint8_t maximumByteSize -) { - return impl()->setEncryptionKeyRequirements_(minimumByteSize, maximumByteSize); -} - -template -ble_error_t SecurityManager::requestAuthentication( - ble::connection_handle_t connectionHandle -) { - return impl()->requestAuthentication_(connectionHandle); -} - -template -ble_error_t SecurityManager::generateOOB(const ble::address_t *address) { - return impl()->generateOOB_(address); -} - -template -ble_error_t SecurityManager::setOOBDataUsage( - ble::connection_handle_t connectionHandle, - bool useOOB, - bool OOBProvidesMITM -) { - return impl()->setOOBDataUsage_(connectionHandle, useOOB, OOBProvidesMITM); -} - -template -ble_error_t SecurityManager::confirmationEntered( - ble::connection_handle_t connectionHandle, - bool confirmation -) { - return impl()->confirmationEntered_(connectionHandle, confirmation); -} - -template -ble_error_t SecurityManager::passkeyEntered( - ble::connection_handle_t connectionHandle, - Passkey_t passkey -) { - return impl()->passkeyEntered_(connectionHandle, passkey); -} - -template -ble_error_t SecurityManager::sendKeypressNotification( - ble::connection_handle_t connectionHandle, - Keypress_t keypress -) { - return impl()->sendKeypressNotification_(connectionHandle, keypress); -} - -template -ble_error_t SecurityManager::legacyPairingOobReceived( - const ble::address_t *address, - const ble::oob_tk_t *tk -) { - return impl()->legacyPairingOobReceived_(address, tk); -} - -template -ble_error_t SecurityManager::oobReceived( - const ble::address_t *address, - const ble::oob_lesc_value_t *random, - const ble::oob_confirm_t *confirm -) { - return impl()->oobReceived_(address, random, confirm); -} - -template -ble_error_t SecurityManager::getSigningKey( - ble::connection_handle_t connectionHandle, - bool authenticated -) { - return impl()->getSigningKey_(connectionHandle, authenticated); -} - -/* ------------------------ Dummy implementations --------------------------- */ - -template -ble_error_t SecurityManager::init_( - bool enableBonding, - bool requireMITM, - SecurityIOCapabilities_t iocaps, - const Passkey_t passkey, - bool signing, - const char *dbFilepath -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setDatabaseFilepath_(const char *dbFilepath) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::preserveBondingStateOnReset_(bool enable) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::purgeAllBondingState_(void) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::generateWhitelistFromBondTable_( - ::ble::whitelist_t *whitelist -) const { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::requestPairing_( - ble::connection_handle_t connectionHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::acceptPairingRequest_( - ble::connection_handle_t connectionHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::cancelPairingRequest_( - ble::connection_handle_t connectionHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setPairingRequestAuthorisation_( - bool required -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::allowLegacyPairing_(bool allow) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::getSecureConnectionsSupport_(bool *enabled) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setIoCapability_(SecurityIOCapabilities_t iocaps) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setDisplayPasskey_(const Passkey_t passkey) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setLinkSecurity_( - ble::connection_handle_t connectionHandle, - SecurityMode_t securityMode -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setKeypressNotification_(bool enabled) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::enableSigning_( - ble::connection_handle_t connectionHandle, - bool enabled -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setHintFutureRoleReversal_(bool enable) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::getLinkEncryption_( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t *encryption -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - - -template -ble_error_t SecurityManager::setLinkEncryption_( - ble::connection_handle_t connectionHandle, - ble::link_encryption_t encryption -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setEncryptionKeyRequirements_( - uint8_t minimumByteSize, - uint8_t maximumByteSize -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::requestAuthentication_( - ble::connection_handle_t connectionHandle -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::generateOOB_(const ble::address_t *address) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::setOOBDataUsage_( - ble::connection_handle_t connectionHandle, - bool useOOB, - bool OOBProvidesMITM -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::confirmationEntered_( - ble::connection_handle_t connectionHandle, - bool confirmation -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::passkeyEntered_( - ble::connection_handle_t connectionHandle, - Passkey_t passkey -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::sendKeypressNotification_( - ble::connection_handle_t connectionHandle, - Keypress_t keypress -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::legacyPairingOobReceived_( - const ble::address_t *address, - const ble::oob_tk_t *tk -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::oobReceived_( - const ble::address_t *address, - const ble::oob_lesc_value_t *random, - const ble::oob_confirm_t *confirm -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t SecurityManager::getSigningKey_( - ble::connection_handle_t connectionHandle, - bool authenticated -) { - return BLE_ERROR_NOT_IMPLEMENTED; -} - -} // interface -} // ble diff --git a/features/FEATURE_BLE/source/gap/Gap.tpp b/features/FEATURE_BLE/source/gap/Gap.tpp deleted file mode 100644 index fd66f1ce97..0000000000 --- a/features/FEATURE_BLE/source/gap/Gap.tpp +++ /dev/null @@ -1,898 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2018 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ble/gap/Gap.h" - -namespace ble { -namespace interface { - -template -bool Gap::isFeatureSupported(controller_supported_features_t feature) -{ -#if !BLE_FEATURE_PHY_MANAGEMENT - if (feature == ble::controller_supported_features_t::LE_CODED_PHY || - feature == ble::controller_supported_features_t::LE_2M_PHY - ) { - return false; - } -#endif - -#if !BLE_FEATURE_EXTENDED_ADVERTISING - if (feature == ble::controller_supported_features_t::LE_EXTENDED_ADVERTISING) { - return false; - } -#endif - -#if !BLE_FEATURE_PERIODIC_ADVERTISING - if (feature == ble::controller_supported_features_t::LE_PERIODIC_ADVERTISING) { - return false; - } -#endif - -#if !BLE_FEATURE_PRIVACY - if (feature == ble::controller_supported_features_t::LL_PRIVACY) { - return false; - } -#endif - - return impl()->isFeatureSupported_(feature); -} - -#if BLE_ROLE_BROADCASTER -template -uint8_t Gap::getMaxAdvertisingSetNumber() -{ - return impl()->getMaxAdvertisingSetNumber_(); -} - -template -uint16_t Gap::getMaxAdvertisingDataLength() -{ - return impl()->getMaxAdvertisingDataLength_(); -} - -template -uint16_t Gap::getMaxConnectableAdvertisingDataLength() -{ - return impl()->getMaxConnectableAdvertisingDataLength_(); -} - -template -uint16_t Gap::getMaxActiveSetAdvertisingDataLength() -{ - return impl()->getMaxActiveSetAdvertisingDataLength_(); -} - -#if BLE_FEATURE_EXTENDED_ADVERTISING -template -ble_error_t Gap::createAdvertisingSet( - advertising_handle_t *handle, - const AdvertisingParameters ¶meters -) -{ - return impl()->createAdvertisingSet_(handle, parameters); -} - -template -ble_error_t Gap::destroyAdvertisingSet(advertising_handle_t handle) -{ - return impl()->destroyAdvertisingSet_(handle); -} -#endif // BLE_FEATURE_EXTENDED_ADVERTISING - -template -ble_error_t Gap::setAdvertisingParameters( - advertising_handle_t handle, - const AdvertisingParameters ¶ms -) -{ - return impl()->setAdvertisingParameters_(handle, params); -} - -template -ble_error_t Gap::setAdvertisingPayload( - advertising_handle_t handle, - mbed::Span payload -) -{ - return impl()->setAdvertisingPayload_(handle, payload); -} - -template -ble_error_t Gap::setAdvertisingScanResponse( - advertising_handle_t handle, - mbed::Span response -) -{ - return impl()->setAdvertisingScanResponse_(handle, response); -} - -template -ble_error_t Gap::startAdvertising( - advertising_handle_t handle, - adv_duration_t maxDuration, - uint8_t maxEvents -) -{ - return impl()->startAdvertising_(handle, maxDuration, maxEvents); -} - -template -ble_error_t Gap::stopAdvertising(advertising_handle_t handle) -{ - return impl()->stopAdvertising_(handle); -} - -template -bool Gap::isAdvertisingActive(advertising_handle_t handle) -{ - return impl()->isAdvertisingActive_(handle); -} -#endif // BLE_ROLE_BROADCASTER - -#if BLE_FEATURE_PERIODIC_ADVERTISING -template -ble_error_t Gap::setPeriodicAdvertisingParameters( - advertising_handle_t handle, - periodic_interval_t periodicAdvertisingIntervalMin, - periodic_interval_t periodicAdvertisingIntervalMax, - bool advertiseTxPower -) -{ - return impl()->setPeriodicAdvertisingParameters_( - handle, - periodicAdvertisingIntervalMin, - periodicAdvertisingIntervalMax, - advertiseTxPower - ); -} - -template -ble_error_t Gap::setPeriodicAdvertisingPayload( - advertising_handle_t handle, - mbed::Span payload -) -{ - return impl()->setPeriodicAdvertisingPayload_(handle, payload); -} - -template -ble_error_t Gap::startPeriodicAdvertising(advertising_handle_t handle) -{ - return impl()->startPeriodicAdvertising_(handle); -} - -template -ble_error_t Gap::stopPeriodicAdvertising(advertising_handle_t handle) -{ - return impl()->stopPeriodicAdvertising_(handle); -} - -template -bool Gap::isPeriodicAdvertisingActive(advertising_handle_t handle) -{ - return impl()->isPeriodicAdvertisingActive_(handle); -} -#endif // BLE_FEATURE_PERIODIC_ADVERTISING - -#if BLE_ROLE_OBSERVER -template -ble_error_t Gap::setScanParameters(const ScanParameters ¶ms) -{ - return impl()->setScanParameters_(params); -} - -template -ble_error_t Gap::startScan( - scan_duration_t duration, - duplicates_filter_t filtering, - scan_period_t period -) -{ - return impl()->startScan_(duration, filtering, period); -} - -template -ble_error_t Gap::stopScan() -{ - return impl()->stopScan_(); -} -#endif // BLE_ROLE_OBSERVER -#if BLE_FEATURE_PERIODIC_ADVERTISING -template -ble_error_t Gap::createSync( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - uint8_t sid, - slave_latency_t maxPacketSkip, - sync_timeout_t timeout -) -{ - return impl()->createSync_( - peerAddressType, - peerAddress, - sid, - maxPacketSkip, - timeout - ); -} - -template -ble_error_t Gap::createSync( - slave_latency_t maxPacketSkip, - sync_timeout_t timeout -) -{ - return impl()->createSync_(maxPacketSkip, timeout); -} - -template -ble_error_t Gap::cancelCreateSync() -{ - return impl()->cancelCreateSync_(); -} - -template -ble_error_t Gap::terminateSync(periodic_sync_handle_t handle) -{ - return impl()->terminateSync_(handle); -} - -template -ble_error_t Gap::addDeviceToPeriodicAdvertiserList( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid -) -{ - return impl()->addDeviceToPeriodicAdvertiserList_( - peerAddressType, - peerAddress, - sid - ); -} - -template -ble_error_t Gap::removeDeviceFromPeriodicAdvertiserList( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid -) -{ - return impl()->removeDeviceFromPeriodicAdvertiserList_( - peerAddressType, - peerAddress, - sid - ); -} - -template -ble_error_t Gap::clearPeriodicAdvertiserList() -{ - return impl()->clearPeriodicAdvertiserList_(); -} - -template -uint8_t Gap::getMaxPeriodicAdvertiserListSize() -{ - return impl()->getMaxPeriodicAdvertiserListSize_(); -} -#endif // BLE_FEATURE_PERIODIC_ADVERTISING - -#if BLE_ROLE_CENTRAL -template -ble_error_t Gap::connect( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - const ConnectionParameters &connectionParams -) -{ - return impl()->connect_( - peerAddressType, - peerAddress, - connectionParams - ); -} - -template -ble_error_t Gap::cancelConnect() -{ - return impl()->cancelConnect_(); -} -#endif - -#if BLE_FEATURE_CONNECTABLE - -template -ble_error_t Gap::updateConnectionParameters( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength -) -{ - return impl()->updateConnectionParameters_( - connectionHandle, - minConnectionInterval, - maxConnectionInterval, - slaveLatency, - supervision_timeout, - minConnectionEventLength, - maxConnectionEventLength - ); -} - -template -ble_error_t Gap::manageConnectionParametersUpdateRequest( - bool userManageConnectionUpdateRequest -) -{ - return impl()->manageConnectionParametersUpdateRequest_(userManageConnectionUpdateRequest); -} - -template -ble_error_t Gap::acceptConnectionParametersUpdate( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength -) -{ - return impl()->acceptConnectionParametersUpdate_( - connectionHandle, - minConnectionInterval, - maxConnectionInterval, - slaveLatency, - supervision_timeout, - minConnectionEventLength, - maxConnectionEventLength - ); -} - -template -ble_error_t Gap::rejectConnectionParametersUpdate( - connection_handle_t connectionHandle -) -{ - return impl()->rejectConnectionParametersUpdate_(connectionHandle); -} - -template -ble_error_t Gap::disconnect( - connection_handle_t connectionHandle, - local_disconnection_reason_t reason -) -{ - return impl()->disconnect_(connectionHandle, reason); -} -#endif // BLE_FEATURE_CONNECTABLE - -#if BLE_FEATURE_PHY_MANAGEMENT -template -ble_error_t Gap::readPhy(connection_handle_t connection) -{ - return impl()->readPhy_(connection); -} - -template -ble_error_t Gap::setPreferredPhys( - const phy_set_t *txPhys, - const phy_set_t *rxPhys -) -{ - return impl()->setPreferredPhys_(txPhys, rxPhys); -} - -template -ble_error_t Gap::setPhy( - connection_handle_t connection, - const phy_set_t *txPhys, - const phy_set_t *rxPhys, - coded_symbol_per_bit_t codedSymbol -) -{ - return impl()->setPhy_( - connection, - txPhys, - rxPhys, - codedSymbol - ); -} -#endif // BLE_FEATURE_PHY_MANAGEMENT - -template -Gap::Gap() : _eventHandler(NULL) -{ -} - -template -const peripheral_privacy_configuration_t Gap::default_peripheral_privacy_configuration = { - /* use_non_resolvable_random_address */ false, - /* resolution_strategy */ peripheral_privacy_configuration_t::PERFORM_PAIRING_PROCEDURE -}; - -template -const central_privacy_configuration_t Gap::default_central_privacy_configuration = { - /* use_non_resolvable_random_address */ false, - /* resolution_strategy */ central_privacy_configuration_t::RESOLVE_AND_FORWARD -}; - -#if BLE_FEATURE_PRIVACY -template -ble_error_t Gap::enablePrivacy(bool enable) -{ - return impl()->enablePrivacy_(enable); -} - -#if BLE_ROLE_BROADCASTER -template -ble_error_t Gap::setPeripheralPrivacyConfiguration( - const peripheral_privacy_configuration_t *configuration -) -{ - return impl()->setPeripheralPrivacyConfiguration_(configuration); -} - -template -ble_error_t Gap::getPeripheralPrivacyConfiguration( - peripheral_privacy_configuration_t *configuration -) -{ - return impl()->getPeripheralPrivacyConfiguration_(configuration); -} -#endif // BLE_ROLE_BROADCASTER - -#if BLE_ROLE_OBSERVER -template -ble_error_t Gap::setCentralPrivacyConfiguration( - const central_privacy_configuration_t *configuration -) -{ - return impl()->setCentralPrivacyConfiguration_(configuration); -} - -template -ble_error_t Gap::getCentralPrivacyConfiguration( - central_privacy_configuration_t *configuration -) -{ - return impl()->getCentralPrivacyConfiguration_(configuration); -} -#endif // BLE_ROLE_OBSERVER -#endif // BLE_FEATURE_PRIVACY - -template -ble_error_t Gap::setRandomStaticAddress(const ble::address_t& address) -{ - return impl()->setRandomStaticAddress_(address); -} - - -#if BLE_FEATURE_WHITELIST -template -uint8_t Gap::getMaxWhitelistSize(void) const { - return impl()->getMaxWhitelistSize_(); -} - -template -ble_error_t Gap::getWhitelist(whitelist_t &whitelist) const { - return impl()->getWhitelist_(whitelist); -} - -template -ble_error_t Gap::setWhitelist(const whitelist_t &whitelist) { - return impl()->setWhitelist_(whitelist); -} -#endif // BLE_FEATURE_WHITELIST - -template -ble_error_t Gap::reset(void) -{ - return impl()->reset_(); -} - -// ----------------------------------------------------------------------------- -/* ------------------------- Default implementations ------------------------ */ -// ----------------------------------------------------------------------------- - -template -bool Gap::isFeatureSupported_(controller_supported_features_t feature) -{ - return false; -} - -template -uint8_t Gap::getMaxAdvertisingSetNumber_() -{ - return 1; -} - -template -uint16_t Gap::getMaxAdvertisingDataLength_() -{ - return LEGACY_ADVERTISING_MAX_SIZE; -} - -template -uint16_t Gap::getMaxConnectableAdvertisingDataLength_() -{ - return LEGACY_ADVERTISING_MAX_SIZE; -} - -template -uint16_t Gap::getMaxActiveSetAdvertisingDataLength_() -{ - return LEGACY_ADVERTISING_MAX_SIZE; -} - -template -ble_error_t Gap::createAdvertisingSet_( - advertising_handle_t *handle, - const AdvertisingParameters ¶meters -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::destroyAdvertisingSet_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setAdvertisingParameters_( - advertising_handle_t handle, - const AdvertisingParameters ¶ms -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setAdvertisingPayload_( - advertising_handle_t handle, - mbed::Span payload -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setAdvertisingScanResponse_( - advertising_handle_t handle, - mbed::Span response -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::startAdvertising_( - advertising_handle_t handle, - adv_duration_t maxDuration, - uint8_t maxEvents -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::stopAdvertising_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -bool Gap::isAdvertisingActive_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setPeriodicAdvertisingParameters_( - advertising_handle_t handle, - periodic_interval_t periodicAdvertisingIntervalMin, - periodic_interval_t periodicAdvertisingIntervalMax, - bool advertiseTxPower -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setPeriodicAdvertisingPayload_( - advertising_handle_t handle, - mbed::Span payload -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::startPeriodicAdvertising_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::stopPeriodicAdvertising_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -bool Gap::isPeriodicAdvertisingActive_(advertising_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setScanParameters_(const ScanParameters ¶ms) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::startScan_( - scan_duration_t duration, - duplicates_filter_t filtering, - scan_period_t period -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::stopScan_() -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::createSync_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - uint8_t sid, - slave_latency_t maxPacketSkip, - sync_timeout_t timeout -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::createSync_( - slave_latency_t maxPacketSkip, - sync_timeout_t timeout -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::cancelCreateSync_() -{ - return impl()->cancelCreateSync_(); -} - -template -ble_error_t Gap::terminateSync_(periodic_sync_handle_t handle) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::addDeviceToPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::removeDeviceFromPeriodicAdvertiserList_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - advertising_sid_t sid -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - - -template -ble_error_t Gap::clearPeriodicAdvertiserList_() -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -uint8_t Gap::getMaxPeriodicAdvertiserListSize_() -{ - return 0; -} - -template -ble_error_t Gap::connect_( - peer_address_type_t peerAddressType, - const address_t &peerAddress, - const ConnectionParameters &connectionParams -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::cancelConnect_() -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::updateConnectionParameters_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::manageConnectionParametersUpdateRequest_( - bool userManageConnectionUpdateRequest -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::acceptConnectionParametersUpdate_( - connection_handle_t connectionHandle, - conn_interval_t minConnectionInterval, - conn_interval_t maxConnectionInterval, - slave_latency_t slaveLatency, - supervision_timeout_t supervision_timeout, - conn_event_length_t minConnectionEventLength, - conn_event_length_t maxConnectionEventLength -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::rejectConnectionParametersUpdate_( - connection_handle_t connectionHandle -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::disconnect_( - connection_handle_t connectionHandle, - local_disconnection_reason_t reason -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::readPhy_(connection_handle_t connection) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setPreferredPhys_( - const phy_set_t *txPhys, - const phy_set_t *rxPhys -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setPhy_( - connection_handle_t connection, - const phy_set_t *txPhys, - const phy_set_t *rxPhys, - coded_symbol_per_bit_t codedSymbol -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::enablePrivacy_(bool enable) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setPeripheralPrivacyConfiguration_( - const peripheral_privacy_configuration_t *configuration -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::getPeripheralPrivacyConfiguration_( - peripheral_privacy_configuration_t *configuration -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::setCentralPrivacyConfiguration_( - const central_privacy_configuration_t *configuration -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::getCentralPrivacyConfiguration_( - central_privacy_configuration_t *configuration -) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -template -ble_error_t Gap::getAddress( - own_address_type_t &typeP, - address_t &address -) { - return impl()->getAddress_(typeP, address); -} - -template -ble_error_t Gap::reset_(void) -{ - /* Notify that the instance is about to shut down */ - shutdownCallChain.call(this); - shutdownCallChain.clear(); - - this->_eventHandler = NULL; - - return BLE_ERROR_NONE; -} - -template -ble_error_t Gap::setRandomStaticAddress_(const ble::address_t& address) -{ - return BLE_ERROR_NOT_IMPLEMENTED; -} - -} // namespace interface -} // namespace ble - diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/BleImplementationForward.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/BleImplementationForward.h deleted file mode 100644 index 5b8d55dd8d..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/BleImplementationForward.h +++ /dev/null @@ -1,165 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBED_OS_EXAMPLE_BLINKY_BLEIMPLEMENTATIONFORWARD_H -#define MBED_OS_EXAMPLE_BLINKY_BLEIMPLEMENTATIONFORWARD_H - -//////////////////////////////////////////////////////////////////////////////// -// Forward declarations of the implementation types -// -namespace ble { - - namespace interface { - - template - class LegacyGap; - - template - class Gap; - - template - class GattClient; - - template - class SecurityManager; - - template - class GattServer; - - } // namespace interface - - - namespace generic { - - template< - template class TGapImpl, - class PalSecurityManager, - class ConnectionEventMonitorEventHandler - > - class GenericGap; - - template < - template class TPalSecurityManager, - template class SigningMonitor - > - class GenericSecurityManager; - - template class TPalGattClient, class SigningMonitorEventHandler> - class GenericGattClient; - - } // namespace generic - - namespace pal { - - template - class SecurityManager; - - template - class AttClientToGattClientAdapter; - - namespace vendor { - namespace cordio { - - template - class CordioSecurityManager; - - template - class Gap; - - template - class CordioGattClient; - } // cordio - } // vendor - } // pal - - namespace vendor { - namespace cordio { - - template - class SigningEventMonitor; - - class GattServer; - - } // cordio - } // vendor -} // ble - - -// implementation assembly -namespace ble { - namespace impl { - // SECURITY MANAGER - typedef generic::GenericSecurityManager< - pal::vendor::cordio::CordioSecurityManager, - vendor::cordio::SigningEventMonitor - > GenericSecurityManagerImpl; - - typedef interface::SecurityManager SecurityManager; - - typedef GenericSecurityManagerImpl SigningEventHandler; - - typedef pal::vendor::cordio::CordioSecurityManager< - GenericSecurityManagerImpl - > PalSecurityManagerImpl; - - typedef ::ble::pal::SecurityManager< - PalSecurityManagerImpl, - GenericSecurityManagerImpl - > PalSecurityManager; - - // GAP - typedef generic::GenericGap< - pal::vendor::cordio::Gap, - PalSecurityManager, - GenericSecurityManagerImpl - > GenericGapImpl; - - typedef pal::vendor::cordio::Gap PalGapImpl; - - typedef interface::LegacyGap LegacyGap; - - typedef interface::Gap Gap; - - // GATT CLIENT - using pal::AttClientToGattClientAdapter; - using pal::vendor::cordio::CordioGattClient; - using generic::GenericGattClient; - - // construct the pal::GattClient - typedef GenericGattClient< - CordioGattClient, - SigningEventHandler - > GenericGattClientImpl; - - typedef CordioGattClient PalGattClientImpl; - - // construct the final GattClient type - typedef interface::GattClient< - GenericGattClientImpl - > GattClient; - - // GATT SERVER - typedef ble::vendor::cordio::GattServer GattServerImpl; - - typedef ble::interface::GattServer< - GattServerImpl - > GattServer; - - } // impl -} // ble - - -#endif //MBED_OS_EXAMPLE_BLINKY_BLEIMPLEMENTATIONFORWARD_H diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h deleted file mode 100644 index acde0e5539..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h +++ /dev/null @@ -1,301 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2017-2017 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef CORDIO_GATT_SERVER_H_ -#define CORDIO_GATT_SERVER_H_ - -#include -#include "ble/blecommon.h" -#include "ble/GattServer.h" -#include "ble/pal/SigningEventMonitor.h" -#include "ble/Gap.h" -#include "wsf_types.h" -#include "att_api.h" -#include "SecurityManager.h" - -/*! Maximum count of characteristics that can be stored for authorisation purposes */ -#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20 - -/*! client characteristic configuration descriptors settings */ -#define MAX_CCCD_CNT 20 - -namespace ble { - -// fwd declaration of CordioAttClient and BLE -namespace pal { -namespace vendor { -namespace cordio { -class CordioAttClient; -} -} -} - -namespace vendor { -namespace cordio { - -class BLE; - -/** - * Cordio implementation of ::GattServer - */ -class GattServer : public ::ble::interface::GattServer, - public pal::SigningEventMonitor -{ - friend ble::vendor::cordio::BLE; - friend ble::pal::vendor::cordio::CordioAttClient; - - typedef ::ble::interface::GattServer Base; - -public: - /** - * Return the singleton of the Cordio implementation of ::GattServer. - */ - static GattServer &getInstance(); - - ::GattServer::EventHandler* getEventHandler() { - return eventHandler; - } - - /** - * Initialize the GattServer and add mandatory services (generic access and - * generic attribute service). - */ - void initialize(); - - /** - * @see ::GattServer::addService - */ - ble_error_t addService_(GattService &); - - /** - * @see ::GattServer::read - */ - ble_error_t read_( - GattAttribute::Handle_t attributeHandle, - uint8_t buffer[], - uint16_t *lengthP - ); - - /** - * @see ::GattServer::read - */ - ble_error_t read_( - connection_handle_t connectionHandle, - GattAttribute::Handle_t attributeHandle, - uint8_t buffer[], uint16_t *lengthP - ); - - /** - * @see ::GattServer::write - */ - ble_error_t write_( - GattAttribute::Handle_t, - const uint8_t[], uint16_t, - bool localOnly = false - ); - - /** - * @see ::GattServer::write - */ - ble_error_t write_( - connection_handle_t connectionHandle, - GattAttribute::Handle_t, - const uint8_t[], - uint16_t, - bool localOnly = false - ); - - /** - * @see ::GattServer::areUpdatesEnabled - */ - ble_error_t areUpdatesEnabled_( - const GattCharacteristic &characteristic, bool *enabledP - ); - - /** - * @see ::GattServer::areUpdatesEnabled - */ - ble_error_t areUpdatesEnabled_( - connection_handle_t connectionHandle, - const GattCharacteristic &characteristic, - bool *enabledP - ); - - /** - * @see ::GattServer::isOnDataReadAvailable - */ - bool isOnDataReadAvailable_() const; - - /** - * @see ::GattServer::getPreferredConnectionParams - */ - ::Gap::PreferredConnectionParams_t getPreferredConnectionParams(); - - /** - * @see ::GattServer::setPreferredConnectionParams - */ - void setPreferredConnectionParams(const ::Gap::PreferredConnectionParams_t& params); - -#if 0 // Disabled until reworked and reintroduced to GattServer API - /** - * @see ::GattServer::setDeviceName - */ - ble_error_t setDeviceName(const uint8_t *deviceName); - - /** - * @see ::GattServer::getDeviceName - */ - void getDeviceName(const uint8_t*& name, uint16_t& length); - - /** - * @see ::GattServer::setAppearance - */ - void setAppearance(GapAdvertisingData::Appearance appearance); - - /** - * @see ::GattServer::getAppearance - */ - GapAdvertisingData::Appearance getAppearance(); - -#endif // Disabled until reworked and reintroduced to GattServer API - - /** - * @see ::GattServer::reset - */ - ble_error_t reset_(void); - - /** - * @see pal::SigningEventMonitor::set_signing_event_handler - */ - void set_signing_event_handler_( - impl::SigningEventHandler *signing_event_handler - ) { - _signing_event_handler = signing_event_handler; - } - - -private: - void add_default_services(); - - static uint16_t compute_attributes_count(GattService& service); - - void insert_service_attribute( - GattService& service, - attsAttr_t *&attribute_it - ); - - ble_error_t insert_characteristic( - GattCharacteristic *characteristic, - attsAttr_t *&attribute_it - ); - - bool is_characteristic_valid(GattCharacteristic *characteristic); - - void insert_characteristic_declaration_attribute( - GattCharacteristic *characteristic, - attsAttr_t *&attribute_it - ); - - ble_error_t insert_characteristic_value_attribute( - GattCharacteristic *characteristic, - attsAttr_t *&attribute_it - ); - - ble_error_t insert_descriptor( - GattCharacteristic *characteristic, - GattAttribute* descriptor, - attsAttr_t *&attribute_it, - bool& cccd_created - ); - - ble_error_t insert_cccd( - GattCharacteristic *characteristic, - attsAttr_t *&attribute_it - ); - - static void cccd_cb(attsCccEvt_t *pEvt); - static void att_cb(const attEvt_t *pEvt); - static uint8_t atts_read_cb(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr); - static uint8_t atts_write_cb(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr); - static uint8_t atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t handle); - void add_generic_access_service(); - void add_generic_attribute_service(); - void* alloc_block(size_t block_size); - GattCharacteristic* get_auth_char(uint16_t value_handle); - bool get_cccd_index_by_cccd_handle(GattAttribute::Handle_t cccd_handle, uint8_t& idx) const; - bool get_cccd_index_by_value_handle(GattAttribute::Handle_t char_handle, uint8_t& idx) const; - bool is_update_authorized(connection_handle_t connection, GattAttribute::Handle_t value_handle); - - struct alloc_block_t { - alloc_block_t* next; - uint8_t data[1]; - }; - - struct internal_service_t { - attsGroup_t attGroup; - internal_service_t *next; - }; - - impl::SigningEventHandler *_signing_event_handler; - - attsCccSet_t cccds[MAX_CCCD_CNT]; - uint16_t cccd_values[MAX_CCCD_CNT]; - uint16_t cccd_handles[MAX_CCCD_CNT]; - uint8_t cccd_cnt; - - GattCharacteristic *_auth_char[MAX_CHARACTERISTIC_AUTHORIZATION_CNT]; - uint8_t _auth_char_count; - - struct { - attsGroup_t service; - attsAttr_t attributes[7]; - uint8_t device_name_declaration_value[5]; - uint16_t device_name_length; - uint8_t appearance_declaration_value[5]; - uint16_t appearance; - uint8_t ppcp_declaration_value[5]; - uint8_t ppcp[8]; - - uint8_t*& device_name_value() { - return attributes[2].pValue; - } - } generic_access_service; - - struct { - attsGroup_t service; - attsAttr_t attributes[4]; - uint8_t service_changed_declaration[5]; - } generic_attribute_service; - - internal_service_t* registered_service; - alloc_block_t* allocated_blocks; - - uint16_t currentHandle; - - bool default_services_added; - -private: - GattServer(); - - GattServer(const GattServer &); - const GattServer& operator=(const GattServer &); -}; - -} // namespace cordio -} // namespace vendor -} // namespace ble - -#endif /* CORDIO_GATT_SERVER_H_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h deleted file mode 100644 index c858e567fa..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h +++ /dev/null @@ -1,124 +0,0 @@ -#ifndef CORDIO_PAL_GENERIC_ACCESS_SERVICE_ -#define CORDIO_PAL_GENERIC_ACCESS_SERVICE_ - -#include "ble/pal/GenericAccessService.h" -#include "CordioGattServer.h" - - -namespace ble { -namespace pal { -namespace vendor { -namespace cordio { - -/** - * Implementation of ble::pal::GenericAccessService for the Cordio stack. - */ -class GenericAccessService : public ::ble::pal::GenericAccessService { -public: - GenericAccessService() { } - - virtual ~GenericAccessService() { } - -#if 0 // Disabled until reworked and reintroduced to GattServer API - - virtual ble_error_t get_device_name_length(uint8_t& length) { -#if BLE_FEATURE_GATT_SERVER - const uint8_t* name = NULL; - uint16_t actual_length = 0; - - gatt_server().getDeviceName(name, actual_length); - length = actual_length; - - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif - } - - virtual ble_error_t get_device_name(Span& array) { -#if BLE_FEATURE_GATT_SERVER - const uint8_t* name = NULL; - uint16_t length = 0; - - gatt_server().getDeviceName(name, length); - - if (length > array.size()) { - return BLE_ERROR_PARAM_OUT_OF_RANGE; - } - - memcpy(array.data(), name, length); - - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t set_device_name(const uint8_t* device_name) { -#if BLE_FEATURE_GATT_SERVER - return gatt_server().setDeviceName(device_name); -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t get_appearance( - GapAdvertisingData::Appearance& appearance - ) { -#if BLE_FEATURE_GATT_SERVER - appearance = gatt_server().getAppearance(); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t set_appearance( - GapAdvertisingData::Appearance appearance - ) { -#if BLE_FEATURE_GATT_SERVER - gatt_server().setAppearance(appearance); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - -#endif // Disabled until reworked and reintroduced to GattServer API - - virtual ble_error_t get_peripheral_preferred_connection_parameters( - ::Gap::PreferredConnectionParams_t& parameters - ) { -#if BLE_FEATURE_GATT_SERVER - parameters = gatt_server().getPreferredConnectionParams(); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t set_peripheral_preferred_connection_parameters( - const ::Gap::PreferredConnectionParams_t& parameters - ) { -#if BLE_FEATURE_GATT_SERVER - gatt_server().setPreferredConnectionParams(parameters); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - -private: -#if BLE_FEATURE_GATT_SERVER - ble::vendor::cordio::GattServer& gatt_server() { - return ble::vendor::cordio::GattServer::getInstance(); - } -#endif // BLE_FEATURE_GATT_SERVER -}; - -} // cordio -} // vendor -} // pal -} // ble - -#endif /* CORDIO_PAL_GENERIC_ACCESS_SERVICE_ */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/SigningMonitorProxy.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/SigningMonitorProxy.h deleted file mode 100644 index efc36abf96..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/SigningMonitorProxy.h +++ /dev/null @@ -1,37 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MBED_OS_EXAMPLE_BLINKY_SIGNINGMONITORPROXY_H -#define MBED_OS_EXAMPLE_BLINKY_SIGNINGMONITORPROXY_H - -#include "ble/pal/SigningEventMonitor.h" - -namespace ble { -namespace vendor { -namespace cordio { - -template -struct SigningEventMonitor : pal::SigningEventMonitor, EventHandler> { - void set_signing_event_handler_(EventHandler *signing_event_handler); -}; - - -} -} -} - - -#endif //MBED_OS_EXAMPLE_BLINKY_SIGNINGMONITORPROXY_H diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp deleted file mode 100644 index 73265ccda0..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ble/GattServer.h" - -#include "ble/Gap.h" -#include "ble/GattClient.h" -#include "ble/SecurityManager.h" - -#include "ble/generic/GenericGap.h" -#include "ble/generic/GenericSecurityManager.h" -#include "ble/pal/PalSecurityManager.h" -#include "ble/pal/AttClientToGattClientAdapter.h" -#include "ble/pal/PalGap.h" - -#include "source/gap/Gap.tpp" -#include "source/GattClient.tpp" -#include "source/SecurityManager.tpp" - -#include "source/generic/GenericGap.tpp" -#include "source/generic/GenericGattClient.tpp" -#include "source/generic/GenericSecurityManager.tpp" - -#include "CordioPalGap.h" -#include "CordioPalSecurityManager.h" -#include "SigningMonitorProxy.h" -#include "CordioPalAttClient.h" - -#include "source/CordioPalSecurityManager.tpp" -#include "source/CordioPalGap.tpp" - -// Generic GattClient -template class ble::generic::GenericGattClient< - ble::pal::vendor::cordio::CordioGattClient, - ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor - > ->; - -typedef ble::generic::GenericGattClient< - ble::pal::vendor::cordio::CordioGattClient, - ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor - > -> GenericGattClientImpl; - -// construct the pal::GattClient -template class ble::pal::vendor::cordio::CordioGattClient< - GenericGattClientImpl ->; - -// construct the final GattClient type -template class ble::interface::GattClient< - GenericGattClientImpl ->; - - -// ---------------------------- SecurityManager -------------------------------- - -template class ble::pal::vendor::cordio::CordioSecurityManager< - ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor - > ->; - -template class ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor ->; - - -template class ble::interface::SecurityManager< - ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor - > ->; - -// --------------------------------- Gap --------------------------------------- - -typedef ble::generic::GenericSecurityManager< - ble::pal::vendor::cordio::CordioSecurityManager, - ble::vendor::cordio::SigningEventMonitor -> SecurityManagerImpl; - -template class ble::pal::vendor::cordio::Gap< - ble::generic::GenericGap< - ble::pal::vendor::cordio::Gap, - SecurityManagerImpl::PalSecurityManager, - SecurityManagerImpl - > ->; - -template class ble::generic::GenericGap< - ble::pal::vendor::cordio::Gap, - SecurityManagerImpl::PalSecurityManager, - SecurityManagerImpl ->; - -template class ble::interface::Gap< - ble::generic::GenericGap< - ble::pal::vendor::cordio::Gap, - SecurityManagerImpl::PalSecurityManager, - SecurityManagerImpl - > ->; diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalAttClient.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalAttClient.cpp deleted file mode 100644 index 02111dd1be..0000000000 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalAttClient.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2019 ARM Limited - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "CordioPalAttClient.h" -#include "CordioBLE.h" - -namespace ble { -namespace pal { -namespace vendor { -namespace cordio { - -void CordioAttClient::att_client_handler(const attEvt_t* event) -{ -#if BLE_FEATURE_GATT_CLIENT - if (event->hdr.status == ATT_SUCCESS && event->hdr.event == ATT_MTU_UPDATE_IND) { - ble::vendor::cordio::BLE& ble = ble::vendor::cordio::BLE::deviceInstance(); - impl::PalGattClientImpl::EventHandler *handler = ble.getPalGattClient().get_event_handler(); - if (handler) { - handler->on_att_mtu_change(event->hdr.param, event->mtu); - } - } else if (event->hdr.event == ATTC_WRITE_CMD_RSP) { - ble::vendor::cordio::BLE& ble = ble::vendor::cordio::BLE::deviceInstance(); - impl::PalGattClientImpl::EventHandler *handler = ble.getPalGattClient().get_event_handler(); - if (handler) { - handler->on_write_command_sent( - event->hdr.param, - event->handle, - event->hdr.status - ); - } - } else { - // all handlers are stored in a static array - static const event_handler_t handlers[] = { - &timeout_event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler, - &event_handler - }; - - // event->hdr.param: connection handle - // event->header.event: opcode from the request - // event->header.status: success or error code ... - // event->pValue: starting after opcode for response; starting after opcode + handle for server initiated responses. - // event->handle: handle for server initiated responses - - // traverse all handlers and execute them with the event in input. - // exit if an handler has handled the event. - for(size_t i = 0; i < (sizeof(handlers)/sizeof(handlers[0])); ++i) { - if (handlers[i](event)) { - return; - } - } - } -#endif // BLE_FEATURE_GATT_CLIENT - -#if BLE_FEATURE_GATT_SERVER - // pass events not handled to the server side - ble::vendor::cordio::GattServer::getInstance().att_cb(event); -#endif // BLE_FEATURE_GATT_SERVER -} - -} // cordio -} // vendor -} // pal -} // ble