医美代码重构
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.

52 lines
1.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  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. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. /*
  11. * DEFINES
  12. ****************************************************************************************
  13. */
  14. //#define SUPPORT_HEARTBEAT
  15. //#define SPP_DEBUG_MODE
  16. #define spp_sprintf(s, ...) sprintf((char*)(s), ##__VA_ARGS__)
  17. #define SPP_DATA_MAX_LEN (512)
  18. #define SPP_CMD_MAX_LEN (20)
  19. #define SPP_STATUS_MAX_LEN (20)
  20. #define SPP_DATA_BUFF_MAX_LEN (2 * 1024)
  21. /// Attributes State Machine
  22. enum {
  23. SPP_IDX_SVC,
  24. SPP_IDX_SPP_DATA_RECV_CHAR,
  25. SPP_IDX_SPP_DATA_RECV_VAL,
  26. SPP_IDX_SPP_DATA_NOTIFY_CHAR,
  27. SPP_IDX_SPP_DATA_NTY_VAL,
  28. SPP_IDX_SPP_DATA_NTF_CFG,
  29. SPP_IDX_SPP_COMMAND_CHAR,
  30. SPP_IDX_SPP_COMMAND_VAL,
  31. SPP_IDX_SPP_STATUS_CHAR,
  32. SPP_IDX_SPP_STATUS_VAL,
  33. SPP_IDX_SPP_STATUS_CFG,
  34. #ifdef SUPPORT_HEARTBEAT
  35. SPP_IDX_SPP_HEARTBEAT_CHAR,
  36. SPP_IDX_SPP_HEARTBEAT_VAL,
  37. SPP_IDX_SPP_HEARTBEAT_CFG,
  38. #endif
  39. SPP_IDX_NB,
  40. };
  41. void ble_spp_server_demo_app_main(void);