bt.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2017 Intel Corporation.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief Bluetooth L2 stack public header
  9. */
  10. #ifndef ZEPHYR_INCLUDE_NET_BT_H_
  11. #define ZEPHYR_INCLUDE_NET_BT_H_
  12. #include <net/net_mgmt.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. /* Management part definitions */
  17. #define _NET_BT_LAYER NET_MGMT_LAYER_L2
  18. #define _NET_BT_CODE 0x155
  19. #define _NET_BT_BASE (NET_MGMT_IFACE_BIT | \
  20. NET_MGMT_LAYER(_NET_BT_LAYER) | \
  21. NET_MGMT_LAYER_CODE(_NET_BT_CODE))
  22. #define _NET_BT_EVENT (_NET_BT_BASE | NET_MGMT_EVENT_BIT)
  23. enum net_request_bt_cmd {
  24. NET_REQUEST_BT_CMD_ADVERTISE = 1,
  25. NET_REQUEST_BT_CMD_CONNECT,
  26. NET_REQUEST_BT_CMD_SCAN,
  27. NET_REQUEST_BT_CMD_DISCONNECT,
  28. };
  29. #define NET_REQUEST_BT_ADVERTISE \
  30. (_NET_BT_BASE | NET_REQUEST_BT_CMD_ADVERTISE)
  31. NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_ADVERTISE);
  32. #define NET_REQUEST_BT_CONNECT \
  33. (_NET_BT_BASE | NET_REQUEST_BT_CMD_CONNECT)
  34. NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_CONNECT);
  35. #define NET_REQUEST_BT_SCAN \
  36. (_NET_BT_BASE | NET_REQUEST_BT_CMD_SCAN)
  37. NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_SCAN);
  38. enum net_event_bt_cmd {
  39. NET_EVENT_BT_CMD_SCAN_RESULT = 1,
  40. };
  41. #define NET_EVENT_BT_SCAN_RESULT \
  42. (_NET_BT_EVENT | NET_EVENT_BT_CMD_SCAN_RESULT)
  43. #define NET_REQUEST_BT_DISCONNECT \
  44. (_NET_BT_BASE | NET_REQUEST_BT_CMD_DISCONNECT)
  45. NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_DISCONNECT);
  46. #ifdef __cplusplus
  47. }
  48. #endif
  49. #endif /* ZEPHYR_INCLUDE_NET_BT_H_ */