bsp_spp.c 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "include.h"
  2. void sco_audio_set_param(u8 *ptr, u8 size);
  3. void bsp_aec_ack_param(void);
  4. void bsp_aec_ack(void);
  5. extern u8 eq_rx_buf[EQ_BUFFER_LEN];
  6. void bt_tws_set_spp_eq_info(uint8_t *packet, uint16_t size)
  7. {
  8. memcpy(eq_rx_buf, packet, size);
  9. if (memcmp(eq_rx_buf, "ANC", 3) == 0) {
  10. #if ANC_EN
  11. msg_enqueue(EVT_ONLINE_SET_ANC);
  12. #endif
  13. }else{
  14. msg_enqueue(EVT_ONLINE_SET_EQ);
  15. }
  16. }
  17. uint bt_app_cmd_process_hook(u8 *ptr, u16 size)
  18. {
  19. uint ret = 0;
  20. #if IODM_TEST_MODE
  21. if((ptr[0]==0x55)&&(ptr[1]==0xAA)&&(ptr[2]==0xff)){
  22. memcpy(eq_rx_buf, ptr, size);
  23. msg_enqueue(EVT_BT_SPP_IODM);
  24. ret = 1;
  25. }
  26. #endif
  27. #if SMIC_DBG_EN
  28. if (memcmp(ptr, "SMIC", 4) == 0) {
  29. memcpy(eq_rx_buf, ptr, size);
  30. msg_enqueue(EVT_ONLINE_SET_SMIC);
  31. ret = 1;
  32. }
  33. #endif
  34. #if ANC_EN
  35. if (memcmp(ptr, "ANC", 3) == 0) {
  36. memcpy(eq_rx_buf, ptr, size);
  37. msg_enqueue(EVT_ONLINE_SET_ANC);
  38. ret = 1;
  39. }
  40. #endif
  41. return ret;
  42. }