
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
71
Ver.1.0.0
BLE_PHY_1M
=
BIT
(
0
),
BLE_PHY_2M
=
BIT
(
1
),
Note: TLSR8232 could only use symmetric PHY, that is, Rx and Tx use the same PHY.
Please see section 2M PHY Supported for usage.
3.2.8 Controller API
3.2.8.1 Controller API Brief
In standard BLE stack architecture (see Figure 3-1), APP layer cannot directly
communicate with Link Layer of Controller, i.e. data of APP layer must be first transferred
to Host, and then Host can transfer control command to Link Layer via HCI. All control
commands from Host to LL via HCI follow the definition in BLE Spec
Core_v5.0
, please
refer to
Core_v5.0
(Vol 2/Part E/ Host Controller Interface Functional Specification).
5316 BLE SDK based on standard BLE architecture can serve as a Controller and work
together with Host system. Therefore, all APIs to operate Link Layer strictly follow the
data format of Host commands in the spec.
Although the architecture in
Figure 3-4 is used in 5316 BLE SDK, APP layer can directly operate Link Layer, it still
uses the standard APIs of HCI part. Corresponding Host commands in Spec are provided
in the API introduction below. Users can refer to the detailed descriptions in Spec.
In BLE S
pec, all HCI commands to operate Controller have corresponding “HCI
command complete event
” or “HCI command status event” as response to Host layer.
However, in Telink BLE SDK, there are different situations:
1) For applications such as 5316_hci, Telink IC only serves as BLE controller, and
needs to work together with BLE Host MCU. Each HCI command will generate
corresponding “HCI command complete event” or “HCI command status event”.
2) The processing is different for master. As 5316 does not support master we do not
provide detailed information here.
Controller API declaration is available in head files
under “stack/ble/ll” and “stack/ble/hci”.
Corresponding to Link Layer state machine functions, the “ll” directory contains ll.h,
ll_adv.h, and ll_slave.h, e.g. APIs related to advertising function should be in ll_adv.h.
3.2.8.2 API Return Type ble_sts_t
An enum type “ble_sts_t” defined in “stack/ble/ble_common.h” is used as return value
type for most APIs in SDK. When API calling with right parameter setting is accepted by
the protocol stack, it will return BLE_SUCCESS, value being
“0”; if any non-zero value is
returned, it indicates a unique error type. All possible return values and corresponding
error reason will be listed in the subsections below for each API.
The
“ble_sts_t” applies to APIs of all layers, including APIs of Link Layer.
3.2.8.3 MAC Address Initialization
In this document, “BLE MAC address” refers to “public address” and “random static
address
” by default.