mirror of https://github.com/ARMmbed/mbed-os.git
Amend Nordic HCI driver to support BLE5 features
parent
1b3efa4ccd
commit
3ce1d91d35
|
@ -36,6 +36,7 @@
|
||||||
#include "wsf_buf.h"
|
#include "wsf_buf.h"
|
||||||
#include "wsf_timer.h"
|
#include "wsf_timer.h"
|
||||||
#include "wsf_trace.h"
|
#include "wsf_trace.h"
|
||||||
|
#include "dm_api.h"
|
||||||
|
|
||||||
// Nordic Includes
|
// Nordic Includes
|
||||||
#include "nrf.h"
|
#include "nrf.h"
|
||||||
|
@ -55,7 +56,7 @@ using namespace ble::vendor::nordic;
|
||||||
using namespace ble::vendor::cordio;
|
using namespace ble::vendor::cordio;
|
||||||
|
|
||||||
/*! \brief Memory that should be reserved for the stack. */
|
/*! \brief Memory that should be reserved for the stack. */
|
||||||
#define CORDIO_LL_MEMORY_FOOTPRINT 3776UL
|
#define CORDIO_LL_MEMORY_FOOTPRINT 31234UL
|
||||||
|
|
||||||
/*! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
|
/*! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
|
||||||
#define LL_IMPL_REV 0x2303
|
#define LL_IMPL_REV 0x2303
|
||||||
|
@ -94,11 +95,11 @@ const LlRtCfg_t NRFCordioHCIDriver::_ll_cfg = {
|
||||||
/* Device */
|
/* Device */
|
||||||
/*compId*/ LL_COMP_ID_ARM,
|
/*compId*/ LL_COMP_ID_ARM,
|
||||||
/*implRev*/ LL_IMPL_REV,
|
/*implRev*/ LL_IMPL_REV,
|
||||||
/*btVer*/ LL_VER_BT_CORE_SPEC_4_2,
|
/*btVer*/ LL_VER_BT_CORE_SPEC_5_0,
|
||||||
0, // padding
|
0, // padding
|
||||||
/* Advertiser */
|
/* Advertiser */
|
||||||
/*maxAdvSets*/ 0, /* Disable extended advertising. */
|
/*maxAdvSets*/ 2, // 2 Extended Advertising Sets
|
||||||
/*maxAdvReports*/ 4,
|
/*maxAdvReports*/ 8,
|
||||||
/*maxExtAdvDataLen*/ advDataLen,
|
/*maxExtAdvDataLen*/ advDataLen,
|
||||||
/*defExtAdvDataFrag*/ 64,
|
/*defExtAdvDataFrag*/ 64,
|
||||||
0, // Aux delay
|
0, // Aux delay
|
||||||
|
@ -263,7 +264,7 @@ void NRFCordioHCIDriver::do_initialize()
|
||||||
// If a submodule does not have enough space to allocate its memory from buffer, it will still allocate its memory (and do a buffer overflow) and return 0 (as in 0 byte used)
|
// If a submodule does not have enough space to allocate its memory from buffer, it will still allocate its memory (and do a buffer overflow) and return 0 (as in 0 byte used)
|
||||||
// however that method will still continue which will lead to undefined behaviour
|
// however that method will still continue which will lead to undefined behaviour
|
||||||
// So whenever a change of configuration is done, it's a good idea to set CORDIO_LL_MEMORY_FOOTPRINT to a high value and then reduce accordingly
|
// So whenever a change of configuration is done, it's a good idea to set CORDIO_LL_MEMORY_FOOTPRINT to a high value and then reduce accordingly
|
||||||
uint32_t mem_used = LlInitControllerInit(&ll_init_cfg);
|
uint32_t mem_used = LlInitControllerExtInit(&ll_init_cfg);
|
||||||
if( mem_used < CORDIO_LL_MEMORY_FOOTPRINT )
|
if( mem_used < CORDIO_LL_MEMORY_FOOTPRINT )
|
||||||
{
|
{
|
||||||
// Sub-optimal, give warning
|
// Sub-optimal, give warning
|
||||||
|
@ -288,6 +289,14 @@ void NRFCordioHCIDriver::do_terminate()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NRFCordioHCIDriver::start_reset_sequence()
|
||||||
|
{
|
||||||
|
// Make sure extended adv is init
|
||||||
|
DmExtAdvInit();
|
||||||
|
|
||||||
|
CordioHCIDriver::start_reset_sequence();
|
||||||
|
}
|
||||||
|
|
||||||
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
|
ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
|
||||||
static NRFCordioHCITransportDriver transport_driver;
|
static NRFCordioHCITransportDriver transport_driver;
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Start the reset sequence of the BLE module.
|
* Start the reset sequence of the BLE module.
|
||||||
*/
|
*/
|
||||||
//virtual void start_reset_sequence();
|
virtual void start_reset_sequence();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle HCI messages received during the reset sequence.
|
* Handle HCI messages received during the reset sequence.
|
||||||
|
|
Loading…
Reference in New Issue