You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/FEATURE_BLE/targets/TARGET_CORDIO/doc/PortingGuide.md
+18-25Lines changed: 18 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,17 +41,18 @@ Include an HCI driver for the BLE module used by the target, and a factory funct
41
41
42
42
1. Navigate to the folder of the BLE API that hosts the target port `features/FEATURE_BLE/targets`.
43
43
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.
45
46
46
47
#### Create the HCI driver
47
48
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.
49
50
50
51
More information about the architecture can be found in [HCI abstraction architecture](HCIAbstraction.md).
51
52
52
53
#### HCITransport
53
54
54
-
<spanclass="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
+
<spanclass="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>
55
56
56
57
To code an empty transport driver:
57
58
@@ -85,9 +86,11 @@ private:
85
86
86
87
It inherits publicly from the base class `CordioHCITransportDriver`.
87
88
89
+
##### Functions
90
+
88
91
***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.
89
92
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.
91
94
92
95
***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.
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:
454
447
455
448
```
456
449
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