Skip to content

Commit dc66204

Browse files
cordio host sources updated
1 parent 7ed16fb commit dc66204

File tree

201 files changed

+14968
-4650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+14968
-4650
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json

Lines changed: 5 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -53,6 +53,11 @@
53
"max-prepared-writes": {
53
"max-prepared-writes": {
54
"help": "Number of queued prepare writes supported by server.",
54
"help": "Number of queued prepare writes supported by server.",
55
"value": 4
55
"value": 4
56+
},
57+
"cmac-calculation": {
58+
"help": "Where the CBC MAC calculatio is performed. Valid values are 0 (host) and 1 (controller through HCI).",
59+
"value": 1,
60+
"macro_name": "SEC_CCM_CFG"
56
}
61
}
57
}
62
}
58
}
63
}

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioBLE.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -41,6 +41,10 @@
41
/*! WSF handler ID */
41
/*! WSF handler ID */
42
wsfHandlerId_t stack_handler_id;
42
wsfHandlerId_t stack_handler_id;
43

43

44+
/* WSF heap allocation */
45+
uint8_t *SystemHeapStart;
46+
uint32_t SystemHeapSize;
47+
44
/**
48
/**
45
* Weak definition of ble_cordio_get_hci_driver.
49
* Weak definition of ble_cordio_get_hci_driver.
46
* A runtime error is generated if the user does not define any
50
* A runtime error is generated if the user does not define any
@@ -369,15 +373,19 @@ void BLE::stack_setup()
369

373

370
buf_pool_desc_t buf_pool_desc = _hci_driver->get_buffer_pool_description();
374
buf_pool_desc_t buf_pool_desc = _hci_driver->get_buffer_pool_description();
371

375

376+
// use the buffer for the WSF heap
377+
SystemHeapStart = buf_pool_desc.buffer_memory;
378+
SystemHeapSize = buf_pool_desc.buffer_size;
379+
372
// Initialize buffers with the ones provided by the HCI driver
380
// Initialize buffers with the ones provided by the HCI driver
373-
uint16_t bytes_used = WsfBufInit(
381+
uint16_t bytes_used = WsfBufInit(buf_pool_desc.pool_count, (wsfBufPoolDesc_t*)buf_pool_desc.pool_description);
374-
buf_pool_desc.buffer_size, buf_pool_desc.buffer_memory,
375-
buf_pool_desc.pool_count, buf_pool_desc.pool_description
376-
);
377

382

378
// Raise assert if not enough memory was allocated
383
// Raise assert if not enough memory was allocated
379
MBED_ASSERT(bytes_used != 0);
384
MBED_ASSERT(bytes_used != 0);
380

385

386+
SystemHeapStart += bytes_used;
387+
SystemHeapSize -= bytes_used;
388+
381
// This warning will be raised if we've allocated too much memory
389
// This warning will be raised if we've allocated too much memory
382
if(bytes_used < buf_pool_desc.buffer_size)
390
if(bytes_used < buf_pool_desc.buffer_size)
383
{
391
{

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.tpp

Lines changed: 2 additions & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -365,7 +365,7 @@ ble_error_t CordioSecurityManager<EventHandler>::set_peer_csrk_(
365
}
365
}
366
}
366
}
367

367

368-
AttsSetCsrk(connection, _peer_csrks[connection_index]->data(), authenticated);
368+
AttsSetCsrk(connection, _peer_csrks[connection_index]->data());
369
AttsSetSignCounter(connection, sign_counter);
369
AttsSetSignCounter(connection, sign_counter);
370
return BLE_ERROR_NONE;
370
return BLE_ERROR_NONE;
371
}
371
}
@@ -384,7 +384,7 @@ ble_error_t CordioSecurityManager<EventHandler>::remove_peer_csrk_(connection_ha
384
_peer_csrks[connection_index] = NULL;
384
_peer_csrks[connection_index] = NULL;
385
}
385
}
386

386

387-
AttsSetCsrk(connection, NULL, false);
387+
AttsSetCsrk(connection, NULL);
388
return BLE_ERROR_NONE;
388
return BLE_ERROR_NONE;
389
}
389
}
390

390

0 commit comments

Comments
 (0)