|
32 | 32 | #include "lll_df.h" |
33 | 33 | #include "lll_conn.h" |
34 | 34 |
|
| 35 | +#include "lll_mfi_audio_internal.h" |
35 | 36 | #include "lll_internal.h" |
36 | 37 | #include "lll_df_internal.h" |
37 | 38 | #include "lll_tim_internal.h" |
@@ -106,6 +107,16 @@ static uint8_t force_md_cnt; |
106 | 107 | #define FORCE_MD_CNT_SET() |
107 | 108 | #endif /* !CONFIG_BT_CTLR_FORCE_MD_COUNT */ |
108 | 109 |
|
| 110 | +// *** Whisper added for MFI |
| 111 | +static mfi_audio_sync_assert_cb_fn lll_mfi_audio_sync_assert_cb = NULL; |
| 112 | +static mfi_audio_sync_deassert_cb_fn lll_mfi_audio_sync_deassert_cb = NULL; |
| 113 | +void lll_mfi_audio_sync_register_cb(mfi_audio_sync_assert_cb_fn mfi_audio_sync_assert_cb, |
| 114 | + mfi_audio_sync_deassert_cb_fn mfi_audio_sync_deassert_cb) |
| 115 | +{ |
| 116 | + lll_mfi_audio_sync_assert_cb = mfi_audio_sync_assert_cb; |
| 117 | + lll_mfi_audio_sync_deassert_cb = mfi_audio_sync_deassert_cb; |
| 118 | +} |
| 119 | + |
109 | 120 | int lll_conn_init(void) |
110 | 121 | { |
111 | 122 | int err; |
@@ -1011,6 +1022,14 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, |
1011 | 1022 |
|
1012 | 1023 | // Whisper added for MFI |
1013 | 1024 | if (lll->mode2_rx_enabled) { |
| 1025 | + // if this is an audio packet and the primary transmit slot, assert the sync signal |
| 1026 | + // for the ezairo |
| 1027 | + if((pdu_data_rx->ll_id == PDU_DATA_LLID_RESV) && |
| 1028 | + (pdu_data_rx->sn == 0) && |
| 1029 | + lll_mfi_audio_sync_assert_cb) { |
| 1030 | + lll_mfi_audio_sync_assert_cb(); |
| 1031 | + } |
| 1032 | + |
1014 | 1033 | // decrypt apple's mode 2 encryption packet via a soft decrypt routine |
1015 | 1034 | // first get the encrypted packet |
1016 | 1035 | struct pdu_data *scratch_pkt = radio_pkt_scratch_get(); |
@@ -1038,6 +1057,14 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, |
1038 | 1057 |
|
1039 | 1058 | // there's no MIC with mode 2 encryption so set this to false |
1040 | 1059 | mic_failure = false; |
| 1060 | + |
| 1061 | + // if this is an audio packet and the primary transmit slot, deassert the sync signal |
| 1062 | + // for the ezairo |
| 1063 | + if((pdu_data_rx->ll_id == PDU_DATA_LLID_RESV) && |
| 1064 | + (pdu_data_rx->sn == 0) && |
| 1065 | + lll_mfi_audio_sync_deassert_cb) { |
| 1066 | + lll_mfi_audio_sync_deassert_cb(); |
| 1067 | + } |
1041 | 1068 | } |
1042 | 1069 |
|
1043 | 1070 | if (mic_failure && |
|
0 commit comments