Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_pubulic/output/eeprom.dat	(revision 747)
+++ /YC1308AC/branch/mouse_project/mouse_pubulic/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-8e
+ce
 07
 c2
 84
@@ -55,7 +55,7 @@
 c0
 67
 01
-dd
+ed
 c0
 68
 01
@@ -111,7 +111,7 @@
 c0
 76
 01
-da
+ea
 20
 20
 13
@@ -1829,13 +1829,77 @@
 c4
 36
 c0
+05
+01
+cb
+c0
 09
 01
-ca
+da
 20
 20
 1c
 d3
+6f
+e4
+4b
+ab
+c3
+1d
+9d
+e7
+20
+40
+1e
+8d
+68
+49
+44
+37
+6f
+e0
+c3
+c0
+c2
+81
+81
+d5
+6f
+e1
+44
+37
+c0
+18
+1e
+c8
+68
+49
+44
+37
+20
+20
+1d
+eb
+6f
+e1
+43
+d1
+98
+46
+7c
+00
+24
+22
+81
+d1
+24
+34
+01
+d1
+20
+20
+1e
+10
 18
 c2
 22
@@ -1936,8 +2000,8 @@
 20
 3f
 75
-04
-a7
+2d
+58
 aa
 55
 40
@@ -3112,72 +3176,8 @@
 55
 70
 5d
-b9
-c8
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+8b
+07
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-74
-8b
+72
+30
Index: output/flash.dat
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_pubulic/output/flash.dat	(revision 747)
+++ /YC1308AC/branch/mouse_project/mouse_pubulic/output/flash.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-8e
+ce
 07
 c2
 84
@@ -55,7 +55,7 @@
 c0
 67
 01
-dd
+ed
 c0
 68
 01
@@ -111,7 +111,7 @@
 c0
 76
 01
-da
+ea
 20
 20
 13
@@ -1829,13 +1829,77 @@
 c4
 36
 c0
+05
+01
+cb
+c0
 09
 01
-ca
+da
 20
 20
 1c
 d3
+6f
+e4
+4b
+ab
+c3
+1d
+9d
+e7
+20
+40
+1e
+8d
+68
+49
+44
+37
+6f
+e0
+c3
+c0
+c2
+81
+81
+d5
+6f
+e1
+44
+37
+c0
+18
+1e
+c8
+68
+49
+44
+37
+20
+20
+1d
+eb
+6f
+e1
+43
+d1
+98
+46
+7c
+00
+24
+22
+81
+d1
+24
+34
+01
+d1
+20
+20
+1e
+10
 18
 c2
 22
@@ -1936,8 +2000,8 @@
 20
 3f
 75
-04
-a7
+2d
+58
 aa
 55
 40
@@ -3112,72 +3176,8 @@
 55
 70
 5d
-b9
-c8
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+8b
+07
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-74
-8b
+72
+30
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_pubulic/output/program.lis	(revision 747)
+++ /YC1308AC/branch/mouse_project/mouse_pubulic/output/program.lis	(working copy)
@@ -12,7 +12,7 @@
 0009 c06480b1 beq patch19_1 ,p_mouse_setgpio_hibernate 
 000a c06500cf beq patch19_2 ,p_mouse_lpm_before_common 
 000b c0660059 beq patch19_4 ,p_mouse_adc_read_start 
-000c c06701dd beq patch19_6 ,p_mouse_motion 
+000c c06701ed beq patch19_6 ,p_mouse_motion 
 000d c068013e beq patch1a_0 ,p_mouse_seting_dpi 
 000e c06b00ef beq patch1a_6 ,p_mouse_priority_bb_event 
 000f c06c814f beq patch1b_1 ,p_mouse_bb_event_timer 
@@ -28,7 +28,7 @@
 0017 c06001c3 beq patch38_0 ,p_le_parse_l2cap 
 0018 c071012d beq patch3c_2 ,p_g24_pair_dispatch 
 0019 c075009e beq patch3d_2 ,p_g24_transmit_no_interrupt 
-001a c07601da beq patch3d_4 ,p_g24_lpm_wait 
+001a c07601ea beq patch3d_4 ,p_g24_lpm_wait 
 001b 2020137c branch loop 
 
 p_soft_reset:
@@ -578,39 +578,61 @@
 p_le_parse_att:
 01c6 efe18006 ifetch 3 ,contr 
 01c7 67e1c436 store 3 ,mem_le_att_opcode 
-01c8 c00901ca beq attop_write_request ,p_le_parse_att_write_request 
-01c9 20201cd3 branch le_parse_att + 2 
+01c8 c00501cb beq attop_read_request ,p_le_parse_att_read_request 
+01c9 c00901da beq attop_write_request ,p_le_parse_att_write_request 
+01ca 20201cd3 branch le_parse_att + 2 
+
+p_le_parse_att_read_request:
+01cb 6fe44bab fetch mouse_flag_len ,mem_mouse_flag 
+01cc c31d9de7 bbit0 mouse_enable_le_battery_service_cancel ,le_parse_att_read_request 
+01cd 20401e8d call le_check_encrypt_state 
+01ce 68494437 fetcht 2 ,mem_le_att_handle 
+01cf 6fe0c3c0 fetch 1 ,mem_le_configuration 
+01d0 c28181d5 bbit1 bit_ble_read_auth ,p_le_send_att_read_response_check_auth 
+
+p_le_send_att_read_response:
+01d1 6fe14437 fetch 2 ,mem_le_att_handle 
+01d2 c0181ec8 beq 0x30 ,le_send_att_error_response_notfound 
+01d3 68494437 fetcht 2 ,mem_le_att_handle 
+01d4 20201deb branch le_send_att_read_response 
 
-p_le_parse_att_write_request:
-01ca 18c22200 copy contr ,rega 
-01cb 6fe143d4 fetch 2 ,mem_le_l2cap_size 
-01cc 1fe0a5fd add pdata ,-3 ,regb 
-01cd 20401a25 call le_writeatt_cb 
-01ce 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
-01cf c07f9e73 beq 0xff ,le_send_att_write_response_check_auth 
-01d0 6fe0cac7 fetch 1 ,mem_mouse_le_reconnect_flag 
-01d1 203a1e73 branch le_send_att_write_response_check_auth ,blank 
-01d2 6fe0cb75 fetch 1 ,mem_le_connect_status_flag 
-01d3 c2809e73 bbit1 ll_start_enc_flag ,le_send_att_write_response_check_auth 
-01d4 5800001a setarg 0x001a 
-01d5 68494437 fetcht 2 ,mem_le_att_handle 
+p_le_send_att_read_response_check_auth:
+01d5 6fe143d1 fetch 2 ,mem_le_pairing_handle 
 01d6 98467c00 isub temp ,null 
-01d7 24229e73 nbranch le_send_att_write_response_check_auth ,zero 
-01d8 7002d805 jam att_err_insufficient_authentication ,mem_le_err_code 
-01d9 20201ec9 branch le_send_att_error_response 
+01d7 242281d1 nbranch p_le_send_att_read_response ,zero 
+01d8 243401d1 nbranch p_le_send_att_read_response ,user 
+01d9 20201e10 branch le_send_att_read_response_error_insufficient_auth 
+
+p_le_parse_att_write_request:
+01da 18c22200 copy contr ,rega 
+01db 6fe143d4 fetch 2 ,mem_le_l2cap_size 
+01dc 1fe0a5fd add pdata ,-3 ,regb 
+01dd 20401a25 call le_writeatt_cb 
+01de 6fe0cac1 fetch 1 ,mem_mouse_bluetooth_fast_conn_flag 
+01df c07f9e73 beq 0xff ,le_send_att_write_response_check_auth 
+01e0 6fe0cac7 fetch 1 ,mem_mouse_le_reconnect_flag 
+01e1 203a1e73 branch le_send_att_write_response_check_auth ,blank 
+01e2 6fe0cb75 fetch 1 ,mem_le_connect_status_flag 
+01e3 c2809e73 bbit1 ll_start_enc_flag ,le_send_att_write_response_check_auth 
+01e4 5800001a setarg 0x001a 
+01e5 68494437 fetcht 2 ,mem_le_att_handle 
+01e6 98467c00 isub temp ,null 
+01e7 24229e73 nbranch le_send_att_write_response_check_auth ,zero 
+01e8 7002d805 jam att_err_insufficient_authentication ,mem_le_err_code 
+01e9 20201ec9 branch le_send_att_error_response 
 
 p_g24_lpm_wait:
-01da 6fe0cbaa fetch 1 ,mem_24g_device_led_status 
-01db 245a26e1 ncall g24_transmit_by_interrupt_enable ,blank 
-01dc 202026bc branch g24_lpm_wait + 1 
+01ea 6fe0cbaa fetch 1 ,mem_24g_device_led_status 
+01eb 245a26e1 ncall g24_transmit_by_interrupt_enable ,blank 
+01ec 202026bc branch g24_lpm_wait + 1 
 
 p_mouse_motion:
-01dd 78547c00 disable user 
-01de 58000000 setarg 0 
-01df 67e348d1 store 6 ,mem_mouse_x 
-01e0 20404240 call mouse_check_sensor_data 
-01e1 2040408e call mouse_dpi_config 
-01e2 20203f75 branch mouse_motion + 5 
+01ed 78547c00 disable user 
+01ee 58000000 setarg 0 
+01ef 67e348d1 store 6 ,mem_mouse_x 
+01f0 20404240 call mouse_check_sensor_data 
+01f1 2040408e call mouse_dpi_config 
+01f2 20203f75 branch mouse_motion + 5 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/mouse_pubulic/program/patch.prog	(revision 747)
+++ /YC1308AC/branch/mouse_project/mouse_pubulic/program/patch.prog	(working copy)
@@ -627,49 +627,32 @@
 	branch le_parse_l2cap+10
 		
 p_le_parse_att:
-//ifdef BATTERY_SERVICE_CANCEL
-//	call store_contr
-//	call p_mouse_le_reconn_write_enable_timer_reinit
-//	call get_contr
-//endif	
 	ifetch 3,contr
 	store 3,mem_le_att_opcode
-//ifdef BATTERY_SERVICE_CANCEL
-//	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
-//endif
+	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
 	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request	
 	branch le_parse_att+2
 	
-//ifdef BATTERY_SERVICE_CANCEL	
-//p_le_parse_att_read_request:
-//	call le_check_encrypt_state
-//	fetcht 2,mem_le_att_handle
-//	fetch 1,mem_le_configuration
-//	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
+p_le_parse_att_read_request:
+	fetch MOUSE_FLAG_LEN,mem_mouse_flag
+	bbit0 MOUSE_ENABLE_LE_BATTERY_SERVICE_CANCEL,le_parse_att_read_request
+	call le_check_encrypt_state
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
 //input:temp is handle
-//p_le_send_att_read_response:
-//	fetch 2,mem_le_att_handle
-//	beq 0x30,le_send_att_error_response_notfound
-//	fetcht 2,mem_le_att_handle
-//	branch le_send_att_read_response
-
-//p_le_send_att_read_response_check_auth:
-//	fetch 2,mem_le_pairing_handle
-//	isub temp,null
-//	nbranch p_le_send_att_read_response,zero
-//	call le_check_encrypt_state
-//	nbranch p_le_send_att_read_response,user
-//	branch le_send_att_read_response_error_insufficient_auth
-
-//p_mouse_le_reconn_write_enable_timer_reinit:
-//	fetch 1,mem_mouse_le_reconnect_flag
-//	rtn blank
-//	fetch 1,mem_le_connect_status_flag
-//	and pdata,0x03,pdata
-//	rtneq 0x03
-//	jam 2,mem_le_start_encrypt_timer
-//	rtn
-//endif
+p_le_send_att_read_response:
+	fetch 2,mem_le_att_handle
+	beq 0x30,le_send_att_error_response_notfound
+	fetcht 2,mem_le_att_handle
+	branch le_send_att_read_response
+
+p_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch p_le_send_att_read_response,zero
+	nbranch p_le_send_att_read_response,user
+	branch le_send_att_read_response_error_insufficient_auth
 
 
 p_le_parse_att_write_request:		// mac os 10.9.5 reconnect can't move
