STM32WB-WBA Connection Oriented Channel – COC

Revision as of 16:03, 13 April 2023 by Registered User (→‎STM32WB - Connection Oriented Channel)

1. STM32WB - Connection Oriented Channel

A COC allows the exchange of BLE data at L2CAP layer without GATT layer. There is no notion of client/server, only central and peripheral.
To set a COC logical link, it is necessary to establish first a BLE link.
Over this BLE link, one or several COC can be established.


1.1. BLE connection and COC establishment

1.1.1. On central side

  • Initiate a BLE link: send aci_gap_create_connection
  • Wait for HCI_LE_CONNECTION_COMPLETE_EVENT
  • Initiate a CoC connection: ACI_L2CAP_COC_CONNECT
  • Wait for ACI_L2CAP_COC_CONNECT_CONFIRM_EVENT(get channel_index_list)

Range of channel_index_list for the COC initiator : from 0 to 0x1F

1.1.2. On peripheral side

  • Start advertising: send aci_gap_set_discoverable
  • Wait for HCI_LE_CONNECTION_COMPLETE_EVENT
  • Wait for ACI_L2CAP_COC_CONNECT_EVENT
  • Send ACI_L2CAP_COC_CONNECT_CONFIRM
  • In hci_command_complete_event, get Channel_number and Channel_Index_List values

Range of channel_index_list for the COC peripheral: from 0x20 to 0x3F

1.2. COC data exchange - from peripheral to central

1.2.1. On peripheral side

Send ACI_L2CAP_COC_TX_DATA (Channel_Index, length, data)

Channel_Index_list get from hci_command_complete_event of ACI_L2CAP_COC_CONNECT_CONFIRM

1.2.2. On central side

Reception of ACI_L2CAP_COC_RX_DATA_EVENT

1.3. COC data exchange - from central to peripheral

1.3.1. On central side

Send ACI_L2CAP_COC_TX_DATA (Channel_Index, length, data)

Channel_Index get in ACI_L2CAP_COC_CONNECT_CONFIRM_EVENT

1.3.2. On peripheral side

Reception of ACI_L2CAP_COC_RX_DATA_EVENT

1.4. Example of BLE connection, COC establishment and data exchange

BLE and COC link establishment



COC data exchange