#ifndef __BLE_SERVICE_H
#define __BLE_SERVICE_H

#define CCCD_DFT                    0           //定义client config的默认值,对于有些应用，主机不会进行订阅的情况，可以设置成1

//
// list service handle ranges
//
#define ATT_SERVICE_FF12_START_HANDLE 0x0001
#define ATT_SERVICE_FF12_END_HANDLE 0x0006
#define ATT_SERVICE_FF12_01_START_HANDLE 0x0001
#define ATT_SERVICE_FF12_01_END_HANDLE 0x0006
#define ATT_SERVICE_GAP_SERVICE_START_HANDLE 0x0007
#define ATT_SERVICE_GAP_SERVICE_END_HANDLE 0x000b
#define ATT_SERVICE_GAP_SERVICE_01_START_HANDLE 0x0007
#define ATT_SERVICE_GAP_SERVICE_01_END_HANDLE 0x000b
#define ATT_SERVICE_GATT_SERVICE_START_HANDLE 0x000c
#define ATT_SERVICE_GATT_SERVICE_END_HANDLE 0x000f
#define ATT_SERVICE_GATT_SERVICE_01_START_HANDLE 0x000c
#define ATT_SERVICE_GATT_SERVICE_01_END_HANDLE 0x000f
#define ATT_SERVICE_1812_START_HANDLE 0x0010
#define ATT_SERVICE_1812_END_HANDLE 0x0025
#define ATT_SERVICE_1812_01_START_HANDLE 0x0010
#define ATT_SERVICE_1812_01_END_HANDLE 0x0025

//
// list mapping between characteristics and handles
//
#define ATT_CHARACTERISTIC_FF15_01_VALUE_HANDLE 0x0003
#define ATT_CHARACTERISTIC_FF14_01_VALUE_HANDLE 0x0005
#define ATT_CHARACTERISTIC_FF14_01_CLIENT_CONFIGURATION_HANDLE 0x0006
#define ATT_CHARACTERISTIC_GAP_DEVICE_NAME_01_VALUE_HANDLE 0x0009
#define ATT_CHARACTERISTIC_GAP_APPEARANCE_01_VALUE_HANDLE 0x000b
#define ATT_CHARACTERISTIC_GATT_SERVICE_CHANGED_01_VALUE_HANDLE 0x000e
#define ATT_CHARACTERISTIC_GATT_SERVICE_CHANGED_01_CLIENT_CONFIGURATION_HANDLE 0x000f
#define ATT_CHARACTERISTIC_2a4a_01_VALUE_HANDLE 0x0012
#define ATT_CHARACTERISTIC_2a4b_01_VALUE_HANDLE 0x0014
#define ATT_CHARACTERISTIC_2a4c_01_VALUE_HANDLE 0x0016
#define ATT_CHARACTERISTIC_2a4d_01_VALUE_HANDLE 0x0018
#define ATT_CHARACTERISTIC_2a4d_01_CLIENT_CONFIGURATION_HANDLE 0x0019
#define ATT_CHARACTERISTIC_2a4d_02_VALUE_HANDLE 0x001c
#define ATT_CHARACTERISTIC_2a4d_02_CLIENT_CONFIGURATION_HANDLE 0x001d
#define ATT_CHARACTERISTIC_2a4d_03_VALUE_HANDLE 0x0020
#define ATT_CHARACTERISTIC_2a4d_04_VALUE_HANDLE 0x0023
#define ATT_CHARACTERISTIC_2a4d_04_CLIENT_CONFIGURATION_HANDLE 0x0024


void ble_service_init(void);
u32 ble_get_adv_data(u8 *adv_buf, u32 buf_size);
u32 ble_get_scan_data(u8 *scan_buf, u32 buf_size);
const u8 *ble_get_profile_data(void);

#endif
