nimble_opt_auto.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2022 The Apache Software Foundation (ASF)
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * SPDX-FileContributor: 2019-2022 Espressif Systems (Shanghai) CO LTD
  7. */
  8. /*
  9. * Licensed to the Apache Software Foundation (ASF) under one
  10. * or more contributor license agreements. See the NOTICE file
  11. * distributed with this work for additional information
  12. * regarding copyright ownership. The ASF licenses this file
  13. * to you under the Apache License, Version 2.0 (the
  14. * "License"); you may not use this file except in compliance
  15. * with the License. You may obtain a copy of the License at
  16. *
  17. * http://www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing,
  20. * software distributed under the License is distributed on an
  21. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  22. * KIND, either express or implied. See the License for the
  23. * specific language governing permissions and limitations
  24. * under the License.
  25. */
  26. #ifndef H_NIMBLE_OPT_AUTO_
  27. #define H_NIMBLE_OPT_AUTO_
  28. #include "syscfg/syscfg.h"
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /***
  33. * Automatic options.
  34. *
  35. * These settings are generated automatically from the user-specified syscfg
  36. * settings.
  37. */
  38. #undef NIMBLE_BLE_ADVERTISE
  39. #define NIMBLE_BLE_ADVERTISE \
  40. (MYNEWT_VAL(BLE_ROLE_BROADCASTER) || MYNEWT_VAL(BLE_ROLE_PERIPHERAL))
  41. #undef NIMBLE_BLE_SCAN
  42. #define NIMBLE_BLE_SCAN \
  43. (MYNEWT_VAL(BLE_ROLE_CENTRAL) || MYNEWT_VAL(BLE_ROLE_OBSERVER))
  44. #undef NIMBLE_BLE_CONNECT
  45. #define NIMBLE_BLE_CONNECT \
  46. (MYNEWT_VAL(BLE_ROLE_CENTRAL) || MYNEWT_VAL(BLE_ROLE_PERIPHERAL))
  47. /** Supported client ATT commands. */
  48. #undef NIMBLE_BLE_ATT_CLT_FIND_INFO
  49. #define NIMBLE_BLE_ATT_CLT_FIND_INFO \
  50. (MYNEWT_VAL(BLE_GATT_DISC_ALL_DSCS))
  51. #undef NIMBLE_BLE_ATT_CLT_FIND_TYPE
  52. #define NIMBLE_BLE_ATT_CLT_FIND_TYPE \
  53. (MYNEWT_VAL(BLE_GATT_DISC_SVC_UUID))
  54. #undef NIMBLE_BLE_ATT_CLT_READ_TYPE
  55. #define NIMBLE_BLE_ATT_CLT_READ_TYPE \
  56. (MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS) || \
  57. MYNEWT_VAL(BLE_GATT_DISC_ALL_CHRS) || \
  58. MYNEWT_VAL(BLE_GATT_DISC_CHRS_UUID) || \
  59. MYNEWT_VAL(BLE_GATT_READ_UUID))
  60. #undef NIMBLE_BLE_ATT_CLT_READ
  61. #define NIMBLE_BLE_ATT_CLT_READ \
  62. (MYNEWT_VAL(BLE_GATT_READ) || \
  63. MYNEWT_VAL(BLE_GATT_READ_LONG) || \
  64. MYNEWT_VAL(BLE_GATT_FIND_INC_SVCS))
  65. #undef NIMBLE_BLE_ATT_CLT_READ_BLOB
  66. #define NIMBLE_BLE_ATT_CLT_READ_BLOB \
  67. (MYNEWT_VAL(BLE_GATT_READ_LONG))
  68. #undef NIMBLE_BLE_ATT_CLT_READ_MULT
  69. #define NIMBLE_BLE_ATT_CLT_READ_MULT \
  70. (MYNEWT_VAL(BLE_GATT_READ_MULT))
  71. #undef NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE
  72. #define NIMBLE_BLE_ATT_CLT_READ_GROUP_TYPE \
  73. (MYNEWT_VAL(BLE_GATT_DISC_ALL_SVCS))
  74. #undef NIMBLE_BLE_ATT_CLT_WRITE
  75. #define NIMBLE_BLE_ATT_CLT_WRITE \
  76. (MYNEWT_VAL(BLE_GATT_WRITE))
  77. #undef NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP
  78. #define NIMBLE_BLE_ATT_CLT_WRITE_NO_RSP \
  79. (MYNEWT_VAL(BLE_GATT_WRITE_NO_RSP))
  80. #undef NIMBLE_BLE_ATT_CLT_PREP_WRITE
  81. #define NIMBLE_BLE_ATT_CLT_PREP_WRITE \
  82. (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
  83. #undef NIMBLE_BLE_ATT_CLT_EXEC_WRITE
  84. #define NIMBLE_BLE_ATT_CLT_EXEC_WRITE \
  85. (MYNEWT_VAL(BLE_GATT_WRITE_LONG))
  86. #undef NIMBLE_BLE_ATT_CLT_NOTIFY
  87. #define NIMBLE_BLE_ATT_CLT_NOTIFY \
  88. (MYNEWT_VAL(BLE_GATT_NOTIFY))
  89. #undef NIMBLE_BLE_ATT_CLT_INDICATE
  90. #define NIMBLE_BLE_ATT_CLT_INDICATE \
  91. (MYNEWT_VAL(BLE_GATT_INDICATE))
  92. /** Security manager settings. */
  93. #undef NIMBLE_BLE_SM
  94. #define NIMBLE_BLE_SM (MYNEWT_VAL(BLE_SM_LEGACY) || MYNEWT_VAL(BLE_SM_SC))
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif