Index: ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvoptx
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvoptx	(revision 950)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvoptx	(working copy)
@@ -223,7 +223,7 @@
       <GroupNumber>2</GroupNumber>
       <FileNumber>4</FileNumber>
       <FileType>1</FileType>
-      <tvExp>1</tvExp>
+      <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
       <PathWithFileName>..\..\user\main.c</PathWithFileName>
@@ -267,6 +267,18 @@
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>8</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\user\app_ble_gatt.c</PathWithFileName>
+      <FilenameWithoutPath>app_ble_gatt.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
   </Group>
 
   <Group>
@@ -277,7 +289,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>8</FileNumber>
+      <FileNumber>9</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -289,7 +301,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>9</FileNumber>
+      <FileNumber>10</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -301,7 +313,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>10</FileNumber>
+      <FileNumber>11</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -313,7 +325,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>11</FileNumber>
+      <FileNumber>12</FileNumber>
       <FileType>4</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -325,7 +337,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>12</FileNumber>
+      <FileNumber>13</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -337,7 +349,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>13</FileNumber>
+      <FileNumber>14</FileNumber>
       <FileType>4</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -349,7 +361,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>14</FileNumber>
+      <FileNumber>15</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -361,7 +373,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>15</FileNumber>
+      <FileNumber>16</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -373,7 +385,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>16</FileNumber>
+      <FileNumber>17</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -385,7 +397,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>17</FileNumber>
+      <FileNumber>18</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -397,7 +409,7 @@
     </File>
     <File>
       <GroupNumber>3</GroupNumber>
-      <FileNumber>18</FileNumber>
+      <FileNumber>19</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -417,7 +429,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>19</FileNumber>
+      <FileNumber>20</FileNumber>
       <FileType>2</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -429,7 +441,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>20</FileNumber>
+      <FileNumber>21</FileNumber>
       <FileType>2</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -449,7 +461,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>21</FileNumber>
+      <FileNumber>22</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -461,7 +473,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>22</FileNumber>
+      <FileNumber>23</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -473,7 +485,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>23</FileNumber>
+      <FileNumber>24</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -485,7 +497,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>24</FileNumber>
+      <FileNumber>25</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -497,7 +509,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>25</FileNumber>
+      <FileNumber>26</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -509,7 +521,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>26</FileNumber>
+      <FileNumber>27</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -521,7 +533,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>27</FileNumber>
+      <FileNumber>28</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -533,7 +545,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>28</FileNumber>
+      <FileNumber>29</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -545,7 +557,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>29</FileNumber>
+      <FileNumber>30</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -557,7 +569,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>30</FileNumber>
+      <FileNumber>31</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
Index: ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvprojx
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvprojx	(revision 950)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/prj/MDK/YC3121_Keil.uvprojx	(working copy)
@@ -422,6 +422,11 @@
               <FileType>1</FileType>
               <FilePath>..\..\user\otausb.c</FilePath>
             </File>
+            <File>
+              <FileName>app_ble_gatt.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\user\app_ble_gatt.c</FilePath>
+            </File>
           </Files>
         </Group>
         <Group>
Index: ModuleDemo/updata_app/Boot/user/app_ble_gatt.h
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt.h	(nonexistent)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt.h	(working copy)
@@ -0,0 +1,431 @@
+#ifndef __SIMPLE_GATT_SERVICE_H_
+#define __SIMPLE_GATT_SERVICE_H_
+
+#include "app_ble_gatt_sig_uuid.h"
+
+
+#define ATT_VALUE_ZERO {0}
+
+#define HI_UINT16(a) (((a) >> 8) & 0xFF)
+#define LO_UINT16(a) ((a) & 0xFF)
+
+// Gap Profile attributes index.
+enum
+{
+    GAP_IDX_SERVICE,    // SERVICE
+
+    GAP_IDX_CHAR1_DECLARATION,    // USER_IDX_CHAR1_USER_DESCRIPTION
+    GAP_IDX_CHAR1_VALUE,
+
+    GAP_IDX_NB,
+};
+
+
+
+
+// Gatt Profile attributes index.
+enum
+{
+    GATT_IDX_SERVICE,    // SERVICE
+
+    GATT_IDX_CHAR1_DECLARATION,    // USER_IDX_CHAR1_USER_DESCRIPTION
+    GATT_IDX_CHAR1_VALUE,
+    GATT_IDX_CHAR1_CFG,
+
+    GATT_IDX_NB,
+};
+
+
+
+// HID service
+/// Keyboard Device
+#define HID_DEV_KEYBOARD    0x01
+/// Mouse Device
+#define HID_DEV_MOUSE       0x02
+/// Protocol Mode present
+#define HID_DEV_PROTO_MODE  0x04
+
+/* Current only support mouse device */
+//#define HID_DEV (HID_DEV_KEYBOARD)
+#define HID_DEV (HID_DEV_MOUSE | HID_DEV_PROTO_MODE | HID_DEV_KEYBOARD)
+
+/* HID information flags */
+#define HID_FLAGS_REMOTE_WAKE           0x01 // RemoteWake
+#define HID_FLAGS_NORMALLY_CONNECTABLE  0x02 // NormallyConnectable
+
+/* HID protocol mode values */
+#define HID_PROTOCOL_MODE_BOOT      0x00 // Boot Protocol Mode
+#define HID_PROTOCOL_MODE_REPORT    0x01 // Report Protocol Mode
+
+/** @defgroup HID_REPORT_TYPE_GROUP */
+#define HID_REPORT_TYPE_INPUT       0x01
+#define HID_REPORT_TYPE_OUTPUT      0x02
+#define HID_REPORT_TYPE_FEATURE     0x03
+#define HID_REPORT_TYPE_WR          0x10    /// Input report with Write capabilities
+
+
+// HID Protocol mode
+#define HID_PROTOCOL_VALUE    \
+{                         \
+    0x01                  /*Protocol mode*/     \
+}
+
+// HID Keyboard Report ID
+#define HID_KEYBOARD_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_STAND_KB,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+// HID Media Report ID
+#define HID_MEDIA_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_MEDIA,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+// HID Power Report ID
+#define HID_POWER_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_POWER,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+// HID Bit Keyboard Report ID
+#define HID_BIT_KEYBOARD_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_BIT_KB,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+// HID Mouse Report ID
+#define HID_MOUSE_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_MOUSE,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+// HID Vendor Report ID
+#define HID_VENDOR_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_VENDOR,       /*Report id*/     \
+    HID_REPORT_TYPE_INPUT     /*Input*/         \
+}
+
+// HID Keyboard	Out Report ID
+#define HID_KB_OUT_REPORT_REF_VALUE    \
+{                         \
+    REPORT_ID_STAND_KB,       /*Report id*/     \
+    HID_REPORT_TYPE_OUTPUT     /*Output*/         \
+}
+
+// HID Information data
+#define HID_INFO_VALUE    \
+{                         \
+    LO_UINT16(0x0101), HI_UINT16(0x0101),             /*bcdHID (USB HID version)*/    \
+    0x00,                                             /*bCountryCode*/                \
+    HID_FLAGS_REMOTE_WAKE | HID_FLAGS_NORMALLY_CONNECTABLE     /*Flags*/              \
+}
+
+//标准键盘报告ID
+#define REPORT_ID_STAND_KB						0x01
+//media报告ID
+#define REPORT_ID_MEDIA							  0x02
+//power报告ID
+#define REPORT_ID_POWER							  0x03
+//全键键盘报告ID
+#define REPORT_ID_BIT_KB						  0x04
+//鼠标的报告ID
+#define REPORT_ID_MOUSE							  0x05//	
+//鼠标的报告ID
+#define REPORT_ID_VENDOR						  0x06//	
+
+//HID Report Map characteristic defination
+#define HID_REPORT_MAP    																											\
+{                         																											\
+	/*====================KEYBOARD====47====================================												*/		\
+	0x05, 0x01,		 									/*// Usage Page (Generic Desktop),					 				*/		\
+	0x09, 0x06,		 									/*// Usage (Keyboard),								                */      \
+	0xA1, 0x01,		 									/*// Collection (Application),	                                    */      \
+	0x85, REPORT_ID_STAND_KB,		 					/*// Report ID (0x02)  		                                       	*/		\
+	0x05, 0x07,		 									/*// Usage Page (Key Codes); 						                */      \
+	0x19, 0xE0,		 									/*// Usage Minimum (224),							                */      \
+	0x29, 0xE7,		 									/*// Usage Maximum (231),							                */      \
+	0x15, 0x00,		 									/*// Logical Minimum (0),							                */      \
+	0x25, 0x01,		 									/*// Logical Maximum (1),							                */      \
+	0x75, 0x01,		 									/*// Report Size (1),								                */      \
+	0x95, 0x08,		 									/*// Report Count (8),								                */      \
+	0x81, 0x02,		 									/*// Input (Data, Variable, Absolute), ;Modifier byte               */      \
+	0x95, 0x01,		 									/*// Report Count (1),								                */      \
+	0x75, 0x08,		 									/*// Report Size (8),								                */      \
+	0x81, 0x03,		 									/*// Input (Constant), ;Reserved byte  	                            */		\
+	0x95, 0x05,    										/*// Report Count (5),            //  for  keybord led  the mouse 	*/		\
+	0x75, 0x01,    										/*// Report Size (1),                                               */      \
+	0x05, 0x08,    										/*// Usage Page (Page# for LEDs),                                   */      \
+	0x19, 0x01,    										/*// Usage Minimum (1),                                             */      \
+	0x29, 0x05,    										/*// Usage Maximum (5),                                             */      \
+	0x91, 0x02,    										/*// Output (Data, Variable, Absolute), ;LED report                 */      \
+	0x95, 0x01,    										/*// Report Count (1),                                              */      \
+	0x75, 0x03,    										/*// Report Size (3),                                               */      \
+	0x91, 0x03,    										/*// Output (Constant), ;LED report padding                         */      \
+	0x95, 0x06,		 									/*// Report Count (6),								                */      \
+	0x75, 0x08,		 									/*// Report Size (8),								                */      \
+	0x15, 0x00,		 									/*// Logical Minimum (0),							                */      \
+	0x25, 0xff,		 									/*// Logical Maximum(101),							                */      \
+	0x05, 0x07,		 									/*// Usage Page (Key Codes), 						                */      \
+	0x19, 0x00,		 									/*// Usage Minimum (0),								                */      \
+	0x29, 0xff,		 									/*// Usage Maximum (255),							                */      \
+	0x81, 0x00,		 									/*// Input (Data, Array), ;Key arrays (6 bytes)		                */      \
+	0xC0, 			 									/*// End Collection                                                 */      \
+	/*//====================MEDIA========25============================ 													*/      \
+    0x05, 0x0c,         								/*// USAGE_PAGE (Consumer Devices)            						*/      \
+    0x09, 0x01,         								/*// USAGE (Consumer Control)                 						*/      \
+    0xa1, 0x01,         								/*// COLLECTION (Application)                 						*/      \
+    0x85, REPORT_ID_MEDIA,         						/*// Report ID (3)                            						*/      \
+    0x15, 0x00,         								/*// LOGICAL_MINIMUM (0)                      						*/      \
+    0x26, 0x80, 0x03,   								/*// Logical Maximum (1),                                           */      \
+    0x19, 0x00,         								/*// Usage Minimum (),                                              */      \
+    0x2a, 0x80, 0x03,   								/*// Usage Maximum (),                                              */      \
+    0x75, 0x10,         								/*// REPORT_SIZE (0x10), 16bit                                      */      \
+    0x95, 0x01,         								/*// REPORT_COUNT (1)                                               */      \
+    0x81, 0x00,         								/*// Input (Data,Ary,Abs)                                           */      \
+    0xc0,               								/*// END_COLLECTION                                                 */      \
+    /*//====================电源控制======29==============================  													*/      \
+    0x05, 0x01, 										/*// Usage Page (Generic Desktop),                                  */      \
+    0x09, 0x80,											/*// USAGE (System Control)                                         */      \
+    0xa1, 0x01,											/*// Collection (Application),                                      */      \
+    0x85, REPORT_ID_POWER, 								/*// Report ID (4)                                                  */      \
+    0x19, 0x81, 										/*// Usage Minimum (0x81),                                          */      \
+    0x29, 0x83, 										/*// Usage Maximum (0x83),                                          */      \
+    0x15, 0x01,											/*// Logical Minimum (0x01),                                        */      \
+    0x25, 0x03, 										/*// Logical Maximum (0x03)                                         */      \
+    0x95, 0x01, 										/*// Report Count (1),                                              */      \
+    0x75, 0x02, 										/*// Report Size (2),                                               */      \
+    0x81, 0x60, 										/*// Input (Data,Ary,Abs)                                           */      \
+	0x95, 0x01, 										/*// Report Count (1),                                              */      \
+    0x75, 0x06, 										/*// Report Size (6),	                                            */      \
+    0x81, 0x03,											/*// Input (Const,Var,Abs)                                          */      \
+    0xc0,												/*// END_COLLECTION                                  				*/      \
+	/*//====================BIT KEYBOARD====25====================================											*/      \
+	0x05, 0x01,        									/*// Usage Page (Generic Desktop),                                  */      \
+    0x09, 0x06,        									/*// Usage (Keyboard),                                              */      \
+    0xA1, 0x01,        									/*// Collection (Application),                                      */      \
+    0x85, REPORT_ID_BIT_KB,         					/*// Report ID                                                      */      \
+    0x05, 0x07,       									/*// Usage Page (Key Codes);                                        */      \
+    0x19, 0x00,       									/*// Usage Minimum (00 reserved),                                   */      \
+    0x29, 0x77,       									/*// Usage Maximum (119 Select),                                    */      \
+    0x15, 0x00,       									/*// Logical Minimum (0),                                           */      \
+    0x25, 0x01,       									/*// Logical Maximum (1),                                           */      \
+    0x75, 0x01,       									/*// Report Size (1),                                               */      \
+    0x95, 0x78,       									/*// Report Count (120),                                            */      \
+    0x81, 0x02,       									/*// Input (Data, Variable, Absolute), ;Modifier byte	   			*/      \
+	0xC0,                                               /*// End Collection                                                 */      \
+	/*//====================MOUSE====54==================================== 												*/      \
+	0x05,0x01,        									/*// USAGE_PAGE (Generic Desktop)		   鼠标                     */      \
+	0x09,0x02,        									/*// Usage (Mouse)=09H,02H                                          */      \
+	0xa1,0x01,        									/*// Collection:(Application)=A1 01                                 */      \
+	0x85,REPORT_ID_MOUSE,        						/*// Report ID                                                      */      \
+	0x09,0x01,        									/*// Usage (Pointer)=09H,01H                                        */      \
+	0xa1,0x00,        									/*// Collection:(Application)=A1 01                                 */      \
+	0x05,0x09,        									/*//Usage Page (Buttons)=09H,05H                                    */      \
+	0x19,0x01,        									/*//Usage Minimum=19H,01H                                           */      \
+	0x29,0x03,        									/*//Usage Maximun=29H,03H                                           */      \
+	0x15,0x00,        									/*//Logical Minimum(0)=15H,00H                                      */      \
+	0x25,0x01,        									/*//Logical Maximum(1)=25H,01H                                      */      \
+	0x95,0x05,        									/*//Report Count=95H,05H                                            */      \
+	0x75,0x01,        									/*//Report Size=75H,01H                                             */      \
+	0x81,0x02,        									/*//Input (Data, Variable, Absolute)=81H,02H                        */      \
+	0x95,0x01,        									/*//Report Count=95H,01H                                            */      \
+	0x75,0x03,        									/*//Report Size=75H,03H                                             */      \
+	0x81,0x01,        									/*//Input (Constant)=81H,01H                                        */      \
+	0x05,0x01,        									/*//Usage Page (Generic Desktop)=05H,01H                            */      \
+	0x09,0x30,        									/*//Usage (X)=09H,30H                                               */      \
+	0x09,0x31,        									/*//Usage (Y)=09H,31H                                               */      \
+	0x09,0x38,        									/*//Usage (Wheel)=09H,38H                                           */      \
+	0x15,0x81,        									/*//Logical Minimum (-127)=15H,81H                                  */      \
+	0x25,0x7f,        									/*//Logical Maximum (+127)=25H,7FH                                  */      \
+	0x75,0x08,        									/*//Report Size (8)=75H,08H                                         */      \
+	0x95,0x03,        									/*//Report Count (1)=95H,01H                                        */      \
+	0x81,0x06,        									/*//Input (Data, Variable, Relative)=81H,06H                        */      \
+	0xc0,0xc0,                                         	/*// End Collection                                                 */      \
+	/*//====================Vendor====23==================================== 												*/	    \
+	0x06,0xff,0xff,   									/*// Vendor Defined Page 1                                          */      \
+	0x09,0x03,        									/*// Vendor Usage 03                                                */      \
+	0xa1,0x01,        									/*// Collection:(Application)=A1 01                                 */      \
+	0x85,REPORT_ID_VENDOR,        						/*// REPORT_ID                                                      */      \
+	0x09,0x01,        									/*// Vendor Usage 161(01)                                           */      \
+	0x15,0x00,        									/*// LOGICAL_MINIMUM (0)                                            */      \
+	0x26,0xff,0x00,   									/*// LOGICAL_MAXIMUM (0)                                            */      \
+	0x75,0x08,        									/*// REPORT_SIZE (8)                                                */      \
+	0x95,0x03,        									/*// REPORT_COUNT (3)                                               */      \
+	0x81,0x02,        									/*// INPUT (Data,Var,Abs)  	                                        */      \
+	0xc0,             									/*// End Collection                                                 */      \
+}
+
+// HID service attributes index.
+enum
+{
+    HID_IDX_SERVICE,                // HID Service
+
+#if ((HID_DEV & HID_DEV_PROTO_MODE) == HID_DEV_PROTO_MODE)
+    HID_PROTOCOL_MODE_DECL_IDX,     // HID Protocol Mode characteristic declaration
+    HID_PROTOCOL_MODE_IDX,          // HID Protocol Mode characteristic
+#endif
+
+
+#if ((HID_DEV & HID_DEV_MOUSE) == HID_DEV_MOUSE)
+    HID_BOOT_MOUSE_IN_DECL_IDX,     // HID Boot Mouse Input Report declaration
+    HID_BOOT_MOUSE_IN_IDX,          // HID Boot Mouse Input Report
+    HID_BOOT_MOUSE_IN_CCCD_IDX,     // HID Boot Mouse Input Report characteristic client characteristic configuration
+#endif
+
+#if ((HID_DEV & HID_DEV_KEYBOARD) == HID_DEV_KEYBOARD)
+    HID_BOOT_KEYBOARD_IN_DECL_IDX,     // HID Boot Keyboard Input Report declaration
+    HID_BOOT_KEYBOARD_IN_IDX,          // HID Boot Keyboard Input Report
+    HID_BOOT_KEYBOARD_IN_CCCD_IDX,     // HID Boot Keyboard Input Report characteristic client characteristic configuration
+
+    HID_BOOT_KEYBOARD_OUT_DECL_IDX,     // HID Boot Keyboard Output Report declaration
+    HID_BOOT_KEYBOARD_OUT_IDX,          // HID Boot Keyboard Output Report
+#endif
+
+    HID_INFO_DECL_IDX,              // HID Information characteristic declaration
+    HID_INFO_IDX,                   // HID Information characteristic
+
+    HID_CONTROL_POINT_DECL_IDX,     // HID Control Point characteristic declaration
+    HID_CONTROL_POINT_IDX,          // HID Control Point characteristic
+
+    HID_IDX_NB,
+};
+enum
+{
+    HID_KEYBOARD_DECL_IDX,          // Keyboard Report declaration
+    HID_KEYBOARD_IDX,               // Keyboard Report
+    HID_KEYBOARD_CCCD_IDX,          // Keyboard Report characteristic client characteristic configuration
+    HID_REPORT_REF_KEYBOARD_IDX,    // HID Report Reference characteristic descriptor, Keyboard
+
+    HID_MEDIA_DECL_IDX,          		// Media Report declaration
+    HID_MEDIA_IDX,               		// Media Report
+    HID_MEDIA_CCCD_IDX,          		// Media Report characteristic client characteristic configuration
+    HID_REPORT_REF_MEDIA_IDX,    		// HID Report Reference characteristic descriptor, Media
+
+    HID_POWER_DECL_IDX,          		// Power Report declaration
+    HID_POWER_IDX,               		// Power Report
+    HID_POWER_CCCD_IDX,          		// Power Report characteristic client characteristic configuration
+    HID_REPORT_REF_POWER_IDX,    		// HID Report Reference characteristic descriptor, Power
+
+    HID_BIT_KEYBOARD_DECL_IDX,          // Bit Keyboard Report declaration
+    HID_BIT_KEYBOARD_IDX,               // Bit Keyboard Report
+    HID_BIT_KEYBOARD_CCCD_IDX,          // Bit Keyboard Report characteristic client characteristic configuration
+    HID_REPORT_REF_BIT_KEYBOARD_IDX,    // HID Report Reference characteristic descriptor, Bit Keyboard
+
+    HID_MOUSE_DECL_IDX,          		// Mouse Report declaration
+    HID_MOUSE_IDX,               		// Mouse Report
+    HID_MOUSE_CCCD_IDX,          		// Mouse Report characteristic client characteristic configuration
+    HID_REPORT_REF_MOUSE_IDX,    		// HID Report Reference characteristic descriptor, Mouse
+
+    HID_VENDOR_DECL_IDX,          		// Vendor Report declaration
+    HID_VENDOR_IDX,               		// Vendor Report
+    HID_VENDOR_CCCD_IDX,          		// Vendor Report characteristic client characteristic configuration
+    HID_REPORT_REF_VENDOR_IDX,    		// HID Report Reference characteristic descriptor, Vendor
+
+    HID_KEYBOARD_OUT_DECL_IDX,          // Keyboard Out Report declaration
+    HID_KEYBOARD_OUT_IDX,               // Keyboard Out Report
+    HID_REPORT_REF_KEYBOARD_OUT_IDX,   	// HID Report Reference characteristic descriptor, Keyboard Out
+
+    HID_REPORT_IDX_NB,
+};
+enum
+{
+    HID_REPORT_MAP_DECL_IDX,        // HID Report Map characteristic declaration
+    HID_REPORT_MAP_IDX,             // HID Report Map characteristic
+    HID_REPORT_MAP_IDX_NB,
+};
+
+
+// BATTERY service attributes index.
+enum
+{
+    BATTERY_SERVICE_IDX,                	// BATTERY Service
+
+    BATTERY_DECLARATION_IDX,        		// BATTERY characteristic declaration
+    BATTERY_VALUE_IDX,             			// BATTERY LEVEL
+    BATTERY_CHAR_CFG_IDX,					// BATTERY characteristic client characteristic configuration
+    BATTERY_IDX_NB,
+};
+
+enum
+{
+    OTA_SERVICE_IDX,                	// BATTERY Service
+
+    OTA_IDX_CHAR1_DECLARATION,
+    OTA_IDX_CHAR1_VALUE,
+    OTA_IDX_CHAR1_CFG,
+
+    OTA_IDX_CHAR2_DECLARATION,
+    OTA_IDX_CHAR2_VALUE,
+	
+//	OTA_IDX_CHAR3_DECLARATION,
+//    OTA_IDX_CHAR3_VALUE,
+    OTA_IDX_NB,
+};
+
+
+
+
+
+
+#define USER_OTA_SVC_UUID   {0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,0xfe,0x43,0x53,0x53,0x49}
+#define USER_OTA_TX_UUID   {0x16,0x96,0x24,0x47,0xc6,0x23,0x61,0xba,0xd9,0x4b,0x4d,0x1e,0x43,0x53,0x53,0x49}
+#define USER_OTA_RX_UUID   {0xb3,0x9b,0x72,0x34,0xbe,0xec,0xd4,0xa8,0xf4,0x43,0x41,0x88,0x43,0x53,0x53,0x49}
+#define USER_FLOW_CTRL_UUID   {0x18,0x03,0xa6,0x28,0x5e,0xd8,0xec,0x91,0x1c,0x48,0xa3,0xac,0x43,0x53,0x53,0x49}
+
+
+
+// User GATT Profile Service UUID
+#define USER_SVC_UUID             0xFFF0
+#define USER_CHAR1_NOTIFY_UUID    0xFFF1
+#define USER_CHAR2_WRITE_UUID     0xFFF2
+#define USER_CHAR3_NOTIFY_UUID    0xFFF3
+#define USER_CHAR4_WRITE_UUID     0xFFF4
+
+// User Profile attributes index.
+enum
+{
+    // SERVICE
+    USER_IDX_SERVICE,
+    // USER_IDX_CHAR1_USER_DESCRIPTION,
+    USER_IDX_CHAR1_DECLARATION,
+    USER_IDX_CHAR1_VALUE,
+    USER_IDX_CHAR1_CFG,
+    // USER_IDX_CHAR2_USER_DESCRIPTION,
+    USER_IDX_CHAR2_DECLARATION,
+    USER_IDX_CHAR2_VALUE,
+#if 0
+    // USER_IDX_CHAR3_USER_DESCRIPTION,
+    USER_IDX_CHAR3_DECLARATION,
+    USER_IDX_CHAR3_VALUE,
+    USER_IDX_CHAR3_CFG,
+    // USER_IDX_CHAR4_USER_DESCRIPTION,
+    USER_IDX_CHAR4_DECLARATION,
+    USER_IDX_CHAR4_VALUE,
+#endif
+    //-------- add service ----------//
+
+    //-------- add service ----------//
+    USER_IDX_NB,
+};
+
+
+
+extern uint16_t user_ble_notify_handle;
+extern uint16_t user_ble_notify_char_handle;
+extern uint16_t user_ble_receive_handle;
+
+extern uint16_t hid_ble_notify_handle;
+extern uint16_t hid_ble_notify_char_handle;
+extern uint16_t hid_ble_receive_handle;
+extern uint16_t hid_ble_pair_handle;
+
+extern uint16_t user_ble_ota_notify_handle;
+extern uint16_t user_ble_ota_notify_char_handle;
+extern uint16_t user_ble_ota_receive_handle;
+
+void bleGattServiceInit(void);
+void bleSetGattService(void);
+
+#endif
Index: ModuleDemo/updata_app/Boot/user/app_ble_gatt.c
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt.c	(nonexistent)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt.c	(working copy)
@@ -0,0 +1,662 @@
+#include "app_ble_gatt.h"
+#include "yc_ipc.h"
+#include "yc_bt.h"
+#include "bt_config.h"
+
+#define mem_le_pairing_handle 0xc44cc
+
+uint16_t user_ble_notify_handle;
+uint16_t user_ble_notify_char_handle;
+uint16_t user_ble_receive_handle;
+
+uint16_t user_ble_ota_notify_handle;
+uint16_t user_ble_ota_notify_char_handle;
+uint16_t user_ble_ota_receive_handle;
+
+
+uint16_t hid_ble_notify_handle;
+uint16_t hid_ble_notify_char_handle;
+uint16_t hid_ble_receive_handle;
+uint16_t hid_ble_pair_handle;
+
+uint16_t hid_input_keyboard_handle;
+uint16_t hid_input_media_handle;
+uint16_t hid_input_power_handle;
+uint16_t hid_input_bit_keybard_handle;
+uint16_t hid_input_mouse_handle;
+uint16_t hid_input_vendor_handle;
+uint16_t hid_output_keyboard_handle;
+uint16_t battery_level_handle;
+
+
+
+const GATT_Attribute service_gap[GAP_IDX_NB] =
+{
+    // Gap Service Declaration
+    [GAP_IDX_SERVICE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_2, UUID16_ARR(GAP_SERVICE_UUID)},
+    },
+
+    // Characteristic 1 Declaration   TX
+    [GAP_IDX_CHAR1_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ},
+    },
+    // Characteristic 1 Value
+    [GAP_IDX_CHAR1_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_DEVICE_NAME_UUID)},
+        {(sizeof(ble_device_name_const)-1), BLE_DEVICE_NAME},
+    },
+
+};
+
+
+const GATT_Attribute service_gatt[GATT_IDX_NB] =
+{
+    // Gatt Service Declaration
+    [GATT_IDX_SERVICE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_2, UUID16_ARR(GATT_SERVICE_UUID)},
+    },
+
+    // Characteristic 1 Declaration   TX
+    [GATT_IDX_CHAR1_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_INDI},
+    },
+    // Characteristic 1 Value
+    [GATT_IDX_CHAR1_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_SERVICE_CHANGED_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+
+    // Characteristic 1 client characteristic configuration
+    [GATT_IDX_CHAR1_CFG] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+};
+
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+
+const GATT_Attribute service_hid[HID_IDX_NB] =
+{
+    [HID_IDX_SERVICE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_2, UUID16_ARR(HID_SERV_UUID)},
+    },
+
+#if ((HID_DEV & HID_DEV_PROTO_MODE) == HID_DEV_PROTO_MODE)
+
+    // HID Protocol Mode characteristic declaration
+    [HID_PROTOCOL_MODE_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_CMD}
+    },
+
+    // HID Protocol Mode characteristic
+    [HID_PROTOCOL_MODE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(PROTOCOL_MODE_UUID)},
+        {SIZE_1, HID_PROTOCOL_VALUE},
+    },
+#endif
+
+
+#if ((HID_DEV & HID_DEV_MOUSE) == HID_DEV_MOUSE)
+    // HID Boot Mouse Input Report declaration
+    [HID_BOOT_MOUSE_IN_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+    
+    // HID Boot Mouse Input Report
+    [HID_BOOT_MOUSE_IN_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(BOOT_MOUSE_INPUT_UUID)},
+        {SIZE_8, ATT_VALUE_ZERO},
+    },
+    
+    // HID Report characteristic, key input client characteristic configuration
+    [HID_BOOT_MOUSE_IN_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+#endif
+
+#if ((HID_DEV & HID_DEV_KEYBOARD) == HID_DEV_KEYBOARD)
+    // HID Boot Keyboard Input Report declaration
+    [HID_BOOT_KEYBOARD_IN_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+    
+    // HID Boot Keyboard Input Report
+    [HID_BOOT_KEYBOARD_IN_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(BOOT_KEY_INPUT_UUID)},
+        {SIZE_8, ATT_VALUE_ZERO},
+    },
+    
+    // HID Boot Keyboard Input Report characteristic client characteristic configuration
+    [HID_BOOT_KEYBOARD_IN_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+    
+    // HID Boot Keyboard Output Report declaration
+    [HID_BOOT_KEYBOARD_OUT_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+    
+    // HID Boot Keyboard Output Report
+    [HID_BOOT_KEYBOARD_OUT_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(BOOT_KEY_OUTPUT_UUID)},
+        {SIZE_8, ATT_VALUE_ZERO},
+    },
+#endif
+
+    // Hid information
+    [HID_INFO_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ},
+    },
+    // Hid information
+    [HID_INFO_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(HID_INFORMATION_UUID)},
+        {SIZE_4, HID_INFO_VALUE},
+    },
+
+    // HID Control Point characteristic declaration
+    [HID_CONTROL_POINT_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_WRITE_CMD},
+    },
+
+    // HID Control Point characteristic value
+    [HID_CONTROL_POINT_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(HID_CTRL_PT_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+};
+
+#endif
+
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+
+const GATT_Attribute service_hid_reprtid[HID_REPORT_IDX_NB] =
+{
+    // Keyboard Report declaration
+    [HID_KEYBOARD_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_KEYBOARD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_8, ATT_VALUE_ZERO},
+    },
+
+    [HID_KEYBOARD_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_KEYBOARD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_KEYBOARD_REPORT_REF_VALUE},
+    },
+
+   	// media Report declaration
+    [HID_MEDIA_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_MEDIA_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_MEDIA_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_MEDIA_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_MEDIA_REPORT_REF_VALUE},
+    },
+    
+    // power Report declaration
+    [HID_POWER_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_POWER_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+
+    [HID_POWER_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_POWER_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_POWER_REPORT_REF_VALUE},
+    },
+    
+    // bit keyboard Report declaration
+    [HID_BIT_KEYBOARD_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_BIT_KEYBOARD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_15, ATT_VALUE_ZERO},
+    },
+
+    [HID_BIT_KEYBOARD_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_BIT_KEYBOARD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_BIT_KEYBOARD_REPORT_REF_VALUE},
+    },
+    
+    // mouse Report declaration
+    [HID_MOUSE_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_MOUSE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_4, ATT_VALUE_ZERO},
+    },
+
+    [HID_MOUSE_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_MOUSE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_MOUSE_REPORT_REF_VALUE},
+    },
+    
+    // vendor Report declaration
+    [HID_VENDOR_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_VENDOR_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_3, ATT_VALUE_ZERO},
+    },
+
+    [HID_VENDOR_CCCD_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_VENDOR_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_VENDOR_REPORT_REF_VALUE},
+    },
+    
+    // KB OUT Report declaration
+    [HID_KEYBOARD_OUT_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [HID_KEYBOARD_OUT_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+
+    [HID_REPORT_REF_KEYBOARD_OUT_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_REPORT_REF_UUID)},
+        {SIZE_2, HID_KB_OUT_REPORT_REF_VALUE},
+    },
+};
+#endif
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+
+const GATT_Attribute service_hid_reprtmap[HID_REPORT_MAP_IDX_NB] =
+{
+    // HID Report Map characteristic declaration
+    [HID_REPORT_MAP_DECL_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ},
+    },
+
+    // HID Report Map characteristic
+    [HID_REPORT_MAP_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(REPORT_MAP_UUID)},
+        {SIZE_69, HID_REPORT_MAP},
+    },
+};
+#endif
+
+#if ((FUNC_DEVICE_BT & BLE_BATTERY_SERVICE_ENABLE) == BLE_BATTERY_SERVICE_ENABLE)
+const GATT_Attribute service_battery[BATTERY_IDX_NB] =
+{
+    // Battery Service Declaration
+    [BATTERY_SERVICE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_2, UUID16_ARR(BATT_SERV_UUID)},
+    },
+	
+    // Battery characteristic declaration
+    [BATTERY_DECLARATION_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_READ | GATT_PROP_WRITE_REQ | GATT_PROP_NOTI}
+    },
+
+    [BATTERY_VALUE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(BATT_LEVEL_UUID)},
+        {SIZE_1, 100},
+    },
+
+    [BATTERY_CHAR_CFG_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, ATT_VALUE_ZERO},
+    },
+};
+#endif
+
+
+
+
+
+#if ((FUNC_DEVICE_BT & BLE_USER_SERVICE_ENABLE) == BLE_USER_SERVICE_ENABLE)
+
+//鐢ㄦ埛绉佹湁鏈嶅姟锛岀粨鏋勪綋鏁扮粍鍒濆鍖
+const GATT_Attribute service_user_transceive[USER_IDX_NB] =
+{
+    // User Service Declaration
+    [USER_IDX_SERVICE] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_2, UUID16_ARR(USER_SVC_UUID)},
+    },
+
+    // Characteristic 1 Declaration   TX  BT->HOST
+    [USER_IDX_CHAR1_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_NOTI},
+    },
+    // Characteristic 1 Value
+    [USER_IDX_CHAR1_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(USER_CHAR1_NOTIFY_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+    // Characteristic 1 client characteristic configuration
+    [USER_IDX_CHAR1_CFG] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, GATT_CCCD_VALUE},
+    },
+
+    // Characteristic 2 Declaration  RX  HOST->BT
+    [USER_IDX_CHAR2_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_WRITE_REQ},
+    },
+    // Characteristic 2 Value
+    [USER_IDX_CHAR2_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(USER_CHAR2_WRITE_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+#if 0
+    // Characteristic 3 Declaration   TX
+    [USER_IDX_CHAR3_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_NOTI},
+    },
+    // Characteristic 3 Value
+    [USER_IDX_CHAR3_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(USER_CHAR3_NOTIFY_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+    // Characteristic 3 client characteristic configuration
+    [USER_IDX_CHAR3_CFG] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, GATT_CCCD_VALUE},
+    },
+
+    // Characteristic 4 Declaration  RX
+    [USER_IDX_CHAR4_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_WRITE_REQ},
+    },
+    // Characteristic 4 Value
+    [USER_IDX_CHAR4_VALUE] = {
+        {UUID_SIZE_2, UUID16_ARR(USER_CHAR4_WRITE_UUID)},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+#endif
+
+};
+
+#endif
+#if ((FUNC_DEVICE_BT & BLE_OTA_SERVICE_ENABLE) == BLE_OTA_SERVICE_ENABLE)
+const GATT_Attribute service_OTA[OTA_IDX_NB] =
+{
+    [OTA_SERVICE_IDX] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_PRIMARY_SERVICE_UUID)},
+        {SIZE_16, USER_OTA_SVC_UUID},
+    },
+
+    // Characteristic 1 Declaration   TX  BT->HOST
+    [OTA_IDX_CHAR1_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_NOTI},
+    },
+    // Characteristic 1 Value
+    [OTA_IDX_CHAR1_VALUE] = {
+        {UUID_SIZE_16, USER_OTA_TX_UUID},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+    // Characteristic 1 client characteristic configuration
+    [OTA_IDX_CHAR1_CFG] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CLIENT_CHAR_CFG_UUID)},
+        {SIZE_2, GATT_CCCD_VALUE},
+    },
+
+    // Characteristic 2 Declaration  RX  HOST->BT
+    [OTA_IDX_CHAR2_DECLARATION] = {
+        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+        {SIZE_1, GATT_PROP_WRITE_REQ|GATT_PROP_WRITE_CMD},
+    },
+    // Characteristic 2 Value
+    [OTA_IDX_CHAR2_VALUE] = {
+        {UUID_SIZE_16, USER_OTA_RX_UUID},
+        {SIZE_1, ATT_VALUE_ZERO},
+    },
+//	// Characteristic 3 Declaration  flow ctrl
+//	 [OTA_IDX_CHAR3_DECLARATION] = {
+//        {UUID_SIZE_2, UUID16_ARR(GATT_CHARACTER_UUID)},
+//        {SIZE_1, GATT_PROP_WRITE_REQ|GATT_PROP_NOTI},
+//    },
+//    // Characteristic 3 Value
+//    [OTA_IDX_CHAR3_VALUE] = {
+//        {UUID_SIZE_16, USER_FLOW_CTRL_UUID},
+//        {SIZE_1, ATT_VALUE_ZERO},
+//    },
+};
+#endif
+
+void genBleGattService(const GATT_Attribute *service_table, uint8_t service_index_max, uint16_t *service_handle, uint8_t *out_service_table, uint8_t *out_service_length)
+{
+    uint8_t loop_assist_idx = 0;
+    uint8_t uuid_inner_idx = 0;
+    uint8_t temp_index = 0;
+    uint8_t ble_inf_idx = 0;
+    uint8_t ble_inf_table[MAX_TCP_DATA_LEN] = {0};
+
+    for (loop_assist_idx = 0; loop_assist_idx < service_index_max; loop_assist_idx++)
+    {
+        temp_index = ble_inf_idx;
+
+        ble_inf_table[ble_inf_idx++] = *service_handle & 0xff;
+        ble_inf_table[ble_inf_idx++] = *service_handle >> 8;
+        (*service_handle)++;
+
+        ble_inf_table[ble_inf_idx++] = service_table[loop_assist_idx].uuid.size;
+        for (uuid_inner_idx = 0; uuid_inner_idx < service_table[loop_assist_idx].uuid.size; uuid_inner_idx++)
+        {
+            ble_inf_table[ble_inf_idx++] = service_table[loop_assist_idx].uuid.uuid[uuid_inner_idx];
+        }
+
+        ble_inf_table[ble_inf_idx++] = service_table[loop_assist_idx].attribute_data.size;
+        for (uuid_inner_idx = 0; uuid_inner_idx < service_table[loop_assist_idx].attribute_data.size; uuid_inner_idx++)
+        {
+            ble_inf_table[ble_inf_idx++] = service_table[loop_assist_idx].attribute_data.attribute[uuid_inner_idx];
+        }
+
+        for (int i = temp_index; i < ble_inf_idx; i++)
+            MyPrintf("%02x ", ble_inf_table[i]);
+        MyPrintf("\r\n");
+    }
+    
+    out_service_length[0] = ble_inf_idx;
+    memcpy(out_service_table,ble_inf_table,ble_inf_idx);
+}
+
+
+void bleGattServiceInit(void)
+{
+    uint16_t handle_num[1] = {0x0001};  //start handle
+    uint8_t service_table_gen[MAX_TCP_DATA_LEN] = {0};
+    uint8_t service_len_gen[1] = {0};
+    
+
+    //service GAP
+    genBleGattService(service_gap,GAP_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetGapService_suc\n");
+    else
+        MyPrintf("SetGapService_failed\n");
+    
+    //service GATT
+    genBleGattService(service_gatt,GATT_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetGattService_suc\n");
+    else
+        MyPrintf("SetGattService_failed\n");
+
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+
+    genBleGattService(service_hid,HID_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetHidService_suc\n");
+    else
+        MyPrintf("SetHidService_failed\n");
+#endif
+
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+    //service HID_report id
+    hid_input_keyboard_handle = *handle_num + HID_KEYBOARD_IDX;
+    hid_input_media_handle = *handle_num + HID_MEDIA_IDX;
+    hid_input_power_handle = *handle_num + HID_POWER_IDX;
+    hid_input_bit_keybard_handle = *handle_num + HID_BIT_KEYBOARD_IDX;
+    hid_input_mouse_handle = *handle_num + HID_MOUSE_IDX;
+    hid_input_vendor_handle = *handle_num + HID_VENDOR_IDX;
+    hid_output_keyboard_handle = *handle_num + HID_KEYBOARD_OUT_IDX;
+    
+    genBleGattService(service_hid_reprtid,HID_REPORT_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetHid_ReportId_suc\n");
+    else
+        MyPrintf("SetHid_ReportId_failed\n");
+        
+    MyPrintf("BLE_Service_Hid: hid_input_keyboard_handle = %04x\n",hid_input_keyboard_handle);
+    MyPrintf("BLE_Service_Hid: hid_input_media_handle = %04x\n",hid_input_media_handle);
+    MyPrintf("BLE_Service_Hid: hid_input_power_handle = %04x\n",hid_input_power_handle);
+    MyPrintf("BLE_Service_Hid: hid_input_bit_keybard_handle = %04x\n",hid_input_bit_keybard_handle);
+    MyPrintf("BLE_Service_Hid: hid_input_mouse_handle = %04x\n",hid_input_mouse_handle);
+    MyPrintf("BLE_Service_Hid: hid_input_vendor_handle = %04x\n",hid_input_vendor_handle);
+    MyPrintf("BLE_Service_Hid: hid_output_keyboard_handle = %04x\n",hid_output_keyboard_handle);
+#endif
+		
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+    //service HID_report id
+
+    hid_ble_pair_handle = *handle_num + HID_REPORT_MAP_IDX;
+    HW_REG_16BIT(mem_le_pairing_handle,hid_ble_pair_handle);
+    genBleGattService(service_hid_reprtmap,HID_REPORT_MAP_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetHid_ReportMap_suc\n");
+    else
+        MyPrintf("SetHid_ReportMap_failed\n");
+#endif		
+
+
+#if ((FUNC_DEVICE_BT & BLE_BATTERY_SERVICE_ENABLE) == BLE_BATTERY_SERVICE_ENABLE)
+	//service BATTERY
+	battery_level_handle =  *handle_num + BATTERY_VALUE_IDX;
+    genBleGattService(service_battery,BATTERY_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetbatteryService_suc\n");
+    else
+        MyPrintf("SetBatteryService_failed\n");
+	
+	MyPrintf("BLE_Service_Battery: battery_level_handle = %04x\n",battery_level_handle);
+#endif
+		
+		
+#if ((FUNC_DEVICE_BT & BLE_USER_SERVICE_ENABLE) == BLE_USER_SERVICE_ENABLE)
+    //service USER
+    user_ble_notify_handle = *handle_num + USER_IDX_CHAR1_VALUE;
+    user_ble_notify_char_handle = *handle_num + USER_IDX_CHAR1_CFG;
+    user_ble_receive_handle = *handle_num + USER_IDX_CHAR2_VALUE;
+    genBleGattService(service_user_transceive,USER_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetUserService_suc\n");
+    else
+        MyPrintf("SetUserService_failed\n");
+		
+		
+#endif
+
+#if ((FUNC_DEVICE_BT & BLE_OTA_SERVICE_ENABLE) == BLE_OTA_SERVICE_ENABLE)
+    //service USER
+    user_ble_ota_notify_handle = *handle_num + OTA_IDX_CHAR1_VALUE;
+    user_ble_ota_notify_char_handle = *handle_num + OTA_IDX_CHAR1_CFG;
+    user_ble_ota_receive_handle = *handle_num + OTA_IDX_CHAR2_VALUE;
+    genBleGattService(service_OTA,OTA_IDX_NB,handle_num,service_table_gen,service_len_gen);
+    if(BT_AddBleBlockService(service_table_gen,*service_len_gen)==TRUE)
+        MyPrintf("SetOtaService_suc\n");
+    else
+        MyPrintf("SetOTAService_failed\n");
+		
+#endif
+}
+
+
+/**
+ * @brief 钃濈墮璁剧疆鏈嶅姟
+ *
+ * @param
+ */
+void bleSetGattService(void)
+{
+    bleGattServiceInit();
+	
+	MyPrintf("BLE_Service_OTA: notify handle = %04x\n",user_ble_ota_notify_handle);
+    MyPrintf("BLE_Service_OTA: notify character handle = %04x\n",user_ble_ota_notify_char_handle);
+    MyPrintf("BLE_Service_OTA: write handle = %04x\n",user_ble_ota_receive_handle);
+	
+	MyPrintf("BLE_Service_User: notify handle = %04x\n",user_ble_notify_handle);
+    MyPrintf("BLE_Service_User: notify character handle = %04x\n",user_ble_notify_char_handle);
+    MyPrintf("BLE_Service_User: write handle = %04x\n",user_ble_receive_handle);
+	
+}
Index: ModuleDemo/updata_app/Boot/user/app_ble_gatt_sig_uuid.h
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt_sig_uuid.h	(nonexistent)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/user/app_ble_gatt_sig_uuid.h	(working copy)
@@ -0,0 +1,300 @@
+#ifndef __GATT_SIG_UUID_H_
+#define __GATT_SIG_UUID_H_
+
+#include "type.h"
+ 
+//uuid瀛楄妭鏁
+#define UUID_SIZE_2         2 
+#define UUID_SIZE_16        16
+
+
+#define SIZE_1         1
+#define SIZE_2         2
+#define SIZE_3         3
+#define SIZE_4         4
+#define SIZE_5         5
+#define SIZE_6         6
+#define SIZE_7         7
+#define SIZE_8         8
+#define SIZE_15        15
+#define SIZE_16        16
+#define SIZE_69        69
+#define SIZE_203 				203
+#define SIZE_255       255
+
+//瀛楄妭椤哄簭浜ゆ崲
+#define UUID16_ARR(uuid16)        {uuid16&0xff,(uuid16&0xff00)>>8}
+#define UUID128_ARR(uuid16)       {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, \
+                                   0x00, 0x10, 0x00, 0x00, (uuid16 & 0xff),(uuid16&0xff00)>>8, 0x00, 0x00}
+
+
+// GATT_PROP_BITMAPS_DEFINES GATT Attribute Access Permissions Bit Fields
+#define GATT_PROP_BROADCAST             (1<<0)  //!< Attribute is able to broadcast
+#define GATT_PROP_READ                  (1<<1)  //!< Attribute is Readable
+#define GATT_PROP_WRITE_CMD             (1<<2)  //!< Attribute supports write with no response
+#define GATT_PROP_WRITE_REQ             (1<<3)  //!< Attribute supports write request
+#define GATT_PROP_NOTI                  (1<<4)  //!< Attribute is able to send notification
+#define GATT_PROP_INDI                  (1<<5)  //!< Attribute is able to send indication
+#define GATT_PROP_AUTH_SIG_WRTIE        (1<<6)  //!< Attribute supports authenticated signed write
+#define GATT_PROP_EXTEND_PROP           (1<<7)  //!< Attribute supports extended properities
+#define GATT_PROP_WRITE                 (1<<8)  //!< Attribute is Writable (support both write_req and write_cmd)
+
+#define GATT_CCCD_VALUE 0x0001
+
+
+
+
+
+/*
+ * WARNING: The 16-bit UUIDs are assigned by the Bluetooth SIG and published
+ *          in the Bluetooth Assigned Numbers page. Do not change these values.
+ *          Changing them will cause Bluetooth interoperability issues.
+ */
+
+/**
+ * GATT Services
+ */
+#define GAP_SERVICE_UUID                           0x1800 // Generic Access Profile
+#define GATT_SERVICE_UUID                          0x1801 // Generic Attribute Profile
+
+/**
+ * GATT Declarations
+ */
+#define GATT_PRIMARY_SERVICE_UUID                  0x2800 // Primary Service
+#define GATT_SECONDARY_SERVICE_UUID                0x2801 // Secondary Service
+#define GATT_INCLUDE_UUID                          0x2802 // Include
+#define GATT_CHARACTER_UUID                        0x2803 // Characteristic
+
+/**
+ * GATT Descriptors
+ */
+#define GATT_CHAR_EXT_PROPS_UUID                   0x2900 // Characteristic Extended Properties
+#define GATT_CHAR_USER_DESC_UUID                   0x2901 // Characteristic User Description
+#define GATT_CLIENT_CHAR_CFG_UUID                  0x2902 // Client Characteristic Configuration
+#define GATT_SERV_CHAR_CFG_UUID                    0x2903 // Server Characteristic Configuration
+#define GATT_CHAR_FORMAT_UUID                      0x2904 // Characteristic Presentation Format
+#define GATT_CHAR_AGG_FORMAT_UUID                  0x2905 // Characteristic Aggregate Format
+#define GATT_VALID_RANGE_UUID                      0x2906 // Valid Range
+#define GATT_EXT_REPORT_REF_UUID                   0x2907 // External Report Reference Descriptor
+#define GATT_REPORT_REF_UUID                       0x2908 // Report Reference Descriptor
+
+/**
+ * GATT Characteristics
+ */
+#define GATT_DEVICE_NAME_UUID                           0x2A00 // Device Name
+#define GATT_APPEARANCE_UUID                            0x2A01 // Appearance
+#define GATT_PERI_PRIVACY_FLAG_UUID                     0x2A02 // Peripheral Privacy Flag
+#define GATT_RECONNECT_ADDR_UUID                        0x2A03 // Reconnection Address
+#define GATT_PERI_CONN_PARAM_UUID                       0x2A04 // Peripheral Preferred Connection Parameters
+#define GATT_SERVICE_CHANGED_UUID                       0x2A05 // Service Changed
+#define GATT_ADDR_RESOL_SUPP                            0x2AA6 // Central Address Resolution supported
+#define GATT_RSLV_PRIV_ADDR_ONLY                        0x2AC9 // Resolvable Private Address only
+
+/*
+ * WARNING: The 16-bit UUIDs are assigned by the Bluetooth SIG and published
+ *          in the Bluetooth Assigned Numbers page. Do not change these values.
+ *          Changing them will cause Bluetooth interoperability issues.
+ */
+
+/**
+ * GATT Service UUIDs
+ */
+#define IMMEDIATE_ALERT_SERV_UUID       0x1802  // Immediate Alert
+#define LINK_LOSS_SERV_UUID             0x1803  // Link Loss
+#define TX_PWR_LEVEL_SERV_UUID          0x1804  // Tx Power
+#define CURRENT_TIME_SERV_UUID          0x1805  // Current Time Service
+#define REF_TIME_UPDATE_SERV_UUID       0x1806  // Reference Time Update Service
+#define NEXT_DST_CHANGE_SERV_UUID       0x1807  // Next DST Change Service
+#define GLUCOSE_SERV_UUID               0x1808  // Glucose
+#define THERMOMETER_SERV_UUID           0x1809  // Health Thermometer
+#define DEVINFO_SERV_UUID               0x180A  // Device Information
+#define NWA_SERV_UUID                   0x180B  // Network Availability
+#define HEARTRATE_SERV_UUID             0x180D  // Heart Rate
+#define PHONE_ALERT_STS_SERV_UUID       0x180E  // Phone Alert Status Service
+#define BATT_SERV_UUID                  0x180F  // Battery Service
+#define BLOODPRESSURE_SERV_UUID         0x1810  // Blood Pressure
+#define ALERT_NOTIF_SERV_UUID           0x1811  // Alert Notification Service
+#define HID_SERV_UUID                   0x1812  // Human Interface Device
+#define SCAN_PARAM_SERV_UUID            0x1813  // Scan Parameters
+#define RSC_SERV_UUID                   0x1814  // Running Speed and Cadence
+#define CSC_SERV_UUID                   0x1816  // Cycling Speed and Cadence
+#define CYCPWR_SERV_UUID                0x1818  // Cycling Power
+#define LOC_NAV_SERV_UUID               0x1819  // Location and Navigation
+#define FITMACHINE_SERV_UUID            0x1826  // Fitmachine
+
+/**
+ * GATT Characteristic UUIDs
+ */
+#define ALERT_LEVEL_UUID                0x2A06  // Alert Level
+#define TX_PWR_LEVEL_UUID               0x2A07  // Tx Power Level
+#define DATE_TIME_UUID                  0x2A08  // Date Time
+#define DAY_OF_WEEK_UUID                0x2A09  // Day of Week
+#define DAY_DATE_TIME_UUID              0x2A0A  // Day Date Time
+#define EXACT_TIME_256_UUID             0x2A0C  // Exact Time 256
+#define DST_OFFSET_UUID                 0x2A0D  // DST Offset
+#define TIME_ZONE_UUID                  0x2A0E  // Time Zone
+#define LOCAL_TIME_INFO_UUID            0x2A0F  // Local Time Information
+#define TIME_WITH_DST_UUID              0x2A11  // Time with DST
+#define TIME_ACCURACY_UUID              0x2A12  // Time Accuracy
+#define TIME_SOURCE_UUID                0x2A13  // Time Source
+#define REF_TIME_INFO_UUID              0x2A14  // Reference Time Information
+#define TIME_UPDATE_CTRL_PT_UUID        0x2A16  // Time Update Control Point
+#define TIME_UPDATE_STATE_UUID          0x2A17  // Time Update State
+#define GLUCOSE_MEAS_UUID               0x2A18  // Glucose Measurement
+#define BATT_LEVEL_UUID                 0x2A19  // Battery Level
+#define TEMP_MEAS_UUID                  0x2A1C  // Temperature Measurement
+#define TEMP_TYPE_UUID                  0x2A1D  // Temperature Type
+#define IMEDIATE_TEMP_UUID              0x2A1E  // Intermediate Temperature
+#define MEAS_INTERVAL_UUID              0x2A21  // Measurement Interval
+#define BOOT_KEY_INPUT_UUID             0x2A22  // Boot Keyboard Input Report
+#define SYSTEM_ID_UUID                  0x2A23  // System ID
+#define MODEL_NUMBER_UUID               0x2A24  // Model Number String
+#define SERIAL_NUMBER_UUID              0x2A25  // Serial Number String
+#define FIRMWARE_REV_UUID               0x2A26  // Firmware Revision String
+#define HARDWARE_REV_UUID               0x2A27  // Hardware Revision String
+#define SOFTWARE_REV_UUID               0x2A28  // Software Revision String
+#define MANUFACTURER_NAME_UUID          0x2A29  // Manufacturer Name String
+#define IEEE_11073_CERT_DATA_UUID       0x2A2A  // IEEE 11073-20601 Regulatory Certification Data List
+#define CURRENT_TIME_UUID               0x2A2B  // Current Time
+#define SCAN_REFRESH_UUID               0x2A31  // Scan Refresh
+#define BOOT_KEY_OUTPUT_UUID            0x2A32  // Boot Keyboard Output Report
+#define BOOT_MOUSE_INPUT_UUID           0x2A33  // Boot Mouse Input Report
+#define GLUCOSE_CONTEXT_UUID            0x2A34  // Glucose Measurement Context
+#define BLOODPRESSURE_MEAS_UUID         0x2A35  // Blood Pressure Measurement
+#define IMEDIATE_CUFF_PRESSURE_UUID     0x2A36  // Intermediate Cuff Pressure
+#define HEARTRATE_MEAS_UUID             0x2A37  // Heart Rate Measurement
+#define BODY_SENSOR_LOC_UUID            0x2A38  // Body Sensor Location
+#define HEARTRATE_CTRL_PT_UUID          0x2A39  // Heart Rate Control Point
+#define NETWORK_AVAIL_UUID              0x2A3E  // Network Availability
+#define ALERT_STATUS_UUID               0x2A3F  // Alert Status
+#define RINGER_CTRL_PT_UUID             0x2A40  // Ringer Control Point
+#define RINGER_SETTING_UUID             0x2A41  // Ringer Setting
+#define ALERT_CAT_ID_BMASK_UUID         0x2A42  // Alert Category ID Bit Mask
+#define ALERT_CAT_ID_UUID               0x2A43  // Alert Category ID
+#define ALERT_NOTIF_CTRL_PT_UUID        0x2A44  // Alert Notification Control Point
+#define UNREAD_ALERT_STATUS_UUID        0x2A45  // Unread Alert Status
+#define NEW_ALERT_UUID                  0x2A46  // New Alert
+#define SUP_NEW_ALERT_CAT_UUID          0x2A47  // Supported New Alert Category
+#define SUP_UNREAD_ALERT_CAT_UUID       0x2A48  // Supported Unread Alert Category
+#define BLOODPRESSURE_FEATURE_UUID      0x2A49  // Blood Pressure Feature
+#define HID_INFORMATION_UUID            0x2A4A  // HID Information
+#define REPORT_MAP_UUID                 0x2A4B  // Report Map
+#define HID_CTRL_PT_UUID                0x2A4C  // HID Control Point
+#define REPORT_UUID                     0x2A4D  // Report
+#define PROTOCOL_MODE_UUID              0x2A4E  // Protocol Mode
+#define SCAN_INTERVAL_WINDOW_UUID       0x2A4F  // Scan Interval Window
+#define PNP_ID_UUID                     0x2A50  // PnP ID
+#define GLUCOSE_FEATURE_UUID            0x2A51  // Glucose Feature
+#define RECORD_CTRL_PT_UUID             0x2A52  // Record Access Control Point
+#define RSC_MEAS_UUID                   0x2A53  // RSC Measurement
+#define RSC_FEATURE_UUID                0x2A54  // RSC Feature
+#define SC_CTRL_PT_UUID                 0x2A55  // SC Control Point
+#define CSC_MEAS_UUID                   0x2A5B  // CSC Measurement
+#define CSC_FEATURE_UUID                0x2A5C  // CSC Feature
+#define SENSOR_LOC_UUID                 0x2A5D  // Sensor Location
+#define CYCPWR_MEAS_UUID                0x2A63  // Cycling Power Measurement
+#define CYCPWR_VECTOR_UUID              0x2A64  // Cycling Power Vector
+#define CYCPWR_FEATURE_UUID             0x2A65  // Cycling Power Feature
+#define CYCPWR_CTRL_PT_UUID             0x2A66  // Cycling Power Control Point
+#define LOC_SPEED_UUID                  0x2A67  // Location and Speed
+#define NAV_UUID                        0x2A68  // Navigation
+#define POS_QUALITY_UUID                0x2A69  // Position Quality
+#define LN_FEATURE_UUID                 0x2A6A  // LN Feature
+#define LN_CTRL_PT_UUID                 0x2A6B  // LN Control Point  
+
+#define GATT_UUID_FITNESS_MACHINE_FEATURE           0x2ACC
+#define GATT_UUID_TREADMILL_DATA                    0x2ACD //璺戞鏈烘暟鎹
+#define GATT_UUID_CROSS_TRAINER_DATA                0x2ACE //妞渾鏈烘暟鎹
+#define GATT_UUID_ROWER_DATA                        0x2AD1 //鍒掕埞鏈烘暟鎹
+#define GATT_UUID_INDOOR_BIKE_DATA                  0x2AD2 //鍗曡溅鏁版嵁
+#define GATT_UUID_STEP_CLIMBER_DATA                 0x2ACF //鏀宀╂満
+#define GATT_UUID_STAIR_CLIMBER_DATA                0x2AD0  //鐖ゼ姊満
+
+#define GATT_UUID_TRAINING_STATUS                   0x2AD3
+#define GATT_UUID_SUPPORT_SPEED_RANGE               0x2AD4
+#define GATT_UUID_SUPPORT_INCLINATION_RANGE         0x2AD5
+#define GATT_UUID_SUPPORT_RESISTANCE_LEVEL_RANGE    0x2AD6
+#define GATT_UUID_SUPPORT_HEART_RATE_RANGE          0x2AD7
+#define GATT_UUID_SUPPORT_POWER_RANGE               0x2AD8
+#define GATT_UUID_FITNESS_MACHINE_CONTROL_POINT     0x2AD9
+#define GATT_UUID_FITNESS_MACHINE_STATUS            0x2ADA
+
+/**
+ * GATT Unit UUIDs
+ */
+#define GATT_UNITLESS_UUID                    0x2700  // <Symbol>, <Expressed in terms of SI base units>
+#define GATT_UNIT_LENGTH_METER_UUID           0x2701  // m, m
+#define GATT_UNIT_MASS_KGRAM_UUID             0x2702  // kg, kg
+#define GATT_UNIT_TIME_SECOND_UUID            0x2703  // s, s
+#define GATT_UNIT_ELECTRIC_CURRENT_A_UUID     0x2704  // A, A
+#define GATT_UNIT_THERMODYN_TEMP_K_UUID       0x2705  // K, K
+#define GATT_UNIT_AMOUNT_SUBSTANCE_M_UUID     0x2706  // mol, mol
+#define GATT_UNIT_LUMINOUS_INTENSITY_C_UUID   0x2707  // cd, cd
+
+#define GATT_UNIT_AREA_SQ_MTR_UUID            0x2710  // m^2, m^2
+#define GATT_UNIT_VOLUME_CUBIC_MTR_UUID       0x2711  // m^3, m^3
+#define GATT_UNIT_VELOCITY_MPS_UUID           0x2712  // m/s, m s^-1
+#define GATT_UNIT_ACCELERATION_MPS_SQ_UUID    0x2713  // m/s^2, m s^-2
+#define GATT_UNIT_WAVENUMBER_RM_UUID          0x2714  // ? m^-1
+#define GATT_UNIT_DENSITY_KGPCM_UUID          0x2715  // p, kg m^-3
+#define GATT_UNIT_SURFACE_DENSITY_KGPSM_UUID  0x2716  // pA, kg m^-2
+#define GATT_UNIT_SPECIFIC_VOLUME_CMPKG_UUID  0x2717  // v, m^3 kg^-1
+#define GATT_UNIT_CURRENT_DENSITY_APSM_UUID   0x2718  // j, A m^-2
+#define GATT_UNIT_MAG_FIELD_STRENGTH_UUID     0x2719  // H, A m
+#define GATT_UNIT_AMOUNT_CONC_MPCM_UUID       0x271A  // c, mol m^-3
+#define GATT_UNIT_MASS_CONC_KGPCM_UUID        0x271B  // c, kg m^-3
+#define GATT_UNIT_LUMINANCE_CPSM_UUID         0x271C  // Lv, cd m^-2
+#define GATT_UNIT_REFRACTIVE_INDEX_UUID       0x271D  // n, 1
+#define GATT_UNIT_RELATIVE_PERMEABLILTY_UUID  0x271E  // u, 1
+#define GATT_UNIT_PLANE_ANGLE_RAD_UUID        0x2720  // rad, m m-1
+#define GATT_UNIT_SOLID_ANGLE_STERAD_UUID     0x2721  // sr, m2 m-2
+#define GATT_UNIT_FREQUENCY_HTZ_UUID          0x2722  // Hz, s-1
+#define GATT_UNIT_FORCE_NEWTON_UUID           0x2723  // N, m kg s-2
+#define GATT_UNIT_PRESSURE_PASCAL_UUID        0x2724  // Pa, N/m2 = m2 kg s-2
+#define GATT_UNIT_ENERGY_JOULE_UUID           0x2725  // J, N m = m2 kg s-2
+#define GATT_UNIT_POWER_WATT_UUID             0x2726  // W, J/s = m2 kg s-3
+#define GATT_UNIT_E_CHARGE_C_UUID             0x2727  // C, sA
+#define GATT_UNIT_E_POTENTIAL_DIF_V_UUID      0x2728  // V, W/A = m2 kg s-3 A-1
+
+#define GATT_UNIT_CELSIUS_TEMP_DC_UUID        0x272F  // oC, t/oC = T/K - 273.15
+
+#define GATT_UNIT_TIME_MINUTE_UUID            0x2760  // min, 60 s
+#define GATT_UNIT_TIME_HOUR_UUID              0x2761  // h, 3600 s
+#define GATT_UNIT_TIME_DAY_UUID               0x2762  // d, 86400 s
+#define GATT_UNIT_PLANE_ANGLE_DEGREE_UUID     0x2763  // o, (pi/180) rad
+#define GATT_UNIT_PLANE_ANGLE_MINUTE_UUID     0x2764  // ', (pi/10800) rad
+#define GATT_UNIT_PLANE_ANGLE_SECOND_UUID     0x2765  // '', (pi/648000) rad
+#define GATT_UNIT_AREA_HECTARE_UUID           0x2766  // ha, 10^4 m^2
+#define GATT_UNIT_VOLUME_LITRE_UUID           0x2767  // l, 10^-3 m^3
+#define GATT_UNIT_MASS_TONNE_UUID             0x2768  // t, 10^3 kg
+
+#define GATT_UINT_LENGTH_YARD_UUID            0x27A0  // yd, 0.9144 m
+#define GATT_UNIT_LENGTH_PARSEC_UUID          0x27A1  // pc, 3.085678 ?1016 m
+#define GATT_UNIT_LENGTH_INCH_UUID            0x27A2  // in, 0.0254 m
+#define GATT_UNIT_LENGTH_FOOT_UUID            0x27A3  // ft, 0.3048 m
+#define GATT_UNIT_LENGTH_MILE_UUID            0x27A4  // mi, 1609.347 m
+#define GATT_UNIT_PRESSURE_PFPSI_UUID         0x27A5  // psi, 6.894757 ?103 Pa
+#define GATT_UNIT_VELOCITY_KMPH_UUID          0x27A6  // km/h, 0.2777778 m^s-1
+#define GATT_UNIT_VELOCITY_MPH_UUID           0x27A7  // mi/h, 0.44704 m^ s-1
+#define GATT_UNIT_ANGULAR_VELOCITY_RPM_UUID   0x27A8  // r/min, 0.1047198 rad s-1
+#define GATT_UNIT_ENERGY_GCAL_UUID            0x27A9  //
+#define GATT_UNIT_ENERGY_KCAL_UUID            0x27AA  // kcal, 4190.02 J
+#define GATT_UNIT_ENERGY_KWH_UUID             0x27AB  // kWh, 3600000 J
+#define GATT_UNIT_THERMODYN_TEMP_DF_UUID      0x27AC  // oF, t/oF = T/K ?1.8 - 459.67
+#define GATT_UNIT_PERCENTAGE_UUID             0x27AD  // %
+#define GATT_UNIT_PER_MILE_UUID               0x27AE  //
+#define GATT_UNIT_PERIOD_BPM_UUID             0x27AF  //
+#define GATT_UNIT_E_CHARGE_AH_UUID            0x27B0  //
+#define GATT_UNIT_MASS_DENSITY_MGPD_UUID      0x27B1  //
+#define GATT_UNIT_MASS_DENSITY_MMPL_UUID      0x27B2  //
+#define GATT_UNIT_TIME_YEAR_UUID              0x27B3  //
+#define GATT_UNIT_TIME_MONTH_UUID             0x27B4  //
+
+
+
+
+
+
+
+
+#endif
Index: ModuleDemo/updata_app/Boot/user/bt_config.h
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/user/bt_config.h	(nonexistent)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/user/bt_config.h	(working copy)
@@ -0,0 +1,113 @@
+/*
+File Name    : yc3121.h
+Author       : Yichip
+Version      : V1.0
+Date         : 2022/05/23
+Description  : BT information.
+*/
+
+#ifndef __BT_CONFIG_H_
+#define __BT_CONFIG_H_
+#include "type.h"
+
+/**************************钃濈墮浣胯兘***************************/
+#define DEVICE_BLE_ENABLE         	0x01
+#define DEVICE_BT_ENABLE         	 	0x02
+#define BLE_HID_SERVICE_ENABLE    	0x04
+#define BLE_USER_SERVICE_ENABLE   	0x08
+#define BLE_BATTERY_SERVICE_ENABLE  0x10
+#define BLE_OTA_SERVICE_ENABLE 		  0x20
+#define FUNC_DEVICE_BT            (BLE_OTA_SERVICE_ENABLE)
+
+
+/**************************钃濈墮璁惧绫诲瀷***************************/
+static const uint8_t bt_cod_const[3] = {0x24,0x04,0x04};
+
+/**************************钃濈墮MTU***************************/
+#define BLE_LOCAL_MTU 185
+
+/**************************钃濈墮璁惧鍚***************************/
+#define BLE_DEVICE_NAME    "3xble"
+#define BT_DEVICE_NAME     "3xbt"
+static const uint8_t ble_device_name_const[6] = BLE_DEVICE_NAME;
+static const uint8_t bt_device_name_const[5] =  BT_DEVICE_NAME;
+
+/**************************钃濈墮Mac鍦板潃***************************/
+static const uint8_t ble_device_mac_const[6] = {0x11,0x11,0x11,0x44,0x22,0x10};   //0x102244000000
+static const uint8_t bt_device_mac_const[6] =  {0x22,0x22,0x22,0x33,0x22,0x10};   //0x102233000000
+
+/**************************钃濈墮PINCODE***************************/
+#define BLE_RANDOM_PINCODE_VALUE     0x00
+#define BLE_FIXED_PINCODE_VALUE      0x01
+static const int ble_pincode_const = {123456};
+
+/**************************钃濈墮杩炴帴鍙傛暟***************************/
+static const uint8_t ble_conn_param_const[8] = 
+{
+    0x06, 0x00,         //minimum connection interval. unit: 1.25ms
+    0x0c, 0x00,         //maximum connection interval, in normal case can be set same as min_intv. unit: 1.25ms
+    0x00, 0x00,         //slave latency, number of connection events that slave would like to skip.
+    0x2c, 0x01          //timeout before connection is dropped. unit: 10ms
+};
+
+static const uint8_t ble_ota_conn_param_const[8] = 
+{
+    0x06, 0x00,         //minimum connection interval. unit: 1.25ms
+    0x06, 0x00,         //maximum connection interval, in normal case can be set same as min_intv. unit: 1.25ms
+    0x2b, 0x01,         //slave latency, number of connection events that slave would like to skip.
+    0xb0, 0x04          //timeout before connection is dropped. unit: 10ms
+};
+
+/**************************ADV鏁版嵁鍖***************************/
+#define BLE_ADV_DATA_LEN_MAX    31
+#define BLE_SCAN_RSP_LEN_MAX    31
+
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+
+#define BLE_ADV_DATA_INDEX    13
+#define BLE_SCAN_RSP_INDEX    13
+
+#else
+
+#define BLE_ADV_DATA_INDEX    3
+#define BLE_SCAN_RSP_INDEX    3
+
+#endif
+
+static const uint8_t ble_adv_data_const[BLE_ADV_DATA_LEN_MAX] =
+{
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+    0x02, 0x01, 0x06,       //flag
+    0x03, 0x19, 0xc2, 0x03,   //appearance
+    0x05, 0x02, 0x12, 0x18, 0xF0, 0xFF,  //service uuid
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+#else
+    0x02, 0x01, 0x06,       //flag
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+#endif
+};
+
+/**************************鎵弿鍝嶅簲鍖***************************/
+static const uint8_t ble_scan_rsp_const[BLE_SCAN_RSP_LEN_MAX] =
+{
+#if ((FUNC_DEVICE_BT & BLE_HID_SERVICE_ENABLE) == BLE_HID_SERVICE_ENABLE)
+    0x02, 0x01, 0x06,       //flag
+    0x03, 0x19, 0xc2, 0x03,   //appearance
+    0x05, 0x02, 0x12, 0x18, 0xF0, 0xFF,  //service uuid
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+#else
+    0x02, 0x01, 0x06,       //flag
+    0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+#endif
+};
+
+
+#endif
Index: ModuleDemo/updata_app/Boot/user/ota_ble.c
===================================================================
--- /YC3121_demo/ModuleDemo/updata_app/Boot/user/ota_ble.c	(revision 950)
+++ /YC3121_demo/ModuleDemo/updata_app/Boot/user/ota_ble.c	(working copy)
@@ -1,7 +1,8 @@
 #include "ota_ble.h"
 #include "yc_bt.h"
 #include "yc_qspi.h"
-
+#include "yc_systick.h"
+#include "app_ble_gatt.h"
 /* DEBUG LOG */
 //#define debug
 
@@ -59,12 +60,20 @@
 	BT_CONFIG &= (~(1<<BT_INIT_FLAG));
 }
 
+extern tick SystickCount;
+void SYSTICK_IRQHandler()
+{
+	SystickCount++;
+	if(SystickCount>=TICK_MAX_VALUE)	SystickCount=0;
+}
+
 void BleInit(void)
 {
     uint8_t bt_name[15] = "YC3121BT";
 	uint8_t bt_addr[6] =  {0x00,0x00,0x00,0x33,0x22,0x10};
 	uint8_t chip_id[6]={0};
     uint16_t temp_handle;
+	SysTick_Config(CPU_MHZ/100);
     BT_Init();
     enable_intr(INTR_BT);
 	read_chipid(chip_id);
@@ -96,29 +105,7 @@
 	else
 		MyPrintf("delete service failed\n");
 
-	temp_handle=BT_AddBleService(ble_service_uuid_lsps,sizeof(ble_service_uuid_lsps));
-	if( temp_handle!= 0)
-		MyPrintf("add service sucess,handle=%04x\n",temp_handle);
-	else
-		MyPrintf("add service failed,return=%04x\n",temp_handle);
-
-	ble_send_handle=BT_AddBleCharacteristic(ble_Characteristic_uuid_lsps_tx,sizeof(ble_Characteristic_uuid_lsps_tx));
-	if( ble_send_handle!= 0)
-		MyPrintf("add Characteristic tx sucess,handle=%04x\n",ble_send_handle);
-	else
-		MyPrintf("add Characteristic tx failed,return=%04x\n",ble_send_handle);
-
-	ble_receive_handle=BT_AddBleCharacteristic(ble_Characteristic_uuid_lsps_rx,sizeof(ble_Characteristic_uuid_lsps_rx));
-	if( ble_receive_handle!= 0)
-		MyPrintf("add Characteristic rx sucess;handle=%04x\n",ble_receive_handle);
-	else
-		MyPrintf("add Characteristic rx failed,return=%04x\n",ble_receive_handle);
-
-	temp_handle=BT_AddBleCharacteristic(ble_Characteristic_uuid_flow_ctrl,sizeof(ble_Characteristic_uuid_flow_ctrl));
-	if( temp_handle!= 0)
-		MyPrintf("add Characteristic flow_ctrl sucess;handle=%04x\n",temp_handle);
-	else
-		MyPrintf("add Characteristic flow_ctrl failed,return=%04x\n",temp_handle);
+	bleSetGattService();
 #if 0
 	if(BT_SetVisibility(0x01,0x01,0x01) == TRUE)
 #else
@@ -352,16 +339,17 @@
 	{
 		return;
 	}
+    
     BleDataLen -=2;//鍘婚櫎涓ゅ瓧鑺俬andle
-    if(bleData[0] == (ble_receive_handle&0xff) && bleData[1] == ((ble_receive_handle>>8)&0xff))
+    if(bleData[0] == (user_ble_ota_receive_handle&0xff) && bleData[1] == ((user_ble_ota_receive_handle>>8)&0xff))
     {
         if(waitSubPacket==FALSE)
 		{
 			otaHead=data[0];
 			otaOpcode=data[1];
 		}
-        Dataretpack.notifydata_1 = (ble_send_handle&0xff);
-        Dataretpack.notifydata_2 = ((ble_send_handle>>8)&0xff);
+        Dataretpack.notifydata_1 = (user_ble_ota_notify_handle&0xff);
+        Dataretpack.notifydata_2 = ((user_ble_ota_notify_handle>>8)&0xff);
         Dataretpack.Evt          = EVTRESPOND;
         Dataretpack.ResultCode   = RESULTTRUE;
         Dataretpack.RcvFlag      = otaOpcode;
