gap_api.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2009-2013 Broadcom Corporation
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at:
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. ******************************************************************************/
  18. #include <string.h>
  19. #include "bt_target.h"
  20. //#include "bt_utils.h"
  21. #include "gap_int.h"
  22. tGAP_CB gap_cb;
  23. /*******************************************************************************
  24. **
  25. ** Function GAP_SetTraceLevel
  26. **
  27. ** Description This function sets the trace level for GAP. If called with
  28. ** a value of 0xFF, it simply returns the current trace level.
  29. **
  30. ** Returns The new or current trace level
  31. **
  32. *******************************************************************************/
  33. UINT8 GAP_SetTraceLevel (UINT8 new_level)
  34. {
  35. if (new_level != 0xFF) {
  36. gap_cb.trace_level = new_level;
  37. }
  38. return (gap_cb.trace_level);
  39. }
  40. /*******************************************************************************
  41. **
  42. ** Function GAP_Init
  43. **
  44. ** Description Initializes the control blocks used by GAP.
  45. **
  46. ** This routine should not be called except once per
  47. ** stack invocation.
  48. **
  49. ** Returns Nothing
  50. **
  51. *******************************************************************************/
  52. void GAP_Init(void)
  53. {
  54. memset (&gap_cb, 0, sizeof (tGAP_CB));
  55. #if defined(GAP_INITIAL_TRACE_LEVEL)
  56. gap_cb.trace_level = GAP_INITIAL_TRACE_LEVEL;
  57. #else
  58. gap_cb.trace_level = BT_TRACE_LEVEL_NONE; /* No traces */
  59. #endif
  60. #if GAP_CONN_INCLUDED == TRUE
  61. gap_conn_init();
  62. #endif
  63. #if BLE_INCLUDED == TRUE
  64. gap_attr_db_init();
  65. #endif
  66. }