Skip to content

Commit 3b95202

Browse files
author
Melinda Weed
committed
Final review and grammatical changes
1 parent 1082724 commit 3b95202

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/doc/PortingGuide.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@ Include an HCI driver for the BLE module used by the target, and a factory funct
4141

4242
1. Navigate to the folder of the BLE API that hosts the target port `features/FEATURE_BLE/targets`.
4343

44-
1. Create a folder containing the port code to isolate it from other code. Begin this folder's name with `TARGET_` and the rest of the name in capital letters.
44+
1. Create a folder containing the port code to isolate it from other code.
45+
* Begin this folder's name with `TARGET_` and the rest of the name in capital letters.
4546

4647
#### Create the HCI driver
4748

48-
The HCI driver is split in two entities. One handles HCI communication with the Bluetooth module. The other handles initialization, reset sequence, and memory dedicated to the Bluetooth controller.
49+
The HCI driver is split into two entities. One handles HCI communication with the Bluetooth module. The other handles the initialization, reset sequence, and memory dedicated to the Bluetooth controller.
4950

5051
More information about the architecture can be found in [HCI abstraction architecture](HCIAbstraction.md).
5152

5253
#### HCITransport
5354

54-
<span class="notes">**Note:** If the Bluetooth controller uses an H4 communication interface and the host exposes serial flow control in Mbed, then you can skip this step. Use the class `ble::vendor::cordio::H4TransportDriver` as the transport driver.</span>
55+
<span class="notes">**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.</span>
5556

5657
To code an empty transport driver:
5758

@@ -85,9 +86,11 @@ private:
8586

8687
It inherits publicly from the base class `CordioHCITransportDriver`.
8788

89+
##### Functions
90+
8891
* **Initialization/termination**: The functions `initialize` and `terminate` are responsible for initializing and terminating the transport driver. It is not necessary to initialize the transport in the constructor.
8992

90-
* **Sending data**: The function `write` sends data in input to the Bluetooth controller and return the number of bytes in the `data` buffer sent. Depending on the type of transport you implement, you may need to send the packet `type` to the controller before the packet data.
93+
* **Sending data**: The function `write` sends data as input to the Bluetooth controller and returns the number of bytes in the `data` buffer sent. Depending on the type of transport you implement, you may need to send the packet `type` to the controller before the packet data.
9194

9295
* **Receiving data**: Inject HCI data from the Bluetooth controller to the system by calling `on_data_received`. This is a static function provided by the base class.
9396

@@ -239,20 +242,17 @@ void HCIDriver::handle_reset_sequence(uint8_t *pMsg) {
239242
case HCI_OPCODE_RESET:
240243
/* initialize rand command count */
241244
randCnt = 0;
242-
// Set the event mask to control which events are generated by the
243-
// controller for the host.
245+
// Set the event mask to control which events are generated by the controller for the host.
244246
HciSetEventMaskCmd((uint8_t *) hciEventMask);
245247
break;
246248
247249
case HCI_OPCODE_SET_EVENT_MASK:
248-
// Set the event mask to control which LE events are generated by
249-
// the controller for the host.
250+
// Set the event mask to control which LE events are generated by the controller for the host.
250251
HciLeSetEventMaskCmd((uint8_t *) hciLeEventMask);
251252
break;
252253
253254
case HCI_OPCODE_LE_SET_EVENT_MASK:
254-
// Set the event mask to control which events are generated by the
255-
// controller for the host (2nd page of flags).
255+
// Set the event mask to control which events are generated by the controller for the host (2nd page of flags).
256256
HciSetEventMaskPage2Cmd((uint8_t *) hciEventMaskPage2);
257257
break;
258258
@@ -277,24 +277,20 @@ void HCIDriver::handle_reset_sequence(uint8_t *pMsg) {
277277
/* initialize ACL buffer accounting */
278278
hciCoreCb.availBufs = hciCoreCb.numBufs;
279279
280-
// Read the states and state combinations supported by the link
281-
// layer of the controller.
280+
// Read the states and state combinations supported by the link layer of the controller.
282281
HciLeReadSupStatesCmd();
283282
break;
284283
285284
case HCI_OPCODE_LE_READ_SUP_STATES:
286-
// Store supported state and combination in the runtime parameters
287-
// of the stack.
285+
// Store supported state and combination in the runtime parameters of the stack.
288286
memcpy(hciCoreCb.leStates, pMsg, HCI_LE_STATES_LEN);
289287
290-
// Read the total of whitelist entries that can be stored in the
291-
// controller.
288+
// Read the total of whitelist entries that can be stored in the controller.
292289
HciLeReadWhiteListSizeCmd();
293290
break;
294291
295292
case HCI_OPCODE_LE_READ_WHITE_LIST_SIZE:
296-
// Store the number of whitelist entries in the stack runtime
297-
// parameters.
293+
// Store the number of whitelist entries in the stack runtime parameters.
298294
BSTREAM_TO_UINT8(hciCoreCb.whiteListSize, pMsg);
299295
300296
// Read the LE features supported by the controller.
@@ -305,18 +301,15 @@ void HCIDriver::handle_reset_sequence(uint8_t *pMsg) {
305301
// Store the set of LE features supported by the controller.
306302
BSTREAM_TO_UINT16(hciCoreCb.leSupFeat, pMsg);
307303
308-
// Read the total number of address translation entries which can be
309-
// stored in the controller resolving list.
304+
// Read the total number of address translation entries which can be stored in the controller resolving list.
310305
hciCoreReadResolvingListSize();
311306
break;
312307
313308
case HCI_OPCODE_LE_READ_RES_LIST_SIZE:
314-
// Store the number of address translation entries in the stack
315-
// runtime parameter.
309+
// Store the number of address translation entries in the stack runtime parameter.
316310
BSTREAM_TO_UINT8(hciCoreCb.resListSize, pMsg);
317311
318-
// Read the Controller’s maximum supported payload octets and packet
319-
// duration times for transmission and reception.
312+
// Read the Controller’s maximum supported payload octets and packet duration times for transmission and reception.
320313
hciCoreReadMaxDataLen();
321314
break;
322315
@@ -450,7 +443,7 @@ ble::vendor::cordio::CordioHCIDriver& ble_cordio_get_hci_driver() {
450443

451444
### Tests
452445

453-
We bundle Greentea tests with the Cordio port of the BLE API, so the transport driver works, as well as validation of Cordio stack initialization. You can run these tests with the following command:
446+
We bundle Greentea tests with the Cordio port of the BLE API, so the transport driver and validation of Cordio stack initialization both work. You can run these tests with the following command:
454447

455448
```
456449
mbed test -t <toolchain> -m <target> -n mbed-os-features-feature_ble-targets-target_cordio-tests-cordio_hci-driver,mbed-os-features-feature_ble-targets-target_cordio-tests-cordio_hci-transport

0 commit comments

Comments
 (0)