bsal_stack_api.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-05-28 Supperthomas the first version
  9. */
  10. #ifndef __BSAL_STACK_API_H__
  11. #define __BSAL_STACK_API_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include "bsal_common.h"
  16. #include <stdbool.h>
  17. #include <stdint.h>
  18. /**
  19. * BSAL compute the sum of the srv handle number.
  20. *
  21. * @param[in] p_srv the service table of the p_srv
  22. * @param[out] att_res the result of the att resource
  23. * @Note compute the number of the service
  24. */
  25. uint8_t bsal_util_sum_handle_num(struct bsal_gatt_app_srv_def *p_srv, bsal_gatt_res_t *att_res);
  26. /**
  27. * BSAL save the profile
  28. *
  29. * @param[in] stack_ptr the point of the stack ptr
  30. * @param[in] handle the start_handle of the device
  31. * @param[in] callback the callback function of the service
  32. * @param[in] uuid the uuid of the service
  33. * @Note
  34. */
  35. BSAL_STATUS bsal_profile_insert(void *stack_ptr, uint16_t handle, void *callback, bsal_uuid_any_t uuid);
  36. /**
  37. * BSAL Stack ready callback
  38. *
  39. * @param[in] stack_ptr the point of the stack ptr
  40. * @param[in] status true is the stack ready, false is stack fail
  41. * @Note
  42. */
  43. int bsal_stack_ready(void *stack_ptr, bool status);
  44. /**
  45. * BSAL Stack ready callback
  46. *
  47. * @param[in] stack_ptr the point of the stack ptr
  48. * @param[in] conn_handle the conn_handle of the link
  49. * @param[in] conn_status the connect status of the link
  50. * @param[in] disconnect_status the disconnect reason of the link
  51. * @Note callback the link status of the devcie
  52. */
  53. int bsal_gap_connect_status(void *stack_ptr, uint16_t conn_handle, uint8_t connect_status, uint16_t disconnect_status);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif