mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-27 06:35:20 +00:00
avdtp: add DELAY_REPORT event
This commit is contained in:
parent
f6f3c9037b
commit
ff6bc02c5d
@ -1621,6 +1621,14 @@ typedef uint8_t sm_key_t[16];
|
||||
*/
|
||||
#define AVDTP_SUBEVENT_SIGNALING_SEP_DICOVERY_DONE 0x16
|
||||
|
||||
/**
|
||||
* @format 1212
|
||||
* @param subevent_code
|
||||
* @param avdtp_cid
|
||||
* @param local_seid
|
||||
* @param delay_100us
|
||||
*/
|
||||
#define AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT 0x17
|
||||
|
||||
/** A2DP Subevent */
|
||||
/* Stream goes through following states:
|
||||
@ -1761,6 +1769,16 @@ typedef uint8_t sm_key_t[16];
|
||||
*/
|
||||
#define A2DP_SUBEVENT_STREAM_RECONFIGURED 0x0D
|
||||
|
||||
/**
|
||||
* @format 1212
|
||||
* @param subevent_code
|
||||
* @param avdtp_cid
|
||||
* @param local_seid
|
||||
* @param delay_100us
|
||||
*/
|
||||
#define A2DP_SUBEVENT_SIGNALING_DELAY_REPORT 0x0E
|
||||
|
||||
|
||||
/** AVRCP Subevent */
|
||||
|
||||
/**
|
||||
|
@ -5268,6 +5268,34 @@ static inline uint16_t avdtp_subevent_signaling_sep_dicovery_done_get_avdtp_cid(
|
||||
return little_endian_read_16(event, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return avdtp_cid
|
||||
* @note: btstack_type 2
|
||||
*/
|
||||
static inline uint16_t avdtp_subevent_signaling_delay_report_get_avdtp_cid(const uint8_t * event){
|
||||
return little_endian_read_16(event, 3);
|
||||
}
|
||||
/**
|
||||
* @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return local_seid
|
||||
* @note: btstack_type 1
|
||||
*/
|
||||
static inline uint8_t avdtp_subevent_signaling_delay_report_get_local_seid(const uint8_t * event){
|
||||
return event[5];
|
||||
}
|
||||
/**
|
||||
* @brief Get field delay_100us from event AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return delay_100us
|
||||
* @note: btstack_type 2
|
||||
*/
|
||||
static inline uint16_t avdtp_subevent_signaling_delay_report_get_delay_100us(const uint8_t * event){
|
||||
return little_endian_read_16(event, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
|
||||
* @param event packet
|
||||
@ -5722,6 +5750,34 @@ static inline uint8_t a2dp_subevent_stream_reconfigured_get_status(const uint8_t
|
||||
return event[6];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field avdtp_cid from event A2DP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return avdtp_cid
|
||||
* @note: btstack_type 2
|
||||
*/
|
||||
static inline uint16_t a2dp_subevent_signaling_delay_report_get_avdtp_cid(const uint8_t * event){
|
||||
return little_endian_read_16(event, 3);
|
||||
}
|
||||
/**
|
||||
* @brief Get field local_seid from event A2DP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return local_seid
|
||||
* @note: btstack_type 1
|
||||
*/
|
||||
static inline uint8_t a2dp_subevent_signaling_delay_report_get_local_seid(const uint8_t * event){
|
||||
return event[5];
|
||||
}
|
||||
/**
|
||||
* @brief Get field delay_100us from event A2DP_SUBEVENT_SIGNALING_DELAY_REPORT
|
||||
* @param event packet
|
||||
* @return delay_100us
|
||||
* @note: btstack_type 2
|
||||
*/
|
||||
static inline uint16_t a2dp_subevent_signaling_delay_report_get_delay_100us(const uint8_t * event){
|
||||
return little_endian_read_16(event, 6);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get field status from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED
|
||||
* @param event packet
|
||||
|
@ -636,6 +636,21 @@ void avdtp_signaling_emit_sep_done(btstack_packet_handler_t callback, uint16_t a
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
}
|
||||
|
||||
void avdtp_signaling_emit_delay(btstack_packet_handler_t callback, uint16_t avdtp_cid, uint8_t local_seid, uint16_t delay){
|
||||
if (!callback) return;
|
||||
uint8_t event[8];
|
||||
int pos = 0;
|
||||
event[pos++] = HCI_EVENT_AVDTP_META;
|
||||
event[pos++] = sizeof(event) - 2;
|
||||
event[pos++] = AVDTP_SUBEVENT_SIGNALING_DELAY_REPORT;
|
||||
little_endian_store_16(event, pos, avdtp_cid);
|
||||
pos += 2;
|
||||
event[pos++] = local_seid;
|
||||
little_endian_store_16(event, pos, delay);
|
||||
pos += 2;
|
||||
(*callback)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||
}
|
||||
|
||||
void avdtp_signaling_emit_accept(btstack_packet_handler_t callback, uint16_t avdtp_cid, uint8_t local_seid, avdtp_signal_identifier_t identifier){
|
||||
if (!callback) return;
|
||||
uint8_t event[7];
|
||||
|
@ -84,6 +84,7 @@ void avdtp_streaming_emit_connection_released(btstack_packet_handler_t callback,
|
||||
|
||||
void avdtp_signaling_emit_sep(btstack_packet_handler_t callback, uint16_t avdtp_cid, avdtp_sep_t sep);
|
||||
void avdtp_signaling_emit_sep_done(btstack_packet_handler_t callback, uint16_t avdtp_cid);
|
||||
void avdtp_signaling_emit_delay(btstack_packet_handler_t callback, uint16_t avdtp_cid, uint8_t local_seid, uint16_t delay);
|
||||
|
||||
void avdtp_signaling_emit_accept(btstack_packet_handler_t callback, uint16_t avdtp_cid, uint8_t seid, avdtp_signal_identifier_t identifier);
|
||||
void avdtp_signaling_emit_general_reject(btstack_packet_handler_t callback, uint16_t avdtp_cid, uint8_t int_seid, avdtp_signal_identifier_t identifier);
|
||||
|
Loading…
x
Reference in New Issue
Block a user