bt_app_sink.h 892 B

123456789101112131415161718192021222324252627282930
  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. typedef enum { BT_SINK_CONNECTED, BT_SINK_DISCONNECTED, BT_SINK_PLAY, BT_SINK_STOP, BT_SINK_PAUSE,
  11. BT_SINK_RATE, BT_SINK_VOLUME, } bt_sink_cmd_t;
  12. typedef void (*bt_cmd_cb_t)(bt_sink_cmd_t cmd, ...);
  13. typedef void (*bt_data_cb_t)(const uint8_t *data, uint32_t len);
  14. /**
  15. * @brief init sink mode (need to be provided)
  16. */
  17. void bt_sink_init(bt_cmd_cb_t cmd_cb, bt_data_cb_t data_cb);
  18. /**
  19. * @brief local command mode (stop, play, volume ...)
  20. */
  21. void bt_sink_cmd(bt_sink_cmd_t event, ...);
  22. #endif /* __BT_APP_SINK_H__*/