You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
957 B

3 years ago
3 years ago
3 years ago
  1. #include <stdint.h>
  2. #include <string.h>
  3. #include <stdbool.h>
  4. #include <stdio.h>
  5. #define PROFILE_NUM 1
  6. #define PROFILE_APP_ID 0
  7. #define BT_BD_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x"
  8. #define BT_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
  9. #define ESP_GATT_SPP_SERVICE_UUID \
  10. { \
  11. 0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x01, 0x00, 0x40, 0x6E \
  12. }
  13. #define SCAN_ALL_THE_TIME 0
  14. enum
  15. {
  16. SPP_IDX_SVC,
  17. SPP_IDX_SPP_DATA_NTY_VAL,
  18. SPP_IDX_SPP_DATA_NTF_CFG,
  19. SPP_IDX_SPP_DATA_RECV_VAL,
  20. // SPP_IDX_SPP_COMMAND_VAL,
  21. #ifdef SUPPORT_HEARTBEAT
  22. SPP_IDX_SPP_HEARTBEAT_VAL,
  23. SPP_IDX_SPP_HEARTBEAT_CFG,
  24. #endif
  25. SPP_IDX_NB,
  26. };
  27. void ble_init();
  28. void ble_gattc_write_char(char *string, uint8_t string_length);