Index: fw/core/bt_code.c
===================================================================
--- /YC3121_SDK/fw/core/bt_code.c	(revision 641)
+++ /YC3121_SDK/fw/core/bt_code.c	(working copy)
@@ -1,126 +1,150 @@
 const unsigned char bt_code[] = {
-0x00,0x02,0xaa,0x55,0x3a,0x02,0xc2,0x84,0x00,0x05,0xc0,0x00,0x80,0x0d,0xc0,0x5c,
-0x00,0x13,0xc0,0x5d,0x80,0x2d,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x80,0x3c,0xc0,0x02,
-0x80,0x4c,0xc0,0x1d,0x00,0x55,0xc0,0x1f,0x00,0x5e,0xc0,0x20,0x80,0x70,0xc0,0x29,
-0x00,0x76,0xc0,0x4c,0x80,0x8a,0x20,0x20,0x4a,0x8b,0x20,0x40,0x68,0xc4,0x20,0x40,
+0x00,0x02,0xaa,0x55,0xb6,0x03,0xc2,0x84,0x00,0x05,0xc0,0x00,0x80,0x0d,0xc0,0x5c,
+0x00,0x13,0xc0,0x5d,0x80,0x40,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x80,0x9b,0xc0,0x02,
+0x80,0xab,0xc0,0x1d,0x00,0xb4,0xc0,0x1f,0x00,0xbd,0xc0,0x20,0x80,0xcf,0xc0,0x29,
+0x00,0xd5,0xc0,0x4c,0x80,0xe9,0x20,0x20,0x4a,0x8b,0x20,0x40,0x68,0xc4,0x20,0x40,
 0x60,0xd7,0x20,0x40,0x00,0x11,0x20,0x20,0x40,0x0a,0x20,0x75,0x80,0x00,0x20,0x20,
-0x7b,0x9a,0x58,0x00,0x00,0x1b,0x67,0xe4,0x41,0xf6,0x58,0x00,0x00,0x23,0x67,0xe4,
-0x41,0xfe,0x20,0x40,0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,
-0x50,0x4d,0x1a,0x62,0x7e,0x00,0xc0,0x04,0x80,0x21,0xc0,0x01,0x00,0x1f,0x20,0x20,
-0x4d,0xdf,0x70,0x4a,0xb1,0x00,0x20,0x20,0x4d,0xfb,0x70,0x4a,0xb1,0x06,0x20,0x20,
-0x4e,0x08,0x20,0x40,0x00,0x25,0x20,0x20,0x50,0xc3,0x6f,0xe2,0x4a,0xb1,0x20,0x7a,
-0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x4a,0xb1,0x24,0x7a,0x00,0x00,0x6f,0xe4,
-0x46,0x52,0xc2,0x80,0x4d,0x64,0x20,0x60,0x00,0x00,0x6f,0xe2,0x0a,0xff,0xc0,0x13,
-0x80,0x3a,0xc0,0x06,0x00,0x31,0x20,0x20,0x4e,0x5c,0x1a,0x22,0x06,0x00,0xef,0xe2,
-0x00,0x03,0xc0,0x00,0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,
-0x80,0x38,0x20,0x20,0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,0x20,0x40,
-0x50,0x1f,0x20,0x20,0x4d,0x85,0x20,0x40,0x49,0xba,0x78,0x23,0xfc,0x00,0x78,0x24,
-0xfc,0x00,0x09,0x80,0x00,0x08,0x19,0x89,0x7e,0x00,0x67,0xe2,0x02,0xd5,0x09,0x80,
-0x00,0x08,0x19,0x89,0x7e,0x00,0xe7,0xe2,0x00,0x05,0x1f,0xe1,0x72,0x3f,0x20,0x22,
-0xd8,0x8b,0x1f,0xe6,0x7c,0x33,0x24,0x41,0x00,0x4a,0x20,0x20,0x58,0x87,0xdf,0x20,
-0x00,0x33,0x20,0x60,0x00,0x00,0x20,0x40,0x58,0xa3,0x20,0x40,0x49,0x15,0x68,0x42,
-0x00,0x17,0x20,0x40,0x49,0x1c,0x20,0x00,0x05,0xdc,0x20,0x40,0x49,0x21,0x78,0x28,
-0x7c,0x00,0xd9,0x60,0x15,0x7c,0x20,0x20,0x58,0x69,0x6f,0xe2,0x00,0x7d,0xc0,0x08,
-0x00,0x58,0x20,0x20,0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,
-0x00,0x5c,0x20,0x20,0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x78,0x54,
-0x7c,0x00,0x20,0x40,0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,
-0x80,0x64,0x20,0x20,0x63,0xf2,0xc0,0x42,0x00,0x67,0xc0,0x41,0x80,0x6a,0x20,0x20,
-0x64,0x21,0x20,0x40,0x00,0x6d,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,
-0x00,0x6d,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0xef,0x6f,0xe2,0x46,0x2c,0x20,0x3a,
-0x65,0x0d,0x20,0x20,0x65,0x06,0x6f,0xe2,0x40,0x9e,0x79,0x3f,0xfe,0x03,0x67,0xe2,
-0x40,0x9e,0x58,0x00,0x00,0x01,0x67,0xe4,0x04,0xca,0x20,0x60,0x00,0x00,0x6f,0xe2,
-0x04,0xf9,0xc0,0x1f,0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,0x80,0x7c,0xc0,0x29,
-0xea,0x05,0x20,0x60,0x00,0x00,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,
-0x69,0x84,0x6f,0xe2,0x04,0xff,0xc0,0x20,0xe9,0x66,0xc0,0x20,0x69,0x6e,0xc0,0x38,
-0xe9,0xa7,0xc0,0x38,0x00,0x86,0xc0,0x24,0xe9,0xbe,0x20,0x20,0x6a,0x58,0x70,0x0a,
-0x95,0x08,0x20,0x40,0x7b,0xab,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xba,0x6f,0xe2,
-0x44,0x90,0x20,0x3a,0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x1b,0xd2,
-0xaa,0x55,0x01,0x00,0x92,0x40,0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,
-0x01,0x00,0x06,0x42,0x13,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xf8,0x8b,
-0x85,0x59,0x83,0xaa,0x55,0x03,0x00,0x14,0x42,0x07,0x4a,0x05,0xaa,0x55,0x04,0x00,
-0x3d,0x45,0x00,0x7f,0x00,0x07,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,0xaa,
-0x55,0x01,0x00,0x2c,0x46,0x01,0xaa,0x55,0x06,0x00,0x57,0x46,0x04,0x30,0x30,0x30,
-0x30,0x30,0xaa,0x55,0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,0x1c,
-0x00,0x4c,0xe0,0x4f,0x00,0x4c,0x00,0x4c,0xaa,0x55,0x02,0x00,0x68,0x46,0x00,0x02,
-0xaa,0x55,0x01,0x00,0x6c,0x46,0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,0xaa,0x55,
-0x03,0x00,0xaa,0x40,0x24,0x04,0x04,0xaa,0x55,0x01,0x00,0x79,0x46,0x00,0xaa,0x55,
-0x01,0x00,0x91,0x40,0x00,0xaa,0x55,0x03,0x00,0x54,0x41,0x00,0x01,0x08,0xaa,0x55,
-0x01,0x00,0x74,0x41,0x02,0xaa,0x55,0x01,0x00,0x93,0x40,0x00,0xaa,0x55,0x01,0x00,
-0x6d,0x46,0x28,0xaa,0x55,0x06,0x00,0xa0,0x40,0xa7,0x2a,0x2a,0x21,0x10,0x3a,0xaa,
-0x55,0x0c,0x00,0xe7,0x44,0x0b,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,
-0x74,0xaa,0x55,0x03,0x00,0xe4,0x41,0x20,0x00,0x01,0xaa,0x55,0x01,0x00,0xe8,0x41,
-0x00,0xaa,0x55,0x01,0x00,0x90,0x44,0x01,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,
-0x55,0x01,0x00,0x98,0x44,0x00,0xaa,0x55,0x04,0x00,0x75,0x46,0x2d,0x00,0x2f,0x00,
-0xaa,0x55,0x01,0x00,0x40,0x43,0x00,0xaa,0x55,0x02,0x00,0x54,0x44,0x40,0x00,0xaa,
-0x55,0x01,0x00,0x6e,0x46,0x05,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x22,0x01,0x33,
-0x02,0x3a,0xaa,0x55,0x0d,0x00,0x81,0x43,0x0c,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,
-0x75,0x20,0x42,0x6c,0x65,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x02,0xaa,
-0x55,0x16,0x00,0x61,0x43,0x0e,0x02,0x01,0x02,0x11,0x09,0x59,0x69,0x63,0x68,0x69,
-0x70,0x20,0x31,0x30,0x32,0x31,0x73,0x20,0x4d,0x6f,0x75,0xaa,0x55,0x07,0x00,0x25,
-0x44,0x02,0x03,0x00,0x05,0x10,0x02,0x03,0xaa,0x55,0x08,0x00,0x68,0x44,0x08,0x00,
-0x10,0x00,0x00,0x00,0x2c,0x01,0xaa,0x55,0x01,0x00,0x78,0x44,0xb9,0xaa,0x55,0x01,
-0x00,0x7a,0x44,0x17,0xaa,0x55,0x02,0x00,0xcc,0x44,0x31,0x00,0xaa,0x55,0x01,0x00,
-0xd1,0x40,0x01,0xaa,0x55,0x0c,0x00,0x49,0x45,0x05,0x03,0x00,0x12,0x00,0x01,0x01,
-0x00,0x01,0x11,0x03,0x00,0xaa,0x55,0x01,0x00,0x5f,0x45,0x00,0xaa,0x55,0x02,0x00,
-0x47,0x45,0x83,0x46,0xaa,0x55,0xb8,0x00,0x83,0x46,0x03,0x12,0x00,0x01,0x00,0x00,
-0x01,0x00,0x01,0x00,0x01,0x36,0x00,0x52,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x01,
-0x09,0x00,0x01,0x35,0x03,0x19,0x12,0x00,0x09,0x00,0x04,0x35,0x0d,0x35,0x06,0x19,
-0x01,0x00,0x09,0x00,0x01,0x35,0x03,0x19,0x00,0x01,0x09,0x00,0x09,0x35,0x08,0x35,
-0x06,0x19,0x12,0x00,0x09,0x01,0x00,0x09,0x02,0x00,0x09,0x01,0x03,0x09,0x02,0x01,
-0x09,0x05,0xac,0x09,0x02,0x02,0x09,0x02,0x39,0x09,0x02,0x03,0x09,0x06,0x44,0x09,
-0x02,0x04,0x28,0x01,0x09,0x02,0x05,0x09,0x00,0x02,0x03,0x11,0x01,0x00,0x03,0x01,
-0x00,0x00,0x01,0x00,0x03,0x36,0x00,0x46,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x03,
-0x09,0x00,0x01,0x35,0x03,0x19,0x11,0x01,0x09,0x00,0x02,0x0a,0x00,0x00,0x00,0x00,
-0x09,0x00,0x04,0x35,0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,
-0x01,0x09,0x00,0x06,0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,
-0x01,0x00,0x25,0x0a,0x53,0x50,0x50,0x20,0x73,0x6c,0x61,0x76,0x65,0x00,0x00,0x00,
-0x01,0x00,0xaa,0x55,0x02,0x00,0x8e,0x44,0xaf,0x47,0xaa,0x55,0x35,0x02,0xaf,0x47,
-0x01,0x00,0x02,0x00,0x28,0x02,0x00,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x02,0x03,
-0x00,0x02,0x01,0x2a,0x02,0xc8,0x00,0x04,0x00,0x02,0x03,0x28,0x01,0x0a,0x05,0x00,
-0x02,0x00,0x2a,0x14,0x41,0x73,0x74,0x20,0x4c,0x45,0x20,0x4d,0x6f,0x75,0x73,0x65,
-0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,
-0x00,0x02,0x04,0x2a,0x08,0x06,0x00,0x06,0x00,0x64,0x00,0x2c,0x01,0x08,0x00,0x02,
-0x03,0x28,0x01,0x02,0x09,0x00,0x02,0x02,0x2a,0x01,0x01,0x0a,0x00,0x02,0x03,0x28,
-0x01,0x08,0x0b,0x00,0x02,0x03,0x2a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,
-0x02,0x00,0x28,0x02,0x01,0x18,0x0d,0x00,0x02,0x03,0x28,0x01,0x20,0x0e,0x00,0x02,
-0x05,0x2a,0x00,0x0f,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x00,0x28,
-0x02,0x04,0x18,0x11,0x00,0x02,0x03,0x28,0x01,0x16,0x12,0x00,0x02,0x07,0x2a,0x01,
-0x00,0x13,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x14,0x00,0x02,0x00,0x28,0x02,0x0f,
-0x18,0x15,0x00,0x02,0x03,0x28,0x01,0x12,0x16,0x00,0x02,0x19,0x2a,0x01,0x38,0x17,
-0x00,0x02,0x00,0x28,0x02,0x0a,0x18,0x18,0x00,0x02,0x03,0x28,0x01,0x02,0x19,0x00,
-0x02,0x23,0x2a,0x03,0x00,0x00,0x00,0x1a,0x00,0x02,0x03,0x28,0x01,0x02,0x1b,0x00,
-0x02,0x29,0x2a,0x08,0x46,0x6c,0x61,0x67,0x74,0x72,0x69,0x70,0x1c,0x00,0x02,0x03,
-0x28,0x01,0x02,0x1d,0x00,0x02,0x24,0x2a,0x06,0x79,0x69,0x63,0x68,0x69,0x70,0x1e,
-0x00,0x02,0x03,0x28,0x01,0x02,0x1f,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,
-0x20,0x00,0x02,0x03,0x28,0x01,0x02,0x21,0x00,0x02,0x26,0x2a,0x03,0x31,0x2e,0x30,
-0x22,0x00,0x02,0x03,0x28,0x01,0x02,0x23,0x00,0x02,0x28,0x2a,0x03,0x31,0x2e,0x30,
-0x24,0x00,0x02,0x03,0x28,0x01,0x02,0x25,0x00,0x02,0x2a,0x2a,0x03,0x31,0x2e,0x30,
-0x26,0x00,0x02,0x03,0x28,0x01,0x02,0x27,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,
-0x33,0x28,0x00,0x02,0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,
-0x4a,0x7d,0xfe,0x43,0x53,0x53,0x49,0x29,0x00,0x02,0x03,0x28,0x01,0x12,0x2a,0x00,
-0x10,0x16,0x96,0x24,0x47,0xc6,0x23,0x61,0xba,0xd9,0x4b,0x4d,0x1e,0x43,0x53,0x53,
-0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x2b,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x2c,0x00,
-0x02,0x03,0x28,0x01,0x08,0x2d,0x00,0x10,0xb3,0x9b,0x72,0x34,0xbe,0xec,0xd4,0xa8,
-0xf4,0x43,0x41,0x88,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x00,0x02,
-0x03,0x28,0x01,0x04,0x2f,0x00,0x10,0xfe,0x69,0xca,0x9a,0x56,0x19,0xf6,0xab,0x02,
-0x4d,0xaa,0x6d,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x02,0x03,
-0x28,0x01,0x1a,0x31,0x00,0x10,0x18,0x03,0xa6,0x28,0x5e,0xd8,0xec,0x91,0x1c,0x48,
-0xa3,0xac,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x02,0x02,0x29,
-0x02,0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x00,0x40,0x02,0xaa,0x55,0x01,0x00,
-0x17,0x40,0x09,0xaa,0x55,0x01,0x00,0x20,0x40,0x28,0xaa,0x55,0x02,0x00,0x27,0x40,
-0x44,0x02,0xaa,0x55,0x01,0x00,0x2a,0x40,0x04,0xaa,0x55,0x01,0x00,0x33,0x40,0x02,
-0xaa,0x55,0x07,0x00,0x76,0x41,0x0f,0x84,0x30,0x0a,0x0b,0xb2,0x32,0xaa,0x55,0x02,
-0x00,0x57,0x41,0x8b,0x0b,0xaa,0x55,0x08,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0xaa,0x55,0x02,0x00,0xbd,0x40,0x02,0x24,0xaa,0x55,0x08,0x00,0xad,
-0x40,0x40,0x00,0x00,0x02,0x32,0x00,0x00,0x02,0xaa,0x55,0x02,0x00,0xbb,0x40,0x20,
-0x00,0xaa,0x55,0x04,0x00,0xb7,0x40,0x20,0x00,0x00,0x20,0xaa,0x55,0x04,0x00,0xbf,
-0x40,0x80,0x04,0x00,0x08,0xaa,0x55,0x05,0x00,0xe2,0x44,0x08,0x0e,0x05,0x04,0x00,
-0xaa,0x55,0x02,0x00,0x02,0x42,0x30,0x1f,0xaa,0x55,0x01,0x00,0x10,0x42,0x20,0xaa,
-0x55,0x01,0x00,0xe0,0x41,0x01,0xaa,0x55,0x0f,0x00,0xb2,0x4a,0x4b,0xba,0x55,0xd0,
-0x56,0xe0,0x57,0x88,0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,
-0x40,0xb2,0x4a,0x3a,0x7d
+0x7b,0x9a,0x58,0x00,0x00,0x1d,0x67,0xe4,0x41,0xf6,0x58,0x00,0x00,0x25,0x67,0xe4,
+0x41,0xfe,0x58,0x00,0x00,0x2f,0x67,0xe4,0x41,0xfa,0x20,0x40,0x4d,0xaf,0x20,0x40,
+0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,0x50,0x4d,0x1a,0x62,0x7e,0x00,0xc0,0x04,
+0x80,0x23,0xc0,0x01,0x00,0x21,0x20,0x20,0x4d,0xdf,0x70,0x4b,0x15,0x00,0x20,0x20,
+0x4d,0xfb,0x70,0x4b,0x15,0x06,0x20,0x20,0x4e,0x08,0x20,0x40,0x00,0x27,0x20,0x20,
+0x50,0xc3,0x6f,0xe2,0x4b,0x15,0x20,0x7a,0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,
+0x4b,0x15,0x24,0x7a,0x00,0x00,0x6f,0xe4,0x46,0x52,0xc2,0x80,0x4d,0x64,0x20,0x60,
+0x00,0x00,0x20,0x40,0x4f,0x11,0x20,0x74,0x00,0x00,0x1a,0x22,0x7e,0x00,0x67,0xe4,
+0x46,0x71,0x1a,0x42,0x7e,0x00,0x67,0xe2,0x46,0x70,0x68,0x44,0x04,0x74,0x60,0x44,
+0x46,0x73,0x20,0x40,0x5b,0x6c,0x24,0x3a,0x4a,0x8b,0x6f,0xe2,0x04,0x9e,0xc0,0x81,
+0x50,0x42,0xe8,0x44,0x00,0x06,0x58,0x00,0x29,0x02,0x98,0x46,0x7c,0x00,0x20,0x62,
+0x80,0x00,0x20,0x20,0x50,0x42,0x6f,0xe2,0x0a,0xff,0xc0,0x13,0x80,0x99,0xc0,0x06,
+0x00,0x48,0xc0,0x3b,0x00,0x51,0xc0,0x3b,0x80,0x57,0xc0,0x3c,0x00,0x5c,0xc0,0x0a,
+0x80,0x96,0x20,0x20,0x4e,0x5c,0x1a,0x22,0x06,0x00,0xef,0xe2,0x00,0x03,0xc0,0x00,
+0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,0x80,0x4f,0x20,0x20,
+0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,0xd8,0x40,0x00,0x28,0x20,0x40,
+0x5b,0x4d,0x18,0xc0,0x8b,0xfe,0x58,0x00,0x00,0x00,0xe7,0xe4,0x00,0x05,0x20,0x20,
+0x50,0x1f,0x20,0x40,0x00,0x60,0x20,0x40,0x00,0x7d,0x58,0x00,0x00,0x00,0xe7,0xe4,
+0x00,0x05,0x20,0x20,0x00,0x8f,0xef,0xe2,0x00,0x03,0x20,0x40,0x00,0x64,0x20,0x40,
+0x00,0x6b,0x20,0x20,0x00,0x8f,0x20,0x40,0x00,0x81,0x58,0x28,0x00,0x02,0xe7,0xe6,
+0x00,0x05,0x20,0x60,0x00,0x00,0x67,0xe2,0x0a,0x96,0x20,0x40,0x00,0x81,0x59,0x28,
+0x03,0x02,0xe7,0xe8,0x00,0x05,0x6f,0xe2,0x0a,0x96,0xe7,0xe6,0x00,0x05,0x20,0x60,
+0x00,0x00,0x20,0x40,0x00,0x81,0x20,0x40,0x00,0x7d,0x20,0x40,0x00,0x7d,0x58,0x00,
+0x00,0x00,0xe7,0xe4,0x00,0x05,0x18,0x40,0x85,0xff,0x20,0x40,0x5b,0x4d,0x18,0xc0,
+0x8c,0x04,0xef,0xe2,0x00,0x06,0xc2,0x82,0x00,0x78,0xc2,0x82,0x80,0x78,0x18,0x40,
+0x84,0x01,0x20,0x60,0x00,0x00,0x20,0x40,0x00,0x81,0x5a,0x29,0x02,0x02,0xe7,0xf0,
+0x00,0x05,0x18,0x40,0x85,0xff,0x20,0x60,0x00,0x00,0xef,0xe2,0x00,0x03,0x1f,0xe2,
+0x72,0x00,0xe7,0xe2,0x00,0x05,0x20,0x20,0x67,0xed,0x20,0x40,0x00,0x84,0xe0,0x44,
+0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe4,0x44,0x8e,0x98,0x00,0x0c,0x00,0xef,0xe4,
+0x00,0x06,0x20,0x7a,0x00,0x00,0x1f,0xe0,0x84,0x01,0xef,0xe2,0x00,0x06,0x98,0xc0,
+0x8c,0x00,0xef,0xe2,0x00,0x06,0x98,0xc0,0x8c,0x00,0x18,0xc2,0x0a,0x00,0x20,0x20,
+0x00,0x86,0x60,0x44,0x0a,0x9e,0x70,0x0a,0xff,0x29,0x58,0x00,0x00,0x02,0x20,0x40,
+0x50,0xa5,0x68,0x44,0x0a,0x9e,0xe0,0x44,0x00,0x0a,0x20,0x20,0x67,0xb9,0xef,0xe6,
+0x00,0x03,0x67,0xe6,0x40,0xaa,0x20,0x20,0x50,0x1f,0x20,0x40,0x50,0x1f,0x20,0x20,
+0x4d,0x85,0x20,0x40,0x49,0xba,0x78,0x23,0xfc,0x00,0x78,0x24,0xfc,0x00,0x09,0x80,
+0x00,0x08,0x19,0x89,0x7e,0x00,0x67,0xe2,0x02,0xd5,0x09,0x80,0x00,0x08,0x19,0x89,
+0x7e,0x00,0xe7,0xe2,0x00,0x05,0x1f,0xe1,0x72,0x3f,0x20,0x22,0xd8,0x8b,0x1f,0xe6,
+0x7c,0x33,0x24,0x41,0x00,0xa9,0x20,0x20,0x58,0x87,0xdf,0x20,0x00,0x33,0x20,0x60,
+0x00,0x00,0x20,0x40,0x58,0xa3,0x20,0x40,0x49,0x15,0x68,0x42,0x00,0x17,0x20,0x40,
+0x49,0x1c,0x20,0x00,0x05,0xdc,0x20,0x40,0x49,0x21,0x78,0x28,0x7c,0x00,0xd9,0x60,
+0x15,0x7c,0x20,0x20,0x58,0x69,0x6f,0xe2,0x00,0x7d,0xc0,0x08,0x00,0xb7,0x20,0x20,
+0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,0x00,0xbb,0x20,0x20,
+0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x78,0x54,0x7c,0x00,0x20,0x40,
+0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,0x80,0xc3,0x20,0x20,
+0x63,0xf2,0xc0,0x42,0x00,0xc6,0xc0,0x41,0x80,0xc9,0x20,0x20,0x64,0x21,0x20,0x40,
+0x00,0xcc,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,0x00,0xcc,0x6f,0xe2,
+0x00,0x48,0x20,0x20,0x64,0xef,0x6f,0xe2,0x46,0x2c,0x20,0x3a,0x65,0x0d,0x20,0x20,
+0x65,0x06,0x6f,0xe2,0x40,0x9e,0x79,0x3f,0xfe,0x03,0x67,0xe2,0x40,0x9e,0x58,0x00,
+0x00,0x01,0x67,0xe4,0x04,0xca,0x20,0x60,0x00,0x00,0x6f,0xe2,0x04,0xf9,0xc0,0x1f,
+0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,0x80,0xdb,0xc0,0x29,0xea,0x05,0x20,0x60,
+0x00,0x00,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x69,0x84,0x6f,0xe2,
+0x04,0xff,0xc0,0x20,0xe9,0x66,0xc0,0x20,0x69,0x6e,0xc0,0x38,0xe9,0xa7,0xc0,0x38,
+0x00,0xe5,0xc0,0x24,0xe9,0xbe,0x20,0x20,0x6a,0x58,0x70,0x0a,0x95,0x08,0x20,0x40,
+0x7b,0xab,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xba,0x6f,0xe2,0x44,0x90,0x20,0x3a,
+0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x0c,0x69,0xaa,0x55,0x01,0x00,
+0x92,0x40,0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,0x01,0x00,0x06,0x42,
+0x13,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xf8,0x8b,0x85,0x59,0x83,0xaa,
+0x55,0x03,0x00,0x14,0x42,0x6b,0x4a,0x05,0xaa,0x55,0x04,0x00,0x3d,0x45,0x00,0x7f,
+0x00,0x07,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,0xaa,0x55,0x01,0x00,0x2c,
+0x46,0x01,0xaa,0x55,0x06,0x00,0x57,0x46,0x04,0x30,0x30,0x30,0x30,0x30,0xaa,0x55,
+0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,0x1c,0x00,0x4c,0xe0,0x4f,
+0x00,0x4c,0x00,0x4c,0xaa,0x55,0x02,0x00,0x68,0x46,0x00,0x03,0xaa,0x55,0x01,0x00,
+0x6c,0x46,0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,0xaa,0x55,0x03,0x00,0xaa,0x40,
+0x24,0x04,0x04,0xaa,0x55,0x01,0x00,0x79,0x46,0x00,0xaa,0x55,0x01,0x00,0x91,0x40,
+0x00,0xaa,0x55,0x03,0x00,0x54,0x41,0x00,0x01,0x08,0xaa,0x55,0x01,0x00,0x74,0x41,
+0x02,0xaa,0x55,0x01,0x00,0x93,0x40,0x00,0xaa,0x55,0x01,0x00,0x6d,0x46,0x28,0xaa,
+0x55,0x06,0x00,0xa0,0x40,0xa7,0x2a,0x2a,0x21,0x10,0x3a,0xaa,0x55,0x0c,0x00,0xe7,
+0x44,0x0b,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,0x74,0xaa,0x55,0x03,
+0x00,0xe4,0x41,0x20,0x00,0x01,0xaa,0x55,0x01,0x00,0xe8,0x41,0x00,0xaa,0x55,0x01,
+0x00,0x90,0x44,0x01,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,0x55,0x01,0x00,0x98,
+0x44,0x00,0xaa,0x55,0x04,0x00,0x75,0x46,0x2d,0x00,0x2f,0x00,0xaa,0x55,0x01,0x00,
+0x40,0x43,0x00,0xaa,0x55,0x02,0x00,0x54,0x44,0x40,0x00,0xaa,0x55,0x01,0x00,0x6e,
+0x46,0x05,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x22,0x01,0x33,0x02,0x3a,0xaa,0x55,
+0x0d,0x00,0x81,0x43,0x0c,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,0x6c,
+0x65,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x02,0xaa,0x55,0x16,0x00,0x61,
+0x43,0x0e,0x02,0x01,0x02,0x11,0x09,0x59,0x69,0x63,0x68,0x69,0x70,0x20,0x31,0x30,
+0x32,0x31,0x73,0x20,0x4d,0x6f,0x75,0xaa,0x55,0x07,0x00,0x25,0x44,0x02,0x03,0x00,
+0x05,0x10,0x02,0x03,0xaa,0x55,0x08,0x00,0x68,0x44,0x08,0x00,0x10,0x00,0x00,0x00,
+0x2c,0x01,0xaa,0x55,0x01,0x00,0x78,0x44,0xb9,0xaa,0x55,0x01,0x00,0x7a,0x44,0x17,
+0xaa,0x55,0x02,0x00,0xcc,0x44,0x31,0x00,0xaa,0x55,0x01,0x00,0xd1,0x40,0x01,0xaa,
+0x55,0x0c,0x00,0x49,0x45,0x05,0x03,0x00,0x12,0x00,0x01,0x01,0x00,0x01,0x11,0x03,
+0x00,0xaa,0x55,0x01,0x00,0x5f,0x45,0x00,0xaa,0x55,0x02,0x00,0x47,0x45,0x83,0x46,
+0xaa,0x55,0xb8,0x00,0x83,0x46,0x03,0x12,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,
+0x01,0x36,0x00,0x52,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x01,0x09,0x00,0x01,0x35,
+0x03,0x19,0x12,0x00,0x09,0x00,0x04,0x35,0x0d,0x35,0x06,0x19,0x01,0x00,0x09,0x00,
+0x01,0x35,0x03,0x19,0x00,0x01,0x09,0x00,0x09,0x35,0x08,0x35,0x06,0x19,0x12,0x00,
+0x09,0x01,0x00,0x09,0x02,0x00,0x09,0x01,0x03,0x09,0x02,0x01,0x09,0x05,0xac,0x09,
+0x02,0x02,0x09,0x02,0x39,0x09,0x02,0x03,0x09,0x06,0x44,0x09,0x02,0x04,0x28,0x01,
+0x09,0x02,0x05,0x09,0x00,0x02,0x03,0x11,0x01,0x00,0x03,0x01,0x00,0x00,0x01,0x00,
+0x03,0x36,0x00,0x46,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x03,0x09,0x00,0x01,0x35,
+0x03,0x19,0x11,0x01,0x09,0x00,0x02,0x0a,0x00,0x00,0x00,0x00,0x09,0x00,0x04,0x35,
+0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,0x01,0x09,0x00,0x06,
+0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,0x01,0x00,0x25,0x0a,
+0x53,0x50,0x50,0x20,0x73,0x6c,0x61,0x76,0x65,0x00,0x00,0x00,0x01,0x00,0xaa,0x55,
+0x02,0x00,0x8e,0x44,0xaf,0x47,0xaa,0x55,0x35,0x02,0xaf,0x47,0x01,0x00,0x02,0x00,
+0x28,0x02,0x00,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x02,0x03,0x00,0x02,0x01,0x2a,
+0x02,0xc8,0x00,0x04,0x00,0x02,0x03,0x28,0x01,0x0a,0x05,0x00,0x02,0x00,0x2a,0x14,
+0x41,0x73,0x74,0x20,0x4c,0x45,0x20,0x4d,0x6f,0x75,0x73,0x65,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,0x00,0x02,0x04,0x2a,
+0x08,0x06,0x00,0x06,0x00,0x64,0x00,0x2c,0x01,0x08,0x00,0x02,0x03,0x28,0x01,0x02,
+0x09,0x00,0x02,0x02,0x2a,0x01,0x01,0x0a,0x00,0x02,0x03,0x28,0x01,0x08,0x0b,0x00,
+0x02,0x03,0x2a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x02,0x00,0x28,0x02,
+0x01,0x18,0x0d,0x00,0x02,0x03,0x28,0x01,0x20,0x0e,0x00,0x02,0x05,0x2a,0x00,0x0f,
+0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x00,0x28,0x02,0x04,0x18,0x11,
+0x00,0x02,0x03,0x28,0x01,0x16,0x12,0x00,0x02,0x07,0x2a,0x01,0x00,0x13,0x00,0x02,
+0x02,0x29,0x02,0x00,0x00,0x14,0x00,0x02,0x00,0x28,0x02,0x0f,0x18,0x15,0x00,0x02,
+0x03,0x28,0x01,0x12,0x16,0x00,0x02,0x19,0x2a,0x01,0x38,0x17,0x00,0x02,0x00,0x28,
+0x02,0x0a,0x18,0x18,0x00,0x02,0x03,0x28,0x01,0x02,0x19,0x00,0x02,0x23,0x2a,0x03,
+0x00,0x00,0x00,0x1a,0x00,0x02,0x03,0x28,0x01,0x02,0x1b,0x00,0x02,0x29,0x2a,0x08,
+0x46,0x6c,0x61,0x67,0x74,0x72,0x69,0x70,0x1c,0x00,0x02,0x03,0x28,0x01,0x02,0x1d,
+0x00,0x02,0x24,0x2a,0x06,0x79,0x69,0x63,0x68,0x69,0x70,0x1e,0x00,0x02,0x03,0x28,
+0x01,0x02,0x1f,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,0x20,0x00,0x02,0x03,
+0x28,0x01,0x02,0x21,0x00,0x02,0x26,0x2a,0x03,0x31,0x2e,0x30,0x22,0x00,0x02,0x03,
+0x28,0x01,0x02,0x23,0x00,0x02,0x28,0x2a,0x03,0x31,0x2e,0x30,0x24,0x00,0x02,0x03,
+0x28,0x01,0x02,0x25,0x00,0x02,0x2a,0x2a,0x03,0x31,0x2e,0x30,0x26,0x00,0x02,0x03,
+0x28,0x01,0x02,0x27,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,0x28,0x00,0x02,
+0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,0xfe,0x43,
+0x53,0x53,0x49,0x29,0x00,0x02,0x03,0x28,0x01,0x12,0x2a,0x00,0x10,0x16,0x96,0x24,
+0x47,0xc6,0x23,0x61,0xba,0xd9,0x4b,0x4d,0x1e,0x43,0x53,0x53,0x49,0x14,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x2b,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x2c,0x00,0x02,0x03,0x28,0x01,
+0x08,0x2d,0x00,0x10,0xb3,0x9b,0x72,0x34,0xbe,0xec,0xd4,0xa8,0xf4,0x43,0x41,0x88,
+0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x00,0x02,0x03,0x28,0x01,0x04,
+0x2f,0x00,0x10,0xfe,0x69,0xca,0x9a,0x56,0x19,0xf6,0xab,0x02,0x4d,0xaa,0x6d,0x43,
+0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x02,0x03,0x28,0x01,0x1a,0x31,
+0x00,0x10,0x18,0x03,0xa6,0x28,0x5e,0xd8,0xec,0x91,0x1c,0x48,0xa3,0xac,0x43,0x53,
+0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x00,
+0x00,0xaa,0x55,0x01,0x00,0x00,0x40,0x02,0xaa,0x55,0x01,0x00,0x17,0x40,0x09,0xaa,
+0x55,0x01,0x00,0x20,0x40,0x28,0xaa,0x55,0x02,0x00,0x27,0x40,0x44,0x02,0xaa,0x55,
+0x01,0x00,0x2a,0x40,0x04,0xaa,0x55,0x01,0x00,0x33,0x40,0x02,0xaa,0x55,0x07,0x00,
+0x76,0x41,0x0f,0x84,0x30,0x0a,0x0b,0xb2,0x32,0xaa,0x55,0x02,0x00,0x57,0x41,0x8b,
+0x0b,0xaa,0x55,0x08,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,
+0x55,0x02,0x00,0xbd,0x40,0x02,0x24,0xaa,0x55,0x08,0x00,0xad,0x40,0x40,0x00,0x00,
+0x02,0x32,0x00,0x00,0x02,0xaa,0x55,0x02,0x00,0xbb,0x40,0x20,0x00,0xaa,0x55,0x04,
+0x00,0xb7,0x40,0x20,0x00,0x00,0x20,0xaa,0x55,0x04,0x00,0xbf,0x40,0x80,0x04,0x00,
+0x08,0xaa,0x55,0x05,0x00,0xe2,0x44,0x08,0x0e,0x05,0x04,0x00,0xaa,0x55,0x02,0x00,
+0x02,0x42,0x30,0x1f,0xaa,0x55,0x01,0x00,0x10,0x42,0x20,0xaa,0x55,0x01,0x00,0xe0,
+0x41,0x01,0xaa,0x55,0x0f,0x00,0x16,0x4b,0x4b,0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,
+0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,0x16,0x4b,0x88,
+0x37
 };
Index: fw/sdk/yc_bt.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_bt.h	(revision 641)
+++ /YC3121_SDK/fw/sdk/yc_bt.h	(working copy)
@@ -19,101 +19,111 @@
 
 #define HCI_CMD		              0x01
 #define HCI_EVENT               0x02
-#define BLE_HANDLE              (uint16_t)0x002A
 #define MAX_BLUETOOTH_DATA_LEN	255
 
 
 
 /*BIT judge*/
-#define BIT_SET_BT_ADDR			0 
-#define BIT_SET_BLE_ADDR		1 
-#define BIT_SET_VISIBILITY		2 
-#define BIT_SET_BT_NAME			3 
-#define BIT_SET_BLE_NAME		4 
-#define BIT_SEND_SPP_DATA		5 
-#define BIT_SEND_BLE_DATA		6 
-#define BIT_STATUS_REQUEST		7 
-#define BIT_SET_PAIRING_MODE	8 
-#define BIT_SET_PINCODE			9
-#define BIT_GET_VERSION			10
-#define BIT_BT_DISCONNECT		11
-#define BIT_BLE_DISCONNECT		12
-#define BIT_SET_NVRAM			13
-#define BIT_ENTER_SLEEP_MODE 	15
-#define BIT_CONFIRM_GKEY		16
-#define BIT_POWER_SET			17
-#define BIT_GET_CREADIT_GIVEN	18
-#define BIT_PASSKEY_ENTRY		19
-#define BIT_LE_SET_PARING		20
-#define BIT_LE_SET_ADV_DATA		21
-#define BIT_LE_SET_SCAN_DATA	22
-#define BIT_LE_SEND_CONN_UPDATE 23
-#define BIT_LE_SET_ADV_PARM	24
-#define BIT_REJECT_JUSTWORK	25
-#define BIT_LE_SET_FIXED_PASSKEY 26
-#define BIT_SET_PSCAN_INTERVAL  27
-#define BIT_MODULE_READY 28
+#define BIT_SET_BT_ADDR                   0 
+#define BIT_SET_BLE_ADDR                  1 
+#define BIT_SET_VISIBILITY                2 
+#define BIT_SET_BT_NAME                   3 
+#define BIT_SET_BLE_NAME                  4 
+#define BIT_SEND_SPP_DATA                 5 
+#define BIT_SEND_BLE_DATA                 6 
+#define BIT_STATUS_REQUEST                7 
+#define BIT_SET_PAIRING_MODE              8 
+#define BIT_SET_PINCODE                   9
+#define BIT_GET_VERSION                   10
+#define BIT_BT_DISCONNECT                 11
+#define BIT_BLE_DISCONNECT                12
+#define BIT_SET_NVRAM                     13
+#define BIT_SET_TXPOWER                   14
+#define BIT_ENTER_SLEEP_MODE              15
+#define BIT_CONFIRM_GKEY                  16
+#define BIT_POWER_SET                     17
+#define BIT_GET_CREADIT_GIVEN             18
+#define BIT_PASSKEY_ENTRY                 19
+#define BIT_LE_SET_PARING                 20
+#define BIT_LE_SET_ADV_DATA               21
+#define BIT_LE_SET_SCAN_DATA              22
+#define BIT_LE_SEND_CONN_UPDATE           23
+#define BIT_LE_SET_ADV_PARM               24
+#define BIT_REJECT_JUSTWORK               25
+#define BIT_LE_SET_FIXED_PASSKEY          26
+#define BIT_SET_PSCAN_INTERVAL            27
+#define BIT_MODULE_READY                  28
+#define	BIT_SET_COD												29
+#define BIT_SET_CREDIT										30
+#define BIT_DELETE_SERVICE								31
+#define BIT_ADD_UUID											32
+
+
 /*CMD*/
-#define HCI_CMD_SET_BT_ADDR				 0x00
-#define HCI_CMD_SET_BLE_ADDR				 0x01 
-#define HCI_CMD_SET_VISIBILITY				 0x02
-#define HCI_CMD_SET_BT_NAME				 0x03 
-#define HCI_CMD_SET_BLE_NAME				 0x04 
-#define HCI_CMD_SEND_SPP_DATA				 0x05 
-#define HCI_CMD_SEND_BLE_DATA				 0x09 
-#define HCI_CMD_STATUS_REQUEST			 0x0B 
-#define HCI_CMD_SET_PAIRING_MODE			 0x0C 
-#define HCI_CMD_SET_PINCODE				0x0D 
-#define HCI_CMD_VERSION_REQUEST			0x10 
-#define HCI_CMD_BT_DISCONNECT				0x11 
-#define HCI_CMD_BLE_DISCONNECT			0x12 
-#define HCI_CMD_SET_NVRAM					0x26 
-#define HCI_CMD_ENTER_SLEEP_MODE			0x27
-#define HCI_CMD_CONFIRM_GKEY				0x28 
-#define HCI_CMD_GET_CREADIT_GIVEN   0x29
-#define HCI_CMD_PASSKEY_ENTRY				0x30
-#define HCI_CMD_LE_SET_PAIRING      0x33
-#define HCI_CMD_LE_SET_ADV_DATA 		0x34
-#define HCI_CMD_LE_SET_SCAN_DATA		0x35
-#define HCI_CMD_LE_SEND_CONN_UPDATE_REQ 0x36
-#define HCI_CMD_LE_SET_ADV_PARM			0x37
-#define HCI_CMD_SET_TX_POWER				0x42
-#define HCI_CMD_REJECT_JUSTWORK			0x49
-#define HCI_CMD_LE_SET_FIXED_PASSKEY		0x61
+#define HCI_CMD_SET_BT_ADDR               0x00
+#define HCI_CMD_SET_BLE_ADDR              0x01 
+#define HCI_CMD_SET_VISIBILITY            0x02
+#define HCI_CMD_SET_BT_NAME               0x03 
+#define HCI_CMD_SET_BLE_NAME              0x04 
+#define HCI_CMD_SEND_SPP_DATA             0x05 
+#define HCI_CMD_SEND_BLE_DATA             0x09 
+#define HCI_CMD_STATUS_REQUEST            0x0B 
+#define HCI_CMD_SET_PAIRING_MODE          0x0C 
+#define HCI_CMD_SET_PINCODE               0x0D 
+#define HCI_CMD_VERSION_REQUEST           0x10 
+#define HCI_CMD_BT_DISCONNECT             0x11 
+#define HCI_CMD_BLE_DISCONNECT            0x12 
+#define HCI_CMD_SET_NVRAM                 0x26 
+#define HCI_CMD_ENTER_SLEEP_MODE          0x27
+#define HCI_CMD_CONFIRM_GKEY              0x28 
+#define HCI_CMD_GET_CREADIT_GIVEN         0x29
+#define HCI_CMD_PASSKEY_ENTRY             0x30
+#define HCI_CMD_LE_SET_PAIRING            0x33
+#define HCI_CMD_LE_SET_ADV_DATA           0x34
+#define HCI_CMD_LE_SET_SCAN_DATA          0x35
+#define HCI_CMD_LE_SEND_CONN_UPDATE_REQ   0x36
+#define HCI_CMD_LE_SET_ADV_PARM           0x37
+#define HCI_CMD_SET_TX_POWER              0x42
+#define HCI_CMD_REJECT_JUSTWORK           0x49
+#define HCI_CMD_LE_SET_FIXED_PASSKEY      0x61
+#define	HCI_CMD_DELETE_CUSTOMIZE_SERVICE	0x76
+#define	HCI_CMD_ADD_SERVICE_UUID					0x77
+#define	HCI_CMD_ADD_CHARACTERISTIC_UUID		0x78
+#define	HCI_CMD_SET_COD										0x15
 
 
 /*EVENT*/
-#define HCI_EVENT_BT_CONNECTED 		 0x00	/**BT3.0 ���ӽ���*/
-#define HCI_EVENT_BLE_CONNECTED 		 0x02	/**BLE ���ӽ���*/////
-#define HCI_EVENT_BT_DISCONNECTED		 0x03	/**BT3.0 ���ӶϿ�*/
-#define HCI_EVENT_BLE_DISCONNECTED 	 0x05	/**BLE ���ӶϿ�*//////
-#define HCI_EVENT_CMD_COMPLETE 		 0x06	/**���������*/////
-#define HCI_EVENT_SPP_DATA_RECEIVED 	 0x07	/**���յ� BT3.0 ���ݣ�SPP��*/
-#define HCI_EVENT_BLE_DATA_RECEIVED 	 0x08	/**���յ� BLE ����*///////
-#define HCI_EVENT_I_AM_READY 			 0x09	/**ģ��׼����*///////
-#define HCI_EVENT_STAUS_RESPONSE 		 0x0A	/**״̬�ظ�*/
-#define HCI_EVENT_NVRAM_CHANGED 		 0x0D	/**�ϴ� NVRAM ����*/
-#define HCI_EVENT_UART_EXCEPTION 		 0x0F	/**HCI ����ʽ����*/
-#define HCI_EVENT_GKEY 					 0x0E	/**���� Numeric Comparison ��Է�ʽ�в�������ԿMCU�յ����¼����跢��HCI_CMD_CONFIRM_GKEYָ��ظ�����ģ��*/
-#define HCI_EVENT_GET_PASSKEY 			 0x10	/**PASSKEY ��Է�ʽ��֪ͨMCU ������Կ,MCU�յ����¼����跢��HCI_CMD_PASSKEY_ENTRYָ��ظ�����ģ��*/
-#define HCI_EVENT_PAIRING_COMPLETED 	 0x11	/**�����ɵ��¼���֪ͨ MCU������*/
-
+#define HCI_EVENT_BT_CONNECTED            0x00
+#define HCI_EVENT_BLE_CONNECTED           0x02
+#define HCI_EVENT_BT_DISCONNECTED         0x03
+#define HCI_EVENT_BLE_DISCONNECTED        0x05
+#define HCI_EVENT_CMD_COMPLETE            0x06
+#define HCI_EVENT_SPP_DATA_RECEIVED       0x07
+#define HCI_EVENT_BLE_DATA_RECEIVED       0x08
+#define HCI_EVENT_I_AM_READY              0x09
+#define HCI_EVENT_STAUS_RESPONSE          0x0A
+#define HCI_EVENT_NVRAM_CHANGED           0x0D
+#define HCI_EVENT_GKEY                    0x0E
+#define HCI_EVENT_UART_EXCEPTION          0x0F  /*cmd format error*/
+#define HCI_EVENT_GET_PASSKEY             0x10
+#define HCI_EVENT_PAIRING_COMPLETED       0x11
+#define	HCI_EVENT_UUID_HANDLE							0x29
 
 /** 
   * @brief  event code enum definition  
   */ 
 typedef enum
 {
-	BT_CONNECTED= HCI_EVENT_BT_CONNECTED,
-	BLE_CONNECTED= HCI_EVENT_BLE_CONNECTED,
-	BT_DISCONNECTED= HCI_EVENT_BT_DISCONNECTED,
-	BLE_DISCONNECTED= HCI_EVENT_BLE_DISCONNECTED,
-	BT_DATA=HCI_EVENT_SPP_DATA_RECEIVED,
-	BLE_DATA=HCI_EVENT_BLE_DATA_RECEIVED,
-	NVRAM_DATA=HCI_EVENT_NVRAM_CHANGED,
-	CONFIRM_GKEY=HCI_EVENT_GKEY,
-	PASSKEY=HCI_EVENT_GET_PASSKEY,
-	PAIRING_COMPLETED=HCI_EVENT_PAIRING_COMPLETED
+	BT_CONNECTED        = HCI_EVENT_BT_CONNECTED,
+	BLE_CONNECTED       = HCI_EVENT_BLE_CONNECTED,
+	BT_DISCONNECTED     = HCI_EVENT_BT_DISCONNECTED,
+	BLE_DISCONNECTED    = HCI_EVENT_BLE_DISCONNECTED,
+	BT_DATA             =HCI_EVENT_SPP_DATA_RECEIVED,
+	BLE_DATA            =HCI_EVENT_BLE_DATA_RECEIVED,
+	NVRAM_DATA          =HCI_EVENT_NVRAM_CHANGED,
+	CONFIRM_GKEY        =HCI_EVENT_GKEY,
+	PASSKEY             =HCI_EVENT_GET_PASSKEY,
+	PAIRING_COMPLETED   =HCI_EVENT_PAIRING_COMPLETED
 }BT_EventCodeEnum;
 
 
@@ -129,17 +139,17 @@
 /**
   * @brief   Set the address of the bluetooth 3.0 device
   * @param  bt_addr: pointer to  address information.
-  * @retval	    TRUE:set addr success.
-  *		    FALSE:set addr failed
+  * @retval TRUE:set addr success.
+  *         FALSE:set addr failed
   */
 Boolean BT_SetBtAddr(uint8_t * bt_addr);
 
 
 /**
-  * @brief   Set the address of the bluetooth 4.0 device
+  * @brief  Set the address of the bluetooth 4.0 device
   * @param  bt_addr: pointer to  address information.
-  * @retval	    TRUE:set addr success.
-  *		    FALSE:set addr failed
+  * @retval TRUE:set addr success.
+  *         FALSE:set addr failed
   */
 Boolean BT_SetBleAddr(uint8_t * bt_addr);
 
@@ -147,9 +157,9 @@
 /**
   * @brief   Set the name of the bluetooth 3.0 device
   * @param  bt_addr: pointer to  address information.
-  *		    name_len: name length.
-  * @retval	    TRUE:set name success.
-  *		    FALSE:set name failed
+  *         name_len: name length,not include '\0'
+  * @retval TRUE:set name success.
+  *         FALSE:set name failed
   */
 Boolean BT_SetBtName(uint8_t * bt_name, uint16_t name_len);
 
@@ -157,65 +167,65 @@
 /**
   * @brief   Set the name of the bluetooth 4.0 device
   * @param  ble_name: pointer to  name information.
-  *        	    name_len: name length.
-  * @retval	    TRUE:set name success.
-  *		    FALSE:set name failed
+  *         name_len: name length,not include '\0'
+  * @retval TRUE:set name success.
+  *         FALSE:set name failed
   */
 Boolean BT_SetBleName(uint8_t* ble_name, uint16_t name_len);
 
 
 /**
-  * @brief	    Set visibility mode.
-  * @param  bt_discoverable: equal to 0 ,bt_discoverable OFF;equal to 1,bt_discoverable ON.
-  *        	    bt_connectability: equal to 0 ,bt_connectability OFF;equal to 1,bt_connectability ON.
-  *                  ble_discoverable: equal to 0 ,ble_discoverable OFF;equal to 1,ble_discoverable ON.
-  * @retval	    TRUE:set visibility success.
-  *		    FALSE:set visibility failed
+  * @brief  Set visibility mode.
+  * @param  bt_discoverable: 0--bt_discoverable OFF;1--bt_discoverable ON.
+  *         bt_connectability:0--bt_connectability OFF;1--bt_connectability ON.
+  *         ble_discoverable:0--ble_discoverable OFF;1--ble_discoverable ON.
+  * @retval TRUE:set visibility success.
+  *         FALSE:set visibility failed
   */
 Boolean BT_SetVisibility(Boolean bt_discoverable, Boolean bt_connectability, Boolean ble_discoverable);
 
 
 /**
-  * @brief   Bt send spp data
+  * @brief  Bt send spp(bt3.0) data
   * @param  bt_addr: pointer to  spp data 
-  *        	    DataLen: spp data length.
-  * @retval	    TRUE:send spp data success.
-  *		    FALSE:send spp data failed
+  *         DataLen: spp data length.
+  * @retval TRUE:send spp data success.
+  *         FALSE:send spp data failed
   */
 Boolean BT_SendSppData(uint8_t * spp_data, uint16_t len);
 
 
 /**
-  * @brief    Send ble data
-  * @param  bt_addr: pointer to  spp data ,it includes two bytes handle.
-  *        	    DataLen: data length.
-  * @retval	    TRUE:send ble data success.
-  *		    FALSE:send ble data failed
+  * @brief  Send ble data
+  * @param  bt_addr: pointer to  spp data ,includes two bytes handle(byte0-byte1 is ble handle).
+  *         DataLen: data length.
+  * @retval TRUE:send ble data success.
+  *         FALSE:send ble data failed
   */
   Boolean BT_SendBleData(uint8_t * ble_data, uint16_t len);
 
 
 /**
-  * @brief	 get bluetooth connect status
+  * @brief  get bluetooth connect status
   * @param  None
-  * @retval	    bit0:BT 3.0 Can be discover
-  *		    bit1:BT 3.0 Can be connected
-  *		    bit2:BT 4.0 Can be discover and connected
-  *		    bit4:BT 3.0 connected
-  *		    bit5:BT 4.0 connected
-  *		    bit7:timer out
+  * @retval bit0:BT 3.0 Can be discover
+  *         bit1:BT 3.0 Can be connected
+  *         bit2:BT 4.0 Can be discover and connected
+  *         bit4:BT 3.0 connected
+  *         bit5:BT 4.0 connected
+  *         bit7:get status timer out
   */
 uint8_t Bt_GetBtStatus(void);
 
 
 
 /**
-  * @brief	 set classic bluetooth paring mode
+  * @brief  set classic bluetooth paring mode
   * @param  mode:the paramater can be one of the following value
-  				0x00:pincode
-  				0x01:just work
-  				0x02:passkey
-  				0x03:confirm
+                0x00:pincode
+                0x01:just work
+                0x02:passkey
+                0x03:confirm
   * @retval	   ture or FALSE
   */
   Boolean BT_SetParingMode(uint8_t mode);
@@ -223,9 +233,9 @@
 
 
 /**
-  * @brief	 set classic bluetooth paring PIN code
+  * @brief  set classic bluetooth paring PIN code
   * @param  Pincode:the pointer ponint to pincode data
-  		    Datalen: normally the value can be 0x01~0x10,
+            Datalen: normally the value can be 0x01~0x10,
   * @retval	   ture or FALSE
   */
 Boolean BT_SetPincode(uint8_t* Pincode,uint8_t len);
@@ -233,35 +243,35 @@
 
 
 /**
-  * @brief	  get the bluetooth module firmware version number
-  * @param  
-  * @retval	    firmware version number(the value is 1~65535)
+  * @brief  get the bluetooth module firmware version number
+  * @param  none
+  * @retval firmware version number(the value is 1~65535)
   *                  
   */
 uint32_t BT_GetVersion(void);
 
 
 /**
-  * @brief	  Set bt disconnect
-  * @param  
-  * @retval	    TRUE:bt disconnected success.
-  *		    FALSE:bt disconnected failed
+  * @brief  Set bt disconnect
+  * @param  none
+  * @retval TRUE:bt disconnected success.
+  *         FALSE:bt disconnected failed
   */
 Boolean BT_BtDisconnect(void);
 
 /**
-  * @brief	  Set NVRAM
-  * @param  NvData:the pointer point to NVRAMData,data length is 0x78 normally.
-  * @retval	    TRUE:bt disconnected success.
-  *		    FALSE:bt disconnected failed
+  * @brief  Set NVRAM
+  * @param  NvData:the pointer point to NVRAMData,data length is 0xaa.
+  * @retval TRUE:bt disconnected success.
+  *         FALSE:bt disconnected failed
   */
 Boolean BT_SetNVRAM(uint8_t * NvData);
 
 
 /**
-  * @brief	    Bt Enter Sleep mode
+  * @brief  Bt Enter Sleep mode
   * @param  none
-  * @retval	    TRUE:enter sleep mode success
+  * @retval TRUE:enter sleep mode success
   *
   */
 Boolean BT_EnterSleepMode(void);
@@ -269,78 +279,97 @@
 
 
 /**
-  * @brief	    Numeric Comparison key matching in paring mode
+  * @brief  Numeric Comparison key matching in paring mode
   * @param  mismatching:the paramater can be the follwing value
-  				0x00: key match 0x01 key mismatch
-  * @retval	    TRUE:set ConfirmGkey success
-  *		    FALSE:set ConfirmGkey failed
+                        0x00: key match
+                        0x01: key mismatch
+  * @retval TRUE:set ConfirmGkey success
+  *         FALSE:set ConfirmGkey failed
  */
-Boolean BT_ConfirmGkey(uint8_t mismatching);
+Boolean BT_ConfirmGkey(uint8_t isMatching);
 
 
-Boolean BT_GetCreadIT_GIVEN(uint8_t given);
+/**
+  * @brief  set spp flow control
+  * @param  packetNum:the flow control packet number
+  * @retval TRUE:success
+  *         FALSE:failed
+ */
+Boolean BT_SetSppFlowcontrol(uint8_t packetNum);
 
 
 /**
-  * @brief	   Comparison of keys in  PASSKEY paring 
-  * @param  key_data: the poninter point to key data,the length is 4 bytes,(data in hexadecimal form, 
-  *                  starting with high bytes;for example ,218372(10) = 0x35504 ->key_data[]={0x00,0x03,0x55,0x04})
-  * @retval	    TRUE:set passkey success
-  *		    FALSE:set passkey  failed
+  * @brief  Comparison of keys in  PASSKEY paring 
+  * @param  key_data: point to key data,length is 4 bytes,(data in hexadecimal form, 
+  *                   starting with high bytes;for example ,218372(10) = 0x35504 ->key_data[]={0x00,0x03,0x55,0x04})
+  * @retval TRUE:set passkey success
+  *         FALSE:set passkey  failed
   */
 Boolean BT_PasskeyEntry(uint8_t *key_data);
 
 /**
-  * @brief	  Set ble paring mode
-  * @param  mode: the poninter point to key data,the length is 4 bytes,(data in hexadecimal form, 
-  * @retval	    TRUE:set ble paring success
-  *		    FALSE:set ble paring  failed
+  * @brief  Set ble paring mode
+  * @param  mode: the paramater can be the follwing value
+  *               0x00:none
+  *               0x01:just work
+  *               0x02:pass key
+  *               0x81:secure connect just work
+  *               0x82:secure connect numeric
+  *               0x00:secure connect pass key
+  * @retval TRUE:set ble paring success
+  *         FALSE:set ble paring  failed
   */
 Boolean BT_SetLEParing(uint8_t mode);
 
 /**
   * @brief    Send ble adv data
   * @param    adv_data: pointer to adv data.
-	*  					DataLen: data length
+	*  					DataLen: data length(must be 0x1f)
   * @retval	  TRUE:set ble adv  data success.
-  *		    FALSE:set ble adv data failed
+  *           FALSE:set ble adv data failed
   */
 Boolean BT_SetLEAdvData(uint8_t*  adv_data, int DataLen);
 
 
 /**
-  * @brief  Send ble scan data
+  * @brief  set ble scan data
   * @param  scan_data: pointer to  scan data.
-  *        	    DataLen: data length.
-  * @retval	    TRUE:set ble scan  data success.
-  *		    FALSE:set ble scan data failed
+  *         DataLen: data length(length < 0x20)
+  * @retval TRUE:set ble scan  data success.
+  *         FALSE:set ble scan data failed
   */
 Boolean BT_SetLEScanData(uint8_t* scan_data, int DataLen);
 
 /**
-  * @brief  Send ble scan data
-  * @param  data: pointer to  scan data.
-  *        	    DataLen: data length.
-  * @retval	    TRUE:set ble scan  data success.
-  *		    FALSE:set ble scan data failed
+  * @brief  ble send update ble connect parameter data
+  * @param  data:
+  *             byte0-byte1:min connect interval
+  *             byte2-byte3:max connect interval
+  *             byte4-byte5:Slave  latency
+  *             byte6-byte7:Connection Supervision Timeout
+  *         len:len must be 8
+  * @retval TRUE:success.
+  *         FALSE:failed
   */
 Boolean BT_SetLESendConnUpdate(uint8_t *data,int len);
 
 
 /**
   * @brief  Set ble adv parm
-  * @param  data: pointer to  scan data.
-  *        	    DataLen: data length.
-  * @retval	    TRUE:set ble adv parm success.
-  *		    FALSE:set ble adv parm failed
+  * @param  data: pointer to  adv parmdata.
+  *         DataLen: data length(len must be 2)
+  * @retval TRUE:set ble adv parm success.
+  *         FALSE:set ble adv parm failed
   */
 Boolean BT_SetLEAdvParm(uint8_t*data,int DataLen);
 
 /**
   * @brief  Set reject just work
   * @param  justwork:
-  * @retval	    TRUE:set ble scan  data success.
-  *		    FALSE:set ble scan data failed
+  *                 0:turn off reject just work
+  *                 1:turn on reject just work
+  * @retval TRUE:set ble scan  data success.
+  *         FALSE:set ble scan data failed
   */
 Boolean BT_RejectJustWork(uint8_t justwork);
 
@@ -348,28 +377,93 @@
 /**
   * @brief  Set fixed passkey
   * @param  key: pointer to key data ,key length is 5 bytes
-  * @retval	    TRUE:set fixed passkey  success.
-  *		    FALSE:set ble fixed passkey failed
+  * @retval TRUE:set fixed passkey  success.
+  *         FALSE:set ble fixed passkey failed
   */
 Boolean BT_Set_FixedPasskey(uint8_t* key);
 
 
 /**
-  * @brief	  Set ble disconnect
-  * @param none 
-  * @retval	    TRUE:ble disconnected success.
-  *		    FALSE:ble disconnected failed
+  * @brief  Set ble disconnect
+  * @param  none 
+  * @retval TRUE:ble disconnected success.
+  *         FALSE:ble disconnected failed
   */
 Boolean BT_BleDisconnect(void);
 
 
+/**
+  * @brief  Set spp(bt3.0) class of device 
+  * @param  bt_cod:cod buf(must be 3 byte) 
+  * @retval TRUE:success.
+  *         FALSE:failed
+  */
+Boolean BT_SetCOD(uint8_t* bt_cod);
+
+
+
+
+/**
+  * @brief  Set RF tx power
+  * @param  power: 0:0db
+  *                1:3db
+  *                2:5db
+  *                3:-3db
+  *                4:-5db
+  * @retval TRUE:set fixed passkey  success.
+  *         FALSE:set ble fixed passkey failed
+  */
 Boolean BT_SetTxPower(uint8_t power);
 
+
+/**
+  * @brief  Delete ble custom Service
+  * @param  none
+  * @retval TRUE:success.
+  *         FALSE:failed
+  */
+Boolean BT_DeleteService(void);
+
+
+/**
+  * @brief  add ble custom Service
+  * @param  ble_service_uuid:
+	*														byte0 uuid length(2 or 16)
+	*														byte1-2(16): uuid
+	*					service_uuid_len: sizeof(ble_service_uuid)
+  * @retval TRUE:success.
+  *         FALSE:failed
+  */
+uint16_t BT_AddBleService(uint8_t* ble_service_uuid, uint16_t service_uuid_len);
+
+
 /**
-  * @brief   Read the received bluetooth data from receive buffer
+  * @brief  add ble custom Characteristic
+  * @param  ble_Characteristic_uuid:
+	*														byte0: characterisitic attribute
+	*																	bit0		Broadcast
+	*																	bit1		Read
+	*																	bit2		Write without Response
+	*																	bit3		Write
+	*																	bit4		Notify
+	*																	bit5		Indicate
+	*																	bit6		Authentication Signed Write
+	*																	bit7		Extended Properties
+	*														byte1:			characterisitic uuid length(2 or 16)
+	*														byte2-3(17):characterisitic uuid 
+	*														byte4(18):	write/read payload length(1--20;default:1)
+	*														byte5(19)-x:write/read payload(default:00)
+	*					service_Characteristic_payload_len: sizeof(ble_Characteristic_uuid)
+  * @retval TRUE:success.
+  *         FALSE:failed
+  */
+uint16_t BT_AddBleCharacteristic(uint8_t* ble_Characteristic_uuid, uint16_t service_Characteristic_payload_len);
+
+/**
+  * @brief  Read the received bluetooth data from receive buffer
   * @param  pbuf:the output buffer,255 bytes is enough
   *
-  * @retval	    The data length of the readed,0 is fail
+  * @retval The data length of the readed,0 is fail
   */
 int BT_ReadBTData(uint8_t* pbuf);
 
@@ -379,17 +473,17 @@
   *
   * @param  none
   *
-  * @retval	   -1		:no data
-  *		   other	:event opcode
+  * @retval -1		:no data
+  *         other	:event opcode
   */
 int BT_GetEventOpcode(void);
 
-//modify 
+
 /**
-  * @brief   parse bluetooth module data packet according to yichip HCI protocol from BT_UART,you shoud call it at BT_UART IRQHandler function
-  * @param  UARTx: UART0 or UART1
+  * @brief   parse bluetooth module data packet according to yichip HCI protocol from ipc buf,you shoud call it at BT_UART IRQHandler function
+  * @param  Unone
   *
-  * @retval	    none
+  * @retval none
   */
 void BT_ParseBTData(void);
 
@@ -401,15 +495,16 @@
   *
   * @param  none
   *
-  * @retval	    none
+  * @retval none
   */
 void BT_Progress(void);
 
 
 /**
-  * @brief   BT Init
+  * @brief  BT Init
   * @param  none
-  * @retval	    none
+  * @retval TRUE:success
+  *         FALSE:fail
   */
 Boolean BT_Init(void);
 #endif 
Index: fw/sdk/yc_bt.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_bt.c	(revision 641)
+++ /YC3121_SDK/fw/sdk/yc_bt.c	(working copy)
@@ -3,7 +3,7 @@
 #include "yc_timer.h"
 #include "yc_ipc.h"
 static tick StartTick;
-static uint32_t HCI_CMD_BIT_FLAG=0;
+static uint32_t HCI_CMD_BIT_FLAG[2]={0};
 #define BTTIMEOUT 500
 #define BT_BUFSIZE 1024
 uint8_t rcvbuf[BT_BUFSIZE]={0};
@@ -18,6 +18,42 @@
 
 HCI_TypeDef hci_bt;
 
+void BT_BIT_SET(uint32_t* a,int b)
+{
+	if(b<32)
+	{
+		a[0] |= (1<<b);
+	}
+	else
+	{
+		a[1] |= (1<<(b-32));
+	}
+}
+
+void BT_BIT_CLEAR(uint32_t* a,int b)
+{
+	if(b<32)
+	{
+		a[0] &= ~(1<<b);
+	}
+	else
+	{
+		a[1] &= ~(1<<(b-32));
+	}
+}
+
+Boolean BT_BIT_GET(uint32_t* a,int b)
+{
+	if(b<32)
+	{
+		return (Boolean)((a[0]&(1<<b))>>b);
+	}
+	else
+	{
+		return (Boolean)((a[1]&(1<<(b-32)))>>(b-32));
+	}
+}
+
 static void SkipData(int Num)
 {
 	BluetoothBuf.ReadIndex+=Num;
@@ -63,7 +99,8 @@
 	BluetoothBuf.count = 0;
 	BluetoothBuf.ReadIndex = 0;
 	BluetoothBuf.WriteIndex =0;
-	HCI_CMD_BIT_FLAG=0;//全局变量问题优化
+	HCI_CMD_BIT_FLAG[0]=0;//全局变量问题优化
+	HCI_CMD_BIT_FLAG[1]=0;
 	StartTick=0;
 	PacketNum=0;
 	int i;
@@ -92,7 +129,9 @@
 {
 	if((msg->DataLen+3) > IPC_get_available_size())
 	{
+		#if BT_LOG
 		MyPrintf("IPC BT Tx FULL\n");
+		#endif
 		return FALSE;
 	}
 	msg->type=HCI_CMD;
@@ -109,12 +148,12 @@
 	msg.opcode = HCI_CMD_SET_BT_ADDR;
 	msg.DataLen = 6;
 	msg.p_data = bt_addr;
-  HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_BT_ADDR);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BT_ADDR);
   SendCMD(&msg);
   StartTick=SysTick_GetTick();
   do
   {
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_BT_ADDR))
+		if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_BT_ADDR))
 		{
 				return TRUE;
 		}
@@ -129,12 +168,12 @@
     msg.opcode = HCI_CMD_SET_BLE_ADDR;
     msg.DataLen = 6;
 		msg.p_data = bt_addr;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_BLE_ADDR);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BLE_ADDR);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
     do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_BLE_ADDR))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_ADDR))
     	{
     		return TRUE;
     	}
@@ -156,12 +195,12 @@
     msg.opcode = HCI_CMD_SET_VISIBILITY;
     msg.DataLen = 0x01;
 	msg.p_data = &visibility_data;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_VISIBILITY);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_VISIBILITY);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_VISIBILITY))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_VISIBILITY))
     	{
     		return TRUE;
     	}
@@ -175,12 +214,12 @@
 	msg.opcode = HCI_CMD_SET_BT_NAME;
 	msg.DataLen = name_len;
 	msg.p_data  = bt_name;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_BT_NAME);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BT_NAME);
 	SendCMD(&msg);
 	StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_BT_NAME))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_BT_NAME))
 		{
     		return TRUE;
 		}
@@ -195,12 +234,12 @@
     msg.opcode = HCI_CMD_SET_BLE_NAME;
     msg.DataLen = name_len;
 		msg.p_data  = ble_name;        
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_BLE_NAME);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BLE_NAME);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
     do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_BLE_NAME))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_NAME))
     	{
     		return TRUE;
     	}
@@ -216,17 +255,16 @@
     msg.opcode = HCI_CMD_SEND_SPP_DATA;
     msg.DataLen = DataLen;
 		msg.p_data = spp_data;	
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SEND_SPP_DATA);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SEND_SPP_DATA);
     SendCMD(&msg);
 		StartTick=SysTick_GetTick();
     do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SEND_SPP_DATA))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SEND_SPP_DATA))
     	{
     		return TRUE;
     	}
     }  while(!SysTick_IsTimeOut(StartTick,BTTIMEOUT));
-    MyPrintf("send spp data failed\n");
     return FALSE;
 
 }
@@ -239,12 +277,12 @@
 	msg.DataLen = DataLen;
 
 	msg.p_data = ble_data;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_SEND_BLE_DATA);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SEND_BLE_DATA);
 	SendCMD(&msg);
 	StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_SEND_BLE_DATA))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SEND_BLE_DATA))
 		{
     		return TRUE;
     	}
@@ -258,12 +296,12 @@
 	HCI_TypeDef msg;
 	msg.opcode = HCI_CMD_STATUS_REQUEST;
 	msg.DataLen = 0;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_STATUS_REQUEST);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_STATUS_REQUEST);
 	SendCMD(&msg);
 	StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_STATUS_REQUEST))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_STATUS_REQUEST))
 		{
 				return CmdRepData[0];
 		}
@@ -279,12 +317,12 @@
     msg.opcode = HCI_CMD_SET_PAIRING_MODE;
     msg.DataLen = 1;
     msg.p_data = &tmode;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_PAIRING_MODE);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_PAIRING_MODE);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_PAIRING_MODE))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_PAIRING_MODE))
     	{
     		return TRUE;
     	}
@@ -298,12 +336,12 @@
 	msg.opcode = HCI_CMD_SET_PINCODE;
 	msg.DataLen = DataLen;
 	msg.p_data = Pincode;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_PINCODE);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_PINCODE);
 	SendCMD(&msg);
 	StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_PINCODE))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_PINCODE))
 		{
 			return TRUE;
 		}
@@ -319,12 +357,12 @@
     msg.opcode = HCI_CMD_BT_DISCONNECT;
     msg.DataLen = 0;
 		msg.p_data = NULL;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_BT_DISCONNECT);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BT_DISCONNECT);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
     do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_BT_DISCONNECT))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_BT_DISCONNECT))
     	{
     		return TRUE;
     	}
@@ -339,12 +377,12 @@
    	msg.opcode = HCI_CMD_VERSION_REQUEST;
     msg.DataLen = 0;
 		msg.p_data = NULL;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_GET_VERSION);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_GET_VERSION);
     SendCMD(&msg);	
    	StartTick=SysTick_GetTick();
    	do
   	{
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_GET_VERSION))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_GET_VERSION))
     	{
 			TempVersion=(CmdRepData[0]<<8) |(CmdRepData[1]);
     		return TempVersion;
@@ -361,12 +399,12 @@
     msg.opcode = HCI_CMD_BLE_DISCONNECT;
     msg.DataLen = 0;
 		msg.p_data = NULL;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_BLE_DISCONNECT);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BLE_DISCONNECT);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_BLE_DISCONNECT))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_BLE_DISCONNECT))
     	{
     		return TRUE;
     	}
@@ -382,12 +420,12 @@
     msg.opcode = HCI_CMD_SET_NVRAM;
     msg.DataLen = NDLen;
 		msg.p_data = NvData;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_SET_NVRAM);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_NVRAM);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_SET_NVRAM))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_NVRAM))
     	{
     		return TRUE;
     	}
@@ -407,19 +445,19 @@
 }
 
 
-Boolean BT_ConfirmGkey(uint8_t mismatching)
+Boolean BT_ConfirmGkey(uint8_t isMatching)
 {
     HCI_TypeDef msg;
-		uint8_t tmismatching = mismatching;
+		uint8_t tmismatching = isMatching;
     msg.opcode = HCI_CMD_CONFIRM_GKEY;
     msg.DataLen =1;
     msg.p_data = &tmismatching;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_CONFIRM_GKEY);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_CONFIRM_GKEY);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_CONFIRM_GKEY))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_CONFIRM_GKEY))
     	{
      		return TRUE;
     	}
@@ -427,13 +465,14 @@
     return FALSE;
 }
 
-Boolean BT_GetCreadIT_GIVEN(uint8_t given)
+Boolean BT_SetSppFlowcontrol(uint8_t packetNum)
 {
     HCI_TypeDef msg;
     msg.opcode = HCI_CMD_GET_CREADIT_GIVEN;
     msg.DataLen =0;
-    msg.p_data = NULL;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_GET_CREADIT_GIVEN);
+	uint8_t temp_packetNum=packetNum;
+    msg.p_data = &temp_packetNum;
+    BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_GET_CREADIT_GIVEN);
     SendCMD(&msg);
     return TRUE;//no event responce
 }
@@ -446,12 +485,12 @@
 	msg.opcode = HCI_CMD_PASSKEY_ENTRY;
 	msg.DataLen = PKLEN;
 	msg.p_data = key_data;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_PASSKEY_ENTRY);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_PASSKEY_ENTRY);
 	SendCMD(&msg);
 	StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_PASSKEY_ENTRY))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_PASSKEY_ENTRY))
 		{
 			return TRUE;
 		}
@@ -466,12 +505,12 @@
     msg.opcode = HCI_CMD_LE_SET_PAIRING;
     msg.DataLen = 1;
     msg.p_data[0] = mode;		
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_LE_SET_PARING);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_PARING);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SET_PARING))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SET_PARING))
     	{
     		return TRUE;
     	}
@@ -485,11 +524,11 @@
     msg.opcode = HCI_CMD_LE_SET_ADV_DATA;
     msg.DataLen = DataLen;
 		msg.p_data = adv_data;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_LE_SET_ADV_DATA);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_DATA);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
     do{
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SET_ADV_DATA))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_DATA))
     	{
     		return TRUE;
     	}
@@ -503,12 +542,12 @@
     msg.opcode = HCI_CMD_LE_SET_SCAN_DATA;
     msg.DataLen = DataLen;
 		msg.p_data = scan_data;
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_LE_SET_SCAN_DATA);
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_SCAN_DATA);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
     do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SET_SCAN_DATA))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SET_SCAN_DATA))
     	{
     		return TRUE;
     	}
@@ -516,20 +555,20 @@
      return FALSE;     
 }
 
-Boolean BT_SetLESendConnUpdate(uint8_t *data,int len)// no event responce.
+Boolean BT_SetLESendConnUpdate(uint8_t *data,int len)
 {
-	if(0x00 == len) 
+	if(0x08 != len) 
 		return FALSE;
     HCI_TypeDef msg;
     msg.opcode = HCI_CMD_LE_SEND_CONN_UPDATE_REQ;
     msg.DataLen = len;	
-		msg.p_data = data;	
-    HCI_CMD_BIT_FLAG&=~(1<<BIT_LE_SEND_CONN_UPDATE);
+	msg.p_data = data;	
+    BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SEND_CONN_UPDATE);
     SendCMD(&msg);
     StartTick=SysTick_GetTick();
      do
     {
-    	if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SEND_CONN_UPDATE))
+		if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SEND_CONN_UPDATE))
     	{
     		return TRUE;
     	}
@@ -546,11 +585,12 @@
     msg.opcode = HCI_CMD_LE_SET_ADV_PARM;
     msg.DataLen = DataLen;	
 		msg.p_data = nvdata;
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_PARM);
 	  SendCMD(&msg);
 		StartTick=SysTick_GetTick();
 	do
 	{
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SET_ADV_PARM))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_PARM))
 		{
 			return TRUE;
 		}
@@ -568,11 +608,12 @@
 		msg.opcode = HCI_CMD_REJECT_JUSTWORK;
 		msg.DataLen = 0x01;  
 		msg.p_data = &td;
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_REJECT_JUSTWORK);
 		SendCMD(&msg);
 		StartTick=SysTick_GetTick();
 		do
 		{
-			if(HCI_CMD_BIT_FLAG&(1<<BIT_REJECT_JUSTWORK))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_REJECT_JUSTWORK))
 			{
 					return TRUE;
 			}
@@ -580,15 +621,24 @@
 	return FALSE;
 }
 
-Boolean BT_SetTxPower(uint8_t power)// no responce response
+Boolean BT_SetTxPower(uint8_t power)
 {
 		uint8_t tpower = power;	
 		HCI_TypeDef msg;
 		msg.opcode = HCI_CMD_SET_TX_POWER;
 		msg.DataLen = 0x01;	
 		msg.p_data = &tpower;
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_TXPOWER);
 		SendCMD(&msg);
-		return TRUE;
+		StartTick=SysTick_GetTick();
+		do
+		{
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_TXPOWER))
+			{
+					return TRUE;
+			}
+    } while(!SysTick_IsTimeOut(StartTick,BTTIMEOUT));
+		return FALSE;
 }
 
 Boolean BT_Set_FixedPasskey(uint8_t* key)
@@ -597,12 +647,12 @@
 	msg.opcode = HCI_CMD_LE_SET_FIXED_PASSKEY;
 	msg.DataLen = 0x05;	
 	msg.p_data = key;
-	HCI_CMD_BIT_FLAG&=~(1<<BIT_LE_SET_FIXED_PASSKEY);
+	BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_FIXED_PASSKEY);
 	SendCMD(&msg);
   StartTick=SysTick_GetTick();
   do
   {
-		if(HCI_CMD_BIT_FLAG&(1<<BIT_LE_SET_FIXED_PASSKEY))
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_LE_SET_FIXED_PASSKEY))
 		{
 			return TRUE;
 		}
@@ -610,15 +660,98 @@
     return FALSE;
 }
 
+Boolean BT_SetCOD(uint8_t * bt_cod)
+{
+    HCI_TypeDef msg;
+    msg.opcode = HCI_CMD_SET_COD;
+    msg.DataLen = 3;
+		msg.p_data = bt_cod;
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_COD);
+    SendCMD(&msg);	
+    StartTick=SysTick_GetTick();
+    do
+    {
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_SET_COD))
+    	{
+    		return TRUE;
+    	}
+    }  while(!SysTick_IsTimeOut(StartTick,BTTIMEOUT));//ms    
+    return FALSE;
+}
+
+
+Boolean BT_DeleteService(void)
+{
+	HCI_TypeDef msg;
+	uint32_t TempVersion=0;
+   	msg.opcode = HCI_CMD_DELETE_CUSTOMIZE_SERVICE;
+    msg.DataLen = 0;
+		msg.p_data = NULL;
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_DELETE_SERVICE);
+    SendCMD(&msg);	
+   	StartTick=SysTick_GetTick();
+   	do
+  	{
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_DELETE_SERVICE))
+    	{			
+    		return TRUE;
+    	}
+  	}while(!SysTick_IsTimeOut(StartTick, BTTIMEOUT));
+		
+    return 1<<BIT_DELETE_SERVICE;
+}
+
+uint16_t BT_AddBleService(uint8_t* ble_service_uuid, uint16_t service_uuid_len)
+{
+    HCI_TypeDef msg;
+    msg.opcode = HCI_CMD_ADD_SERVICE_UUID;
+    msg.DataLen = service_uuid_len;
+		msg.p_data  = ble_service_uuid;        
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
+    SendCMD(&msg);
+    StartTick=SysTick_GetTick();
+    do
+    {
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_ADD_UUID))
+    	{
+    		return (uint16_t)(CmdRepData[0]|(CmdRepData[1]<<8));
+    	}
+    }  while(!SysTick_IsTimeOut(StartTick,BTTIMEOUT));
+    return 0x00;
+	}
+
+
+	
+	
+uint16_t BT_AddBleCharacteristic(uint8_t* ble_Characteristic_uuid, uint16_t service_Characteristic_payload_len)
+{
+    HCI_TypeDef msg;
+    msg.opcode = HCI_CMD_ADD_CHARACTERISTIC_UUID;
+    msg.DataLen = service_Characteristic_payload_len;
+		msg.p_data  = ble_Characteristic_uuid;        
+		BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
+    SendCMD(&msg);
+    StartTick=SysTick_GetTick();
+    do
+    {
+			if(BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_ADD_UUID))
+    	{
+    		return (uint16_t)(CmdRepData[0]|(CmdRepData[1]<<8));
+    	}
+    }  while(!SysTick_IsTimeOut(StartTick,BTTIMEOUT));
+    return 0x00;
+	}
+
 
 void BT_ParseBTData()
 {
 	//此判断用于防止接收包buf满
 	if(BluetoothBuf.BufSize - BluetoothBuf.count < 258)
 	{
+		#if BT_LOG
 		MyPrintf("BluetoothBuf full2");
 		MyPrintf("BluetoothBuf.BufSize: %d,BluetoothBuf.count: %d\n",BluetoothBuf.BufSize,BluetoothBuf.count);
-		
+		#endif
 		return;
 	}
 
@@ -635,8 +768,8 @@
 			{
 				case HCI_EVENT_SPP_DATA_RECEIVED:
 //					SaveData((uint8_t *)&hci_bt,hci_bt.DataLen+3);
-						SaveData((uint8_t*)&hci_bt,3);
-						SaveData(hci_bt.p_data,hci_bt.DataLen);
+					SaveData((uint8_t*)&hci_bt,3);
+					SaveData(hci_bt.p_data,hci_bt.DataLen);
 					PacketNum++;
 					break;
 					
@@ -668,62 +801,62 @@
 						case HCI_CMD_SET_BT_ADDR:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BT_ADDR);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BT_ADDR);
 							}
 							break;
 
 						case HCI_CMD_SET_BLE_ADDR:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_ADDR);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_ADDR);
 							}
 							break;
 
 						case HCI_CMD_SET_VISIBILITY:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_VISIBILITY);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_VISIBILITY);
 							}
 							break;
 
 						case HCI_CMD_SET_BT_NAME:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BT_NAME);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BT_NAME);
 							}
 							break;
 						case HCI_CMD_SET_BLE_NAME:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_NAME);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_BLE_NAME);
 							}
 							break;
 
 						case HCI_CMD_SEND_SPP_DATA:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SEND_SPP_DATA);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SEND_SPP_DATA);
 							}
 							break;
 
 						case HCI_CMD_SEND_BLE_DATA:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SEND_BLE_DATA);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SEND_BLE_DATA);
 							}
 							break;
 
 						case HCI_CMD_SET_PAIRING_MODE:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_PAIRING_MODE);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_PAIRING_MODE);
 							}
 							break;
 
 						case HCI_CMD_SET_PINCODE:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_PINCODE);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_PINCODE);
 							}
 							break;
 
@@ -732,75 +865,89 @@
 						case HCI_CMD_BT_DISCONNECT:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_BT_DISCONNECT);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_BT_DISCONNECT);
 							}
 							break;
 
 						case HCI_CMD_BLE_DISCONNECT:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_BLE_DISCONNECT);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_BLE_DISCONNECT);
 							}
 							break;
 						case HCI_CMD_SET_NVRAM:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_NVRAM);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_NVRAM);
 							}
 							break;
 
 						case HCI_CMD_CONFIRM_GKEY:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_CONFIRM_GKEY);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_CONFIRM_GKEY);
 							}
 							break;
 
 						case HCI_CMD_PASSKEY_ENTRY:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_PASSKEY_ENTRY);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_PASSKEY_ENTRY);
 							}
 							break;
 
 						case HCI_CMD_LE_SET_ADV_DATA:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_DATA);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_DATA);
 							}
 						break;
 
 						case HCI_CMD_LE_SET_SCAN_DATA:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_SCAN_DATA);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_SCAN_DATA);
 							}
 						break;
 						
 						case HCI_CMD_LE_SEND_CONN_UPDATE_REQ:
 							if(!hci_bt.p_data[1])
 							{
-								BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SEND_CONN_UPDATE);
+								BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SEND_CONN_UPDATE);
 							}
 						break;
 						case HCI_CMD_LE_SET_ADV_PARM:
 						if(!hci_bt.p_data[1])
 						{
-							 BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_PARM);
+							 BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_PARM);
 						}							
 						break;
 						
 						case HCI_CMD_REJECT_JUSTWORK:
 						if(!hci_bt.p_data[1])
 						{
-							 BIT_SET(HCI_CMD_BIT_FLAG,BIT_REJECT_JUSTWORK);
+							 BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_REJECT_JUSTWORK);
 						}								
 						break;
 						
+						case HCI_CMD_SET_COD:
+						if(!hci_bt.p_data[1])
+						{
+							BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_COD);
+						}
+						break;
+												
+						case HCI_CMD_DELETE_CUSTOMIZE_SERVICE:
+						if(!hci_bt.p_data[1])
+						{
+							BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_DELETE_SERVICE);
+						}
+						break;					
+				
 						case HCI_CMD_LE_SET_FIXED_PASSKEY:
 						if(!hci_bt.p_data[1])
 						{
-							 BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_FIXED_PASSKEY);
+							 BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_LE_SET_FIXED_PASSKEY);
 						}
 						break;
 						default:
@@ -809,13 +956,19 @@
 					break;
 
 				case HCI_EVENT_I_AM_READY:
-					BIT_SET(HCI_CMD_BIT_FLAG,BIT_MODULE_READY);
+					BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_MODULE_READY);
 					break;
 
 				case HCI_EVENT_STAUS_RESPONSE:
-					BIT_SET(HCI_CMD_BIT_FLAG,BIT_STATUS_REQUEST);
+					BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_STATUS_REQUEST);
 					CmdRepData[0] = hci_bt.p_data[0];
 					break;
+				
+				case HCI_EVENT_UUID_HANDLE:
+					BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
+					CmdRepData[0] = hci_bt.p_data[0];
+					CmdRepData[1] = hci_bt.p_data[1];
+					break;
 
 				default:
 					break;
@@ -825,12 +978,16 @@
 		}
 		else
 		{
+			#if BT_LOG
 			MyPrintf("receive bt data err");
+			#endif
 		}
 	}
 	else
 	{
+		#if BT_LOG
 		MyPrintf("receive bt data err");
+		#endif
 	}
 }
 
Index: rom/format/app_module.format
===================================================================
--- /YC3121_SDK/rom/format/app_module.format	(revision 621)
+++ /YC3121_SDK/rom/format/app_module.format	(working copy)
@@ -28,7 +28,7 @@
 	
 	300 mem_module_uuid_list
 	0 mem_module_uuid_list_end
-	600 mem_module_le_att_list
+	700 mem_module_le_att_list
 	0 mem_module_le_att_list_end
 	0 mem_module_nv_data
 	34 mem_module_nv_data0
@@ -112,6 +112,7 @@
 0x12 HCI_CMD_BLE_DISCONNECT
 0x13 HCI_CMD_DELETE_DEVICE
 0x14 HCI_CMD_CREATE_CONNECT
+0x15 HCI_CMD_SET_COD
 0x26 HCI_CMD_SET_NVRAM_REQ
 0x27 HCI_CMD_SLEEP
 0x28 HCI_CMD_CONFIRM_GKEY
@@ -136,6 +137,11 @@
 0x51 HCI_CMD_RESET_CHIP_REQ
 0x61 HCI_CMD_LE_SET_FIXED_PASSKEY
 
+0x76 HCI_CMD_DELETE_CUSTOMIZE_SERVICE
+0x77 HCI_CMD_ADD_SERVICE_UUID
+0x78 HCI_CMD_ADD_CHARACTERISTIC_UUID
+
+
 0xee HCI_TEST_CMD_REBACK
 0xff HCI_TEST_CMD_CLOSE_LPM
 )
@@ -164,6 +170,7 @@
 0X15 HCI_EVENT_LE_ENCRYPTION_STATE
 0x17 HCI_EVENT_LE_CONNECTION_UPDATE
 0x1d HCI_EVENT_LE_GKEY
+0x29 HCI_EVENT_UUID_HANDLE
 
 )
 
Index: rom/format/le.format
===================================================================
--- /YC3121_SDK/rom/format/le.format	(revision 621)
+++ /YC3121_SDK/rom/format/le.format	(working copy)
@@ -718,5 +718,15 @@
 2 BIT_ADV_CHANNEL_MAP_39
 )
 
+(
+0 BIT_CHARACTERISTIC_BROADCAST
+1 BIT_CHARACTERISTIC_READ
+2 BIT_CHARACTERISTIC_WRITE_WITHOUT_RESPONSE
+3 BIT_CHARACTERISTIC_WRITE
+4 BIT_CHARACTERISTIC_NOTIFY
+5 BIT_CHARACTERISTIC_INDICATE
+6 BIT_CHARACTERISTIC_SIGNED_WRITE
+7 BIT_CHARACTERISTIC_EXTENDED_PROPERTIES
+)
 
 
Index: rom/output/bt_code.c
===================================================================
--- /YC3121_SDK/rom/output/bt_code.c	(revision 621)
+++ /YC3121_SDK/rom/output/bt_code.c	(working copy)
@@ -1,126 +1,150 @@
 const unsigned char bt_code[] = {
-0x00,0x02,0xaa,0x55,0x3a,0x02,0xc2,0x84,0x00,0x05,0xc0,0x00,0x80,0x0d,0xc0,0x5c,
-0x00,0x13,0xc0,0x5d,0x80,0x2d,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x80,0x3c,0xc0,0x02,
-0x80,0x4c,0xc0,0x1d,0x00,0x55,0xc0,0x1f,0x00,0x5e,0xc0,0x20,0x80,0x70,0xc0,0x29,
-0x00,0x76,0xc0,0x4c,0x80,0x8a,0x20,0x20,0x4a,0x8b,0x20,0x40,0x68,0xc4,0x20,0x40,
+0x00,0x02,0xaa,0x55,0xb6,0x03,0xc2,0x84,0x00,0x05,0xc0,0x00,0x80,0x0d,0xc0,0x5c,
+0x00,0x13,0xc0,0x5d,0x80,0x40,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x80,0x9b,0xc0,0x02,
+0x80,0xab,0xc0,0x1d,0x00,0xb4,0xc0,0x1f,0x00,0xbd,0xc0,0x20,0x80,0xcf,0xc0,0x29,
+0x00,0xd5,0xc0,0x4c,0x80,0xe9,0x20,0x20,0x4a,0x8b,0x20,0x40,0x68,0xc4,0x20,0x40,
 0x60,0xd7,0x20,0x40,0x00,0x11,0x20,0x20,0x40,0x0a,0x20,0x75,0x80,0x00,0x20,0x20,
-0x7b,0x9a,0x58,0x00,0x00,0x1b,0x67,0xe4,0x41,0xf6,0x58,0x00,0x00,0x23,0x67,0xe4,
-0x41,0xfe,0x20,0x40,0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,
-0x50,0x4d,0x1a,0x62,0x7e,0x00,0xc0,0x04,0x80,0x21,0xc0,0x01,0x00,0x1f,0x20,0x20,
-0x4d,0xdf,0x70,0x4a,0xb1,0x00,0x20,0x20,0x4d,0xfb,0x70,0x4a,0xb1,0x06,0x20,0x20,
-0x4e,0x08,0x20,0x40,0x00,0x25,0x20,0x20,0x50,0xc3,0x6f,0xe2,0x4a,0xb1,0x20,0x7a,
-0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x4a,0xb1,0x24,0x7a,0x00,0x00,0x6f,0xe4,
-0x46,0x52,0xc2,0x80,0x4d,0x64,0x20,0x60,0x00,0x00,0x6f,0xe2,0x0a,0xff,0xc0,0x13,
-0x80,0x3a,0xc0,0x06,0x00,0x31,0x20,0x20,0x4e,0x5c,0x1a,0x22,0x06,0x00,0xef,0xe2,
-0x00,0x03,0xc0,0x00,0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,
-0x80,0x38,0x20,0x20,0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,0x20,0x40,
-0x50,0x1f,0x20,0x20,0x4d,0x85,0x20,0x40,0x49,0xba,0x78,0x23,0xfc,0x00,0x78,0x24,
-0xfc,0x00,0x09,0x80,0x00,0x08,0x19,0x89,0x7e,0x00,0x67,0xe2,0x02,0xd5,0x09,0x80,
-0x00,0x08,0x19,0x89,0x7e,0x00,0xe7,0xe2,0x00,0x05,0x1f,0xe1,0x72,0x3f,0x20,0x22,
-0xd8,0x8b,0x1f,0xe6,0x7c,0x33,0x24,0x41,0x00,0x4a,0x20,0x20,0x58,0x87,0xdf,0x20,
-0x00,0x33,0x20,0x60,0x00,0x00,0x20,0x40,0x58,0xa3,0x20,0x40,0x49,0x15,0x68,0x42,
-0x00,0x17,0x20,0x40,0x49,0x1c,0x20,0x00,0x05,0xdc,0x20,0x40,0x49,0x21,0x78,0x28,
-0x7c,0x00,0xd9,0x60,0x15,0x7c,0x20,0x20,0x58,0x69,0x6f,0xe2,0x00,0x7d,0xc0,0x08,
-0x00,0x58,0x20,0x20,0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,
-0x00,0x5c,0x20,0x20,0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x78,0x54,
-0x7c,0x00,0x20,0x40,0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,
-0x80,0x64,0x20,0x20,0x63,0xf2,0xc0,0x42,0x00,0x67,0xc0,0x41,0x80,0x6a,0x20,0x20,
-0x64,0x21,0x20,0x40,0x00,0x6d,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,
-0x00,0x6d,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0xef,0x6f,0xe2,0x46,0x2c,0x20,0x3a,
-0x65,0x0d,0x20,0x20,0x65,0x06,0x6f,0xe2,0x40,0x9e,0x79,0x3f,0xfe,0x03,0x67,0xe2,
-0x40,0x9e,0x58,0x00,0x00,0x01,0x67,0xe4,0x04,0xca,0x20,0x60,0x00,0x00,0x6f,0xe2,
-0x04,0xf9,0xc0,0x1f,0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,0x80,0x7c,0xc0,0x29,
-0xea,0x05,0x20,0x60,0x00,0x00,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,
-0x69,0x84,0x6f,0xe2,0x04,0xff,0xc0,0x20,0xe9,0x66,0xc0,0x20,0x69,0x6e,0xc0,0x38,
-0xe9,0xa7,0xc0,0x38,0x00,0x86,0xc0,0x24,0xe9,0xbe,0x20,0x20,0x6a,0x58,0x70,0x0a,
-0x95,0x08,0x20,0x40,0x7b,0xab,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xba,0x6f,0xe2,
-0x44,0x90,0x20,0x3a,0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x1b,0xd2,
-0xaa,0x55,0x01,0x00,0x92,0x40,0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,
-0x01,0x00,0x06,0x42,0x13,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xf8,0x8b,
-0x85,0x59,0x83,0xaa,0x55,0x03,0x00,0x14,0x42,0x07,0x4a,0x05,0xaa,0x55,0x04,0x00,
-0x3d,0x45,0x00,0x7f,0x00,0x07,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,0xaa,
-0x55,0x01,0x00,0x2c,0x46,0x01,0xaa,0x55,0x06,0x00,0x57,0x46,0x04,0x30,0x30,0x30,
-0x30,0x30,0xaa,0x55,0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,0x1c,
-0x00,0x4c,0xe0,0x4f,0x00,0x4c,0x00,0x4c,0xaa,0x55,0x02,0x00,0x68,0x46,0x00,0x02,
-0xaa,0x55,0x01,0x00,0x6c,0x46,0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,0xaa,0x55,
-0x03,0x00,0xaa,0x40,0x24,0x04,0x04,0xaa,0x55,0x01,0x00,0x79,0x46,0x00,0xaa,0x55,
-0x01,0x00,0x91,0x40,0x00,0xaa,0x55,0x03,0x00,0x54,0x41,0x00,0x01,0x08,0xaa,0x55,
-0x01,0x00,0x74,0x41,0x02,0xaa,0x55,0x01,0x00,0x93,0x40,0x00,0xaa,0x55,0x01,0x00,
-0x6d,0x46,0x28,0xaa,0x55,0x06,0x00,0xa0,0x40,0xa7,0x2a,0x2a,0x21,0x10,0x3a,0xaa,
-0x55,0x0c,0x00,0xe7,0x44,0x0b,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,
-0x74,0xaa,0x55,0x03,0x00,0xe4,0x41,0x20,0x00,0x01,0xaa,0x55,0x01,0x00,0xe8,0x41,
-0x00,0xaa,0x55,0x01,0x00,0x90,0x44,0x01,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,
-0x55,0x01,0x00,0x98,0x44,0x00,0xaa,0x55,0x04,0x00,0x75,0x46,0x2d,0x00,0x2f,0x00,
-0xaa,0x55,0x01,0x00,0x40,0x43,0x00,0xaa,0x55,0x02,0x00,0x54,0x44,0x40,0x00,0xaa,
-0x55,0x01,0x00,0x6e,0x46,0x05,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x22,0x01,0x33,
-0x02,0x3a,0xaa,0x55,0x0d,0x00,0x81,0x43,0x0c,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,
-0x75,0x20,0x42,0x6c,0x65,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x02,0xaa,
-0x55,0x16,0x00,0x61,0x43,0x0e,0x02,0x01,0x02,0x11,0x09,0x59,0x69,0x63,0x68,0x69,
-0x70,0x20,0x31,0x30,0x32,0x31,0x73,0x20,0x4d,0x6f,0x75,0xaa,0x55,0x07,0x00,0x25,
-0x44,0x02,0x03,0x00,0x05,0x10,0x02,0x03,0xaa,0x55,0x08,0x00,0x68,0x44,0x08,0x00,
-0x10,0x00,0x00,0x00,0x2c,0x01,0xaa,0x55,0x01,0x00,0x78,0x44,0xb9,0xaa,0x55,0x01,
-0x00,0x7a,0x44,0x17,0xaa,0x55,0x02,0x00,0xcc,0x44,0x31,0x00,0xaa,0x55,0x01,0x00,
-0xd1,0x40,0x01,0xaa,0x55,0x0c,0x00,0x49,0x45,0x05,0x03,0x00,0x12,0x00,0x01,0x01,
-0x00,0x01,0x11,0x03,0x00,0xaa,0x55,0x01,0x00,0x5f,0x45,0x00,0xaa,0x55,0x02,0x00,
-0x47,0x45,0x83,0x46,0xaa,0x55,0xb8,0x00,0x83,0x46,0x03,0x12,0x00,0x01,0x00,0x00,
-0x01,0x00,0x01,0x00,0x01,0x36,0x00,0x52,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x01,
-0x09,0x00,0x01,0x35,0x03,0x19,0x12,0x00,0x09,0x00,0x04,0x35,0x0d,0x35,0x06,0x19,
-0x01,0x00,0x09,0x00,0x01,0x35,0x03,0x19,0x00,0x01,0x09,0x00,0x09,0x35,0x08,0x35,
-0x06,0x19,0x12,0x00,0x09,0x01,0x00,0x09,0x02,0x00,0x09,0x01,0x03,0x09,0x02,0x01,
-0x09,0x05,0xac,0x09,0x02,0x02,0x09,0x02,0x39,0x09,0x02,0x03,0x09,0x06,0x44,0x09,
-0x02,0x04,0x28,0x01,0x09,0x02,0x05,0x09,0x00,0x02,0x03,0x11,0x01,0x00,0x03,0x01,
-0x00,0x00,0x01,0x00,0x03,0x36,0x00,0x46,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x03,
-0x09,0x00,0x01,0x35,0x03,0x19,0x11,0x01,0x09,0x00,0x02,0x0a,0x00,0x00,0x00,0x00,
-0x09,0x00,0x04,0x35,0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,
-0x01,0x09,0x00,0x06,0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,
-0x01,0x00,0x25,0x0a,0x53,0x50,0x50,0x20,0x73,0x6c,0x61,0x76,0x65,0x00,0x00,0x00,
-0x01,0x00,0xaa,0x55,0x02,0x00,0x8e,0x44,0xaf,0x47,0xaa,0x55,0x35,0x02,0xaf,0x47,
-0x01,0x00,0x02,0x00,0x28,0x02,0x00,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x02,0x03,
-0x00,0x02,0x01,0x2a,0x02,0xc8,0x00,0x04,0x00,0x02,0x03,0x28,0x01,0x0a,0x05,0x00,
-0x02,0x00,0x2a,0x14,0x41,0x73,0x74,0x20,0x4c,0x45,0x20,0x4d,0x6f,0x75,0x73,0x65,
-0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,
-0x00,0x02,0x04,0x2a,0x08,0x06,0x00,0x06,0x00,0x64,0x00,0x2c,0x01,0x08,0x00,0x02,
-0x03,0x28,0x01,0x02,0x09,0x00,0x02,0x02,0x2a,0x01,0x01,0x0a,0x00,0x02,0x03,0x28,
-0x01,0x08,0x0b,0x00,0x02,0x03,0x2a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,
-0x02,0x00,0x28,0x02,0x01,0x18,0x0d,0x00,0x02,0x03,0x28,0x01,0x20,0x0e,0x00,0x02,
-0x05,0x2a,0x00,0x0f,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x00,0x28,
-0x02,0x04,0x18,0x11,0x00,0x02,0x03,0x28,0x01,0x16,0x12,0x00,0x02,0x07,0x2a,0x01,
-0x00,0x13,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x14,0x00,0x02,0x00,0x28,0x02,0x0f,
-0x18,0x15,0x00,0x02,0x03,0x28,0x01,0x12,0x16,0x00,0x02,0x19,0x2a,0x01,0x38,0x17,
-0x00,0x02,0x00,0x28,0x02,0x0a,0x18,0x18,0x00,0x02,0x03,0x28,0x01,0x02,0x19,0x00,
-0x02,0x23,0x2a,0x03,0x00,0x00,0x00,0x1a,0x00,0x02,0x03,0x28,0x01,0x02,0x1b,0x00,
-0x02,0x29,0x2a,0x08,0x46,0x6c,0x61,0x67,0x74,0x72,0x69,0x70,0x1c,0x00,0x02,0x03,
-0x28,0x01,0x02,0x1d,0x00,0x02,0x24,0x2a,0x06,0x79,0x69,0x63,0x68,0x69,0x70,0x1e,
-0x00,0x02,0x03,0x28,0x01,0x02,0x1f,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,
-0x20,0x00,0x02,0x03,0x28,0x01,0x02,0x21,0x00,0x02,0x26,0x2a,0x03,0x31,0x2e,0x30,
-0x22,0x00,0x02,0x03,0x28,0x01,0x02,0x23,0x00,0x02,0x28,0x2a,0x03,0x31,0x2e,0x30,
-0x24,0x00,0x02,0x03,0x28,0x01,0x02,0x25,0x00,0x02,0x2a,0x2a,0x03,0x31,0x2e,0x30,
-0x26,0x00,0x02,0x03,0x28,0x01,0x02,0x27,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,
-0x33,0x28,0x00,0x02,0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,
-0x4a,0x7d,0xfe,0x43,0x53,0x53,0x49,0x29,0x00,0x02,0x03,0x28,0x01,0x12,0x2a,0x00,
-0x10,0x16,0x96,0x24,0x47,0xc6,0x23,0x61,0xba,0xd9,0x4b,0x4d,0x1e,0x43,0x53,0x53,
-0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x2b,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x2c,0x00,
-0x02,0x03,0x28,0x01,0x08,0x2d,0x00,0x10,0xb3,0x9b,0x72,0x34,0xbe,0xec,0xd4,0xa8,
-0xf4,0x43,0x41,0x88,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x00,0x02,
-0x03,0x28,0x01,0x04,0x2f,0x00,0x10,0xfe,0x69,0xca,0x9a,0x56,0x19,0xf6,0xab,0x02,
-0x4d,0xaa,0x6d,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x02,0x03,
-0x28,0x01,0x1a,0x31,0x00,0x10,0x18,0x03,0xa6,0x28,0x5e,0xd8,0xec,0x91,0x1c,0x48,
-0xa3,0xac,0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x02,0x02,0x29,
-0x02,0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x00,0x40,0x02,0xaa,0x55,0x01,0x00,
-0x17,0x40,0x09,0xaa,0x55,0x01,0x00,0x20,0x40,0x28,0xaa,0x55,0x02,0x00,0x27,0x40,
-0x44,0x02,0xaa,0x55,0x01,0x00,0x2a,0x40,0x04,0xaa,0x55,0x01,0x00,0x33,0x40,0x02,
-0xaa,0x55,0x07,0x00,0x76,0x41,0x0f,0x84,0x30,0x0a,0x0b,0xb2,0x32,0xaa,0x55,0x02,
-0x00,0x57,0x41,0x8b,0x0b,0xaa,0x55,0x08,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x00,
-0x00,0x00,0x00,0xaa,0x55,0x02,0x00,0xbd,0x40,0x02,0x24,0xaa,0x55,0x08,0x00,0xad,
-0x40,0x40,0x00,0x00,0x02,0x32,0x00,0x00,0x02,0xaa,0x55,0x02,0x00,0xbb,0x40,0x20,
-0x00,0xaa,0x55,0x04,0x00,0xb7,0x40,0x20,0x00,0x00,0x20,0xaa,0x55,0x04,0x00,0xbf,
-0x40,0x80,0x04,0x00,0x08,0xaa,0x55,0x05,0x00,0xe2,0x44,0x08,0x0e,0x05,0x04,0x00,
-0xaa,0x55,0x02,0x00,0x02,0x42,0x30,0x1f,0xaa,0x55,0x01,0x00,0x10,0x42,0x20,0xaa,
-0x55,0x01,0x00,0xe0,0x41,0x01,0xaa,0x55,0x0f,0x00,0xb2,0x4a,0x4b,0xba,0x55,0xd0,
-0x56,0xe0,0x57,0x88,0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,
-0x40,0xb2,0x4a,0x3a,0x7d
+0x7b,0x9a,0x58,0x00,0x00,0x1d,0x67,0xe4,0x41,0xf6,0x58,0x00,0x00,0x25,0x67,0xe4,
+0x41,0xfe,0x58,0x00,0x00,0x2f,0x67,0xe4,0x41,0xfa,0x20,0x40,0x4d,0xaf,0x20,0x40,
+0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,0x50,0x4d,0x1a,0x62,0x7e,0x00,0xc0,0x04,
+0x80,0x23,0xc0,0x01,0x00,0x21,0x20,0x20,0x4d,0xdf,0x70,0x4b,0x15,0x00,0x20,0x20,
+0x4d,0xfb,0x70,0x4b,0x15,0x06,0x20,0x20,0x4e,0x08,0x20,0x40,0x00,0x27,0x20,0x20,
+0x50,0xc3,0x6f,0xe2,0x4b,0x15,0x20,0x7a,0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,
+0x4b,0x15,0x24,0x7a,0x00,0x00,0x6f,0xe4,0x46,0x52,0xc2,0x80,0x4d,0x64,0x20,0x60,
+0x00,0x00,0x20,0x40,0x4f,0x11,0x20,0x74,0x00,0x00,0x1a,0x22,0x7e,0x00,0x67,0xe4,
+0x46,0x71,0x1a,0x42,0x7e,0x00,0x67,0xe2,0x46,0x70,0x68,0x44,0x04,0x74,0x60,0x44,
+0x46,0x73,0x20,0x40,0x5b,0x6c,0x24,0x3a,0x4a,0x8b,0x6f,0xe2,0x04,0x9e,0xc0,0x81,
+0x50,0x42,0xe8,0x44,0x00,0x06,0x58,0x00,0x29,0x02,0x98,0x46,0x7c,0x00,0x20,0x62,
+0x80,0x00,0x20,0x20,0x50,0x42,0x6f,0xe2,0x0a,0xff,0xc0,0x13,0x80,0x99,0xc0,0x06,
+0x00,0x48,0xc0,0x3b,0x00,0x51,0xc0,0x3b,0x80,0x57,0xc0,0x3c,0x00,0x5c,0xc0,0x0a,
+0x80,0x96,0x20,0x20,0x4e,0x5c,0x1a,0x22,0x06,0x00,0xef,0xe2,0x00,0x03,0xc0,0x00,
+0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,0x80,0x4f,0x20,0x20,
+0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,0xd8,0x40,0x00,0x28,0x20,0x40,
+0x5b,0x4d,0x18,0xc0,0x8b,0xfe,0x58,0x00,0x00,0x00,0xe7,0xe4,0x00,0x05,0x20,0x20,
+0x50,0x1f,0x20,0x40,0x00,0x60,0x20,0x40,0x00,0x7d,0x58,0x00,0x00,0x00,0xe7,0xe4,
+0x00,0x05,0x20,0x20,0x00,0x8f,0xef,0xe2,0x00,0x03,0x20,0x40,0x00,0x64,0x20,0x40,
+0x00,0x6b,0x20,0x20,0x00,0x8f,0x20,0x40,0x00,0x81,0x58,0x28,0x00,0x02,0xe7,0xe6,
+0x00,0x05,0x20,0x60,0x00,0x00,0x67,0xe2,0x0a,0x96,0x20,0x40,0x00,0x81,0x59,0x28,
+0x03,0x02,0xe7,0xe8,0x00,0x05,0x6f,0xe2,0x0a,0x96,0xe7,0xe6,0x00,0x05,0x20,0x60,
+0x00,0x00,0x20,0x40,0x00,0x81,0x20,0x40,0x00,0x7d,0x20,0x40,0x00,0x7d,0x58,0x00,
+0x00,0x00,0xe7,0xe4,0x00,0x05,0x18,0x40,0x85,0xff,0x20,0x40,0x5b,0x4d,0x18,0xc0,
+0x8c,0x04,0xef,0xe2,0x00,0x06,0xc2,0x82,0x00,0x78,0xc2,0x82,0x80,0x78,0x18,0x40,
+0x84,0x01,0x20,0x60,0x00,0x00,0x20,0x40,0x00,0x81,0x5a,0x29,0x02,0x02,0xe7,0xf0,
+0x00,0x05,0x18,0x40,0x85,0xff,0x20,0x60,0x00,0x00,0xef,0xe2,0x00,0x03,0x1f,0xe2,
+0x72,0x00,0xe7,0xe2,0x00,0x05,0x20,0x20,0x67,0xed,0x20,0x40,0x00,0x84,0xe0,0x44,
+0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe4,0x44,0x8e,0x98,0x00,0x0c,0x00,0xef,0xe4,
+0x00,0x06,0x20,0x7a,0x00,0x00,0x1f,0xe0,0x84,0x01,0xef,0xe2,0x00,0x06,0x98,0xc0,
+0x8c,0x00,0xef,0xe2,0x00,0x06,0x98,0xc0,0x8c,0x00,0x18,0xc2,0x0a,0x00,0x20,0x20,
+0x00,0x86,0x60,0x44,0x0a,0x9e,0x70,0x0a,0xff,0x29,0x58,0x00,0x00,0x02,0x20,0x40,
+0x50,0xa5,0x68,0x44,0x0a,0x9e,0xe0,0x44,0x00,0x0a,0x20,0x20,0x67,0xb9,0xef,0xe6,
+0x00,0x03,0x67,0xe6,0x40,0xaa,0x20,0x20,0x50,0x1f,0x20,0x40,0x50,0x1f,0x20,0x20,
+0x4d,0x85,0x20,0x40,0x49,0xba,0x78,0x23,0xfc,0x00,0x78,0x24,0xfc,0x00,0x09,0x80,
+0x00,0x08,0x19,0x89,0x7e,0x00,0x67,0xe2,0x02,0xd5,0x09,0x80,0x00,0x08,0x19,0x89,
+0x7e,0x00,0xe7,0xe2,0x00,0x05,0x1f,0xe1,0x72,0x3f,0x20,0x22,0xd8,0x8b,0x1f,0xe6,
+0x7c,0x33,0x24,0x41,0x00,0xa9,0x20,0x20,0x58,0x87,0xdf,0x20,0x00,0x33,0x20,0x60,
+0x00,0x00,0x20,0x40,0x58,0xa3,0x20,0x40,0x49,0x15,0x68,0x42,0x00,0x17,0x20,0x40,
+0x49,0x1c,0x20,0x00,0x05,0xdc,0x20,0x40,0x49,0x21,0x78,0x28,0x7c,0x00,0xd9,0x60,
+0x15,0x7c,0x20,0x20,0x58,0x69,0x6f,0xe2,0x00,0x7d,0xc0,0x08,0x00,0xb7,0x20,0x20,
+0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,0x00,0xbb,0x20,0x20,
+0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x78,0x54,0x7c,0x00,0x20,0x40,
+0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,0x80,0xc3,0x20,0x20,
+0x63,0xf2,0xc0,0x42,0x00,0xc6,0xc0,0x41,0x80,0xc9,0x20,0x20,0x64,0x21,0x20,0x40,
+0x00,0xcc,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,0x00,0xcc,0x6f,0xe2,
+0x00,0x48,0x20,0x20,0x64,0xef,0x6f,0xe2,0x46,0x2c,0x20,0x3a,0x65,0x0d,0x20,0x20,
+0x65,0x06,0x6f,0xe2,0x40,0x9e,0x79,0x3f,0xfe,0x03,0x67,0xe2,0x40,0x9e,0x58,0x00,
+0x00,0x01,0x67,0xe4,0x04,0xca,0x20,0x60,0x00,0x00,0x6f,0xe2,0x04,0xf9,0xc0,0x1f,
+0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,0x80,0xdb,0xc0,0x29,0xea,0x05,0x20,0x60,
+0x00,0x00,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x69,0x84,0x6f,0xe2,
+0x04,0xff,0xc0,0x20,0xe9,0x66,0xc0,0x20,0x69,0x6e,0xc0,0x38,0xe9,0xa7,0xc0,0x38,
+0x00,0xe5,0xc0,0x24,0xe9,0xbe,0x20,0x20,0x6a,0x58,0x70,0x0a,0x95,0x08,0x20,0x40,
+0x7b,0xab,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xba,0x6f,0xe2,0x44,0x90,0x20,0x3a,
+0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x0c,0x69,0xaa,0x55,0x01,0x00,
+0x92,0x40,0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,0x01,0x00,0x06,0x42,
+0x13,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xf8,0x8b,0x85,0x59,0x83,0xaa,
+0x55,0x03,0x00,0x14,0x42,0x6b,0x4a,0x05,0xaa,0x55,0x04,0x00,0x3d,0x45,0x00,0x7f,
+0x00,0x07,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,0xaa,0x55,0x01,0x00,0x2c,
+0x46,0x01,0xaa,0x55,0x06,0x00,0x57,0x46,0x04,0x30,0x30,0x30,0x30,0x30,0xaa,0x55,
+0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,0x1c,0x00,0x4c,0xe0,0x4f,
+0x00,0x4c,0x00,0x4c,0xaa,0x55,0x02,0x00,0x68,0x46,0x00,0x03,0xaa,0x55,0x01,0x00,
+0x6c,0x46,0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,0xaa,0x55,0x03,0x00,0xaa,0x40,
+0x24,0x04,0x04,0xaa,0x55,0x01,0x00,0x79,0x46,0x00,0xaa,0x55,0x01,0x00,0x91,0x40,
+0x00,0xaa,0x55,0x03,0x00,0x54,0x41,0x00,0x01,0x08,0xaa,0x55,0x01,0x00,0x74,0x41,
+0x02,0xaa,0x55,0x01,0x00,0x93,0x40,0x00,0xaa,0x55,0x01,0x00,0x6d,0x46,0x28,0xaa,
+0x55,0x06,0x00,0xa0,0x40,0xa7,0x2a,0x2a,0x21,0x10,0x3a,0xaa,0x55,0x0c,0x00,0xe7,
+0x44,0x0b,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,0x74,0xaa,0x55,0x03,
+0x00,0xe4,0x41,0x20,0x00,0x01,0xaa,0x55,0x01,0x00,0xe8,0x41,0x00,0xaa,0x55,0x01,
+0x00,0x90,0x44,0x01,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,0x55,0x01,0x00,0x98,
+0x44,0x00,0xaa,0x55,0x04,0x00,0x75,0x46,0x2d,0x00,0x2f,0x00,0xaa,0x55,0x01,0x00,
+0x40,0x43,0x00,0xaa,0x55,0x02,0x00,0x54,0x44,0x40,0x00,0xaa,0x55,0x01,0x00,0x6e,
+0x46,0x05,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x22,0x01,0x33,0x02,0x3a,0xaa,0x55,
+0x0d,0x00,0x81,0x43,0x0c,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,0x6c,
+0x65,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x02,0xaa,0x55,0x16,0x00,0x61,
+0x43,0x0e,0x02,0x01,0x02,0x11,0x09,0x59,0x69,0x63,0x68,0x69,0x70,0x20,0x31,0x30,
+0x32,0x31,0x73,0x20,0x4d,0x6f,0x75,0xaa,0x55,0x07,0x00,0x25,0x44,0x02,0x03,0x00,
+0x05,0x10,0x02,0x03,0xaa,0x55,0x08,0x00,0x68,0x44,0x08,0x00,0x10,0x00,0x00,0x00,
+0x2c,0x01,0xaa,0x55,0x01,0x00,0x78,0x44,0xb9,0xaa,0x55,0x01,0x00,0x7a,0x44,0x17,
+0xaa,0x55,0x02,0x00,0xcc,0x44,0x31,0x00,0xaa,0x55,0x01,0x00,0xd1,0x40,0x01,0xaa,
+0x55,0x0c,0x00,0x49,0x45,0x05,0x03,0x00,0x12,0x00,0x01,0x01,0x00,0x01,0x11,0x03,
+0x00,0xaa,0x55,0x01,0x00,0x5f,0x45,0x00,0xaa,0x55,0x02,0x00,0x47,0x45,0x83,0x46,
+0xaa,0x55,0xb8,0x00,0x83,0x46,0x03,0x12,0x00,0x01,0x00,0x00,0x01,0x00,0x01,0x00,
+0x01,0x36,0x00,0x52,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x01,0x09,0x00,0x01,0x35,
+0x03,0x19,0x12,0x00,0x09,0x00,0x04,0x35,0x0d,0x35,0x06,0x19,0x01,0x00,0x09,0x00,
+0x01,0x35,0x03,0x19,0x00,0x01,0x09,0x00,0x09,0x35,0x08,0x35,0x06,0x19,0x12,0x00,
+0x09,0x01,0x00,0x09,0x02,0x00,0x09,0x01,0x03,0x09,0x02,0x01,0x09,0x05,0xac,0x09,
+0x02,0x02,0x09,0x02,0x39,0x09,0x02,0x03,0x09,0x06,0x44,0x09,0x02,0x04,0x28,0x01,
+0x09,0x02,0x05,0x09,0x00,0x02,0x03,0x11,0x01,0x00,0x03,0x01,0x00,0x00,0x01,0x00,
+0x03,0x36,0x00,0x46,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x03,0x09,0x00,0x01,0x35,
+0x03,0x19,0x11,0x01,0x09,0x00,0x02,0x0a,0x00,0x00,0x00,0x00,0x09,0x00,0x04,0x35,
+0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,0x01,0x09,0x00,0x06,
+0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,0x01,0x00,0x25,0x0a,
+0x53,0x50,0x50,0x20,0x73,0x6c,0x61,0x76,0x65,0x00,0x00,0x00,0x01,0x00,0xaa,0x55,
+0x02,0x00,0x8e,0x44,0xaf,0x47,0xaa,0x55,0x35,0x02,0xaf,0x47,0x01,0x00,0x02,0x00,
+0x28,0x02,0x00,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x02,0x03,0x00,0x02,0x01,0x2a,
+0x02,0xc8,0x00,0x04,0x00,0x02,0x03,0x28,0x01,0x0a,0x05,0x00,0x02,0x00,0x2a,0x14,
+0x41,0x73,0x74,0x20,0x4c,0x45,0x20,0x4d,0x6f,0x75,0x73,0x65,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,0x00,0x02,0x04,0x2a,
+0x08,0x06,0x00,0x06,0x00,0x64,0x00,0x2c,0x01,0x08,0x00,0x02,0x03,0x28,0x01,0x02,
+0x09,0x00,0x02,0x02,0x2a,0x01,0x01,0x0a,0x00,0x02,0x03,0x28,0x01,0x08,0x0b,0x00,
+0x02,0x03,0x2a,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x02,0x00,0x28,0x02,
+0x01,0x18,0x0d,0x00,0x02,0x03,0x28,0x01,0x20,0x0e,0x00,0x02,0x05,0x2a,0x00,0x0f,
+0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x00,0x28,0x02,0x04,0x18,0x11,
+0x00,0x02,0x03,0x28,0x01,0x16,0x12,0x00,0x02,0x07,0x2a,0x01,0x00,0x13,0x00,0x02,
+0x02,0x29,0x02,0x00,0x00,0x14,0x00,0x02,0x00,0x28,0x02,0x0f,0x18,0x15,0x00,0x02,
+0x03,0x28,0x01,0x12,0x16,0x00,0x02,0x19,0x2a,0x01,0x38,0x17,0x00,0x02,0x00,0x28,
+0x02,0x0a,0x18,0x18,0x00,0x02,0x03,0x28,0x01,0x02,0x19,0x00,0x02,0x23,0x2a,0x03,
+0x00,0x00,0x00,0x1a,0x00,0x02,0x03,0x28,0x01,0x02,0x1b,0x00,0x02,0x29,0x2a,0x08,
+0x46,0x6c,0x61,0x67,0x74,0x72,0x69,0x70,0x1c,0x00,0x02,0x03,0x28,0x01,0x02,0x1d,
+0x00,0x02,0x24,0x2a,0x06,0x79,0x69,0x63,0x68,0x69,0x70,0x1e,0x00,0x02,0x03,0x28,
+0x01,0x02,0x1f,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,0x20,0x00,0x02,0x03,
+0x28,0x01,0x02,0x21,0x00,0x02,0x26,0x2a,0x03,0x31,0x2e,0x30,0x22,0x00,0x02,0x03,
+0x28,0x01,0x02,0x23,0x00,0x02,0x28,0x2a,0x03,0x31,0x2e,0x30,0x24,0x00,0x02,0x03,
+0x28,0x01,0x02,0x25,0x00,0x02,0x2a,0x2a,0x03,0x31,0x2e,0x30,0x26,0x00,0x02,0x03,
+0x28,0x01,0x02,0x27,0x00,0x02,0x25,0x2a,0x04,0x63,0x6f,0x6d,0x33,0x28,0x00,0x02,
+0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,0xfe,0x43,
+0x53,0x53,0x49,0x29,0x00,0x02,0x03,0x28,0x01,0x12,0x2a,0x00,0x10,0x16,0x96,0x24,
+0x47,0xc6,0x23,0x61,0xba,0xd9,0x4b,0x4d,0x1e,0x43,0x53,0x53,0x49,0x14,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x2b,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x2c,0x00,0x02,0x03,0x28,0x01,
+0x08,0x2d,0x00,0x10,0xb3,0x9b,0x72,0x34,0xbe,0xec,0xd4,0xa8,0xf4,0x43,0x41,0x88,
+0x43,0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x00,0x02,0x03,0x28,0x01,0x04,
+0x2f,0x00,0x10,0xfe,0x69,0xca,0x9a,0x56,0x19,0xf6,0xab,0x02,0x4d,0xaa,0x6d,0x43,
+0x53,0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x02,0x03,0x28,0x01,0x1a,0x31,
+0x00,0x10,0x18,0x03,0xa6,0x28,0x5e,0xd8,0xec,0x91,0x1c,0x48,0xa3,0xac,0x43,0x53,
+0x53,0x49,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x00,
+0x00,0xaa,0x55,0x01,0x00,0x00,0x40,0x02,0xaa,0x55,0x01,0x00,0x17,0x40,0x09,0xaa,
+0x55,0x01,0x00,0x20,0x40,0x28,0xaa,0x55,0x02,0x00,0x27,0x40,0x44,0x02,0xaa,0x55,
+0x01,0x00,0x2a,0x40,0x04,0xaa,0x55,0x01,0x00,0x33,0x40,0x02,0xaa,0x55,0x07,0x00,
+0x76,0x41,0x0f,0x84,0x30,0x0a,0x0b,0xb2,0x32,0xaa,0x55,0x02,0x00,0x57,0x41,0x8b,
+0x0b,0xaa,0x55,0x08,0x00,0xa1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,
+0x55,0x02,0x00,0xbd,0x40,0x02,0x24,0xaa,0x55,0x08,0x00,0xad,0x40,0x40,0x00,0x00,
+0x02,0x32,0x00,0x00,0x02,0xaa,0x55,0x02,0x00,0xbb,0x40,0x20,0x00,0xaa,0x55,0x04,
+0x00,0xb7,0x40,0x20,0x00,0x00,0x20,0xaa,0x55,0x04,0x00,0xbf,0x40,0x80,0x04,0x00,
+0x08,0xaa,0x55,0x05,0x00,0xe2,0x44,0x08,0x0e,0x05,0x04,0x00,0xaa,0x55,0x02,0x00,
+0x02,0x42,0x30,0x1f,0xaa,0x55,0x01,0x00,0x10,0x42,0x20,0xaa,0x55,0x01,0x00,0xe0,
+0x41,0x01,0xaa,0x55,0x0f,0x00,0x16,0x4b,0x4b,0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,
+0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,0x16,0x4b,0x88,
+0x37
 };
Index: rom/program/patch.prog
===================================================================
--- /YC3121_SDK/rom/program/patch.prog	(revision 621)
+++ /YC3121_SDK/rom/program/patch.prog	(working copy)
@@ -37,6 +37,9 @@
 	setarg p_module_bb_event_timer
 	store 2,mem_cb_event_timer
 
+	setarg p_module_le_receive_data
+	store 2,mem_cb_att_write
+
 	call module_lpm_uart_init
 	call module_gpio_init
 	call check_module_disabled
@@ -70,10 +73,34 @@
 	bbit1 UI_STATE_BT_CONNECTED,app_bt_disconnect
 	rtn
 
+p_module_le_receive_data:
+	call module_check_ble_encrypt_state
+	rtn user
+	copy rega,pdata
+	store 2,mem_module_le_rx_data_address
+	copy regb,pdata
+	store 1,mem_module_le_rx_data_len
+	fetcht 2,mem_le_att_handle
+	storet 2,mem_module_le_rx_data_handle
+
+	call le_att_get_handle_info
+	nbranch assert,blank
+	fetch 1,mem_le_cur_uuid_length	//	uuid length
+	bne 0x02,module_hci_event_receive_le_data
+	ifetcht 2,contr
+	setarg CLIENT_CHARACTERTIC_CONFIGURATION
+	isub temp,null
+	rtn zero		//filter ccc handle data
+	branch module_hci_event_receive_le_data
+
 p_module_hci_cmd_control:
 	fetch 1,mem_module_uart_opcode
 	beq HCI_CMD_SLEEP,p_module_hci_cmd_enter_sleep
 	beq HCI_CMD_SET_PAIRING_REQ,p_module_hci_cmd_set_pairing_mode
+	beq HCI_CMD_DELETE_CUSTOMIZE_SERVICE,module_hci_cmd_delete_customize_service
+	beq HCI_CMD_ADD_SERVICE_UUID,module_hci_cmd_add_service_uuid
+	beq HCI_CMD_ADD_CHARACTERISTIC_UUID,module_hci_cmd_add_characteristic_uuid
+	beq HCI_CMD_SET_COD,module_hci_cmd_le_set_adv_data_set_cod
 	branch module_hci_cmd_control + 2
 
 p_module_hci_cmd_set_pairing_mode:
@@ -89,6 +116,109 @@
 	setarg 0x000001
 	branch module_hci_sspairing_mode
 
+module_hci_cmd_delete_customize_service:
+	arg 0x0028,temp
+	call le_att_get_handle_ptr2
+	add contr,-2,contw
+	setarg 0x0000
+	istore 2,contw
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_add_service_uuid:
+	call module_hci_cmd_add_service_uuid_set_uuid
+	call uart_copy_rx_bytes_len_data
+	setarg 0x0000
+	istore 2,contw
+	branch module_hci_event_uuid_handle
+
+module_hci_cmd_add_characteristic_uuid:
+	ifetch 1,contru	//Characteristic
+	call module_hci_cmd_add_characteristic_uuid_set_handle
+	call module_hci_cmd_add_characteristic_uuid_set_uuid
+	branch module_hci_event_uuid_handle
+
+module_hci_cmd_add_service_uuid_set_uuid:
+	call le_att_creat_new_handle
+	setarg 0x280002
+	istore 3,contw
+	rtn
+
+module_hci_cmd_add_characteristic_uuid_set_handle:
+	store 1,mem_pdatatemp
+	call le_att_creat_new_handle
+	setarg 0x01280302
+	istore 4,contw
+	fetch 1,mem_pdatatemp
+	istore 3,contw
+	rtn
+
+module_hci_cmd_add_characteristic_uuid_set_uuid:
+	call le_att_creat_new_handle
+	call uart_copy_rx_bytes_len_data		//uuid
+	call uart_copy_rx_bytes_len_data		//data
+	setarg 0
+	istore 2,contw
+	increase -1,temp
+	call le_att_get_handle_ptr2
+	add contr,4,contr
+	ifetch 1,contr		//characteristic data
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,module_hci_cmd_add_characteristic_uuid_set_ccc_uuid
+	bbit1 BIT_CHARACTERISTIC_INDICATE,module_hci_cmd_add_characteristic_uuid_set_ccc_uuid
+	increase 1,temp
+	rtn
+
+module_hci_cmd_add_characteristic_uuid_set_ccc_uuid:
+	call le_att_creat_new_handle
+	setarg 0x02290202
+	istore 8,contw
+	increase -1,temp
+	rtn
+
+
+uart_copy_rx_bytes_len_data:
+	ifetch 1,contru
+	copy pdata,loopcnt
+	istore 1,contw
+	branch uart_copy_rx_bytes
+
+
+le_att_creat_new_handle:
+	call le_att_get_last_handle
+	istoret 2,contw
+	rtn
+
+//output:temp:new handle num
+//contr:address write data
+le_att_get_last_handle:
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_last_handle_loop:
+	ifetch 2,contr
+	rtn blank
+	add pdata,1,temp
+	ifetch 1,contr
+	iadd contr,contr	
+	ifetch 1,contr			// length
+	iadd contr,contr
+	copy contr,contw
+	branch le_att_get_last_handle_loop
+
+
+//input:temp uuid number
+module_hci_event_uuid_handle:
+	storet 2,mem_temp
+	jam HCI_EVENT_UUID_HANDLE,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	fetcht 2,mem_temp
+	istoret 2,contwu
+	branch uartd_send
+
+module_hci_cmd_le_set_adv_data_set_cod:
+	ifetch 3,contru
+	store 3,mem_class
+	branch module_hci_event_receive_valid_cmd
+
 
 p_module_hci_cmd_enter_sleep:
 	call module_hci_event_receive_valid_cmd
Index: rom/sched/DM_module.dat
===================================================================
--- /YC3121_SDK/rom/sched/DM_module.dat	(revision 621)
+++ /YC3121_SDK/rom/sched/DM_module.dat	(working copy)
@@ -46,7 +46,7 @@
 
 ##############BLUETOOTH CONFIG##############
 ###commom###
-mem_soft_version_num:00 02
+mem_soft_version_num:00 03
 mem_module_state:03
 mem_module_bluetooth_stauts_by_command:07
 mem_class:24 04 04
