bt_app_sink.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. This example code is in the Public Domain (or CC0 licensed, at your option.)
  3. Unless required by applicable law or agreed to in writing, this
  4. software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  5. CONDITIONS OF ANY KIND, either express or implied.
  6. */
  7. #ifndef __BT_APP_SINK_H__
  8. #define __BT_APP_SINK_H__
  9. #include <stdint.h>
  10. #include "bt_app_core.h"
  11. typedef enum { BT_SINK_CONNECTED, BT_SINK_DISCONNECTED, BT_SINK_AUDIO_STARTED, BT_SINK_AUDIO_STOPPED, BT_SINK_PLAY, BT_SINK_STOP, BT_SINK_PAUSE,
  12. BT_SINK_RATE, BT_SINK_VOLUME, BT_SINK_METADATA, BT_SINK_PROGRESS } bt_sink_cmd_t;
  13. typedef bool (*bt_cmd_vcb_t)(bt_sink_cmd_t cmd, va_list args);
  14. typedef void (*bt_data_cb_t)(const uint8_t *data, uint32_t len);
  15. /**
  16. * @brief init sink mode (need to be provided)
  17. */
  18. void bt_sink_init(bt_cmd_vcb_t cmd_cb, bt_data_cb_t data_cb);
  19. /**
  20. * @brief deinit sink mode (need to be provided)
  21. */
  22. void bt_sink_deinit(void);
  23. /**
  24. * @brief force disconnection
  25. */
  26. void bt_disconnect(void);
  27. #endif /* __BT_APP_SINK_H__*/