| BlueNRG-1 ACI APIs and events callbacks

- Main Page
- Modules
- Classes
- Files

Classes | Typedefs | Functions
HCI events

HCI events layer. More...

## Classes

struct | Handle_Packets_Pair_Entry_t_s

## Typedefs

typedef struct Handle_Packets_Pair_Entry_t_s | Handle_Packets_Pair_Entry_t

## Functions

void | hci_disconnection_complete_event (uint8_t Status, uint16_t Connection_Handle, uint8_t Reason)
| The Disconnection Complete event occurs when a connection is terminated. The status parameter indicates if the disconnection was successful or not. The reason parameter indicates the reason for the disconnection if the disconnection was successful. If the disconnection was not successful, the value of the reason parameter can be ignored by the Host. For example, this can be the case if the Host has issued the Disconnect command and there was a parameter error, or the command was not presently allowed, or a Connection_Handle that didn't correspond to a connection was given. More...
void | hci_encryption_change_event (uint8_t Status, uint16_t Connection_Handle, uint8_t Encryption_Enabled)
| The Encryption Change event is used to indicate that the change of the encryption mode has been completed. The Connection_Handle will be a Connection_Handle for an ACL connection. The Encryption_Enabled event parameter specifies the new Encryption_Enabled parameter for the Connection_Handle specified by the Connection_Handle event parameter. This event will occur on both devices to notify the Hosts when Encryption has changed for the specified Connection_Handle between two devices. Note: This event shall not be generated if encryption is paused or resumed; during a role switch, for example. The meaning of the Encryption_Enabled parameter depends on whether the Host has indicated support for Secure Connections in the Secure_Connections_Host_Support parameter. When Secure_Connections_Host_Support is 'disabled' or the Connection_Handle refers to an LE link, the Controller shall only use Encryption_Enabled values 0x00 (OFF) and 0x01 (ON). When Secure_Connections_Host_Support is 'enabled' and the Connection_Handle refers to a BR/EDR link, the Controller shall set Encryption_Enabled to 0x00 when encryption is off, to 0x01 when encryption is on and using E0 and to 0x02 when encryption is on and using AES-CCM. More...
void | hci_read_remote_version_information_complete_event (uint8_t Status, uint16_t Connection_Handle, uint8_t Version, uint16_t Manufacturer_Name, uint16_t Subversion)
| The Read Remote Version Information Complete event is used to indicate the completion of the process obtaining the version information of the remote Controller specified by the Connection_Handle event parameter. The Connection_Handle shall be for an ACL connection. The Version event parameter defines the specification version of the BR/EDR or LE Controller. The Manufacturer_Name event parameter indicates the manufacturer of the remote Controller. The Subversion event parameter is controlled by the manufacturer and is implementation dependent. The Subversion event parameter defines the various revisions that each version of the Bluetooth hardware will go through as design processes change and errors are fixed. This allows the software to determine what Bluetooth hardware is being used and, if necessary, to work around various bugs in the hardware. When the Connection_Handle is associated with a BR/EDR ACL-U logical link, the Version event parameter shall be LMP VersNr parameter, the Manufacturer_Name event parameter shall be the CompId parameter, and the Subversion event parameter shall be the LMP SubVersNr parameter. When the Connection_Handle is associated with an LE-U logical link, the Version event parameter shall be Link Layer VersNr parameter, the Manufacturer_Name event parameter shall be the CompId parameter, and the Subversion event parameter shall be the SubVersNr parameter. More...
void | hci_hardware_error_event (uint8_t Hardware_Code)
| The Hardware Error event is used to indicate some implementation specific type of hardware failure for the controller. This event is used to notify the Host that a hardware failure has occurred in the Controller. More...
void | hci_number_of_completed_packets_event (uint8_t Number_of_Handles, Handle_Packets_Pair_Entry_t Handle_Packets_Pair_Entry[])
| The Number Of Completed Packets event is used by the Controller to indicate to the Host how many HCI Data Packets have been completed (transmitted or flushed) for each Connection_Handle since the previous Number Of Completed Packets event was sent to the Host. This means that the corresponding buffer space has been freed in the Controller. Based on this information, and the HC_Total_Num_ACL_Data_Packets and HC_Total_Num_Synchronous_- Data_Packets return parameter of the Read_Buffer_Size command, the Host can determine for which Connection_Handles the following HCI Data Packets should be sent to the Controller. The Number Of Completed Packets event must not be sent before the corresponding Connection Complete event. While the Controller has HCI data packets in its buffer, it must keep sending the Number Of Completed Packets event to the Host at least periodically, until it finally reports that all the pending ACL Data Packets have been transmitted or flushed. More...
void | hci_data_buffer_overflow_event (uint8_t Link_Type)
| This event is used to indicate that the Controller's data buffers have been overflowed. This can occur if the Host has sent more packets than allowed. The Link_Type parameter is used to indicate that the overflow was caused by ACL data. More...
void | hci_encryption_key_refresh_complete_event (uint8_t Status, uint16_t Connection_Handle)
| The Encryption Key Refresh Complete event is used to indicate to the Host that the encryption key was refreshed on the given Connection_Handle any time encryption is paused and then resumed. If the Encryption Key Refresh Complete event was generated due to an encryption pause and resume operation embedded within a change connection link key procedure, the Encryption Key Refresh Complete event shall be sent prior to the Change Connection Link Key Complete event. If the Encryption Key Refresh Complete event was generated due to an encryption pause and resume operation embedded within a role switch procedure, the Encryption Key Refresh Complete event shall be sent prior to the Role Change event. More...

## Detailed Description

HCI events layer.

## Typedef Documentation

typedef struct Handle_Packets_Pair_Entry_t_s Handle_Packets_Pair_Entry_t

Documentation for Handle_Packets_Pair_Entry_t

## Function Documentation

void hci_data_buffer_overflow_event | ( | uint8_t | Link_Type | ) |

This event is used to indicate that the Controller's data buffers have been overflowed. This can occur if the Host has sent more packets than allowed. The Link_Type parameter is used to indicate that the overflow was caused by ACL data.

Parameters

  Link_Type | 0x00 Synchronous Buffer Overflow (Voice Channels). 0x01 ACL Buffer Overflow (Data Channels). 0x02-0xFF Reserved for future use.

Return values

  None |

void hci_disconnection_complete_event | ( | uint8_t | Status,
|  | uint16_t | Connection_Handle,
|  | uint8_t | Reason
| ) |  |

The Disconnection Complete event occurs when a connection is terminated. The status parameter indicates if the disconnection was successful or not. The reason parameter indicates the reason for the disconnection if the disconnection was successful. If the disconnection was not successful, the value of the reason parameter can be ignored by the Host. For example, this can be the case if the Host has issued the Disconnect command and there was a parameter error, or the command was not presently allowed, or a Connection_Handle that didn't correspond to a connection was given.

Parameters

  Status | Error code
  Connection_Handle | Connection_Handle which was disconnected. Range: 0x0000-0x0EFF (0x0F00 - 0x0FFF Reserved for future use)
  Reason | Reason for disconnection.

Return values

  None |

void hci_encryption_change_event | ( | uint8_t | Status,
|  | uint16_t | Connection_Handle,
|  | uint8_t | Encryption_Enabled
| ) |  |

The Encryption Change event is used to indicate that the change of the encryption mode has been completed. The Connection_Handle will be a Connection_Handle for an ACL connection. The Encryption_Enabled event parameter specifies the new Encryption_Enabled parameter for the Connection_Handle specified by the Connection_Handle event parameter. This event will occur on both devices to notify the Hosts when Encryption has changed for the specified Connection_Handle between two devices. Note: This event shall not be generated if encryption is paused or resumed; during a role switch, for example. The meaning of the Encryption_Enabled parameter depends on whether the Host has indicated support for Secure Connections in the Secure_Connections_Host_Support parameter. When Secure_Connections_Host_Support is 'disabled' or the Connection_Handle refers to an LE link, the Controller shall only use Encryption_Enabled values 0x00 (OFF) and 0x01 (ON). When Secure_Connections_Host_Support is 'enabled' and the Connection_Handle refers to a BR/EDR link, the Controller shall set Encryption_Enabled to 0x00 when encryption is off, to 0x01 when encryption is on and using E0 and to 0x02 when encryption is on and using AES-CCM.

Parameters

  Status | Error code
  Connection_Handle | Connection handle for which the command is given. Range: 0x0000-0x0EFF (0x0F00 - 0x0FFF Reserved for future use)
  Encryption_Enabled | - 0x00 Link Level Encryption is OFF
  - 0x01 Link Level Encryption is ON with E0 for BR/EDR Link Level Encryption is ON with AES-CCM for LE
  - 0x02 Link Level Encryption is ON with AES-CCM for BR/EDR
  - 0x03-0xFF Reserved.

Return values

  None |

void hci_encryption_key_refresh_complete_event | ( | uint8_t | Status,
|  | uint16_t | Connection_Handle
| ) |  |

The Encryption Key Refresh Complete event is used to indicate to the Host that the encryption key was refreshed on the given Connection_Handle any time encryption is paused and then resumed. If the Encryption Key Refresh Complete event was generated due to an encryption pause and resume operation embedded within a change connection link key procedure, the Encryption Key Refresh Complete event shall be sent prior to the Change Connection Link Key Complete event. If the Encryption Key Refresh Complete event was generated due to an encryption pause and resume operation embedded within a role switch procedure, the Encryption Key Refresh Complete event shall be sent prior to the Role Change event.

Parameters

  Status | Error code
  Connection_Handle | Connection handle for which the command is given. Range: 0x0000-0x0EFF (0x0F00 - 0x0FFF Reserved for future use)

Return values

  None |

void hci_hardware_error_event | ( | uint8_t | Hardware_Code | ) |

The Hardware Error event is used to indicate some implementation specific type of hardware failure for the controller. This event is used to notify the Host that a hardware failure has occurred in the Controller.

Parameters

  Hardware_Code | Hardware Error Event code. Error code 0 means that an error on the SPI bus has been detected, most likely caused by incorrect SPI configuration on the external micro-controller. Error code 0x01 and 0x02 are errors caused by a slow crystal startup and they are an indication that the HS_STARTUP_TIME in the device configuration needs to be tuned. After this event is recommended to hardware reset the device.

Return values

  None |

void hci_number_of_completed_packets_event | ( | uint8_t | Number_of_Handles,
|  | Handle_Packets_Pair_Entry_t | Handle_Packets_Pair_Entry[]
| ) |  |

The Number Of Completed Packets event is used by the Controller to indicate to the Host how many HCI Data Packets have been completed (transmitted or flushed) for each Connection_Handle since the previous Number Of Completed Packets event was sent to the Host. This means that the corresponding buffer space has been freed in the Controller. Based on this information, and the HC_Total_Num_ACL_Data_Packets and HC_Total_Num_Synchronous_- Data_Packets return parameter of the Read_Buffer_Size command, the Host can determine for which Connection_Handles the following HCI Data Packets should be sent to the Controller. The Number Of Completed Packets event must not be sent before the corresponding Connection Complete event. While the Controller has HCI data packets in its buffer, it must keep sending the Number Of Completed Packets event to the Host at least periodically, until it finally reports that all the pending ACL Data Packets have been transmitted or flushed.

Parameters

  Number_of_Handles | The number of Connection_Handles and Num_HCI_Data_Packets parameters pairs contained in this event
  Handle_Packets_Pair_Entry | See Handle_Packets_Pair_Entry_t

Return values

  None |

void hci_read_remote_version_information_complete_event | ( | uint8_t | Status,
|  | uint16_t | Connection_Handle,
|  | uint8_t | Version,
|  | uint16_t | Manufacturer_Name,
|  | uint16_t | Subversion
| ) |  |

The Read Remote Version Information Complete event is used to indicate the completion of the process obtaining the version information of the remote Controller specified by the Connection_Handle event parameter. The Connection_Handle shall be for an ACL connection. The Version event parameter defines the specification version of the BR/EDR or LE Controller. The Manufacturer_Name event parameter indicates the manufacturer of the remote Controller. The Subversion event parameter is controlled by the manufacturer and is implementation dependent. The Subversion event parameter defines the various revisions that each version of the Bluetooth hardware will go through as design processes change and errors are fixed. This allows the software to determine what Bluetooth hardware is being used and, if necessary, to work around various bugs in the hardware. When the Connection_Handle is associated with a BR/EDR ACL-U logical link, the Version event parameter shall be LMP VersNr parameter, the Manufacturer_Name event parameter shall be the CompId parameter, and the Subversion event parameter shall be the LMP SubVersNr parameter. When the Connection_Handle is associated with an LE-U logical link, the Version event parameter shall be Link Layer VersNr parameter, the Manufacturer_Name event parameter shall be the CompId parameter, and the Subversion event parameter shall be the SubVersNr parameter.

Parameters

  Status | Error code
  Connection_Handle | Connection handle for which the command is given. Range: 0x0000-0x0EFF (0x0F00 - 0x0FFF Reserved for future use)
  Version | Version of the Current LMP in the remote Controller
  Manufacturer_Name | Manufacturer Name of the remote Controller
  Subversion | Subversion of the LMP in the remote Controller

Return values

  None |