ble_svc_gap.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. #ifndef H_BLE_SVC_GAP_
  20. #define H_BLE_SVC_GAP_
  21. #include <inttypes.h>
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #define BLE_SVC_GAP_UUID16 0x1800
  26. #define BLE_SVC_GAP_CHR_UUID16_DEVICE_NAME 0x2a00
  27. #define BLE_SVC_GAP_CHR_UUID16_APPEARANCE 0x2a01
  28. #define BLE_SVC_GAP_CHR_UUID16_PERIPH_PREF_CONN_PARAMS 0x2a04
  29. #define BLE_SVC_GAP_CHR_UUID16_CENTRAL_ADDRESS_RESOLUTION 0x2aa6
  30. #define BLE_SVC_GAP_APPEARANCE_GEN_UNKNOWN 0
  31. #define BLE_SVC_GAP_APPEARANCE_GEN_COMPUTER 128
  32. #define BLE_SVC_GAP_APPEARANCE_CYC_SPEED_AND_CADENCE_SENSOR 1157
  33. typedef void (ble_svc_gap_chr_changed_fn) (uint16_t uuid);
  34. void ble_svc_gap_set_chr_changed_cb(ble_svc_gap_chr_changed_fn *cb);
  35. const char *ble_svc_gap_device_name(void);
  36. int ble_svc_gap_device_name_set(const char *name);
  37. uint16_t ble_svc_gap_device_appearance(void);
  38. int ble_svc_gap_device_appearance_set(uint16_t appearance);
  39. void ble_svc_gap_init(void);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif