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 <inttypes.h> 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 #define BLE_SVC_GAP_UUID16 0x1800 30 #define BLE_SVC_GAP_CHR_UUID16_DEVICE_NAME 0x2a00 31 #define BLE_SVC_GAP_CHR_UUID16_APPEARANCE 0x2a01 32 #define BLE_SVC_GAP_CHR_UUID16_PERIPH_PREF_CONN_PARAMS 0x2a04 33 #define BLE_SVC_GAP_CHR_UUID16_CENTRAL_ADDRESS_RESOLUTION 0x2aa6 34 35 #define BLE_SVC_GAP_APPEARANCE_GEN_UNKNOWN 0 36 #define BLE_SVC_GAP_APPEARANCE_GEN_COMPUTER 128 37 #define BLE_SVC_GAP_APPEARANCE_CYC_SPEED_AND_CADENCE_SENSOR 1157 38 39 typedef void (ble_svc_gap_chr_changed_fn) (uint16_t uuid); 40 41 void ble_svc_gap_set_chr_changed_cb(ble_svc_gap_chr_changed_fn *cb); 42 43 const char *ble_svc_gap_device_name(void); 44 int ble_svc_gap_device_name_set(const char *name); 45 uint16_t ble_svc_gap_device_appearance(void); 46 int ble_svc_gap_device_appearance_set(uint16_t appearance); 47 48 void ble_svc_gap_init(void); 49 50 #ifdef __cplusplus 51 } 52 #endif 53 54 #endif 55