1 /* 2 * Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef __NBLE_SERVER_H__ 17 #define __NBLE_SERVER_H__ 18 19 /* Initialize the list for ble server */ 20 extern void ble_server_init(void); 21 22 /* Enable the all service stored in the servcie list one by one */ 23 extern void ble_server_start_service(void); 24 25 /* Free servcie by server id */ 26 extern int ble_server_free(int server_id); 27 28 /* Register one service, and return server if */ 29 extern int ble_server_alloc(BleGattService *srvcinfo); 30 31 extern void ble_server_gap_event(struct ble_gap_event *event, void *arg); 32 33 /* Internal function */ 34 extern void ble_server_update_svc_handle(ble_uuid_t *uuid, uint16_t attr_handle); 35 extern void ble_server_retrieve_id_by_service_id(uint16_t svc_handle, uint16_t *server_id); 36 extern void ble_server_retrieve_id_by_uuid(ble_uuid_t *uuid, uint16_t *server_id); 37 extern void ble_server_retrieve_service_handle_by_server_id(uint16_t server_id, uint16_t *service_handle); 38 39 #endif 40