NimBLE-Arduino 2.1.3
Loading...
Searching...
No Matches
ble_svc_gap.h
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
20#ifndef H_BLE_SVC_GAP_
21#define H_BLE_SVC_GAP_
22
23#include "nimble/porting/nimble/include/syscfg/syscfg.h"
24#include <inttypes.h>
25#if MYNEWT_VAL(ENC_ADV_DATA)
26#include "nimble/nimble/host/include/nimble/host/ble_ead.h"
27#endif
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#define BLE_SVC_GAP_UUID16 0x1800
33#define BLE_SVC_GAP_CHR_UUID16_DEVICE_NAME 0x2a00
34#define BLE_SVC_GAP_CHR_UUID16_APPEARANCE 0x2a01
35#define BLE_SVC_GAP_CHR_UUID16_PERIPH_PREF_CONN_PARAMS 0x2a04
36#define BLE_SVC_GAP_CHR_UUID16_CENTRAL_ADDRESS_RESOLUTION 0x2aa6
37
38#if MYNEWT_VAL(ENC_ADV_DATA)
39#define BLE_SVC_GAP_CHR_UUID16_KEY_MATERIAL 0x2B88
40#endif
41
42#define BLE_SVC_GAP_APPEARANCE_GEN_UNKNOWN 0
43#define BLE_SVC_GAP_APPEARANCE_GEN_COMPUTER 128
44#define BLE_SVC_GAP_APPEARANCE_GEN_HID 960
45#define BLE_SVC_GAP_APPEARANCE_CYC_SPEED_AND_CADENCE_SENSOR 1157
46
47typedef void (ble_svc_gap_chr_changed_fn) (uint16_t uuid);
48
49void ble_svc_gap_set_chr_changed_cb(ble_svc_gap_chr_changed_fn *cb);
50
51const char *ble_svc_gap_device_name(void);
52int ble_svc_gap_device_name_set(const char *name);
53uint16_t ble_svc_gap_device_appearance(void);
54int ble_svc_gap_device_appearance_set(uint16_t appearance);
55#if MYNEWT_VAL(ENC_ADV_DATA)
56int ble_svc_gap_device_key_material_set(uint8_t *session_key, uint8_t *iv);
57#endif
58
59void ble_svc_gap_init(void);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif