/** ****************************************************************************** * @file ble_events.h * @author GPM WBL Application team * @brief Header file for Bluetooth Low Energy stack events callbacks * Autogenerated files, do not edit!! ****************************************************************************** * @attention * * Copyright (c) 2024 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ #ifndef _BLE_EVENTS_H_ #define _BLE_EVENTS_H_ #include "compiler.h" #include "ble_types.h" /** * @brief Format of packets coming from BLE Stack. */ typedef PACKED(struct) _hci_pckt{ uint8_t type; /*!< Type of packet. For possible values see @ref HCI_pckt_type */ uint8_t data[0]; /*!< HCI data packets. Format depends on type field. It can be casted to one of @ref HCI_data_pckt_structs */ } hci_pckt; /** @defgroup HCI_pckt_type HCI packet type * @{ */ #define HCI_COMMAND_PKT_TYPE 0x01U /*!< Not used. */ #define HCI_ACLDATA_PKT_TYPE 0x02U #define HCI_EVENT_PKT_TYPE 0x04U #define HCI_ISODATA_PKT_TYPE 0x05U #define HCI_COMMAND_EXT_PKT_TYPE 0x81U /*!< Not used. */ #define HCI_EVENT_EXT_PKT_TYPE 0x82U #define HCI_VENDOR_PKT_TYPE 0xFFU /*!< Not used. */ /** * @} */ /** @defgroup HCI_data_pckt_structs Structures for HCI data packets * @{ */ /** * @brief Packet format of events. * * This is data field of hci_pckt if type field is equal to HCI_EVENT_PKT_TYPE. */ typedef PACKED(struct) _hci_event_pckt{ uint8_t evt; /*!< One of @ref HCI_evt_code */ uint8_t plen; /*!< Parameter Total Length, i.e. length of data field. */ uint8_t data[0]; /*!< Event payload. To be casted to one of event struct types of @ref HCI_evt_structs. */ } hci_event_pckt; /** * @brief Packet format of extended proprietary events. * * This is data field of hci_pckt if type field is equal to HCI_EVENT_EXT_PKT_TYPE. */ typedef PACKED(struct) _hci_event_ext_pckt{ uint8_t evt; /*!< HCI_VENDOR_EVT_CODE is the only allowed value. */ uint16_t plen; /*!< Parameter Total Length, i.e. length of data field. */ uint8_t data[0]; /*!< Event payload. To be casted to one of event struct types of @ref HCI_evt_structs. Current possible type is only aci_blecore_event. */ } hci_event_ext_pckt; /** * @brief Packet format of ACL data packets. * * This is data field of hci_pckt if type field is equal to HCI_ACLDATA_PKT_TYPE. */ typedef PACKED(struct) _hci_acl_data_pckt{ uint16_t handle_flags; /*!< This field includes Handle (12 bits), PB Flag (2 bits) and BC Flag (2 bits). */ uint16_t dlen; /*!< Data Total Length. */ uint8_t data[0]; /*!< Data. */ } hci_acl_data_pckt; /** * @brief Packet format of ISO data packets. * * This is data field of hci_pckt if type field is equal to HCI_ISODATA_PKT_TYPE. */ typedef PACKED(struct) _hci_iso_data_pckt{ uint16_t handle_flags; /*!< This field includes Handle (12 bits), PB Flag (2 bits) and TS Flag (1 bit). */ uint16_t dlen; /*!< Data Total Length (14 bits used, 2 msb are reserved). */ uint8_t data[0]; /*!< Data. Format is described in Core v5.4 Vol. 4, part E, section 5.4.5. */ } hci_iso_data_pckt; /** * @} */ /** @defgroup HCI_evt_code HCI event codes * @{ */ #define HCI_DISCONNECTION_COMPLETE_EVT_CODE 0x05 #define HCI_ENCRYPTION_CHANGE_EVT_CODE 0x08 #define HCI_READ_REMOTE_VERSION_INFORMATION_COMPLETE_EVT_CODE 0x0C #define HCI_HARDWARE_ERROR_EVT_CODE 0x10 #define HCI_NUMBER_OF_COMPLETED_PACKETS_EVT_CODE 0x13 #define HCI_DATA_BUFFER_OVERFLOW_EVT_CODE 0x1A #define HCI_ENCRYPTION_KEY_REFRESH_COMPLETE_EVT_CODE 0x30 #define HCI_AUTHENTICATED_PAYLOAD_TIMEOUT_EXPIRED_EVT_CODE 0x57 #define HCI_LE_META_EVT_CODE 0x3E #define HCI_VENDOR_EVT_CODE 0xFF /** * @} */ /* Structs for events are never allocated. They are only used to cast a specific event type. For this reason, this macro has no much importance for events. */ #define HCI_MAX_PAYLOAD_SIZE 532 /** @defgroup HCI_evt_structs HCI event structures * Types to be used to cast data field of @ref hci_event_pckt type * @{ */ typedef PACKED(struct) hci_disconnection_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Reason; } hci_disconnection_complete_event_rp0; typedef PACKED(struct) hci_encryption_change_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Encryption_Enabled; } hci_encryption_change_event_rp0; typedef PACKED(struct) hci_read_remote_version_information_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Version; uint16_t Manufacturer_Name; uint16_t Subversion; } hci_read_remote_version_information_complete_event_rp0; typedef PACKED(struct) hci_hardware_error_event_rp0_s { uint8_t Hardware_Code; } hci_hardware_error_event_rp0; typedef PACKED(struct) hci_number_of_completed_packets_event_rp0_s { uint8_t Number_of_Handles; packed_Handle_Packets_Pair_Entry_t Handle_Packets_Pair_Entry[(HCI_MAX_PAYLOAD_SIZE - 1)/sizeof(packed_Handle_Packets_Pair_Entry_t)]; } hci_number_of_completed_packets_event_rp0; typedef PACKED(struct) hci_data_buffer_overflow_event_rp0_s { uint8_t Link_Type; } hci_data_buffer_overflow_event_rp0; typedef PACKED(struct) hci_encryption_key_refresh_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; } hci_encryption_key_refresh_complete_event_rp0; typedef PACKED(struct) hci_authenticated_payload_timeout_expired_event_rp0_s { uint16_t Connection_Handle; } hci_authenticated_payload_timeout_expired_event_rp0; /** * @brief Format of Standard LE Meta Events * * This is data field of @ref hci_event_pckt if evt field is equal to HCI_LE_META_EVT_CODE. */ typedef PACKED(struct) hci_le_meta_event_s { uint8_t subevent; /*!< A value of @ref HCI_le_meta_evt_code. */ uint8_t data[0]; /*!< LE Meta event. To be casted to a struct of @ref HCI_le_meta_evt_structs. */ } hci_le_meta_event; /** * @brief Format of proprietary events. * * This is data field of @ref hci_event_pckt or @ref hci_event_ext_pckt if evt field is equal to HCI_VENDOR_EVT_CODE. */ typedef PACKED(struct) aci_blecore_event_s { uint16_t ecode; /*!< A value of @ref ACI_evt_code. */ uint8_t data[0]; /*!< Proprietary event parameters. To be casted to a struct of @ref ACI_evt_structs. */ } aci_blecore_event; /** * @} */ /** @defgroup HCI_le_meta_evt_code HCI LE Meta subevent codes * Codes found in subevent field of hci_le_meta_event struct. * @{ */ #define HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE 0x01 #define HCI_LE_ADVERTISING_REPORT_SUBEVT_CODE 0x02 #define HCI_LE_CONNECTION_UPDATE_COMPLETE_SUBEVT_CODE 0x03 #define HCI_LE_READ_REMOTE_FEATURES_COMPLETE_SUBEVT_CODE 0x04 #define HCI_LE_LONG_TERM_KEY_REQUEST_SUBEVT_CODE 0x05 #define HCI_LE_DATA_LENGTH_CHANGE_SUBEVT_CODE 0x07 #define HCI_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE_SUBEVT_CODE 0x08 #define HCI_LE_GENERATE_DHKEY_COMPLETE_SUBEVT_CODE 0x09 #define HCI_LE_ENHANCED_CONNECTION_COMPLETE_SUBEVT_CODE 0x0A #define HCI_LE_DIRECTED_ADVERTISING_REPORT_SUBEVT_CODE 0x0B #define HCI_LE_PHY_UPDATE_COMPLETE_SUBEVT_CODE 0x0C #define HCI_LE_EXTENDED_ADVERTISING_REPORT_SUBEVT_CODE 0x0D #define HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_SUBEVT_CODE 0x0E #define HCI_LE_PERIODIC_ADVERTISING_REPORT_SUBEVT_CODE 0x0F #define HCI_LE_PERIODIC_ADVERTISING_SYNC_LOST_SUBEVT_CODE 0x10 #define HCI_LE_SCAN_TIMEOUT_SUBEVT_CODE 0x11 #define HCI_LE_ADVERTISING_SET_TERMINATED_SUBEVT_CODE 0x12 #define HCI_LE_SCAN_REQUEST_RECEIVED_SUBEVT_CODE 0x13 #define HCI_LE_CHANNEL_SELECTION_ALGORITHM_SUBEVT_CODE 0x14 #define HCI_LE_CONNECTIONLESS_IQ_REPORT_SUBEVT_CODE 0x15 #define HCI_LE_CONNECTION_IQ_REPORT_SUBEVT_CODE 0x16 #define HCI_LE_CTE_REQUEST_FAILED_SUBEVT_CODE 0x17 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_SUBEVT_CODE 0x18 #define HCI_LE_CIS_ESTABLISHED_SUBEVT_CODE 0x19 #define HCI_LE_CIS_REQUEST_SUBEVT_CODE 0x1A #define HCI_LE_CREATE_BIG_COMPLETE_SUBEVT_CODE 0x1B #define HCI_LE_TERMINATE_BIG_COMPLETE_SUBEVT_CODE 0x1C #define HCI_LE_BIG_SYNC_ESTABLISHED_SUBEVT_CODE 0x1D #define HCI_LE_BIG_SYNC_LOST_SUBEVT_CODE 0x1E #define HCI_LE_REQUEST_PEER_SCA_COMPLETE_SUBEVT_CODE 0x1F #define HCI_LE_PATH_LOSS_THRESHOLD_SUBEVT_CODE 0x20 #define HCI_LE_TRANSMIT_POWER_REPORTING_SUBEVT_CODE 0x21 #define HCI_LE_BIGINFO_ADVERTISING_REPORT_SUBEVT_CODE 0x22 #define HCI_LE_SUBRATE_CHANGE_SUBEVT_CODE 0x23 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHED_V2_SUBEVT_CODE 0x24 #define HCI_LE_PERIODIC_ADVERTISING_REPORT_V2_SUBEVT_CODE 0x25 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECEIVED_V2_SUBEVT_CODE 0x26 #define HCI_LE_PERIODIC_ADVERTISING_SUBEVENT_DATA_REQUEST_SUBEVT_CODE 0x27 #define HCI_LE_PERIODIC_ADVERTISING_RESPONSE_REPORT_SUBEVT_CODE 0x28 #define HCI_LE_ENHANCED_CONNECTION_COMPLETE_V2_SUBEVT_CODE 0x29 /** * @} */ /** @defgroup HCI_le_meta_evt_structs HCI LE Meta event structures * Types to be used to cast data field of hci_le_meta_event type * @{ */ typedef PACKED(struct) hci_le_connection_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Role; uint8_t Peer_Address_Type; uint8_t Peer_Address[6]; uint16_t Connection_Interval; uint16_t Peripheral_Latency; uint16_t Supervision_Timeout; uint8_t Central_Clock_Accuracy; } hci_le_connection_complete_event_rp0; typedef PACKED(struct) hci_le_advertising_report_event_rp0_s { uint8_t Num_Reports; packed_Advertising_Report_t Advertising_Report; /* N elements of variable size */ } hci_le_advertising_report_event_rp0; typedef PACKED(struct) hci_le_connection_update_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint16_t Connection_Interval; uint16_t Peripheral_Latency; uint16_t Supervision_Timeout; } hci_le_connection_update_complete_event_rp0; typedef PACKED(struct) hci_le_read_remote_features_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t LE_Features[8]; } hci_le_read_remote_features_complete_event_rp0; typedef PACKED(struct) hci_le_long_term_key_request_event_rp0_s { uint16_t Connection_Handle; uint8_t Random_Number[8]; uint16_t Encrypted_Diversifier; } hci_le_long_term_key_request_event_rp0; typedef PACKED(struct) hci_le_data_length_change_event_rp0_s { uint16_t Connection_Handle; uint16_t MaxTxOctets; uint16_t MaxTxTime; uint16_t MaxRxOctets; uint16_t MaxRxTime; } hci_le_data_length_change_event_rp0; typedef PACKED(struct) hci_le_read_local_p256_public_key_complete_event_rp0_s { uint8_t Status; uint8_t Local_P256_Public_Key[64]; } hci_le_read_local_p256_public_key_complete_event_rp0; typedef PACKED(struct) hci_le_generate_dhkey_complete_event_rp0_s { uint8_t Status; uint8_t DHKey[32]; } hci_le_generate_dhkey_complete_event_rp0; typedef PACKED(struct) hci_le_enhanced_connection_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Role; uint8_t Peer_Address_Type; uint8_t Peer_Address[6]; uint8_t Local_Resolvable_Private_Address[6]; uint8_t Peer_Resolvable_Private_Address[6]; uint16_t Connection_Interval; uint16_t Peripheral_Latency; uint16_t Supervision_Timeout; uint8_t Central_Clock_Accuracy; } hci_le_enhanced_connection_complete_event_rp0; typedef PACKED(struct) hci_le_directed_advertising_report_event_rp0_s { uint8_t Num_Reports; packed_Direct_Advertising_Report_t Direct_Advertising_Report[(HCI_MAX_PAYLOAD_SIZE - 1)/sizeof(packed_Direct_Advertising_Report_t)]; } hci_le_directed_advertising_report_event_rp0; typedef PACKED(struct) hci_le_phy_update_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t TX_PHY; uint8_t RX_PHY; } hci_le_phy_update_complete_event_rp0; typedef PACKED(struct) hci_le_extended_advertising_report_event_rp0_s { uint8_t Num_Reports; packed_Extended_Advertising_Report_t Extended_Advertising_Report; /* N elements of variable size */ } hci_le_extended_advertising_report_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_sync_established_event_rp0_s { uint8_t Status; uint16_t Sync_Handle; uint8_t Advertising_SID; uint8_t Advertiser_Address_Type; uint8_t Advertiser_Address[6]; uint8_t Advertiser_PHY; uint16_t Periodic_Advertising_Interval; uint8_t Advertiser_Clock_Accuracy; } hci_le_periodic_advertising_sync_established_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_report_event_rp0_s { uint16_t Sync_Handle; int8_t TX_Power; int8_t RSSI; uint8_t CTE_Type; uint8_t Data_Status; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 7)/sizeof(uint8_t)]; } hci_le_periodic_advertising_report_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_sync_lost_event_rp0_s { uint16_t Sync_Handle; } hci_le_periodic_advertising_sync_lost_event_rp0; typedef PACKED(struct) hci_le_advertising_set_terminated_event_rp0_s { uint8_t Status; uint8_t Advertising_Handle; uint16_t Connection_Handle; uint8_t Num_Completed_Extended_Advertising_Events; } hci_le_advertising_set_terminated_event_rp0; typedef PACKED(struct) hci_le_scan_request_received_event_rp0_s { uint8_t Advertising_Handle; uint8_t Scanner_Address_Type; uint8_t Scanner_Address[6]; } hci_le_scan_request_received_event_rp0; typedef PACKED(struct) hci_le_channel_selection_algorithm_event_rp0_s { uint16_t Connection_Handle; uint8_t Channel_Selection_Algorithm; } hci_le_channel_selection_algorithm_event_rp0; typedef PACKED(struct) hci_le_connectionless_iq_report_event_rp0_s { uint16_t Sync_Handle; uint8_t Channel_Index; int16_t RSSI; uint8_t RSSI_Antenna_ID; uint8_t CTE_Type; uint8_t Slot_Durations; uint8_t Packet_Status; uint16_t Periodic_Event_Counter; uint8_t Sample_Count; packed_Samples_t Samples[(HCI_MAX_PAYLOAD_SIZE - 12)/sizeof(packed_Samples_t)]; } hci_le_connectionless_iq_report_event_rp0; typedef PACKED(struct) hci_le_connection_iq_report_event_rp0_s { uint16_t Connection_Handle; uint8_t RX_PHY; uint8_t Data_Channel_Index; int16_t RSSI; uint8_t RSSI_Antenna_ID; uint8_t CTE_Type; uint8_t Slot_Durations; uint8_t Packet_Status; uint16_t Connection_Event_Counter; uint8_t Sample_Count; packed_Samples_t Samples[(HCI_MAX_PAYLOAD_SIZE - 13)/sizeof(packed_Samples_t)]; } hci_le_connection_iq_report_event_rp0; typedef PACKED(struct) hci_le_cte_request_failed_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; } hci_le_cte_request_failed_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_sync_transfer_received_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint16_t Service_data; uint16_t Sync_Handle; uint8_t Advertising_SID; uint8_t Advertiser_Address_Type; uint8_t Advertiser_Address[6]; uint8_t Advertiser_PHY; uint16_t Periodic_Advertising_Interval; uint8_t Advertiser_Clock_Accuracy; } hci_le_periodic_advertising_sync_transfer_received_event_rp0; typedef PACKED(struct) hci_le_cis_established_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t CIG_Sync_Delay[3]; uint8_t CIS_Sync_Delay[3]; uint8_t Transport_Latency_C_To_P[3]; uint8_t Transport_Latency_P_To_C[3]; uint8_t PHY_C_To_P; uint8_t PHY_P_To_C; uint8_t NSE; uint8_t BN_C_To_P; uint8_t BN_P_To_C; uint8_t FT_C_To_P; uint8_t FT_P_To_C; uint16_t Max_PDU_C_To_P; uint16_t Max_PDU_P_To_C; uint16_t ISO_Interval; } hci_le_cis_established_event_rp0; typedef PACKED(struct) hci_le_cis_request_event_rp0_s { uint16_t ACL_Connection_Handle; uint16_t CIS_Connection_Handle; uint8_t CIG_ID; uint8_t CIS_ID; } hci_le_cis_request_event_rp0; typedef PACKED(struct) hci_le_create_big_complete_event_rp0_s { uint8_t Status; uint8_t BIG_Handle; uint8_t BIG_Sync_Delay[3]; uint8_t Transport_Latency_BIG[3]; uint8_t PHY; uint8_t NSE; uint8_t BN; uint8_t PTO; uint8_t IRC; uint16_t Max_PDU; uint16_t ISO_Interval; uint8_t Num_BIS; uint16_t Connection_Handle[(HCI_MAX_PAYLOAD_SIZE - 18)/sizeof(uint16_t)]; } hci_le_create_big_complete_event_rp0; typedef PACKED(struct) hci_le_terminate_big_complete_event_rp0_s { uint8_t BIG_Handle; uint8_t Reason; } hci_le_terminate_big_complete_event_rp0; typedef PACKED(struct) hci_le_big_sync_established_event_rp0_s { uint8_t Status; uint8_t BIG_Handle; uint8_t Transport_Latency_BIG[3]; uint8_t NSE; uint8_t BN; uint8_t PTO; uint8_t IRC; uint16_t Max_PDU; uint16_t ISO_Interval; uint8_t Num_BIS; uint16_t Connection_Handle[(HCI_MAX_PAYLOAD_SIZE - 14)/sizeof(uint16_t)]; } hci_le_big_sync_established_event_rp0; typedef PACKED(struct) hci_le_big_sync_lost_event_rp0_s { uint8_t BIG_Handle; uint8_t Reason; } hci_le_big_sync_lost_event_rp0; typedef PACKED(struct) hci_le_request_peer_sca_complete_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Peer_Clock_Accuracy; } hci_le_request_peer_sca_complete_event_rp0; typedef PACKED(struct) hci_le_path_loss_threshold_event_rp0_s { uint16_t Connection_Handle; uint8_t Current_Path_Loss; uint8_t Zone_Entered; } hci_le_path_loss_threshold_event_rp0; typedef PACKED(struct) hci_le_transmit_power_reporting_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Reason; uint8_t PHY; int8_t Transmit_Power_Level; uint8_t Transmit_Power_Level_Flag; int8_t Delta; } hci_le_transmit_power_reporting_event_rp0; typedef PACKED(struct) hci_le_biginfo_advertising_report_event_rp0_s { uint16_t Sync_Handle; uint8_t Num_BIS; uint8_t NSE; uint16_t ISO_Interval; uint8_t BN; uint8_t PTO; uint8_t IRC; uint16_t Max_PDU; uint8_t SDU_Interval[3]; uint16_t Max_SDU; uint8_t PHY; uint8_t Framing; uint8_t Encryption; } hci_le_biginfo_advertising_report_event_rp0; typedef PACKED(struct) hci_le_subrate_change_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint16_t Subrate_Factor; uint16_t Peripheral_Latency; uint16_t Continuation_Number; uint16_t Supervision_Timeout; } hci_le_subrate_change_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_sync_established_v2_event_rp0_s { uint8_t Status; uint16_t Sync_Handle; uint8_t Advertising_SID; uint8_t Advertiser_Address_Type; uint8_t Advertiser_Address[6]; uint8_t Advertiser_PHY; uint16_t Periodic_Advertising_Interval; uint8_t Advertiser_Clock_Accuracy; uint8_t Num_Subevents; uint8_t Subevent_Interval; uint8_t Response_Slot_Delay; uint8_t Response_Slot_Spacing; } hci_le_periodic_advertising_sync_established_v2_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_report_v2_event_rp0_s { uint16_t Sync_Handle; int8_t TX_Power; int8_t RSSI; uint8_t CTE_Type; uint16_t Periodic_Event_Counter; uint8_t Subevent; uint8_t Data_Status; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 10)/sizeof(uint8_t)]; } hci_le_periodic_advertising_report_v2_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_sync_transfer_received_v2_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint16_t Service_data; uint16_t Sync_Handle; uint8_t Advertising_SID; uint8_t Advertiser_Address_Type; uint8_t Advertiser_Address[6]; uint8_t Advertiser_PHY; uint16_t Periodic_Advertising_Interval; uint8_t Advertiser_Clock_Accuracy; uint8_t Num_Subevents; uint8_t Subevent_Interval; uint8_t Response_Slot_Delay; uint8_t Response_Slot_Spacing; } hci_le_periodic_advertising_sync_transfer_received_v2_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_subevent_data_request_event_rp0_s { uint8_t Advertising_Handle; uint8_t Subevent_Start; uint8_t Subevent_Data_Count; } hci_le_periodic_advertising_subevent_data_request_event_rp0; typedef PACKED(struct) hci_le_periodic_advertising_response_report_event_rp0_s { uint8_t Advertising_Handle; uint8_t Subevent; uint8_t Tx_Status; uint8_t Num_Responses; packed_Periodic_Advertising_Response_t Periodic_Advertising_Response; /* N elements of variable size */ } hci_le_periodic_advertising_response_report_event_rp0; typedef PACKED(struct) hci_le_enhanced_connection_complete_v2_event_rp0_s { uint8_t Status; uint16_t Connection_Handle; uint8_t Role; uint8_t Peer_Address_Type; uint8_t Peer_Address[6]; uint8_t Local_Resolvable_Private_Address[6]; uint8_t Peer_Resolvable_Private_Address[6]; uint16_t Connection_Interval; uint16_t Peripheral_Latency; uint16_t Supervision_Timeout; uint8_t Central_Clock_Accuracy; uint8_t Advertising_Handle; uint16_t Sync_Handle; } hci_le_enhanced_connection_complete_v2_event_rp0; /** * @} */ /** @defgroup ACI_evt_code ACI proprietary event codes * Codes found in ecode field of aci_blecore_event struct. * @{ */ /* Vendor specific codes of ACI GAP events */ #define ACI_HAL_END_OF_RADIO_ACTIVITY_VSEVT_CODE 0x0004 #define ACI_HAL_FW_ERROR_VSEVT_CODE 0x0006 #define ACI_HAL_ADV_SCAN_RESP_DATA_UPDATE_VSEVT_CODE 0x0010 #define ACI_HAL_PAWR_DATA_FREE_VSEVT_CODE 0x0011 #define ACI_GAP_LIMITED_DISCOVERABLE_VSEVT_CODE 0x0400 #define ACI_GAP_PAIRING_COMPLETE_VSEVT_CODE 0x0401 #define ACI_GAP_PASSKEY_REQ_VSEVT_CODE 0x0402 #define ACI_GAP_PROC_COMPLETE_VSEVT_CODE 0x0407 #define ACI_GAP_ADDR_NOT_RESOLVED_VSEVT_CODE 0x0408 #define ACI_GAP_NUMERIC_COMPARISON_VALUE_VSEVT_CODE 0x0409 #define ACI_GAP_KEYPRESS_NOTIFICATION_VSEVT_CODE 0x040A #define ACI_GAP_PAIRING_VSEVT_CODE 0x040B #define ACI_L2CAP_CONNECTION_UPDATE_RESP_VSEVT_CODE 0x0800 #define ACI_L2CAP_PROC_TIMEOUT_VSEVT_CODE 0x0801 #define ACI_L2CAP_CONNECTION_UPDATE_REQ_VSEVT_CODE 0x0802 #define ACI_L2CAP_COS_DISCONNECTION_COMPLETE_VSEVT_CODE 0x0804 #define ACI_L2CAP_COS_FLOW_CONTROL_CREDIT_VSEVT_CODE 0x0805 #define ACI_L2CAP_COS_SDU_DATA_TX_VSEVT_CODE 0x0806 #define ACI_L2CAP_COS_RECONFIGURATION_VSEVT_CODE 0x0809 #define ACI_L2CAP_COMMAND_REJECT_VSEVT_CODE 0x080A #define ACI_L2CAP_COS_SDU_DATA_RX_VSEVT_CODE 0x080D #define ACI_L2CAP_COS_CONNECTION_REQ_VSEVT_CODE 0x080E #define ACI_L2CAP_COS_CONNECTION_RESP_VSEVT_CODE 0x080F #define ACI_GATT_SRV_ATTRIBUTE_MODIFIED_VSEVT_CODE 0x0C01 #define ACI_GATT_PROC_TIMEOUT_VSEVT_CODE 0x0C02 #define ACI_ATT_EXCHANGE_MTU_RESP_VSEVT_CODE 0x0C03 #define ACI_ATT_CLT_FIND_INFO_RESP_VSEVT_CODE 0x0C04 #define ACI_ATT_CLT_FIND_BY_TYPE_VALUE_RESP_VSEVT_CODE 0x0C05 #define ACI_ATT_CLT_READ_BY_TYPE_RESP_VSEVT_CODE 0x0C06 #define ACI_ATT_CLT_READ_RESP_VSEVT_CODE 0x0C07 #define ACI_ATT_CLT_READ_BLOB_RESP_VSEVT_CODE 0x0C08 #define ACI_ATT_CLT_READ_MULTIPLE_RESP_VSEVT_CODE 0x0C09 #define ACI_ATT_CLT_READ_BY_GROUP_TYPE_RESP_VSEVT_CODE 0x0C0A #define ACI_ATT_CLT_PREPARE_WRITE_RESP_VSEVT_CODE 0x0C0C #define ACI_ATT_CLT_EXEC_WRITE_RESP_VSEVT_CODE 0x0C0D #define ACI_GATT_CLT_INDICATION_VSEVT_CODE 0x0C0E #define ACI_GATT_CLT_NOTIFICATION_VSEVT_CODE 0x0C0F #define ACI_GATT_CLT_PROC_COMPLETE_VSEVT_CODE 0x0C10 #define ACI_GATT_CLT_ERROR_RESP_VSEVT_CODE 0x0C11 #define ACI_GATT_CLT_DISC_READ_CHAR_BY_UUID_RESP_VSEVT_CODE 0x0C12 #define ACI_GATT_TX_POOL_AVAILABLE_VSEVT_CODE 0x0C16 #define ACI_GATT_SRV_CONFIRMATION_VSEVT_CODE 0x0C17 #define ACI_GATT_SRV_READ_VSEVT_CODE 0x0C19 #define ACI_GATT_SRV_WRITE_VSEVT_CODE 0x0C1A #define ACI_ATT_SRV_PREPARE_WRITE_REQ_VSEVT_CODE 0x0C1B #define ACI_ATT_SRV_EXEC_WRITE_REQ_VSEVT_CODE 0x0C1C #define ACI_ATT_CLT_READ_MULTIPLE_VAR_LEN_RESP_VSEVT_CODE 0x0C1E /** * @} */ /** @defgroup ACI_evt_structs Proprietary ACI event structures * Types to be used to cast data field of hci_event_pckt type or * hci_event_ext_pckt type. * @{ */ typedef PACKED(struct) aci_hal_end_of_radio_activity_event_rp0_s { uint8_t Last_State; uint8_t Next_State; uint32_t Next_State_SysTime; } aci_hal_end_of_radio_activity_event_rp0; typedef PACKED(struct) aci_hal_fw_error_event_rp0_s { uint8_t FW_Error_Type; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 2)/sizeof(uint8_t)]; } aci_hal_fw_error_event_rp0; typedef PACKED(struct) aci_hal_adv_scan_resp_data_update_event_rp0_s { void * Old_Pointer; void * New_Pointer; } aci_hal_adv_scan_resp_data_update_event_rp0; typedef PACKED(struct) aci_hal_pawr_data_free_event_rp0_s { void * Buffer; uint8_t Type; } aci_hal_pawr_data_free_event_rp0; typedef PACKED(struct) aci_gap_pairing_complete_event_rp0_s { uint16_t Connection_Handle; uint8_t Status; uint8_t Reason; } aci_gap_pairing_complete_event_rp0; typedef PACKED(struct) aci_gap_passkey_req_event_rp0_s { uint16_t Connection_Handle; uint8_t Display_Input; } aci_gap_passkey_req_event_rp0; typedef PACKED(struct) aci_gap_proc_complete_event_rp0_s { uint8_t Procedure_Code; uint8_t Status; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 3)/sizeof(uint8_t)]; } aci_gap_proc_complete_event_rp0; typedef PACKED(struct) aci_gap_addr_not_resolved_event_rp0_s { uint16_t Connection_Handle; } aci_gap_addr_not_resolved_event_rp0; typedef PACKED(struct) aci_gap_numeric_comparison_value_event_rp0_s { uint16_t Connection_Handle; uint32_t Numeric_Value; } aci_gap_numeric_comparison_value_event_rp0; typedef PACKED(struct) aci_gap_keypress_notification_event_rp0_s { uint16_t Connection_Handle; uint8_t Notification_Type; } aci_gap_keypress_notification_event_rp0; typedef PACKED(struct) aci_gap_pairing_event_rp0_s { uint16_t Connection_Handle; uint8_t Bonded; } aci_gap_pairing_event_rp0; typedef PACKED(struct) aci_l2cap_connection_update_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t Result; } aci_l2cap_connection_update_resp_event_rp0; typedef PACKED(struct) aci_l2cap_proc_timeout_event_rp0_s { uint16_t Connection_Handle; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 3)/sizeof(uint8_t)]; } aci_l2cap_proc_timeout_event_rp0; typedef PACKED(struct) aci_l2cap_connection_update_req_event_rp0_s { uint16_t Connection_Handle; uint8_t Identifier; uint16_t L2CAP_Length; uint16_t Connection_Interval_Min; uint16_t Connection_Interval_Max; uint16_t Max_Latency; uint16_t Timeout_Multiplier; } aci_l2cap_connection_update_req_event_rp0; typedef PACKED(struct) aci_l2cap_cos_disconnection_complete_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; } aci_l2cap_cos_disconnection_complete_event_rp0; typedef PACKED(struct) aci_l2cap_cos_flow_control_credit_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t TX_Credits; uint16_t TX_Credit_Balance; } aci_l2cap_cos_flow_control_credit_event_rp0; typedef PACKED(struct) aci_l2cap_cos_sdu_data_tx_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t SDU_Length; uint16_t TX_Credit_Balance; } aci_l2cap_cos_sdu_data_tx_event_rp0; typedef PACKED(struct) aci_l2cap_cos_reconfiguration_event_rp0_s { uint16_t Connection_Handle; uint8_t Event_Type; uint16_t Result; uint8_t Identifier; uint16_t Peer_MTU; uint16_t Peer_MPS; uint8_t CID_Count; uint16_t Local_CID[(HCI_MAX_PAYLOAD_SIZE - 11)/sizeof(uint16_t)]; } aci_l2cap_cos_reconfiguration_event_rp0; typedef PACKED(struct) aci_l2cap_command_reject_event_rp0_s { uint16_t Connection_Handle; uint8_t Identifier; uint16_t Reason; uint8_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 6)/sizeof(uint8_t)]; } aci_l2cap_command_reject_event_rp0; typedef PACKED(struct) aci_l2cap_cos_sdu_data_rx_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t RX_Credit_Balance; uint16_t SDU_Length; } aci_l2cap_cos_sdu_data_rx_event_rp0; typedef PACKED(struct) aci_l2cap_cos_connection_req_event_rp0_s { uint16_t Connection_Handle; uint8_t Channel_Type; uint8_t Identifier; uint16_t SPSM; uint16_t Peer_MTU; uint16_t Peer_MPS; uint16_t Initial_Credits; uint8_t CID_Count; } aci_l2cap_cos_connection_req_event_rp0; typedef PACKED(struct) aci_l2cap_cos_connection_resp_event_rp0_s { uint16_t Connection_Handle; uint8_t Channel_Type; uint16_t Peer_MTU; uint16_t Peer_MPS; uint16_t Initial_Credits; uint16_t Result; uint8_t CID_Count; uint16_t CID[(HCI_MAX_PAYLOAD_SIZE - 12)/sizeof(uint16_t)]; } aci_l2cap_cos_connection_resp_event_rp0; typedef PACKED(struct) aci_gatt_srv_attribute_modified_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attr_Handle; uint16_t Attr_Data_Length; uint8_t Attr_Data[(HCI_MAX_PAYLOAD_SIZE - 8)/sizeof(uint8_t)]; } aci_gatt_srv_attribute_modified_event_rp0; typedef PACKED(struct) aci_gatt_proc_timeout_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; } aci_gatt_proc_timeout_event_rp0; typedef PACKED(struct) aci_att_exchange_mtu_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t MTU; } aci_att_exchange_mtu_resp_event_rp0; typedef PACKED(struct) aci_att_clt_find_info_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Format; uint16_t Event_Data_Length; uint8_t Handle_UUID_Pair[(HCI_MAX_PAYLOAD_SIZE - 7)/sizeof(uint8_t)]; } aci_att_clt_find_info_resp_event_rp0; typedef PACKED(struct) aci_att_clt_find_by_type_value_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Num_of_Handle_Pair; packed_Attribute_Group_Handle_Pair_t Attribute_Group_Handle_Pair[(HCI_MAX_PAYLOAD_SIZE - 5)/sizeof(packed_Attribute_Group_Handle_Pair_t)]; } aci_att_clt_find_by_type_value_resp_event_rp0; typedef PACKED(struct) aci_att_clt_read_by_type_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Handle_Value_Pair_Length; uint16_t Data_Length; uint8_t Handle_Value_Pair_Data[(HCI_MAX_PAYLOAD_SIZE - 7)/sizeof(uint8_t)]; } aci_att_clt_read_by_type_resp_event_rp0; typedef PACKED(struct) aci_att_clt_read_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Event_Data_Length; uint8_t Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 6)/sizeof(uint8_t)]; } aci_att_clt_read_resp_event_rp0; typedef PACKED(struct) aci_att_clt_read_blob_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Event_Data_Length; uint8_t Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 6)/sizeof(uint8_t)]; } aci_att_clt_read_blob_resp_event_rp0; typedef PACKED(struct) aci_att_clt_read_multiple_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Event_Data_Length; uint8_t Set_Of_Values[(HCI_MAX_PAYLOAD_SIZE - 6)/sizeof(uint8_t)]; } aci_att_clt_read_multiple_resp_event_rp0; typedef PACKED(struct) aci_att_clt_read_by_group_type_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Attribute_Data_Length; uint16_t Data_Length; uint8_t Attribute_Data_List[(HCI_MAX_PAYLOAD_SIZE - 7)/sizeof(uint8_t)]; } aci_att_clt_read_by_group_type_resp_event_rp0; typedef PACKED(struct) aci_att_clt_prepare_write_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint16_t Offset; uint16_t Part_Attribute_Value_Length; uint8_t Part_Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 10)/sizeof(uint8_t)]; } aci_att_clt_prepare_write_resp_event_rp0; typedef PACKED(struct) aci_att_clt_exec_write_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; } aci_att_clt_exec_write_resp_event_rp0; typedef PACKED(struct) aci_gatt_clt_indication_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint16_t Attribute_Value_Length; uint8_t Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 8)/sizeof(uint8_t)]; } aci_gatt_clt_indication_event_rp0; typedef PACKED(struct) aci_gatt_clt_notification_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint16_t Attribute_Value_Length; uint8_t Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 8)/sizeof(uint8_t)]; } aci_gatt_clt_notification_event_rp0; typedef PACKED(struct) aci_gatt_clt_proc_complete_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Error_Code; } aci_gatt_clt_proc_complete_event_rp0; typedef PACKED(struct) aci_gatt_clt_error_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Req_Opcode; uint16_t Attribute_Handle; uint8_t Error_Code; } aci_gatt_clt_error_resp_event_rp0; typedef PACKED(struct) aci_gatt_clt_disc_read_char_by_uuid_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint8_t Attribute_Value_Length; uint8_t Attribute_Value[(HCI_MAX_PAYLOAD_SIZE - 7)/sizeof(uint8_t)]; } aci_gatt_clt_disc_read_char_by_uuid_resp_event_rp0; typedef PACKED(struct) aci_gatt_tx_pool_available_event_rp0_s { uint16_t Connection_Handle; uint16_t Available_Buffers; } aci_gatt_tx_pool_available_event_rp0; typedef PACKED(struct) aci_gatt_srv_confirmation_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; } aci_gatt_srv_confirmation_event_rp0; typedef PACKED(struct) aci_gatt_srv_read_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint16_t Data_Offset; } aci_gatt_srv_read_event_rp0; typedef PACKED(struct) aci_gatt_srv_write_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Resp_Needed; uint16_t Attribute_Handle; uint16_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 9)/sizeof(uint8_t)]; } aci_gatt_srv_write_event_rp0; typedef PACKED(struct) aci_att_srv_prepare_write_req_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Attribute_Handle; uint16_t Data_Offset; uint16_t Data_Length; uint8_t Data[(HCI_MAX_PAYLOAD_SIZE - 10)/sizeof(uint8_t)]; } aci_att_srv_prepare_write_req_event_rp0; typedef PACKED(struct) aci_att_srv_exec_write_req_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint8_t Flags; } aci_att_srv_exec_write_req_event_rp0; typedef PACKED(struct) aci_att_clt_read_multiple_var_len_resp_event_rp0_s { uint16_t Connection_Handle; uint16_t CID; uint16_t Event_Data_Length; uint8_t Set_Of_Values[(HCI_MAX_PAYLOAD_SIZE - 6)/sizeof(uint8_t)]; } aci_att_clt_read_multiple_var_len_resp_event_rp0; /** * @} */ #endif /* _BLE_EVENTS_H_ */