Index: BlueTooth/BT_code_patch/key/trunk/do.bat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/do.bat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/do.bat	(working copy)
@@ -0,0 +1,241 @@
+cls
+@echo off
+
+::get Rom path
+set now_path=%~dp0
+call:getstrlocation %now_path% ModuleDemo location
+call:get_fix_len_str  %now_path% location soft_path
+set lib_path=%soft_path%Librarier
+set rom_path=%lib_path%\bt_rom
+set program=%rom_path%\program
+set format=%rom_path%\format
+set util=%rom_path%\util
+set patch_path=%now_path%patch
+set sched=%now_path%sched
+set format_ex=%now_path%format
+
+rem @echo rom_path=%rom_path%
+rem @echo program_path=%program%
+rem @echo format_path=%format%
+rem @echo util_path=%util%
+rem @echo patch_path=%patch_path%
+
+setlocal enabledelayedexpansion
+set progs=""
+for /f %%f in ('dir /b /o %program%\*.prog') do @if not %%f==bt.prog if not %%f==patch.prog if not %%f==sim.prog set progs=!progs! + %program%\%%f
+copy %program%\bt.prog + %progs%  output\bt_program23.meta > output\1
+
+set fmts=""
+for /f %%f in ('dir /b /o %format%\*.format') do @if not %%f==bt.format if not %%f==command.format set fmts=!fmts! + %format%\%%f
+copy %format%\bt.format + %fmts%  + %format_ex%\app_module.format + %format_ex%\bt.format + %format_ex%\le.format + %format_ex%\utility.format + %format%\command.format output\bt_format.meta > output\2
+
+perl %util%/mergepatch.pl 				output/bt_program23.meta %patch_path%
+perl %util%/memalloc.pl 				output/bt_format.meta
+
+cd output
+osiuasm bt_program23 -O-W
+copy ..\sched\DM_module.dat  + ..\sched\109x.dat ..\output\sched.rom
+Creat_patch_Module
+if "%1" equ "eep" (
+	goto genromrevc
+)else (
+  goto downloadram
+)
+
+:genromrevc
+echo off
+@echo Start to generate EEPROM code
+geneep -n
+
+
+:gen_eep_end
+cd ..
+echo **********************************
+echo EEPROM Generated.
+echo Use command "e fp" to download EEPROM.
+echo **********************************
+goto end
+
+
+
+:genrom
+@rem echo on
+perl ..\util\rom2mif.pl romcode
+del ..\..\%FPGA_PATH%\romcode.mif
+copy .\romcode.mif ..\..\%FPGA_PATH%\romcode.mif
+perl ..\util\gen_patch_h.pl >%YC_PATCH_FILE%
+copy .\%YC_PATCH_FILE% ..\..\%MV_PATCH%\%YC_PATCH_FILE%
+copy .\%YC_PATCH_FILE% D:\work\yichip\mv_proj\src\inc\%YC_PATCH_FILE%
+cd ..\..\%FPGA_PATH%
+quartus_cdb btspi -c btspi --update_mif
+quartus_asm --read_settings_files=off --write_settings_files=off btspi -c btspi
+quartus_pgm -c USB-Blaster[USB-0] -m jtag -o "p;.\output\btspi.sof" 
+@echo bitstream_compression=on >1
+@echo memory_map_file=on >> 1
+quartus_cpf -c -o 1 -s EP3C55 -d EPCS16 output\btspi.sof output\btspi.jic  
+@rem quartus_pgm -c USB-Blaster[USB-0] -m jtag -o "pi;.\output\btspi.jic"   
+@del 1
+goto end
+
+
+
+:downloadram
+echo on
+@echo Start to download ram code
+e ku
+e hu
+e su sched.rom
+@echo **********************************
+@echo RAM CODE has been downloaded. 
+@echo **********************************
+cd ..
+
+
+:end
+echo create bt_code.c file
+perl %util%/rom2h.pl  <.\output\eeprom.dat>  .\output\bt_code.c
+goto:eof
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+::------------------------------------------
+::---------------func:getstrlocation-------
+::------------------------------------------
+:getstrlocation
+setlocal
+set "bstr=%1"
+set "cstr=%2"
+set %3=0
+set "num=0"
+set "len_bstr=0"
+set "len_cstr=0"
+
+call:getstrlen %bstr% len_bstr
+call:getstrlen %cstr% len_cstr
+
+:getstrlocation_next
+set /a len_remain=len_bstr-num
+if %len_remain% lss %len_cstr% (
+echo "cann't get str location"
+set /a num =0
+goto getstrlocation_last
+)
+
+call:get_fix_len_str %bstr%  len_cstr compar_str
+
+if not %compar_str%==%cstr% (
+set /a num+=1
+set "bstr=%bstr:~1%"
+goto getstrlocation_next
+)
+
+:getstrlocation_last
+(endlocal
+	set %3=%num%
+)
+goto:eof
+::---------------end:func-------------------
+
+
+::------------------------------------------
+::---------------func:get_fix_len_str-------
+::------------------------------------------
+:get_fix_len_str
+setlocal
+set "getstr=%NULL%"
+set str=%1
+set /a len=%2
+set num=0
+:get_fix_len_str_loop
+set getstr=%getstr%%str:~0,1%
+set /a num+=1
+set str=%str:~1%
+if %num% lss %len% goto get_fix_len_str_loop
+(endlocal
+ set %3=%getstr%
+)
+goto:eof
+::---------------end:func-------------------
+
+
+
+
+::------------------------------------------
+::---------------func:getstrlen-------------
+::------------------------------------------
+:getstrlen
+setlocal
+set str=%1
+set %2=0
+set /a "num=0"
+
+:getstrlen_next
+if "%str%"=="" goto getstrlen_last
+
+if not "%str%"=="" (
+set /a num+=1 
+set "str=%str:~1%"
+goto getstrlen_next
+)
+
+:getstrlen_last
+(endlocal
+	set /a "%2=%num%"
+)
+goto:eof
+::---------------end:func-------------------
+
+
+
+
+::------------------------------------------
+::---------------func:getcharlocation-------
+::------------------------------------------
+:getcharlocation
+setlocal
+set "str=%1"
+set "ch=%2"
+set %3=0
+set /a "num=0"
+
+:getcharnext
+if "%str%"=="" ( 
+set /a num=0
+goto getcharlast
+)
+
+if not "%str%"=="" (
+set /a num+=1
+if "%str:~0,1%"=="%ch%" goto getcharlast
+set "str=%str:~1%"
+goto getcharnext
+)
+:getcharlast
+(endlocal
+set %3=%num%
+)
+goto:eof 
+::---------------end:func-------------------
+
+
+
+
+
+
Index: BlueTooth/BT_code_patch/key/trunk/format/app_module.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/app_module.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/app_module.format	(working copy)
@@ -0,0 +1,126 @@
+bmemalloc(
+	0 mem_module_prepare_write_request_packet
+	2 mem_module_prepare_write_request_PDU_length
+	2 mem_module_prepare_write_request_Channel_ID
+	1 mem_module_prepare_write_request_opcode
+	2 mem_module_prepare_write_request_handle
+	260 mem_temp_prepare_write_request_Data
+	260 mem_le_l2capbuf_new
+	0 mem_le_l2capbuf_new_end
+	464 mem_smp_buf_temp
+	0 mem_end1
+)
+omemalloc(
+	2 mem_soft_version_num
+
+	2 mem_current_packet_length
+	1 mem_module_state
+	
+	1 mem_module_spp_lpm_mult
+	1 mem_module_le_lpm_mult	
+	1 mem_module_bluetooth_stauts_by_command
+
+	//ble
+	1 mem_module_le_rx_data_len
+	2 mem_module_le_rx_data_address
+	2 mem_module_le_rx_data_handle
+	//ble write handle
+	2 mem_module_data_write_handle
+	2 mem_module_data_write_handle2
+	//flag
+	1 mem_module_flag
+
+	1 mem_module_hci_notify_len
+	2 mem_module_hci_notify_handle
+	2 mem_module_hci_nofiy_addr
+
+	4 mem_last_transmite_clock	
+	0 mem_module_uuid_list_end
+	450 mem_module_le_att_list
+	0 mem_module_le_att_list_end
+	0 mem_module_nv_data
+	34 mem_module_nv_data0
+	34 mem_module_nv_data1
+	34 mem_module_nv_data2
+	34 mem_module_nv_data3
+	34 mem_module_nv_data4
+	34 mem_module_nv_data5
+	34 mem_module_nv_data6
+	34 mem_module_nv_data7
+	
+
+	2 mem_le_buff_len
+	2 mem_le_buff_len_all	
+
+	1 mem_ipcbuf_bt2m0_flag
+	2 mem_ipcbuf_bt2m0_write
+	2 mem_ipcbuf_bt2m0_read
+	
+	1 mem_context_cnt
+	1 mem_context_map
+	80 mem_context_new
+	80 mem_context_new2
+	80 mem_context_new3
+	80 mem_context_new4
+	80 mem_context_new5
+	80 mem_context_new6
+	80 mem_context_new7
+	80 mem_context_new8
+	
+	608 mem_context_extend 
+	// (39+37)*8
+	
+	1 mem_le_pairing_sm_flag
+	1 mem_le_fifo_error
+	
+	0 mem_end2
+	// Be aware of memory boundaries  limit 0x4bff
+)
+(//mem_ble_dle_enable
+0x00 DLE_ENABLE
+0x01 DLE_DISABLE
+)
+
+
+(
+80 BLE_L2CAP_TX_BUFF_SIZE
+
+8 CONTEXT_NUM_NEW
+//144 context_size_tx_buf
+76 CONTEXT_SIZE_EXTEND
+58 CONTEXT_SMP
+)
+
+(
+249 LE_BASEBAND_MAX_BUFFER
+)
+(//mem_module_flag
+//bit3~bit7 module states change
+3 MODULE_RECEIVE_COMPLETE_PREPARE_WRITE_REQ
+
+7 MODULE_RECV_CONFIRM
+)
+
+(
+	0x200 UART_AIR_CONTROL_THRESHOLD
+)
+(//Command
+
+0x15 HCI_CMD_SET_COD
+0x76 HCI_CMD_DELETE_CUSTOMIZE_SERVICE
+0x77 HCI_CMD_ADD_SERVICE_UUID
+0x78 HCI_CMD_ADD_CHARACTERISTIC_UUID
+
+0xfe HCI_CMD_ALL_ROUND
+)
+
+(//event
+
+0x29 HCI_EVENT_UUID_HANDLE
+
+)
+
+(
+0x44 BT_EVT_LE_CONN_PARAM_UPDATE
+)
+
Index: BlueTooth/BT_code_patch/key/trunk/format/bt.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/bt.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/bt.format	(working copy)
@@ -0,0 +1,6 @@
+
+/* ============== mark ============= *//*0 - 47 */
+(
+
+44 mark_buf_full
+)
Index: BlueTooth/BT_code_patch/key/trunk/format/le.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/le.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/le.format	(working copy)
@@ -0,0 +1,20 @@
+
+
+	/* LE control packet type */
+	(
+
+	0x14 LL_LENGTH_REQ
+	0x15 LL_LENGTH_RSP
+	)
+(
+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: BlueTooth/BT_code_patch/key/trunk/format/utility.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/utility.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/format/utility.format	(working copy)
@@ -0,0 +1,111 @@
+
+bmemalloc(
+1 mem_usb_status
+1 mem_usb_fifo_empty
+1 mem_usb_read_len
+64 mem_usb_rxbuf
+2 mem_bufptr
+1 mem_remain
+20 mem_devicedesc
+2 mem_hidreportdesc_kb
+2 mem_hidreportdesc_m
+100 mem_confdesc
+5 mem_string0
+30 mem_string1
+64 mem_string2
+30 mem_string3
+2 mem_usb_zero_packet
+2 mem_usb_ones_packet
+2 mem_usb_two_packet
+1 mem_usb0_state
+
+1 mem_usb_offline_check_gpio
+1 mem_usb_tx_interval
+
+0 mem_usb_clear_mem_start
+0 mem_usb_setup
+1 mem_usb_setup_bmRequestType
+1 mem_usb_setup_bRequest
+1 mem_usb_setup_bValue
+1 mem_usb_setup_bValueH
+2 mem_usb_setup_wIndex
+1 mem_usb_setup_bLength
+1 mem_usb_setup_bLengthH
+64 mem_usb0_setup
+64 mem_usb0_set_report_data
+64 mem_usb0_get_report_data
+1 mem_usb_state
+1 mem_usb_tx_wait
+1 mem_usb_tx_enable
+1 mem_usb_remote_wakeup
+1 mem_usb_clear_remote_wakeup
+1 mem_usb_ep0_stall_status
+1 mem_usb_ep1_stall_status
+1 mem_usb_ep2_stall_status
+1 mem_usb_ep3_stall_status
+2 mem_dsc_info_data_pointer
+1 mem_dsc_info_len
+1 mem_usb0_data_ready_report
+1 mem_usb_tx_win_enable
+1 mem_usb_tx_mac_enable
+1 mem_usb_device_enumeration_endflag
+1 mem_usb_wakestate_onetime_flag
+1 mem_usb_mac_wakeup_trig
+1 mem_usb_set_high_addr_flag
+1 mem_usb_set_protocol_value
+1 mem_usb_set_protocol_status
+1 mem_usb_get_protocol_flag
+1 mem_usb_idle_flag
+1 mem_usb_idle_rate
+2 mem_usb_setup_bValue_temp
+1 mem_usb0_get_set_report
+1 mem_usb_ep1_data
+1 mem_usb_ep2_data
+1 mem_usb_clear_halt
+16 mem_usb_mouse_data
+16 mem_usb_kb_data
+16 mem_usb_kb_multikey
+8 mem_usb_kb_data_sta_data
+8 mem_usb_kb_data_last_data
+3 mem_usb_kb_multikey_sta_data
+3 mem_usb_kb_multikey_last_data
+1 mem_usb_kb_blank_data_enable
+1 mem_usb_kb_mul_blank_data_enable
+1 mem_usb_test_cnt
+0 mem_usb_clear_mem_end
+1 mem_usb_test_kb
+
+256 mem_rssi_noise_buffer
+256 mem_rssi_noise_dg_buffer
+256 mem_rssi_noise_ms_buffer
+256 mem_rssi_noise_kb_buffer
+32 mem_24g_common_temp
+
+
+)
+(// mem_bb_flag
+0 OLD_PACKET				//0:new packet   1: old packet  
+1 USE_BB_BUFFER_NOW		//0:BB BUFFER1  1:BB BUFFER2
+)
+(
+0 CACHE_BUFFER_FLAG
+1 CACHE_BUFFER_LCH
+2 CACHE_BUFFER_LEN
+4 CACHE_BUFFER_DATA_PTR
+
+
+)
+(
+0x0b1b mem_bb_cache_bufptr
+0x0b1d mem_bb_flag
+
+0x0b20 mem_baseband_buffer1_flag
+0x0b21 mem_baseband_buffer1_lch
+0x0b22 mem_baseband_buffer1_len
+0x0b24 mem_baseband_buffer1
+
+0x0c20 mem_baseband_buffer2_flag
+0x0c21 mem_baseband_buffer2_lch
+0x0c22 mem_baseband_buffer2_len
+0x0c24 mem_baseband_buffer2 
+)
Index: BlueTooth/BT_code_patch/key/trunk/output/bt_code.c
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/output/bt_code.c	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/output/bt_code.c	(working copy)
@@ -0,0 +1,302 @@
+const unsigned char bt_code[] = {
+0x00,0x02,0xaa,0x55,0xee,0x0e,0xc2,0x84,0x00,0x15,0xc0,0x00,0x80,0x40,0xc0,0x02,
+0x83,0xa5,0xc0,0x15,0x03,0x2e,0xc0,0x15,0x83,0x51,0xc0,0x16,0x03,0x7d,0xc0,0x17,
+0x03,0xa2,0xc0,0x42,0x80,0x46,0xc0,0x44,0x80,0x67,0xc0,0x4a,0x00,0x26,0xc0,0x51,
+0x00,0x70,0xc0,0x51,0x80,0x31,0xc0,0x54,0x80,0x34,0xc0,0x56,0x00,0x77,0xc0,0x5c,
+0x00,0x78,0xc0,0x5d,0x80,0xc3,0xc0,0x5e,0x00,0xb0,0xc0,0x75,0x83,0x22,0xc0,0x79,
+0x83,0x24,0xc0,0x7b,0x03,0x29,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x81,0x4c,0xc0,0x02,
+0x81,0x58,0xc0,0x08,0x01,0x49,0xc0,0x0e,0x02,0x10,0xc0,0x11,0x02,0x19,0xc0,0x11,
+0x82,0x75,0xc0,0x12,0x82,0x7b,0xc0,0x19,0x81,0x76,0xc0,0x1a,0x81,0xa2,0xc0,0x1d,
+0x02,0x85,0xc0,0x1f,0x02,0x90,0xc0,0x20,0x82,0xa2,0xc0,0x29,0x02,0xa8,0xc0,0x4c,
+0x82,0xbc,0xc0,0x4f,0x82,0xc8,0xc0,0x50,0x82,0xc0,0x20,0x20,0x4a,0x8b,0x18,0x42,
+0x7e,0x00,0x20,0x40,0x7d,0x2b,0x1c,0x30,0x7e,0x00,0x79,0x20,0x7e,0x2c,0x20,0x40,
+0x7d,0x14,0x79,0x3f,0xfe,0x2c,0x20,0x40,0x4a,0x76,0x20,0x40,0x7d,0x14,0x20,0x74,
+0x00,0x00,0x20,0x40,0x00,0x3d,0x20,0x20,0x4a,0x2f,0x1b,0x42,0x7e,0x00,0x20,0x40,
+0x00,0x3c,0x20,0x20,0x4a,0xe9,0x6f,0xe4,0x40,0x4e,0x1f,0xe3,0x7e,0x00,0x20,0x40,
+0x7d,0x2b,0x1e,0x02,0x7e,0x00,0x20,0x40,0x7d,0x14,0x1b,0x42,0x04,0x00,0x20,0x40,
+0x00,0x3c,0x20,0x20,0x4b,0x67,0x20,0x40,0x7d,0x14,0x98,0x00,0x0c,0x00,0x79,0x3f,
+0x8c,0x10,0x20,0x20,0x7d,0x1f,0x20,0x40,0x68,0xc4,0x20,0x40,0x60,0xd7,0x20,0x40,
+0x00,0x44,0x20,0x20,0x40,0x0a,0x20,0x75,0x80,0x00,0x20,0x20,0x7b,0x9a,0x20,0x30,
+0x80,0x56,0x70,0x89,0x55,0xd4,0x20,0x00,0x00,0x04,0x70,0x89,0x55,0xd2,0x20,0x00,
+0x00,0x04,0x70,0x89,0x55,0xd1,0x20,0x00,0x00,0x04,0x6f,0xe2,0x41,0xdf,0xc0,0x00,
+0x00,0x54,0xc0,0x00,0x80,0x64,0xc0,0x01,0x00,0x54,0xc0,0x01,0x80,0x64,0xc0,0x02,
+0x00,0x64,0xc0,0x10,0x00,0x64,0x70,0x89,0x55,0xd0,0x70,0x89,0x56,0xe0,0x18,0x00,
+0x2a,0x08,0x18,0x00,0x2a,0x00,0x78,0x50,0xfc,0x00,0x78,0x50,0x7c,0x00,0x78,0x2f,
+0x7c,0x00,0x70,0x89,0x02,0x00,0x70,0x89,0x01,0x00,0x70,0x89,0x00,0x00,0x70,0x89,
+0x03,0x00,0x70,0x89,0x04,0x70,0x6f,0xe2,0x89,0x06,0x79,0x20,0x7e,0x00,0x67,0xe2,
+0x89,0x06,0x20,0x60,0x00,0x00,0x70,0x89,0x55,0xd0,0x70,0x89,0x56,0xc0,0x20,0x20,
+0x00,0x56,0x60,0x42,0x00,0x17,0x20,0x40,0x49,0x2a,0x20,0x40,0x49,0x80,0x58,0x00,
+0x05,0x00,0x20,0x40,0x4a,0x8e,0x6f,0xe2,0x89,0x06,0x79,0x20,0x7e,0x00,0x67,0xe2,
+0x89,0x06,0x20,0x20,0x49,0x37,0x70,0x89,0x06,0x7c,0x20,0x75,0x80,0x00,0x58,0x00,
+0x00,0x00,0x67,0xe4,0x41,0xdd,0x1c,0x43,0x7e,0x00,0x67,0xe8,0x40,0x94,0x20,0x60,
+0x00,0x00,0x20,0x20,0x4b,0x7f,0x58,0x00,0x00,0x00,0x67,0xe4,0x41,0xf6,0x67,0xe4,
+0x41,0xfe,0x58,0x00,0x00,0x87,0x67,0xe4,0x41,0xfa,0x58,0x00,0x4d,0xbd,0x67,0xe4,
+0x41,0xea,0x58,0x00,0x00,0x9a,0x67,0xe4,0x41,0xf2,0x58,0x00,0x00,0x9d,0x67,0xe4,
+0x45,0x41,0x20,0x40,0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,
+0x50,0x4d,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,0x70,0x0a,
+0xff,0x08,0x6f,0xe2,0x46,0x70,0x1f,0xe2,0x72,0x00,0x1f,0xe0,0xfe,0x03,0x20,0x40,
+0x50,0xa5,0x6f,0xe2,0x04,0x51,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x50,0x47,0x20,0x40,
+0x00,0x9c,0x20,0x20,0x50,0xd3,0x20,0x20,0x4d,0xc8,0x20,0x40,0x4d,0xd7,0x70,0x0a,
+0xff,0x07,0x6f,0xe4,0x04,0xfb,0x20,0x7a,0x00,0x00,0xd8,0x40,0x00,0xff,0x20,0x40,
+0x7d,0xb5,0x1f,0xe2,0x72,0x00,0x6f,0xe4,0x04,0xfb,0x9f,0x26,0x7e,0x00,0x67,0xe4,
+0x04,0xfb,0x1f,0x22,0x7e,0x00,0x20,0x40,0x50,0xa5,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,
+0x0c,0x00,0x20,0x40,0x67,0xc1,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x04,0xfd,0x20,0x40,
+0x67,0xb9,0x20,0x20,0x00,0x9e,0x18,0x40,0xff,0xfd,0x68,0x42,0x46,0x7a,0x20,0x40,
+0x7d,0xb5,0x1f,0xe2,0x22,0x00,0x18,0x42,0x7e,0x00,0x9a,0x26,0x7e,0x00,0x67,0xe2,
+0x46,0x7a,0x68,0x44,0x46,0x7b,0x20,0x40,0x5e,0x44,0x6f,0xe4,0x46,0x7d,0x1f,0xe2,
+0x06,0x00,0x1a,0x22,0x72,0x00,0x20,0x40,0x67,0xda,0x20,0x40,0x02,0x53,0x18,0x62,
+0x7e,0x00,0x67,0xe4,0x46,0x7d,0x6f,0xe2,0x46,0x7a,0x24,0x7a,0x00,0x00,0x20,0x20,
+0x50,0xde,0x6f,0xe2,0x0a,0xff,0xc0,0x04,0x81,0x0d,0xc0,0x13,0x81,0x43,0xc0,0x13,
+0x00,0xed,0xc0,0x1b,0x00,0xca,0xc0,0x1c,0x00,0xd6,0x20,0x20,0x4e,0x5c,0x20,0x40,
+0x5c,0x72,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x0b,0x00,0xc0,0x84,0xd0,0x1c,0x20,0x40,
+0x00,0xf9,0x24,0x7a,0x00,0x00,0x70,0x0b,0x01,0x01,0xef,0xf0,0x00,0x03,0x67,0xf0,
+0x44,0x68,0x20,0x40,0x5e,0x9f,0x20,0x40,0x02,0x53,0x20,0x20,0x50,0x1f,0x20,0x40,
+0x5c,0x72,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x44,0x98,0x20,0x3a,0x50,0x1c,0x20,0x40,
+0x00,0xf9,0x24,0x7a,0x00,0x00,0x70,0x0b,0x01,0x01,0xef,0xe2,0x00,0x02,0xc2,0x82,
+0x50,0x1c,0x20,0x40,0x50,0x1f,0x20,0x40,0x5e,0xe2,0x20,0x20,0x02,0x53,0xda,0x60,
+0x00,0xe4,0x20,0x20,0x42,0x5d,0xc3,0x00,0x42,0x62,0x1a,0x20,0x8c,0x01,0xef,0xe2,
+0x00,0x06,0xc3,0x00,0x42,0x62,0x1a,0x20,0x8c,0x16,0xef,0xe2,0x00,0x06,0x98,0x46,
+0x7c,0x00,0x20,0x62,0x80,0x00,0x20,0x20,0x42,0x62,0x6f,0xe2,0x0b,0x00,0x1f,0xe2,
+0x72,0x00,0x1f,0x20,0xf3,0xfe,0x1a,0x22,0x06,0x00,0x6f,0xe4,0x42,0x14,0xe8,0x44,
+0x00,0x03,0x98,0x40,0x8a,0x00,0x20,0x40,0x67,0xda,0x20,0x20,0x50,0x1f,0x68,0x42,
+0x04,0x51,0x98,0x46,0x7c,0x00,0x20,0x60,0x00,0x00,0x1a,0x22,0x6e,0x00,0xe8,0x42,
+0x00,0x03,0x20,0x40,0x01,0x02,0x24,0x22,0x81,0x09,0x70,0x0b,0x01,0x00,0x60,0x42,
+0x04,0x51,0x1a,0x22,0x04,0x00,0x1e,0xe2,0x22,0x00,0x20,0x20,0x7d,0xc9,0xda,0x60,
+0x01,0x04,0x20,0x20,0x42,0x5d,0xc3,0x00,0x42,0x62,0x1a,0x20,0x8c,0x01,0xef,0xe2,
+0x00,0x06,0xc3,0x00,0x42,0x62,0x20,0x20,0x42,0x72,0x20,0x40,0x01,0x0b,0x20,0x20,
+0x7d,0xc7,0x70,0x0b,0x01,0x01,0x20,0x20,0x50,0x1c,0x20,0x40,0x00,0xf9,0x24,0x7a,
+0x00,0x00,0x1a,0x22,0x06,0x00,0x70,0x0b,0x01,0x00,0x6f,0xe2,0x46,0x79,0xc2,0x82,
+0x4e,0xf1,0x6f,0xe2,0x46,0x7a,0x24,0x7a,0x00,0x00,0x70,0x0b,0x01,0x01,0xef,0xe2,
+0x00,0x03,0xef,0xe4,0x00,0x03,0x67,0xe4,0x46,0x7b,0x18,0x62,0x7e,0x00,0x67,0xe4,
+0x46,0x7d,0x6f,0xe2,0x0b,0x00,0x1f,0xe0,0xff,0xfd,0x24,0x21,0x50,0x1c,0x20,0x22,
+0xd0,0x1c,0x67,0xe2,0x46,0x7a,0x70,0x0b,0x01,0x00,0x20,0x40,0x4e,0xf4,0x20,0x40,
+0x4e,0xf4,0x20,0x40,0x4e,0xf4,0x6f,0xe2,0x46,0x79,0xc4,0x02,0x00,0x00,0x20,0x20,
+0x4e,0xf1,0xef,0xe2,0x00,0x03,0x1f,0xe2,0x72,0x00,0xe7,0xe2,0x00,0x05,0x20,0x20,
+0x67,0xed,0x20,0x40,0x01,0x2e,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,0x01,0x30,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,0x70,0x46,0x7a,0x00,0x70,0x0b,
+0x01,0x01,0x20,0x40,0x50,0xe0,0x20,0x20,0x50,0x1c,0x70,0x0a,0x95,0x44,0x20,0x40,
+0x7b,0xab,0x20,0x20,0x59,0x57,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,0xe2,0x72,0x00,0x20,0x3a,
+0x58,0x8b,0x20,0x20,0x58,0x87,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,0x70,0x49,0x59,0x00,0x68,0x44,
+0x4f,0xf0,0x6f,0xe4,0x4f,0xf2,0x98,0x46,0x22,0x00,0x68,0x44,0x4f,0xf4,0x6f,0xe4,
+0x4f,0xf6,0x60,0x44,0x49,0x5c,0x67,0xe4,0x49,0x5a,0x98,0x46,0x7e,0x00,0x20,0x21,
+0x01,0x71,0x20,0x22,0x81,0x71,0x1a,0x22,0x04,0x00,0x6f,0xe4,0x49,0x5a,0x98,0x40,
+0xfe,0x00,0x68,0x44,0x49,0x5c,0x98,0x46,0x7e,0x00,0xd8,0x40,0x03,0x00,0x98,0x46,
+0x7c,0x00,0x24,0x61,0x00,0x00,0x70,0x49,0x59,0x01,0x20,0x60,0x00,0x00,0x20,0x40,
+0x5c,0x72,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x44,0x96,0xc0,0x00,0x5f,0xcf,0xc0,0x00,
+0x81,0x92,0xc0,0x01,0x5f,0xcf,0xc0,0x01,0x81,0x82,0xc0,0x02,0x81,0x95,0xc0,0x03,
+0x81,0x90,0xc0,0x04,0x01,0x88,0xc0,0x04,0x81,0x84,0x20,0x60,0x00,0x00,0x70,0x44,
+0x96,0x04,0x20,0x20,0x5b,0xf6,0x20,0x40,0x5b,0xf4,0x20,0x40,0x5f,0x80,0x20,0x40,
+0x02,0x53,0x20,0x20,0x5f,0xf2,0x6f,0xe2,0x44,0x24,0x68,0x42,0x44,0x2b,0x98,0x41,
+0x7e,0x00,0x2f,0xec,0x00,0x01,0x20,0x20,0xdf,0xf2,0x70,0x44,0x96,0x09,0x20,0x40,
+0x5f,0x78,0x20,0x20,0x02,0x53,0x20,0x40,0x5f,0xe7,0x20,0x20,0x02,0x53,0x70,0x44,
+0x96,0x02,0x20,0x40,0x5e,0xe2,0x20,0x20,0x02,0x53,0x6f,0xe2,0x44,0x97,0xc0,0x02,
+0x01,0x98,0x20,0x60,0x00,0x00,0x70,0x44,0x96,0x07,0x70,0x0a,0x95,0x29,0x20,0x40,
+0x7b,0xab,0x20,0x40,0x5f,0x62,0x20,0x40,0x02,0x53,0x6f,0xe2,0x40,0x92,0xc1,0x85,
+0x00,0x00,0x20,0x40,0x5f,0x99,0x20,0x74,0x00,0x00,0x20,0x20,0x4d,0x8b,0x6f,0xe2,
+0x02,0xd7,0xc0,0x00,0x60,0x5c,0xc0,0x00,0xe0,0x64,0xc0,0x01,0x60,0x6f,0xc0,0x01,
+0x81,0xc8,0xc0,0x02,0x60,0xc2,0xc0,0x02,0xe0,0xc7,0xc0,0x03,0x01,0xc6,0xc0,0x03,
+0xe0,0xd6,0xc0,0x04,0x01,0xc4,0xc0,0x04,0xe0,0xd6,0xc0,0x05,0x01,0xbf,0xc0,0x05,
+0xe0,0xd6,0xc0,0x06,0x01,0xbd,0xc0,0x06,0xe0,0xd6,0xc0,0x09,0x01,0xbb,0xc0,0x09,
+0xe0,0xd6,0xc0,0x0a,0x01,0xdc,0xc1,0x0a,0x80,0x00,0xda,0x20,0x00,0x02,0xda,0x40,
+0x00,0x07,0x20,0x40,0x5c,0x22,0x6f,0xe2,0x02,0xd7,0xe7,0xe2,0x00,0x05,0x20,0x60,
+0x00,0x00,0x20,0x40,0x60,0x87,0x20,0x20,0x02,0x53,0x20,0x40,0x60,0x80,0x20,0x20,
+0x02,0x53,0x70,0x44,0x97,0x02,0x20,0x40,0x60,0xd4,0x20,0x40,0x02,0x53,0x70,0x0a,
+0x95,0x33,0x20,0x20,0x7b,0xab,0x20,0x40,0x60,0x7a,0x20,0x20,0x02,0x53,0x20,0x40,
+0x60,0xcc,0x20,0x20,0x02,0x53,0xef,0xf0,0x00,0x06,0x67,0xf0,0x44,0x9f,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x44,0x9d,0xef,0xf0,0x00,0x06,0x67,0xf0,0x44,0x7c,0xef,0xe8,
+0x00,0x06,0x67,0xe8,0x43,0xe3,0x20,0x40,0x60,0xb0,0x20,0x40,0x02,0x53,0x6f,0xe2,
+0x44,0x96,0xc0,0x02,0x81,0xd8,0x6f,0xe2,0x42,0x16,0x24,0x5a,0x68,0xb0,0x6f,0xe2,
+0x43,0xfb,0xc0,0x00,0x60,0xa5,0x70,0x44,0x97,0x01,0x20,0x40,0x60,0xbe,0x20,0x40,
+0x02,0x53,0x20,0x20,0x72,0x58,0xda,0x20,0x00,0x09,0xda,0x40,0x00,0x15,0x20,0x40,
+0x5c,0x22,0x58,0x00,0x00,0x1b,0xe7,0xe4,0x00,0x05,0x58,0x00,0x08,0x48,0xe7,0xe4,
+0x00,0x05,0x58,0x00,0x00,0x1b,0xe7,0xe4,0x00,0x05,0x58,0x00,0x08,0x48,0xe7,0xe4,
+0x00,0x05,0x20,0x20,0x02,0x53,0xef,0xe2,0x00,0x06,0x98,0xc0,0x8c,0x00,0x18,0xc0,
+0x8c,0x02,0xef,0xe2,0x00,0x06,0x20,0x3a,0x4a,0x8b,0x68,0x42,0x04,0x51,0x98,0x46,
+0x7c,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x5c,0x53,0x20,0x7a,0x00,0x00,0x18,0xc2,
+0x22,0x00,0x20,0x40,0x01,0xe8,0x20,0x22,0xfd,0xc7,0x20,0x40,0x01,0xfd,0x24,0x22,
+0x81,0xf8,0x20,0x20,0x7d,0xc9,0x6f,0xe2,0x4e,0x41,0x1f,0xe0,0xfe,0x01,0x67,0xe2,
+0x4e,0x41,0x20,0x40,0x5c,0x76,0x20,0x20,0x7d,0xc9,0x20,0x20,0x42,0x54,0x20,0x40,
+0x5c,0x56,0x20,0x7a,0x00,0x00,0x20,0x40,0x01,0xe8,0x20,0x22,0xfd,0xc7,0x20,0x20,
+0x7d,0xc9,0xef,0xe2,0x00,0x06,0xe8,0x42,0x00,0x06,0x98,0x46,0x7e,0x00,0x1f,0xe6,
+0x7c,0x1b,0x20,0x21,0x5a,0x2c,0x20,0x20,0x5a,0x2a,0x20,0x40,0x02,0x03,0xc6,0x14,
+0x80,0x00,0x6f,0xe2,0x44,0xbb,0xc3,0x01,0x5a,0x2c,0x20,0x40,0x01,0xfe,0x20,0x3a,
+0x5a,0x2c,0x20,0x20,0x5a,0x2a,0x6f,0xe2,0x04,0x52,0xc3,0x82,0x80,0x00,0x20,0x40,
+0x01,0xf0,0x20,0x3a,0x5a,0x3e,0x1a,0x22,0x26,0x00,0x1a,0x22,0x0c,0x00,0x20,0x40,
+0x02,0x09,0x1a,0x62,0x0c,0x00,0x20,0x20,0x59,0xfe,0xef,0xe4,0x00,0x06,0xc0,0x02,
+0x02,0x32,0xc0,0x03,0x02,0x1e,0xc0,0x02,0xde,0x96,0x20,0x60,0x00,0x00,0xef,0xe2,
+0x00,0x06,0xc0,0x00,0x82,0x2c,0xc0,0x01,0x82,0x2e,0xc0,0x02,0x02,0x30,0xc0,0x02,
+0xdf,0x3a,0xc0,0x03,0x5f,0x60,0xc0,0x03,0xdf,0xa4,0xc0,0x04,0x5f,0x8f,0xc0,0x04,
+0xdf,0xa0,0xc0,0x05,0x5f,0xa4,0xc0,0x05,0xdf,0xa4,0xc0,0x06,0x5f,0xa5,0xc0,0x06,
+0xdf,0xaa,0x20,0x60,0x00,0x00,0x20,0x40,0x5e,0xe9,0x20,0x20,0x02,0x4e,0x20,0x40,
+0x5f,0x10,0x20,0x20,0x02,0x4e,0x20,0x40,0x5f,0x2d,0x20,0x20,0x02,0x4e,0xef,0xe6,
+0x00,0x06,0x67,0xe6,0x04,0x73,0xc0,0x08,0x02,0x56,0xc0,0x04,0x02,0x60,0xc0,0x02,
+0x02,0x4d,0xc0,0x03,0x02,0x4b,0xc0,0x05,0x02,0x49,0xc0,0x06,0x02,0x47,0xc0,0x09,
+0x02,0x45,0xc0,0x0b,0x02,0x43,0xc0,0x0c,0x02,0x41,0xc0,0x29,0x5e,0x40,0xc0,0x01,
+0x02,0x5e,0xc0,0x01,0xdc,0xa9,0x20,0x60,0x00,0x00,0x20,0x40,0x5e,0x3b,0x20,0x20,
+0x02,0x4e,0x20,0x40,0x5e,0x28,0x20,0x20,0x02,0x4e,0x20,0x40,0x5e,0x0f,0x20,0x20,
+0x02,0x4e,0x20,0x40,0x5d,0xc4,0x20,0x20,0x02,0x4e,0x20,0x40,0x5d,0x9c,0x20,0x20,
+0x02,0x4e,0x20,0x40,0x5c,0xd2,0x20,0x20,0x02,0x4e,0x20,0x40,0x5c,0xac,0x20,0x40,
+0x5c,0x59,0x20,0x3a,0x4a,0x8b,0xef,0xe2,0x00,0x06,0x98,0xc0,0x8a,0x00,0x18,0xa0,
+0x8a,0x02,0x6f,0xe2,0x04,0x51,0xe7,0xe2,0x00,0x05,0x20,0x60,0x00,0x00,0x20,0x40,
+0x02,0x58,0x20,0x20,0x02,0x4e,0x20,0x40,0x5e,0x91,0x20,0x40,0x5a,0xb3,0xd9,0x60,
+0x00,0x01,0x20,0x20,0x5d,0xde,0xd8,0xe0,0x00,0x07,0x20,0x20,0x50,0xe6,0x20,0x40,
+0x5c,0xa2,0x20,0x20,0x02,0x4e,0x20,0x40,0x02,0x62,0x20,0x20,0x02,0x4e,0x20,0x40,
+0x5e,0x91,0x20,0x40,0x5a,0xbb,0x20,0x20,0x02,0x65,0x68,0x44,0x44,0x2c,0x60,0x44,
+0x0a,0x9e,0x20,0x40,0x5b,0x36,0x20,0x40,0x5b,0x4d,0x18,0xc0,0x8d,0xfe,0x18,0xc2,
+0x7e,0x00,0x67,0xe4,0x04,0x98,0x68,0x44,0x44,0x44,0x58,0x00,0x2a,0x00,0x98,0x46,
+0x7c,0x00,0x20,0x22,0x82,0x71,0x20,0x20,0x5d,0x2d,0xd8,0x40,0x2a,0x00,0x20,0x40,
+0x5b,0x5c,0x20,0x3a,0x5e,0x56,0x20,0x20,0x5d,0x8b,0x6f,0xe2,0x43,0x40,0x20,0x7a,
+0x00,0x00,0xd8,0xe0,0x00,0x00,0x20,0x40,0x7c,0xf1,0x24,0x7a,0x00,0x00,0x20,0x20,
+0x5a,0xd5,0x18,0x0a,0x7e,0x00,0xd8,0x40,0x00,0x1f,0x98,0x41,0x7e,0x00,0x1f,0xe0,
+0xfe,0x03,0x20,0x40,0x5a,0xef,0x6f,0xe2,0x0a,0xbe,0x68,0x42,0x44,0x5f,0x98,0x46,
+0x7c,0x00,0x24,0x22,0xda,0xd5,0x20,0x20,0x5a,0xec,0x6f,0xe2,0x00,0x7d,0xc0,0x08,
+0x02,0x89,0xc0,0x0b,0x82,0x8f,0x20,0x20,0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,
+0x7c,0x06,0x20,0x21,0x02,0x8d,0x20,0x20,0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,
+0x61,0x34,0x20,0x20,0x62,0xb8,0x78,0x54,0x7c,0x00,0x20,0x40,0x66,0xa3,0x6f,0xe2,
+0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,0x82,0x96,0x20,0x20,0x63,0xf2,0xc0,0x42,
+0x02,0x99,0xc0,0x41,0x82,0x9c,0x20,0x20,0x64,0x21,0x20,0x40,0x02,0x9f,0x6f,0xe2,
+0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,0x02,0x9f,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,0x82,0xae,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,0x02,0xb8,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,0xda,0x20,0x46,0x42,0x20,0x40,0x7d,0x9c,0x20,0x7a,
+0x00,0x00,0xc0,0x01,0x7c,0x04,0xc0,0x06,0xfc,0x16,0xc0,0x07,0x7c,0x1c,0xc0,0x0f,
+0xe7,0xfd,0x20,0x60,0x00,0x00,0x6f,0xe2,0x0a,0x95,0xc0,0x0a,0x03,0x11,0xc0,0x20,
+0x83,0x0f,0xc0,0x18,0x03,0x03,0xc0,0x18,0x83,0x01,0xc0,0x19,0x02,0xf9,0xc0,0x19,
+0x82,0xf7,0xc0,0x1a,0x50,0x82,0xc0,0x1e,0x82,0xdb,0xc0,0x22,0x02,0xd4,0xc0,0x0a,
+0x83,0x1c,0x20,0x60,0x00,0x00,0x70,0x0a,0xff,0x17,0x58,0x00,0x00,0x07,0x20,0x40,
+0x50,0xa5,0x20,0x40,0x03,0x0c,0x6f,0xec,0x43,0xa8,0xe7,0xec,0x00,0x0a,0x20,0x20,
+0x67,0xb9,0x70,0x0a,0xff,0x0d,0x6f,0xe2,0x42,0x16,0x1f,0xe6,0x7c,0x07,0x20,0x21,
+0x02,0xef,0xdf,0xe0,0x00,0x07,0x20,0x40,0x02,0xef,0x6f,0xe2,0x42,0x16,0x68,0x42,
+0x0a,0x96,0x98,0x46,0x7e,0x00,0x1f,0xef,0xfe,0x22,0x1f,0xe2,0x72,0x00,0x1f,0xe0,
+0xfe,0x02,0x20,0x40,0x50,0xa5,0x6f,0xe4,0x42,0x14,0x68,0x42,0x0a,0x96,0x18,0x4f,
+0x84,0x22,0xe0,0x44,0x00,0x0a,0x98,0x40,0x8c,0x00,0x20,0x40,0x67,0xc1,0x20,0x20,
+0x67,0xb9,0x67,0xe2,0x0a,0x96,0x1f,0xef,0xfe,0x22,0x1f,0xe2,0x72,0x00,0x1f,0xe0,
+0xfe,0x02,0x20,0x40,0x50,0xa5,0xdf,0xe0,0x00,0x00,0xe7,0xe4,0x00,0x0a,0x20,0x20,
+0x50,0x74,0xda,0x60,0x00,0x00,0x20,0x20,0x02,0xfa,0xda,0x60,0x00,0x01,0x70,0x0a,
+0xff,0x15,0x58,0x00,0x00,0x02,0x20,0x40,0x50,0xa5,0x20,0x40,0x03,0x0c,0x1a,0x62,
+0x7e,0x00,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x67,0xb9,0xda,0x20,0x00,0x80,0x20,0x20,
+0x03,0x04,0xda,0x20,0x01,0x80,0x70,0x46,0x33,0x00,0x70,0x0a,0xff,0x14,0x58,0x00,
+0x00,0x03,0x20,0x40,0x50,0xa5,0x20,0x40,0x03,0x0c,0x1a,0x22,0x7e,0x00,0xe7,0xe4,
+0x00,0x0a,0x20,0x20,0x67,0xb9,0x6f,0xe2,0x04,0x51,0xe7,0xe2,0x00,0x0a,0x20,0x60,
+0x00,0x00,0x20,0x40,0x60,0xaa,0x20,0x20,0x02,0x53,0x20,0x40,0x4c,0xe4,0x20,0x40,
+0x4e,0x8f,0x6f,0xe2,0x46,0x6e,0x67,0xe2,0x41,0x73,0x70,0x0a,0xff,0x02,0x58,0x00,
+0x00,0x07,0x20,0x40,0x50,0xa5,0x20,0x40,0x03,0x0c,0x6f,0xec,0x04,0x4b,0xe7,0xec,
+0x00,0x0a,0x20,0x20,0x67,0xb9,0x20,0x40,0x4c,0xe8,0x70,0x0a,0xff,0x05,0x58,0x00,
+0x00,0x01,0x20,0x40,0x50,0xa5,0x20,0x40,0x03,0x0c,0x20,0x20,0x67,0xb9,0x78,0x55,
+0xfc,0x00,0x20,0x20,0x57,0x0b,0x20,0x40,0x5f,0xc4,0x20,0x40,0x7b,0xc1,0x6f,0xe2,
+0x04,0x5e,0xc2,0x81,0xd7,0x83,0x20,0x20,0x57,0x75,0x20,0x40,0x57,0x8c,0x20,0x40,
+0x4d,0x3f,0x70,0x0a,0x95,0x15,0x20,0x40,0x7b,0xab,0x20,0x20,0x03,0x94,0x79,0x20,
+0x00,0x09,0x1a,0x22,0x7e,0x00,0x67,0xe4,0x00,0x1e,0x18,0x00,0x72,0x50,0xd8,0xa0,
+0x04,0x3b,0x1a,0x22,0x0c,0x00,0x20,0x40,0x7c,0xcf,0x20,0x40,0x03,0x72,0x1f,0xe2,
+0x0c,0x00,0xd8,0xa0,0x43,0xae,0x18,0x00,0x72,0x27,0x20,0x40,0x7c,0xcf,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x46,0x52,0xef,0xea,0x00,0x06,0x67,0xea,0x43,0xd5,0xef,0xea,
+0x00,0x06,0x67,0xea,0x43,0xda,0xef,0xf0,0x00,0x06,0x67,0xf0,0x43,0xe3,0xef,0xe2,
+0x00,0x06,0x67,0xe2,0x44,0xbb,0xef,0xe2,0x00,0x06,0x67,0xe2,0x44,0x96,0xef,0xe2,
+0x00,0x06,0x67,0xe2,0x44,0x97,0xd8,0xa0,0x43,0xa0,0xdf,0x20,0x00,0x0e,0x20,0x40,
+0x7c,0xcf,0x1e,0xef,0xee,0x3a,0xdf,0xe0,0x0d,0x2d,0x9e,0xe0,0x8c,0x00,0xd8,0xa0,
+0x43,0xeb,0x18,0x00,0x72,0x3a,0x20,0x20,0x7c,0xcf,0x6f,0xe4,0x00,0x1e,0x98,0x00,
+0x0a,0x00,0x18,0x00,0x72,0x50,0xd8,0xc0,0x04,0x3b,0x20,0x40,0x7c,0xcf,0x20,0x40,
+0x03,0x72,0x1f,0xe2,0x0a,0x00,0xd8,0xc0,0x43,0xae,0x18,0x00,0x72,0x27,0x20,0x40,
+0x7c,0xcf,0x6f,0xe4,0x46,0x52,0xe7,0xe4,0x00,0x05,0x6f,0xea,0x43,0xd5,0xe7,0xea,
+0x00,0x05,0x6f,0xea,0x43,0xda,0xe7,0xea,0x00,0x05,0x6f,0xf0,0x43,0xe3,0xe7,0xf0,
+0x00,0x05,0x6f,0xe2,0x44,0xbb,0xe7,0xe2,0x00,0x05,0x6f,0xe2,0x44,0x96,0xe7,0xe2,
+0x00,0x05,0x6f,0xe2,0x44,0x97,0xe7,0xe2,0x00,0x05,0xd8,0xc0,0x43,0xa0,0xdf,0x20,
+0x00,0x0e,0x20,0x40,0x7c,0xcf,0x1e,0xef,0xee,0x3a,0xdf,0xe0,0x0d,0x2d,0x9e,0xe0,
+0x8a,0x00,0xd8,0xc0,0x43,0xeb,0x18,0x00,0x72,0x3a,0x20,0x20,0x7c,0xcf,0x6f,0xe4,
+0x00,0x1e,0xd8,0x40,0x49,0x60,0x98,0x46,0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,
+0x7d,0x61,0x18,0x07,0xfe,0x00,0x1f,0xe2,0x6e,0x00,0x1f,0xef,0xfe,0x4c,0xd8,0x40,
+0x4b,0xe0,0x98,0x40,0xfe,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x03,0x7f,0x20,0x20,
+0x42,0x3a,0x68,0x42,0x49,0x5f,0xd8,0xe0,0x00,0x00,0xa8,0x4f,0xff,0xff,0x20,0x20,
+0x83,0x90,0xf9,0x20,0x04,0x00,0x60,0x42,0x49,0x5f,0x18,0xe2,0x7e,0x00,0x67,0xe2,
+0x00,0x15,0x1f,0xef,0xa2,0x50,0x1f,0xe0,0xfe,0x01,0x67,0xe2,0x04,0x51,0xdf,0xe0,
+0x49,0x60,0x9a,0x20,0xa2,0x00,0x6f,0xe2,0x49,0x5e,0x1f,0xe0,0xfe,0x01,0x67,0xe2,
+0x49,0x5e,0x20,0x20,0x42,0x4c,0x18,0xe0,0x8e,0x01,0x28,0xe0,0x1e,0x08,0x24,0x20,
+0x83,0x81,0x20,0x20,0x42,0x4a,0x6f,0xe4,0x00,0x1e,0xda,0x20,0x49,0x60,0x9a,0x26,
+0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,0x7d,0x61,0x18,0x07,0xfe,0x00,0x98,0x00,
+0x0e,0x00,0x6f,0xe2,0x49,0x5f,0xf9,0x3f,0xfe,0x00,0x67,0xe2,0x49,0x5f,0x6f,0xe2,
+0x49,0x5e,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x49,0x5e,0x20,0x60,0x00,0x00,0xda,0x20,
+0x49,0x60,0xdf,0x20,0x00,0x08,0x20,0x20,0x42,0x60,0x20,0x40,0x42,0x5a,0x24,0x22,
+0x83,0xa8,0x20,0x20,0x40,0x25,0x20,0x40,0x03,0xab,0x1f,0x26,0x7c,0x00,0x20,0x20,
+0x40,0x2d,0xdf,0x20,0x00,0x08,0x68,0x42,0x00,0x15,0x18,0x40,0x84,0x01,0x18,0x46,
+0x7c,0x07,0x20,0x21,0x03,0xb1,0xd8,0x40,0x00,0x00,0x60,0x42,0x00,0x15,0x18,0x4f,
+0xfe,0x50,0xda,0x20,0x49,0x60,0x9a,0x20,0xa2,0x00,0xef,0xe2,0x00,0x11,0xc2,0x80,
+0x83,0xb9,0xc3,0x80,0x00,0x00,0xc3,0x81,0x80,0x00,0xc2,0x00,0x03,0xad,0x20,0x60,
+0x00,0x00,0x42,0x0d,0xaa,0x55,0x40,0x00,0x00,0x40,0x22,0x00,0x00,0x00,0x00,0x5c,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x02,0x10,0x00,0x0c,0x12,
+0x00,0x19,0x00,0x00,0x00,0x00,0x00,0x08,0x48,0x00,0x28,0x00,0x01,0x10,0x2c,0x00,
+0x28,0x44,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x92,0x40,
+0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,0x01,0x00,0x06,0x42,0x13,0xaa,
+0x55,0x01,0x00,0x5b,0x41,0x01,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xfa,
+0x8b,0x85,0x59,0x83,0xaa,0x55,0x03,0x00,0x14,0x42,0x45,0x48,0x08,0xaa,0x55,0x04,
+0x00,0x3d,0x45,0x01,0xff,0x00,0x03,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,
+0xaa,0x55,0x01,0x00,0x2c,0x46,0x00,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,0x80,0x4e,0xe0,0x4f,0x80,0x4e,0x80,0x4e,0xaa,0x55,0x02,0x00,0x68,0x46,0x10,
+0x0b,0xaa,0x55,0x01,0x00,0x6c,0x46,0x02,0xaa,0x55,0x01,0x00,0x6f,0x46,0x04,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,0xaa,0xaa,0x2a,0x21,0x10,0x55,
+0xaa,0x55,0x07,0x00,0xe7,0x44,0x06,0x59,0x69,0x43,0x68,0x69,0x70,0xaa,0x55,0x03,
+0x00,0xe4,0x41,0x20,0x00,0x02,0xaa,0x55,0x01,0x00,0xe8,0x41,0x01,0xaa,0x55,0x01,
+0x00,0x90,0x44,0x00,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,0x55,0x01,0x00,0x98,
+0x44,0x01,0xaa,0x55,0x04,0x00,0x75,0x46,0x2d,0x00,0x2f,0x00,0xaa,0x55,0x01,0x00,
+0x40,0x43,0x01,0xaa,0x55,0x02,0x00,0x54,0x44,0x01,0x03,0xaa,0x55,0x01,0x00,0x6e,
+0x46,0x01,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0xaa,0xaa,0x33,0x02,0x3a,0xaa,0x55,
+0x0a,0x00,0x81,0x43,0x09,0x59,0x69,0x43,0x68,0x69,0x70,0x2d,0x6c,0x65,0xaa,0x55,
+0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x06,0xaa,0x55,0x0c,0x00,0x61,0x43,0x0b,0x0a,
+0x09,0x59,0x69,0x43,0x68,0x69,0x70,0x2d,0x6c,0x65,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,0x17,0xaa,0x55,0x01,0x00,
+0x7a,0x44,0x17,0xaa,0x55,0x02,0x00,0xcc,0x44,0x31,0x00,0xaa,0x55,0x02,0x00,0x47,
+0x45,0x00,0x00,0xaa,0x55,0x02,0x00,0x8e,0x44,0x83,0x46,0xaa,0x55,0x4e,0x01,0x83,
+0x46,0x01,0x00,0x02,0x00,0x28,0x02,0x01,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x20,
+0x03,0x00,0x02,0x05,0x2a,0x01,0x00,0x04,0x00,0x02,0x02,0x29,0x02,0x01,0x00,0x05,
+0x00,0x02,0x00,0x28,0x02,0x00,0x18,0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,0x00,
+0x02,0x00,0x2a,0x13,0x59,0x69,0x43,0x68,0x69,0x70,0x2d,0x6c,0x65,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x08,0x00,0x02,0x03,0x28,0x01,0x02,0x09,0x00,
+0x02,0x01,0x2a,0x02,0x00,0x00,0x0a,0x00,0x02,0x03,0x28,0x01,0x02,0x0b,0x00,0x02,
+0x04,0x2a,0x08,0x10,0x00,0x80,0x00,0x05,0x00,0x2c,0x01,0x0c,0x00,0x02,0x00,0x28,
+0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,0xfe,0x43,0x53,0x53,
+0x49,0x0d,0x00,0x02,0x03,0x28,0x01,0x10,0x0e,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,
+0x0f,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x03,0x28,0x01,0x08,0x11,
+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,0x12,0x00,0x02,0x03,0x28,0x01,0x04,0x13,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,0x14,0x00,0x02,0x03,0x28,0x01,0x1a,0x15,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,0x16,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x00,0x00,0xaa,
+0x55,0x07,0x00,0x76,0x41,0x0f,0x84,0xf0,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,0x10,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,0x40,0x40,0x4b,0xba,0x55,0xd0,0x56,
+0xe0,0x57,0x88,0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,
+0x40,0x40,0xf0,0x30
+};
Index: BlueTooth/BT_code_patch/key/trunk/output/memmap.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/output/memmap.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/output/memmap.format	(working copy)
@@ -0,0 +1,1054 @@
+0x0000 mem_le_adv_transmit
+0x0001 mem_le_adv_waitcnt
+0x0002 mem_le_adv_rcv
+0x0003 mem_le_req_rcv
+0x0004 mem_le_scanrsp_rcv
+0x0005 mem_le_conn_rcv
+0x0006 mem_inquiryscan_waitcnt
+0x0007 mem_inquiryscan_rcvcnt
+0x0008 mem_pagescan_waitcnt
+0x0009 mem_pagescan_rcvcnt
+0x000a mem_pagescan_rcvfhscnt
+0x000b mem_slave_rcvcnt
+0x000c mem_page_transmit
+0x000d mem_page_rcv
+0x000e mem_page_rcv_fhs
+0x000f mem_master_rcvcnt
+0x0010 mem_fhs_wait_counter
+0x0011 mem_newconnto_counter
+0x0012 mem_inquiry_transmit
+0x0013 mem_inquiry_rcv
+0x0014 mem_fw_ver
+0x0015 mem_current_context
+0x0016 mem_le_ch_mapped
+0x0017 mem_last_freq
+0x0018 mem_rssi
+0x0019 mem_rx_type
+0x001a mem_rx_hec_err
+0x001c mem_rx_crc_err
+0x001e mem_context_ptr
+0x0020 mem_display
+0x0028 mem_bcd
+0x0030 mem_state
+0x0031 mem_mode
+0x0032 mem_tsniff
+0x0034 mem_sniff_anchor
+0x0038 mem_clk_offset
+0x003e mem_rx_window
+0x0040 mem_plap
+0x0043 mem_puap
+0x0044 mem_pnap
+0x0046 mem_conn_handle
+0x0047 mem_arq
+0x0048 mem_lmp_to_send
+0x0049 mem_lmi_opcode
+0x004a mem_lmo_reason
+0x004b mem_op
+0x004c mem_state_map
+0x004d mem_supervision_timer
+0x0051 mem_supervision_to
+0x0053 mem_name_offset
+0x0054 mem_key_size
+0x0055 mem_conn_sm
+0x0056 mem_aco
+0x0062 mem_kc
+0x0072 mem_conn_timer
+0x0073 mem_sniff_attempt
+0x0074 mem_sniff_timeout
+0x0075 mem_dsniff
+0x0077 mem_amaddr
+0x0078 mem_lmo_opcode1
+0x0079 mem_lmi_opcode1
+0x007a mem_lmo_reason1
+0x007b mem_lmo_tid1
+0x007c mem_lmo_opcode2
+0x007d mem_lmi_opcode2
+0x007e mem_lmo_reason2
+0x007f mem_lmo_tid2
+0x0080 mem_hci_version
+0x0083 mem_acl_pktlen
+0x0085 mem_sco_pktlen
+0x0086 mem_acl_pktcnt
+0x0088 mem_sco_pktcnt
+0x008a mem_current_sniff_attempt
+0x008b mem_current_sniff_timeout
+0x008c mem_sniff_timeout_temp
+0x008d mem_nfreq_index_inq
+0x008e mem_nfreq_index_page
+0x008f mem_ninqy_index
+0x0090 mem_fhs_misc
+0x0091 mem_subsniff_instant
+0x0095 mem_subsniff_rate
+0x0096 mem_subsniff_tcmax
+0x0098 mem_subsniff_tsniff
+0x0099 mem_lpm_adjust
+0x009a mem_sync_clke
+0x00a0 mem_lpm_current_mult
+0x00a1 mem_gpio_wakeup
+0x00a7 mem_air_mode
+0x00a8 mem_sco_asso_handle
+0x00a9 mem_sco_handle
+0x00ab mem_esco_desco
+0x00ac mem_esco_type
+0x00ad mem_neogotiation_state
+0x00ae mem_saved_amaddr
+0x00af mem_esco_arq
+0x00b0 mem_esco_saved_arq
+0x00b1 mem_sco_obuf
+0x00cf mem_sco_ibuf
+0x00ed mem_sco_poll
+0x00ee mem_npage_index
+0x00ef mem_page_mode
+0x00f0 mem_page_clk
+0x00f4 mem_tst_pktcnt_sync
+0x00f6 mem_tst_pktcnt_hec
+0x00f8 mem_tst_pktcnt_crc
+0x00fa mem_tst_pktcnt_dmh
+0x00fc mem_tmp_buffer_head
+0x00ff mem_tmp_buffer
+0x014f mem_tester_emulate
+0x0150 mem_temp_payload
+0x0150 test_mode_scenario
+0x0151 test_mode_hopping_mode
+0x0152 test_mode_tx_freq
+0x0153 test_mode_rx_freq
+0x0154 test_mode_power_mode
+0x0155 test_mode_poll_period
+0x0156 test_mode_packet_type
+0x0157 test_mode_data_length
+0x0159 mem_test_mode_old_debug_config
+0x015a mem_tester_cnt
+0x015b mem_temp_am_addr
+0x015c mem_temp_arq
+0x015d mem_len
+0x015f mem_clkn_bt
+0x0163 mem_clke_bt
+0x0167 mem_dpll_clkn
+0x016b mem_connection_options
+0x016c mem_nameres_cnt
+0x016d mem_txptr
+0x016f mem_slot_offset
+0x0171 extm_fhs_misc
+0x0172 extm_newconn_am_addr
+0x0173 extm_class
+0x0176 extm_lap
+0x0179 extm_uap
+0x017a extm_nap
+0x017d mem_debug_config
+0x017e mem_lch_code
+0x017f mem_fhs_am_addr
+0x0180 mem_dpll_error
+0x0182 mem_select_list_item
+0x0183 mem_temp_reconn_record
+0x0183 mem_record_bt_mode
+0x0184 mem_temp_lap
+0x018a mem_list_item_ptr
+0x018c mem_eir
+0x01f0 mem_ucode_status
+0x01f1 mem_otp_ucode_flag
+0x01f3 mem_spid_tbuf/* spid buf: 03 addr[23:16] addr[15:8] addr[7:0] */
+0x01f4 mem_iicd_tbuf/* iicd buf: iic_adr addr[15:8] addr[7:0] iic_adr */
+0x01f4 mem_addr_hi
+0x01f5 mem_addr_mi
+0x01f6 mem_addr_lo
+0x01f7 mem_iicd_addr
+0x01f8 mem_spid_rbuf
+0x01fc mem_ucode_buf
+0x01fe mem_ucode_len
+0x0200 mem_sched_addr
+0x0202 mem_ucode_ptr
+0x0204 mem_ucode_keybuf
+0x0214 mem_check_plap_temp
+0x0226 mem_reconnect_flag
+0x0227 mem_switch_fail_master_count
+0x0228 mem_app_evt_timer_count
+0x0229 mem_h5rx_ackcnt
+0x022a mem_check_err_acl_cont
+0x022b mem_rp_packets
+0x022c mem_packet_type
+0x022e mem_hci_sniff_conn_handle
+0x0230 mem_hci_sniff_max_interval
+0x0232 mem_hci_sniff_min_interval
+0x0234 mem_hci_sniff_attempt
+0x0236 mem_hci_sniff_timeout
+0x0238 mem_voice_setting
+0x023a mem_retransmission_effort
+0x023b mem_sco_ptype
+0x023d mem_extm_uap_restore
+0x0240 mem_h5rx_rptr
+0x0242 mem_h5rx_ack
+0x0243 mem_h5tx_ack
+0x0244 mem_h5tx_rptr
+0x0246 mem_h5tx_wptr
+0x0248 mem_h5tx_free
+0x024a mem_h5rx_tmp
+0x024b mem_h5tx_seq
+0x024c mem_hci_acl_queue_wptr
+0x024e mem_hci_acl_queue_rptr
+0x0250 mem_hci_acl_queue_end
+0x0252 mem_hci_acl_queue_wcnt
+0x0253 mem_hci_acl_cnt
+0x0254 mem_hci_acl_tx_trigger_wptr//tx via uart
+0x0256 mem_hci_curr_len
+0x0257 mem_hci_curr_target
+0x0259 mem_l2cap_mem_start
+0x0259 mem_l2cap_rxbuff1_len
+0x025b mem_l2cap_rxbuff2_len
+0x025d mem_l2cap_rxbuff_new
+0x025f mem_l2cap_rxbuff_inuse
+0x0260 mem_l2cap_payload_ptr
+0x0262 mem_l2cap_rx_pkt_length
+0x0264 mem_l2cap_rx_cid
+0x0266 mem_l2cap_rx_done
+0x0267 mem_l2cap_signal_tx_buff_ptr
+0x0269 mem_l2cap_signal_tx_payload_ptr
+0x026b mem_l2cap_signal_tx_length
+0x026d mem_sdp_tx_buff_ptr
+0x026f mem_sdp_tx_payload_ptr
+0x0271 mem_sdp_tx_pkt_length
+0x0273 mem_rfcomm_tx_buff_ptr
+0x0275 mem_rfcomm_tx_payload_ptr
+0x0277 mem_rfcomm_tx_pkt_length
+0x0279 memL2CAP_T1
+0x027b mem_CONTROL_tasks
+0x027c mem_send_config_req
+0x027d mem_config_identifier
+0x027e mem_config_req_dest_CID
+0x0280 mem_rfcomm_malloc_fail_flag
+0x0281 mem_message_to_uppersm
+0x0282 mem_upper_sm_remote_page
+0x0283 mem_upper_sm_reconn
+0x0284 mem_upper_sm_ss
+0x0285 mem_tx_malloc_log
+0x02c5 mem_l2cap_mem_end
+0x02c5 mem_scid
+0x02c7 mem_cmd_length
+0x02c9 mem_tt2
+0x02cb mem_tt3
+0x02cd mem_id
+0x02cf mem_psm
+0x02d1 mem_l2cap_sdpres_delay_time
+0x02d5 mem_le_rxbuf
+0x030d mem_le_l2capbuf
+0x0413 mem_le_mic
+0x0417 mem_le_peer_mic
+0x041b mem_le_peer_ltk
+0x042b mem_le_mrand
+0x043b mem_le_state
+0x043c mem_le_mode
+0x043d mem_le_tsniff
+0x043f mem_le_anchor
+0x0443 mem_le_clk_offset
+0x0449 mem_le_receive_window
+0x044b mem_le_plap
+0x0451 mem_le_conn_handle
+0x0452 mem_le_arq
+0x0453 mem_le_ch
+0x0454 mem_le_hop
+0x0455 mem_le_event_count
+0x0457 mem_le_supervision_timer
+0x045b mem_le_instant
+0x045d mem_le_channels
+0x045e mem_le_op
+0x045f mem_le_access
+0x0463 mem_le_crcinit
+0x0466 mem_le_window_size
+0x0467 mem_le_slave_latency
+0x0469 mem_le_superto
+0x046b mem_le_channel_map
+0x0470 mem_le_no_using
+0x0472 mem_le_peer_sca
+0x0473 mem_le_att_opcode
+0x0474 mem_le_att_handle
+0x0476 mem_le_err_code
+0x0477 mem_le_ll_pairing_fail_reason
+0x0478 mem_le_sk
+0x0488 mem_le_testtype
+0x0489 mem_le_test_sync
+0x048b mem_le_test_pcnt
+0x048d mem_le_rxon_ts
+0x0493 mem_le_rx_ll_opcode
+0x0494 mem_le_notify_attr_start
+0x0496 mem_le_notify_len
+0x0497 mem_cmd_le_create_conn
+0x0498 mem_le_cur_attlist_start_ptr
+0x049a mem_le_cur_handle_start
+0x049c mem_le_cur_handle_end
+0x049e mem_le_cur_uuid_length
+0x049f mem_le_cur_uuid
+0x04af mem_le_curr_att_len
+0x04b0 mem_le_search_res
+0x04b1 mem_le_continue_type
+0x04b2 mem_lmo_header_length
+0x04b3 mem_lmo_header_opcode
+0x04b4 mem_lmo_payload
+0x04c5 mem_lmi_accepted_opcode
+0x04c6 mem_disconn_reason_send
+0x04c7 mem_tx_fixed_freq
+0x04c8 mem_rx_fixed_freq
+0x04c9 mem_ext_features_page
+0x04ca mem_lmpext_ssp_enable
+0x04cc mem_remote_sppcap
+0x04cd mem_lmp_conn_state
+0x04ce mem_soft_timer
+0x04d0 mem_pincode_state
+0x04d1 mem_sres_tid
+0x04d2 mem_accptsco_tid
+0x04d3 mem_auth_enable
+0x04d4 mem_wait_encryption
+0x04d5 mem_sniff_payload
+0x04e5 mem_aurand_send_delay_time
+0x04e9 memRemoteRPNBitRate
+0x04ea memRemotePRNDataBits
+0x04eb memRemotePRNStopBit
+0x04ec memRemotePRNParity
+0x04ed memRemotePRNFlowControl
+0x04ee memRemotePRNXon
+0x04ef memRemotePRNXoff
+0x04f0 mem_mod2div_temp
+0x04f3 mem_contw_temp
+0x04f5 mem_attrib_list
+0x04f7 mem_current_adss
+0x04f8 mem_current_channel
+0x04f9 mem_current_frame_type
+0x04fa mem_current_fcs
+0x04fb mem_current_length
+0x04fd mem_rfcomm_uih_payload_ptr
+0x04ff mem_uih_cmd_type
+0x0500 mem_uih_length
+0x0502 mem_param_payload_ptr
+0x0504 mem_ms_param
+0x0505 mem_pn_credit_flow_type_info
+0x0506 mem_pn_priority
+0x0507 mem_pn_acknowledg_timer
+0x0508 mem_pn_max_retrans
+0x0509 mem_rfcomm_send_adss
+0x050a mem_rfcomm_send_frame_type
+0x050b mem_rfcomm_send_fcs
+0x050c mem_rfcomm_send_offset
+0x050d mem_sdp_mem_start
+0x050d mem_sdp_uuid_search_ptr
+0x0515 mem_sdp_continue_byte
+0x0517 mem_sdp_pduid
+0x0518 mem_sdp_transactionid
+0x051a mem_sdp_transactionid_local
+0x051c mem_sdp_attribute_maxbyte
+0x051e mem_sdp_record_maxcnt
+0x0520 mem_sdp_record_handle
+0x0524 mem_sdp_LACAP_found
+0x0525 mem_sdp_RFCOMM_found
+0x0526 mem_sdp_handle_list
+0x0526 mem_sdp_attrib_list
+0x0546 mem_sdp_error_code
+0x0548 mem_sdp_all_length
+0x054a mem_handle_humber
+0x054b mem_search_uuid
+0x054d mem_sdp_mem_end
+0x054d mem_rxbuf
+0x055e mem_random_number
+0x056e mem_round_key
+0x057e mem_kinit
+0x058e mem_input_store
+0x059e mem_x
+0x05ae mem_y
+0x05bd mem_y15
+0x05be mem_key_store
+0x05cf mem_key_store_end
+0x05d0 memp_ar_key
+0x05d2 memp_ar_input
+0x05d4 mem_ar_hround
+0x05de mem_ec_infinite
+0x05df mem_ec_loopc
+0x05e1 mem_aes_cmac_data_length
+0x05e2 memdat
+0x05e2 mem_ax
+0x05fa mem_ay
+0x0612 mem_az
+0x062a mem_bx
+0x0642 mem_ax_256//32 bytes
+0x0642 mem_by
+0x065a mem_bz
+0x0662 mem_ay_256// 32 bytes
+0x0672 mem_cx
+0x0682 mem_az_256// 32 bytes
+0x068a mem_cy
+0x06a1 mem_cy5
+0x06a2 mem_bx_256// 32 bytes
+0x06a2 mem_cz
+0x06ba mem_k
+0x06c2 mem_by_256// 31 bytes
+0x06d2 mem_align
+0x06e2 mem_bz_256//32 bytes
+0x06e2 mem_tmp1
+0x06e2 memahbak
+0x06fa mem_tmp5
+0x0702 mem_cx_256//32 bytes
+0x0702 memahsave
+0x0712 mem_tmp2
+0x0722 mem_cy_256// 32 bytes
+0x0722 memahsave_end
+0x0722 mem_addr_padding
+0x0723 mem_addr_value/* 12 bytes     */ 
+0x072a mem_tmp3
+0x072a mem_t1
+0x072f mem_addr_value_end
+0x0732 mem_addr_iocap_end
+0x0741 mem_cy5_256// 1 byte
+0x0742 mem_cz_256// 32 bytes
+0x0742 mem_tmp0
+0x0742 mem_t0
+0x074a mem_tmp0a
+0x075a mem_t2
+0x0762 mem_k_256//32 bytes
+0x0772 mem_t3
+0x0782 mem_tmp1_256//32 bytes
+0x078a mem_t7
+0x07a2 mem_tmp5_256
+0x07c2 mem_tmp2_256
+0x07e2 mem_tmp3_256
+0x07e2 mem_t1_256
+0x0802 mem_tmp0_256
+0x0802 mem_t0_256
+0x0822 mem_t2_256
+0x0842 mem_t3_256
+0x0862 mem_t7_256
+0x0882 mem_p
+0x089a mem_a
+0x08b2 mem_b
+0x08ca mem_gx
+0x08e2 mem_gy
+0x08fa memh0
+0x091a mem_p_256
+0x093a mem_a_256
+0x095a mem_gx_256
+0x097a mem_gy_256
+0x099a mem_le_slat
+0x09aa mem_sp_state_start
+0x09aa mem_sp_state
+0x09ab mem_master_sp_state
+0x09ac mem_sp_flag
+0x09ad mem_master_sp_flag
+0x09ae mem_sp_calc
+0x09af mem_sp_dh_ready
+0x09b0 mem_sp_localsm
+0x09b1 mem_pairing_auth
+0x09b2 mem_sp_flag_start
+0x09b2 mem_sp_local_key_send_count
+0x09b3 mem_sp_remote_key_recv_count
+0x09b4 mem_sp_remote_key_invalid
+0x09b5 mem_sp_dhkey_invalid
+0x09b6 mem_gkey
+0x09ba mem_le_pubkey_remote_x_256
+0x09c2 mem_sp_pubkey_remote
+0x09c2 mem_sp_pubkey_remote_x
+0x09da mem_sp_pubkey_remote_x_end
+0x09da mem_le_pubkey_remote_y_256
+0x09e2 mem_sp_pubkey_remote_y
+0x09fa mem_le_dhkey_256
+0x0a02 mem_sp_dhkey
+0x0a1a mem_sp_dhkey_end
+0x0a1a mem_sp_random_local
+0x0a2a mem_sp_random_local_end
+0x0a2a mem_sp_random_remote
+0x0a3a mem_sp_random_remote_end
+0x0a3a memresult
+0x0a3a mem_sp_calc_result
+0x0a3a memh
+0x0a3e memg
+0x0a42 memf
+0x0a46 meme
+0x0a4a mem_sp_calc_result_high
+0x0a4a memd
+0x0a4e memc
+0x0a52 memb
+0x0a56 mema
+0x0a5a mem_sp_check_result
+0x0a6a mem_sp_confirm_remote
+0x0a7a mem_sp_prarm_stack
+0x0a8a mem_UI_data_txbuff_length
+0x0a8c mem_ipc_skip_continue_proc
+0x0a8d mem_ui_timer_temp//length 4
+0x0a8d mem_ipc_rega_temp
+0x0a91 mem_hold_contr
+0x0a93 mem_hold_contw
+0x0a95 mem_fifo_temp
+0x0a96 mem_pdatatemp
+0x0a9e mem_temp//8 bytes
+0x0aa6 mem_timeup// 4 bytes
+0x0aaa mem_rega//4 bytes
+0x0aae mem_regb//4 bytes
+0x0ab2 mem_regc//3 bytes
+0x0ab5 mem_contr//2 bytes
+0x0ab7 mem_contw//2 bytes
+0x0ab9 mem_wakup_from_power_flag
+0x0aba mem_saved_gpio_in
+0x0abe mem_shutter_random_mac_data_temp
+0x0abe mem_shutter_config_data_temp
+0x0abe mem_le_adv_channel_map_temp
+0x0abe mem_le_data_len_temp//1byte
+0x0abe mem_tx_fifo_map_temp
+0x0abe mem_rpn_dlci//1byte
+0x0abe mem_event_cmd_response_content//2byte
+0x0abe mem_le_prand//16byte
+0x0abe mem_AES_CMAC_k//16 bytes
+0x0abe mem_regext_index//1 bytes
+0x0abe mem_temp_block0
+0x0abf mem_le_data_temp//15bytes
+0x0abf mem_temp_block1
+0x0ace mem_le_aes_128//16byte
+0x0ace mem_regext//64 bytes
+0x0ace mem_AES_CMAC_k1//16 bytes
+0x0ace mem_temp_block2
+0x0ade mem_AES_CMAC_k2//16 bytes
+0x0ade mem_temp_block3
+0x0aee mem_AES_CMAC_temp// 16 bytes
+0x0aee mem_temp_block4
+0x0afe mem_AES_CMAC_M_last// 16 bytes
+0x0afe mem_module_uart_cmd
+0x0aff mem_module_uart_opcode
+0x0b00 mem_module_uart_len
+0x0b01 mem_module_temp_nl_discard_packet
+0x0b02 mem_temp_block5
+0x0b0e mem_le_mackey//16 bytes
+0x0b0e mem_app_receive_temp
+0x0b0e mem_key_value_temp
+0x0b10 mem_key_value
+0x0b12 mem_key_value_temp1
+0x0b13 mem_key_value_temp2
+0x0b14 mem_key_value_temp3
+0x0b15 mem_key_value_temp4
+0x0b16 mem_key_value_temp5
+0x0b17 mem_key_value_temp6
+0x0b18 mem_temp_block6
+0x4000 mem_patch00
+0x4001 mem_patch01
+0x4002 mem_patch02
+0x4003 mem_patch03
+0x4004 mem_patch04
+0x4005 mem_patch05
+0x4006 mem_patch06
+0x4007 mem_patch07
+0x4008 mem_patch08
+0x4009 mem_patch09
+0x400a mem_patch0a
+0x400b mem_patch0b
+0x400c mem_patch0c
+0x400d mem_patch0d
+0x400e mem_patch0e
+0x400f mem_patch0f
+0x4010 mem_patch10
+0x4011 mem_patch11
+0x4012 mem_patch12
+0x4013 mem_patch13
+0x4014 mem_patch14
+0x4015 mem_patch15
+0x4016 mem_patch16
+0x4017 mem_patch17
+0x4018 mem_patch18
+0x4019 mem_patch19
+0x401a mem_patch1a
+0x401b mem_patch1b
+0x401c mem_patch1c
+0x401d mem_patch1d
+0x401e mem_patch1e
+0x401f mem_patch1f
+0x4020 mem_patch20
+0x4021 mem_patch21
+0x4022 mem_patch22
+0x4023 mem_patch23
+0x4024 mem_patch24
+0x4025 mem_patch25
+0x4026 mem_patch26
+0x4027 mem_patch27
+0x4028 mem_patch28
+0x4029 mem_patch29
+0x402a mem_patch2a
+0x402b mem_patch2b
+0x402c mem_patch2c
+0x402d mem_patch2d
+0x402e mem_patch2e
+0x402f mem_patch2f
+0x4030 mem_patch30
+0x4031 mem_patch31
+0x4032 mem_patch32
+0x4033 mem_patch33
+0x4034 mem_patch34
+0x4035 mem_patch35
+0x4036 mem_patch36
+0x4037 mem_patch37
+0x4038 mem_patch38
+0x4039 mem_patch39
+0x403a mem_patch3a
+0x403b mem_patch3b
+0x403c mem_patch3c
+0x403d mem_patch3d
+0x403e mem_patch3e
+0x403f mem_patch3f
+0x4040 mem_context
+0x4090 mem_current_amaddr
+0x4091 mem_lpm_mode
+0x4092 mem_device_option
+0x4093 mem_scan_mode
+0x4094 mem_last_clkn
+0x4098 mem_features
+0x40a0 mem_lap
+0x40a3 mem_uap
+0x40a4 mem_nap
+0x40a6 mem_npage
+0x40a7 mem_glap
+0x40aa mem_class
+0x40ad mem_iscan_window
+0x40af mem_iscan_interval
+0x40b1 mem_pscan_window
+0x40b3 mem_pscan_interval
+0x40b5 mem_page_interval
+0x40b7 mem_page_window
+0x40b9 mem_page_to
+0x40bb mem_inq_window
+0x40bd mem_fcomp_mul
+0x40be mem_fcomp_div
+0x40bf mem_rx_window_init
+0x40c1 mem_rx_window_sniff
+0x40c3 mem_rf_init_ptr
+0x40c5 mem_last_type
+0x40c6 mem_last_type_esco
+0x40c7 mem_last_type_saved
+0x40c8 mem_retransmission_cnt
+0x40ca mem_next_btclk
+0x40ce mem_rf_rccal
+0x40cf mem_handle_num
+0x40d0 mem_max_slot
+0x40d1 mem_eir_enable
+0x40d2 mem_afh_instant
+0x40d6 mem_afh_error_total
+0x40d8 mem_afh_cfg
+0x40d9 mem_afh_new_mod
+0x40da mem_afh_map_lo
+0x40df mem_afh_map_hi
+0x40e4 mem_afh_used
+0x40e5 mem_afh_index
+0x40e7 mem_afh_map_new
+0x40f2 mem_afh_map
+0x4142 mem_afh_timer
+0x4146 mem_afh_classify_channel_map
+0x4150 mem_chip_functions
+0x4152 mem_lpm_wake_lock
+0x4154 mem_lpm_interval
+0x4156 mem_lpm_overhead
+0x4157 mem_lpm_hibernate_switch
+0x4158 mem_lpm_doze_switch
+0x4159 mem_esco_addr
+0x415a mem_sniff_unint_lost
+0x415b mem_ptt
+0x415c mem_sleep_counter//should be 0x41fc in REVC
+0x4160 mem_sleep_counter_all
+0x4164 mem_sleep_clkn
+0x416a mem_sniff_rcv
+0x416d mem_sniff_lost
+0x4170 mem_clks_per_lpo
+0x4173 mem_lpm_mult
+0x4174 mem_lpm_mult_timeout
+0x4175 mem_lpm_mult_cnt
+0x4176 mem_lpm_config
+0x4179 mem_lpm_xtalcnt
+0x417a mem_lpm_buckcnt
+0x417b mem_lpm_ldocnt
+0x417c mem_lpm_isogate
+0x417d mem_lpm_isogate_final
+0x417e mem_saved_gpio// should be 0x421e in REVC
+0x418e mem_saved_gsel
+0x4191 mem_saved_mark
+0x4199 mem_saved_spidctrl
+0x419a mem_patch_ptr
+0x419c mem_patch_len
+0x419e mem_timers
+0x41be mem_link_key_exists
+0x41bf mem_link_key
+0x41cf mem_hci_cmd
+0x41d0 mem_hci_conn_handle
+0x41d1 mem_hci_plap
+0x41d4 mem_hci_puap
+0x41d5 mem_hci_pnap
+0x41d7 mem_uartd_rxitems_got_data
+0x41d8 mem_uartd_rxitems_threshold
+0x41d9 mem_uartd_rx_timeout
+0x41db mem_loadcode_times
+0x41dc mem_tx_lch
+0x41dd mem_tx_len
+0x41df mem_tx_power
+0x41e0 mem_context_number
+0x41e1 mem_250k_freq_enable
+0x41e2 mem_rf_init_data
+0x41e3 mem_app_handshake_flag
+0x41e4 mem_sniff_param_interval
+0x41e6 mem_sniff_param_attempt
+0x41e8 mem_sniff_param_timeout
+0x41ea mem_cb_check_wakelock
+0x41ec mem_cb_before_hibernate
+0x41ee mem_cb_before_lpm
+0x41f0 mem_cb_le_process
+0x41f2 mem_cb_bt_process
+0x41f4 mem_cb_idle_process
+0x41f6 mem_cb_bb_event_process
+0x41f8 mem_cb_discovry_timeout
+0x41fa mem_cb_att_write
+0x41fc mem_cb_ble_transmit
+0x41fe mem_cb_event_timer
+0x4200 mem_cb_bt_set_mult
+0x4202 mem_eeprom_base
+0x4204 mem_unsniff2sniff_timer_count
+0x4205 mem_wake_up_delay_timer
+0x4206 mem_app_connection_options
+0x4207 mem_app_disconn_reason
+0x4209 mem_app_disconn_reason_flag
+0x420b mem_lpm_delay_after_sniff
+0x420f mem_xrecord_mode
+0x4210 mem_eeprom_block_size
+0x4211 mem_spi_init_clk
+0x4212 mem_spi_init_delay_time
+0x4213 mem_spi_ncs_gpio
+0x4214 mem_nv_data_ptr
+0x4216 mem_nv_data_number
+0x4217 mem_hci_lt_rx_state
+0x4218 mem_l2cap_xmem_start
+0x4218 mem_l2cap_tx_multi_offset//0 means single packet
+0x421a mem_sdp_remote_cid
+0x421c mem_rfcomm_remote_cid
+0x421e mem_hid_ctrl_remote_cid
+0x4220 mem_hid_int_remote_cid
+0x4222 mem_sdp_state
+0x4223 mem_rfcomm_state
+0x4224 mem_hid_control_state
+0x4225 mem_hid_interrupt_state
+0x4226 mem_spp_state
+0x4227 mem_ML2CAP_comm_id
+0x4228 mem_used_map
+0x4229 mem_tx_fifo0
+0x4229 mem_tx_fifo0_map
+0x422a mem_tx_fifo0_ptr
+0x422c mem_tx_fifo1
+0x422c mem_tx_fifo1_map
+0x422d mem_tx_fifo1_ptr
+0x422f mem_tx_fifo2
+0x422f mem_tx_fifo2_map
+0x4230 mem_tx_fifo2_ptr
+0x4232 mem_tx_fifo3
+0x4232 mem_tx_fifo3_map
+0x4233 mem_tx_fifo3_ptr
+0x4235 mem_tx_fifo_end
+0x4235 mem_l2cap_lpm_txbuf
+0x4335 mem_l2cap_flow_ctrl_flag
+0x4336 mem_l2cap_pending_item
+0x4337 mem_l2cap_xmem_end
+0x4337 mem_le_dsniff
+0x4339 mem_le_conn_interval
+0x433b mem_le_scan_enable
+0x433c mem_le_scan_interval
+0x433e mem_le_scan_window
+0x4340 mem_le_adv_enable
+0x4341 mem_le_adv_data_len
+0x4342 mem_le_adv_data
+0x4361 mem_le_scan_data_len
+0x4362 mem_le_scan_data
+0x4381 mem_le_name_len
+0x4382 mem_le_name
+0x43a0 mem_le_new_map
+0x43a5 mem_le_new_param
+0x43a5 mem_le_new_transmitwindowsize
+0x43a6 mem_le_new_transmitwindowoffset
+0x43a8 mem_le_new_conninterval
+0x43aa mem_le_new_connslavelatency
+0x43ac mem_le_new_connsupervisiontimeout
+0x43ae mem_le_txheader
+0x43af mem_le_txlen
+0x43b0 mem_le_txpayload
+0x43b2 mem_le_txcid
+0x43b4 mem_le_l2cap
+0x43b5 mem_le_l2cap_response
+0x43b6 mem_le_txbdy
+0x43d5 mem_le_pcnt_tx
+0x43da mem_le_pcnt_rx
+0x43df mem_le_last_mic
+0x43e3 mem_le_ivm
+0x43e7 mem_le_ivs
+0x43eb mem_le_ltk
+0x43fb mem_ltk_exists
+0x43fc mem_le_rconfirm
+0x440c mem_le_srand
+0x441c mem_le_iat
+0x441d mem_le_rat
+0x441e mem_le_preq
+0x441f mem_le_preq_iocap
+0x4420 mem_le_preq_oob
+0x4421 mem_le_preq_auth
+0x4422 mem_le_preq_max_keysize
+0x4423 mem_le_preq_init_key_distribution
+0x4424 mem_le_preq_resp_key_distribution
+0x4425 mem_le_pres
+0x4426 mem_le_pres_iocap
+0x4427 mem_le_pres_oob
+0x4428 mem_le_pres_auth
+0x4429 mem_le_pres_max_keysize
+0x442a mem_le_pres_init_key_distribution
+0x442b mem_le_pres_resp_key_distribution
+0x442c mem_le_search_handle_start
+0x442e mem_le_search_handle_end
+0x4430 mem_le_att_offset
+0x4430 mem_le_search_att_type_length
+0x4431 mem_le_search_att_type
+0x4441 mem_le_notify_handle
+0x4443 mem_le_search_uuid_length
+0x4444 mem_le_search_uuid
+0x4454 mem_le_adv_param
+0x4454 mem_le_adv_interval
+0x4456 mem_le_adv_type
+0x4457 mem_le_adv_own_addr_type
+0x4458 mem_le_adv_direct_addr_type
+0x4459 mem_le_adv_direct_addr
+0x445f mem_le_adv_channel_map
+0x4460 mem_le_conn_param
+0x4460 mem_le_conn_peer_addr_type
+0x4461 mem_le_conn_peer_addr
+0x4467 mem_le_conn_own_addr_type
+0x4468 mem_le_interval_min
+0x446a mem_le_interval_max
+0x446c mem_le_latency
+0x446e mem_le_timeout
+0x4470 mem_le_scan_params
+0x4470 mem_le_scan_type
+0x4471 mem_le_scan_own_addr_type
+0x4472 mem_le_lap
+0x4475 mem_le_uap
+0x4476 mem_le_nap
+0x4478 mem_le_local_mtu
+0x447a mem_le_remote_mtu
+0x447c mem_le_skdm
+0x4484 mem_le_skds
+0x448c mem_le_init_superto
+0x448e mem_ui_le_uuid_table
+0x4490 mem_le_secure_connect_enable
+0x4491 mem_le_secure_connect_flag
+0x4492 mem_le_sc_calc
+0x4493 mem_le_secure_connect_state
+0x4494 mem_le_sc_confirm_gkey_flag
+0x4495 mem_le_sc_local_key_invalid
+0x4496 mem_le_pairing_state
+0x4497 mem_le_enc_state
+0x4498 mem_le_pairing_mode
+0x4499 mem_le_tk
+0x449d mem_le_ediv
+0x449f mem_le_rand
+0x44a7 mem_le_irk
+0x44b7 mem_le_transmit_window
+0x44bb mem_le_configuration
+0x44bc mem_le_fixed_ltk
+0x44cc mem_le_pairing_handle
+0x44ce mem_le_l2cap_size
+0x44d0 mem_le_packet_len_recved
+0x44d1 mem_le_tx_buff_used
+0x44d2 mem_le_tx_ptr0
+0x44d4 mem_le_tx_ptr1
+0x44d6 mem_le_tx_ptr2
+0x44d8 mem_le_tx_ptr3
+0x44da mem_le_signaling_identifier
+0x44db mem_le_l2cap_signaling_conn_param_update_rsp_result
+0x44dd mem_le_packet_size
+0x44de mem_le_packet_llid
+0x44df mem_le_payload_ptr
+0x44e1 mem_le_md_count
+0x44e2 mem_lmp_version
+0x44e5 mem_lmp_subversion
+0x44e7 mem_local_name_length
+0x44e8 mem_local_name
+0x44eb mem_local_name2
+0x452b mem_local_name_end
+0x452c mem_unsniff2sniff_timer
+0x452d mem_switch_flag
+0x452e mem_classic_bt_flag
+0x452f mem_pn_dlci
+0x4530 mem_pn_max_frame_size
+0x4532 memFCStemp1
+0x4533 memFCStemp2
+0x4534 memFCStemp3
+0x4535 mem_rfcomm_initiator
+0x4536 mem_remote_spp_channel
+0x4537 mem_HIUfcs_SPP
+0x4538 mem_HIUfcs_SPP_WCredits
+0x4539 mem_rfcomm_send_more_pkt
+0x453a mem_remote_credits
+0x453b mem_credit_given
+0x453c mem_ms_channel
+0x453d mem_credit_flag
+0x453e mem_rfcomm_max_frame_size
+0x4540 mem_rfcomm_credit_init_data
+0x4541 mem_cb_receive_spp_data
+0x4543 mem_nl_rx_data_src
+0x4545 mem_nl_rx_len_all
+0x4547 mem_ui_uuid_table
+0x4549 mem_all_uuid_16bits
+0x455f mem_all_uuid_128bits
+0x4581 mem_sdp_l2capch_ptr
+0x4583 mem_sp_local_key_invalid
+0x4584 mem_le_private_key_256
+0x45a4 mem_le_pubkey_local_x_256
+0x45c4 mem_le_pubkey_local_y_256
+0x45e4 mem_sp_private_key
+0x45fc mem_sp_pubkey_local
+0x45fc mem_sp_pubkey_local_x
+0x4614 mem_sp_pubkey_local_x_end
+0x4614 mem_sp_pubkey_local_y
+0x462c mem_ssp_enable
+0x462d mem_sp_iocap_local
+0x4630 mem_sp_iocap_remote
+0x4633 mem_flag_mode_ssp_pin
+0x4634 mem_ssp_mode_flag
+0x4635 mem_authentication_passkey_times
+0x4636 mem_passkey_1bit
+0x4637 mem_flag_pairing_state
+0x4638 mem_ipc_lock_bt
+0x4639 mem_ipc_lock_c51
+0x463a mem_ipc_fifo_bt2c51
+0x4642 mem_ipc_fifo_c512bt
+0x464a mem_ui_timer_last_btclk
+0x464e mem_discovery_timeout_timer_count
+0x4650 mem_hid_handshake_timer_count
+0x4651 memui_reconnect_mode
+0x4652 mem_ui_state_map
+0x4654 mem_ui_profile_supported
+0x4655 mem_discovery_timeout
+0x4657 mem_pin_length
+0x4658 mem_pin
+0x4668 mem_soft_version_num
+0x466a mem_current_packet_length
+0x466c mem_module_state
+0x466d mem_module_spp_lpm_mult
+0x466e mem_module_le_lpm_mult
+0x466f mem_module_bluetooth_stauts_by_command
+0x4670 mem_module_le_rx_data_len
+0x4671 mem_module_le_rx_data_address
+0x4673 mem_module_le_rx_data_handle
+0x4675 mem_module_data_write_handle
+0x4677 mem_module_data_write_handle2
+0x4679 mem_module_flag
+0x467a mem_module_hci_notify_len
+0x467b mem_module_hci_notify_handle
+0x467d mem_module_hci_nofiy_addr
+0x467f mem_last_transmite_clock
+0x4683 mem_module_uuid_list_end
+0x4683 mem_module_le_att_list
+0x4845 mem_module_le_att_list_end
+0x4845 mem_module_nv_data
+0x4845 mem_module_nv_data0
+0x4867 mem_module_nv_data1
+0x4889 mem_module_nv_data2
+0x48ab mem_module_nv_data3
+0x48cd mem_module_nv_data4
+0x48ef mem_module_nv_data5
+0x4911 mem_module_nv_data6
+0x4933 mem_module_nv_data7
+0x4955 mem_le_buff_len
+0x4957 mem_le_buff_len_all
+0x4959 mem_ipcbuf_bt2m0_flag
+0x495a mem_ipcbuf_bt2m0_write
+0x495c mem_ipcbuf_bt2m0_read
+0x495e mem_context_cnt
+0x495f mem_context_map
+0x4960 mem_context_new
+0x49b0 mem_context_new2
+0x4a00 mem_context_new3
+0x4a50 mem_context_new4
+0x4aa0 mem_context_new5
+0x4af0 mem_context_new6
+0x4b40 mem_context_new7
+0x4b90 mem_context_new8
+0x4be0 mem_context_extend
+0x4e40 mem_le_pairing_sm_flag
+0x4e41 mem_le_fifo_error
+0x4e42 mem_end2
+0x0b1e mem_module_prepare_write_request_packet
+0x0b1e mem_module_prepare_write_request_PDU_length
+0x0b20 mem_module_prepare_write_request_Channel_ID
+0x0b22 mem_module_prepare_write_request_opcode
+0x0b23 mem_module_prepare_write_request_handle
+0x0b25 mem_temp_prepare_write_request_Data
+0x0c29 mem_le_l2capbuf_new
+0x0d2d mem_le_l2capbuf_new_end
+0x0d2d mem_smp_buf_temp
+0x0efd mem_end1
+0x0b1e mem_usb_status
+0x0b1f mem_usb_fifo_empty
+0x0b20 mem_usb_read_len
+0x0b21 mem_usb_rxbuf
+0x0b61 mem_bufptr
+0x0b63 mem_remain
+0x0b64 mem_devicedesc
+0x0b78 mem_hidreportdesc_kb
+0x0b7a mem_hidreportdesc_m
+0x0b7c mem_confdesc
+0x0be0 mem_string0
+0x0be5 mem_string1
+0x0c03 mem_string2
+0x0c43 mem_string3
+0x0c61 mem_usb_zero_packet
+0x0c63 mem_usb_ones_packet
+0x0c65 mem_usb_two_packet
+0x0c67 mem_usb0_state
+0x0c68 mem_usb_offline_check_gpio
+0x0c69 mem_usb_tx_interval
+0x0c6a mem_usb_clear_mem_start
+0x0c6a mem_usb_setup
+0x0c6a mem_usb_setup_bmRequestType
+0x0c6b mem_usb_setup_bRequest
+0x0c6c mem_usb_setup_bValue
+0x0c6d mem_usb_setup_bValueH
+0x0c6e mem_usb_setup_wIndex
+0x0c70 mem_usb_setup_bLength
+0x0c71 mem_usb_setup_bLengthH
+0x0c72 mem_usb0_setup
+0x0cb2 mem_usb0_set_report_data
+0x0cf2 mem_usb0_get_report_data
+0x0d32 mem_usb_state
+0x0d33 mem_usb_tx_wait
+0x0d34 mem_usb_tx_enable
+0x0d35 mem_usb_remote_wakeup
+0x0d36 mem_usb_clear_remote_wakeup
+0x0d37 mem_usb_ep0_stall_status
+0x0d38 mem_usb_ep1_stall_status
+0x0d39 mem_usb_ep2_stall_status
+0x0d3a mem_usb_ep3_stall_status
+0x0d3b mem_dsc_info_data_pointer
+0x0d3d mem_dsc_info_len
+0x0d3e mem_usb0_data_ready_report
+0x0d3f mem_usb_tx_win_enable
+0x0d40 mem_usb_tx_mac_enable
+0x0d41 mem_usb_device_enumeration_endflag
+0x0d42 mem_usb_wakestate_onetime_flag
+0x0d43 mem_usb_mac_wakeup_trig
+0x0d44 mem_usb_set_high_addr_flag
+0x0d45 mem_usb_set_protocol_value
+0x0d46 mem_usb_set_protocol_status
+0x0d47 mem_usb_get_protocol_flag
+0x0d48 mem_usb_idle_flag
+0x0d49 mem_usb_idle_rate
+0x0d4a mem_usb_setup_bValue_temp
+0x0d4c mem_usb0_get_set_report
+0x0d4d mem_usb_ep1_data
+0x0d4e mem_usb_ep2_data
+0x0d4f mem_usb_clear_halt
+0x0d50 mem_usb_mouse_data
+0x0d60 mem_usb_kb_data
+0x0d70 mem_usb_kb_multikey
+0x0d80 mem_usb_kb_data_sta_data
+0x0d88 mem_usb_kb_data_last_data
+0x0d90 mem_usb_kb_multikey_sta_data
+0x0d93 mem_usb_kb_multikey_last_data
+0x0d96 mem_usb_kb_blank_data_enable
+0x0d97 mem_usb_kb_mul_blank_data_enable
+0x0d98 mem_usb_test_cnt
+0x0d99 mem_usb_clear_mem_end
+0x0d99 mem_usb_test_kb
+0x0d9a mem_rssi_noise_buffer
+0x0e9a mem_rssi_noise_dg_buffer
+0x0f9a mem_rssi_noise_ms_buffer
+0x109a mem_rssi_noise_kb_buffer
+0x119a mem_24g_common_temp
Index: BlueTooth/BT_code_patch/key/trunk/patch/patch.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/patch/patch.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/patch/patch.prog	(working copy)
@@ -0,0 +1,1435 @@
+
+
+/******************************************/
+/**************   Start   *****************/
+/******************************************/
+
+p_start:
+	bbit1 8,pf_patch_ext
+	beq patch00_1,p_soft_reset
+	beq patch00_5,p_connection_incontext
+	beq patch05_2,p_context_load
+	beq patch05_3,p_context_save
+	beq patch05_4,p_context_new
+	beq patch05_6,p_context_search
+	beq patch10_5,p_shutdown_radio
+	beq patch11_1,p_set_freq_tx
+	beq patch12_4,p_ahead_window
+	beq patch14_2,p_init_param
+	beq patch14_3,p_lpm_adjust_clk
+	beq patch15_1,p_lpm_dispatch_next
+	beq patch15_4,p_lpm_unconn_nossp
+//	beq patch16_1,p_lpm_check_wake_lock
+	beq patch17_0,p_module_init
+	beq patch17_3,p_module_hci_cmd_control
+	beq patch17_4,p_module_hci_cmd_transmit_le_notify
+	beq patch1d_3,p_le_init_conn
+	beq patch1e_3,p_le_slave_cont
+	beq patch1e_6,p_le_disconnect
+	branch assert
+	
+pf_patch_ext:
+	beq patch20_3,p_le_receive_skip
+	beq patch20_5,p_le_transmit_receive_sifs
+	beq patch22_0,p_le_update_param
+	beq patch23_4,p_le_prepare_tx
+	beq patch24_2,p_le_parse_l2cap	
+	beq patch24_3,p_le_adv_loop
+	beq patch24_5,p_le_adv_not_match
+	beq patch26_3,p_le_pairing_sm
+	beq patch26_5,p_le_parse_ll
+	beq patch27_2,p_parse_lmp
+
+	beq patch27_6,p_send_lmp
+	beq patch28_1,p_ssp_disable
+	beq patch2a_2,p_parse_dlci0_rp
+	beq patch33_1,p_sp_initialize_256
+	beq patch33_7,p_ui_ipc_send_event
+	beq patch34_1,p_check_51cmd
+	branch assert
+
+
+	
+p_ahead_window:
+	copy temp,pdata
+	call clk2bt
+	lshift16 bt_clk,pdata
+	set1 44,pdata
+	call clk_diff
+	set0 44,pdata
+	call get_clk
+	call clk_diff
+	rtn user
+	call p_clk2rt
+	branch ahead_window+12
+    
+p_lpm_adjust_clk:
+	deposit clke
+	call p_clk_diff_rt
+	branch lpm_adjust_clk+3
+
+p_lpm_dispatch_next:
+	fetch 2,mem_context + coffset_rx_window
+	rshift pdata,pdata
+	call clk2bt
+	deposit alarm
+	call clk_diff
+	copy clke,temp
+	call p_clk_diff_rt
+	branch lpm_dispatch_next+30
+
+p_clk_diff_rt:
+	call clk_diff
+p_clk2rt:
+	iforce contr
+	set0 16,contr
+	branch clk2rt+1
+
+	
+p_soft_reset:
+	call rfcomm_init
+	call init_lmp
+	call p_ui_init
+	branch soft_reset + 9
+
+p_ui_init:
+	rtn wake
+	branch ui_timer_init
+
+p_shutdown_radio:
+	branch p_shutdown_radio0,is_rx
+	hjam 0xd4, 0x955
+	nop 4
+	hjam 0xd2, 0x955
+	nop 4
+	hjam 0xd1, 0x955
+	nop 4	
+	fetch 1,mem_tx_power
+	beq TX_POWER_0DB,p_shutdown_radio_0db
+	beq TX_POWER_3DB,p_shutdown_radio_3db
+	beq TX_POWER_5DB,p_shutdown_radio_5db
+	beq TX_POWER_f3DB,p_shutdown_radio_f3db
+	beq TX_POWER_f5DB,p_shutdown_radio_f5db
+	beq TX_POWER_PAIR,p_shutdown_radio_pair
+p_shutdown_radio_5db:	
+p_shutdown_radio_0db:
+	hjam 0xd0, 0x955
+	hjam 0xe0, 0x956
+p_shutdown_radio0:
+	force 0x08,radio_ctrl
+	force 0,radio_ctrl
+	disable is_rx
+	disable is_tx
+	pulse packet_end
+	hjam 0x0,rfen_mdm
+	hjam 0x0,rfen_tx
+	hjam 0x0,rfen_rx
+	hjam 0,rfen_sn
+	hjam 0x70,rfen_msc
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	rtn
+	
+p_shutdown_radio_pair:
+p_shutdown_radio_f5db:
+p_shutdown_radio_f3db:
+p_shutdown_radio_3db:
+	hjam 0xd0,0x955
+	hjam 0xc0,0x956
+	branch p_shutdown_radio0
+
+p_set_freq_tx:
+	storet 1,mem_last_freq
+	call set_freq_tx_offset
+	call rf_write_freq
+	setarg param_pll_setup
+	call sleep
+p_txon:	
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	branch txon+1
+
+
+p_init_param:
+	hjam 0x7c,rfen_adc
+	rtn wake
+	setarg 0
+	store 2,mem_tx_len
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+	
+p_lpm_unconn_nossp:
+	branch lpm_unconn_cont				//BT/BLE discover don't infect lpm
+
+
+p_module_init:
+//	setarg p_module_process_bb_event
+	setarg 0
+	store 2,mem_cb_bb_event_process
+	store 2,mem_cb_event_timer
+
+	setarg p_module_le_receive_data
+	store 2,mem_cb_att_write
+
+	setarg module_lpm_lock
+	store 2,mem_cb_check_wakelock
+
+	setarg p_module_bt_conn_process
+	store 2,mem_cb_bt_process
+
+	setarg p_module_hci_event_receive_spp_data
+	store 2,mem_cb_receive_spp_data
+
+	call module_lpm_uart_init
+	call module_gpio_init
+	call check_module_disabled
+	branch module_hci_event_enter_standby_mode
+
+
+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
+//	copy loopcnt,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 p_module_hci_event_receive_le_data_notify,zero
+	jam HCI_EVENT_LE_DATA_REP,mem_module_uart_opcode
+	fetch 1,mem_module_le_rx_data_len
+	icopy loopcnt
+	increase 3,pdata
+	call module_hci_prepare_tx
+	fetch 1,mem_le_conn_handle
+	istore 1,contwu
+	branch module_hci_event_receive_le_data+5
+
+
+	
+p_module_bt_conn_process:
+	call p_module_spp_enter_sniff
+	branch module_control_air_flow
+
+p_module_spp_enter_sniff:
+	branch module_spp_enter_sniff+1
+
+p_module_hci_event_receive_spp_data:
+	call module_spp_clear_last_transmite_clock
+p_ng_event_receive_spp_data0:
+	jam HCI_EVENT_SPP_DATA_REP,mem_module_uart_opcode
+	fetch 2,mem_current_length
+	rtn blank
+	arg 255,temp
+	call not_greater_than
+	copy pdata,loopcnt
+	fetch 2,mem_current_length
+	isub loopcnt,pdata
+	store 2,mem_current_length
+	copy loopcnt,pdata
+	call module_hci_prepare_tx
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call uart_copy_tx_bytes_fast
+	copy contr,pdata
+	store 2,mem_rfcomm_uih_payload_ptr
+	call uartd_send
+	branch p_ng_event_receive_spp_data0
+
+
+p_module_hci_cmd_transmit_le_notify:
+//	bpatch patch17_4,mem_patch17
+	add temp,-3,pdata		//sub handle and opcode
+	fetcht 1,mem_module_hci_notify_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_module_hci_notify_len
+	fetcht 2,mem_module_hci_notify_handle
+	call le_att_malloc_tx_notify
+	fetch 2,mem_module_hci_nofiy_addr
+	copy pdata,contru
+	copy rega,loopcnt
+	call uart_copy_rx_bytes_fast
+	call p_le_add_handle2	
+	copy contru,pdata
+	store 2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	branch module_set_le_tx_data_flag
+
+
+p_module_hci_cmd_control:
+	fetch 1,mem_module_uart_opcode
+//	beq HCI_CMD_SET_PAIRING_REQ,p_module_hci_cmd_set_pairing_mode
+//	beq HCI_CMD_SET_COD,module_hci_cmd_le_set_adv_data_set_cod
+	beq HCI_CMD_LE_DATA_REQ,p_module_hci_cmd_receive_le_data
+	beq HCI_CMD_SLEEP,p_module_hci_cmd_enter_sleep
+	beq HCI_CMD_SET_NVRAM_REQ,p_module_hci_cmd_set_nvram
+	beq HCI_CMD_LE_SEND_CONN_UPDATE_REQ,p_module_hci_cmd_le_send_conn_update_req
+	beq HCI_CMD_LE_START_PAIRING,p_module_hci_cmd_le_start_pairing
+	branch module_hci_cmd_control + 2
+
+p_module_hci_cmd_le_send_conn_update_req:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	fetch 1,mem_module_uart_len
+	bne 0x09,module_hci_event_receive_invalid_cmd
+	call p_module_hci_check_conn_handle
+	nrtn blank
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet	
+//	copy rega,contru
+//	ifetch 1,contru
+	ifetch 8,contru
+	store 8,mem_le_interval_min
+	call le_l2cap_tx_update_req
+	call p_le_add_handle2
+	branch module_hci_event_receive_valid_cmd	
+
+//command opcode 0x38
+p_module_hci_cmd_le_start_pairing:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	fetch 1,mem_le_pairing_mode
+	branch module_hci_event_receive_invalid_cmd,blank
+	call p_module_hci_check_conn_handle
+	nrtn blank
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet	
+	ifetch 1,temp
+	bbit1 lestate_encryption,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd	
+	call le_send_smp_security_request
+	branch p_le_add_handle2
+
+
+p_context_check_enc:
+	arg p_context_search_handle_enc,regc
+	branch context_search
+	
+p_context_search_handle_enc:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit0 mode_le,context_search_next
+	add rega,coffset_conn_handle,contr
+	ifetch 1,contr
+	isub temp,null
+	rtn zero
+	branch context_search_next
+	
+p_module_hci_cmd_set_nvram:
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	increase -2,loopcnt
+	copy rega,contru
+	fetch 2,mem_nv_data_ptr
+	ifetcht 2,contru
+	iadd temp,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+p_check_handle:	
+	fetcht 1,mem_le_conn_handle
+	isub temp,null
+	rtn
+
+p_module_hci_check_conn_handle:
+//call ice_break
+	copy rega,rege
+	ifetcht 1,contru
+//	rshift4 temp,temp
+	call p_context_search_conn_handle2
+	nbranch p_module_hci_event_invalid_cmd_disblank,zero
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	storet 1,mem_le_conn_handle
+	copy rega,temp
+	copy rege,rega
+	branch enable_blank
+	
+
+/*
+p_module_hci_check_conn_handle:
+//call ice_break
+	copy rega,rege
+	ifetcht 1,contru
+//	rshift4 temp,temp
+	call p_context_search_conn_handle2
+	nbranch p_module_hci_event_invalid_cmd_disblank,zero
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+//	bmark0 mark_context,disable_blank
+	copy rege,rega
+	ifetch 1,rega
+//	rshift4 pdata,pdata
+	call p_check_handle
+	branch enable_blank,zero
+	branch disable_blank
+*/
+	
+p_context_search_conn_handle2:
+	arg p_context_search_handle,regc
+	branch context_search
+	
+p_context_search_handle:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit0 mode_le,context_search_next
+	branch context_search_handle+1
+	
+p_module_hci_event_invalid_cmd_disblank:
+	call p_module_hci_event_receive_invalid_cmd
+	branch disable_blank
+	
+p_module_hci_event_receive_invalid_cmd:
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet	
+	branch module_hci_event_receive_invalid_cmd	
+
+p_module_hci_cmd_receive_le_data:
+	call p_module_hci_check_conn_handle
+	nrtn blank
+	copy rega,contru
+//	call module_check_ble_encrypt_state
+//	branch module_hci_event_receive_invalid_cmd,user
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	fetch 1,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_FINISH,module_hci_cmd_receive_le_data_finish
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	ifetch 1,contru
+	ifetch 2,contru		//handle
+	store 2,mem_module_hci_notify_handle
+	copy contru,pdata
+	store 2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_uart_len
+	pincrease -3
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	branch module_hci_event_receive_invalid_cmd,zero
+	store 1,mem_module_hci_notify_len
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+//	call le_set_config_more_data
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	fetch 1,mem_module_flag
+	rtnbit0 MODULE_FLAG_BLE_DATA_FINISH
+	branch module_hci_cmd_receive_le_data_finish
+
+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
+	branch app_enter_hibernate
+
+
+p_module_hci_cmd_transmit_handle_error:
+	jam 0,mem_module_hci_notify_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_invalid_cmd
+
+p_le_update_param:
+	jam BT_EVT_LE_CONN_PARAM_UPDATE,mem_fifo_temp
+	call ui_ipc_send_event	
+	branch le_update_param+8
+
+p_le_receive_skip:
+	call save_rssi
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	copy pdata,loopcnt
+	branch lerx_nopayload,blank
+	branch lerx_loop
+
+p_le_transmit_receive_sifs:
+	call le_transmit
+	call set_sync_on
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	nop 1500
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup 
+	branch le_receive_rxon
+
+
+p_check_ipcbuf_size:
+	jam 0,mem_ipcbuf_bt2m0_flag
+	//call	p_get_ipc_tx_buff
+	fetcht 2,IPC_BT2M0_START_ADDR
+	fetch 2,IPC_BT2M0_END_ADDR
+	isub temp,rega
+	fetcht 2,IPC_BT2M0_READ_PTR
+	fetch 2,IPC_BT2M0_WRITE_PTR
+	storet 2,mem_ipcbuf_bt2m0_read
+	store 2,mem_ipcbuf_bt2m0_write
+	isub temp,pdata
+	branch start_calc_ipcbuf,positive
+	branch start_calc_ipcbuf,zero
+	copy rega,temp
+	fetch 2,mem_ipcbuf_bt2m0_write
+	iadd temp,pdata
+	fetcht 2,mem_ipcbuf_bt2m0_read
+	isub temp,pdata
+	//store 2,0x4bfc
+start_calc_ipcbuf:	
+	arg 0x300,temp
+	isub temp,null
+	nrtn positive
+	jam 1,mem_ipcbuf_bt2m0_flag
+	rtn
+	
+p_le_pairing_sm:
+	call le_fifo_check_nearly_full
+	nrtn blank
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_NULL,le_pairing_sm_null
+	beq FLAG_LE_PAIRING_START,p_le_pairing_sm_start
+	beq FLAG_LE_PAIRING_SEND_RECURITY_REQ,le_pairing_sm_send_sec_req
+	beq FLAG_LE_PAIRING_RCV_PAIRING_REQ,p_le_pairing_sm_rcv_pairing_req
+	beq FLAG_LE_PAIRING_AFTER_AUTH,p_le_pairing_sm_after_auth
+	beq FLAG_LE_PARING_SEND_ENC_INFORMATION,p_le_pairng_sm_send_enc_information
+	beq FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,p_le_pairng_sm_send_master_indentification
+	beq FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,p_le_pairng_sm_send_indentity_information
+	rtn
+
+p_le_pairing_sm_rcv_pairing_req:
+	jam FLAG_LE_PAIRING_AUTH,mem_le_pairing_state
+	branch le_clr_config_more_data
+
+p_le_pairng_sm_send_indentity_information:	
+	call le_set_config_more_data
+	call le_send_smp_identity_address_information
+	call p_le_add_handle2
+	branch le_parse_start_enc_rsp_after_auth_end
+
+p_le_pairng_sm_send_master_indentification:	
+	fetch 1,mem_le_preq_resp_key_distribution
+	fetcht 1,mem_le_pres_resp_key_distribution
+	iand temp,pdata
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_parse_start_enc_rsp_after_auth_end,true
+	jam FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,mem_le_pairing_state
+	call le_send_smp_identity_information
+	branch p_le_add_handle2
+
+p_le_pairng_sm_send_enc_information:
+	call le_pairng_sm_send_enc_information
+	branch p_le_add_handle2
+
+p_le_pairing_sm_start:
+	jam FLAG_LE_PAIRING_SEND_RECURITY_REQ,mem_le_pairing_state
+	call le_send_smp_security_request
+	branch p_le_add_handle2
+
+	
+p_le_pairing_sm_after_auth:
+	fetch 1,mem_le_enc_state
+	beq FLAG_LE_SEND_START_ENC_RSP,p_le_pairing_sm_after_auth_start_enc
+	rtn
+	
+p_le_pairing_sm_after_auth_start_enc:
+	jam FLAG_LE_PARING_SEND_ENC_INFORMATION,mem_le_pairing_state
+	jam BT_EVT_LE_ENC_INFO,mem_fifo_temp
+	call ui_ipc_send_event
+	call le_send_smp_encryption_information
+	call p_le_add_handle2
+	fetch 1,mem_device_option
+	rtnne dvc_op_module
+	call le_check_master_addr_type
+	rtn user
+	branch app_ble_store_reconn_info
+		
+p_le_parse_ll:
+	fetch 1,mem_le_rxbuf+2
+	beq LL_CONNECTION_UPDATE_REQ,le_parse_connection_update_req
+	beq LL_CHANNEL_MAP_REQ,le_parse_channel_map_req
+	beq LL_TERMINATE_IND,le_parse_terminate_ind
+	beq LL_ENC_REQ,p_le_parse_enc_req
+	beq LL_ENC_RSP,le_parse_enc_rsp
+	beq LL_START_ENC_REQ,le_parse_start_enc_req
+	beq LL_START_ENC_RSP,p_le_parse_start_enc_rsp
+	beq LL_UNKNOWN_RSP,le_parse_unknown_rsp
+	beq LL_FEATURE_REQ,p_le_parse_feature_req
+	beq LL_FEATURE_RSP,le_parse_feature_rsp
+	beq LL_PAUSE_ENC_REQ,p_le_parse_pause_enc_req
+	beq LL_PAUSE_ENC_RSP,le_parse_pause_enc_rsp
+	beq LL_VERSION_IND,p_le_parse_version_ind
+	beq LL_REJECT_IND,le_parse_reject_ind
+	beq LL_PING_REQ,p_le_parse_ping_req
+	beq LL_PING_RSP,le_parse_ping_rsp
+	beq LL_LENGTH_REQ,le_parse_length_request
+	rtneq  LL_LENGTH_RSP
+	arg 2,rega
+	arg LL_UNKNOWN_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 1,mem_le_rxbuf+2
+	istore 1,contw
+	rtn		
+
+p_le_parse_ping_req:
+	call le_parse_ping_req
+	branch p_le_add_handle2
+
+p_le_parse_version_ind:
+	call le_parse_version_ind
+	branch p_le_add_handle2
+
+p_le_parse_pause_enc_req:
+	jam FLAG_LE_ENC_PAUSE,mem_le_enc_state
+	call le_send_pause_enc_rsp	
+	call p_le_add_handle2
+	jam BT_EVT_LE_PAUSE_ENC,mem_fifo_temp
+	branch ui_ipc_send_event	
+
+p_le_parse_feature_req:
+	call le_parse_feature_req
+	branch p_le_add_handle2
+	
+p_le_parse_start_enc_rsp:
+	call le_parse_start_enc_rsp+1
+	branch p_le_add_handle2
+	
+p_le_parse_enc_req:
+	ifetch 8,contr
+	store 8,mem_le_rand
+	ifetch 2,contr
+	store 2,mem_le_ediv
+	ifetch 8,contr
+	store 8,mem_le_skdm
+	ifetch 4,contr
+	store 4,mem_le_ivm
+	call le_send_enc_rsp
+	call p_le_add_handle2
+//	bpatchx patch26_6,mem_patch26
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_AFTER_AUTH,p_le_parse_enc_req_after_auth
+//	fetch 1,mem_le_configuration
+//	bbit1  BIT_BLE_PAIRING_FIXED_LTK,le_parse_enc_req_fixed_ltk
+	fetch 1,mem_nv_data_number
+	ncall load_device_list_mode_4,blank
+	fetch 1,mem_ltk_exists
+	beq 0,le_ltk_lost
+p_le_parse_enc_req_after_auth:
+	jam FLAG_LE_RCV_ENC_START,mem_le_enc_state
+	call  le_send_start_enc_req
+	call p_le_add_handle2
+	branch generate_sk
+	
+le_parse_length_request:
+//	ifetch 2,contr
+//	store 2,mem_module_master_rx_max
+//	branch le_send_length_res
+le_send_length_res:
+	arg 9,rega
+	arg LL_LENGTH_RSP,regb
+	call le_fifo_malloc_tx_ll
+	//MaxRxOctets >=27B <=251
+	setarg 27
+	istore 2,contw
+	//MaxRxTime >=328ms <=2120
+	setarg 2120
+	istore 2,contw
+	//MaxTxOctets >=27B
+	setarg 27
+	istore 2,contw
+	//MaxTxTime >=328ms
+	setarg 2120
+	istore 2,contw
+	branch p_le_add_handle2
+
+
+p_le_check_fifo_with_handle:
+	ifetch 1,contr
+	iadd contr,contr
+	add contr,2,contr
+	ifetch 1,contr
+	branch assert,blank
+	fetcht 1,mem_le_conn_handle
+	isub temp,null
+	rtn
+	
+//return flag blank 
+p_le_check_first_fifo_with_handle:
+	call le_fifo_get_first_tx_ptr
+	rtn blank
+	copy contr,rega
+	call p_le_check_fifo_with_handle
+	branch disable_blank,zero
+	call p_le_check_connect_handle
+	nbranch p_le_fifo_release_first_node,zero
+	branch enable_blank
+
+p_le_fifo_release_first_node:	
+	fetch 1,mem_le_fifo_error
+	increase 1,pdata
+	store 1,mem_le_fifo_error
+	call le_fifo_release_first_node
+	branch enable_blank
+
+p_le_check_connect_handle:
+	/* return zero if conn handle is found */
+	branch context_search_conn_handle2
+
+//return flag blank 
+p_le_check_sec_fifo_with_handle:
+	call le_fifo_get_second_tx_ptr
+	rtn blank
+	call p_le_check_fifo_with_handle
+	branch disable_blank,zero
+	branch enable_blank
+	
+p_le_check_continue:
+	ifetch 1,contr				//pdata:length
+	ifetcht 1,contr				//temp:offest
+	isub temp,pdata			//pdata:length - offset
+	sub pdata,LE_MAX_PAKET_LEN,null	
+	branch le_clear_md,positive				//27 > length -offset
+	branch le_set_md
+
+p_le_check_tx_md:	
+	call p_le_check_continue
+	rtnmark1 mark_ble_tx_md
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_TRANSMIT_PACKET_BY_MD,le_clear_md
+	call p_le_check_sec_fifo_with_handle 	//no packet to send
+	branch le_clear_md,blank
+	branch le_set_md
+
+p_le_prepare_tx:
+//	bpatchx patch23_4,mem_patch23
+	fetch 1,mem_le_arq
+	rtnbit1 wak
+//	call le_fifo_get_first_tx_ptr	//no packet to send
+//	branch le_send_empty,blank
+	call p_le_check_first_fifo_with_handle
+	branch le_send_empty,blank	
+	copy rega,regc
+	copy rega,contr
+	call p_le_check_tx_md
+	copy regc,contr
+	branch le_prepare_tx+6
+
+p_le_parse_l2cap:
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,p_le_parse_att
+	beq LE_L2CAP_CID_SMP,p_le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+	
+p_le_parse_smp:
+	ifetch 1,contr
+	beq SMP_PAIRING_REQUEST,p_le_parse_smp_pairing_request
+//	beq SMP_PAIRING_RESPONSE,le_parse_smp_pairing_response
+	beq SMP_PAIRING_CONFIRM,p_le_parse_smp_pairing_confirm
+	beq SMP_PAIRING_RANDOM,p_le_parse_smp_pairing_random
+	beq SMP_PAIRING_FAILED,le_parse_smp_pairing_failed
+	beq SMP_ENCRYPTION_INFORMATION,le_parse_smp_encryption_information
+	beq SMP_MASTER_IDENTIFICATION,le_parse_smp_master_identification
+	beq SMP_IDENTITY_INFORMATION,le_parse_smp_identity_information
+	beq SMP_IDENTITY_ADDRESS_INFORMATION,le_parse_smp_identity_address_information
+	beq SMP_SIGNING_INFORMATION,le_parse_smp_signing_information
+	beq SMP_SECURITY_REQUEST,le_parse_smp_security_request
+	beq SMP_PAIRING_PUBLIC_KEY,le_parse_smp_public_key
+	beq SMP_PAIRING_DHKEY_CHECK,le_parse_smp_dhkey_check
+	rtn
+
+p_le_parse_smp_pairing_request:
+	call le_parse_smp_pairing_request
+	branch p_le_add_handle
+
+p_le_parse_smp_pairing_confirm:
+	call le_parse_smp_pairing_confirm
+	branch p_le_add_handle
+
+p_le_parse_smp_pairing_random:
+	call le_parse_smp_pairing_random
+	branch p_le_add_handle
+	
+	
+p_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+//	beq ATTOP_HANDLE_VALUE_CONFIRMATION,p_le_parse_handle_value_confirmation
+	beq ATTOP_READ_BY_GROUP_TYPE_REQUEST,p_le_parse_att_read_by_group_type_request
+	beq ATTOP_READ_BY_TYPE_REQUEST,p_le_parse_att_read_by_type_request
+
+	beq ATTOP_FIND_INFORMATION_REQUEST,p_le_parse_att_find_information_request
+	beq ATTOP_FIND_BY_TYPE_VALUE_REQUEST,p_le_parse_att_find_by_type_value_request
+//	beq ATTOP_READ_BY_TYPE_REQUEST,le_parse_att_read_by_type_request
+	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
+	beq ATTOP_READ_BLOB_REQUEST,p_le_parse_att_read_blob_request
+//	beq ATTOP_READ_BY_GROUP_TYPE_REQUEST,le_parse_att_read_by_group_type_request
+	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request
+	beq ATTOP_PREPARE_WRITE_REQUEST,p_le_parse_att_prepare_write_request
+	beq ATTOP_EXECUTE_WRITE_REQUEST,p_le_parse_att_execute_write_request
+	beq ATTOP_WRITE_COMMAND,le_parse_att_write_command
+	beq ATTOP_EXCHANGE_MTU_REQUEST,p_le_parse_att_exchange_mtu_request
+	beq ATTOP_EXCHANGE_MTU_RESPONSE,le_parse_att_exchange_mtu_response
+	rtn
+
+p_le_parse_att_execute_write_request:
+	call le_parse_att_execute_write_request
+	branch p_le_add_handle
+
+p_le_parse_att_prepare_write_request:
+	call le_parse_att_prepare_write_request
+	branch p_le_add_handle
+
+p_le_parse_att_write_request:
+	call le_parse_att_write_request
+	branch p_le_add_handle
+
+p_le_parse_att_read_blob_request:
+	call le_parse_att_read_blob_request	
+	branch p_le_add_handle
+
+p_le_parse_att_read_request:
+	call le_parse_att_read_request
+	branch p_le_add_handle
+
+p_le_parse_att_find_by_type_value_request:
+	call le_parse_att_find_by_type_value_request
+	branch p_le_add_handle
+	
+p_le_parse_att_find_information_request:
+	call le_parse_att_find_information_request
+p_le_add_handle:
+	call le_fifo_get_last_tx_ptr
+	branch assert,blank
+	ifetch 1,contr
+	iadd contr,contw
+	increase 2,contw
+p_le_add_handle2:
+	fetch 1,mem_le_conn_handle
+	istore 1,contw
+	rtn	
+	
+
+p_le_parse_att_read_by_group_type_request:
+	call p_le_parse_att_read_by_group_type_request2
+	branch p_le_add_handle
+	
+p_le_parse_att_read_by_group_type_request2:
+	call le_get_search_handle_start_end_common
+ 	call le_get_search_att_type
+	arg 1,timeup
+	branch le_send_att_read_by_group_type_response+1
+
+module_set_recv_confirm_flag:
+	arg MODULE_RECV_CONFIRM,queue
+	branch module_set_state
+
+p_le_parse_att_exchange_mtu_request:
+	call  le_send_att_exchange_mtu_response
+	branch p_le_add_handle
+
+p_le_parse_att_read_by_type_request:
+	call p_le_parse_att_read_by_type_request2
+	branch p_le_add_handle
+	
+p_le_parse_att_read_by_type_request2:
+	call le_get_search_handle_start_end_common
+	call le_get_search_att_uuid
+	branch p_le_send_att_read_by_type_response
+
+p_le_send_att_read_by_type_response:
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_init_attlist_search
+	call le_att_get_handle_ptr2
+	increase -2,contr
+	copy contr,pdata
+	store 2,mem_le_cur_attlist_start_ptr
+
+	fetcht 2,mem_le_search_uuid
+	setarg UUID_CHRCTR_DEVICE_NAME
+	isub temp,null
+	branch p_le_send_att_read_by_type_res_device_name,zero
+	branch le_send_att_read_by_type_response+11
+
+
+
+p_le_send_att_read_by_type_res_device_name:
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	call le_att_get_short_uuid_ptr
+//	rtn blank
+	branch le_send_att_error_response_notfound,blank
+	branch le_send_att_read_by_type_res_device_name+3
+
+
+p_le_adv_loop:
+	fetch 1,mem_le_adv_enable
+	rtn blank
+//	fetch 1,mem_module_l2cap_rx_flag
+//	nrtn blank
+	arg le_adv_interval_timer,queue
+	call timer_check
+	nrtn blank
+//	call p_le_save_tx
+	branch le_adv_loop_tx
+/*
+p_le_pop_tx:
+	arg mem_le_txheader,contw
+	arg mem_temp_block2,contr
+p_le_cpy_39:
+	arg 39,loopcnt
+	branch memcpy_fast	
+
+p_le_save_tx:
+	arg mem_le_txheader,contr
+	arg mem_temp_block2,contw
+	branch p_le_cpy_39
+*/	
+
+p_le_adv_not_match:
+//	bpatchx patch24_5,mem_patch24
+	random pdata 
+	arg 0x1f,temp
+	iand temp,pdata
+	add pdata,3,pdata
+	call delay
+	fetch 1,mem_le_adv_channel_map_temp
+	fetcht 1,mem_le_adv_channel_map
+	isub temp,null
+	nbranch le_adv_loop_tx,zero
+	branch le_adv_not_match+10
+	
+
+p_parse_lmp:
+	fetch 1,mem_lmi_opcode2
+ 	beq LMP_ENCRYPTION_KEY_SIZE_REQ,p_parse_lmp_crypt_key
+	beq LMP_SNIFF_REQ, p_parse_lmp_sniff_req
+ 	branch parse_lmp + 21
+
+p_parse_lmp_crypt_key:
+	fetcht 1,mem_rxbuf+1
+	sub temp,6,null
+	branch reject_lmp_packet_pdu_not_allowed,positive
+	branch parse_lmp_crypt_key + 1
+	
+reject_lmp_packet_pdu_not_allowed:
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+p_parse_lmp_sniff_req:
+	branch parse_lmp_sniff_req+1
+
+
+p_send_lmp:
+	disable user
+	call lmo_fifo_process
+	fetch 1,mem_lmp_to_send
+	rtn blank
+	bbit1 7,p_send_lmp_escape
+	branch send_lmp0
+	
+p_send_lmp_escape:
+	beq LMP_EXT_FEATURES_RES,p_send_lmpext_features_res
+	beq LMP_EXT_FEATURES_REQ,p_send_lmpext_features_req	
+	branch send_lmp_escape
+
+p_send_lmpext_features_res:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_res
+p_send_lmpext_features_req:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_req
+
+p_check_ssp_enable:
+	fetch 1,mem_ssp_enable 
+	branch ssp_disable, blank
+	branch  ssp_enable
+
+p_ssp_disable:
+	fetch 1,mem_features+6
+	set0 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg 0x1
+	store 2,mem_lmpext_ssp_enable
+	rtn
+
+
+p_parse_dlci0_rp:
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_SABM,rfcomm_rx_process_DLCI0_sabm
+	beq RFCOMM_FRAME_TYPE_UA,rfcomm_rx_process_DLCI0_ua
+	beq RFCOMM_FRAME_TYPE_UIH,p_parse_DLCI0_rp_uih
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_rp_spp_disconn_send_event
+	rtn
+p_parse_DLCI0_rp_uih:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_uih_head_struct
+	fetch 1,mem_uih_cmd_type
+	beq UIH_PARAM_NEG_CMD,parse_DLCI0_rp_uih_pn_cmd
+	beq UIH_PARAM_NEG_RES,parse_DLCI0_rp_uih_pn_res
+	beq UIH_MODEM_STATUS_CMD,parse_DLCI0_rp_uih_ms_cmd
+	beq UIH_MODEM_STATUS_RES,p_parse_DLCI0_rp_uih_ms_res
+	beq UIH_PARAM_CMD_REMOVE_PORT,parse_DLCI0_rp_uih_cmd_port	
+	branch rfcomm_rx_process_end
+p_parse_DLCI0_rp_uih_ms_res:
+	jam BT_EVT_SPP_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	call get_rfcomm_param_modem_status
+	branch parse_DLCI0_rp_uih_ms_res_spp
+
+
+p_sp_initialize_256:	
+	fetch 1,mem_le_secure_connect_enable
+	branch  le_secure_connection_disable,blank
+//	call le_secure_connection_enable
+	call sp_clear_flags
+	branch sp_pubkey_calc_256
+	
+p_check_51cmd:
+//	bpatchx patch34_1,mem_patch34
+//	arg mem_ipc_fifo_c512bt,rega
+//	call fifo_is_empty
+//	rtn blank
+//check_51cmd_once:
+//	call ui_ipc_get_lock
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_out
+//	copy pdata,temp
+//	call ui_ipc_put_lock
+//	bpatchx patch34_2,mem_patch34
+//	copy temp,pdata
+	rtn blank
+//	beq BT_CMD_START_DISCOVERY,check_51cmd_start_discovery
+  	beq BT_CMD_STOP_DISCOVERY,check_51cmd_stop_discovery
+	beq BT_CMD_START_ADV,check_51cmd_adv
+	beq BT_CMD_STOP_ADV,check_51cmd_stop_adv  	
+	beq BT_CMD_STORE_RECONN_INFO_LE,eeprom_store_le_reconn_info
+	rtn
+	
+
+p_ui_ipc_send_event:
+//	bpatchx patch33_7,mem_patch33
+	fetch 1,mem_fifo_temp
+p_module_process_bb_event:
+	beq BT_EVT_LE_CONNECTED,p_module_process_le_conn
+	beq BT_EVT_LE_LTK_LOST,p_module_process_ble_ltk_lost
+	beq BT_EVT_LE_PAIRING_FAIL,p_module_hci_event_le_pairing_fail
+	beq BT_EVT_LE_PAIRING_SUCCESS,p_module_hci_event_le_pairing_success
+	beq BT_EVT_LE_START_ENC,p_module_hci_event_start_enc
+	beq BT_EVT_LE_PAUSE_ENC,p_module_hci_event_pause_enc
+	beq BT_EVT_LE_TK_GENERATE,module_hci_event_le_tk
+//	beq BT_EVT_LE_GKEY_GENERATE,module_hci_event_le_gkey
+	beq BT_EVT_STORE_NVRAM,p_module_hci_event_store_device
+	beq BT_EVT_LE_CONN_PARAM_UPDATE,p_module_process_bb_event_le_conn_update
+	beq BT_EVT_LE_DISCONNECTED,p_module_process_bb_even_le_disconn
+	rtn
+
+p_module_process_bb_event_le_conn_update:
+	jam  HCI_EVENT_LE_CONNECTION_UPDATE,mem_module_uart_opcode
+	setarg 7
+	call module_hci_prepare_tx
+	call p_event_add_handle
+	fetch 6,mem_le_new_conninterval
+	istore 6,contwu
+	branch uartd_send
+	
+p_module_hci_event_store_device:
+	jam HCI_EVENT_NVRAM_REP,mem_module_uart_opcode
+	fetch 1,mem_nv_data_number
+	sub pdata,7,null
+	branch p_module_hci_event_store_device1,positive
+	arg 7,pdata
+	call p_module_hci_event_store_device1
+p_module_hci_event_store_device2:
+	fetch 1,mem_nv_data_number
+	fetcht 1,mem_pdatatemp
+	isub temp,pdata
+	mul32 pdata,34,pdata
+	icopy loopcnt
+	add pdata,2,pdata
+	call module_hci_prepare_tx
+	fetch 2,mem_nv_data_ptr
+	fetcht 1,mem_pdatatemp
+	mul32 temp,34,temp
+	istoret 2,contwu
+	iadd temp,contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+	
+p_module_hci_event_store_device1:
+	store 1,mem_pdatatemp
+	mul32 pdata,34,pdata
+	icopy loopcnt
+	add pdata,2,pdata
+	call module_hci_prepare_tx
+	arg 0,pdata
+	istore 2,contwu
+	branch module_hci_event_store_device+5
+
+
+	
+p_module_hci_event_pause_enc:
+	arg FLAG_EVENT_PAUSE_ENC,regc
+	branch p_module_hci_event_enc
+
+p_module_hci_event_start_enc:
+	arg FLAG_EVENT_START_ENC,regc
+p_module_hci_event_enc:
+	jam HCI_EVENT_LE_ENCRYPTION_STATE,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	call p_event_add_handle
+	copy regc,pdata
+	istore 1,contwu
+	branch uartd_send
+
+
+p_module_hci_event_le_pairing_success:
+	arg FLAG_BLE_PAIRING_SUCCESS,rega
+	branch p_module_hci_event_pairing_completed
+	
+p_module_hci_event_le_pairing_fail:
+	arg FLAG_BLE_PAIRING_FAIL,rega
+p_module_hci_event_pairing_completed:
+	jam 0,mem_flag_mode_ssp_pin
+	jam HCI_EVENT_LE_PAIRING_STATE,mem_module_uart_opcode
+	setarg 3
+	call module_hci_prepare_tx
+	call p_event_add_handle
+	copy rega,pdata
+	istore 2,contwu
+	branch uartd_send
+
+p_event_add_handle:
+	fetch 1,mem_le_conn_handle
+	istore 1,contwu	
+	rtn
+
+p_module_process_ble_ltk_lost:
+	call le_send_reject_ind
+	branch p_le_add_handle2
+//	branch p_le_pairing_sm_start
+	
+p_module_process_le_conn:
+	call app_le_event_bb_connected
+	call module_start_adv_discovery_by_command
+	fetch 1,mem_module_le_lpm_mult
+	store 1,mem_lpm_mult
+p_module_hci_event_le_connect:
+	jam  HCI_EVENT_LE_CONN_REP,mem_module_uart_opcode
+	setarg 7
+	call module_hci_prepare_tx
+	call p_event_add_handle
+	fetch 6,mem_le_plap
+	istore 6,contwu
+	branch uartd_send
+	
+p_module_process_bb_even_le_disconn:	
+	call app_le_event_bb_disconn
+//	call le_clr_config_more_data
+//	call module_disconn_start
+	jam  HCI_EVENT_LE_DIS_REP,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	call p_event_add_handle
+	branch uartd_send
+	
+p_le_init_conn:
+//	bpatch patch1d_3,mem_patch1d
+	disable wake
+//	jam 1,mem_le_conn_handle
+	branch le_init_conn+3
+
+p_le_slave_cont:
+//	bpatch patch1e_3,mem_patch1e
+	call le_pairing_sm
+ //	call le_check_paring_time
+	call check_51cmd
+	fetch 1,mem_le_op
+	bbit1 op_disconn,le_slave_disconn
+	branch le_slave_unsync
+	
+p_le_disconnect:
+//	bpatch patch1e_6,mem_patch1e
+	call le_clear_connection_info+3
+	call app_disconn_reason_collect_ble
+	jam BT_EVT_LE_DISCONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	branch p_context_free
+
+	
+p_context_load:
+	set1 mark_context,mark
+	deposit rega
+	store 2,mem_context_ptr
+	force CONTEXT_SIZE,loopcnt
+	arg mem_le_state,contw
+	copy rega,contr
+	call memcpy_fast
+
+	call p_context_extend_ptr
+	copy pdata,contr
+	
+	arg mem_le_txheader,contw
+	force 39,loopcnt
+	call memcpy_fast
+	
+	ifetch 2,contr
+	store 2,mem_ui_state_map
+	
+	ifetch 5,contr
+	store 5,mem_le_pcnt_tx
+	ifetch 5,contr
+	store 5,mem_le_pcnt_rx
+
+	ifetch 8,contr
+	store 8,mem_le_ivm
+		
+	ifetch 1,contr
+	store 1,mem_le_configuration
+
+//	ifetch 1,contr
+//	store 1,mem_le_ll_sm
+	
+	ifetch 1,contr
+	store 1,mem_le_pairing_state
+	ifetch 1,contr
+	store 1,mem_le_enc_state
+	arg mem_le_new_map,contw
+	arg 14,loopcnt
+	call memcpy_fast
+	
+	mul32 rege,CONTEXT_SMP,rege
+	arg mem_smp_buf_temp,pdata
+	iadd rege,contr	
+	arg mem_le_ltk,contw
+	force CONTEXT_SMP,loopcnt
+	branch memcpy_fast
+
+
+p_context_save:
+//	fetch 2,mem_le_remote_mtu 
+//	store 2,mem_le_context_mtu
+//	fetch 2,mem_remote_rx_max_octets 
+//	store 2,mem_le_context_remote_rx_max_octets
+
+	fetch 2,mem_context_ptr
+	iforce contw
+	force CONTEXT_SIZE,loopcnt
+	arg mem_le_state,contr
+	call memcpy_fast
+	
+	call p_context_extend_ptr
+	copy pdata,contw
+	
+	arg mem_le_txheader,contr
+	force 39,loopcnt
+	call memcpy_fast
+	
+	fetch 2,mem_ui_state_map
+	istore 2,contw
+	
+//	arg  mem_used_map,contr
+//	call memcpy16
+	fetch 5, mem_le_pcnt_tx
+	istore 5,contw
+	fetch 5,mem_le_pcnt_rx
+	istore 5,contw
+	
+	fetch 8,mem_le_ivm
+	istore 8,contw
+	
+	fetch 1,mem_le_configuration
+	istore 1,contw	
+
+//	fetch 1,mem_le_ll_sm
+//	istore 1,contw
+	
+	fetch 1,mem_le_pairing_state
+	istore 1,contw
+	fetch 1,mem_le_enc_state
+	istore 1,contw
+	arg mem_le_new_map,contr
+	arg 14,loopcnt
+	call memcpy_fast
+
+p_check_smp_buf:
+//	fetch 1,mem_le_pairing_state
+	mul32 rege,CONTEXT_SMP,rege
+	arg mem_smp_buf_temp,pdata
+	iadd rege,contw	
+	arg mem_le_ltk,contr
+	force CONTEXT_SMP,loopcnt
+	branch memcpy_fast
+
+
+p_context_extend_ptr:
+	fetch 2,mem_context_ptr
+	arg mem_context_new,temp
+	isub temp,pdata
+	div pdata, CONTEXT_SIZE
+	call wait_div_end
+	quotient pdata
+	copy pdata,rege
+	mul32 pdata,CONTEXT_SIZE_EXTEND,pdata
+	arg mem_context_extend,temp
+	iadd temp,pdata
+	rtn
+
+	
+p_context_new:
+//fetch 1,0xd
+//increase 1,pdata
+//store 1,0xd
+	call p_context_new2
+	branch context_new+3
+	
+p_context_new2:	
+	fetcht 1,mem_context_map
+	arg 0,queue
+p_context_new_loop:
+	qisolate1 temp
+	branch p_context_used,true
+	qset1 temp
+	storet 1,mem_context_map
+	deposit queue
+	store 1,mem_current_context
+	mul32 pdata,CONTEXT_SIZE,rega
+	increase 1,pdata
+	store 1,mem_le_conn_handle
+	arg mem_context_new,pdata
+	iadd rega,rega
+	
+	fetch 1,mem_context_cnt
+	increase 1,pdata
+	store 1,mem_context_cnt
+	branch context_esco_wack
+	
+p_context_used:
+	increase 1,queue
+	compare 8,queue,0xf
+	nbranch p_context_new_loop,true
+	branch context_check_esco_wack + 3
+
+
+p_context_free:
+//fetch 1,0xe
+//increase 1,pdata
+//store 1,0xe	
+	fetch 2,mem_context_ptr
+	arg mem_context_new,rega
+	isub rega,pdata
+	div pdata,CONTEXT_SIZE
+	call wait_div_end
+	quotient pdata	
+	
+	iforce queue
+	fetch 1,mem_context_map
+	qset0 pdata
+	store 1,mem_context_map
+	fetch 1,mem_context_cnt
+	increase -1,pdata
+	store 1,mem_context_cnt
+	rtn
+
+p_context_search:
+	arg mem_context_new,rega
+	arg CONTEXT_NUM_NEW,loopcnt
+	branch context_search_loop
+
+
+p_connection_incontext:
+	call context_search_insniff
+	nbranch p_connection_nosniff,zero
+	branch connection_incontext+3
+	
+p_connection_nosniff:
+	call p_context_get_next
+	sub loopcnt,0,null
+	branch connection_nosniff+2
+  
+p_context_get_next:
+	arg CONTEXT_NUM_NEW,loopcnt
+	fetcht 1,mem_current_context
+p_context_get_next_loop:
+	increase 1,temp
+	sub temp,CONTEXT_NUM_NEW+-1,null
+	branch p_context_get_next_cont,positive
+	arg 0,temp
+p_context_get_next_cont:
+	storet 1,mem_current_context
+	mul32 temp,CONTEXT_SIZE,pdata
+	arg mem_context_new,rega
+	iadd rega,rega
+	ifetch 1,rega
+	bbit1 state_insniff,p_context_get_next_sniff
+	rtnbit1 state_inconn
+	rtnbit1 state_inpage
+p_context_get_next_sniff:
+	loop p_context_get_next_loop
+	rtn
+
+
Index: BlueTooth/BT_code_patch/key/trunk/sched/109x.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/sched/109x.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/sched/109x.dat	(working copy)
@@ -0,0 +1,52 @@
+mem_patch00:02
+mem_patch10:20
+mem_patch11:02
+mem_patch14:04
+mem_patch17:09
+mem_patch20:68
+mem_patch27:44
+mem_patch28:02
+mem_patch2a:04
+mem_patch33:02
+
+#mem_lpm_config:0f 84 30
+mem_lpm_config:0f 84 f0
+mem_lpm_xtalcnt:0a 0b b2 32
+mem_lpm_hibernate_switch:8b
+mem_lpm_doze_switch:0b
+mem_gpio_wakeup:00 00 00 00 00 00 00 00
+
+mem_fcomp_mul:02
+mem_fcomp_div:24
+mem_iscan_window:40 00
+mem_iscan_interval:00 02
+mem_pscan_window:32 00
+mem_pscan_interval:00 02
+
+mem_inq_window:20 00
+mem_page_window:20 00
+mem_page_to:00 20
+mem_rx_window_init:80 04
+mem_rx_window_sniff:00 10
+
+
+
+mem_lmp_version:08 0e 05 04 00
+
+mem_eeprom_base:30 1f
+mem_eeprom_block_size:20
+mem_context_number:01
+
+mem_context:
+4b ba
+55 d0
+56 e0
+57 88
+58 6c
+59 10
+07 ff
+ff
+mem_rf_init_ptr:mem_context
+
+
+
Index: BlueTooth/BT_code_patch/key/trunk/sched/DM_module.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/sched/DM_module.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/key/trunk/sched/DM_module.dat	(working copy)
@@ -0,0 +1,177 @@
+
+mem_device_option:0a
+mem_ui_profile_supported:40
+mem_app_connection_options:13
+mem_ptt:01
+mem_features:
+ff
+fb
+8f
+fa	#openACL3M fe    2M fa
+8B	#AFHclose 83
+85
+59
+83	#83 ssp
+
+
+##############NVRAM CONFIG##############
+mem_nv_data_ptr:mem_module_nv_data
+mem_nv_data_number:08
+#####################################
+
+##############SPP CONFIG##############
+mem_credit_flag:01
+mem_rfcomm_max_frame_size:ff 00 
+mem_rfcomm_credit_init_data:03
+#####################################
+
+##############SSP CONFIG##############
+mem_sp_iocap_local:03 00 04
+mem_ssp_enable:00
+mem_pin_length:04  30 30 30 30 30
+#####################################
+
+
+################IPC BUFFER INIT#####################
+4FF0:00 1C
+4FF2:FF 1F
+4FF4:00 1C
+4FF6:00 1C
+4FF8:80 4e
+4FFA:E0 4F
+4FFC:80 4e
+4FFE:80 4e
+#####################################
+
+##############BLUETOOTH CONFIG##############
+###commom###
+mem_soft_version_num:10 0b
+mem_module_state:02
+mem_module_bluetooth_stauts_by_command:04
+mem_class:24 04 04
+
+mem_module_flag:00
+#bit0 MODULE_FLAG_UART_FLOW_CONTROL
+#bit1 MODULE_FLAG_BLE_SEND_MTU23
+#bit2 MODULE_FLAG_BLE_DATA_ENCRYPT
+
+mem_lpm_mode:00
+mem_lpm_interval:00 01
+mem_lpm_overhead:08
+mem_lpm_mult_timeout:02
+
+
+###3.0###
+mem_scan_mode:00
+mem_module_spp_lpm_mult:28
+mem_lap:aa aa 2a 21 10 55
+mem_local_name_length:
+'YiChip
+
+###3.0 sinff param###
+mem_sniff_param_interval:20 00
+mem_sniff_param_attempt:02
+mem_sniff_param_timeout:01
+
+
+###ble###
+mem_le_secure_connect_enable:00
+mem_le_adv_channel_map:07
+mem_le_pairing_mode:01
+
+mem_module_data_write_handle:2d 00
+mem_module_data_write_handle2:2f 00
+
+
+mem_le_adv_enable:01
+mem_le_adv_interval:01 03
+mem_module_le_lpm_mult:01
+mem_le_lap:21 aa aa 33 02 3a
+mem_le_name_len:
+'YiChip-le
+
+mem_le_adv_data_len:03
+mem_le_adv_data:
+02 01 06
+
+mem_le_scan_data_len:0b
+
+mem_le_scan_data:# 1 byte length + 1 byte type + N bytes data
+'\09YiChip-le
+
+mem_le_pres:02 03 00 05 10 02 03
+
+mem_le_interval_min:
+08 00 #min interval
+10 00 #max interval
+00 00 #latency
+2c 01 #timeout
+
+
+mem_le_local_mtu:17
+mem_le_remote_mtu:17
+
+mem_le_pairing_handle:31 00
+
+#####################################
+
+
+
+mem_ui_uuid_table:0000
+
+
+
+mem_ui_le_uuid_table:mem_module_le_att_list
+
+#attribute list: handle 2bytes, uuid 2bytes, length 1bytes, attribute Nbytes
+mem_module_le_att_list:
+#Primary service yichip transmit ------
+01 00 02 00 28 02 01 18
+#Service Changed
+02 00 02 03 28 01 20
+03 00 02 05 2a 01 00
+#Client Characteristic Configuration
+04 00 02 02 29 02 01 00
+
+#Primary service GAP ------
+05 00 02 00 28 02 00 18
+
+#Device name
+06 00 02 03 28 01 02
+07 00 02 00 2a 13 59 69 43 68 69 70 2d 6c 65 20 20 20 20 20 20 20 20 20 20
+
+#Apperance
+08 00 02 03 28 01 02
+09 00 02 01 2a 02 00 00
+
+#Perpheral Preferred Connection Parameters
+0a 00 02 03 28 01 02
+0b 00 02 04 2a 08 10 00 80 00 05 00 2c 01
+
+
+#Primary service yichip transmit ------
+0c 00 02 00 28 10 55 e4 05 d2 af 9f a9 8f e5 4a 7d fe 43 53 53 49
+#Characteristic tx--notify read
+0d  00 02 03 28 01 10
+0e 00 10 16 96 24 47 C6 23 61 BA D9 4B 4D 1E 43 53 53 49 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+#Client Characteristic Configuration
+0f 00 02 02 29 02 00 00
+
+#Characteristic rx--write
+10 00 02 03 28 01 08
+11 00 10 B3 9B 72 34 BE EC D4 A8 F4 43 41 88 43 53 53 49 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+#Characteristic rx-- write without Response
+12 00 02 03 28 01 04
+13 00 10 fe 69 ca 9a 56 19 f6 ab 02 4d aa 6d 43 53 53 49 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+#Characteristic rx tx --read write notify
+14 00 02 03 28 01 1a
+15 00 10 18 03 A6 28 5E D8 EC 91 1C 48 A3 AC 43 53 53 49 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+#Client Characteristic Configuration
+16 00 02 02 29 02 00 00
+
+#End of Attribute list
+00 00
+
+
Index: BlueTooth/BT_code_patch/print/branches/mult_connect/format/app_module.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/format/app_module.format	(revision 859)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/format/app_module.format	(working copy)
@@ -80,6 +80,7 @@
 	1 mem_scheduler_handle_flag
 
 	1 mem_multi_piconet_flag
+	1 mem_sdp_offset2
 	1 mem_sdp_channel_offset
 	1 mem_module_le_l2cap_rx_flag
 	4 mem_module_le_l2cap_rx_clk
@@ -126,7 +127,7 @@
 	560 mem_context_new
 	420 mem_context_extend
 	161 mem_rfcomm_channel_context
-	0 mem_module_end
+	0 mem_module_end2
 	
 )
  
Index: BlueTooth/BT_code_patch/print/branches/mult_connect/output/bt_code.c
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/output/bt_code.c	(revision 859)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/output/bt_code.c	(working copy)
@@ -1,5 +1,5 @@
 const unsigned char bt_code[] = {
-0x00,0x02,0xaa,0x55,0x22,0x1f,0xc2,0x84,0x00,0x2f,0xc0,0x00,0x81,0xa3,0xc0,0x02,
+0x00,0x02,0xaa,0x55,0x4a,0x1f,0xc2,0x84,0x00,0x2f,0xc0,0x00,0x81,0xa3,0xc0,0x02,
 0x00,0xf8,0xc0,0x02,0x81,0x16,0xc0,0x15,0x00,0x5f,0xc0,0x15,0x80,0x88,0xc0,0x16,
 0x00,0xd3,0xc0,0x17,0x01,0x13,0xc0,0x1a,0x01,0x46,0xc0,0x1e,0x01,0x49,0xc0,0x1f,
 0x01,0xad,0xc0,0x22,0x80,0xc0,0xc0,0x24,0x01,0xa9,0xc0,0x28,0x01,0xae,0xc0,0x2e,
@@ -10,15 +10,15 @@
 0x02,0x71,0xc0,0x5a,0x00,0x4d,0xc0,0x5a,0x80,0x50,0xc0,0x5c,0x02,0x72,0xc0,0x5d,
 0x83,0x47,0xc0,0x5e,0x04,0x49,0xc0,0x60,0x04,0xb0,0xc0,0x6d,0x84,0xb9,0xc0,0x6e,
 0x84,0xc0,0xc0,0x6f,0x04,0xc5,0xc0,0x6f,0x84,0xcb,0xc0,0x71,0x84,0xa9,0xc0,0x75,
-0x84,0xd8,0xc0,0x78,0x81,0x6f,0xc0,0x7a,0x81,0x84,0xc0,0x7b,0x01,0x8c,0x20,0x20,
-0x4a,0x8b,0xc0,0x01,0x84,0xe2,0xc0,0x02,0x84,0xee,0xc0,0x03,0x04,0xf7,0xc0,0x03,
-0x84,0xfd,0xc0,0x04,0x05,0x06,0xc0,0x05,0x85,0x19,0xc0,0x09,0x85,0x2c,0xc0,0x0a,
-0x05,0xc7,0xc0,0x0e,0x05,0xdc,0xc0,0x0f,0x06,0x05,0xc0,0x0f,0x86,0x30,0xc0,0x11,
-0x06,0xb5,0xc0,0x11,0x86,0x9a,0xc0,0x12,0x86,0xab,0xc0,0x14,0x05,0x29,0xc0,0x19,
-0x06,0xdd,0xc0,0x1d,0x06,0xdf,0xc0,0x1f,0x06,0xf7,0xc0,0x20,0x87,0x09,0xc0,0x26,
-0x86,0xde,0xc0,0x28,0x87,0x1c,0xc0,0x29,0x07,0x25,0xc0,0x31,0x04,0x83,0xc0,0x33,
-0x04,0xa6,0xc0,0x3c,0x84,0xd0,0xc0,0x46,0x86,0x1a,0xc0,0x4c,0x87,0x0f,0xc0,0x4f,
-0x87,0x13,0xc0,0x50,0x87,0x14,0x20,0x20,0x4a,0x8b,0x58,0x00,0x00,0x00,0x67,0xf0,
+0x84,0xe2,0xc0,0x78,0x81,0x6f,0xc0,0x7a,0x81,0x84,0xc0,0x7b,0x01,0x8c,0x20,0x20,
+0x4a,0x8b,0xc0,0x01,0x84,0xec,0xc0,0x02,0x84,0xf8,0xc0,0x03,0x05,0x01,0xc0,0x03,
+0x85,0x07,0xc0,0x04,0x05,0x10,0xc0,0x05,0x85,0x23,0xc0,0x09,0x85,0x36,0xc0,0x0a,
+0x05,0xd1,0xc0,0x0e,0x05,0xe6,0xc0,0x0f,0x06,0x0f,0xc0,0x0f,0x86,0x3a,0xc0,0x11,
+0x06,0xbf,0xc0,0x11,0x86,0xa4,0xc0,0x12,0x86,0xb5,0xc0,0x14,0x05,0x33,0xc0,0x19,
+0x06,0xe7,0xc0,0x1d,0x06,0xe9,0xc0,0x1f,0x07,0x01,0xc0,0x20,0x87,0x13,0xc0,0x26,
+0x86,0xe8,0xc0,0x28,0x87,0x26,0xc0,0x29,0x07,0x2f,0xc0,0x31,0x04,0x83,0xc0,0x33,
+0x04,0xa6,0xc0,0x3c,0x84,0xd0,0xc0,0x46,0x86,0x24,0xc0,0x4c,0x87,0x19,0xc0,0x4f,
+0x87,0x1d,0xc0,0x50,0x87,0x1e,0x20,0x20,0x4a,0x8b,0x58,0x00,0x00,0x00,0x67,0xf0,
 0x46,0x3a,0x20,0x60,0x00,0x00,0x1a,0x22,0x7e,0x00,0x67,0xe2,0x02,0x28,0x6f,0xe2,
 0x02,0x28,0x20,0x7a,0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x02,0x28,0x6f,0xe4,
 0x41,0xfe,0x20,0x40,0x7d,0x77,0x20,0x20,0x00,0x52,0x20,0x40,0x7c,0xcf,0x20,0x40,
@@ -31,55 +31,55 @@
 0x42,0x22,0xef,0xe2,0x00,0x06,0x67,0xe2,0x42,0x26,0xef,0xe2,0x00,0x06,0x67,0xe2,
 0x43,0x36,0xef,0xe4,0x00,0x06,0x67,0xe4,0x46,0x52,0xef,0xe2,0x00,0x06,0x67,0xe2,
 0x49,0xc0,0xd8,0xa0,0x40,0xd2,0xdf,0x20,0x00,0x20,0x20,0x40,0x7c,0xcf,0xdf,0x20,
-0x00,0x17,0xd8,0xa0,0x4a,0xeb,0x20,0x40,0x7c,0xcf,0x20,0x20,0x42,0x12,0x20,0x40,
+0x00,0x17,0xd8,0xa0,0x4a,0xec,0x20,0x40,0x7c,0xcf,0x20,0x20,0x42,0x12,0x20,0x40,
 0x7c,0xcf,0x20,0x40,0x00,0xb6,0x1f,0xe2,0x0a,0x00,0x6f,0xe4,0x46,0x52,0xe7,0xe4,
 0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe4,0x00,0x1e,0x98,0x00,0x0a,0x00,0x18,0x00,
-0x72,0x50,0xd8,0xc0,0x04,0x3b,0x20,0x3b,0x7c,0xcf,0xd8,0xc0,0x00,0x30,0x20,0x40,
+0x72,0x50,0xd8,0xc0,0x04,0x3b,0x20,0x3b,0x00,0x82,0xd8,0xc0,0x00,0x30,0x20,0x40,
 0x7c,0xcf,0x20,0x40,0x00,0xb6,0x1f,0xe2,0x0a,0x00,0xd8,0xc0,0x45,0x2f,0xdf,0x20,
 0x00,0x0e,0x20,0x40,0x7c,0xcf,0x6f,0xec,0x42,0x18,0xe7,0xec,0x00,0x05,0x6f,0xe4,
 0x42,0x22,0xe7,0xe4,0x00,0x05,0x6f,0xe2,0x42,0x26,0xe7,0xe2,0x00,0x05,0x6f,0xe2,
 0x43,0x36,0xe7,0xe2,0x00,0x05,0x6f,0xe4,0x46,0x52,0xe7,0xe4,0x00,0x05,0x6f,0xe2,
 0x49,0xc0,0xe7,0xe2,0x00,0x05,0xd8,0xc0,0x40,0xd2,0xdf,0x20,0x00,0x20,0x20,0x40,
-0x7c,0xcf,0xdf,0x20,0x00,0x17,0xd8,0xc0,0x4a,0xeb,0x20,0x20,0x7c,0xcf,0xd8,0xa0,
+0x7c,0xcf,0xdf,0x20,0x00,0x17,0xd8,0xc0,0x4a,0xec,0x20,0x20,0x7c,0xcf,0xd8,0xa0,
 0x00,0x30,0x18,0x00,0x72,0x50,0x20,0x40,0x7c,0xaf,0xd8,0xa0,0x45,0x2f,0xdf,0x20,
 0x00,0x0e,0x20,0x40,0x7c,0xaf,0x58,0x00,0x00,0x00,0x67,0xec,0x42,0x18,0x67,0xe4,
 0x42,0x22,0x67,0xe2,0x42,0x26,0x67,0xe2,0x43,0x36,0x67,0xe4,0x46,0x52,0x67,0xe2,
 0x49,0xc0,0xd8,0xa0,0x40,0xd2,0xdf,0x20,0x00,0x20,0x20,0x20,0x7c,0xaf,0x6f,0xe4,
-0x00,0x1e,0xd8,0x40,0x4b,0x02,0x98,0x46,0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,
-0x7d,0x61,0x18,0x07,0xfe,0x00,0x1f,0xef,0xfe,0x52,0xd8,0x40,0x4d,0x32,0x98,0x40,
+0x00,0x1e,0xd8,0x40,0x4b,0x03,0x98,0x46,0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,
+0x7d,0x61,0x18,0x07,0xfe,0x00,0x1f,0xef,0xfe,0x52,0xd8,0x40,0x4d,0x33,0x98,0x40,
 0xfe,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x74,0x38,0x58,0x00,0x00,0x00,0x67,0xec,
 0x42,0x18,0x67,0xe4,0x42,0x22,0x67,0xe2,0x42,0x26,0x67,0xe2,0x00,0x30,0x67,0xec,
-0x00,0x32,0x67,0xe2,0x43,0x36,0x67,0xe4,0x46,0x52,0x67,0xe2,0x4a,0xeb,0x67,0xe2,
-0x4a,0xed,0x67,0xe2,0x4a,0xeb,0x70,0x4a,0xec,0x01,0xdf,0x20,0x00,0x05,0x1f,0x2f,
-0xf2,0x04,0xd8,0xa0,0x4a,0xee,0x20,0x40,0x7c,0xaf,0x20,0x40,0x60,0xe5,0x20,0x20,
+0x00,0x32,0x67,0xe2,0x43,0x36,0x67,0xe4,0x46,0x52,0x67,0xe2,0x4a,0xec,0x67,0xe2,
+0x4a,0xee,0x67,0xe2,0x4a,0xec,0x70,0x4a,0xed,0x01,0xdf,0x20,0x00,0x05,0x1f,0x2f,
+0xf2,0x04,0xd8,0xa0,0x4a,0xef,0x20,0x40,0x7c,0xaf,0x20,0x40,0x60,0xe5,0x20,0x20,
 0x44,0x40,0x20,0x40,0x00,0xd5,0x20,0x20,0x42,0x3a,0x68,0x42,0x4a,0xd9,0xd8,0xe0,
 0x00,0x00,0xa8,0x4f,0xff,0xff,0x20,0x20,0x80,0xe6,0xf9,0x20,0x04,0x00,0x60,0x42,
 0x4a,0xd9,0x18,0xe2,0x7e,0x00,0x67,0xe2,0x00,0x15,0x1f,0xef,0xa2,0x50,0x1f,0xe0,
-0xfe,0x01,0x67,0xe2,0x00,0x46,0xdf,0xe0,0x4b,0x02,0x9a,0x20,0xa2,0x00,0x6f,0xe2,
+0xfe,0x01,0x67,0xe2,0x00,0x46,0xdf,0xe0,0x4b,0x03,0x9a,0x20,0xa2,0x00,0x6f,0xe2,
 0x4a,0xda,0x1f,0xe0,0xfe,0x01,0x67,0xe2,0x4a,0xda,0x20,0x20,0x42,0x4c,0x18,0xe0,
 0x8e,0x01,0x28,0xe0,0x1e,0x08,0x24,0x20,0x80,0xd7,0x20,0x20,0x42,0x4a,0x6f,0xe4,
-0x00,0x1e,0xda,0x20,0x4b,0x02,0x9a,0x26,0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,
+0x00,0x1e,0xda,0x20,0x4b,0x03,0x9a,0x26,0x7e,0x00,0x1f,0xe6,0xfc,0x50,0x20,0x40,
 0x7d,0x61,0x18,0x07,0xfe,0x00,0x98,0x00,0x0e,0x00,0x6f,0xe2,0x4a,0xd9,0xf9,0x3f,
 0xfe,0x00,0x67,0xe2,0x4a,0xd9,0x6f,0xe2,0x4a,0xda,0x1f,0xe0,0xff,0xff,0x67,0xe2,
 0x4a,0xda,0x20,0x60,0x00,0x00,0x20,0x40,0x40,0x34,0x20,0x40,0x4c,0x86,0x20,0x40,
 0x00,0xff,0x20,0x40,0x01,0x04,0x20,0x40,0x40,0x1d,0x20,0x40,0x4b,0x3f,0x20,0x20,
-0x40,0x0f,0x6f,0xe2,0x4a,0xda,0xc1,0x03,0x80,0x00,0x6f,0xe2,0x4a,0xe5,0x24,0x7a,
+0x40,0x0f,0x6f,0xe2,0x4a,0xda,0xc1,0x03,0x80,0x00,0x6f,0xe2,0x4a,0xe6,0x24,0x7a,
 0x00,0x00,0x20,0x20,0x42,0xf4,0x6f,0xe2,0x4a,0xda,0xc1,0x03,0x80,0x00,0x6f,0xe2,
-0x4a,0xdd,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x4a,0xe5,0x24,0x7a,0x00,0x00,0x6f,0xe2,
+0x4a,0xdd,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x4a,0xe6,0x24,0x7a,0x00,0x00,0x6f,0xe2,
 0x40,0x93,0xc4,0x00,0x80,0x00,0x18,0x00,0x0e,0x05,0x20,0x40,0x7c,0xf1,0x24,0x7a,
 0x00,0x00,0x78,0x48,0x7c,0x00,0x68,0x44,0x40,0xb1,0x18,0x42,0x36,0x00,0x20,0x20,
-0x43,0x6f,0xda,0x20,0x4b,0x02,0xdf,0x20,0x00,0x07,0x20,0x20,0x42,0x60,0x20,0x40,
+0x43,0x6f,0xda,0x20,0x4b,0x03,0xdf,0x20,0x00,0x07,0x20,0x20,0x42,0x60,0x20,0x40,
 0x01,0x19,0x24,0x22,0x81,0x31,0x20,0x20,0x40,0x25,0xda,0x60,0x01,0x1b,0x20,0x20,
 0x42,0x5d,0xc3,0x00,0xc2,0x62,0x20,0x40,0x42,0xaf,0x20,0x40,0x42,0x93,0x98,0x46,
-0x7e,0x00,0x1f,0xe0,0xfe,0x01,0x20,0x21,0x01,0x28,0x6a,0x42,0x4a,0xea,0x1a,0x43,
+0x7e,0x00,0x1f,0xe0,0xfe,0x01,0x20,0x21,0x01,0x28,0x6a,0x42,0x4a,0xeb,0x1a,0x43,
 0xa4,0x00,0x1a,0x40,0xa4,0x05,0x9a,0x40,0xfe,0x00,0x24,0x21,0x42,0x62,0x70,0x4a,
-0xea,0x00,0x20,0x20,0x42,0x89,0x98,0x00,0x24,0x00,0x6f,0xe2,0x4a,0xea,0x1f,0xe0,
-0xfe,0x01,0x67,0xe2,0x4a,0xea,0x1a,0x20,0x8c,0x02,0xef,0xe4,0x00,0x06,0x20,0x3a,
+0xeb,0x00,0x20,0x20,0x42,0x89,0x98,0x00,0x24,0x00,0x6f,0xe2,0x4a,0xeb,0x1f,0xe0,
+0xfe,0x01,0x67,0xe2,0x4a,0xeb,0x1a,0x20,0x8c,0x02,0xef,0xe4,0x00,0x06,0x20,0x3a,
 0x42,0x89,0x20,0x40,0x42,0xbb,0x20,0x20,0x01,0x1c,0x20,0x40,0x02,0x15,0x24,0x7a,
 0x00,0x00,0x20,0x40,0x01,0x36,0x1f,0x26,0x7c,0x00,0x20,0x20,0x40,0x2d,0xdf,0x20,
 0x00,0x07,0x68,0x42,0x00,0x15,0x18,0x40,0x84,0x01,0x18,0x46,0x7c,0x06,0x20,0x21,
 0x01,0x3c,0xd8,0x40,0x00,0x00,0x60,0x42,0x00,0x15,0x18,0x4f,0xfe,0x50,0xda,0x20,
-0x4b,0x02,0x9a,0x20,0xa2,0x00,0xef,0xe2,0x00,0x11,0xc2,0x80,0x81,0x44,0xc3,0x80,
+0x4b,0x03,0x9a,0x20,0xa2,0x00,0xef,0xe2,0x00,0x11,0xc2,0x80,0x81,0x44,0xc3,0x80,
 0x00,0x00,0xc3,0x81,0x80,0x00,0xc2,0x00,0x01,0x38,0x20,0x60,0x00,0x00,0x20,0x40,
 0x42,0x3f,0x20,0x62,0x80,0x00,0x20,0x20,0x43,0x2f,0x70,0x4a,0xd8,0x00,0x20,0x40,
 0x48,0xa5,0x20,0x20,0x43,0xcc,0x58,0x00,0x00,0x00,0x1c,0xe2,0x7c,0x00,0x20,0x22,
@@ -90,14 +90,14 @@
 0xfe,0x00,0x1f,0xe0,0xfe,0x6e,0xd8,0x40,0x0e,0xa6,0x98,0x46,0xfc,0x00,0x20,0x40,
 0x7d,0x61,0x18,0x07,0xfe,0x00,0x1f,0xf0,0x7e,0x00,0x18,0x07,0x04,0x00,0x98,0x41,
 0xfe,0x00,0x68,0x4c,0x41,0x64,0x20,0x40,0x7d,0x07,0x18,0x42,0x32,0x00,0x6f,0xec,
-0x4b,0x0a,0x20,0x20,0x48,0x50,0x6f,0xe2,0x4b,0x02,0x20,0x20,0x4b,0x74,0x20,0x60,
+0x4b,0x0b,0x20,0x20,0x48,0x50,0x6f,0xe2,0x4b,0x03,0x20,0x20,0x4b,0x74,0x20,0x60,
 0x00,0x00,0x79,0x3f,0x80,0x2c,0x70,0x44,0xe1,0x00,0x20,0x40,0x79,0x64,0x20,0x40,
 0x5f,0xf8,0x78,0x57,0x7c,0x00,0x20,0x40,0x5a,0xc0,0x20,0x21,0x57,0x83,0x20,0x40,
 0x4c,0x27,0x20,0x40,0x57,0xed,0x20,0x40,0x58,0x63,0x24,0x2c,0x57,0x75,0x20,0x56,
-0x85,0xb2,0x6f,0xe2,0x4a,0xd3,0x24,0x5a,0x01,0x81,0x20,0x40,0x57,0x91,0x20,0x36,
+0x85,0xbc,0x6f,0xe2,0x4a,0xd3,0x24,0x5a,0x01,0x81,0x20,0x40,0x57,0x91,0x20,0x36,
 0xd7,0x62,0xc5,0x16,0x57,0x62,0x20,0x20,0x57,0x6f,0x79,0x20,0x00,0x2c,0x78,0x56,
 0xfc,0x00,0x20,0x60,0x00,0x00,0x78,0x37,0x7c,0x00,0x20,0x40,0x58,0x9b,0x20,0x56,
-0x85,0xb2,0x6f,0xe2,0x4a,0xd3,0x24,0x5a,0x01,0x81,0x20,0x36,0xd7,0x62,0xc5,0x16,
+0x85,0xbc,0x6f,0xe2,0x4a,0xd3,0x24,0x5a,0x01,0x81,0x20,0x36,0xd7,0x62,0xc5,0x16,
 0x57,0x62,0x20,0x20,0x57,0x6f,0x20,0x40,0x57,0x84,0x20,0x40,0x00,0xea,0xd8,0xa0,
 0x04,0x3b,0x18,0x00,0x72,0x50,0x20,0x20,0x7c,0xaf,0x18,0x42,0x7e,0x00,0x20,0x40,
 0x7d,0x2b,0x1c,0x30,0x7e,0x00,0x79,0x20,0x7e,0x2c,0x20,0x40,0x7d,0x14,0x79,0x3f,
@@ -138,10 +138,10 @@
 0x7c,0x00,0x20,0x21,0x7d,0xc9,0x20,0x20,0x7d,0xc7,0x78,0x37,0x7c,0x00,0x6f,0xe2,
 0x00,0x30,0xc2,0x80,0xc7,0x0b,0x6f,0xe2,0x4a,0xd8,0x1f,0xe0,0xfe,0x01,0x67,0xe2,
 0x4a,0xd8,0x68,0x48,0x00,0x4d,0x20,0x40,0x02,0x18,0x24,0x3a,0x02,0x3c,0x6f,0xe2,
-0x4a,0xd8,0x1f,0xe6,0x7c,0x03,0x24,0x21,0x02,0x37,0x6f,0xe2,0x4a,0xe5,0x20,0x40,
+0x4a,0xd8,0x1f,0xe6,0x7c,0x03,0x24,0x21,0x02,0x37,0x6f,0xe2,0x4a,0xe6,0x20,0x40,
 0x04,0x9f,0x20,0x22,0xfd,0xc7,0x6f,0xe2,0x00,0x47,0xc3,0x81,0x80,0x00,0x6f,0xe2,
 0x00,0x48,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x00,0x4b,0xc3,0x83,0x00,0x00,0x20,0x20,
-0x46,0xfa,0x6f,0xe2,0x4a,0xe0,0x24,0x3a,0x46,0xfa,0x6f,0xe2,0x4a,0xe5,0x20,0x40,
+0x46,0xfa,0x6f,0xe2,0x4a,0xe1,0x24,0x3a,0x46,0xfa,0x6f,0xe2,0x4a,0xe6,0x20,0x40,
 0x04,0x9f,0x24,0x22,0xc6,0xfa,0x6f,0xe2,0x4a,0xd8,0x1f,0xe6,0x7c,0x12,0x24,0x21,
 0x46,0xfa,0x20,0x20,0x7d,0xc7,0x20,0x30,0x82,0x50,0x70,0x89,0x55,0xd4,0x20,0x00,
 0x00,0x04,0x70,0x89,0x55,0xd2,0x20,0x00,0x00,0x04,0x70,0x89,0x55,0xd1,0x20,0x00,
@@ -160,12 +160,12 @@
 0x41,0xf2,0x67,0xe4,0x41,0xfe,0x58,0x00,0x03,0x19,0x67,0xe4,0x41,0xfa,0x58,0x00,
 0x03,0x2b,0x67,0xe4,0x41,0xea,0x58,0x00,0x03,0x2f,0x67,0xe4,0x45,0x41,0x20,0x40,
 0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,0x50,0x4d,0x6f,0xe2,
-0x4a,0xe0,0x20,0x7a,0x00,0x00,0x68,0x48,0x4a,0xe1,0x1c,0x42,0x7e,0x00,0x98,0x46,
+0x4a,0xe1,0x20,0x7a,0x00,0x00,0x68,0x48,0x4a,0xe2,0x1c,0x42,0x7e,0x00,0x98,0x46,
 0x7e,0x00,0x24,0x21,0x02,0x8b,0xd8,0x40,0x03,0xe8,0x98,0x46,0x7c,0x00,0x24,0x61,
-0x00,0x00,0x70,0x4a,0xe0,0x00,0x20,0x60,0x00,0x00,0x6f,0xe2,0x4a,0xe5,0x20,0x7a,
-0x00,0x00,0x68,0x48,0x4a,0xe6,0x1c,0x42,0x7e,0x00,0x98,0x46,0x7e,0x00,0x24,0x21,
+0x00,0x00,0x70,0x4a,0xe1,0x00,0x20,0x60,0x00,0x00,0x6f,0xe2,0x4a,0xe6,0x20,0x7a,
+0x00,0x00,0x68,0x48,0x4a,0xe7,0x1c,0x42,0x7e,0x00,0x98,0x46,0x7e,0x00,0x24,0x21,
 0x02,0x96,0xd8,0x40,0x06,0x40,0x98,0x46,0x7c,0x00,0x24,0x61,0x00,0x00,0x70,0x4a,
-0xe5,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x7b,0xc1,0x20,0x40,0x02,0x8d,0x20,0x40,
+0xe6,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x7b,0xc1,0x20,0x40,0x02,0x8d,0x20,0x40,
 0x02,0x82,0x20,0x40,0x04,0x9b,0x20,0x40,0x56,0x48,0x24,0x7a,0x00,0x00,0x6f,0xe4,
 0x4f,0xfc,0x68,0x44,0x4f,0xfe,0x98,0x46,0x7c,0x00,0x20,0x62,0x80,0x00,0x20,0x20,
 0x4e,0x41,0x6f,0xe2,0x0a,0x95,0xc0,0x04,0x83,0x01,0xc0,0x01,0x02,0xdd,0xc0,0x0a,
@@ -180,7 +180,7 @@
 0x84,0x00,0x60,0x44,0x40,0xaf,0x1f,0xeb,0xfe,0x00,0xd8,0x40,0x00,0x60,0x98,0x40,
 0x84,0x00,0x60,0x44,0x40,0xb3,0x20,0x60,0x00,0x00,0x20,0x40,0x02,0xc3,0x6f,0xe2,
 0x00,0x46,0x67,0xe2,0x4a,0xdd,0x6f,0xe2,0x4a,0xde,0x20,0x5a,0x4e,0x32,0x20,0x20,
-0x4d,0xd7,0xda,0x20,0x4a,0xee,0xdf,0x20,0x00,0x04,0xef,0xe2,0x00,0x11,0x1f,0xe1,
+0x4d,0xd7,0xda,0x20,0x4a,0xef,0xdf,0x20,0x00,0x04,0xef,0xe2,0x00,0x11,0x1f,0xe1,
 0x04,0x1f,0x60,0x42,0x04,0xf8,0x2f,0xef,0xfe,0x07,0x20,0x40,0x82,0xf8,0x1a,0x20,
 0xa2,0x05,0xc2,0x00,0x02,0xd5,0x20,0x60,0x00,0x00,0x70,0x49,0xc0,0x00,0x20,0x40,
 0x02,0xc3,0x20,0x40,0x02,0xd3,0x6f,0xe2,0x4a,0xde,0x20,0x5a,0x4e,0x2f,0x58,0x00,
@@ -192,9 +192,9 @@
 0xdd,0x00,0x20,0x60,0x00,0x00,0x70,0x0a,0xff,0x03,0x58,0x00,0x00,0x01,0x20,0x40,
 0x50,0xa5,0x6f,0xe2,0x00,0x46,0x1f,0xf2,0x7e,0x00,0x68,0x42,0x04,0xf8,0x98,0x41,
 0xfe,0x00,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x67,0xb9,0x20,0x40,0x02,0xf8,0x6f,0xe2,
-0x4a,0xed,0x24,0x7a,0x00,0x00,0x6f,0xe4,0x46,0x52,0x79,0x3f,0xfe,0x04,0x67,0xe4,
+0x4a,0xee,0x24,0x7a,0x00,0x00,0x6f,0xe4,0x46,0x52,0x79,0x3f,0xfe,0x04,0x67,0xe4,
 0x46,0x52,0x70,0x49,0xc0,0x32,0x20,0x60,0x00,0x00,0x20,0x40,0x4c,0xe4,0x20,0x40,
-0x06,0xbf,0x20,0x40,0x4e,0x29,0x20,0x40,0x02,0xc3,0x6f,0xe2,0x4a,0xde,0x20,0x3a,
+0x06,0xc9,0x20,0x40,0x4e,0x29,0x20,0x40,0x02,0xc3,0x6f,0xe2,0x4a,0xde,0x20,0x3a,
 0x4d,0x6b,0x20,0x20,0x4d,0x75,0xc6,0x84,0x80,0x00,0x6f,0xe2,0x49,0xc0,0x20,0x7a,
 0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x49,0xc0,0x24,0x7a,0x00,0x00,0x6f,0xe4,
 0x46,0x52,0xc2,0x80,0x7c,0x0c,0x20,0x60,0x00,0x00,0x20,0x40,0x4f,0x11,0x20,0x74,
@@ -202,7 +202,7 @@
 0x46,0x70,0x68,0x44,0x04,0x74,0x60,0x44,0x46,0x73,0x20,0x40,0x5b,0x6c,0x24,0x3a,
 0x4a,0x8b,0x6f,0xe2,0x04,0x9e,0x20,0x20,0x50,0x42,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
 0x03,0x29,0x1f,0x22,0x7e,0x00,0x20,0x60,0x00,0x00,0x1a,0x42,0x7e,0x00,0x20,0x60,
-0x00,0x00,0x20,0x40,0x05,0x80,0x24,0x34,0x4d,0x4b,0x20,0x20,0x4d,0xbd,0x20,0x20,
+0x00,0x00,0x20,0x40,0x05,0x8a,0x24,0x34,0x4d,0x4b,0x20,0x20,0x4d,0xbd,0x20,0x20,
 0x4d,0xc8,0x20,0x40,0x4d,0xd7,0x70,0x0a,0xff,0x07,0x6f,0xe4,0x04,0xfb,0x20,0x7a,
 0x00,0x00,0xd8,0x40,0x00,0xfe,0x20,0x40,0x7d,0xb5,0x1f,0xe2,0x72,0x00,0x6f,0xe4,
 0x04,0xfb,0x9f,0x26,0x7e,0x00,0x67,0xe4,0x04,0xfb,0x1f,0x20,0xfe,0x01,0x20,0x40,
@@ -221,9 +221,9 @@
 0x00,0x03,0x60,0x42,0x4a,0xde,0x20,0x20,0x50,0x1f,0x20,0x40,0x03,0x80,0x24,0x7a,
 0x00,0x00,0x6f,0xe4,0x46,0x52,0xc3,0x02,0x03,0xb7,0x6f,0xe2,0x45,0x3d,0xc0,0x00,
 0x03,0xb7,0x1a,0x22,0x06,0x00,0xe8,0xe2,0x00,0x03,0x18,0xe1,0x0e,0x0f,0x60,0xe2,
-0x04,0xf8,0x20,0x40,0x07,0x6b,0x24,0x20,0x83,0xb7,0x20,0x40,0x07,0x96,0x70,0x0b,
+0x04,0xf8,0x20,0x40,0x07,0x75,0x24,0x20,0x83,0xb7,0x20,0x40,0x07,0xa0,0x70,0x0b,
 0x01,0x01,0xef,0xe2,0x00,0x03,0x68,0x42,0x45,0x3b,0x98,0x40,0x84,0x00,0x60,0x42,
-0x45,0x3b,0x20,0x20,0x07,0x82,0x1a,0x22,0x6e,0x00,0xe8,0x42,0x00,0x03,0x18,0x51,
+0x45,0x3b,0x20,0x20,0x07,0x8c,0x1a,0x22,0x6e,0x00,0xe8,0x42,0x00,0x03,0x18,0x51,
 0x84,0x00,0x20,0x40,0x03,0x8d,0x24,0x22,0x83,0xa3,0x70,0x0b,0x01,0x00,0xc5,0x84,
 0xfd,0xc7,0x1e,0xe2,0x22,0x00,0xef,0xe2,0x00,0x11,0x1f,0xf1,0xfe,0x00,0x20,0x40,
 0x04,0x9f,0x20,0x22,0xfd,0xc9,0x20,0x20,0x7d,0xc7,0xda,0x60,0x03,0x8f,0x20,0x20,
@@ -239,12 +239,12 @@
 0x00,0x00,0x20,0x40,0x66,0x9e,0x24,0x7a,0x00,0x00,0x70,0x0b,0x01,0x01,0x20,0x20,
 0x7c,0x0c,0x70,0x0b,0x01,0x01,0x20,0x20,0x50,0x1c,0x20,0x40,0x03,0x80,0x24,0x7a,
 0x00,0x00,0x1a,0x22,0x06,0x00,0xe8,0xe2,0x00,0x03,0x18,0xe1,0x0e,0x0f,0x60,0xe2,
-0x04,0xf8,0x20,0x40,0x07,0x6b,0x24,0x20,0x83,0xb7,0x20,0x40,0x07,0x96,0x6f,0xe2,
+0x04,0xf8,0x20,0x40,0x07,0x75,0x24,0x20,0x83,0xb7,0x20,0x40,0x07,0xa0,0x6f,0xe2,
 0x46,0x52,0xc3,0x02,0x03,0xb7,0x6f,0xe2,0x45,0x3a,0x20,0x7a,0x00,0x00,0x6f,0xe4,
 0x45,0x45,0xc0,0x80,0x03,0xcf,0x6f,0xe2,0x0b,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe4,
 0x45,0x45,0x1a,0x22,0x06,0x00,0xef,0xe2,0x00,0x03,0x18,0x62,0x7e,0x00,0x67,0xe4,
 0x45,0x43,0x20,0x40,0x03,0xd5,0x6f,0xe2,0x04,0xf8,0x1f,0xe3,0xfe,0x00,0x67,0xe2,
-0x45,0x2f,0x20,0x40,0x6b,0x0c,0x20,0x20,0x07,0x82,0x20,0x40,0x4e,0xcb,0xd8,0x40,
+0x45,0x2f,0x20,0x40,0x6b,0x0c,0x20,0x20,0x07,0x8c,0x20,0x40,0x4e,0xcb,0xd8,0x40,
 0x00,0x7f,0x20,0x40,0x7d,0xb5,0x67,0xe4,0x46,0x6a,0x20,0x20,0x4e,0xc6,0x6f,0xe2,
 0x46,0x79,0xc3,0x82,0x80,0x00,0x20,0x40,0x66,0x9e,0x24,0x7a,0x00,0x00,0x70,0x00,
 0x7c,0x18,0x20,0x20,0x50,0xda,0x70,0x0b,0x01,0x00,0x20,0x20,0x50,0xbd,0x1a,0x22,
@@ -274,304 +274,307 @@
 0x00,0x03,0x1f,0xe2,0x0a,0x00,0xef,0xe2,0x00,0x03,0x1f,0xe2,0x72,0x00,0x20,0x40,
 0x67,0xda,0x20,0x20,0x50,0x1f,0xef,0xe2,0x00,0x03,0x1f,0xe2,0x2c,0x00,0x20,0x20,
 0x50,0x1f,0x20,0x40,0x50,0x1f,0x20,0x20,0x4d,0x85,0x6f,0xe2,0x46,0x79,0xc2,0x81,
-0x85,0x92,0x6f,0xe2,0x46,0x79,0xc3,0x83,0x80,0x00,0x18,0x40,0xff,0xfd,0xd8,0x40,
+0x85,0x9c,0x6f,0xe2,0x46,0x79,0xc3,0x83,0x80,0x00,0x18,0x40,0xff,0xfd,0xd8,0x40,
 0x00,0xc8,0x20,0x40,0x7d,0xb5,0x68,0x42,0x46,0x7a,0x20,0x40,0x7d,0xb5,0x1f,0xe2,
 0x22,0x00,0x18,0x42,0x7e,0x00,0x9a,0x26,0x7e,0x00,0x67,0xe2,0x46,0x7a,0x68,0x44,
 0x46,0x7b,0x18,0x40,0x85,0xff,0x20,0x40,0x5b,0x4d,0x20,0x3a,0x04,0x66,0xe8,0x48,
 0x00,0x06,0x59,0x28,0x03,0x02,0x98,0x46,0x7c,0x00,0x24,0x22,0x84,0x66,0xef,0xe2,
 0x00,0x06,0xc2,0x82,0x84,0x62,0xc2,0x82,0x4f,0x01,0x20,0x20,0x04,0x66,0x20,0x40,
-0x06,0xc5,0x68,0x44,0x46,0x7b,0x20,0x40,0x5e,0x4d,0x20,0x20,0x4f,0x03,0x70,0x46,
+0x06,0xcf,0x68,0x44,0x46,0x7b,0x20,0x40,0x5e,0x4d,0x20,0x20,0x4f,0x03,0x70,0x46,
 0x7a,0x00,0x70,0x0b,0x01,0x01,0x20,0x40,0x50,0xe0,0x20,0x20,0x50,0x1c,0x20,0x40,
 0x56,0x48,0x24,0x7a,0x00,0x00,0x6f,0xe4,0x4f,0xfc,0x68,0x44,0x4f,0xfe,0x98,0x46,
 0x7c,0x00,0x20,0x22,0x84,0x71,0x20,0x20,0x4e,0x41,0x6f,0xe2,0x45,0x3d,0xc1,0x00,
-0x00,0x00,0x20,0x40,0x07,0x6f,0x24,0x62,0x80,0x00,0x62,0x24,0x0a,0xaa,0x1a,0x20,
+0x00,0x00,0x20,0x40,0x07,0x79,0x24,0x62,0x80,0x00,0x62,0x24,0x0a,0xaa,0x1a,0x20,
 0x8c,0x00,0xef,0xe2,0x00,0x06,0x1f,0xe1,0x7e,0x1f,0x1f,0xe3,0xfe,0x00,0x67,0xe2,
 0x45,0x2f,0x20,0x40,0x69,0x33,0x6a,0x24,0x0a,0xaa,0x1a,0x22,0x0c,0x00,0x20,0x40,
-0x07,0x9d,0x20,0x40,0x6a,0xec,0x6a,0x24,0x0a,0xaa,0x1a,0x22,0x0a,0x00,0x20,0x20,
-0x07,0x89,0x20,0x40,0x04,0x95,0x6f,0xe2,0x4a,0xdd,0x20,0x3a,0x04,0x88,0x6f,0xe2,
+0x07,0xa7,0x20,0x40,0x6a,0xec,0x6a,0x24,0x0a,0xaa,0x1a,0x22,0x0a,0x00,0x20,0x20,
+0x07,0x93,0x20,0x40,0x04,0x95,0x6f,0xe2,0x4a,0xdd,0x20,0x3a,0x04,0x88,0x6f,0xe2,
 0x00,0x47,0xc3,0x81,0x80,0x00,0x20,0x40,0x4c,0x8f,0x20,0x40,0x03,0x10,0x20,0x40,
 0x04,0x9b,0x20,0x40,0x04,0x6a,0x20,0x40,0x56,0x48,0x24,0x7a,0x00,0x00,0x20,0x40,
 0x51,0x83,0x20,0x40,0x56,0x48,0x24,0x7a,0x00,0x00,0x20,0x40,0x53,0x3e,0x20,0x40,
 0x56,0x48,0x24,0x7a,0x00,0x00,0x20,0x20,0x6a,0x59,0x20,0x40,0x04,0x9e,0x24,0x62,
 0x80,0x00,0x20,0x40,0x66,0xfd,0x20,0x40,0x75,0x91,0x20,0x40,0x75,0x6a,0x20,0x60,
-0x00,0x00,0x20,0x40,0x05,0xb2,0x20,0x21,0x4d,0x54,0x20,0x20,0x4d,0x56,0x6f,0xe2,
+0x00,0x00,0x20,0x40,0x05,0xbc,0x20,0x21,0x4d,0x54,0x20,0x20,0x4d,0x56,0x6f,0xe2,
 0x4a,0xdd,0x68,0x42,0x00,0x46,0x98,0x46,0x7c,0x00,0x20,0x60,0x00,0x00,0x6f,0xe2,
 0x4a,0xdb,0x68,0x42,0x00,0x46,0x98,0x46,0x7c,0x00,0x20,0x60,0x00,0x00,0x20,0x40,
 0x04,0xa2,0x24,0x62,0x80,0x00,0x20,0x20,0x6b,0x82,0x20,0x40,0x56,0x49,0x24,0x3a,
 0x4a,0x8b,0x20,0x40,0x56,0x4f,0x20,0x40,0x56,0x66,0x6f,0xe2,0x00,0x46,0x67,0xe2,
 0x4a,0xdb,0x20,0x60,0x00,0x00,0x18,0xc2,0x22,0x00,0x6f,0xe2,0x00,0x46,0x67,0xe2,
-0x4a,0xe5,0x1c,0x42,0x7e,0x00,0x67,0xe8,0x4a,0xe6,0x20,0x40,0x56,0x48,0x24,0x7a,
+0x4a,0xe6,0x1c,0x42,0x7e,0x00,0x67,0xe8,0x4a,0xe7,0x20,0x40,0x56,0x48,0x24,0x7a,
 0x00,0x00,0x1a,0x22,0x0c,0x00,0x20,0x20,0x51,0x56,0xda,0x40,0x00,0x00,0x20,0x40,
 0x56,0x49,0x24,0x3a,0x4a,0x8b,0x20,0x40,0x56,0x58,0xda,0x40,0x14,0x00,0xd8,0xe0,
 0x00,0x00,0x20,0x20,0x56,0x21,0x20,0x40,0x56,0x38,0x6f,0xe6,0x42,0x32,0x24,0x7a,
 0x00,0x00,0x70,0x4a,0xdb,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x56,0x3f,0x20,0x20,
 0x04,0xc1,0x6f,0xe2,0x4a,0xdb,0x24,0x7a,0x00,0x00,0x6f,0xe6,0x42,0x32,0x20,0x60,
 0x00,0x00,0x6f,0xe2,0x4a,0xdb,0x20,0x3a,0x56,0x4c,0x20,0x40,0x04,0xa2,0x20,0x22,
-0xd6,0x4c,0x20,0x20,0x7d,0xc7,0x6f,0xe2,0x4a,0xde,0x20,0x3a,0x6c,0xd1,0x6f,0xe2,
-0x4a,0xdf,0x68,0x44,0x45,0x47,0x98,0x40,0x8a,0x00,0x6f,0xe2,0x4a,0xec,0xe7,0xe2,
-0x00,0x05,0x20,0x20,0x6c,0xd1,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x57,0x09,0x20,0x40,
-0x57,0x09,0x70,0x49,0xcb,0x01,0x70,0x49,0xcc,0x00,0x58,0x00,0x00,0x00,0x67,0xf0,
-0x49,0xc1,0x58,0x00,0x00,0x1b,0x67,0xe4,0x49,0xc9,0x20,0x60,0x00,0x00,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,0xe2,0x72,0x00,0x20,0x3a,0x58,0x8b,0x20,0x20,0x58,0x87,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,0x20,0x40,0x57,0xaf,0x20,0x40,0x04,0xfa,0x20,0x20,0x58,0xa7,0x20,0x36,
-0x82,0x66,0xc5,0x16,0x02,0x66,0x20,0x20,0x57,0xbe,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
-0x58,0xb3,0x6f,0xe2,0x49,0xcb,0x08,0x00,0x86,0x08,0xef,0xe2,0x00,0x06,0x1f,0xe2,
-0x72,0x00,0x08,0x00,0x86,0x08,0x20,0x22,0xd8,0xbc,0x20,0x20,0x58,0xb9,0x6f,0xe2,
-0x4a,0xe5,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x58,0xc4,0x6f,0xe2,
-0x44,0x56,0xc0,0x00,0xd8,0xd3,0x6f,0xe2,0x44,0x57,0x1f,0xf2,0x7e,0x00,0x1f,0xeb,
-0xfe,0x00,0x67,0xe2,0x49,0xcb,0x68,0x42,0x43,0x41,0x18,0x40,0xfe,0x06,0x67,0xe2,
-0x49,0xcc,0x6f,0xec,0x44,0x72,0x67,0xec,0x49,0xcd,0x18,0x42,0x72,0x00,0xd8,0xc0,
-0x43,0x42,0x20,0x40,0x7c,0xcf,0x20,0x20,0x58,0xde,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
-0x58,0xf7,0xd8,0x40,0x00,0x04,0x6f,0xe2,0x44,0x57,0x7d,0x3a,0x04,0x06,0x60,0x42,
-0x49,0xcb,0x68,0x42,0x43,0x61,0x18,0x40,0xfe,0x06,0x67,0xe2,0x49,0xcc,0x6f,0xec,
-0x44,0x72,0x67,0xec,0x49,0xcd,0xd8,0xc0,0x43,0x62,0x18,0x42,0x72,0x00,0x20,0x40,
-0x7c,0xcf,0x20,0x40,0x58,0xa1,0x20,0x20,0x5a,0xe2,0x6f,0xe2,0x04,0x3b,0xc3,0x80,
-0x00,0x00,0x20,0x20,0x5b,0x09,0x20,0x40,0x5a,0xc9,0xc6,0x16,0x00,0x00,0x20,0x40,
-0x59,0x9a,0x6f,0xe2,0x02,0xd5,0x2f,0xef,0xfe,0x04,0x79,0x20,0x80,0x2a,0x1f,0xe3,
-0x7e,0x00,0x98,0x42,0xfe,0x00,0x2f,0xef,0xfe,0x02,0x79,0x20,0x80,0x0f,0xc6,0x07,
-0x80,0x00,0x6f,0xe2,0x02,0xd6,0x20,0x3a,0x05,0x3f,0x6f,0xe2,0x04,0x3b,0xc3,0x02,
-0x05,0x3f,0x20,0x40,0x73,0x42,0x20,0x40,0x72,0xb2,0x7d,0x3a,0x00,0x0f,0x24,0x7a,
-0x00,0x00,0x68,0x42,0x04,0x52,0x79,0x40,0x04,0x02,0x60,0x42,0x04,0x52,0x6f,0xe2,
-0x4a,0xce,0x24,0x7a,0x00,0x00,0x20,0x20,0x05,0x45,0x6f,0xe2,0x02,0xd6,0x20,0x7a,
-0x00,0x00,0x6f,0xe2,0x02,0xd5,0x2f,0xe0,0x06,0x01,0x20,0x20,0x85,0x6d,0x2f,0xe0,
-0x06,0x02,0x20,0x20,0x85,0x4d,0x20,0x60,0x00,0x00,0x6f,0xe4,0x02,0xd9,0xc1,0x82,
-0x00,0x00,0xef,0xe6,0x00,0x06,0x67,0xe6,0x04,0x73,0x79,0x20,0x00,0x0f,0xc0,0x09,
-0x05,0x61,0xc0,0x29,0x05,0x63,0xc0,0x0b,0x05,0x5a,0xc0,0x0c,0x5e,0x3b,0xc0,0x01,
-0x5c,0xa1,0xc0,0x0f,0x06,0xbf,0x79,0x3f,0x80,0x0f,0x20,0x60,0x00,0x00,0x58,0x00,
-0x0b,0x1e,0x67,0xe4,0x49,0xc5,0x20,0x40,0x05,0x66,0x1f,0x20,0xf3,0xfe,0xda,0x20,
-0x02,0xe0,0x20,0x40,0x5a,0xbe,0x20,0x20,0x05,0x86,0x20,0x40,0x05,0x63,0x20,0x20,
-0x05,0x7d,0x20,0x40,0x05,0x66,0xda,0x20,0x02,0xde,0x20,0x20,0x5a,0xbe,0x6f,0xe2,
-0x02,0xd6,0x1f,0xe0,0xf3,0xf9,0x1f,0xe0,0xff,0xfc,0x67,0xe4,0x49,0xc1,0xe8,0x44,
-0x00,0x06,0x60,0x44,0x49,0xc3,0x20,0x60,0x00,0x00,0x79,0x20,0x00,0x0f,0x20,0x40,
-0x05,0x75,0x6f,0xe2,0x04,0x73,0xc0,0x09,0x05,0x7d,0xc0,0x0b,0x05,0x7c,0xc1,0x29,
-0x00,0x00,0x79,0x3f,0x80,0x0f,0x20,0x60,0x00,0x00,0x6f,0xe2,0x02,0xd6,0x68,0x44,
-0x49,0xc1,0x98,0x40,0x84,0x00,0x60,0x44,0x49,0xc1,0x1f,0xe2,0x72,0x00,0xda,0x20,
-0x02,0xd7,0x20,0x20,0x5a,0xbe,0x20,0x20,0x05,0x86,0x20,0x40,0x05,0x80,0x24,0x74,
-0x00,0x00,0x20,0x20,0x5e,0x13,0x20,0x40,0x7d,0xc1,0x6f,0xe4,0x49,0xc3,0x68,0x44,
-0x49,0xc1,0x98,0x46,0x7c,0x00,0x24,0x62,0x80,0x00,0x20,0x20,0x7d,0xbf,0x6f,0xe4,
-0x49,0xc5,0x1f,0xe2,0x0a,0x00,0x6f,0xe2,0x02,0xd6,0x1f,0xe2,0x72,0x00,0x20,0x40,
-0x7c,0xdc,0x18,0xa2,0x7e,0x00,0x67,0xe4,0x49,0xc5,0x20,0x40,0x05,0x80,0x24,0x74,
-0x00,0x00,0xd8,0xe0,0x00,0x03,0x20,0x40,0x50,0xe6,0x20,0x20,0x05,0x92,0x20,0x40,
-0x5c,0x74,0x24,0x7a,0x00,0x00,0x70,0x0b,0x22,0x17,0x58,0x00,0x0b,0x1e,0x67,0xe4,
-0x49,0xc7,0x68,0x44,0x0b,0x1e,0x18,0x40,0x84,0x04,0x58,0x00,0x00,0xf9,0x20,0x40,
-0x7d,0xb5,0x1f,0xe0,0xa5,0xfc,0x18,0x00,0x02,0x02,0x1f,0xe2,0x22,0x00,0x20,0x40,
-0x5c,0x32,0x6f,0xe4,0x49,0xc7,0x1f,0xe2,0x0c,0x00,0x1a,0x22,0x72,0x00,0x20,0x40,
-0x7c,0xcf,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x49,0xc7,0x6f,0xe4,0x0b,0x1e,0x9a,0x46,
-0x7e,0x00,0x67,0xe4,0x0b,0x1e,0x20,0x3a,0x05,0xae,0xd8,0x40,0x00,0xf9,0x20,0x40,
-0x7d,0xb5,0x1f,0xe2,0x24,0x00,0x18,0x00,0x02,0x01,0x20,0x20,0x05,0x9d,0x58,0x00,
-0x00,0x00,0x67,0xe4,0x49,0xc5,0xd8,0xe0,0x00,0x03,0x20,0x20,0x50,0xe2,0x70,0x4a,
-0xd3,0x00,0x68,0x44,0x4f,0xf0,0x6f,0xe4,0x4f,0xf2,0x98,0x46,0x22,0x00,0x68,0x44,
-0x4f,0xf4,0x6f,0xe4,0x4f,0xf6,0x60,0x44,0x4a,0xd6,0x67,0xe4,0x4a,0xd4,0x98,0x46,
-0x7e,0x00,0x20,0x21,0x05,0xc2,0x20,0x22,0x85,0xc2,0x1a,0x22,0x04,0x00,0x6f,0xe4,
-0x4a,0xd4,0x98,0x40,0xfe,0x00,0x68,0x44,0x4a,0xd6,0x98,0x46,0x7e,0x00,0xd8,0x40,
-0x03,0x00,0x98,0x46,0x7c,0x00,0x24,0x61,0x00,0x00,0x70,0x4a,0xd3,0x01,0x20,0x60,
-0x00,0x00,0x68,0x42,0x04,0x52,0x28,0x4c,0x00,0x05,0x20,0x60,0x80,0x00,0x6f,0xe2,
-0x02,0xd5,0x1f,0xe3,0xfe,0x00,0x98,0x42,0xfe,0x00,0xc4,0x01,0x80,0x00,0x79,0x3f,
-0x84,0x05,0x79,0x40,0x04,0x03,0x60,0x42,0x04,0x52,0x28,0x40,0x06,0x03,0x24,0x60,
-0x80,0x00,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x05,0xd7,0x6f,0xe2,0x49,0xcd,0x20,0x20,
-0x05,0xd8,0x6f,0xe2,0x43,0xb0,0xc0,0x02,0xd9,0xac,0x6f,0xe2,0x44,0x97,0xc0,0x01,
-0x59,0xb0,0x20,0x60,0x00,0x00,0x6f,0xe2,0x04,0x52,0xc3,0x82,0x80,0x00,0x20,0x40,
-0x5a,0x1c,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x59,0xfc,0x20,0x40,0x5c,0x53,0x20,0x3a,
-0x5a,0x3e,0xef,0xe2,0x00,0x06,0xe8,0x42,0x00,0x06,0x18,0x42,0x22,0x00,0x9a,0x26,
-0x7e,0x00,0x20,0x40,0x06,0x01,0x20,0x40,0x7d,0xb5,0x1f,0xe2,0x04,0x00,0xef,0xe2,
-0x00,0x06,0x1f,0xe2,0x02,0x00,0x1a,0x22,0x7e,0x00,0x98,0xc0,0x8c,0x00,0xd8,0xa0,
-0x49,0xcd,0x18,0x42,0x72,0x00,0x20,0x40,0x7c,0xcf,0x20,0x40,0x5a,0x2e,0x20,0x40,
-0x5a,0x40,0x20,0x40,0x5c,0x53,0xef,0xe2,0x00,0x06,0x1f,0xe2,0x22,0x00,0x18,0xc2,
-0x26,0x00,0xe8,0x42,0x00,0x06,0x18,0x42,0x24,0x00,0x9a,0x46,0x7e,0x00,0x20,0x40,
-0x06,0x01,0x20,0x40,0x7d,0xb5,0x9a,0x40,0xfe,0x00,0xe7,0xe2,0x00,0x13,0x9a,0x26,
-0x7c,0x00,0x24,0x62,0x80,0x00,0x20,0x20,0x5c,0x76,0x18,0xc2,0x0a,0x00,0x68,0x44,
-0x49,0xc9,0x18,0xa2,0x0c,0x00,0x20,0x60,0x00,0x00,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
-0x5a,0x41,0x60,0x42,0x49,0xcc,0x68,0x42,0x04,0x52,0x79,0x20,0x04,0x05,0x18,0x41,
-0x7e,0xfc,0x98,0x21,0xfe,0x00,0x67,0xe2,0x04,0x52,0x1f,0xe1,0x7e,0x1f,0x28,0x0f,
-0xfe,0x29,0x79,0x20,0xfe,0x04,0x67,0xe2,0x49,0xcb,0x6f,0xe2,0x49,0xcb,0x28,0x20,
-0x06,0x01,0x24,0x20,0x86,0x16,0x6f,0xe2,0x49,0xcc,0x20,0x7a,0x00,0x00,0x6f,0xe2,
-0x04,0x3b,0xc4,0x02,0x00,0x00,0x20,0x40,0x73,0x42,0x20,0x20,0x72,0x99,0x6f,0xe2,
-0x4a,0xce,0x24,0x3a,0x72,0x9a,0xda,0x60,0x49,0xcb,0x68,0x4a,0x43,0xd5,0x20,0x40,
-0x72,0x77,0x18,0x00,0x70,0x08,0x98,0x00,0x5e,0x00,0x18,0x00,0x22,0x00,0x20,0x40,
-0x72,0x63,0x20,0x40,0x72,0xe8,0xda,0x60,0x49,0xcd,0x6f,0xe2,0x49,0xcc,0x1f,0xe0,
-0xa5,0xff,0x9a,0x60,0x8a,0x00,0x18,0x00,0x70,0x0c,0x1d,0xe2,0x7e,0x00,0xe7,0xe8,
-0x00,0x05,0x20,0x40,0x72,0x8e,0x6f,0xe2,0x49,0xcc,0x1f,0xe0,0xfe,0x04,0x67,0xe2,
-0x49,0xcc,0x20,0x20,0x72,0xae,0xc6,0x07,0x80,0x00,0xc6,0x16,0x00,0x00,0x20,0x40,
-0x5c,0x70,0x24,0x7a,0x00,0x00,0x6f,0xe2,0x02,0xd5,0x1f,0xe1,0x7e,0x03,0x67,0xe2,
-0x44,0xde,0xef,0xe2,0x00,0x06,0x67,0xe2,0x44,0xdd,0x20,0x7a,0x00,0x00,0x18,0xc2,
-0x7e,0x00,0x67,0xe4,0x44,0xdf,0x6f,0xe2,0x44,0xde,0xc0,0x01,0x86,0x74,0x20,0x40,
-0x06,0x46,0xd8,0xe0,0x00,0x03,0x24,0x34,0x4b,0xec,0x20,0x40,0x4b,0xf0,0x70,0x4a,
-0xe0,0x01,0x1c,0x42,0x7e,0x00,0x67,0xe8,0x4a,0xe1,0x20,0x20,0x5a,0x6b,0x6f,0xe2,
-0x44,0xde,0xc0,0x01,0x06,0x4a,0xc0,0x00,0x86,0x5e,0x20,0x60,0x00,0x00,0x6f,0xe4,
-0x44,0xdf,0x1f,0xe2,0x0c,0x00,0xef,0xe4,0x00,0x06,0x67,0xe4,0x44,0xce,0xef,0xe4,
-0x00,0x06,0x20,0x40,0x5a,0x7a,0x24,0x74,0x00,0x00,0x68,0x42,0x44,0xdd,0x60,0x42,
-0x44,0xd0,0x6f,0xe4,0x44,0xce,0x1f,0xe0,0xfe,0x04,0x98,0x46,0x7c,0x00,0x20,0x22,
-0xfd,0xbf,0x6f,0xe2,0x44,0xdd,0x1f,0xe2,0x72,0x00,0xd8,0xa0,0x0c,0x29,0x6f,0xe4,
-0x44,0xdf,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x7c,0xdc,0x20,0x20,0x7d,0xc1,0x20,0x40,
-0x5a,0x99,0x24,0x74,0x00,0x00,0x6f,0xe2,0x44,0xd0,0xd8,0xa0,0x0c,0x29,0x98,0xa0,
-0xa2,0x00,0x68,0x42,0x44,0xdd,0x98,0x40,0xfe,0x00,0x67,0xe2,0x44,0xd0,0x6f,0xe2,
-0x44,0xdd,0x1f,0xe2,0x72,0x00,0x1a,0x22,0x0a,0x00,0x6f,0xe4,0x44,0xdf,0x1f,0xe2,
-0x0c,0x00,0x20,0x40,0x7c,0xcf,0x58,0x00,0x0c,0x29,0x67,0xe4,0x44,0xdf,0x6f,0xe4,
-0x44,0xce,0x1f,0xe0,0xfe,0x04,0x68,0x42,0x44,0xd0,0x98,0x46,0x7c,0x00,0x20,0x22,
-0xfd,0xbf,0x20,0x20,0x7d,0xc1,0x6f,0xe2,0x02,0xd7,0xc0,0x04,0x06,0x78,0xc0,0x0a,
-0x06,0x84,0x20,0x20,0x60,0x45,0xda,0x20,0x00,0x09,0xda,0x40,0x00,0x09,0x20,0x40,
-0x5c,0x22,0x58,0x00,0x00,0x21,0xe7,0xf0,0x00,0x05,0x6f,0xe2,0x02,0xd8,0x1f,0xe1,
-0x7e,0x20,0x20,0x3a,0x06,0x82,0x70,0x4a,0xce,0x00,0x20,0x60,0x00,0x00,0x70,0x4a,
-0xce,0x01,0x20,0x60,0x00,0x00,0xef,0xe4,0x00,0x06,0x67,0xe4,0x49,0xc9,0x20,0x20,
-0x06,0x87,0xda,0x20,0x00,0x09,0xda,0x40,0x00,0x15,0x20,0x40,0x5c,0x22,0x58,0x00,
-0x00,0xfb,0xe7,0xe4,0x00,0x05,0x58,0x00,0x08,0x48,0xe7,0xe4,0x00,0x05,0x58,0x00,
-0x00,0xfb,0xe7,0xe4,0x00,0x05,0x58,0x00,0x08,0x48,0xe7,0xe4,0x00,0x05,0x20,0x60,
-0x00,0x00,0x6f,0xe2,0x4a,0xce,0x20,0x3a,0x06,0x97,0xd8,0xc0,0x43,0xae,0x20,0x20,
-0x06,0x98,0xd8,0xc0,0x49,0xcb,0xd8,0xa0,0x0a,0xce,0x20,0x20,0x06,0xa9,0x6f,0xe2,
-0x43,0x40,0x20,0x7a,0x00,0x00,0x6f,0xe2,0x4a,0xe5,0x24,0x7a,0x00,0x00,0xd8,0xe0,
-0x00,0x00,0x20,0x40,0x7c,0xf1,0x24,0x7a,0x00,0x00,0x20,0x40,0x06,0x93,0x20,0x40,
-0x5a,0xd5,0x6f,0xe2,0x4a,0xce,0x20,0x3a,0x06,0xa7,0xd8,0xa0,0x43,0xae,0x20,0x20,
-0x06,0xa8,0xd8,0xa0,0x49,0xcb,0xd8,0xc0,0x0a,0xce,0xdf,0x20,0x00,0x27,0x20,0x20,
-0x7c,0xcf,0x18,0x0a,0x7e,0x00,0xd8,0x40,0x00,0x1f,0x98,0x41,0x7e,0x00,0x1f,0xe0,
-0xfe,0x03,0x20,0x40,0x5a,0xef,0x6f,0xe2,0x0a,0xbe,0x68,0x42,0x44,0x5f,0x98,0x46,
-0x7c,0x00,0x24,0x22,0xda,0xd5,0x20,0x20,0x5a,0xec,0xef,0xe4,0x00,0x06,0xc0,0x02,
-0x06,0xba,0xc0,0x03,0x5e,0xd4,0xc0,0x02,0xde,0x96,0x20,0x60,0x00,0x00,0xef,0xe6,
-0x00,0x06,0x67,0xe6,0x04,0x73,0xc0,0x08,0x06,0xc1,0xc0,0x04,0x06,0xca,0x20,0x20,
-0x5c,0x8d,0xd8,0xe0,0x00,0x07,0x20,0x20,0x50,0xe2,0x20,0x40,0x5e,0x91,0x20,0x40,
-0x5a,0xb3,0xd9,0x60,0x00,0x01,0x20,0x20,0x5d,0xde,0xd8,0xe0,0x00,0x07,0x20,0x20,
-0x50,0xe6,0x20,0x40,0x5c,0xa9,0x67,0xe4,0x44,0x78,0x20,0x20,0x5c,0xa2,0x20,0x40,
-0x5e,0x91,0x20,0x40,0x5a,0xbb,0x20,0x20,0x06,0xcd,0x68,0x44,0x44,0x2c,0x60,0x44,
-0x0a,0x9e,0x20,0x40,0x5b,0x36,0x20,0x40,0x5b,0x4d,0x18,0xc0,0x8d,0xfe,0x18,0xc2,
-0x7e,0x00,0x67,0xe4,0x04,0x98,0x68,0x44,0x44,0x44,0x58,0x00,0x2a,0x00,0x98,0x46,
-0x7c,0x00,0x20,0x22,0x86,0xd9,0x20,0x20,0x5d,0x2d,0xd8,0x40,0x2a,0x00,0x20,0x40,
-0x5b,0x5c,0x20,0x3a,0x5e,0x56,0x20,0x20,0x5d,0x8b,0x20,0x60,0x00,0x00,0x20,0x20,
-0x68,0x46,0x6f,0xe2,0x00,0x7d,0xc0,0x08,0x06,0xf0,0xc0,0x0b,0x86,0xf6,0xc0,0x1e,
-0x86,0xed,0xc0,0x04,0x06,0xe9,0xc0,0x03,0x86,0xe6,0x20,0x20,0x60,0xfe,0x20,0x40,
-0x62,0x17,0x70,0x00,0x72,0x05,0x20,0x60,0x00,0x00,0x20,0x40,0x63,0xdb,0x70,0x04,
-0xd0,0x01,0x20,0x40,0x62,0x2f,0x20,0x20,0x7c,0x12,0x20,0x40,0x62,0xf2,0x70,0x09,
-0xb3,0x00,0x20,0x60,0x00,0x00,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,
-0x06,0xf4,0x20,0x20,0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x20,0x20,
-0x62,0xd2,0x78,0x54,0x7c,0x00,0x20,0x40,0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,
-0x00,0x00,0xc2,0x83,0x86,0xfd,0x20,0x20,0x63,0xf2,0xc0,0x42,0x07,0x00,0xc0,0x41,
-0x87,0x03,0x20,0x20,0x64,0x21,0x20,0x40,0x07,0x06,0x6f,0xe2,0x00,0x48,0x20,0x20,
-0x64,0x7b,0x20,0x40,0x07,0x06,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,0x44,0x90,0x20,0x3a,0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,
-0x79,0x32,0x20,0x20,0x02,0xa3,0xda,0x20,0x46,0x42,0x20,0x40,0x7d,0x9c,0x20,0x7a,
-0x00,0x00,0xc0,0x00,0xfb,0xff,0xc0,0x01,0x7c,0x04,0xc0,0x06,0xfc,0x16,0xc0,0x07,
-0x7c,0x1c,0x20,0x60,0x00,0x00,0x6f,0xe2,0x46,0x51,0xc0,0x00,0x07,0x1f,0x20,0x20,
-0x6a,0x0d,0x6f,0xe4,0x02,0x60,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x69,0x79,0x6f,0xe2,
-0x04,0xf8,0xc0,0x00,0x07,0x25,0x20,0x20,0x07,0x2b,0x6f,0xe2,0x04,0xf9,0xc0,0x1f,
-0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,0x87,0x32,0xc0,0x29,0xea,0x07,0x20,0x60,
-0x00,0x00,0x6f,0xe2,0x04,0xf9,0xc0,0x39,0xe9,0xe2,0xc0,0x1f,0xe9,0xe6,0xc0,0x77,
-0x87,0xa7,0xc0,0x7f,0x87,0xa9,0xc0,0x29,0x87,0xbb,0x20,0x60,0x00,0x00,0x6f,0xe4,
-0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x69,0x84,0x6f,0xe2,0x04,0xff,0xc0,0x20,
-0x87,0x3c,0xc0,0x20,0x69,0x6e,0xc0,0x38,0x87,0x3f,0xc0,0x38,0x07,0x52,0xc0,0x24,
-0xe9,0xbe,0x20,0x20,0x6a,0x58,0x20,0x40,0x69,0x70,0x20,0x40,0x07,0x7f,0x20,0x20,
-0x69,0x68,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xa9,0x6f,0xe2,0x45,0x3c,0x1f,0xe2,
-0x04,0x00,0x79,0x20,0x04,0x07,0x20,0x40,0x07,0x4d,0xe0,0x42,0x00,0x05,0x20,0x60,
-0x00,0x00,0x6f,0xe2,0x04,0xf8,0x20,0x7a,0x00,0x00,0xd8,0x40,0x00,0x00,0x20,0x40,
-0x07,0x4d,0xe0,0x42,0x00,0x05,0x20,0x60,0x00,0x00,0xd8,0xa0,0x4a,0xee,0x1f,0xe0,
-0xff,0xff,0x1f,0xef,0xfe,0x05,0x98,0xa0,0x8a,0x00,0x20,0x60,0x00,0x00,0x20,0x40,
-0x07,0x41,0x20,0x40,0x07,0x84,0x6f,0xe2,0x4a,0xed,0x1f,0xe0,0xfe,0x01,0x67,0xe2,
-0x4a,0xed,0x20,0x40,0x07,0x5c,0x70,0x0a,0x95,0x08,0x20,0x40,0x7b,0xab,0x20,0x40,
-0x69,0x72,0x20,0x20,0x69,0xba,0x68,0x42,0x4a,0xeb,0x6f,0xe2,0x45,0x3c,0x1f,0xe0,
-0x8f,0xff,0xf9,0x20,0x04,0x00,0x60,0x42,0x4a,0xeb,0xd8,0xe0,0x00,0x00,0xa8,0x4f,
-0xff,0xff,0x20,0x20,0x87,0x67,0x18,0xe0,0xfe,0x01,0x67,0xe2,0x4a,0xec,0x20,0x60,
-0x00,0x00,0x18,0xe0,0x8e,0x01,0x18,0xe6,0x7c,0x03,0x20,0x21,0x07,0x62,0x20,0x60,
-0x00,0x00,0x18,0xe0,0x8f,0xff,0x6f,0xe2,0x4a,0xeb,0xaf,0xef,0xff,0xff,0x20,0x60,
-0x00,0x00,0xd8,0xe0,0x00,0x00,0x6f,0xe2,0x4a,0xeb,0x20,0x3a,0x7d,0xbb,0xaf,0xef,
-0xff,0xff,0x24,0x20,0x87,0x7b,0x18,0xef,0xfe,0x05,0xda,0x20,0x4a,0xee,0x9a,0x20,
-0xa2,0x00,0x1a,0x20,0x8c,0x02,0xef,0xe2,0x00,0x06,0x20,0x3a,0x07,0x7b,0x20,0x20,
-0x7d,0xbd,0x18,0xe0,0x8e,0x01,0x18,0xe6,0x7c,0x03,0x24,0x21,0x7d,0xbb,0x20,0x20,
-0x07,0x70,0x6f,0xe2,0x45,0x2f,0x1f,0xe3,0x7e,0x00,0x20,0x20,0x07,0x85,0x6f,0xe2,
-0x04,0xf8,0x20,0x20,0x07,0x85,0x6f,0xe2,0x45,0x3c,0x1f,0xe0,0xff,0xff,0x1f,0xef,
-0xfe,0x05,0xd8,0xa0,0x4a,0xee,0x98,0xa0,0x8a,0x00,0x18,0xa0,0x8a,0x01,0x6f,0xe2,
-0x45,0x3a,0xe7,0xe2,0x00,0x05,0x6f,0xe2,0x45,0x3b,0xe7,0xe2,0x00,0x05,0x6f,0xe2,
-0x45,0x37,0xe7,0xe2,0x00,0x05,0x6f,0xe2,0x45,0x38,0xe7,0xe2,0x00,0x05,0x20,0x60,
-0x00,0x00,0x6f,0xe2,0x45,0x2f,0x1f,0xe3,0x7e,0x00,0x20,0x20,0x07,0x99,0x6f,0xe2,
-0x04,0xf8,0x20,0x20,0x07,0x99,0x6f,0xe2,0x45,0x3c,0x1f,0xe0,0xff,0xff,0x1f,0xef,
-0xfe,0x05,0xd8,0xc0,0x4a,0xee,0x98,0xc0,0x8c,0x00,0x18,0xc0,0x8c,0x01,0xef,0xe2,
-0x00,0x06,0x67,0xe2,0x45,0x3a,0xef,0xe2,0x00,0x06,0x67,0xe2,0x45,0x3b,0xef,0xe2,
-0x00,0x06,0x67,0xe2,0x45,0x37,0xef,0xe2,0x00,0x06,0x67,0xe2,0x45,0x38,0x20,0x60,
-0x00,0x00,0x20,0x40,0x07,0x96,0x20,0x20,0x07,0xb2,0x20,0x40,0x07,0x96,0x6f,0xe4,
-0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x1f,0xe0,0xfe,0x01,0x67,0xe4,0x04,0xfd,0xef,0xe2,
-0x00,0x06,0x68,0x42,0x45,0x3a,0x98,0x40,0xfe,0x00,0x67,0xe2,0x45,0x3a,0x6f,0xe2,
-0x04,0xf7,0x1f,0xeb,0x7e,0x00,0x67,0xe2,0x45,0x2f,0x20,0x40,0x6b,0x01,0x20,0x40,
-0x69,0x33,0x20,0x40,0x6a,0xe9,0x20,0x40,0x07,0x82,0x20,0x40,0x6b,0x0a,0x20,0x20,
-0x6a,0x58,0x20,0x40,0x07,0x47,0x68,0xe2,0x04,0xf8,0x60,0xe2,0x4a,0xec,0x18,0xe0,
-0x8f,0xff,0x6f,0xe2,0x4a,0xeb,0xf9,0x3f,0xfe,0x00,0x67,0xe2,0x4a,0xeb,0x6f,0xe2,
-0x4a,0xed,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x4a,0xed,0x70,0x0a,0x95,0x09,0x20,0x40,
-0x7b,0xab,0x20,0x20,0x6a,0x07,0xb4,0x54,0xaa,0x55,0x40,0x00,0x00,0x40,0x32,0x00,
-0x00,0x00,0x00,0x5c,0x10,0x50,0x20,0x01,0x01,0xf0,0x01,0x40,0x03,0x00,0x20,0x02,
-0x10,0x00,0xcc,0x18,0x30,0x19,0x01,0x00,0x00,0xe8,0x08,0x08,0x62,0x00,0xe8,0x09,
-0x18,0xd0,0x2c,0x01,0x04,0x44,0x02,0x20,0x06,0x00,0x44,0x00,0x00,0x02,0x00,0x20,
-0x00,0x82,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x55,
-0x01,0x00,0x92,0x40,0x0a,0xaa,0x55,0x01,0x00,0x54,0x46,0x40,0xaa,0x55,0x01,0x00,
-0x06,0x42,0x13,0xaa,0x55,0x01,0x00,0x5b,0x41,0x01,0xaa,0x55,0x08,0x00,0x98,0x40,
-0xff,0xfb,0x8f,0xfa,0x8b,0x85,0x59,0x83,0xaa,0x55,0x01,0x00,0xde,0x4a,0x01,0xaa,
-0x55,0x03,0x00,0x14,0x42,0xd1,0x48,0x07,0xaa,0x55,0x03,0x00,0x3e,0x45,0x7f,0x00,
-0x03,0xaa,0x55,0x01,0x00,0x3d,0x45,0x01,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,0x2d,0x0d,0x85,0x0f,0x2d,0x0d,0x2d,0x0d,0xaa,0x55,0x03,0x00,0xd0,0x4a,
-0x00,0x80,0x02,0xaa,0x55,0x02,0x00,0x68,0x46,0x10,0x0b,0xaa,0x55,0x01,0x00,0x6c,
-0x46,0x07,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,0xbf,0x49,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,0x00,0xaa,0x55,0x06,0x00,0xa0,0x40,0xa7,0xac,0x2a,0x21,0x10,
-0x55,0xaa,0x55,0x07,0x00,0xe7,0x44,0x06,0x59,0x69,0x63,0x68,0x69,0x70,0xaa,0x55,
-0x03,0x00,0xe4,0x41,0x20,0x00,0x02,0xaa,0x55,0x01,0x00,0xe8,0x41,0x01,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,0x20,0x03,0xaa,0x55,0x01,0x00,
-0x6e,0x46,0x01,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0xac,0x01,0x33,0x02,0x3a,0xaa,
-0x55,0x0b,0x00,0x81,0x43,0x0a,0x59,0x69,0x63,0x68,0x69,0x70,0x2d,0x6c,0x65,0x20,
-0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x02,0xaa,0x55,0x12,0x00,0x61,0x43,
-0x0e,0x02,0x01,0x02,0x0d,0x09,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,
-0x6c,0x65,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,0xf0,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,0x01,0x00,0xdf,0x4a,0x96,0xaa,0x55,0x02,0x00,0x47,0x45,
-0x83,0x46,0xaa,0x55,0xb6,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,0xaa,0x55,
-0x02,0x00,0x8e,0x44,0x41,0x47,0xaa,0x55,0x4e,0x01,0x41,0x47,0x01,0x00,0x02,0x00,
-0x28,0x02,0x01,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x20,0x03,0x00,0x02,0x05,0x2a,
-0x01,0x00,0x04,0x00,0x02,0x02,0x29,0x02,0x01,0x00,0x05,0x00,0x02,0x00,0x28,0x02,
-0x00,0x18,0x06,0x00,0x02,0x03,0x28,0x01,0x4e,0x07,0x00,0x02,0x00,0x2a,0x13,0x59,
-0x69,0x63,0x68,0x69,0x70,0x2d,0x6c,0x65,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
-0x20,0x20,0x08,0x00,0x02,0x03,0x28,0x01,0x4e,0x09,0x00,0x02,0x01,0x2a,0x02,0x00,
-0x00,0x0a,0x00,0x02,0x03,0x28,0x01,0x02,0x0b,0x00,0x02,0x04,0x2a,0x08,0x10,0x00,
-0x20,0x00,0x05,0x00,0x2c,0x01,0x0c,0x00,0x02,0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,
-0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,0xfe,0x43,0x53,0x53,0x49,0x0d,0x00,0x02,0x03,
-0x28,0x01,0x12,0x0e,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,0x0f,0x00,0x02,0x02,0x29,
-0x02,0x00,0x00,0x10,0x00,0x02,0x03,0x28,0x01,0x08,0x11,0x00,0x10,0xb3,0x9b,0x72,
-0x34,0xbe,0xec,0xd4,0xa8,0xf4,0x43,0x41,0x88,0x43,0x53,0x53,0x49,0x14,0x00,0x00,
+0xd6,0x4c,0x20,0x20,0x7d,0xc7,0x6f,0xe2,0x4a,0xde,0x20,0x3a,0x04,0xde,0x6f,0xe2,
+0x4a,0xe0,0x68,0x44,0x45,0x47,0x98,0x40,0x8a,0x00,0x6f,0xe2,0x4a,0xed,0xe7,0xe2,
+0x00,0x05,0xd8,0x40,0x11,0x03,0x6f,0xe4,0x45,0x47,0x1f,0xe2,0x0a,0x00,0x6f,0xe2,
+0x4a,0xdf,0x98,0xa0,0x8a,0x00,0xe0,0x44,0x00,0x05,0x20,0x20,0x6c,0xd1,0x6f,0xe2,
+0x4a,0xee,0x20,0x3a,0x04,0xd7,0xd8,0x40,0x00,0x00,0x20,0x20,0x04,0xd8,0x6f,0xe2,
+0x4a,0xce,0x24,0x3a,0x57,0x09,0x20,0x40,0x57,0x09,0x70,0x49,0xcb,0x01,0x70,0x49,
+0xcc,0x00,0x58,0x00,0x00,0x00,0x67,0xf0,0x49,0xc1,0x58,0x00,0x00,0x1b,0x67,0xe4,
+0x49,0xc9,0x20,0x60,0x00,0x00,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,0xe2,0x72,0x00,0x20,0x3a,
+0x58,0x8b,0x20,0x20,0x58,0x87,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,0x20,0x40,0x57,0xaf,0x20,0x40,
+0x05,0x04,0x20,0x20,0x58,0xa7,0x20,0x36,0x82,0x66,0xc5,0x16,0x02,0x66,0x20,0x20,
+0x57,0xbe,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x58,0xb3,0x6f,0xe2,0x49,0xcb,0x08,0x00,
+0x86,0x08,0xef,0xe2,0x00,0x06,0x1f,0xe2,0x72,0x00,0x08,0x00,0x86,0x08,0x20,0x22,
+0xd8,0xbc,0x20,0x20,0x58,0xb9,0x6f,0xe2,0x4a,0xe6,0x24,0x7a,0x00,0x00,0x6f,0xe2,
+0x4a,0xce,0x24,0x3a,0x58,0xc4,0x6f,0xe2,0x44,0x56,0xc0,0x00,0xd8,0xd3,0x6f,0xe2,
+0x44,0x57,0x1f,0xf2,0x7e,0x00,0x1f,0xeb,0xfe,0x00,0x67,0xe2,0x49,0xcb,0x68,0x42,
+0x43,0x41,0x18,0x40,0xfe,0x06,0x67,0xe2,0x49,0xcc,0x6f,0xec,0x44,0x72,0x67,0xec,
+0x49,0xcd,0x18,0x42,0x72,0x00,0xd8,0xc0,0x43,0x42,0x20,0x40,0x7c,0xcf,0x20,0x20,
+0x58,0xde,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x58,0xf7,0xd8,0x40,0x00,0x04,0x6f,0xe2,
+0x44,0x57,0x7d,0x3a,0x04,0x06,0x60,0x42,0x49,0xcb,0x68,0x42,0x43,0x61,0x18,0x40,
+0xfe,0x06,0x67,0xe2,0x49,0xcc,0x6f,0xec,0x44,0x72,0x67,0xec,0x49,0xcd,0xd8,0xc0,
+0x43,0x62,0x18,0x42,0x72,0x00,0x20,0x40,0x7c,0xcf,0x20,0x40,0x58,0xa1,0x20,0x20,
+0x5a,0xe2,0x6f,0xe2,0x04,0x3b,0xc3,0x80,0x00,0x00,0x20,0x20,0x5b,0x09,0x20,0x40,
+0x5a,0xc9,0xc6,0x16,0x00,0x00,0x20,0x40,0x59,0x9a,0x6f,0xe2,0x02,0xd5,0x2f,0xef,
+0xfe,0x04,0x79,0x20,0x80,0x2a,0x1f,0xe3,0x7e,0x00,0x98,0x42,0xfe,0x00,0x2f,0xef,
+0xfe,0x02,0x79,0x20,0x80,0x0f,0xc6,0x07,0x80,0x00,0x6f,0xe2,0x02,0xd6,0x20,0x3a,
+0x05,0x49,0x6f,0xe2,0x04,0x3b,0xc3,0x02,0x05,0x49,0x20,0x40,0x73,0x42,0x20,0x40,
+0x72,0xb2,0x7d,0x3a,0x00,0x0f,0x24,0x7a,0x00,0x00,0x68,0x42,0x04,0x52,0x79,0x40,
+0x04,0x02,0x60,0x42,0x04,0x52,0x6f,0xe2,0x4a,0xce,0x24,0x7a,0x00,0x00,0x20,0x20,
+0x05,0x4f,0x6f,0xe2,0x02,0xd6,0x20,0x7a,0x00,0x00,0x6f,0xe2,0x02,0xd5,0x2f,0xe0,
+0x06,0x01,0x20,0x20,0x85,0x77,0x2f,0xe0,0x06,0x02,0x20,0x20,0x85,0x57,0x20,0x60,
+0x00,0x00,0x6f,0xe4,0x02,0xd9,0xc1,0x82,0x00,0x00,0xef,0xe6,0x00,0x06,0x67,0xe6,
+0x04,0x73,0x79,0x20,0x00,0x0f,0xc0,0x09,0x05,0x6b,0xc0,0x29,0x05,0x6d,0xc0,0x0b,
+0x05,0x64,0xc0,0x0c,0x5e,0x3b,0xc0,0x01,0x5c,0xa1,0xc0,0x0f,0x06,0xc9,0x79,0x3f,
+0x80,0x0f,0x20,0x60,0x00,0x00,0x58,0x00,0x0b,0x1e,0x67,0xe4,0x49,0xc5,0x20,0x40,
+0x05,0x70,0x1f,0x20,0xf3,0xfe,0xda,0x20,0x02,0xe0,0x20,0x40,0x5a,0xbe,0x20,0x20,
+0x05,0x90,0x20,0x40,0x05,0x6d,0x20,0x20,0x05,0x87,0x20,0x40,0x05,0x70,0xda,0x20,
+0x02,0xde,0x20,0x20,0x5a,0xbe,0x6f,0xe2,0x02,0xd6,0x1f,0xe0,0xf3,0xf9,0x1f,0xe0,
+0xff,0xfc,0x67,0xe4,0x49,0xc1,0xe8,0x44,0x00,0x06,0x60,0x44,0x49,0xc3,0x20,0x60,
+0x00,0x00,0x79,0x20,0x00,0x0f,0x20,0x40,0x05,0x7f,0x6f,0xe2,0x04,0x73,0xc0,0x09,
+0x05,0x87,0xc0,0x0b,0x05,0x86,0xc1,0x29,0x00,0x00,0x79,0x3f,0x80,0x0f,0x20,0x60,
+0x00,0x00,0x6f,0xe2,0x02,0xd6,0x68,0x44,0x49,0xc1,0x98,0x40,0x84,0x00,0x60,0x44,
+0x49,0xc1,0x1f,0xe2,0x72,0x00,0xda,0x20,0x02,0xd7,0x20,0x20,0x5a,0xbe,0x20,0x20,
+0x05,0x90,0x20,0x40,0x05,0x8a,0x24,0x74,0x00,0x00,0x20,0x20,0x5e,0x13,0x20,0x40,
+0x7d,0xc1,0x6f,0xe4,0x49,0xc3,0x68,0x44,0x49,0xc1,0x98,0x46,0x7c,0x00,0x24,0x62,
+0x80,0x00,0x20,0x20,0x7d,0xbf,0x6f,0xe4,0x49,0xc5,0x1f,0xe2,0x0a,0x00,0x6f,0xe2,
+0x02,0xd6,0x1f,0xe2,0x72,0x00,0x20,0x40,0x7c,0xdc,0x18,0xa2,0x7e,0x00,0x67,0xe4,
+0x49,0xc5,0x20,0x40,0x05,0x8a,0x24,0x74,0x00,0x00,0xd8,0xe0,0x00,0x03,0x20,0x40,
+0x50,0xe6,0x20,0x20,0x05,0x9c,0x20,0x40,0x5c,0x74,0x24,0x7a,0x00,0x00,0x70,0x0b,
+0x22,0x17,0x58,0x00,0x0b,0x1e,0x67,0xe4,0x49,0xc7,0x68,0x44,0x0b,0x1e,0x18,0x40,
+0x84,0x04,0x58,0x00,0x00,0xf9,0x20,0x40,0x7d,0xb5,0x1f,0xe0,0xa5,0xfc,0x18,0x00,
+0x02,0x02,0x1f,0xe2,0x22,0x00,0x20,0x40,0x5c,0x32,0x6f,0xe4,0x49,0xc7,0x1f,0xe2,
+0x0c,0x00,0x1a,0x22,0x72,0x00,0x20,0x40,0x7c,0xcf,0x18,0xc2,0x7e,0x00,0x67,0xe4,
+0x49,0xc7,0x6f,0xe4,0x0b,0x1e,0x9a,0x46,0x7e,0x00,0x67,0xe4,0x0b,0x1e,0x20,0x3a,
+0x05,0xb8,0xd8,0x40,0x00,0xf9,0x20,0x40,0x7d,0xb5,0x1f,0xe2,0x24,0x00,0x18,0x00,
+0x02,0x01,0x20,0x20,0x05,0xa7,0x58,0x00,0x00,0x00,0x67,0xe4,0x49,0xc5,0xd8,0xe0,
+0x00,0x03,0x20,0x20,0x50,0xe2,0x70,0x4a,0xd3,0x00,0x68,0x44,0x4f,0xf0,0x6f,0xe4,
+0x4f,0xf2,0x98,0x46,0x22,0x00,0x68,0x44,0x4f,0xf4,0x6f,0xe4,0x4f,0xf6,0x60,0x44,
+0x4a,0xd6,0x67,0xe4,0x4a,0xd4,0x98,0x46,0x7e,0x00,0x20,0x21,0x05,0xcc,0x20,0x22,
+0x85,0xcc,0x1a,0x22,0x04,0x00,0x6f,0xe4,0x4a,0xd4,0x98,0x40,0xfe,0x00,0x68,0x44,
+0x4a,0xd6,0x98,0x46,0x7e,0x00,0xd8,0x40,0x03,0x00,0x98,0x46,0x7c,0x00,0x24,0x61,
+0x00,0x00,0x70,0x4a,0xd3,0x01,0x20,0x60,0x00,0x00,0x68,0x42,0x04,0x52,0x28,0x4c,
+0x00,0x05,0x20,0x60,0x80,0x00,0x6f,0xe2,0x02,0xd5,0x1f,0xe3,0xfe,0x00,0x98,0x42,
+0xfe,0x00,0xc4,0x01,0x80,0x00,0x79,0x3f,0x84,0x05,0x79,0x40,0x04,0x03,0x60,0x42,
+0x04,0x52,0x28,0x40,0x06,0x03,0x24,0x60,0x80,0x00,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
+0x05,0xe1,0x6f,0xe2,0x49,0xcd,0x20,0x20,0x05,0xe2,0x6f,0xe2,0x43,0xb0,0xc0,0x02,
+0xd9,0xac,0x6f,0xe2,0x44,0x97,0xc0,0x01,0x59,0xb0,0x20,0x60,0x00,0x00,0x6f,0xe2,
+0x04,0x52,0xc3,0x82,0x80,0x00,0x20,0x40,0x5a,0x1c,0x6f,0xe2,0x4a,0xce,0x24,0x3a,
+0x59,0xfc,0x20,0x40,0x5c,0x53,0x20,0x3a,0x5a,0x3e,0xef,0xe2,0x00,0x06,0xe8,0x42,
+0x00,0x06,0x18,0x42,0x22,0x00,0x9a,0x26,0x7e,0x00,0x20,0x40,0x06,0x0b,0x20,0x40,
+0x7d,0xb5,0x1f,0xe2,0x04,0x00,0xef,0xe2,0x00,0x06,0x1f,0xe2,0x02,0x00,0x1a,0x22,
+0x7e,0x00,0x98,0xc0,0x8c,0x00,0xd8,0xa0,0x49,0xcd,0x18,0x42,0x72,0x00,0x20,0x40,
+0x7c,0xcf,0x20,0x40,0x5a,0x2e,0x20,0x40,0x5a,0x40,0x20,0x40,0x5c,0x53,0xef,0xe2,
+0x00,0x06,0x1f,0xe2,0x22,0x00,0x18,0xc2,0x26,0x00,0xe8,0x42,0x00,0x06,0x18,0x42,
+0x24,0x00,0x9a,0x46,0x7e,0x00,0x20,0x40,0x06,0x0b,0x20,0x40,0x7d,0xb5,0x9a,0x40,
+0xfe,0x00,0xe7,0xe2,0x00,0x13,0x9a,0x26,0x7c,0x00,0x24,0x62,0x80,0x00,0x20,0x20,
+0x5c,0x76,0x18,0xc2,0x0a,0x00,0x68,0x44,0x49,0xc9,0x18,0xa2,0x0c,0x00,0x20,0x60,
+0x00,0x00,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x5a,0x41,0x60,0x42,0x49,0xcc,0x68,0x42,
+0x04,0x52,0x79,0x20,0x04,0x05,0x18,0x41,0x7e,0xfc,0x98,0x21,0xfe,0x00,0x67,0xe2,
+0x04,0x52,0x1f,0xe1,0x7e,0x1f,0x28,0x0f,0xfe,0x29,0x79,0x20,0xfe,0x04,0x67,0xe2,
+0x49,0xcb,0x6f,0xe2,0x49,0xcb,0x28,0x20,0x06,0x01,0x24,0x20,0x86,0x20,0x6f,0xe2,
+0x49,0xcc,0x20,0x7a,0x00,0x00,0x6f,0xe2,0x04,0x3b,0xc4,0x02,0x00,0x00,0x20,0x40,
+0x73,0x42,0x20,0x20,0x72,0x99,0x6f,0xe2,0x4a,0xce,0x24,0x3a,0x72,0x9a,0xda,0x60,
+0x49,0xcb,0x68,0x4a,0x43,0xd5,0x20,0x40,0x72,0x77,0x18,0x00,0x70,0x08,0x98,0x00,
+0x5e,0x00,0x18,0x00,0x22,0x00,0x20,0x40,0x72,0x63,0x20,0x40,0x72,0xe8,0xda,0x60,
+0x49,0xcd,0x6f,0xe2,0x49,0xcc,0x1f,0xe0,0xa5,0xff,0x9a,0x60,0x8a,0x00,0x18,0x00,
+0x70,0x0c,0x1d,0xe2,0x7e,0x00,0xe7,0xe8,0x00,0x05,0x20,0x40,0x72,0x8e,0x6f,0xe2,
+0x49,0xcc,0x1f,0xe0,0xfe,0x04,0x67,0xe2,0x49,0xcc,0x20,0x20,0x72,0xae,0xc6,0x07,
+0x80,0x00,0xc6,0x16,0x00,0x00,0x20,0x40,0x5c,0x70,0x24,0x7a,0x00,0x00,0x6f,0xe2,
+0x02,0xd5,0x1f,0xe1,0x7e,0x03,0x67,0xe2,0x44,0xde,0xef,0xe2,0x00,0x06,0x67,0xe2,
+0x44,0xdd,0x20,0x7a,0x00,0x00,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x44,0xdf,0x6f,0xe2,
+0x44,0xde,0xc0,0x01,0x86,0x7e,0x20,0x40,0x06,0x50,0xd8,0xe0,0x00,0x03,0x24,0x34,
+0x4b,0xec,0x20,0x40,0x4b,0xf0,0x70,0x4a,0xe1,0x01,0x1c,0x42,0x7e,0x00,0x67,0xe8,
+0x4a,0xe2,0x20,0x20,0x5a,0x6b,0x6f,0xe2,0x44,0xde,0xc0,0x01,0x06,0x54,0xc0,0x00,
+0x86,0x68,0x20,0x60,0x00,0x00,0x6f,0xe4,0x44,0xdf,0x1f,0xe2,0x0c,0x00,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x44,0xce,0xef,0xe4,0x00,0x06,0x20,0x40,0x5a,0x7a,0x24,0x74,
+0x00,0x00,0x68,0x42,0x44,0xdd,0x60,0x42,0x44,0xd0,0x6f,0xe4,0x44,0xce,0x1f,0xe0,
+0xfe,0x04,0x98,0x46,0x7c,0x00,0x20,0x22,0xfd,0xbf,0x6f,0xe2,0x44,0xdd,0x1f,0xe2,
+0x72,0x00,0xd8,0xa0,0x0c,0x29,0x6f,0xe4,0x44,0xdf,0x1f,0xe2,0x0c,0x00,0x20,0x40,
+0x7c,0xdc,0x20,0x20,0x7d,0xc1,0x20,0x40,0x5a,0x99,0x24,0x74,0x00,0x00,0x6f,0xe2,
+0x44,0xd0,0xd8,0xa0,0x0c,0x29,0x98,0xa0,0xa2,0x00,0x68,0x42,0x44,0xdd,0x98,0x40,
+0xfe,0x00,0x67,0xe2,0x44,0xd0,0x6f,0xe2,0x44,0xdd,0x1f,0xe2,0x72,0x00,0x1a,0x22,
+0x0a,0x00,0x6f,0xe4,0x44,0xdf,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x7c,0xcf,0x58,0x00,
+0x0c,0x29,0x67,0xe4,0x44,0xdf,0x6f,0xe4,0x44,0xce,0x1f,0xe0,0xfe,0x04,0x68,0x42,
+0x44,0xd0,0x98,0x46,0x7c,0x00,0x20,0x22,0xfd,0xbf,0x20,0x20,0x7d,0xc1,0x6f,0xe2,
+0x02,0xd7,0xc0,0x04,0x06,0x82,0xc0,0x0a,0x06,0x8e,0x20,0x20,0x60,0x45,0xda,0x20,
+0x00,0x09,0xda,0x40,0x00,0x09,0x20,0x40,0x5c,0x22,0x58,0x00,0x00,0x21,0xe7,0xf0,
+0x00,0x05,0x6f,0xe2,0x02,0xd8,0x1f,0xe1,0x7e,0x20,0x20,0x3a,0x06,0x8c,0x70,0x4a,
+0xce,0x00,0x20,0x60,0x00,0x00,0x70,0x4a,0xce,0x01,0x20,0x60,0x00,0x00,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x49,0xc9,0x20,0x20,0x06,0x91,0xda,0x20,0x00,0x09,0xda,0x40,
+0x00,0x15,0x20,0x40,0x5c,0x22,0x58,0x00,0x00,0xfb,0xe7,0xe4,0x00,0x05,0x58,0x00,
+0x08,0x48,0xe7,0xe4,0x00,0x05,0x58,0x00,0x00,0xfb,0xe7,0xe4,0x00,0x05,0x58,0x00,
+0x08,0x48,0xe7,0xe4,0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe2,0x4a,0xce,0x20,0x3a,
+0x06,0xa1,0xd8,0xc0,0x43,0xae,0x20,0x20,0x06,0xa2,0xd8,0xc0,0x49,0xcb,0xd8,0xa0,
+0x0a,0xce,0x20,0x20,0x06,0xb3,0x6f,0xe2,0x43,0x40,0x20,0x7a,0x00,0x00,0x6f,0xe2,
+0x4a,0xe6,0x24,0x7a,0x00,0x00,0xd8,0xe0,0x00,0x00,0x20,0x40,0x7c,0xf1,0x24,0x7a,
+0x00,0x00,0x20,0x40,0x06,0x9d,0x20,0x40,0x5a,0xd5,0x6f,0xe2,0x4a,0xce,0x20,0x3a,
+0x06,0xb1,0xd8,0xa0,0x43,0xae,0x20,0x20,0x06,0xb2,0xd8,0xa0,0x49,0xcb,0xd8,0xc0,
+0x0a,0xce,0xdf,0x20,0x00,0x27,0x20,0x20,0x7c,0xcf,0x18,0x0a,0x7e,0x00,0xd8,0x40,
+0x00,0x1f,0x98,0x41,0x7e,0x00,0x1f,0xe0,0xfe,0x03,0x20,0x40,0x5a,0xef,0x6f,0xe2,
+0x0a,0xbe,0x68,0x42,0x44,0x5f,0x98,0x46,0x7c,0x00,0x24,0x22,0xda,0xd5,0x20,0x20,
+0x5a,0xec,0xef,0xe4,0x00,0x06,0xc0,0x02,0x06,0xc4,0xc0,0x03,0x5e,0xd4,0xc0,0x02,
+0xde,0x96,0x20,0x60,0x00,0x00,0xef,0xe6,0x00,0x06,0x67,0xe6,0x04,0x73,0xc0,0x08,
+0x06,0xcb,0xc0,0x04,0x06,0xd4,0x20,0x20,0x5c,0x8d,0xd8,0xe0,0x00,0x07,0x20,0x20,
+0x50,0xe2,0x20,0x40,0x5e,0x91,0x20,0x40,0x5a,0xb3,0xd9,0x60,0x00,0x01,0x20,0x20,
+0x5d,0xde,0xd8,0xe0,0x00,0x07,0x20,0x20,0x50,0xe6,0x20,0x40,0x5c,0xa9,0x67,0xe4,
+0x44,0x78,0x20,0x20,0x5c,0xa2,0x20,0x40,0x5e,0x91,0x20,0x40,0x5a,0xbb,0x20,0x20,
+0x06,0xd7,0x68,0x44,0x44,0x2c,0x60,0x44,0x0a,0x9e,0x20,0x40,0x5b,0x36,0x20,0x40,
+0x5b,0x4d,0x18,0xc0,0x8d,0xfe,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x04,0x98,0x68,0x44,
+0x44,0x44,0x58,0x00,0x2a,0x00,0x98,0x46,0x7c,0x00,0x20,0x22,0x86,0xe3,0x20,0x20,
+0x5d,0x2d,0xd8,0x40,0x2a,0x00,0x20,0x40,0x5b,0x5c,0x20,0x3a,0x5e,0x56,0x20,0x20,
+0x5d,0x8b,0x20,0x60,0x00,0x00,0x20,0x20,0x68,0x46,0x6f,0xe2,0x00,0x7d,0xc0,0x08,
+0x06,0xfa,0xc0,0x0b,0x87,0x00,0xc0,0x1e,0x86,0xf7,0xc0,0x04,0x06,0xf3,0xc0,0x03,
+0x86,0xf0,0x20,0x20,0x60,0xfe,0x20,0x40,0x62,0x17,0x70,0x00,0x72,0x05,0x20,0x60,
+0x00,0x00,0x20,0x40,0x63,0xdb,0x70,0x04,0xd0,0x01,0x20,0x40,0x62,0x2f,0x20,0x20,
+0x7c,0x12,0x20,0x40,0x62,0xf2,0x70,0x09,0xb3,0x00,0x20,0x60,0x00,0x00,0x68,0x42,
+0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,0x06,0xfe,0x20,0x20,0x62,0x06,0x70,0x00,
+0x7e,0x24,0x20,0x20,0x61,0x34,0x20,0x20,0x62,0xd2,0x78,0x54,0x7c,0x00,0x20,0x40,
+0x66,0xa3,0x6f,0xe2,0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,0x87,0x07,0x20,0x20,
+0x63,0xf2,0xc0,0x42,0x07,0x0a,0xc0,0x41,0x87,0x0d,0x20,0x20,0x64,0x21,0x20,0x40,
+0x07,0x10,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,0x07,0x10,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,0x44,0x90,0x20,0x3a,
+0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x20,0x20,0x02,0xa3,0xda,0x20,
+0x46,0x42,0x20,0x40,0x7d,0x9c,0x20,0x7a,0x00,0x00,0xc0,0x00,0xfb,0xff,0xc0,0x01,
+0x7c,0x04,0xc0,0x06,0xfc,0x16,0xc0,0x07,0x7c,0x1c,0x20,0x60,0x00,0x00,0x6f,0xe2,
+0x46,0x51,0xc0,0x00,0x07,0x29,0x20,0x20,0x6a,0x0d,0x6f,0xe4,0x02,0x60,0x1f,0xe2,
+0x0c,0x00,0x20,0x40,0x69,0x79,0x6f,0xe2,0x04,0xf8,0xc0,0x00,0x07,0x2f,0x20,0x20,
+0x07,0x35,0x6f,0xe2,0x04,0xf9,0xc0,0x1f,0xe9,0x3e,0xc0,0x39,0xe9,0x47,0xc0,0x77,
+0x87,0x3c,0xc0,0x29,0xea,0x07,0x20,0x60,0x00,0x00,0x6f,0xe2,0x04,0xf9,0xc0,0x39,
+0xe9,0xe2,0xc0,0x1f,0xe9,0xe6,0xc0,0x77,0x87,0xb1,0xc0,0x7f,0x87,0xb3,0xc0,0x29,
+0x87,0xc5,0x20,0x60,0x00,0x00,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x20,0x40,
+0x69,0x84,0x6f,0xe2,0x04,0xff,0xc0,0x20,0x87,0x46,0xc0,0x20,0x69,0x6e,0xc0,0x38,
+0x87,0x49,0xc0,0x38,0x07,0x5c,0xc0,0x24,0xe9,0xbe,0x20,0x20,0x6a,0x58,0x20,0x40,
+0x69,0x70,0x20,0x40,0x07,0x89,0x20,0x20,0x69,0x68,0x20,0x40,0x69,0x72,0x20,0x20,
+0x69,0xa9,0x6f,0xe2,0x45,0x3c,0x1f,0xe2,0x04,0x00,0x79,0x20,0x04,0x07,0x20,0x40,
+0x07,0x57,0xe0,0x42,0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe2,0x04,0xf8,0x20,0x7a,
+0x00,0x00,0xd8,0x40,0x00,0x00,0x20,0x40,0x07,0x57,0xe0,0x42,0x00,0x05,0x20,0x60,
+0x00,0x00,0xd8,0xa0,0x4a,0xef,0x1f,0xe0,0xff,0xff,0x1f,0xef,0xfe,0x05,0x98,0xa0,
+0x8a,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x07,0x4b,0x20,0x40,0x07,0x8e,0x6f,0xe2,
+0x4a,0xee,0x1f,0xe0,0xfe,0x01,0x67,0xe2,0x4a,0xee,0x20,0x40,0x07,0x66,0x70,0x0a,
+0x95,0x08,0x20,0x40,0x7b,0xab,0x20,0x40,0x69,0x72,0x20,0x20,0x69,0xba,0x68,0x42,
+0x4a,0xec,0x6f,0xe2,0x45,0x3c,0x1f,0xe0,0x8f,0xff,0xf9,0x20,0x04,0x00,0x60,0x42,
+0x4a,0xec,0xd8,0xe0,0x00,0x00,0xa8,0x4f,0xff,0xff,0x20,0x20,0x87,0x71,0x18,0xe0,
+0xfe,0x01,0x67,0xe2,0x4a,0xed,0x20,0x60,0x00,0x00,0x18,0xe0,0x8e,0x01,0x18,0xe6,
+0x7c,0x03,0x20,0x21,0x07,0x6c,0x20,0x60,0x00,0x00,0x18,0xe0,0x8f,0xff,0x6f,0xe2,
+0x4a,0xec,0xaf,0xef,0xff,0xff,0x20,0x60,0x00,0x00,0xd8,0xe0,0x00,0x00,0x6f,0xe2,
+0x4a,0xec,0x20,0x3a,0x7d,0xbb,0xaf,0xef,0xff,0xff,0x24,0x20,0x87,0x85,0x18,0xef,
+0xfe,0x05,0xda,0x20,0x4a,0xef,0x9a,0x20,0xa2,0x00,0x1a,0x20,0x8c,0x02,0xef,0xe2,
+0x00,0x06,0x20,0x3a,0x07,0x85,0x20,0x20,0x7d,0xbd,0x18,0xe0,0x8e,0x01,0x18,0xe6,
+0x7c,0x03,0x24,0x21,0x7d,0xbb,0x20,0x20,0x07,0x7a,0x6f,0xe2,0x45,0x2f,0x1f,0xe3,
+0x7e,0x00,0x20,0x20,0x07,0x8f,0x6f,0xe2,0x04,0xf8,0x20,0x20,0x07,0x8f,0x6f,0xe2,
+0x45,0x3c,0x1f,0xe0,0xff,0xff,0x1f,0xef,0xfe,0x05,0xd8,0xa0,0x4a,0xef,0x98,0xa0,
+0x8a,0x00,0x18,0xa0,0x8a,0x01,0x6f,0xe2,0x45,0x3a,0xe7,0xe2,0x00,0x05,0x6f,0xe2,
+0x45,0x3b,0xe7,0xe2,0x00,0x05,0x6f,0xe2,0x45,0x37,0xe7,0xe2,0x00,0x05,0x6f,0xe2,
+0x45,0x38,0xe7,0xe2,0x00,0x05,0x20,0x60,0x00,0x00,0x6f,0xe2,0x45,0x2f,0x1f,0xe3,
+0x7e,0x00,0x20,0x20,0x07,0xa3,0x6f,0xe2,0x04,0xf8,0x20,0x20,0x07,0xa3,0x6f,0xe2,
+0x45,0x3c,0x1f,0xe0,0xff,0xff,0x1f,0xef,0xfe,0x05,0xd8,0xc0,0x4a,0xef,0x98,0xc0,
+0x8c,0x00,0x18,0xc0,0x8c,0x01,0xef,0xe2,0x00,0x06,0x67,0xe2,0x45,0x3a,0xef,0xe2,
+0x00,0x06,0x67,0xe2,0x45,0x3b,0xef,0xe2,0x00,0x06,0x67,0xe2,0x45,0x37,0xef,0xe2,
+0x00,0x06,0x67,0xe2,0x45,0x38,0x20,0x60,0x00,0x00,0x20,0x40,0x07,0xa0,0x20,0x20,
+0x07,0xbc,0x20,0x40,0x07,0xa0,0x6f,0xe4,0x04,0xfd,0x1f,0xe2,0x0c,0x00,0x1f,0xe0,
+0xfe,0x01,0x67,0xe4,0x04,0xfd,0xef,0xe2,0x00,0x06,0x68,0x42,0x45,0x3a,0x98,0x40,
+0xfe,0x00,0x67,0xe2,0x45,0x3a,0x6f,0xe2,0x04,0xf7,0x1f,0xeb,0x7e,0x00,0x67,0xe2,
+0x45,0x2f,0x20,0x40,0x6b,0x01,0x20,0x40,0x69,0x33,0x20,0x40,0x6a,0xe9,0x20,0x40,
+0x07,0x8c,0x20,0x40,0x6b,0x0a,0x20,0x20,0x6a,0x58,0x20,0x40,0x07,0x51,0x68,0xe2,
+0x04,0xf8,0x60,0xe2,0x4a,0xed,0x18,0xe0,0x8f,0xff,0x6f,0xe2,0x4a,0xec,0xf9,0x3f,
+0xfe,0x00,0x67,0xe2,0x4a,0xec,0x6f,0xe2,0x4a,0xee,0x1f,0xe0,0xff,0xff,0x67,0xe2,
+0x4a,0xee,0x70,0x0a,0x95,0x09,0x20,0x40,0x7b,0xab,0x20,0x20,0x6a,0x07,0x5a,0x8e,
+0xaa,0x55,0x40,0x00,0x00,0x40,0x32,0x00,0x00,0x00,0x00,0x5c,0x10,0x50,0x20,0x01,
+0x01,0xf0,0x01,0x40,0x03,0x00,0x20,0x02,0x10,0x00,0xcc,0x18,0x30,0x19,0x01,0x00,
+0x00,0xe8,0x08,0x08,0x62,0x00,0xe8,0x09,0x18,0xd0,0x2c,0x01,0x04,0x44,0x02,0x20,
+0x06,0x00,0x44,0x00,0x00,0x02,0x00,0x20,0x00,0x82,0x02,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x92,0x40,0x0a,0xaa,0x55,0x01,
+0x00,0x54,0x46,0x40,0xaa,0x55,0x01,0x00,0x06,0x42,0x13,0xaa,0x55,0x01,0x00,0x5b,
+0x41,0x01,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xfb,0x8f,0xfa,0x8b,0x85,0x59,0x83,
+0xaa,0x55,0x01,0x00,0xde,0x4a,0x01,0xaa,0x55,0x03,0x00,0x14,0x42,0xd1,0x48,0x07,
+0xaa,0x55,0x03,0x00,0x3e,0x45,0x7f,0x00,0x03,0xaa,0x55,0x01,0x00,0x3d,0x45,0x01,
+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,0x2d,0x0d,0x85,0x0f,0x2d,0x0d,
+0x2d,0x0d,0xaa,0x55,0x03,0x00,0xd0,0x4a,0x00,0x80,0x02,0xaa,0x55,0x02,0x00,0x68,
+0x46,0x10,0x0b,0xaa,0x55,0x01,0x00,0x6c,0x46,0x07,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,0xbf,0x49,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,0x00,0xaa,0x55,0x06,
+0x00,0xa0,0x40,0xa7,0xac,0x2a,0x21,0x10,0x55,0xaa,0x55,0x07,0x00,0xe7,0x44,0x06,
+0x59,0x69,0x63,0x68,0x69,0x70,0xaa,0x55,0x03,0x00,0xe4,0x41,0x20,0x00,0x02,0xaa,
+0x55,0x01,0x00,0xe8,0x41,0x01,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,0x20,0x03,0xaa,0x55,0x01,0x00,0x6e,0x46,0x01,0xaa,0x55,0x06,0x00,0x72,
+0x44,0x21,0xac,0x01,0x33,0x02,0x3a,0xaa,0x55,0x0b,0x00,0x81,0x43,0x0a,0x59,0x69,
+0x63,0x68,0x69,0x70,0x2d,0x6c,0x65,0x20,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,
+0x01,0x02,0xaa,0x55,0x12,0x00,0x61,0x43,0x0e,0x02,0x01,0x02,0x0d,0x09,0x33,0x31,
+0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,0x6c,0x65,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,0xf0,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,0xdf,
+0x4a,0x60,0x96,0xaa,0x55,0x02,0x00,0x47,0x45,0x83,0x46,0xaa,0x55,0xb6,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,0xaa,0x55,0x02,0x00,0x8e,0x44,0x41,0x47,0xaa,
+0x55,0x4e,0x01,0x41,0x47,0x01,0x00,0x02,0x00,0x28,0x02,0x01,0x18,0x02,0x00,0x02,
+0x03,0x28,0x01,0x20,0x03,0x00,0x02,0x05,0x2a,0x01,0x00,0x04,0x00,0x02,0x02,0x29,
+0x02,0x01,0x00,0x05,0x00,0x02,0x00,0x28,0x02,0x00,0x18,0x06,0x00,0x02,0x03,0x28,
+0x01,0x4e,0x07,0x00,0x02,0x00,0x2a,0x13,0x59,0x69,0x63,0x68,0x69,0x70,0x2d,0x6c,
+0x65,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x08,0x00,0x02,0x03,0x28,
+0x01,0x4e,0x09,0x00,0x02,0x01,0x2a,0x02,0x00,0x00,0x0a,0x00,0x02,0x03,0x28,0x01,
+0x02,0x0b,0x00,0x02,0x04,0x2a,0x08,0x10,0x00,0x20,0x00,0x05,0x00,0x2c,0x01,0x0c,
+0x00,0x02,0x00,0x28,0x10,0x55,0xe4,0x05,0xd2,0xaf,0x9f,0xa9,0x8f,0xe5,0x4a,0x7d,
+0xfe,0x43,0x53,0x53,0x49,0x0d,0x00,0x02,0x03,0x28,0x01,0x12,0x0e,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,0x12,0x00,0x02,0x03,0x28,0x01,0x04,0x13,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,0x14,0x00,0x02,0x03,0x28,0x01,0x1a,0x15,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,
-0x16,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x00,0x00,0xaa,0x55,0x07,0x00,0x76,0x41,
-0x0f,0x84,0xf0,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,0x03,0x00,0x10,0x00,0x03,
-0x00,0x30,0x00,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,0x10,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,0x40,0x40,0x4b,0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,0x58,0x6c,
-0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,0x40,0x40,0xf6,0x2d
+0x00,0x00,0x00,0x00,0x0f,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x10,0x00,0x02,0x03,
+0x28,0x01,0x08,0x11,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,0x12,0x00,0x02,0x03,0x28,
+0x01,0x04,0x13,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,0x14,0x00,0x02,0x03,0x28,0x01,
+0x1a,0x15,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,0x16,0x00,0x02,0x02,0x29,0x02,0x00,
+0x00,0x00,0x00,0xaa,0x55,0x07,0x00,0x76,0x41,0x0f,0x84,0xf0,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,0x03,0x00,0x10,0x00,0x03,0x00,0x30,0x00,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,0x10,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,0x40,0x40,0x4b,
+0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,
+0x02,0x00,0xc3,0x40,0x40,0x40,0xf7,0xf9
 };
Index: BlueTooth/BT_code_patch/print/branches/mult_connect/patch/patch.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/patch/patch.prog	(revision 859)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/patch/patch.prog	(working copy)
@@ -173,7 +173,7 @@
 	iforce contw
 	force context_size,loopcnt
 	arg mem_le_state,contr
-	branch memcpy_fast,le
+	branch p_context_save_le,le
 	arg mem_state,contr
 	call memcpy_fast
 	
@@ -1928,14 +1928,30 @@
 
 p_sdp_process:
 	fetch 1,mem_multi_piconet_flag
-	branch sdp_process+1,blank
+	branch p_sdp_process_1_piconet,blank
 	fetch 1,mem_sdp_channel_offset
 	fetcht 2,mem_ui_uuid_table
 	iadd temp,contw
 	fetch 1,mem_rfcomm_next_channal 
 //	increase 1,pdata
 	istore 1,contw
+p_sdp_process_1_piconet_not_conn:
+	arg 0x1103,temp
+p_sdp_process_1_piconet_common:	
+	fetch 2,mem_ui_uuid_table
+	copy pdata,contw
+	fetch 1,mem_sdp_offset2
+	iadd contw,contw 
+	istoret 2,contw
 	branch sdp_process+1
+
+p_sdp_process_1_piconet:
+	fetch 1,mem_rfcomm_channel_cnt
+	branch p_sdp_process_1_piconet_not_conn,blank
+p_sdp_process_1_piconet_conn:
+	arg 0,temp
+	branch  p_sdp_process_1_piconet_common
+		
 	
 p_le_init_conn:
 	fetch 1,mem_ble_dle_enable
Index: BlueTooth/BT_code_patch/print/branches/mult_connect/sched/DM_module.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/sched/DM_module.dat	(revision 859)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mult_connect/sched/DM_module.dat	(working copy)
@@ -130,7 +130,7 @@
 mem_all_uuid_128bits:
 00
 
-
+mem_sdp_offset2:60
 mem_sdp_channel_offset:96
 
 mem_ui_uuid_table:mem_module_uuid_list
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/app.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/app.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/app.format	(working copy)
@@ -0,0 +1,279 @@
+
+memalloc(
+
+/* load code */
+1 mem_ucode_status
+2 mem_otp_ucode_flag
+1 mem_spid_tbuf				/* spid buf: 03 addr[23:16] addr[15:8] addr[7:0] */
+0 mem_iicd_tbuf				/* iicd buf: iic_adr addr[15:8] addr[7:0] iic_adr */
+1 mem_addr_hi
+1 mem_addr_mi
+1 mem_addr_lo
+1 mem_iicd_addr
+4 mem_spid_rbuf
+2 mem_ucode_buf
+2 mem_ucode_len
+2 mem_sched_addr
+2 mem_ucode_ptr
+16 mem_ucode_keybuf
+18 mem_check_plap_temp
+
+
+1 mem_reconnect_flag
+1 mem_switch_fail_master_count
+1 mem_app_evt_timer_count
+
+)
+
+xmemalloc(
+1 mem_app_handshake_flag
+2 mem_sniff_param_interval
+2 mem_sniff_param_attempt
+2 mem_sniff_param_timeout
+
+/*App Callback Functons*/
+2 mem_cb_check_wakelock
+2 mem_cb_before_hibernate
+2 mem_cb_before_lpm
+2 mem_cb_le_process
+2 mem_cb_bt_process
+2 mem_cb_idle_process
+2 mem_cb_bb_event_process
+2 mem_cb_discovry_timeout
+2 mem_cb_att_write
+2 mem_cb_ble_transmit
+2 mem_cb_event_timer
+2 mem_cb_bt_set_mult
+
+
+
+
+2 mem_eeprom_base
+
+1 mem_unsniff2sniff_timer_count
+//lpm mode
+1 mem_wake_up_delay_timer
+
+1 mem_app_connection_options
+
+//
+2 mem_app_disconn_reason
+2 mem_app_disconn_reason_flag
+4 mem_lpm_delay_after_sniff
+1 mem_xrecord_mode
+
+1 mem_eeprom_block_size
+1 mem_spi_init_clk
+1 mem_spi_init_delay_time
+1 mem_spi_ncs_gpio
+
+2 mem_nv_data_ptr
+1 mem_nv_data_number
+
+
+ifdef SPI_SIMULATE
+//spi gpio config
+0 mem_spi_simulate_struct
+1 mem_spi_simulate_cs_gpio
+1 mem_spi_simulate_sclk_gpio
+1 mem_spi_simulate_mosi_gpio
+1 mem_spi_simulate_miso_gpio
+1 mem_spi_simulate_motion_gpio
+//spi slave read byte
+50 mem_spi_simulate_read_byte_slave
+1 mem_spi_simulate_read_byte_slave_temp
+1 mem_spi_simulate_read_length_slave
+1 mem_spi_simulate_read_length_slave_temp
+//spi slave write byte
+50 mem_spi_simulate_write_byte_slave
+1 mem_spi_simulate_write_byte_slave_temp
+1 mem_spi_simulate_write_byte_slave_temp_temp
+1 mem_spi_simulate_write_length_slave
+1 mem_spi_simulate_write_length_slave_temp
+endif
+
+)
+//adc read
+(
+0 ADC_CONFIG_VINLPM
+1 ADC_CONFIG_HVIN
+2 ADC_CONFIG_GPIO
+)
+
+
+(
+0 QUEUE_OFFSET_EACH_SIZE
+1 QUEUE_OFFSET_LENGTH
+2 QUEUE_OFFSET_CURR_NUM
+3 QUEUE_OFFSET_READ_PTR
+4 QUEUE_OFFSET_WRITE_PTR
+5 QUEUE_OFFSET_ELE_INIT_ADDR
+)
+(
+//Flash Register
+0x05 FLASH_READ_SATUS
+
+// Flash Status Register
+0x00 FLASH_STATUS_WIP
+0X01 FLASH_STATUS_WEL
+0X02 FLASH_STATUS_BP0
+0X03 FLASH_STATUS_BP1
+
+//Flash Write Sm
+0X00 FLASH_SM_NO_BUYS
+0X01 FLASH_SM_START
+0X02 FLASH_SM_ERASE_SECTOR
+0X03 FLASH_SM_WAIT_ERASE_SECTOR
+0X04 FLASH_SM_WRITE_DATA
+0X05 FLASH_SM_WAIT_WRITE_DATA
+
+
+//Flash Command
+0x02 FLASH_COMMAND_WRITE_DATA
+0x03 FLASH_COMMAND_READ_DATA
+0x20 FLASH_COMMAND_SECTOR_ERASE
+)
+
+0x0000 otp_ucode_flag
+0x07f0 otp_ucode_aeskey
+
+/* adc data addr and flag */
+(
+0x07e0 OTP_CHIP_FUNCTIONS
+0x07e2 otp_adc_io_0_5V_addr
+0x07e4 otp_adc_hvin_1V_addr
+0x07e6 otp_adc_vinlpm_2V_addr
+0x07e8 otp_adc_io_1V_addr
+0x07ea otp_adc_hvin_5V_addr
+0x07ec otp_adc_vinlpm_3V_addr
+0x07ee otp_adc_flag_addr
+0xaa55 OTP_ADC_FLAG
+)
+
+/* data stored in eeprom */
+(
+0	eeprom_nv_ram
+
+195	eeprom_module_init_flag//2
+
+)
+
+/*mem_app_handshake_flag*/
+(
+0 APP_HANDSHAKE_NULL
+1 APP_HANDSHAKE_DONE
+
+)
+/*mem_device_option*/
+(
+1 dvc_op_hci
+4 dvc_op_dongle
+5 dvc_op_spp
+6 dvc_op_ukey
+7 dvc_op_ir
+
+9 dvc_op_shutter
+10 dvc_op_module
+11 dvc_op_ble_mouse
+12 dvc_op_ble_kb
+13 dvc_op_ble_prcp
+14 dvc_op_car
+15 dvc_op_AntiLost
+16 dvc_op_remote_car
+255 dvc_op_test
+//device option hight 4
+6 dvc_op_mouse
+7 dvc_op_keyboard
+//device option low 2
+(
+0 MODE_3_MOUSE
+1 MODE_4_MOUSE
+)
+)
+
+(
+3 twspi_sclk
+4 twspi_sdio
+)
+
+(
+4 pan_clk_bit
+5 pan_dat_bit
+6 pan_mov_bit
+)
+
+(
+7 otp_uflag_aes
+6 otp_uflag_skip_eep
+5 otp_uflag_skip_flash
+4 otp_uflag_hci
+)
+
+/* ir command */
+(
+1 ircmd_record
+2 ircmd_play
+3 ircmd_write_pulse
+4 ircmd_write_seq
+5 ircmd_write_next
+
+8 ircmd_test_play
+9 ircmd_test_rec
+
+10 ircmd_report_pulse
+11 ircmd_report_seq
+12 ircmd_report_raw
+
+20 ircmd_screen_on
+21 ircmd_screen_off
+)
+
+(
+7 gpio_active_bit
+)
+(
+2 HID_HANDSHAKE_TIMEOUT
+
+)
+
+(
+1 APP_FLAG_RECONNECT
+)
+(
+5 LPM_WAKE_UP_DELAY_TIMER
+)
+
+
+//mem_app_disconn_reason
+//mem_app_disconn_reason_flag
+//bit map
+(
+2 APP_DISC_RSN_SIZE
+)
+(
+0 APP_DISC_BY_BUTTON
+1 APP_DISC_AFTER_PAIRING
+2 APP_DISC_AFTER_RECONN
+3 APP_DISC_AFTER_SNIFF
+4 APP_DISC_AFTER_SETUP_DONE
+5 APP_DISC_AFTER_HANDSHAKE
+6 APP_DISC_BT
+7 APP_DISC_BLE
+8 APP_DISC_L2CAP_REFUSED
+9 APP_DISC_SWITCH_FAIL
+)
+//eeprom init flag
+(
+	0xaa55 EEPROM_INIT_FLAG
+)
+
+(
+1 KEY_CONF_STRUCT_LEN
+0 KEY_PIN_OFFSET
+)
+
+(
+12000000 PWM_12MHZ
+)
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/app_module.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/app_module.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/app_module.format	(working copy)
@@ -0,0 +1,185 @@
+memalloc(
+)
+
+(
+0x4FEF 	IPC_HOLD_BT
+
+0x4FF0 IPC_BT2M0_START_ADDR
+0x4FF2 IPC_BT2M0_END_ADDR
+0x4FF4 IPC_BT2M0_READ_PTR
+0x4FF6 IPC_BT2M0_WRITE_PTR
+
+0x4FF8 IPC_M02BT_START_ADDR
+0x4FFA IPC_M02BT_END_ADDR
+0x4FFC IPC_M02BT_READ_PTR
+0x4FFE IPC_M02BT_WRITE_PTR
+)
+
+(//mem_module_flag
+//bit0~bit3 config module function
+0 MODULE_FLAG_UART_FLOW_CONTROL
+1 MODULE_FLAG_BLE_SEND_MTU23
+2 MODULE_FLAG_BLE_DATA_ENCRYPT
+
+//bit4~bit7 module states change
+4 MODULE_FLAG_BLE_DATA_FINISH
+5 MOUDLE_TASK_UNSNIFF
+6 MOUDLE_TASK_SNIFF
+
+)
+
+(
+34 NV_DATA_LEN
+-1 DECREASED_ONE
+)
+
+(
+0x1200 mem_l2cap_rxbuff2_new
+0x1400 mem_tx_buff0_new
+2 context_num_new
+)
+
+(
+	10 FLAG_MODULE_READ_VDD_COUNT
+)
+
+(
+	110  DM_REFCOM_BUFF_LEN
+	230 NL_RFCOMM_BUFF_LEN
+)
+
+
+(
+0x01 HCI_DISCARD_PACKET
+0x00 HCI_NOT_DISCARD_PACKET
+)
+
+
+
+(//Command
+0x00 HCI_CMD_SET_BT_ADDR_REQ
+0x01 HCI_CMD_SET_LE_ADDR_REQ
+0x02 HCI_CMD_SET_VISIBILITY_REQ
+0x03 HCI_CMD_SET_BT_NAME_REQ
+0x04 HCI_CMD_SET_LE_NAME_REQ
+0x05 HCI_CMD_SPP_DATA_REQ
+0x09 HCI_CMD_LE_DATA_REQ
+0x0b HCI_CMD_STATUS_IRQ
+0x0c HCI_CMD_SET_PAIRING_REQ
+0x0d HCI_CMD_SET_PINCODE_REQ
+0x0e HCI_CMD_SET_UARTCONTROL_REQ
+0x0f HCI_CMD_SET_UART_BAUD_REQ
+0x10 HCI_CMD_VERSION_REQ
+0x11 HCI_CMD_BT_DISCONNECT
+0x12 HCI_CMD_BLE_DISCONNECT
+0x13 HCI_CMD_DELETE_DEVICE
+0x14 HCI_CMD_CREATE_CONNECT
+0x26 HCI_CMD_SET_NVRAM_REQ
+0x27 HCI_CMD_SLEEP
+0x28 HCI_CMD_CONFIRM_GKEY
+0x29 HCI_CMD_SET_CREDIT_GIVEN
+0x2a HCI_CMD_AUTO_ADV_SCAN
+0x2b HCI_CMD_POWER_REQ
+0x2c HCI_CMD_POWER_SET
+0x30 HCI_CMD_PASSKEY_ENTRY
+0x31 HCI_CMD_SET_GPIO
+0x32 HCI_CMD_READ_GPIO
+0x33 HCI_CMD_LE_SET_PAIRING
+0x34 HCI_CMD_LE_SET_ADV_DATA
+0x35 HCI_CMD_LE_SET_SCAN_DATA
+0x36 HCI_CMD_LE_SEND_CONN_UPDATE_REQ
+0x37 HCI_CMD_LE_SET_ADV_PARM
+0x38 HCI_CMD_LE_START_PAIRING
+0x40 HCI_CMD_SET_WAKE_GPIO
+0x42 HCI_CMD_SET_TX_POWER
+0x43 HCI_CMD_BOOT_VERSION_REQ
+0x48 HCI_CMD_LE_CONFIRM_GKEY
+0x49 HCI_CMD_REJECT_JUSTWORK
+0x51 HCI_CMD_RESET_CHIP_REQ
+0x61 HCI_CMD_LE_SET_FIXED_PASSKEY
+
+0x70  HCI_CMD_SWITCH_WAKEUP
+
+0xee HCI_TEST_CMD_REBACK
+0xff HCI_TEST_CMD_CLOSE_LPM
+)
+
+(//event
+0x00 HCI_EVENT_SPP_CONN_REP
+0x01 HCI_EVENT_HID_CONN_REP
+0x02 HCI_EVENT_LE_CONN_REP
+0x03 HCI_EVENT_SPP_DIS_REP
+0x04 HCI_EVENT_HID_DIS_REP
+0x05 HCI_EVENT_LE_DIS_REP
+0x06 HCI_EVENT_CMD_RES
+0x07 HCI_EVENT_SPP_DATA_REP
+0x08 HCI_EVENT_LE_DATA_REP
+0x09 HCI_EVENT_STANDBY_REP
+0x0a HCI_EVENT_STATUS_RES
+0x0b HCI_EVENT_FINISH_PACK_NUM
+0X0C HCI_EVENT_SNIFF_MD_CHANGE
+0x0D HCI_EVENT_NVRAM_REP
+0x0e HCI_EVENT_GKEY
+0x0F HCI_EVENT_INVALID_PACKET
+0x10 HCI_EVENT_GET_PASSKEY
+0x11 HCI_EVENT_LE_TK
+0x12 HCI_EVENT_REMOTE_MTU
+0x14 HCI_EVENT_LE_PAIRING_STATE
+0X15 HCI_EVENT_LE_ENCRYPTION_STATE
+0x17 HCI_EVENT_LE_CONNECTION_UPDATE
+0x1d HCI_EVENT_LE_GKEY
+
+)
+
+
+(//command HCI_CMD_SET_GPIO
+//byte 0
+0x00 HCI_CMD_CONFIG_GPIO_INPUT
+0x01 HCI_CMD_CONFIG_GPIO_OUTPUT
+//byte 1 input state
+0x00 GPIO_INPUT_PULLUP
+0x01 GPIO_INPUT_PULLDOWN
+0x02 GPIO_INPUT_HIGH_IMPEDANCE
+)
+
+
+
+(
+0x7e0 OTP_ADDR_RF_PARAM_FIX
+//struct of RF_PARAM_FIX
+// uint8       //length = param_pair_count * 2 
+// uint16     //param-pair-1
+// uint16     //param-pair-2
+// uint16     //param-pair-3
+// uint16     //param-pair-4
+// uint16     //param-pair-5
+// uint16     //param-pair-6
+// uint16     //param-pair-7
+)
+
+(
+0	PAIRING_PINCODE
+1	PAIRING_JUSTWORK
+2	PAIRING_PASSKEY
+3	PAIRING_CONFIRM
+)
+
+
+(
+0x0001	FLAG_BT_PAIRING_SUCCESS
+0x0101	FLAG_BT_PAIRING_FAIL
+0x0080	FLAG_BLE_PAIRING_SUCCESS
+0x0180	FLAG_BLE_PAIRING_FAIL
+)
+
+
+(
+1	FLAG_EVENT_START_ENC
+0	FLAG_EVENT_PAUSE_ENC
+)
+
+(
+	0 MOUDLE_STATE_BT_BIT
+	1 MOUDLE_STATE_BLE_BIT
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/bt.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/bt.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/bt.format	(working copy)
@@ -0,0 +1,1050 @@
+
+	width = 32
+	const length = 12000
+
+	/* ========= memory ============== */
+memalloc(
+/* 00-0f most frequently used area  */
+1 mem_le_adv_transmit
+1 mem_le_adv_waitcnt
+1 mem_le_adv_rcv
+1 mem_le_req_rcv
+1 mem_le_scanrsp_rcv
+1 mem_le_conn_rcv
+
+1 mem_inquiryscan_waitcnt
+1 mem_inquiryscan_rcvcnt
+1 mem_pagescan_waitcnt
+1 mem_pagescan_rcvcnt
+1 mem_pagescan_rcvfhscnt
+1 mem_slave_rcvcnt
+1 mem_page_transmit
+1 mem_page_rcv
+1 mem_page_rcv_fhs
+1 mem_master_rcvcnt
+
+/* 10-1f debug area */
+1 mem_fhs_wait_counter
+1 mem_newconnto_counter
+1 mem_inquiry_transmit
+1 mem_inquiry_rcv
+1 mem_fw_ver
+1 mem_current_context
+1 mem_le_ch_mapped
+1 mem_last_freq
+1 mem_rssi
+1 mem_rx_type
+2 mem_rx_hec_err
+2 mem_rx_crc_err
+2 mem_context_ptr
+8 mem_display
+8 mem_bcd
+
+		/* context swappable area */
+1 mem_state
+1 mem_mode
+2 mem_tsniff
+4 mem_sniff_anchor
+6 mem_clk_offset
+2 mem_rx_window
+3 mem_plap
+1 mem_puap
+2 mem_pnap
+1 mem_conn_handle
+1 mem_arq
+1 mem_lmp_to_send
+1 mem_lmi_opcode
+1 mem_lmo_reason
+1 mem_op
+1 mem_state_map
+4 mem_supervision_timer
+2 mem_supervision_to
+1 mem_name_offset
+1 mem_key_size
+1 mem_conn_sm
+12 mem_aco
+16 mem_kc
+1 mem_conn_timer
+1 mem_sniff_attempt
+1 mem_sniff_timeout
+2 mem_dsniff
+1 mem_amaddr
+1 mem_lmo_opcode1
+1 mem_lmi_opcode1
+1 mem_lmo_reason1
+1 mem_lmo_tid1
+1 mem_lmo_opcode2
+1 mem_lmi_opcode2
+1 mem_lmo_reason2
+1 mem_lmo_tid2
+
+3 mem_hci_version
+2 mem_acl_pktlen
+1 mem_sco_pktlen
+2 mem_acl_pktcnt
+2 mem_sco_pktcnt
+
+1 mem_current_sniff_attempt
+1 mem_current_sniff_timeout
+1 mem_sniff_timeout_temp
+1 mem_nfreq_index_inq
+1 mem_nfreq_index_page
+1 mem_ninqy_index
+1 mem_fhs_misc
+
+
+
+/* lpo related */
+4 mem_subsniff_instant
+1 mem_subsniff_rate
+2 mem_subsniff_tcmax
+1 mem_subsniff_tsniff
+1 mem_lpm_adjust
+6 mem_sync_clke
+1 mem_lpm_current_mult
+6 mem_gpio_wakeup
+
+/* sco & esco */
+1 mem_air_mode
+1 mem_sco_asso_handle
+2 mem_sco_handle
+1 mem_esco_desco
+1 mem_esco_type
+1 mem_neogotiation_state
+1 mem_saved_amaddr
+1 mem_esco_arq
+1 mem_esco_saved_arq
+30 mem_sco_obuf
+30 mem_sco_ibuf
+1 mem_sco_poll
+
+
+
+//page
+1 mem_npage_index
+1 mem_page_mode
+4 mem_page_clk
+
+
+/* test related */
+2 mem_tst_pktcnt_sync
+2 mem_tst_pktcnt_hec
+2 mem_tst_pktcnt_crc
+2 mem_tst_pktcnt_dmh
+3 mem_tmp_buffer_head
+80 mem_tmp_buffer
+
+
+1 mem_tester_emulate
+0 mem_temp_payload
+1 test_mode_scenario
+1 test_mode_hopping_mode
+1 test_mode_tx_freq
+1 test_mode_rx_freq
+1 test_mode_power_mode
+1 test_mode_poll_period
+1 test_mode_packet_type
+2 test_mode_data_length
+1 mem_test_mode_old_debug_config
+1 mem_tester_cnt
+
+
+/*temp mem*/
+1 mem_temp_am_addr
+1 mem_temp_arq
+
+//
+2 mem_len
+4 mem_clkn_bt
+4 mem_clke_bt
+4 mem_dpll_clkn
+1 mem_connection_options
+
+1 mem_nameres_cnt
+2 mem_txptr
+2 mem_slot_offset
+
+//extm
+1 extm_fhs_misc
+1 extm_newconn_am_addr
+3 extm_class
+3 extm_lap
+1 extm_uap
+3 extm_nap
+
+
+//debug
+1 mem_debug_config
+1 mem_lch_code
+1 mem_fhs_am_addr
+2 mem_dpll_error
+1 mem_select_list_item
+0 mem_temp_reconn_record
+1 mem_record_bt_mode
+6 mem_temp_lap
+2 mem_list_item_ptr
+
+100 mem_eir
+)
+
+
+xmemalloc(
+/* patch enable 0x4000-0x403f  */
+
+1 mem_patch00
+1 mem_patch01
+1 mem_patch02
+1 mem_patch03
+1 mem_patch04
+1 mem_patch05
+1 mem_patch06
+1 mem_patch07
+1 mem_patch08
+1 mem_patch09
+1 mem_patch0a
+1 mem_patch0b
+1 mem_patch0c
+1 mem_patch0d
+1 mem_patch0e
+1 mem_patch0f
+1 mem_patch10
+1 mem_patch11
+1 mem_patch12
+1 mem_patch13
+1 mem_patch14
+1 mem_patch15
+1 mem_patch16
+1 mem_patch17
+1 mem_patch18
+1 mem_patch19
+1 mem_patch1a
+1 mem_patch1b
+1 mem_patch1c
+1 mem_patch1d
+1 mem_patch1e
+1 mem_patch1f
+1 mem_patch20
+1 mem_patch21
+1 mem_patch22
+1 mem_patch23
+1 mem_patch24
+1 mem_patch25
+1 mem_patch26
+1 mem_patch27
+1 mem_patch28
+1 mem_patch29
+1 mem_patch2a
+1 mem_patch2b
+1 mem_patch2c
+1 mem_patch2d
+1 mem_patch2e
+1 mem_patch2f
+1 mem_patch30
+1 mem_patch31
+1 mem_patch32
+1 mem_patch33
+1 mem_patch34
+1 mem_patch35
+1 mem_patch36
+1 mem_patch37
+1 mem_patch38
+1 mem_patch39
+1 mem_patch3a
+1 mem_patch3b
+1 mem_patch3c
+1 mem_patch3d
+1 mem_patch3e
+1 mem_patch3f
+
+	/* 3 device contexts  */
+80 mem_context
+1 mem_current_amaddr
+1 mem_lpm_mode
+1 mem_device_option
+1 mem_scan_mode
+4 mem_last_clkn
+
+	/* parameters */
+8 mem_features
+3 mem_lap
+1 mem_uap
+2 mem_nap
+1 mem_npage
+3 mem_glap
+3 mem_class
+2 mem_iscan_window
+2 mem_iscan_interval
+2 mem_pscan_window
+2 mem_pscan_interval
+2 mem_page_interval
+2 mem_page_window
+2 mem_page_to
+2 mem_inq_window
+1 mem_fcomp_mul
+1 mem_fcomp_div
+2 mem_rx_window_init
+2 mem_rx_window_sniff
+2 mem_rf_init_ptr
+
+	/* connection related */
+1 mem_last_type
+1 mem_last_type_esco
+1 mem_last_type_saved
+2 mem_retransmission_cnt
+4 mem_next_btclk
+
+1 mem_rf_rccal
+1 mem_handle_num
+1 mem_max_slot
+1 mem_eir_enable
+
+/* AFH related */
+4 mem_afh_instant
+2 mem_afh_error_total
+1 mem_afh_cfg
+1 mem_afh_new_mod
+5 mem_afh_map_lo
+5 mem_afh_map_hi
+1 mem_afh_used
+2 mem_afh_index
+11 mem_afh_map_new
+80 mem_afh_map
+4 mem_afh_timer
+10 mem_afh_classify_channel_map
+
+
+	/* lpm related */
+2 mem_chip_functions
+2 mem_lpm_wake_lock
+2 mem_lpm_interval
+1 mem_lpm_overhead
+1 mem_lpm_hibernate_switch
+1 mem_lpm_doze_switch
+1 mem_esco_addr
+1 mem_sniff_unint_lost
+1 mem_ptt
+4 mem_sleep_counter   //should be 0x41fc in REVC
+4 mem_sleep_counter_all
+6 mem_sleep_clkn
+3 mem_sniff_rcv
+3 mem_sniff_lost
+3 mem_clks_per_lpo
+
+1 mem_lpm_mult
+1 mem_lpm_mult_timeout
+1 mem_lpm_mult_cnt
+
+/* 8139-813b lpm_ctrl[31:12] */
+3 mem_lpm_config				
+
+1 mem_lpm_xtalcnt
+1 mem_lpm_buckcnt
+1 mem_lpm_ldocnt
+1 mem_lpm_isogate
+1 mem_lpm_isogate_final
+16 mem_saved_gpio	// should be 0x421e in REVC
+3 mem_saved_gsel
+8 mem_saved_mark
+1 mem_saved_spidctrl
+2 mem_patch_ptr
+2 mem_patch_len
+
+32 mem_timers
+
+/*LINK KEY*/
+1 mem_link_key_exists
+16 mem_link_key
+
+
+/* HCI */
+1 mem_hci_cmd
+1 mem_hci_conn_handle
+3 mem_hci_plap
+1 mem_hci_puap
+2 mem_hci_pnap
+
+/*Peripherals*/
+1 mem_uartd_rxitems_got_data
+1 mem_uartd_rxitems_threshold
+2 mem_uartd_rx_timeout
+
+1 mem_loadcode_times
+
+1 mem_tx_lch
+2 mem_tx_len
+
+1 mem_tx_power
+
+1 mem_context_number
+
+1 mem_250k_freq_enable
+
+ifdef DEBUG_RF_INIT
+1 mem_rf_init_data
+endif
+)
+
+(//bluetooth tx power
+0 TX_POWER_0DB
+1 TX_POWER_3DB
+2 TX_POWER_5DB
+3 TX_POWER_f3DB
+4 TX_POWER_f5DB
+
+0x20 TX_POWER_PAIR
+)
+
+
+ifdef RAM_VERSION
+0x4b17 rom_lpm_sleep
+0x4b1d rom_lpm_enter_sleep
+0x4b16 rom_lpm_write_ctrl
+0x6b1a rom_otpd_read_data
+0x6ada rom_otp_write
+else
+0x3b17 rom_lpm_sleep
+0x59e0 rom_save_ucode
+
+0x4219 rom_mem_lpm_xtalcnt
+0x423b rom_mem_patch_ptr
+0x423d rom_mem_patch_len
+
+0x5b1a rom_otpd_read_data
+0x5ada rom_otp_write
+endif
+	/* context */
+(
+0x01 coffset_mode
+0x02 coffset_tsniff
+0x04 coffset_sniff_anchor
+0x08 coffset_clk_offset
+0x0e coffset_rx_window
+0x10 coffset_plap
+0x16 coffset_conn_handle
+0x17 coffset_arq
+	/* 3.0 only */
+0x18 coffset_lmp_to_send
+0x1b coffset_op
+0x1c coffset_state_map
+	/* le only */
+0x18 coffset_le_ch
+0x19 coffset_le_hop
+0x1a coffset_le_event_cnt
+
+80 context_size
+1 context_num
+)
+
+(
+0 lpm_flag_wake
+1 lpm_flag_loadcode
+)
+
+/* ========= parameters ============== */
+(
+0x0050 param_newconn_arq
+0x0007 param_esco_addr
+0x0010 param_conn_handle
+0x01f0 param_conn_handle_comp
+0x0020 param_newconnto
+0x0008 param_pagerespto
+0x0a00 param_snooze_setup_orig
+0x5353 param_snooze_ahead_orig
+0x00ff param_ninquiry
+0x2000 param_page_to
+0x0005 param_max_slot
+0x0010 param_sco_poll
+
+/* 6Mhz clock setting */
+ifdef CLK6M
+0x0721 param_tx_setup
+0x06e8 param_rx_setup
+0x04e8 param_rx_setup_earlier
+0x0300 param_rf_setup
+0x01d8 param_clke_cal
+0x0500 param_conn_access 
+0x0400 param_conn_access_wider
+200 param_pll_setup
+else
+/* 12Mhz clock setting */
+0x0e43 param_tx_setup
+0x09d0 param_rx_setup_earlier
+0x0600 param_rf_setup
+0x03bb param_clke_cal
+0x0600 param_conn_access 
+0x0800 param_conn_access_wider
+ifdef FPGA
+0x0500 param_pll_setup		// 120 is minimum
+else
+0x0500 param_pll_setup		// 120 is minimum
+endif
+0x0500 param_rx_ahead
+
+0x0d00 param_rx_setup	// 114us before sync
+2000 param_dpll_start_delay
+
+110 param_lpm_fix
+10 param_lpo_extra
+200 param_lpm_adjmax
+
+ifdef SIM
+20 param_hibernate_clks
+3 param_chgpump_delay
+else
+-1 param_hibernate_clks
+3000 param_chgpump_delay
+endif
+
+3 param_featrue_ssp
+0x0101 param_lmpext_ssp_enable
+339 param_acl_pktlen
+30   param_sco_pktlen
+1     param_acl_pktcnt		/*buffer acl pkt cnt*/
+7     param_sco_pktcnt
+
+
+0x8fffff param_features0
+0x9d83fe param_features1  // not support afh
+0x8359     param_features2
+0x000033 param_unap
+0x001177 param_lap
+0x9e8b33 param_glap
+0x002540 param_class//0x180208 //0x002580//402500//240404
+0x12e904 param_hci_version
+0x000a04 param_lmp_version//0x0a04
+0x000a06 param_lmp_version0
+0x12e9 param_lmp_subversion
+0x0012 param_tisw
+0x0012 param_tpsw
+0x1000 param_tisi
+0x0800 param_tpsi
+0x0020 param_page_window
+0x0020 param_inq_window
+0x1c80 param_supervision_to
+39 param_fcomp_div
+2 param_fcomp_mul
+6     param_name_len
+0x535442 param_name
+0x344950 param_name1
+
+
+)
+
+/* ======= packet types  ========= */
+(
+0x0      type_null    
+0x1      type_poll   
+0x2      type_fhs    
+0x3      type_dm1    
+0x4      type_dh1    
+0x5      type_hv1    
+0x6      type_hv2    
+0x7      type_hv3    
+0x8      type_3dh1     
+0x9      type_aux1   
+0xa      type_dm3    
+0xb      type_dh3    
+0xe      type_dm5    
+0xf      type_dh5    
+0x10     type_id
+0x11     type_shutdown
+0x13     type_lmp
+)
+
+/* ========== flag[6] =============== */
+(
+0        always        /* always 1 */
+1        true          /* set/rstn by verify,compare,icompare (true) */
+2        positive      /* set/rstn by all alu operations (opcode = 0x03,0x13,0x0f,0x1f), if alu output >= 0 */
+3        timeout       /* read only, the timeout from timers */
+5        zero          /* set/rstn by all alu operations (opcode = 0x03,0x13,0x0f,0x1f), if alu output == 0 */
+6        crc_failed    /* level, cleared by hop_start */
+7        enable_white  /* outside mux decide whether to load bt_clk or response_X */
+8        enable_parity /* level */
+9        enable_crc    /* level */
+10       enable_hec    /* level */
+11       decode_fec1   /* level */
+12       decode_fec2   /* level */
+13       decode_fec0   /* level */
+14       encrypt       /* level */
+15       crc16       /* for caculate ccitt crc16 */
+16       swfine	/* =0 stop_watch count based on oneslot =1 on 1 clock */
+17	  bt_trig
+20       rqst_freq    /* pulse, to start calculating frequency */
+21       recalc        /* pulse, to recalculate the fhs_parity */
+22       init_encrypt  /* pulse, issued to initialize encrption */
+23       mhalfbnd    /* half slot boundary of clke_rt, or when clke_bt[0] toggles */
+24       sync          /* sync found as a result of correlation,set/rstn by correlate opcode */
+25       user10    /* user10 */
+26       kc_p_activate  /* pulse to recalc the kc_p */
+27       encode_fec1   /* level */
+28       encode_fec2   /* level */
+29       encode_fec0   /* level */
+30       packet_end    /* pulse */
+32       is_tx         /* level */
+33       is_rx         /* level */
+34       halfslot     /* pulse, read only, when clkn_bt[0] toggles */
+35       oneslot      /* pulse, read only, when clkn_bt[1] toggles */
+36       mslotbnd     /* pulse, read only, when clke_bt[1] toggles */
+37       expire       /* level, read only, when selected clock source exceed timeup value */
+38       meet         /* level, read only, when selected clock source meet timeup value */
+39       tx_clear     /* level, read only, indicate tx pipe is cleared */
+40       user         /* user0 */
+41       master        /* user1 */
+42       slave2         /* user2 */
+43       wake           /* user3 */
+44       user2        /* user4 */
+45       match         /* user5 */
+46       attempt        /* user6 */
+47       user3          /* user7 */
+48       clknt         /* user8 */
+49	   user7 	/* user9 */
+50       synchronize   /* synchronize lpo and regular version of the clock */
+51       lpo_edge  /* read only, 3 clocks after risling edge of lpo clock */
+52       blank         /* C0 only, means pdata == 0 */
+53       modone          /* set divide operation is done */
+54       le		/* bluetooth 4.0 LE enable */
+55       aes_ready	/* set when aes is ok */
+63       never         /* read only, always 0 */
+)
+
+default flag = always
+
+/* ========== reg[6] =============== */
+(
+0        mark   /* for keeping strobes, more permanent */
+1        type   /* save and verify during rx */     /* rw */
+2        temp   /* general purpose register, 64 bits */
+3        contru  /* contr uart */
+4        am_addr      /* verify during rx, read and send during tx */ /* ro */
+5        contw        /* last mem_addr during write */
+6        contr        /* last mem_addr during read */
+7        queue    /* the index of qset*,qisolate* commands, ie, if queue = 3, qset/qisolate operate on bit3 */
+8        debug    /* can be wired out for observation */
+9        access   /* the 72 bit access word */
+10       contwu   /* contw uart */
+11       timeup        /* when does certain counter expire */
+12       pwindow       /* bit 71-61 of pdata; because on rx, bits shifts in from 71 down */
+13       fhs_parity    /* re-gernated based on bt_adr( {nap,uap,lap} ) when recalc flag is pulsed */
+14       white_init    /* init value of the whitening */
+15       crc24_init        /* init crc24 lfsr, 24 bits */
+16       contrub    /* uartb read ptr */
+17       rega          /* general purpose register, 32 bits */
+18       regb          /* general purpose register, 32 bits */
+19       regc          /* general purpose register, 17 bits */
+20       regab         /* concat of {rega,regb}, thus 64 bits */
+21       radio_ctrl   /* radio i/f direct i/o ctrl, check following "radio_ctrl" section */
+22       addhi    /* ahb bus address [24:16] */
+23       freq_index   /* 7 bit read only */
+24       regd    /* regext[1] */
+25       clkn              /* {clkn_bt, clkn_rt} */
+26       clke              /* {clke_bt, clke_rt} */
+27       stop_watch
+28       fhs_misc   /* SR, SP, pscan mode */
+29       fhs_class  /* class field in fhs */
+30       fhs0   /* read only, bit 0-71 of fhs word */
+31       fhs1   /* read only, bit 72-142 of fhs word */
+32       bt_adr /* r/w, the bt_addr to access gen and freq hopping, contain only lap and uap */
+33       bt_clk /* r/w, the bt_clk for freq hopping */
+34       clkn_bt  /* read only, native bluetooth clock, free running 3.2KHz  or controlled by RTHALFSLOT register */
+35       clkn_rt  /* read only, native realtime clock, free running 12MHz, count from 0-3749, or controlled by RTHALFSLOT register */
+36       freq_mode
+/* wire even_train    = freq_mode[4];    // odd even train                            */
+/* wire conn_mode     = 3;    // connection                                           */
+/* wire iqpgscan_mode = 2;    // slave in inquiry and page (not response)             */
+/* wire iqpgresp_mode = 1;    // slave in inquriy and page (response only)            */
+/* wire inqypage_mode = 0;    // master in inquiry and page(response or not response) */
+37       xin   /* x parameter, read only */
+38       N_tx_slot /* the N factor in equations for Xi,Xp,Xprm,Xprs */
+39 	   auxcnt
+40       clke_bt  /* r/w,  external bluetooth clock , free running 3.2KHz or controlled by RTHALFSLOT register */
+41       clke_rt  /* r/w,  external realtime clock, , free running 12MHz, count from 0-3749, or controlled by RTHALFSLOT register */
+42       branch_addr	/* last branch address */
+44       lap
+45       uap
+46       nap         
+47       regext		/* r/w extended 12x32bit registers,  indexed by regext_index */
+48       alarm             /* r/w, lpo wake up time, this is also how lpo and current clock keep sync */
+49       lpo_time          /* read only, this is the value to be copied back to clkn/clke after wakeup */
+50       kc_ls             /* secret key,                71: 0 */
+51       kc_ms             /* secret key,               127:72 */
+52       g1l               /* encryption length                */
+53		mask3ff		/* for mask 0x3ff operation */
+54       aes_ctrl		/* bit[0] init, bit[2:1] mode, bit[3] big endian, bit[4] load data, bit[5] load key */		
+55   	    rege			/* regext[3],regext[2] */
+56       regext_index   /* index of regext */
+57	     loopcnt
+58      stack			/* current return address */
+59       stack_ptr		/* stack depth */
+60       max_stack		/* maximum stack ptr */
+61       pc 			/* direct goto */
+62       null              /* to nowhere */
+63       pdata /* the shift register */
+)
+default reg = pdata
+
+/* regext_index */
+(
+0 regidx_data
+4 regidx_key
+8 regidx_xor
+12 regidx_result
+)
+
+/* aes_ctrl */
+(
+0x01 aes_cbc
+0x02 aes_cfb
+0x04 aes_192
+0x08 aes_256
+0x10 aes_big_endian
+0x20 aes_initialize
+0x40 aes_load
+0x80 aes_zero
+)
+
+/* ========== radio_ctrl========= */
+(
+0 TXGFSK
+1 PSK
+2 PSK3M
+3 RESET
+)
+/* assign BPWR = radio_ctrl[0]; */
+/* assign PARAMP = radio_ctrl[1]; */
+/* assign XTALPU = radio_ctrl[2]; */
+/* assign SYNTHPU = radio_ctrl[3]; */
+/* assign TXPU = radio_ctrl[4]; */
+/* assign RXPU = radio_ctrl[5]; */
+/* assign SLCTRL = radio_ctrl[6]; */
+/* assign XTALSEL_MUX_SEL = radio_ctrl[7] */
+
+
+/* =========== destination[4] ============== */
+(
+0 bucket
+1 rxf
+2 back
+3 mod
+)
+default dest = bucket
+
+/* =========== source[4] ============= */
+(
+1 txf
+3 demod
+)
+default source = 0
+
+
+/* ============== mark ============= *//*0 - 47 */
+(
+
+0  mark_fhs_eir  
+1  mark_rxbuf_inuse
+2  mark_tx_l2cap
+3  mark_switch_initiated
+4  mark_accept_switch
+5  mark_loopback
+7  mark_esco
+8  mark_esco_rxok
+9  mark_context
+10 mark_am_addr_broadcast
+11 mark_fhs_already_good
+12 mark_page_trainb
+13 mark_lpm_mult_enable
+14 mark_usb_flag
+15 mark_old_packet
+16 mark_longpacket
+17 mark_testmode
+18 mark_ar2
+19 mark_h5tx_rp
+20 mark_h5tx_crc	
+21 mark_h5tx_retransmit
+22 mark_h5rx_pstart
+23 mark_h5_sync
+24 mark_h5_reinit
+28 mark_inquiry_on
+29 mark_inquiry_state
+30 mark_inquiry_trainb
+31 mark_periodical_diac
+32 mark_all_diac
+33 mark_slave_in_rand_accepted
+34 mark_reconn_recieve_switch
+35 mark_isstr
+36 mark_loadcode
+37 mark_ext_patch
+38 mark_24g
+39 mark_24g_conext
+40 mark_eeprom_size
+// REVAB:max 35, REVC:max 63
+41 mark_ble_tx_md
+42 mark_ble_rx_md
+43 mark_otp_encrypt
+)
+
+(
+1 reload_type_otp
+2 reload_type_spi
+3 reload_type_iic
+)
+
+
+/* ============== soft timers ============== */
+(
+0 le_adv_interval_timer
+1 inquiry_length_timer
+2 le_scan_interval_timer
+3 page_length_timer
+4 iscan_interval_timer
+5 pscan_interval_timer
+6 switch_wait_timer
+7 enpt_delay_timer
+8 page_interval_timer
+9 key_scan_timer
+10 smp_pairing_timer
+11  ui_led_blink   //led timer 可扩展
+12  ui_led_blink1
+13 ui_led_blink2
+14 m_wake_timer
+
+)
+
+(
+1 hci_cmd_inquiry
+2 hci_cmd_inquiry_cancel
+3 hci_cmd_remote_name_req
+4 hci_cmd_remote_feature_req
+5 hci_cmd_create_conn
+6 hci_cmd_disconn
+7 hci_cmd_accept_conn
+8 hci_cmd_reject_conn
+9 hci_cmd_pair
+10 hci_cmd_nopair
+11 hci_cmd_linkkey
+12 hci_cmd_nokey
+13 hci_cmd_auth
+14 hci_cmd_stopencrypt
+15 hci_cmd_startencrypt
+16 hci_cmd_setup_sco
+17 hci_cmd_disconn_sco
+18 hci_cmd_in_sniff
+19 hci_cmd_exit_sniff
+20 hci_cmd_remote_version_req
+21 hci_cmd_remote_ext_features_req
+22 hci_cmd_io_cap
+23 hci_cmd_role_discovery
+24 hci_cmd_role_switch
+25 hci_cmd_accept_with_switch
+26 hci_cmd_detach
+27 hci_cmd_le_create_conn
+28 hci_cmd_accept_sco_conn
+80 hci_cmd_wait_remote_feature
+81 hci_cmd_wait_remote_ext_feature
+82 hci_cmd_wait_remote_name
+)
+
+
+
+/* ============== debug ============= */
+(
+0 debug_neg_skew
+1 debug_bitbucket
+2 debug_dont_clear_got_tx
+3 debug_scatter_enabled
+4 debug_tx_fixed_freq
+5 debug_rx_fixed_freq
+6 debug_tx_pattern
+)
+
+/* ============== tester_emulator ============= */
+(
+0 tester_fixed_flow
+1 tester_fixed_flow_polarity
+2 tester_change
+3 tester_exit
+4 tester_pattern_test
+5 tester_whitening_change
+6 tester_fixed_freq
+7 tester_no_whitening
+)
+
+/* ============== mode ==========*/
+(
+0 mode_le
+1 mode_master
+2 afh_enable
+3 afh_change
+4 send_sco_when_slave
+5 first_seqnx
+)
+
+/* ============== state_map ==========*/
+(
+0 smap_lmptidinit
+1 smap_lmptid
+2 smap_encryption
+3 smap_name_res
+4 smap_name_req
+5 smap_edr
+6 smap_rxlmp
+7 smap_rxl2cap
+)
+(
+0 state_inconn
+1 state_insniff
+2 state_insco 
+3 state_inpage
+4 state_conn_comp
+5 state_init_seq
+6 state_combkey
+7 state_linkkey
+)
+(
+0 op_send_sres
+1 op_auth_req
+2 op_inrand_req
+3 op_disconn
+4 op_stop_enc
+5 op_start_enc
+6 op_txl2cap
+7 op_pkt_comp
+)
+
+
+/* ============== arq [3] ================ */
+(
+0 flow
+1 arqn
+2 seqn
+3 wack
+4 flowx              /* out */  /* not really in memory */
+5 arqnx              /* out */
+6 seqnx              /* out */
+7 bcast1             /* first broadcast received */
+)
+
+/* arq          {flow,arqn,seqn}, read/write */
+/* [0] flow r/w  acl full status of the other, store during rx, checked during tx */
+/* [1] arqn r/w  ack of the other during rx (ack tx fifo),                        */
+/* [2] seqn r/w  seqn of the other, check during rx                               */ 
+/* arqx         {flowx,arqnx,seqnx} */
+/* [0] flowx r/o flow back to the other, 1 alow send, 0 not to send, read only tx */
+/* [1] arqnx r/w ack to the other, set by rx, send back on tx                     */
+/* [2] seqnx r/w toggled by arqn, to be send during tx                            */ 
+
+(
+0 llid0
+1 llid1
+2 nesn
+3 sn
+4 md
+5 wak
+)
+
+/* AFH flags */
+(
+0 AFH_CFG_ON
+1 AFH_CFG_TIMER
+2 send_lmp_set_afh
+3 AFH_CFG_REPORT_MODE
+4 AFH_CFG_MASTER_SENT_REQ
+)
+
+/* LLID CODE */
+(	
+1 LLID_L2CAP_CONT
+2 LLID_L2CAP_START
+3 LLID_LMP
+)
+
+/* ============== master_state ==========*/
+(
+0  master_in_idle
+1  master_in_inquiry
+2  master_in_page
+10 master_in_becoming_slave
+15 master_in_conn
+)
+(
+0 newrev_feature_bettx
+1 newrev_feature_betplltx
+2 newrev_feature_skip_retransmit
+3 newrev_feature_init_radio_after_sleep
+4 newrev_feature_no_lpolog
+)
+/*************mem_pincode_state****************/
+(
+0 pincode_state_ilde
+1 pincode_state_wait_pincode
+2 pincode_state_pincode_ready
+)
+
+
+// lpm_write
+(
+1 lpmreg_sel_ctrl
+2 lpmreg_sel_ctrl2
+4 lpmreg_sel_gpiolow
+8 lpmreg_sel_gpiohigh
+16 lpmreg_sel_counter
+)
+
+//scan_mode
+(
+0 inq_scan_mode
+1 page_scan_mode
+2 page_inq_enable
+)
+//mem_neogotiation_state
+(
+ 0 default_neogotiation_state
+ 1 prarm_neogotiation
+)
+
+//mem_lpm_wake_lock
+(
+0 wake_lock_ble_rx
+1 wake_lock_ble_tx
+2 wake_lock_m0_single
+
+3 wake_lock_ble_rx_patch
+4 wake_lock_ble_tx_patch
+
+5 wake_lock_ipc_bt2m0
+6 wake_lock_ipc_m02bt
+7 wake_lock_button
+8 wake_lock_cmd
+9 wake_lock_app
+10 wake_lock_lmp_tx
+11 wake_lock_lmp_rx
+12 wake_lock_l2cap_tx
+13 wake_lock_l2cap_rx
+14 wake_lock_ipc_c512bt
+15 wake_lock_ipc_bt2c51
+
+)
+
+(
+0 bt_disabled
+1 ble_disabled
+2 module_disable
+
+)
+
+(
+0x33  REC_3_MODE
+0x34  REC_4_MODE
+0x35  REC_4_MODE_STATIC_ADDRESS
+0x36  REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS
+0x37  REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS
+)
+
+
+//sniff UART_TX UART_RX
+(
+6 UART_WAKEUP_TX
+7 UART_WAKEUP_RX
+)
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/command.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/command.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/command.format	(working copy)
@@ -0,0 +1,1407 @@
+
+/* Parse Command:
+TX: take bits from tx fifo, jam it into shift and a destination (rf,bucket)
+RX: take bits from demod,  jam it into shift and a destination (acl,sco,bucket) */
+
+/* Inject Command:
+TX: 0 into shift, send tail of shift into a destination (rf,bucket)
+RX: 0 into shift, send tail of shift into a destination (acl,sco,bucket) */
+
+format
+  ! 15 romdat
+  % d0
+  % d1
+  % d2
+  % d3
+  [8] d0
+  [8] d1
+  [8] d2
+  [8] d3
+end
+
+format
+  ! 15 enable   /* set flag to 1 */
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [6] null
+  [9] 0
+end
+ /* High 5 bytes of channel map */
+format
+  ! 15 pulse   /* set flag to 1 */
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [6] null
+  [9] 0
+end
+
+format
+  ! 15 disable   /* set flag to 0 */
+  % flag
+  [5] opcode
+  [6] 2
+  [6] flag
+  [6] null
+  [9] 0
+end
+
+format
+  ! 15 set0  /* set selected bit of reg to 0 */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9
+  [6] never
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 set1  /* set selected bit of reg to 1 */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9          /* alu op demux */
+  [6] always
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 setflag  /* set selected bit of the reg to the polarity of the flag */
+  % flag
+  % immediate
+  % reg
+  [5] opcode
+  [6] 9
+  [6] flag
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 nsetflag  /* set the selected bit of the reg to the opposite polarity of the flag */
+  % flag
+  % immediate
+  % reg
+  [5] opcode
+  [6] 0x29
+  [6] flag
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 15 setflip    /* invert the selected bit of the reg */
+  % immediate
+  % reg
+  [5] opcode
+  [6] 10            /* this is alu op */
+  [6] always
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 0x1f qset1      /* demux the lowest 4 bit of queue and OR it with regr into regw */
+  % reg             /* in short, set the bit in reg indexed by queue to 1 */
+  [5] opcode
+  [6] 9
+  [6] always
+  [6] reg
+  [9] 0
+end
+  
+format
+  ! 0x1f qset0      /* demux the lowest 4 bit of queue and AND it with regr into regw */
+  % reg             /* in short, set the bit in reg indexed by queue to 0 */
+  [5] opcode
+  [6] 9
+  [6] never
+  [6] reg
+  [9] 0
+end
+
+format 
+  ! 0x1f qsetflag   /* set the bit in reg index by queue to same as flag */
+  % flag
+  % reg
+  [5] opcode
+  [6] 9
+  [6] flag
+  [6] reg
+  [9] 0
+end
+
+format 
+  ! 0x1f nqsetflag   /* set the bit in the reg index by queue to opposite of flag */
+  % flag
+  % reg
+  [5] opcode
+  [6] 0x29
+  [6] flag
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 0x1f qsetflip      /* flip the bit in reg index by queue */
+  % reg
+  [5] opcode
+  [6] 10
+  [6] always
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 1 parse       /* take bits out of source (sco_tx,tx_buffer,rx-elas) into pdata and dest (sco_rx,rx_fifo,tx-elas) */
+  % source
+  % dest
+  % immediate
+  [5] opcode
+  [4] source      /* voice, data, demod */
+  [2] 0
+  [6] 0    
+  [2] 0           /* parse or inject */ 
+  [4] dest        /* acl, sco, mod, bucket */
+  [9] immediate   /* number of bits to parse off */
+end
+
+format
+  ! 1 inject      /* shift data from pdata into destination (tx-elas,rx_fifo,sco_rx) */
+  % destination
+  % immediate
+  [5] opcode
+  [4] 0
+  [2] 0
+  [6] 1
+  [2] 0
+  [4] destination /* acl,sco,mod,bucket */
+  [9] immediate   /* number of bits to be injected */
+end
+
+format
+  ! 1 iinject
+  % destination
+  % regr
+  [5] opcode
+  [6] regr       /* contain the number of bits to inject */
+  [6] 3
+  [2] 0
+  [4] destination /* acl,sco,mod,bucket */
+  [9] 0 
+end
+
+format
+  ! 1 stuff  /* automatic parse, stuff_counter decrement on every bit until hits zero */
+  % source
+  % destination
+  [5] opcode
+  [4] source
+  [2] 0
+  [6] 2
+  [2] 0
+  [4] destination
+  [9] 0
+end
+
+format    /* force immediate value into registers */
+  ! 3 force
+  % immediate
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 0    /* alu operation force */
+  [6] regw  /* destination register */
+  [9] immediate
+end
+
+format    /* force whatever is on shift_reg to regsiters */
+  ! 0x13 iforce
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 0    /* alu operation force */
+  [6] regw  /* destination register */
+  [9] 0
+end
+
+format    /* force immediate value into registers */
+  ! 3 increase
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 1    /* alu operation add */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 pincrease
+  % immediate
+  [5] opcode
+  [6] -1  /* pdata */
+  [6] 1   /* alu add */
+  [6] -1  /* back to pdata */
+  [9] immediate
+end
+
+format    /* force immediate value into registers */
+  ! 3 and_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 2    /* alu operation and into */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 and
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 2    /* alu operation and into */
+  [6] regw
+  [9] immediate
+end
+  
+format
+  ! 0x13 iand    /* pdata & regr -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 2    /* alu operation and into */
+  [6] regw
+  [9] 0
+end
+  
+
+format    /* and whatever is in shiftreg with reg */
+  ! 0x13 iand_into
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 2    /* alu operation and into */
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 3 or_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 3    /* alu operation or into */
+  [6] reg
+  [9] immediate
+end
+
+format
+  ! 3 or
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 3    /* alu operation or into */
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 ior
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 3    /* alu operation or into */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 0x13 ior_into
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 3    /* alu operation or into */
+  [6] reg
+  [9] 0
+end
+
+format
+  ! 3 skip_to   /* jump to location stored in reg */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 4   /* alu operation copy */
+  [6] rom_addr
+  [9] 0
+end
+
+format
+  ! 3 copy
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 4   /* alu operation copy */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 deposit   /* copy the register content thru alu to shift register, not prealigned like preload */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 4   /* alu operation copy */
+  [6] -1  /* pdata */
+  [9] 0
+end
+
+format
+  ! 3 icopy     /* copy the shift register lsb content directly to register, not aligned */
+  % regw
+  [5] opcode
+  [6] -1  /* pdata */
+  [6]  4  /* alu copy */
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 add
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 1
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 iadd       /* regr + pdata -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 1
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 sub          /* immediate - regr -> regw */
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 12
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 isub       /* pdata - regr -> regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 12
+  [6] regw
+  [9] 0
+end
+
+
+format
+  ! 3 flip
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 5
+  [6] reg
+  [9] immediate
+end
+  
+format
+  ! 0x13 iflip  /* use shift register as immediate to do xor */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] 0
+end
+  
+format
+  ! 3 xor
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 3 xor_into
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 5
+  [6] reg
+  [9] immediate
+end
+  
+format
+  ! 0x13 ixor  /* pdata xor regr and store result in regw */
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 5
+  [6] regw
+  [9] 0
+end
+  
+format
+  ! 3 invert
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 8
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 pinvert    /* invert pdata into itself */
+  [5] opcode
+  [6] -1
+  [6] 8
+  [6] -1
+  [9] 0
+end
+
+format
+  ! 3 div                 /* regr div immediate div */
+  % reg
+  % immediate
+  [5] opcode
+  [6] reg
+  [6] 13                   /* generate diven pulse to div */
+  [6] null
+  [9] immediate
+end
+
+format
+  ! 0x13 idiv           /* pdata div regr data ready at most after 41 nops */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 13                   /* generate diven pulse to div */
+  [6] null
+  [9] 0
+end
+
+format
+  ! 3 remainder            /* harvest div remainder */
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 14
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 quotient             /* harvest div quotient */
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 15
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 6
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift2
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 22
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift3
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 18
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift4
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 35
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift8
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 25
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift16
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 34
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 rshift32
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 30
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 7
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift2
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 23
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift8
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 26
+  [6] regw
+  [9] 0
+end
+
+  
+format
+  ! 3 lshift3
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 19
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 lshift4
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 36
+  [6] regw
+  [9] 0
+end
+  
+
+format
+  ! 3 lshift16
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 32
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 random               /* random number into regw */
+  % reg
+  [5] opcode
+  [6] 0
+  [6] 20
+  [6] reg
+  [9] 0
+end
+
+format                     /* bit reverse within a byte */
+  ! 3 reverse
+  % reg
+  % regw
+  [5] opcode
+  [6] reg
+  [6] 27
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 priority    /* priority encode reg into regw, lsb is the top priority, ie, priority(8'b00010000) = 4 */
+  % reg
+  % regw
+  [5] opcode
+  [6] reg
+  [6] 21
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 7 setsect   /* set a section of pdata */
+  % section    /* 0 sets 17:0 of pdata with set_data, 1 sets 35:18, 2 sets 53:36, 3 sets 71:54 */
+  % set_data
+  [5] opcode
+  [7] 0
+  [2] section
+  [18] set_data
+end
+
+format
+  ! 10 preload   /* load stuff into pdata according to fhs format, check us.v */
+  % reg
+  [5] opcode
+  [6] reg
+  [6] 0
+  [6] -1
+  [9] 0
+end
+
+format  /* load register with pdata content, according to fhs format, check us.v */
+  ! 10 ialigned   /* all bits are in position */
+  % regw
+  [5] opcode
+  [6] -1
+  [6] 0
+  [6] regw
+  [9] 0
+end
+
+format  /* load register to another according to fhs format */
+  ! 10 aligned
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 0
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 4 branch
+  % addr
+  % flag
+  [5] opcode
+  [6] 1
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 call
+  % addr
+  % flag
+  [5] opcode
+  [6] 2
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 rtn
+  % flag
+  [5] opcode
+  [6] 3
+  [6] flag
+  [15] 0
+end
+
+format
+  ! 0x0c storer          /* write reg to memory, address from immediate then mem_ptr */
+  % reg
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] reg               
+  [4] num_bytes
+  [17] addr
+end
+
+format
+  ! 0x0c store          /* write pdata to memory, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63               
+  [4] num_bytes
+  [17] addr
+end
+
+format
+  ! 0x0c storet          /* write temp to memory, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2               
+  [4] num_bytes
+  [17] addr
+end
+
+
+format
+  ! 0x1c istorer        /* write regr to memory, address from regaddr */
+  % regr
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] regr            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+format
+  ! 0x1c istore        /* write pdata to memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 63            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+format
+  ! 0x1c istoret        /* write temp to memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 2            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+
+format
+  ! 0x0d fetchr          /* read reg from memory, address from immediate then mem_ptr */
+  % reg
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] reg               
+  [4] num_bytes
+  [17] addr
+end
+
+format
+  ! 0x0d fetch          /* read pdata from memory, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63               
+  [4] num_bytes
+  [17] addr
+end
+
+format
+  ! 0x0d fetcht          /* read temp from memory, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2               
+  [4] num_bytes
+  [17] addr
+end
+
+format
+  ! 0x1d ifetchr        /* read regr from memory, address from regaddr */
+  % regr
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] regr            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+format
+  ! 0x1d ifetch        /* read pdata from memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 63            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+format
+  ! 0x1d ifetcht        /* read temp from memory, address from regaddr */
+  % num_bytes
+  % regaddr
+  [5] opcode
+  [6] 2            
+  [4] num_bytes
+  [11] 0
+  [6] regaddr
+end
+
+
+format
+  ! 0x0c hstoret          /* write to corereg, data from temp, address from immediate won't increment */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2               /* memory */
+  [4] num_bytes
+  [1] 0
+  [1] 1
+  [15] addr
+end
+
+format
+  ! 0x0d hfetcht          /* read from corereg, data into temp, address from immediate won't increment */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 2               /* memory */
+  [4] num_bytes
+  [1] 0
+  [1] 1
+  [15] addr
+end
+
+format
+  ! 0x0c hstore          /* write to memory, data from pdata, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63               /* memory */
+  [4] num_bytes
+  [1] 0
+  [1] 1
+  [15] addr
+end
+
+format
+  ! 0x0d hfetch          /* read from memory, data into pdata, address from immediate then mem_ptr */
+  % num_bytes
+  % addr
+  [5] opcode
+  [6] 63               /* memory */
+  [4] num_bytes
+  [1] 0
+  [1] 1
+  [15] addr
+end
+
+
+format
+  ! 0x0d crc         /* read from memory, count from loopcnt, put crc result into pdata */
+  % addr
+  [5] opcode
+  [6] 0
+  [4] 0
+  [17] addr
+end
+
+format
+  ! 0x1d icrc         /* read from memory, address from reg, count from loopcnt, put crc result into pdata */
+  % reg
+  [5] opcode
+  [6] reg             /* hold address */
+  [4] 0
+  [17] 0
+end
+
+format
+  ! 0x0e jam
+  % immediate
+  % addr
+  [5] opcode
+  [2] 0
+  [17] addr
+  [8] immediate
+end
+
+format
+  ! 0x0e hjam
+  % immediate
+  % addr
+  [5] opcode
+  [3] 0
+  [1] 1   /* msb */
+  [15] addr
+  [8] immediate
+end
+
+
+format			/* 0x242... */
+  ! 4 nbranch
+  % addr
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 1
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 ncall
+  % addr
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 2
+  [6] flag
+  [15] addr
+end
+
+format
+  ! 4 nrtn
+  % flag
+  [5] opcode
+  [1] 1
+  [5] 3
+  [6] flag
+  [15] 0
+end
+
+format
+  ! 4 nop
+  % addr  /* no-op for addr+2 clocks */
+  [5] opcode
+  [6] 0     
+  [6] 0     /* always */ 
+  [15] addr
+end
+
+format
+  ! 4 clear_stack
+  [5] opcode
+  [6] 4
+  [6] 0    /* always */
+  [15] 0
+end
+
+format
+  ! 6 until
+  % reg
+  % flag
+  [5] opcode
+  [6] reg
+  [6] flag
+  [6] 1
+  [9] 0
+end
+  
+format
+  ! 6 correlate   /* quit if 1. flag is true 2, regr time up 3, found sync,(cond_true) */
+  % reg          /* expire counter to check against */
+  % flag
+  [5] opcode
+  [6] reg
+  [6] flag
+  [6] 2           /* correlate */
+  [9] 0           
+end
+
+format
+  ! 5 compare   /* sets cond flag,  if reg equals immediate */
+  % immediate
+  % reg
+  % mask
+  [5] opcode
+  [6] reg
+  [3] 0
+  [9] mask
+  [9] immediate
+end
+
+format
+  ! 0x15 icompare   /* sets cond flag,  if reg equals pdata */
+  % mask
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 0
+  [9] mask
+  [9] 0
+end
+
+format   /* sets cond. flag, if reg equals LS half of shift reg with MS half of reg being mask */
+  ! 5 iverify
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 2
+  [18] 0
+end
+
+format
+  ! 0x15 qisolate1
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [18] -1
+end
+
+format
+  ! 0x15 qisolate0
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [18] 0
+end
+
+	/* REVAB bug: cannot access bit above 35 */
+format
+  ! 5 isolate1
+  % addr
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [9] -1
+  [9] addr
+end
+
+format
+  ! 5 isolate0
+  % addr
+  % reg
+  [5] opcode
+  [6] reg
+  [3] 3
+  [9] 0
+  [9] addr
+end
+
+format
+  ! 11 setarg
+  % immediate
+  [5] opcode
+  [27] immediate
+end
+
+format
+  ! 0x1b arg
+  % immediate
+  % reg
+  [5] opcode
+  [6] reg
+  [21] immediate
+end
+
+  
+format
+  ! 0 sleep
+  [5] opcode
+  [27] 0
+end
+
+format
+  ! 0 snooze
+  [5] opcode
+  [6] -1
+  [21] 0
+end
+
+format
+  ! 0 revision
+  % rev_num
+  [5] opcode
+  [27] rev_num
+end
+
+format
+  ! 0x18 loop   /* branch when loopcnt is NOT zero, and decrease loopcnt */
+  % addr
+  [5] opcode
+  [4] 4
+  [8] 0
+  [15] addr
+end
+
+format
+  ! 0x18 beq   /* branch when pdata is equal to immediate */
+  % imme
+  % addr
+  [5] opcode
+  [4] 0
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bne   /* branch when pdata is NOT equal to immediate */
+  % imme
+  % addr
+  [5] opcode
+  [4] 1
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtneq   /* return when pdata is equal to immediate */
+  % imme
+  [5] opcode
+  [4] 2
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnne   /* return when pdata is NOT equal to immediate */
+  % imme
+  [5] opcode
+  [4] 3
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 bbit1   /* branch when pdata's imme bit is 1 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 5
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bbit0   /* branch when pdata's imme bit is 0 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 6
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtnbit1   /* return when pdata's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 7
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnbit0   /* return when pdata's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 8
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 8	bpatch
+  % imme
+  % addr
+  [5] opcode
+  [4] 9
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 8	bpatchx
+  % imme
+  % addr
+  [5] opcode
+  [4] 14
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bmark1   /* branch when mark's imme bit is 1 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 10
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 bmark0   /* branch when mark's imme bit is 0 */
+  % imme
+  % addr
+  [5] opcode
+  [4] 11
+  [8] imme
+  [15] addr
+end
+
+format
+  ! 0x18 rtnmark1   /* return when mark's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 12
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 0x18 rtnmark0   /* return when mark's imme bit is 0 */
+  % imme
+  [5] opcode
+  [4] 13
+  [8] imme
+  [15] 0
+end
+
+format
+  ! 3 mul32                  /* immediate mult regr */ 
+  % regr
+  % immediate                                  
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 31           
+  [6] regw
+  [9] immediate
+end
+
+format
+  ! 0x13 imul32           /* pdata mult regr 32x32=64bit */  
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 31                   
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 product              /* harvest mult product */
+  % regw
+  [5] opcode
+  [6] 0
+  [6] 17
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 byteswap
+  % regr
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 33
+  [6] regw
+  [9] 0
+end
+
+format
+  ! 3 shasx          /* SHA256 Sx operation, immediate is Sx */
+  % regr
+  % immediate
+  % regw
+  [5] opcode
+  [6] regr
+  [6] 28
+  [6] regw
+  [9] immediate
+end
+
+
+format
+  ! 0x13 regexrot 	/* regext[0] <- regext[7], regext[1] <- regext[0], regext[2] <- regext[1] ... */
+  [5] opcode
+  [6] 0
+  [6] 29
+  [6] null
+  [9] 0
+end
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/hci.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/hci.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/hci.format	(working copy)
@@ -0,0 +1,569 @@
+
+
+memalloc(
+1 mem_h5rx_ackcnt
+1 mem_check_err_acl_cont
+
+1 mem_rp_packets
+2 mem_packet_type
+
+2 mem_hci_sniff_conn_handle
+2 mem_hci_sniff_max_interval
+2 mem_hci_sniff_min_interval
+2 mem_hci_sniff_attempt
+2 mem_hci_sniff_timeout
+2 mem_voice_setting
+1 mem_retransmission_effort
+2 mem_sco_ptype
+3 mem_extm_uap_restore
+
+2 mem_h5rx_rptr
+1 mem_h5rx_ack
+1 mem_h5tx_ack
+2 mem_h5tx_rptr
+2 mem_h5tx_wptr
+2 mem_h5tx_free
+1 mem_h5rx_tmp
+1 mem_h5tx_seq
+
+2 mem_hci_acl_queue_wptr
+2 mem_hci_acl_queue_rptr
+2 mem_hci_acl_queue_end
+1 mem_hci_acl_queue_wcnt
+1 mem_hci_acl_cnt
+
+2 mem_hci_acl_tx_trigger_wptr //tx via uart
+
+
+1 mem_hci_curr_len
+2 mem_hci_curr_target 
+) 
+
+xmemalloc(
+
+1 mem_hci_lt_rx_state
+)
+
+15 hci_flag_rp
+//mem_hci_options bit map
+(
+1 hci_option_h4
+2 hci_option_protocol2
+3 hci_option_protocol3
+4 hci_option_uart
+5 hci_option_usb
+6 hci_option_phy2
+7 hci_option_phy3
+)
+// UART baud rate @6MHz
+(
+0 uart_ctrl_bit_enable
+3 uart_ctrl_bit_slip_protocol
+
+)
+
+//bit map of core_uart_ctrl
+(
+
+)
+//bit map of core_uart_status
+(
+0 uart_status_tx_fifo_full
+1 uart_status_tx_fifo_empty
+2 uart_status_tx_busy
+3 uart_status_rx_fifo_empty
+
+)
+//HCI H4 LOG related
+(
+0x4850 mem_hci_log
+8 hci_log_size
+100 hci_log_cnt
+
+)
+//HCI H4 Packet TYPE
+(
+0x01 HCI_H4_TYPE_CMD
+0x02 HCI_H4_TYPE_ACL
+0x04 HCI_H4_TYPE_EVENT
+
+)
+// HCI command opcode group field values
+(
+0x01 HCI_OGF_LINK_CONTROL
+0x02 HCI_OGF_LINK_POLICY
+0x03 HCI_OGF_BASEBAND
+0x04 HCI_OGF_INFO
+0x05 HCI_OGF_STATUS
+0x06 HCI_OGF_TEST
+0x08 HCI_OGF_LOW_ENERGY
+0x3e HCI_OGF_LOGO_TESTING
+0x3f HCI_OGF_VENDOR_SPECIFIC
+)
+
+// HCI link control opcode command field values, OGF=1
+(
+0x01 HCI_INQUIRY 
+0x02 HCI_INQUIRY_CANCEL 
+0x03 HCI_PERIODIC_INQUIRY_MODE 
+0x04 HCI_EXIT_PERIODIC_INQUIRY_MODE 
+0x05 HCI_CREATE_CONNECTION 
+0x06 HCI_DISCONNECT 
+0x07 HCI_ADD_SCO_CONNECTION 
+0x08 HCI_CREATE_CONNECTION_CANCEL
+0x09 HCI_ACCEPT_CONNECTION 
+0x0A HCI_REJECT_CONNECTION 
+0x0B HCI_LINK_KEY_REQUEST_REPLY 
+0x0C HCI_LINK_KEY_REQUEST_NEGATIVE_REPLY 
+0x0D HCI_PIN_CODE_REQUEST_REPLY 
+0x0E HCI_PIN_CODE_REQUEST_NEGATIVE_REPLY 
+0x0F HCI_CHANGE_CONNECTION_PACKET_TYPE 
+0x11 HCI_AUTHENTICATION_REQUESTED 
+0x13 HCI_SET_CONNECTION_ENCRYPTION 
+0x15 HCI_CHANGE_CONNECTION_LINK_KEY 
+0x17 HCI_MASTER_LINK_KEY 
+0x19 HCI_REMOTE_NAME_REQUEST 
+0x1A HCI_REMOTE_NAME_REQUEST_CANCEL
+0x1B HCI_READ_REMOTE_SUPPORTED_FEATURES 
+0x1C HCI_READ_REMOTE_EXT_FEATURES 
+0x1D HCI_READ_REMOTE_VERSION_INFORMATION 
+0x1F HCI_READ_CLOCK_OFFSET 
+0x20 HCI_READ_LMP_HANDLE
+0x28 HCI_SETUP_SCO_CONNECTION
+0x29 HCI_ACCEPT_SCO_CONNECTION
+0x2A HCI_REJECT_SCO_CONNECTION
+0x2B HCI_IO_CAP_REQUEST_REPLY
+0x2C HCI_USER_CONFIRMATION_REQUEST_REPLY
+0x2D HCI_USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY
+0x2E HCI_USER_PASSKEY_REQUEST_REPLY
+0x2F HCI_USER_PASSKEY_REQUEST_NEGATIVE_REPLY
+0x30 HCI_REMOTE_OOB_DATA_REQUEST_REPLY
+0x33 HCI_REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY
+0x34 HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY
+0x35 HCI_CREATE_PHYSICAL_LINK
+0x36 HCI_ACCEPT_PHYSICAL_LINK
+0x37 HCI_DISCONNECT_PHYSICAL_LINK
+0x38 HCI_CREATE_LOGICAL_LINK
+0x39 HCI_ACCEPT_LOGICAL_LINK
+0x3A HCI_DISCONNECT_LOGICAL_LINK
+0x3B HCI_LOGICAL_LINK_CANCEL
+0x3C HCI_FLOW_SPEC_MODIFY
+0x3D HCI_ENHANCED_SETUP_SYNCHRONOUS_CONNECTION
+0x3E HCI_ENHANCED_ACCEPT_SYNCHRONOUS_CONNECTION_REQUEST
+0x3F HCI_TRUNCATED_PAGE
+0x40 HCI_TRUNCATED_PAGE_CANCEL
+0x41 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST
+0x42 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST_RECEIVE
+0x43 HCI_START_SYNCHRONIZATION_TRAIN
+0x44 HCI_RECEIVE_SYNCHRONIZATION_TRAIN
+0x45 HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY
+)
+
+
+// HCI link policy commands OCF value, OGF=2
+(
+0x01 HCI_HOLD_MODE 
+0x03 HCI_SNIFF_MODE 
+0x04 HCI_EXIT_SNIFF_MODE 
+0x05 HCI_PARK_MODE 
+0x06 HCI_EXIT_PARK_MODE 
+0x07 HCI_QOS_SETUP 
+0x09 HCI_ROLE_DISCOVERY 
+0x0B HCI_SWITCH_ROLE 
+0x0C HCI_READ_LINK_POLICY_SETTINGS 
+0x0D HCI_WRITE_LINK_POLICY_SETTINGS 
+0x0e HCI_READ_DEFAULT_LINK_POLICY_SETTINGS
+0x0f HCI_WRITE_DEFAULT_LINK_POLICY_SETTINGS
+0x10 HCI_FLOW_SPECIFICATION
+0x11 HCI_SNIFF_SUBRATING
+)
+
+// HCI host controller and baseband commands OCF values, OGF=3
+(
+0x01 HCI_SET_EVENT_MASK 
+0x03 HCI_RESET 
+0x05 HCI_SET_EVENT_FILTER 
+0x08 HCI_FLUSH 
+0x09 HCI_READ_PIN_TYPE 
+0x0A HCI_WRITE_PIN_TYPE 
+0x0B HCI_CREATE_NEW_UNIT_KEY 
+0x0D HCI_READ_STORED_LINK_KEY 
+0x11 HCI_WRITE_STORED_LINK_KEY 
+0x12 HCI_DELETE_STORED_LINK_KEY 
+0x13 HCI_WRITE_LOCAL_NAME 
+0x14 HCI_READ_LOCAL_NAME 
+0x15 HCI_READ_CONN_ACCEPT_TIMEOUT 
+0x16 HCI_WRITE_CONN_ACCEPT_TIMEOUT 
+0x17 HCI_READ_PAGE_TIMEOUT 
+0x18 HCI_WRITE_PAGE_TIMEOUT 
+0x19 HCI_READ_SCAN_ENABLE 
+0x1A HCI_WRITE_SCAN_ENABLE 
+0x1B HCI_READ_PAGE_SCAN_ACTIVITY 
+0x1C HCI_WRITE_PAGE_SCAN_ACTIVITY 
+0x1D HCI_READ_INQUIRY_SCAN_ACTIVITY 
+0x1E HCI_WRITE_INQUIRY_SCAN_ACTIVITY 
+0x1F HCI_READ_AUTHENTICATION_ENABLE 
+0x20 HCI_WRITE_AUTHENTICATION_ENABLE 
+0x21 HCI_READ_ENCRYPTION_MODE 
+0x22 HCI_WRITE_ENCRYPTION_MODE 
+0x23 HCI_READ_CLASS_OF_DEVICE 
+0x24 HCI_WRITE_CLASS_OF_DEVICE 
+0x25 HCI_READ_VOICE_SETTING 
+0x26 HCI_WRITE_VOICE_SETTING 
+0x27 HCI_READ_AUTOMATIC_FLUSH_TIMEOUT 
+0x28 HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT 
+0x29 HCI_READ_NUM_BROADCAST_RETRANSMISSIONS 
+0x2A HCI_WRITE_NUM_BROADCAST_RETRANSMISSIONS 
+0x2B HCI_READ_HOLD_MODE_ACTIVITY 
+0x2C HCI_WRITE_HOLD_MODE_ACTIVITY 
+0x2D HCI_READ_TRANSMIT_POWER_LEVEL 
+0x2E HCI_READ_SCO_FLOW_CONTROL_ENABLE 
+0x2F HCI_WRITE_SCO_FLOW_CONTROL_ENABLE 
+0x31 HCI_SET_CONTROLLER_TO_HOST_FLOW_CONTROL 
+0x33 HCI_HOST_BUFFER_SIZE 
+0x35 HCI_HOST_NUM_COMPLETED_PACKETS 
+0x36 HCI_READ_LINK_SUPERVISION_TIMEOUT 
+0x37 HCI_WRITE_LINK_SUPERVISION_TIMEOUT 
+0x38 HCI_READ_NUMBER_OF_SUPPORTED_IAC 
+0x39 HCI_READ_CURRENT_IAC_LAP 
+0x3A HCI_WRITE_CURRENT_IAC_LAP 
+0x3B HCI_READ_PAGE_SCAN_PERIOD_MODE 
+0x3C HCI_WRITE_PAGE_SCAN_PERIOD_MODE 
+0x3D HCI_READ_PAGE_SCAN_MODE 
+0x3E HCI_WRITE_PAGE_SCAN_MODE 
+0x3F HCI_SET_AFH_CHANNEL_CLASSIFICATION 
+
+
+0x42 HCI_READ_INQUIRY_SCAN_TYPE 
+0x43 HCI_WRITE_INQUIRY_SCAN_TYPE 
+0x44 HCI_READ_INQUIRY_MODE 
+0x45 HCI_WRITE_INQUIRY_MODE 
+0x46 HCI_READ_PAGE_SCAN_TYPE 
+0x47 HCI_WRITE_PAGE_SCAN_TYPE 
+
+0x48 HCI_READ_AFH_CHANNEL_ACCESSMENT_MODE 
+0x49 HCI_WRITE_AFH_CHANNEL_ACCESSMENT_MODE 
+0x51 HCI_READ_EXTENDED_INQUIRY_RESPONSE
+0x52 HCI_WRITE_EXTENDED_INQUIRY_RESPONSE
+0x53 HCI_REFRESH_ENCRYPTION_KEY
+0x55 HCI_READ_SIMPLE_PAIRING_MODE
+0x56 HCI_WRITE_SIMPLE_PAIRING_MODE
+0x57 HCI_READ_LOCAL_OOB_DATA
+0x58 HCI_READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL
+0x59 HCI_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL
+0x60 HCI_SEND_KEYPRESS_NOTIFICATION
+0x5A HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING
+0x5B HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING
+0x5F HCI_ENHANCED_FLUSH
+0x61 HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT
+0x62 HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT
+0x63 HCI_SET_EVENT_MASK_PAGE_2
+0x64 HCI_READ_LOCATION_DATA
+0x65 HCI_WRITE_LOCATION_DATA
+0x66 HCI_READ_FLOW_CONTROL_MODE
+0x67 HCI_WRITE_FLOW_CONTROL_MODE
+0x68 HCI_READ_ENHANCE_TRANSMIT_POWER_LEVEL
+0x69 HCI_READ_BEST_EFFORT_FLUSH_TIMEOUT
+0x6A HCI_WRITE_BEST_EFFORT_FLUSH_TIMEOUT
+0x6B HCI_SHORT_RANGE_MODE
+0x6C HCI_READ_LE_HOST_SUPPORT
+0x6D HCI_WRITE_LE_HOST_SUPPORT
+0x6E HCI_SET_MWS_CHANNEL_PARAMETERS
+0x6F HCI_SET_EXTERNAL_FRAME_CONFIGURATION
+0x70 HCI_SET_MWS_SIGNALING
+0x71 HCI_SET_MWS_TRANSPORT_LAYER
+0x72 HCI_SET_MWS_SCAN_FREQUENCY_TABLE
+0x73 HCI_SET_MWS_PATTERN_CONFIGURATION
+0x74 HCI_SET_RESERVED_LT_ADDR
+0x75 HCI_DELETE_RESERVED_LT_ADDR
+0x76 HCI_SET_CONNECTIONLESS_SLAVE_BROADCAST_DATA
+0x77 HCI_READ_SYNCHRONIZATION_TRAIN_PARAMETERS
+0x78 HCI_WRITE_SYNCHRONIZATION_TRAIN_PARAMETERS
+0x79 HCI_READ_SECURE_CONNECTIONS_HOST_SUPPORT
+0x7A HCI_WRITE_SECURE_CONNECTIONS_HOST_SUPPORT
+0x7B HCI_READ_AUTHENTICATED_PAYLOAD_TIMEOUT
+0x7C HCI_WRITE_AUTHENTICATED_PAYLOAD_TIMEOUT
+0x7D HCI_READ_LOCAL_OOB_EXTENDED_DATA
+0x7E HCI_READ_EXTENDED_PAGE_TIMEOUT
+0x7F HCI_WRITE_EXTENDED_PAGE_TIMEOUT
+0x80 HCI_READ_EXTENDED_INQUIRY_LENGTH
+0x81 HCI_WRITE_EXTENDED_INQUIRY_LENGTH
+)
+
+
+// HCI informational parameters OCF values, OGF=4
+(
+0x01 HCI_READ_LOCAL_VERSION_INFORMATION 
+0x02 HCI_READ_LOCAL_SUPPORTED_COMMANDS
+0x03 HCI_READ_LOCAL_SUPPORTED_FEATURES 
+0x04 HCI_READ_LOCAL_EXT_FEATURES 
+0x05 HCI_READ_BUFFER_SIZE 
+0x07 HCI_READ_COUNTRY_CODE 
+0x09 HCI_READ_BD_ADDR 
+0x0A HCI_REJECT_CONNECTION_REQUEST
+0x0B HCI_READ_LOCAL_SUPPORTED_CODECS
+)
+
+// HCI status parameters OCF values, OGF=5
+(
+0x01 HCI_READ_FAILED_CONTACT_COUNTER 
+0x02 HCI_RESET_FAILED_CONTACT_COUNTER 
+0x03 HCI_GET_LINK_QUALITY 
+0x05 HCI_READ_RSSI 
+0x06 HCI_READ_AFH_CHANNEL_MAP
+0x07 HCI_READ_BD_CLOCK
+0x08 HCI_READ_ENCRYPTION_KEY_SIZE
+0x09 HCI_READ_LOCAL_AMP_INFO
+0x0A HCI_READ_LOCAL_AMP_ASSOC
+0x0B HCI_WRITE_REMOTE_AMP_ASSOC
+0x0C HCI_GET_MWS_TRANSPORT_LAYER_CONFIGURATION
+0x0D HCI_SET_TRIGGERED_CLOCK_CAPTURE
+)
+
+// HCI testing command OCF values, OGF=6
+(
+0x01 HCI_READ_LOOPBACK_MODE 
+0x02 HCI_WRITE_LOOPBACK_MODE 
+0x03 HCI_ENABLE_DEVICE_UNDER_TEST_MODE 
+0x04 HCI_WRITE_SIMPLE_PAIRING_DEBUG_MODE
+0x07 HCI_ENABLE_AMP_RECEIVER_REPORTS
+0x08 HCI_AMP_TEST_END
+0x09 HCI_AMP_TEST
+0x0A HCI_WRITE_SECURE_CONNECTIONS_TEST_MODE
+)
+
+// HCI vendor specific command OCF values -OGF=3F
+(
+0x01 HCI_WRITE_BD_ADDR 
+0x02 HCI_READ_INQUIRY_RESPONSE_TIMEOUT 
+0x03 HCI_WRITE_INQUIRY_RESPONSE_TIMEOUT 
+0x04 HCI_READ_PAGE_SCAN_REPETITION_MODE 
+0x05 HCI_WRITE_PAGE_SCAN_REPETITION_MODE 
+0x06 HCI_READ_PAGE_RESPONSE_TIMEOUT 
+0x07 HCI_WRITE_PAGE_RESPONSE_TIMEOUT 
+0x08 HCI_READ_NEW_CONNECTION_TIMEOUT 
+0x09 HCI_WRITE_NEW_CONNECTION_TIMEOUT 
+0x0a HCI_INITIALIZE_BASEBAND 
+0x0b HCI_WRITE_LOCAL_SUPPORTED_FEATURES 
+0x0c HCI_WRITE_PARK_PARAMETERS 
+0x0d HCI_READ_PARK_PARAMETERS 
+0x0e HCI_WRITE_QUALITY_OF_SERVICE 
+0x0f HCI_NOT_USED 
+0x10 HCI_MODIFY_BEACON_PARAMETERS 
+0x11 HCI_UNPARK_USING_PM_ADDR 
+0x12 HCI_WRITE_HOPPING_CHANNELS 
+0x13 HCI_SLEEP_FOREVER_MODE 
+0x14 HCI_WRITE_AUTO_PAGE_SCAN_ENABLE 
+0x15 HCI_READ_AUTO_PAGE_SCAN_ENABLE 
+0x16 HCI_SET_ENCRYPTION_KEY_SIZE 
+0x17 HCI_INVALIDATE_FLASH_AND_REBOOT 
+0x18 HCI_UPDATE_UART_BAUD_RATE 
+0x19 HCI_WRITE_GPIO_1_4_AS_OUTPUT 
+0x1A HCI_WRITE_GPIO_2_LED 
+0x1B HCI_SET_TESTMODE_TYPE 
+0x1C HCI_WRITE_SCO_PCM_INT_PARAM 
+0x1D HCI_READ_SCO_PCM_INT_PARAM 
+0x1E HCI_WRITE_PCM_DATA_FORMAT_PARAM 
+0x1F HCI_READ_PCM_DATA_FORMAT_PARAM 
+0x20 HCI_WRITE_COMFORT_NOISE_PARAM 
+0x21 HCI_READ_COMFORT_NOISE_PARAM 
+0x22 HCI_WRITE_SCO_TS 
+0x23 HCI_READ_SCO_TS 
+0x24 HCI_WRITE_PCM_LOOPBACK_MODE 
+0x25 HCI_READ_PCM_LOOPBACK_MODE 
+0x26 HCI_SET_TRANSMIT_POWER 
+0x27 HCI_SET_SLEEPMODE_PARAM 
+0x28 HCI_READ_SLEEPMODE_PARAM 
+0x29 HCI_SLEEPMODE_CMD 
+0x2A HCI_DELAY_PERIPHERAL_SCO_STARTUP 
+0x2B HCI_WRITE_RECEIVE_ONLY 
+0x2C HCI_WRITE_RATE_CONTROL 
+0x2D HCI_TX_UNMOD_CARRIER 
+0x2E HCI_DOWNLOAD_MINIDRIVER 
+0x2F HCI_CRYSTAL_PPM 
+0x30 HCI_SET_POWER_AMP_BIAS 
+0x31 HCI_SET_HAM_BEHAVIOR 
+0x32 HCI_SET_AFH_BEHAVIOR 
+0x33 HCI_READ_USER_DEFINED_NVRAM 
+0x34 HCI_ENABLE_RADIO 
+0x35 HCI_READ_DIAGNOSTIC_INFO 
+0x36 HCI_GET_HID_DEVICE_LIST 
+0x37 HCI_ADD_HID_DEVICE 
+0x38 HCI_READ_APP_FW_CONFIG_VERSION 
+0x39 HCI_DELETE_HID_DEVICE 
+0x3B HCI_ENABLE_USB_HID_EMULATION 
+// 0x3A available
+// 0x3B available
+0x3C HCI_SEND_LMPDU 
+0x3D HCI_AUTO_PAIR_REQ 
+0x3E HCI_READ_VS_EXTENSION 
+0x3F HCI_WRITE_VS_EXTENSION 
+
+0x77 HCI_OPCODE_FC77
+0x79 HCI_OPCODE_FC79
+0xC4 HCI_DOWNLOAD_PATCH
+0xCC HCI_OPCODE_FCCC
+
+0x00 HCI_VENDOR_CMD_RESET
+0x01 HCI_VENDOR_CMD_CHIPID
+0x02 HCI_VENDOR_CMD_BAUD
+0x03 HCI_VENDOR_CMD_PATCH
+0x04 HCI_VENDOR_CMD_PATCH_DONE
+0x05 HCI_VENDOR_CMD_ECHO
+0x06 HCI_VENDOR_CMD_BDADDR
+
+0x07 HCI_VENDOR_CMD_ENTER_LPM
+0x08 HCI_VENDOR_CMD_COMMU_READY
+
+0x10 HCI_VENDOR_CMD_MEM
+0x11 HCI_VENDOR_CMD_EEP
+
+0X12 HCI_VENDOR_CMD_PATCH_SEC_INIT
+0X13 HCI_VENDOR_CMD_PATCH_SEC
+)
+
+//HCI LE controller command OCF values, OGF=8
+(
+0x01 HCI_LE_SET_EVENT_MASK
+0x02 HCI_LE_READ_BUFFER_SIZE
+0x03 HCI_LE_READ_LOCAL_SUPPORTED_FEATURES
+0x05 HCI_LE_SET_RANDOM_ADDRESS
+0x06 HCI_LE_SET_ADVERTISING_PARAMETERS
+0x07 HCI_LE_READ_ADVERTISING_CHANNEL_TX_POWER
+0x08 HCI_LE_SET_ADVERTISING_DATA
+0x09 HCI_LE_SET_SCAN_RESPONSE_DATA
+0x0A HCI_LE_SET_ADVERTISE_ENABLE
+0x0B HCI_LE_SET_SCAN_PARAMETERS
+0x0C HCI_LE_SET_SCAN_ENABLE
+0x0D HCI_LE_CREATE_CONNECTION
+0x0E HCI_LE_CREATE_CONNECTION_CANCEL
+0x0F HCI_LE_READ_WHITE_LIST_SIZE
+0x10 HCI_LE_CLEAR_WHITE_LIST
+0x11 HCI_LE_ADD_DEVICE_TO_WHITE_LIST
+0x12 HCI_LE_REMOVE_DEVICE_FROM_WHITE_LIST
+0x13 HCI_LE_CONNECTION_UPDATE
+0x14 HCI_LE_SET_HOST_CHANNEL_CLASSIFICATION
+0x15 HCI_LE_READ_CHANNEL_MAP
+0x16 HCI_LE_READ_REMOTE_USED_FEATURES
+0x17 HCI_LE_ENCRYPT
+0x18 HCI_LE_RAND
+0x19 HCI_LE_START_ENCRYPTION
+0x1A HCI_LE_LONG_TERM_KEY_REQUEST_REPLY
+0x1B HCI_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY
+0x1C HCI_LE_READ_SUPPORTED_STATES
+0x1D HCI_LE_RECEIVER_TEST
+0x1E HCI_LE_TRANSMITTER_TEST
+0x1F HCI_LE_TEST_END
+0x20 HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_REPLY
+0x21 HCI_LE_REMOTE_CONNECTION_PARAMETER_REQUEST_NEGATIVE_REPLY
+)
+// HCI event code
+(
+0x01 HCI_EVENT_INQUIRY_COMPLETE
+0x02 HCI_EVENT_INQUIRY_RESULT
+0x03 HCI_EVENT_CONNECTION_COMPLETE
+0x04 HCI_EVENT_CONNECTION_REQUEST
+0x05 HCI_EVENT_DISCONNECTION_COMPLETE
+0x06 HCI_EVENT_AUTHENTICATION_COMPLETE
+0x07 HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
+0x08 HCI_EVENT_ENCRYPTION_CHANGE_COMPLETE
+0x09 HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
+0x0A HCI_EVENT_MASTER_LINK_KEY_COMPLETE
+0x0B HCI_EVENT_READ_REMOTE_FEATURES_COMPLETE
+0x0C HCI_EVENT_READ_REMOTE_VERSION_INFORMATION_COMPLETE
+0x0D HCI_EVENT_QOS_SETUP_COMPLETE
+0x0E HCI_EVENT_COMMAND_COMPLETE
+0x0F HCI_EVENT_COMMAND_STATUS
+0x10 HCI_EVENT_HARDWARE_ERROR
+0x11 HCI_EVENT_FLUSH_OCCURRED
+0x12 HCI_EVENT_ROLE_CHANGE
+0x13 HCI_EVENT_NUM_COMPLETED_PACKETS
+0x14 HCI_EVENT_MODE_CHANGE
+0x15 HCI_EVENT_RETURN_LINK_KEYS
+0x16 HCI_EVENT_PIN_CODE_REQUEST
+0x17 HCI_EVENT_LINK_KEY_REQUEST
+0x18 HCI_EVENT_LINK_KEY_NOTIFICATION
+0x19 HCI_EVENT_LOOPBACK_COMMAND
+0x1A HCI_EVENT_DATA_BUFFER_OVERFLOW
+0x1B HCI_EVENT_MAX_SLOTS_CHANGE
+0x1C HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
+0x1D HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
+0x1E HCI_EVENT_QOS_VIOLATION
+0x1F HCI_EVENT_PAGE_SCAN_MODE_CHANGE
+0x20 HCI_EVENT_PAGE_SCAN_REPETITION_MODE_CHANGE
+0x21 HCI_EVENT_FLOW_SPECIFICATION_COMPLETE
+0x22 HCI_EVENT_INQUIRY_RESULT_WITHRSSI
+0x23 HCI_EVENT_READ_REMOTE_EXT_FEATURES_COMPLETE
+0x2C HCI_EVENT_SCO_CONNECTION_COMPLETE
+0x2D HCI_EVENT_SCO_CONNECTION_CHANGED
+0x2E HCI_EVENT_SNIFF_SUBRATING
+0x2F HCI_EVENT_EXT_INQUIRY_RESULT
+0x30 HCI_EVENT_ENCRYPT_KEY_REFRESH_COMPLETE
+0x31 HCI_EVENT_IO_CAP_REQ
+0x32 HCI_EVENT_IO_CAP_RESPONSE
+0x33 HCI_EVENT_USER_CONFIRMATION_REQUEST
+0x34 HCI_EVENT_UESR_PASSKEY_REQUEST
+0x35 HCI_EVENT_REMOTE_OOB_DATA_REQUEST
+0x36 HCI_EVENT_SIMPLE_PAIRING_COMPLETE
+0x38 HCI_EVENT_LINK_SUPERVISION_TIMEOUT_CHANGED
+0x39 HCI_EVENT_ENHANCED_FLUSH_COMPLETE
+0x3B HCI_EVENT_USER_PASSKEY_NOTIFICATION
+0x3C HCI_EVENT_KEYPRESS_NOTIFICATION
+0x3D HCI_EVENT_REMOTE_HOST_SUPPORTED_FEATURES_NOTIFICATION 
+0x3E HCI_EVENT_LE_META_EVENT
+0x40 HCI_EVENT_PHYSICAL_LINK_COMPLETE
+0x41 HCI_EVENT_CHANNEL_SELECTED
+0x42 HCI_EVENT_DISCONNECTION_PHYSICAL_LINK_COMPLETE
+0x43 HCI_EVENT_PHYSICAL_LINK_LOSS_EARLY_WARNING
+0x44 HCI_EVENT_PHYSICAL_LINK_RECOVERY
+0x45 HCI_EVENT_LOGICAL_LINK_COMPLETE
+0x46 HCI_EVENT_DISCONNECTION_LOGICAL_LINK_COMPLETE
+0x47 HCI_EVENT_FLOW_SPEC_MODIFY_COMPLETE
+0x48 HCI_EVENT_NUMBER_OF_COMPLETED_DATA_BLOCKS
+0x49 HCI_EVENT_AMP_START_TEST
+0x4A HCI_EVENT_AMP_TEST_END
+0x4B HCI_EVENT_AMP_RECEIVER_REPORT
+0x4C HCI_EVENT_SHORT_RANGE_MODE_CHANGE_COMPLETE
+0x4D HCI_EVENT_AMP_STATUS_CHANGE
+0x4E HCI_EVENT_TRIGGERED_CLOCK_CAPTURE
+0x4F HCI_EVENT_SYNCHRONIZATION_TRAIN_COMPLETE
+0x50 HCI_EVENT_SYNCHRONIZATION_TRAIN_RECEIVED
+0x51 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_RECEIVE
+0x52 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_TIMEOUT
+0x53 HCI_EVENT_TRUNCATED_PAGE_COMPLETE
+0x54 HCI_EVENT_SLAVE_PAGE_RESPONSE_TIMEOUT
+0x55 HCI_EVENT_CONNECTIONLESS_SLAVE_BROADCAST_CHANNEL_MAP_CHANGE
+0x56 HCI_EVENT_INQUIRY_RESPONSE_NOTIFICATION
+0x57 HCI_EVENT_AUTHENTICATED_PAYLOAD_TIMEOUT_EXPIRED
+
+0xFE HCI_EVENT_LOGO_TESTING
+0xFF HCI_EVENT_VENDOR_SPECIFIC
+)
+(
+0x01 HCI_VENDOR_EVENT_COMMU_READY
+)
+//HCI LE SUBEVENT CODE
+(
+0x01 HCI_LE_SUBEVENT_CONN_COMPLETE
+0x02 HCI_LE_SUBEVENT_ADV_REPORT
+0x03 HCI_LE_SUBEVENT_CONN_UPDATE_COMPLETE
+0x04 HCI_LE_SUBEVENT_REMOTE_FEATURE_COMPLETE
+0x05 HCI_LE_SUBEVENT_LTK_REQUEST
+0x06 HCI_LE_SUBEVENT_REMOTE_CONN_PARAM_REQ
+)
+
+(
+0x00 HCI_LPM_OFF
+0x01 HCI_LPM_ON
+)
+
+
+(
+33 HOST_WAKE_TIME
+)
+
+(
+1 HCI_RX_WAKE
+0 HCI_RX_READY
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/hid.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/hid.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/hid.format	(working copy)
@@ -0,0 +1,21 @@
+
+(
+/*HID TYPE*/
+0x01 HID_TYPE_CONTROL
+0x04 HID_TYPE_GET_REPORT
+0x05 HID_TYPE_SET_REPORT
+0x07 HID_TYPE_SET_PROTOCOL
+0x09 HID_TYPE_SET_IDLE
+0x0a HID_TYPE_DATA
+/*HID REPORT ID*/
+0x01 HID_REPORT_ID_KB
+
+0x00 HID_CONTROL_P_NOOPERATION
+0x01 HID_CONTROL_P_HARDRESET
+0x02 HID_CONTROL_P_SOFTRESET
+0x03 HID_CONTROL_P_SUSPEND
+0x04 HID_CONTROL_P_EXITSUSPEND
+0x05 HID_CONTROL_P_VIRTUALCABLEUNPLUG
+)
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/l2cap.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/l2cap.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/l2cap.format	(working copy)
@@ -0,0 +1,442 @@
+
+memalloc(
+0 mem_l2cap_mem_start
+// L2CAP RX 
+2 mem_l2cap_rxbuff1_len
+2 mem_l2cap_rxbuff2_len
+2 mem_l2cap_rxbuff_new
+1 mem_l2cap_rxbuff_inuse
+2 mem_l2cap_payload_ptr
+2 mem_l2cap_rx_pkt_length
+2 mem_l2cap_rx_cid
+1 mem_l2cap_rx_done
+
+
+
+// L2CAP TX Signal channel
+2 mem_l2cap_signal_tx_buff_ptr
+2 mem_l2cap_signal_tx_payload_ptr
+2 mem_l2cap_signal_tx_length
+// L2CAP TX SDP channel
+2 mem_sdp_tx_buff_ptr
+2 mem_sdp_tx_payload_ptr
+2 mem_sdp_tx_pkt_length
+// L2CAP TX RFCOMM channel
+2 mem_rfcomm_tx_buff_ptr
+2 mem_rfcomm_tx_payload_ptr
+2 mem_rfcomm_tx_pkt_length
+
+
+
+//L2CAP Util
+
+2 memL2CAP_T1
+
+1 mem_CONTROL_tasks
+1 mem_send_config_req
+
+
+1 mem_config_identifier
+2 mem_config_req_dest_CID
+1 mem_rfcomm_malloc_fail_flag
+
+//L2CAP STATE MACHINE
+1 mem_message_to_uppersm
+1 mem_upper_sm_remote_page
+1 mem_upper_sm_reconn
+1 mem_upper_sm_ss
+
+
+64 mem_tx_malloc_log
+0 mem_l2cap_mem_end
+
+
+2 mem_scid
+2 mem_cmd_length
+2 mem_tt2
+2 mem_tt3
+2 mem_id
+2 mem_psm
+
+
+4 mem_l2cap_sdpres_delay_time
+)
+
+xmemalloc(
+0 mem_l2cap_xmem_start
+//*******************L2CAP TX MULTI-PACKET*********************//
+2 mem_l2cap_tx_multi_offset //0 means single packet
+
+//*******************CHANNEL ID*********************//
+2 mem_sdp_remote_cid
+2 mem_rfcomm_remote_cid
+2 mem_hid_ctrl_remote_cid
+2 mem_hid_int_remote_cid
+//*******************CHANNEL STATE*********************//
+1 mem_sdp_state
+1 mem_rfcomm_state
+1 mem_hid_control_state
+1 mem_hid_interrupt_state
+1 mem_spp_state
+1 mem_ML2CAP_comm_id
+
+//*******************L2CAP malloc********************//
+1 mem_used_map
+0 mem_tx_fifo0
+1 mem_tx_fifo0_map
+2 mem_tx_fifo0_ptr
+0 mem_tx_fifo1
+1 mem_tx_fifo1_map
+2 mem_tx_fifo1_ptr
+0 mem_tx_fifo2
+1 mem_tx_fifo2_map
+2 mem_tx_fifo2_ptr
+0 mem_tx_fifo3
+1 mem_tx_fifo3_map
+2 mem_tx_fifo3_ptr
+0 mem_tx_fifo_end
+256 mem_l2cap_lpm_txbuf
+//*******************MISC*********************//
+1 mem_l2cap_flow_ctrl_flag
+1 mem_l2cap_pending_item
+0 mem_l2cap_xmem_end
+
+)
+
+
+//mem_l2cap_lpm_txbuf
+(
+256 l2cap_lpm_txbuf_len
+)
+
+(
+4 L2CAP_TX_FIFO_SIZE
+8 L2CAP_TX_BUFF_CNT
+
+)
+(
+0x0002 L2CAP_SIG_EXT_FEATRUE
+0x0003 L2CAP_SIG_FIX_FEATRUE
+)
+
+
+(
+0 HS_IDLE
+1 AG_INIT_CALL
+2 HS_INIT_CALL
+)
+(
+0 M_ACL_LINK_ABSENT
+1 M_ACL_LINK_EXIST
+)
+
+(
+0 L2CAP_INUSE_BUFF1
+1 L2CAP_INUSE_BUFF2
+)
+/* upper layer interface w/ lower layer */
+(
+1 MAX_NUM_LINKS_ALLOWED
+1 MAX_NUM_SCO_ALLOWED
+1 ACL_LINK_PRESENT
+0 ACL_LINK_ABSENT
+)
+(
+1 L2CAP_RX_DONE 
+0 L2CAP_RX_CLEAR
+)
+/* Scheduler */
+(
+0 L2CAP_DISCONNECT_INTERRUPT
+1 RFCOMM_wants_service
+2 L2CAP_sig_Tx_buff_full
+3 RFCOMM_Tx_buff_full
+4 SDP_Tx_buff_full
+5 got_complete_L2CAP_pkt	
+6 L2CAP_init_Config_Req
+7 L2CAP_DISCONNECT_CONTROL
+)
+
+/* mem_CONTROL_tasks2 */
+(
+0 UI_NEED_SERVICE
+)
+/* L2CAP logic channel identifiers (2 bytes) p.261 */
+(
+0x0001 L2CAP_signal_channel
+0x0050 L2CAP_SDP_channel
+0x0051 L2CAP_RFCOMM_channel
+0x0052 L2CAP_HID_Control_channel   
+0x0053 L2CAP_HID_Interrupt_channel
+0x0077 L2CAP_AVDTP_signal_channel		//------avdtp
+0x0078 L2CAP_AVDTP_media_channel
+0x0079 L2CAP_AVDTP_report_channel
+0x0080 L2CAP_AVDTP_recovery_channel
+0x00dd L2CAP_AVCTP_Control_channel
+)
+/* L2CAP signalling command codes (1 byte) p.284 */
+(
+0x00 reserved
+0x01 signal_cmd_reject
+0x02 signal_connect_req
+0x03 signal_connect_rsp
+0x04 signal_config_req
+0x05 signal_config_rsp
+0x06 signal_disconnect_req
+0x07 signal_disconnect_rsp
+0x08 signal_echo_req
+0x09 signal_echo_rsp
+0x0a signal_info_req
+0x0b signal_info_rsp
+)
+/* L2CAP signal_command_reject reason code (2 bytes), p.285 */
+(
+0x0000 cmd_not_understood
+0x0001 signalling_MTU_exceeded
+0x0002 invalid_CID_in_req
+)
+/* L2CAP PSM values used in signal_connect_req (2 bytes), p.286 */
+(
+0x0001 PSM_SDP
+0x0003 PSM_RFCOMM
+0x0005 PSM_TCS
+0x0011 PSM_HID_control
+0x0013 PSM_HID_interrupt
+0x0017 PSM_AVCTP
+0x0019 PSM_AVDTP
+)
+/* L2CAP connection response result code (2 bytes), p.288 */
+(
+0x0000 L2CAP_connect_successful
+0x0001 L2CAP_connect_pending
+0x0002 L2CAP_connect_refused_PSM_unsupported
+0x0003 L2CAP_connect_refused_security_block
+0x0004 L2CAP_connect_refused_no_resources
+)
+/* L2CAP connection status values (2 bytes), p.288 */
+(
+0x0000 L2CAP_no_info_available
+0x0001 L2CAP_authentication_pending
+0x0002 L2CAP_authorization_pending
+)
+/* L2CAP configuration response result code (2 bytes), p.292 */
+(
+0x0000 L2CAP_config_success
+0x0001 L2CAP_config_failure_bad_parameters
+0x0002 L2CAP_config_failure_no_reason
+0x0003 L2CAP_config_failure_unknown_options
+)
+/* L2CAP constant definitions */
+(
+128 L2CAP_Rx_buff_size
+48  L2CAP_signal_Tx_buff_size
+128 SDP_Tx_buff_size
+128 RFCOMM_Tx_buff_size
+1 AM_ADDRESS
+3 DM1TYPE
+4 DH1TYPE
+11 DH3TYPE
+8 DVTYPE
+0 channel_state_closed
+1 channel_state_config
+2 channel_state_open
+0x0030 L2CAP_config_MTU_SDP
+0xffff L2CAP_config_ftimeout_SDP
+0x03e3 L2CAP_config_MTU_RFCOMM
+0xffff L2CAP_config_ftimeout_RFCOMM
+260 l2cap_max_pkt_len
+)
+
+(
+0 FAILURE
+1 SUCCESS
+2 IN_PROGRESS
+)
+(
+0x00	IDLE
+0x01	WAIT_4_BB_PAGE
+0x02	WAIT_4_LMP_CONN
+0x03	WAIT_4_SCO_CONN
+0x04	WAIT_4_SCO_KILLED
+)
+
+/*mem_master_mss*/
+(
+0 STOP_ENC
+1 SEND_SWITCH_REQ
+)
+(
+0 HF_HS_READY
+1 HF_AG_READY
+)
+/* mem_hf_state */
+(
+0 HF_STATE_WAITING_RFCOMM_CONN
+1 HF_STATE_HF_SEND_FEATURE
+2 HF_STATE_WAITING_AG_FEATURE_OK
+3 HF_STATE_HF_SEND_INDICATORS
+4 HF_STATE_WAITING_AG_INDICATORS_OK
+5 HF_STATE_HF_SEND_CURR_STATUS
+6 HF_STATE_WAITING_AG_STATUS_OK
+7 HF_STATE_HF_SEND_UPDATE_STATUS
+8 HF_STATE_WAITING_AG_UPDATE_STATUS_OK
+9 HF_STATE_CONNECTED
+0x0a HF_STATE_HF_SEND_RECEIVE_INFO
+0x0b HF_STATE_WAITING_AG_INFO
+0x0c HF_STATE_HF_SEND_AT_CLIP
+0x0d HF_STATE_WAITING_AT_CLIP
+0x0e HF_STATE_HF_SEND_AT_CCWA
+0x0f HF_STATE_WAITING_AT_CCWA
+)
+/*mem_hf_call_state*/
+(
+0 HF_CALL_STATE_INACTIVE
+1 HF_CALL_STATE_SETUP
+2 HF_CALL_STATE_ACTIVE 
+)
+/* mem_pairing_state bit definition */
+(
+0 PAIR_INQUIRY_START
+1 PAIR_INQUIRY_TIME_OUT
+2 PAIR_INQUIRY_FAILED
+3 PAIR_INQUIRY_SUCCESS
+4 PAIR_READY_CONN
+5 PAIR_WAIT_CANCEL_RESPONSE
+6 PAIR_CONN_SUCCESS
+7 PAIR_WAIT_DETACH
+)  
+
+/* mem_pairing_mode bit definition */
+(
+0 FORCE_AUTHENTICATION
+)
+/* mem_hid_protecol_type */
+(
+0 PROTECOL_BOOT /*default*/
+1 PROTECOL_REPORT
+)
+
+/* mem_upper_sm_reconn */
+(
+1 UPPERSM_SEND_SDP_CONN_REQ
+2 UPPERSM_SEND_SDP_CFG_REQ
+3 UPPERSM_SEND_SDP_HF_SS
+4 UPPERSM_SEND_SDP_DISC_REQ
+5 UPPERSM_SEND_RFCOMM_CONN_REQ
+6 UPPERSM_SEND_RFCOMM_CFG_REQ
+7 UPPERSM_SEND_SABM_CMD
+8 UPPERSM_SEND_DISC
+9 UPPERSM_SEND_WAIT
+10 UPPERSM_SEND_HID_CONTROL_CONN_REQ
+11 UPPERSM_SEND_HID_CONTROL_CFG_REQ
+12 UPPERSM_SEND_HID_INTERRUPT_CONN_REQ
+13 UPPERSM_SEND_HID_INTERRUPT_CFG_REQ
+14 UPPERSM_SEND_SDP_HS_SS
+15 UPPERSM_SEND_SDP_PBAP_SS
+16 UPPERSM_SEND_SDP_AVTARG_SS
+)
+/* mem_upper_sm_remote_page */
+(
+1 UPPERSM_RP_SEND_SDP_CONN_REQ
+2 UPPERSM_RP_SEND_SDP_CFG_REQ
+3 UPPERSM_RP_SEND_SDP_HF_SS
+4 UPPERSM_RP_SEND_SDP_HS_SS
+5 UPPERSM_RP_SEND_SDP_PBAP_SS
+6 UPPERSM_RP_SEND_SDP_AVTARG_SS
+7 UPPERSM_RP_SEND_SDP_DISC_REQ
+8 UPPERSM_RP_SEND_AVCTP_CONN_REQ
+9 UPPERSM_RP_SEND_AVCTP_CFG_REQ
+)
+
+/* mem_ML2CAP_flag */
+(
+0 MSCHEDULER_HID_CONTROL_CONN_DONE
+1 MSCHEDULER_HID_INTERRUPT_CONN_DONE
+2 MSCHEDULER_HID_CONTROL_CFG_REQ_DONE
+3 MSCHEDULER_HID_CONTROL_CFG_RSP_DONE
+4 MSCHEDULER_HID_INTERRUPT_CFG_REQ_DONE
+5 MSCHEDULER_HID_INTERRUPT_CFG_RSP_DONE
+6 MSCHEDULER_HID_CONTROL_DISC_DONE
+7 MSCHEDULER_HID_INTERRUPT_DISC_DONE
+)
+/*    ui event    --add by lj*/
+(
+0x00 UI_DATA_EVNET_NONE
+0x01 UI_DATA_EVNET_HID
+0x02 UI_DATA_EVNET_AVDTP_S
+0x03 UI_DATA_EVNET_AVDTP_M
+0x04 UI_DATA_EVNET_AVCTP
+0x05 UI_DATA_EVNET_HS
+0x06 UI_DATA_EVNET_HF
+0x07 UI_DATA_EVNET_SPP
+0x08 UI_DATA_EVNET_OBEX
+)
+/*    ui ack --add by lj*/
+(
+0x00 UI_DATA_TX_NONE
+0x01 UI_DATA_TX_HID
+0x02 UI_DATA_TX_AVDTP_S
+0x03 UI_DATA_TX_AVDTP_M
+0x04 UI_DATA_TX_AVCTP
+0x05 UI_DATA_TX_HS
+0x06 UI_DATA_TX_HF
+0x07 UI_DATA_TX_SPP
+0x08 UI_DATA_TX_OBEX
+0x10 ACL_TX_L2CAP_SIGNAL
+0x11 ACL_TX_SDP
+0x12 ACL_TX_RFCOMM
+
+)
+
+(
+0 L2CAP_SDP_interface_conn
+1 L2CAP_SDP_interface_cfg
+)
+
+(                                   
+0 L2CAP_CHANNEL_STATE_CONN_REQ      
+1 L2CAP_CHANNEL_STATE_CONN_RES      
+2 L2CAP_CHANNEL_STATE_SND_CFG_REQ   
+3 L2CAP_CHANNEL_STATE_SND_CFG_RES   
+4 L2CAP_CHANNEL_STATE_RCV_CFG_REQ   
+5 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+6 L2CAP_CHANNEL_RFCOMM_ONLY_SABM
+7 L2CAP_CHANNEL_RFCOMM_ONLY_UA
+6 L2CAP_CHANNEL_AVDTP_SIGNAL_INIT //set avdtp init complete
+6 L2CAP_CHANNEL_HID_HANDSHAKE_DONE
+0x3f L2CAP_CHANNEL_SETUP_COMPLETE
+0x7f L2CAP_CHANNEL_AVDTP_SIGNAL_COMPLETE
+0xff L2CAP_CHANNEL_RFCOMM_DLCI0_OPENED
+)                                     
+
+/*  AVDTP---lj*/
+(
+0 L2CAP_AVDTP_SIGNAL_CONNECT
+1 L2CAP_AVDTP_SIGNAL_CONFIG
+2 L2CAP_AVDTP_MEDIA_CONNECT
+3 L2CAP_AVDTP_MEDIA_CONFIG
+4 L2CAP_AVDTP_REPORT_CONNECT
+5 L2CAP_AVDTP_REPORT_CONFIG
+6 L2CAP_AVDTP_RECOVERY_CONNECT
+7 L2CAP_AVDTP_RECOVERY_CONFIG
+)
+/*  AVCTP---lj*/
+(
+0 L2CAP_AVCTP_SIGNAL_CONNECT
+1 L2CAP_AVCTP_SIGNAL_CONFIG
+)
+
+127 L2CAP_SIGNAL_MALLOC_SIZE
+
+//1 mem_rfcomm_malloc_fail_flag
+(
+0 RFCOMM_MALLOC_SUCCEED
+1 RFCOMM_MALLOC_FAIL
+)
+
+//mem_l2cap_flow_ctrl_flag
+(
+0 L2CAP_FLOW_CTRL_DISABLE
+1 L2CAP_FLOW_CTRL_ENABLE
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/le.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/le.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/le.format	(working copy)
@@ -0,0 +1,722 @@
+
+memalloc(
+56 mem_le_rxbuf
+262 mem_le_l2capbuf
+
+
+/* security temp */
+4 mem_le_mic
+4 mem_le_peer_mic
+//8 mem_le_skdm
+//8 mem_le_skds
+16 mem_le_peer_ltk
+16 mem_le_mrand
+
+
+/* ========= le context =========== */
+1 mem_le_state
+1 mem_le_mode
+2 mem_le_tsniff
+4 mem_le_anchor
+6 mem_le_clk_offset
+2 mem_le_receive_window
+6 mem_le_plap
+1 mem_le_conn_handle
+1 mem_le_arq
+1 mem_le_ch
+1 mem_le_hop
+2 mem_le_event_count
+4 mem_le_supervision_timer
+2 mem_le_instant
+1 mem_le_channels
+1 mem_le_op
+
+	/* these 3 should NOT be seperated */
+4 mem_le_access
+3 mem_le_crcinit
+1 mem_le_window_size
+
+	/* these 3 should NOT be seperated */
+2 mem_le_slave_latency
+2 mem_le_superto
+5 mem_le_channel_map
+
+2 mem_le_no_using
+1 mem_le_peer_sca
+
+/* should be together */
+1 mem_le_att_opcode
+2 mem_le_att_handle
+
+1 mem_le_err_code
+1 mem_le_ll_pairing_fail_reason
+
+16 mem_le_sk
+
+/* test */
+1 mem_le_testtype
+2 mem_le_test_sync
+2 mem_le_test_pcnt
+
+6 mem_le_rxon_ts
+
+1 mem_le_rx_ll_opcode
+
+2 mem_le_notify_attr_start
+1 mem_le_notify_len
+
+1 mem_cmd_le_create_conn
+
+2 mem_le_cur_attlist_start_ptr
+2 mem_le_cur_handle_start
+2 mem_le_cur_handle_end
+1 mem_le_cur_uuid_length
+16 mem_le_cur_uuid
+
+1 mem_le_curr_att_len
+1 mem_le_search_res
+
+1 mem_le_continue_type
+
+)
+
+
+xmemalloc(
+2 mem_le_dsniff
+
+// parameters
+2 mem_le_conn_interval
+1 mem_le_scan_enable
+2 mem_le_scan_interval
+2 mem_le_scan_window
+
+1 mem_le_adv_enable
+1 mem_le_adv_data_len
+31 mem_le_adv_data
+1 mem_le_scan_data_len
+31 mem_le_scan_data
+
+//modified name
+1 mem_le_name_len
+30 mem_le_name
+
+
+5 mem_le_new_map
+0 mem_le_new_param
+1 mem_le_new_transmitwindowsize
+2 mem_le_new_transmitwindowoffset
+2 mem_le_new_conninterval
+2 mem_le_new_connslavelatency
+2 mem_le_new_connsupervisiontimeout
+
+1 mem_le_txheader
+1 mem_le_txlen
+2 mem_le_txpayload
+2 mem_le_txcid
+1 mem_le_l2cap
+1 mem_le_l2cap_response
+31 mem_le_txbdy
+
+/* smp related */
+5 mem_le_pcnt_tx
+5 mem_le_pcnt_rx
+4 mem_le_last_mic
+4 mem_le_ivm
+4 mem_le_ivs
+16 mem_le_ltk
+1 mem_ltk_exists
+16 mem_le_rconfirm
+16 mem_le_srand
+1 mem_le_iat
+1 mem_le_rat
+1 mem_le_preq
+1 mem_le_preq_iocap
+1 mem_le_preq_oob
+1 mem_le_preq_auth
+1 mem_le_preq_max_keysize
+1 mem_le_preq_init_key_distribution
+1 mem_le_preq_resp_key_distribution
+1 mem_le_pres
+1 mem_le_pres_iocap
+1 mem_le_pres_oob
+1 mem_le_pres_auth
+1 mem_le_pres_max_keysize
+1 mem_le_pres_init_key_distribution
+1 mem_le_pres_resp_key_distribution
+
+/* att related */
+2 mem_le_search_handle_start
+2 mem_le_search_handle_end
+0 mem_le_att_offset
+1 mem_le_search_att_type_length
+16 mem_le_search_att_type
+2 mem_le_notify_handle
+1 mem_le_search_uuid_length
+16 mem_le_search_uuid
+
+
+//START of LE adv parameter structure
+0 mem_le_adv_param
+2 mem_le_adv_interval
+1 mem_le_adv_type
+1 mem_le_adv_own_addr_type
+1 mem_le_adv_direct_addr_type
+6 mem_le_adv_direct_addr
+1 mem_le_adv_channel_map
+//END of LE adv parameter structure
+
+//START of LE conn parameter structure
+0 mem_le_conn_param
+1 mem_le_conn_peer_addr_type
+6 mem_le_conn_peer_addr
+1 mem_le_conn_own_addr_type
+2 mem_le_interval_min
+2 mem_le_interval_max
+2 mem_le_latency
+2 mem_le_timeout
+//START of LE conn parameter structure
+
+//START of LE scan parameter structure
+0 mem_le_scan_params
+1 mem_le_scan_type
+1 mem_le_scan_own_addr_type
+//END of LE scan parameter structure
+
+3 mem_le_lap
+1 mem_le_uap
+2 mem_le_nap
+
+
+2 mem_le_local_mtu
+2 mem_le_remote_mtu
+
+8 mem_le_skdm
+8 mem_le_skds
+
+2 mem_le_init_superto
+2 mem_ui_le_uuid_table
+
+1 mem_le_secure_connect_enable
+1 mem_le_secure_connect_flag
+1 mem_le_sc_calc
+1 mem_le_secure_connect_state
+1 mem_le_sc_confirm_gkey_flag
+1 mem_le_sc_local_key_invalid
+
+
+1 mem_le_pairing_state
+1 mem_le_enc_state
+1 mem_le_pairing_mode
+4 mem_le_tk
+2 mem_le_ediv
+8 mem_le_rand
+16 mem_le_irk
+
+//LE attribute list
+4 mem_le_transmit_window
+
+//ble General configuration 
+1 mem_le_configuration
+16 mem_le_fixed_ltk
+2 mem_le_pairing_handle
+
+//for continue
+2 mem_le_l2cap_size
+1 mem_le_packet_len_recved
+
+//for fifo
+1 mem_le_tx_buff_used
+2 mem_le_tx_ptr0
+2 mem_le_tx_ptr1
+2 mem_le_tx_ptr2
+2 mem_le_tx_ptr3
+
+//ble gatt signaling
+1 mem_le_signaling_identifier
+2 mem_le_l2cap_signaling_conn_param_update_rsp_result
+
+1 mem_le_packet_size
+1 mem_le_packet_llid
+2 mem_le_payload_ptr
+
+1 mem_le_md_count
+
+)
+
+
+(
+0x000001 param_le_features
+
+1636 param_sifs
+0x1e0 param_clke_cal_le
+0xa0 param_le_sca
+)
+
+(
+0 DEFAULT_STATES
+1 IPHONE_LOST_LTK
+2 MODULE_LOST_LTK
+3 LTK_NOT_LOST
+)
+
+
+(
+27 LE_MAX_PAKET_LEN
+)
+
+/* advertising channel PDU type */
+(
+0 ADV_IND
+1 ADV_DIRECT_IND
+2 ADV_NONCONN_IND
+3 SCAN_REQ
+4 SCAN_RSP
+5 CONNECT_REQ
+6 ADV_SCAN_IND
+)
+
+(
+0x01	GAP_ADTYPE_FLAGS
+0x02	GAP_ADTYPE_16BIT_MORE
+0x03	GAP_ADTYPE_16BIT_COMPLETE
+0x04	GAP_ADTYPE_32BIT_MORE
+0x05	GAP_ADTYPE_32BIT_COMPLETE
+0x06	GAP_ADTYPE_128BIT_MORE
+0x07	GAP_ADTYPE_128BIT_COMPLETE
+0x08	GAP_ADTYPE_LOCAL_NAME_SHORT
+0x09	GAP_ADTYPE_LOCAL_NAME_COMPLETE
+0x0a	GAP_ADTYPE_POWER_LEVEL
+0xff	GAP_ADTYPE_MANUFACTURER_SPECIFIC
+)
+
+
+	/* LE control packet type */
+	(
+	0x00 LL_CONNECTION_UPDATE_REQ
+	0x01 LL_CHANNEL_MAP_REQ
+	0x02 LL_TERMINATE_IND
+	0x03 LL_ENC_REQ
+	0x04 LL_ENC_RSP
+	0x05 LL_START_ENC_REQ
+	0x06 LL_START_ENC_RSP
+	0x07 LL_UNKNOWN_RSP
+	0x08 LL_FEATURE_REQ
+	0x09 LL_FEATURE_RSP
+	0x0A LL_PAUSE_ENC_REQ
+	0x0B LL_PAUSE_ENC_RSP
+	0x0C LL_VERSION_IND
+	0x0D LL_REJECT_IND
+	0x0E LL_SLAVE_FEATURE_REQ
+	0x0F LL_CONNECTION_PARAM_REQ
+	0x10 LL_CONNECTION_PARAM_RSP
+	0x11 LL_REJECT_IND_EXT
+	0x12 LL_PING_REQ
+	0x13 LL_PING_RSP
+	)
+
+	/* Security Manager Protocol Code */
+	(
+	0x01 SMP_PAIRING_REQUEST
+	0x02 SMP_PAIRING_RESPONSE
+	0x03 SMP_PAIRING_CONFIRM
+	0x04 SMP_PAIRING_RANDOM
+	0x05 SMP_PAIRING_FAILED
+	0x06 SMP_ENCRYPTION_INFORMATION
+	0x07 SMP_MASTER_IDENTIFICATION
+	0x08 SMP_IDENTITY_INFORMATION
+	0x09 SMP_IDENTITY_ADDRESS_INFORMATION
+	0x0A SMP_SIGNING_INFORMATION
+	0x0B SMP_SECURITY_REQUEST
+	0x0c SMP_PAIRING_PUBLIC_KEY
+	0x0d SMP_PAIRING_DHKEY_CHECK
+	)
+
+	/* L2CAP Signaling OPCODE */
+	(
+	0x12 L2CAP_CONNECTION_PARAMETER_UPDATE_REQUEST
+	0x13 L2CAP_CONNECTION_PARAMETER_UPDATE_RESPONSE
+	)
+
+	/* ATT OPCODE */
+	(
+	0x01 ATTOP_ERROR_RESPONSE
+	0x02 ATTOP_EXCHANGE_MTU_REQUEST
+	0x03 ATTOP_EXCHANGE_MTU_RESPONSE
+	0x04 ATTOP_FIND_INFORMATION_REQUEST
+	0x05 ATTOP_FIND_INFORMATION_RESPONSE
+	0x06 ATTOP_FIND_BY_TYPE_VALUE_REQUEST
+	0x07 ATTOP_FIND_BY_TYPE_VALUE_RESPONSE
+	0x08 ATTOP_READ_BY_TYPE_REQUEST
+	0x09 ATTOP_READ_BY_TYPE_RESPONSE
+	0x0A ATTOP_READ_REQUEST
+	0x0B ATTOP_READ_RESPONSE
+	0x0C ATTOP_READ_BLOB_REQUEST
+	0x0D ATTOP_READ_BLOB_RESPONSE
+	0x0E ATTOP_READ_MULTIPLE_REQUEST
+	0x0F ATTOP_READ_MULTIPLE_RESPONSE
+	0x10 ATTOP_READ_BY_GROUP_TYPE_REQUEST
+	0x11 ATTOP_READ_BY_GROUP_TYPE_RESPONSE
+	0x12 ATTOP_WRITE_REQUEST
+	0x13 ATTOP_WRITE_RESPONSE
+	0x16 ATTOP_PREPARE_WRITE_REQUEST
+	0x17 ATTOP_PREPARE_WRITE_RESPONSE
+	0x18 ATTOP_EXECUTE_WRITE_REQUEST
+	0x19 ATTOP_EXECUTE_WRITE_RESPONSE
+	0x1B ATTOP_HANDLE_VALUE_NOTIFICATION
+	0x1D ATTOP_HANDLE_VALUE_INDICATION
+	0x1E ATTOP_HANDLE_VALUE_CONFIRMATION
+	0x52 ATTOP_WRITE_COMMAND
+	0xD2 ATTOP_SIGNED_WRITE_COMMAND
+	0x1f ATTOP_CONTINUE
+	0x9e EMPTY_LE_DATA_PRE
+	0x9f EMPTY_LE_DATA
+	)
+
+	/* ATT error code */
+	(
+	0x01 ATT_ERR_INVALID_HANDLE
+	0x02 ATT_ERR_READ_NOT_PERMITTED
+	0x03 ATT_ERR_WRITE_NOT_PERMITTED
+	0x04 ATT_ERR_INVALID_PDU
+	0x05 ATT_ERR_INSUFFICIENT_AUTHENTICATION
+	0x06 ATT_ERR_REQUEST_NOT_SUPPORTED
+	0x07 ATT_ERR_INVALID_OFFSET
+	0x08 ATT_ERR_INSUFFICIENT_AUTHORIZATION
+	0x09 ATT_ERR_PREPARE_QUEUE_FULL
+	0x0A ATT_ERR_ATTRIBUTE_NOT_FOUND
+	0x0B ATT_ERR_ATTRIBUTE_NOT_LONG
+	0x0C ATT_ERR_INSUFFICIENT_ENCRYPTION_KEY_SIZE
+	0x0D ATT_ERR_INVALID_ATTRIBUTE_VALUE_LENGTH
+	0x0E ATT_ERR_UNLIKELY_ERROR
+	0x0F ATT_ERR_INSUFFICIENT_ENCRYPTION
+	0x10 ATT_ERR_UNSUPPORTED_GROUP_TYPE
+	0x11 ATT_ERR_INSUFFICIENT_RESOURCES
+	)
+	/*	SERVICE UUID	*/
+	(
+	0x1800 UUID_SERVICE_GENERIC_ACC
+	0x1801 UUID_SERVICE_GENERIC_ATT
+	0x180a UUID_SERVICE_DEVICE_INFO
+	0x180f UUID_SERVICE_BATTERY
+	0x1812 UUID_SERVICE_HIDS
+	0x2800 UUID_GATT_PRIMARY_SERVICE
+	0x2801 UUID_GATT_SECONDARY_SERVICE
+	0X2802 UUID_GATT_INCLUDE
+	0X2803 UUID_GATT_CHARACTERISTIC
+	0X2A00 UUID_CHRCTR_DEVICE_NAME
+	0X2A19 UUID_CHRCTR_BATTERY_LEVEL
+	0X2A22 UUID_CHRCTR_KEYBOARD_INPUT
+	0X2A23 UUID_CHRCTR_SYSTEM_ID 
+	0X2A25 UUID_CHRCTR_SERIAL_NUMBER
+	0X2A26 UUID_CHRCTR_FIRMWARE
+	0X2A32 UUID_CHRCTR_KEYBOARD_OUTPUT
+	0X2A33 UUID_CHRCTR_MOUSE_INPUT
+	0X2A4A UUID_CHRCTR_HID_INFO
+	0X2A4B UUID_CHRCTR_REPORT_MAP
+	0X2A4C UUID_CHRCTR_HID_CTRL_POINT
+	0X2A4D UUID_CHRCTR_REPORT
+	0X2A4E UUID_CHRCTR_PROTOCOL_MODE
+	)
+
+	(// pairing failed reason
+	0x00 PAIRING_FAILED_RESERVED
+	0X01 PAIRING_FAILED_PASSKEY_ENTRY_FAILED
+	0X02 PAIRING_FAILED_OOB_NOT_AVAILABLE
+	0X03 PAIRING_FAILED_AUTHENTICATION_REQUIRE
+	0X04 PAIRING_FAILED_CONFIRM_VALUE_FAILED
+	0X05 PAIRING_FAILED_PAIRING_NOT_SUPPORTED
+	0X06 PAIRING_FAILED_ENCRYPTION_KEY_SIZE
+	0X07 PAIRING_FAILED_COMMAND_NOT_SUPPORTED
+	0X08 PAIRING_FAILED_UNSPECIFIED_REASON
+	0X09 PAIRING_FAILED_REPEATED_ATTEMPTS
+	0X0A PAIRING_FAILED_INVALID_PARAMETERS
+	0X0B PAIRING_FAILED_DHKEY_CHECK_FAILED
+	0X0C PAIRING_FAILED_NUMERIC_COMPARISON_FAILED
+	0X0D PAIRING_FAILED_BR_EDR_PAIRING_IN_PROGRESS
+	0X0E PAIRING_FAILED_KEY_DERIVATION_GENERATION_NOT_ALLOWED
+	)
+
+
+	//BLE ErrorCodes
+	(    
+	0x01 ERROR_UNKNOWN_HCI_COMMAND
+	0x02 ERROR_NO_CONNECTION
+	0x03 ERROR_HARDWARE_FAILURE
+	0x04 ERROR_PAGE_TIMEOUT
+	0x05 ERROR_AUTHENTICATION_FAILURE
+	0x06 ERROR_KEY_MISSING
+	0x07 ERROR_MEMORY_FULL
+	0x08 ERROR_CONNECTION_TIMEOUT
+	0x09 ERROR_MAX_CONNECTIONS
+	0x0A ERROR_MAX_SCO_CONNECTIONS
+	0x0B ERROR_MAX_ACL_CONNECTIONS
+	0x0C ERROR_COMMAND_DISALLOWED
+	0x0D ERROR_HOST_REJECT_LIMITED_RESOURCES
+	0x0E ERROR_HOST_REJECT_SECURITY_REASONS
+	0x0F ERROR_HOST_REJECT_REMOTE_IS_ONLY_PERSONAL
+	0x10 ERROR_HOST_TIMEOUT
+	0x11 ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE
+	0x12 ERROR_INVALID_HCI_COMMAND_PARAMETERS
+	0x13 ERROR_REMOTE_USER_TERMINATED_CONNECTION
+	0x14 ERROR_REMOTE_LOW_RESOURCES
+	0x15 ERROR_REMOTE_POWERING_OFF
+	0x16 ERROR_CONNECTION_TERMINATED_BY_LOCAL_HOST
+	0x17 ERROR_REPEATED_ATTEMPTS
+	0x18 ERROR_PAIRING_NOT_ALLOWED
+	0x19 ERROR_UNKNOWN_LMP_PDU
+	0x1A ERROR_UNSUPPORTED_REMOTE_FEATURE
+	0x1B ERROR_SCO_OFFSET_REJECTED
+	0x1C ERROR_SCO_INTERVAL_REJECTED
+	0x1D ERROR_SCO_AIR_MODE_REJECTED
+	0x1E ERROR_INVALID_LMP_PARAMETER
+	0x1F ERROR_UNSPECIFIED_ERROR
+	0x20 ERROR_UNSUPPORTED_LMP_PARAMETER_VALUE
+	0x21 ERROR_ROLE_CHANGE_NOT_ALLOWD
+	0x22 ERROR_LMP_RESPONSE_TIMEOUT
+	0x23 ERROR_ERROR_TRANSACTION_COLLISION
+	0x24 ERROR_LMP_PDU_NOT_ALLOWED
+	0x25 ERROR_ENCRYPTION_MODE_NOT_ACCEPTABLE
+	0x26 ERROR_UNIT_KEY_USED
+	0x27 ERROR_QOS_NOT_SUPPORTED
+	0x28 ERROR_INSTANT_PASSED
+	0x29 ERROR_PAIRING_W_UNIT_KEY_NOT_SUPPORTED
+	0x2a ERROR_DIFFERENT_TRANSACTION_COLLISION
+	0x2c ERROR_QOS_UNACCEPTABLE_PARAMETER
+	0x2d ERROR_QOS_REJECTED
+	0x2e ERROR_CHANNEL_CLASSIFICATION_NOT_SUPPORTED
+	0x2f ERROR_INSUFFICIENT_SECURITY
+	0x30 ERROR_PARAMETER_OUT_OF_MANDATORY_PANGE
+	0x32 ERROR_ROLE_SWITCH_PENDING
+	0x34 ERROR_RESERVED_SLOT_VIOLATION
+	0x35 ERROR_ROLE_SWITCH_FAILED
+	0x36 ERROR_EXTENDED_INQUIRY_RESPONSE_TOO_LARGE
+	0x37 ERROR_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST
+	0x38 ERROR_HOST_BUSY_PAIRING
+	)
+
+
+	//modified_name
+	(
+	0x14 MAX_NAME_LEN
+	0x16 ADV_DATA_NAME_LEN
+	0X20 SPACE
+	
+	)
+	/* GATT Specifications*/
+	(
+	0X2900 CHARACTERTIC_EXTENDED_PROPERTIES
+	0X2901 CHARACTERTIC_USER_DESCRIPTION
+	0X2902 CLIENT_CHARACTERTIC_CONFIGURATION
+	0X2903 SERVER_CHARACTERTIC_CONFIGURATION
+	0X2904 CHARACTERTIC_PRESENTATION_FORMAT
+	0X2905 CHARACTERTIC_AGGREGATE
+	0X2906 VALID_RANGE
+	0X2907 EXTERNAL_REPORT_REFERENCE
+	0X2908 REPORT_REFERENCE
+	0X290B ENVIR_SENSING_CONFIGURATION
+	0X290C ENVIR_SENSING_MEASUREMENT
+	0X290D ENVIR_SENSING_TRIGGER_SETTING
+	)
+	/* LE L2CAP CID */
+	(
+	0x0004 LE_L2CAP_CID_ATT
+	0x0005 LE_L2CAP_CID_SIGNAL
+	0x0006 LE_L2CAP_CID_SMP
+	)
+
+	//LE address type
+	(
+	0 LE_ADDR_TYPE_PUBLIC
+	1 LE_ADDR_TYPE_RANDOM
+	)
+	//LE address type bitmap
+	(
+	7 LE_RECEIVER_ADDR_BIT
+	6 LE_SENDER_ADDR_BIT
+	)
+	//LE SCAN TYPE
+	(
+	0x00 LE_SCAN_TYPE_PASSIVE //no SCAN_REQ shall be sent
+	0x01 LE_SCAN_TYPE_ACTIVE
+	)
+
+	//LE SCAN ENABLE
+	(
+	0x00 LE_SCAN_DISABLE
+	0x01 LE_SCAN_ENABLE
+	0x0101 LE_ACTIVE_SCAN_ENABLE
+	)
+
+	//LE FIND INFORMATION RESPONSE
+	//THE FORMAT OF THE INFORMATION DATA
+	(
+	0x01 UUID_SIZE_16BIT
+	0x02 UUID_SIZE_128BIT
+	)
+
+	(
+	0x0000 BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_ACCEPTED
+	0x0001 BLE_SIGNALING_CONNECT_PARAMETER_UPDATE_REJECTED
+	)
+
+//	le_state_map 0-2 is reserved for state_inconn,state_insniff and state_sco
+(
+3 lestate_got_first_packet
+4 lestate_encryption
+5 lestate_update_param
+6 lestate_update_map
+)
+
+// 	le mode
+(
+0 lemode_idle
+1 lemode_slave
+3 lemode_master
+)
+
+
+(
+0x01 LLID_CONTINUE
+0x02 LLID_START
+0x03 LLID_LE_LL
+0x01 LLID_EMPTY
+)
+
+(
+4 LE_TX_BUFF_COUNT
+3 LE_TX_BUFF_UPDATE_LOOPCNT //LE_TX_BUFF_COUNT-1
+
+12 LE_MD_MAX_COUNT
+)
+
+
+(
+0 LE_INITATOR_LTK_BIT
+1 LE_INITATOR_IRK_BIT
+2 LE_INITATOR_CSRK_BIT
+)
+
+(
+0x00 LE_PAIRING_MODE_NONE
+0x01 LE_PAIRING_MODE_LAGACY_JUSTWORK
+0x02 LE_PAIRING_MODE_LAGACY_PASSKEY
+0x81 LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK
+0x82 LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC
+0x83 LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY
+
+7 LE_PAIRING_MODE_SECURE_CONNECT_BIT
+)
+
+
+(
+0 FLAG_IOCAP_DISPLAYONLY
+1 FLAG_IOCAP_DISPLAYYESNO
+2 FLAG_IOCAP_KEYBOARDONLY
+3 FLAG_IOCAP_NOINPUTNOOUTPUT
+4 FLAG_IOCAP_KEYBOARDDISPLAY
+
+0x00 FLAG_OOB_DATA_FLAG_NO
+)
+
+(
+0x00 FLAG_LE_NO_BONDING_NO_MITM
+0x01 FLAG_LE_BONDING_NO_MITM
+0x04 FLAG_LE_NO_BONDING_MITM
+0x05 FLAG_LE_BONDING_MITM
+0x09 FLAG_LE_BONDING_NO_MITM_SECURE
+0x0D FLAG_LE_BONDING_MITM_SECURE
+
+2 LE_AUTH_MITM_BIT
+3 LE_AUTH_SECURE_CONNECTION_PAIRING_BIT
+)
+
+(
+0  LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND
+1  LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE
+2  LE_FIND_BY_TYPE_VAL_RES_FOUND_ENDING_HANDLE
+
+)
+
+(
+0 MASTER_PUBLIC_ADDR
+1 MASTER_RANDOM_ADDR
+)
+
+(
+0x06 LE_ERR_PIN_OR_KEY_MISSING
+)
+
+
+(
+96000 TIMER_SMP_PAIRING_TIMEOUT //30S
+)
+//mem_le_pairing_state
+(
+0 FLAG_LE_PAIRING_NULL
+1 FLAG_LE_PAIRING_START
+2 FLAG_LE_PAIRING_SEND_RECURITY_REQ
+3 FLAG_LE_PAIRING_RCV_PAIRING_REQ
+4 FLAG_LE_PAIRING_AUTH
+5 FLAG_LE_PAIRING_AFTER_AUTH
+6 FLAG_LE_PAIRING_SEND_START_ENC_RSP
+7 FLAG_LE_PARING_SEND_ENC_INFORMATION
+8 FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION 
+9 FLAG_LE_PARING_SEND_INDENTITY_INFORMATION
+0xff FLAG_LE_PAIRING_END
+)
+
+
+
+/*LE secure connect state */
+(
+0x00 LE_SC_STAT_NULL
+0x01 LE_SC_STAT_RECEIVE_PUBLIC_KEY
+0x02 LE_SC_STAT_WAIT_SEND_PUBLIC_KEY
+0x03 LE_SC_STAT_SEND_PUBLIC_KEY
+0x04 LE_SC_STAT_RECEIVE_RANDOM
+0x05 LE_SC_STAT_SEND_RANDOM
+0x06 LE_SC_STAT_RECEIVE_DHKEY
+0x07 LE_SC_STAT_WAIT_CONFIRM_GKEY
+0x08 LE_SC_STAT_PASSKEY_WAIT_CONFIRM
+)
+
+
+(
+0 FLAG_LE_SC_CONFRIM_NULL
+1 FLAG_LE_SC_CONFRIM_GKEY_OK
+)
+
+//mem_le_enc_state
+(
+0 FLAG_LE_ENC_NULL
+1 FLAG_LE_RCV_ENC_START
+2 FLAG_LE_ENC_PAUSE
+3 FLAG_LE_RCV_START_ENC_RSP
+4 FLAG_LE_SEND_START_ENC_RSP
+0xff FLAG_LE_ENC_END
+)
+
+(//mem_le_configuration
+//bit0:use fixed key , ble passkey pairing
+0 BIT_BLE_PASSKEY_FIXED_KEY
+//bit1:ble pairing use fixed long term key
+1 BIT_BLE_PAIRING_FIXED_LTK
+//bit2:ble transmit packet will set more data flag
+2 BIT_BLE_TRANSMIT_PACKET_BY_MD
+//bit3:master read handle, with requires an authenticated link
+3 BIT_BLE_READ_AUTH
+//bit4:master write handle, with requires an authenticated link
+4 BIT_BLE_WRITE_AUTH
+//bit5:cannot enter long sleep
+5 BIT_BLE_SHORT_MULT
+
+)
+
+(
+0 BIT_ADV_CHANNEL_MAP_37
+1 BIT_ADV_CHANNEL_MAP_38
+2 BIT_ADV_CHANNEL_MAP_39
+)
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/lmp.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/lmp.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/lmp.format	(working copy)
@@ -0,0 +1,227 @@
+
+memalloc(
+
+1 mem_lmo_header_length
+1 mem_lmo_header_opcode
+17 mem_lmo_payload
+1 mem_lmi_accepted_opcode
+1 mem_disconn_reason_send
+1 mem_tx_fixed_freq
+1 mem_rx_fixed_freq
+1 mem_ext_features_page
+2 mem_lmpext_ssp_enable
+1 mem_remote_sppcap
+
+1 mem_lmp_conn_state
+2 mem_soft_timer
+1 mem_pincode_state
+
+1 mem_sres_tid
+1 mem_accptsco_tid
+
+1 mem_auth_enable
+1 mem_wait_encryption
+
+16 mem_sniff_payload
+4 mem_aurand_send_delay_time
+)
+
+xmemalloc(
+3 mem_lmp_version
+2 mem_lmp_subversion
+1 mem_local_name_length
+3 mem_local_name
+64 mem_local_name2
+1 mem_local_name_end
+1 mem_unsniff2sniff_timer
+1 mem_switch_flag
+1 mem_classic_bt_flag
+)
+
+	(
+	//bit flag:mem_classic_bt_flag
+	0 FLAG_SSP_REJECT_JUSTWORK
+	1 SHORT_MULT_FLAG
+	)
+	
+	(
+	//bit map
+	0 pair_state_inrand
+	1 pair_state_inrand_acpt
+	2 pair_state_send_comb
+	3 pair_state_recv_comb
+	4 pair_state_send_aurand
+	5 pair_state_recv_sres
+	6 pair_state_recv_aurand
+	7 pair_state_send_sres	
+	)
+	/* LMP opcodes */
+	(
+	1 LMP_NAME_REQ 
+	2 LMP_NAME_RES 
+	3 LMP_ACCEPTED 
+	4 LMP_NOT_ACCEPTED 
+	5 LMP_CLKOFFSET_REQ 
+	6 LMP_CLKOFFSET_RES 
+	7 LMP_DETACH 
+	8 LMP_IN_RAND 
+	9 LMP_COMB_KEY 
+	10 LMP_UNIT_KEY 
+	11 LMP_AU_RAND 
+	12 LMP_SRES 
+	13 LMP_TEMP_RAND 
+	14 LMP_TEMP_KEY 
+	15 LMP_ENCRYPTION_MODE_REQ 
+	16 LMP_ENCRYPTION_KEY_SIZE_REQ 
+	17 LMP_START_ENCRYPTION_REQ 
+	18 LMP_STOP_ENCRYPTION_REQ 
+	19 LMP_SWITCH_REQ 
+	20 LMP_HOLD
+	21 LMP_HOLD_REQ
+	23 LMP_SNIFF_REQ 
+	24 LMP_UNSNIFF_REQ 
+	26 LMP_PARK_REQ 
+	27 LMP_SET_BROADCAST_SCAN_WINDOW 
+	28 LMP_MODIFY_BEACON 
+	29 LMP_UNPARK_BD_ADDR_REQ 
+	30 LMP_UNPARK_PM_ADDR_REQ 
+	31 LMP_INCR_POWER_REQ 
+	32 LMP_DECR_POWER_REQ 
+	33 LMP_MAX_POWER 
+	34 LMP_MIN_POWER 
+	35 LMP_AUTO_RATE 
+	36 LMP_PREFERRED_RATE 
+	37 LMP_VERSION_REQ 
+	38 LMP_VERSION_RES 
+	39 LMP_FEATURES_REQ 
+	40 LMP_FEATURES_RES 
+	41 LMP_QUALITY_OF_SERVICE 
+	42 LMP_QUALITY_OF_SERVICE_REQ 
+	43 LMP_SCO_LINK_REQ 
+	44 LMP_REMOVE_SCO_LINK_REQ 
+	45 LMP_MAX_SLOT 
+	46 LMP_MAX_SLOT_REQ 
+	47 LMP_TIMING_ACCURACY_REQ 
+	48 LMP_TIMING_ACCURACY_RES 
+	49 LMP_SETUP_COMPLETE 
+	50 LMP_USE_SEMI_PERMANENT_KEY 
+	51 LMP_HOST_CONNECTION_REQ 
+	52 LMP_SLOT_OFFSET 
+	53 LMP_PAGE_MODE_REQ 
+	54 LMP_PAGE_SCAN_MODE_REQ 
+	55 LMP_SUPERVISION_TIMEOUT 
+	56 LMP_TEST_ACTIVATE
+	57 LMP_TEST_CONTROL
+	58 LMP_ENC_KEY_SIZE_MASK_REQ
+	59 LMP_ENC_KEY_SIZE_MASK_RES
+	60 LMP_SET_AFH
+
+	/* simple pairing support */
+	61 LMP_ENCAPSULATED_HEADER
+	62 LMP_ENCAPSULATED_PAYLOAD
+	63 LMP_SIMPLE_PAIRING_CONFIRM
+	64 LMP_SIMPLE_PAIRING_NUMBER
+	65 LMP_DHKEY_CHECK
+
+	66 LMP_M_TEST_REQ 
+
+	127 LMP_ESCAPE
+	127 LMP_ESCAPE_4   /* add 2bytes LMP header support  */   
+	)
+	/* LMP EXT opcodes, ORed with bit 7 to make difference to nonEXT */
+	(
+	129 LMP_EXT_ACCEPTED
+	130 LMP_NOT_ACCEPTED_EXT
+	131 LMP_EXT_FEATURES_REQ
+	132 LMP_EXT_FEATURES_RES
+	139 LMP_PACKET_TYPE_TABLE_REQ
+	140 LMP_EXT_ESCO_LINK_REQ
+	141 LMP_EXT_REMOVE_ESCO_REQ
+	144 LMP_EXT_CHN_CLASSIFICATION_REQ
+	145 LMP_EXT_CHN_CLASSIFICATION
+	149 LMP_SNIFF_SUBRATING_REQ
+	150 LMP_SNIFF_SUBRATING_RES
+	151 LMP_PAUSE_ENCRYPTION_REQ
+	152 LMP_RESUME_ENCRYPTION_REQ
+	153 LMP_IO_CAP_REQ
+	154 LMP_IO_CAP_RES
+	)
+	/* LMP reason codes */
+	(
+	0x05 AUTHENTICATION_FAILURE_ERROR
+	0x06 KEY_MISSING
+	0x0b ACL_CONNECTION_ALREADY_EXISTS
+	0x13 OTHER_END_TERMINATED
+	0x15 ABOUT_TO_POEWR_OFF
+	0x16 LOCAL_HOST
+	0x18 PAIRING_NOT_ALLOWED
+	0x19 UNKNOWN_LMP_PDU
+	0x1A UNSUPPORTED_LMP_FEATURE 
+	0x1F UNSPECIFIED_ERROR
+	0x20 UNSUPPORTED_PARAMETERS
+	0x21 SWITCH_NOT_ALLOWED
+	0x23 TRANSACTION_COLLISION
+	0x24 PDU_NOT_ALLOWED
+	0x25 ENCRYPTION_MODE_NOT_ACCEPTABLE
+	0x2e NOT_SUPPORT_CHN_CLASSIFICATION
+	0x37 NOT_SUPPORT_SSP
+	)
+
+	/* test mode scenarios */
+	(
+	0 PAUSE_TEST_MODE
+	1 ZERO_PATTERN
+	2 ONE_PATTERN
+	3 ALT_PATTERN
+	4 PSEUDORANDOM
+	5 CLOSED_LOOP_BACK_ACL
+	6 CLOSED_LOOP_BACK_SCO
+	7 ACL_WITHOUT_WHITENING
+	8 SCO_WITHOUT_WHITENING
+	9 ALT2_PATTERN
+	255 EXIT_TEST_MODE
+	)
+	/* test mode hoppig modes */
+	(
+	0 FIXED_FREQ
+	1 NORMAL_HOP
+	)
+
+	/* mem_lmp_tid indicates which type of LMP will be sent */
+	(
+	0 TID_NORM_REPLY
+	1 TID_NORM_SEND
+	2 TID_ONE
+	3 TID_ZERO
+	4 TID_PAIRING
+	5 TID_ENCRYPTION
+	6 TID_VARIABLE
+	7 TID_RX
+	)
+
+	/* ============== lmp status ==========*/
+	(
+	0 lmp_incoming
+	1 lmp_outgoing
+	2 lmp_reject_msg
+	3 lmp_clear_msg
+	4 upper_reject_msg
+	5 upper_clear_msg
+	)
+
+(
+0x2ee00 TIMER_ONE_MINUTE //96000*2
+80 TIMER_SWITCH_WAITE
+12 TIMER_ENPT_WAITE
+)
+
+(
+0 SWITCH_FLAG_INIT
+1 SWITCH_FLAG_ACCEPT
+2 SWITCH_FLAG_NOT_ACCEPT
+)
+(
+0 NULL_ENCRYP
+1 DONE_ENCRYP
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/memblocks.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/memblocks.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/memblocks.format	(working copy)
@@ -0,0 +1,66 @@
+//
+//
+//Large memory blocks defined in this file.
+//Blocks Shall be defined with absolute address.
+//Blocks' length Shall be specified in comment following Blocks' names.
+//Different blocks MAY be overlap.
+//Blocks defined in this file Shall NOT be overlap with variable in memmap.format.
+
+// USB C51 exchange area
+(
+0xff0 mem_mcmd
+0xff1 mem_mouse_data
+)
+
+//l2cap RX buffers
+(
+0x1000 mem_l2cap_rxbuff1		//0x400
+0x1400 mem_l2cap_rxbuff2		//0x400
+//end address:0x17ff
+)
+//l2cap TX buffers
+(
+0x1800 mem_tx_buff0		//128
+0x1880 mem_tx_buff1		//128
+0x1900 mem_tx_buff2		//128
+0x1980 mem_tx_buff3		//128
+0x1a00 mem_tx_buff4		//128
+0x1a80 mem_tx_buff5		//128
+0x1b00 mem_tx_buff6		//128
+0x1b80 mem_tx_buff7		//128
+//end address: 0x1bff
+)
+
+(
+0x1800 mem_le_tx_buffer0
+0x1900 mem_le_tx_buffer1
+0x1a00 mem_le_tx_buffer2
+0x1b00 mem_le_tx_buffer3
+//end addr:0x1dff
+)
+
+
+//uart buffer
+(
+0x1800 mem_h5rx_buf//0x400
+0x1bff mem_h5rx_buf_end
+0x1c00 mem_h5tx_buf
+0x1fff mem_h5tx_buf_end
+)
+
+(
+0x4c00 mem_module_rx_buf//0x400
+0x4c00 mem_module_rx_buf_little
+0x4fff mem_module_rx_buf_end
+0x1c00 mem_module_tx_buf
+0x1fff mem_module_tx_buf_end
+)
+
+(
+0x1800 mem_ir_record
+0x1c      mem_ir_record_max
+)
+
+
+endif
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/patch.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/patch.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/patch.format	(working copy)
@@ -0,0 +1,516 @@
+
+(
+	  0 patch00_0
+	  1 patch00_1
+	  2 patch00_2
+	  3 patch00_3
+	  4 patch00_4
+	  5 patch00_5
+	  6 patch00_6
+	  7 patch00_7
+	  8 patch01_0
+	  9 patch01_1
+	 10 patch01_2
+	 11 patch01_3
+	 12 patch01_4
+	 13 patch01_5
+	 14 patch01_6
+	 15 patch01_7
+	 16 patch02_0
+	 17 patch02_1
+	 18 patch02_2
+	 19 patch02_3
+	 20 patch02_4
+	 21 patch02_5
+	 22 patch02_6
+	 23 patch02_7
+	 24 patch03_0
+	 25 patch03_1
+	 26 patch03_2
+	 27 patch03_3
+	 28 patch03_4
+	 29 patch03_5
+	 30 patch03_6
+	 31 patch03_7
+	 32 patch04_0
+	 33 patch04_1
+	 34 patch04_2
+	 35 patch04_3
+	 36 patch04_4
+	 37 patch04_5
+	 38 patch04_6
+	 39 patch04_7
+	 40 patch05_0
+	 41 patch05_1
+	 42 patch05_2
+	 43 patch05_3
+	 44 patch05_4
+	 45 patch05_5
+	 46 patch05_6
+	 47 patch05_7
+	 48 patch06_0
+	 49 patch06_1
+	 50 patch06_2
+	 51 patch06_3
+	 52 patch06_4
+	 53 patch06_5
+	 54 patch06_6
+	 55 patch06_7
+	 56 patch07_0
+	 57 patch07_1
+	 58 patch07_2
+	 59 patch07_3
+	 60 patch07_4
+	 61 patch07_5
+	 62 patch07_6
+	 63 patch07_7
+	 64 patch08_0
+	 65 patch08_1
+	 66 patch08_2
+	 67 patch08_3
+	 68 patch08_4
+	 69 patch08_5
+	 70 patch08_6
+	 71 patch08_7
+	 72 patch09_0
+	 73 patch09_1
+	 74 patch09_2
+	 75 patch09_3
+	 76 patch09_4
+	 77 patch09_5
+	 78 patch09_6
+	 79 patch09_7
+	 80 patch0a_0
+	 81 patch0a_1
+	 82 patch0a_2
+	 83 patch0a_3
+	 84 patch0a_4
+	 85 patch0a_5
+	 86 patch0a_6
+	 87 patch0a_7
+	 88 patch0b_0
+	 89 patch0b_1
+	 90 patch0b_2
+	 91 patch0b_3
+	 92 patch0b_4
+	 93 patch0b_5
+	 94 patch0b_6
+	 95 patch0b_7
+	 96 patch0c_0
+	 97 patch0c_1
+	 98 patch0c_2
+	 99 patch0c_3
+	100 patch0c_4
+	101 patch0c_5
+	102 patch0c_6
+	103 patch0c_7
+	104 patch0d_0
+	105 patch0d_1
+	106 patch0d_2
+	107 patch0d_3
+	108 patch0d_4
+	109 patch0d_5
+	110 patch0d_6
+	111 patch0d_7
+	112 patch0e_0
+	113 patch0e_1
+	114 patch0e_2
+	115 patch0e_3
+	116 patch0e_4
+	117 patch0e_5
+	118 patch0e_6
+	119 patch0e_7
+	120 patch0f_0
+	121 patch0f_1
+	122 patch0f_2
+	123 patch0f_3
+	124 patch0f_4
+	125 patch0f_5
+	126 patch0f_6
+	127 patch0f_7
+	128 patch10_0
+	129 patch10_1
+	130 patch10_2
+	131 patch10_3
+	132 patch10_4
+	133 patch10_5
+	134 patch10_6
+	135 patch10_7
+	136 patch11_0
+	137 patch11_1
+	138 patch11_2
+	139 patch11_3
+	140 patch11_4
+	141 patch11_5
+	142 patch11_6
+	143 patch11_7
+	144 patch12_0
+	145 patch12_1
+	146 patch12_2
+	147 patch12_3
+	148 patch12_4
+	149 patch12_5
+	150 patch12_6
+	151 patch12_7
+	152 patch13_0
+	153 patch13_1
+	154 patch13_2
+	155 patch13_3
+	156 patch13_4
+	157 patch13_5
+	158 patch13_6
+	159 patch13_7
+	160 patch14_0
+	161 patch14_1
+	162 patch14_2
+	163 patch14_3
+	164 patch14_4
+	165 patch14_5
+	166 patch14_6
+	167 patch14_7
+	168 patch15_0
+	169 patch15_1
+	170 patch15_2
+	171 patch15_3
+	172 patch15_4
+	173 patch15_5
+	174 patch15_6
+	175 patch15_7
+	176 patch16_0
+	177 patch16_1
+	178 patch16_2
+	179 patch16_3
+	180 patch16_4
+	181 patch16_5
+	182 patch16_6
+	183 patch16_7
+	184 patch17_0
+	185 patch17_1
+	186 patch17_2
+	187 patch17_3
+	188 patch17_4
+	189 patch17_5
+	190 patch17_6
+	191 patch17_7
+	192 patch18_0
+	193 patch18_1
+	194 patch18_2
+	195 patch18_3
+	196 patch18_4
+	197 patch18_5
+	198 patch18_6
+	199 patch18_7
+	200 patch19_0
+	201 patch19_1
+	202 patch19_2
+	203 patch19_3
+	204 patch19_4
+	205 patch19_5
+	206 patch19_6
+	207 patch19_7
+	208 patch1a_0
+	209 patch1a_1
+	210 patch1a_2
+	211 patch1a_3
+	212 patch1a_4
+	213 patch1a_5
+	214 patch1a_6
+	215 patch1a_7
+	216 patch1b_0
+	217 patch1b_1
+	218 patch1b_2
+	219 patch1b_3
+	220 patch1b_4
+	221 patch1b_5
+	222 patch1b_6
+	223 patch1b_7
+	224 patch1c_0
+	225 patch1c_1
+	226 patch1c_2
+	227 patch1c_3
+	228 patch1c_4
+	229 patch1c_5
+	230 patch1c_6
+	231 patch1c_7
+	232 patch1d_0
+	233 patch1d_1
+	234 patch1d_2
+	235 patch1d_3
+	236 patch1d_4
+	237 patch1d_5
+	238 patch1d_6
+	239 patch1d_7
+	240 patch1e_0
+	241 patch1e_1
+	242 patch1e_2
+	243 patch1e_3
+	244 patch1e_4
+	245 patch1e_5
+	246 patch1e_6
+	247 patch1e_7
+	248 patch1f_0
+	249 patch1f_1
+	250 patch1f_2
+	251 patch1f_3
+	252 patch1f_4
+	253 patch1f_5
+	254 patch1f_6
+	255 patch1f_7
+	  0 patch20_0
+	  1 patch20_1
+	  2 patch20_2
+	  3 patch20_3
+	  4 patch20_4
+	  5 patch20_5
+	  6 patch20_6
+	  7 patch20_7
+	  8 patch21_0
+	  9 patch21_1
+	 10 patch21_2
+	 11 patch21_3
+	 12 patch21_4
+	 13 patch21_5
+	 14 patch21_6
+	 15 patch21_7
+	 16 patch22_0
+	 17 patch22_1
+	 18 patch22_2
+	 19 patch22_3
+	 20 patch22_4
+	 21 patch22_5
+	 22 patch22_6
+	 23 patch22_7
+	 24 patch23_0
+	 25 patch23_1
+	 26 patch23_2
+	 27 patch23_3
+	 28 patch23_4
+	 29 patch23_5
+	 30 patch23_6
+	 31 patch23_7
+	 32 patch24_0
+	 33 patch24_1
+	 34 patch24_2
+	 35 patch24_3
+	 36 patch24_4
+	 37 patch24_5
+	 38 patch24_6
+	 39 patch24_7
+	 40 patch25_0
+	 41 patch25_1
+	 42 patch25_2
+	 43 patch25_3
+	 44 patch25_4
+	 45 patch25_5
+	 46 patch25_6
+	 47 patch25_7
+	 48 patch26_0
+	 49 patch26_1
+	 50 patch26_2
+	 51 patch26_3
+	 52 patch26_4
+	 53 patch26_5
+	 54 patch26_6
+	 55 patch26_7
+	 56 patch27_0
+	 57 patch27_1
+	 58 patch27_2
+	 59 patch27_3
+	 60 patch27_4
+	 61 patch27_5
+	 62 patch27_6
+	 63 patch27_7
+	 64 patch28_0
+	 65 patch28_1
+	 66 patch28_2
+	 67 patch28_3
+	 68 patch28_4
+	 69 patch28_5
+	 70 patch28_6
+	 71 patch28_7
+	 72 patch29_0
+	 73 patch29_1
+	 74 patch29_2
+	 75 patch29_3
+	 76 patch29_4
+	 77 patch29_5
+	 78 patch29_6
+	 79 patch29_7
+	 80 patch2a_0
+	 81 patch2a_1
+	 82 patch2a_2
+	 83 patch2a_3
+	 84 patch2a_4
+	 85 patch2a_5
+	 86 patch2a_6
+	 87 patch2a_7
+	 88 patch2b_0
+	 89 patch2b_1
+	 90 patch2b_2
+	 91 patch2b_3
+	 92 patch2b_4
+	 93 patch2b_5
+	 94 patch2b_6
+	 95 patch2b_7
+	 96 patch2c_0
+	 97 patch2c_1
+	 98 patch2c_2
+	 99 patch2c_3
+	100 patch2c_4
+	101 patch2c_5
+	102 patch2c_6
+	103 patch2c_7
+	104 patch2d_0
+	105 patch2d_1
+	106 patch2d_2
+	107 patch2d_3
+	108 patch2d_4
+	109 patch2d_5
+	110 patch2d_6
+	111 patch2d_7
+	112 patch2e_0
+	113 patch2e_1
+	114 patch2e_2
+	115 patch2e_3
+	116 patch2e_4
+	117 patch2e_5
+	118 patch2e_6
+	119 patch2e_7
+	120 patch2f_0
+	121 patch2f_1
+	122 patch2f_2
+	123 patch2f_3
+	124 patch2f_4
+	125 patch2f_5
+	126 patch2f_6
+	127 patch2f_7
+	128 patch30_0
+	129 patch30_1
+	130 patch30_2
+	131 patch30_3
+	132 patch30_4
+	133 patch30_5
+	134 patch30_6
+	135 patch30_7
+	136 patch31_0
+	137 patch31_1
+	138 patch31_2
+	139 patch31_3
+	140 patch31_4
+	141 patch31_5
+	142 patch31_6
+	143 patch31_7
+	144 patch32_0
+	145 patch32_1
+	146 patch32_2
+	147 patch32_3
+	148 patch32_4
+	149 patch32_5
+	150 patch32_6
+	151 patch32_7
+	152 patch33_0
+	153 patch33_1
+	154 patch33_2
+	155 patch33_3
+	156 patch33_4
+	157 patch33_5
+	158 patch33_6
+	159 patch33_7
+	160 patch34_0
+	161 patch34_1
+	162 patch34_2
+	163 patch34_3
+	164 patch34_4
+	165 patch34_5
+	166 patch34_6
+	167 patch34_7
+	168 patch35_0
+	169 patch35_1
+	170 patch35_2
+	171 patch35_3
+	172 patch35_4
+	173 patch35_5
+	174 patch35_6
+	175 patch35_7
+	176 patch36_0
+	177 patch36_1
+	178 patch36_2
+	179 patch36_3
+	180 patch36_4
+	181 patch36_5
+	182 patch36_6
+	183 patch36_7
+	184 patch37_0
+	185 patch37_1
+	186 patch37_2
+	187 patch37_3
+	188 patch37_4
+	189 patch37_5
+	190 patch37_6
+	191 patch37_7
+	192 patch38_0
+	193 patch38_1
+	194 patch38_2
+	195 patch38_3
+	196 patch38_4
+	197 patch38_5
+	198 patch38_6
+	199 patch38_7
+	200 patch39_0
+	201 patch39_1
+	202 patch39_2
+	203 patch39_3
+	204 patch39_4
+	205 patch39_5
+	206 patch39_6
+	207 patch39_7
+	208 patch3a_0
+	209 patch3a_1
+	210 patch3a_2
+	211 patch3a_3
+	212 patch3a_4
+	213 patch3a_5
+	214 patch3a_6
+	215 patch3a_7
+	216 patch3b_0
+	217 patch3b_1
+	218 patch3b_2
+	219 patch3b_3
+	220 patch3b_4
+	221 patch3b_5
+	222 patch3b_6
+	223 patch3b_7
+	224 patch3c_0
+	225 patch3c_1
+	226 patch3c_2
+	227 patch3c_3
+	228 patch3c_4
+	229 patch3c_5
+	230 patch3c_6
+	231 patch3c_7
+	232 patch3d_0
+	233 patch3d_1
+	234 patch3d_2
+	235 patch3d_3
+	236 patch3d_4
+	237 patch3d_5
+	238 patch3d_6
+	239 patch3d_7
+	240 patch3e_0
+	241 patch3e_1
+	242 patch3e_2
+	243 patch3e_3
+	244 patch3e_4
+	245 patch3e_5
+	246 patch3e_6
+	247 patch3e_7
+	248 patch3f_0
+	249 patch3f_1
+	250 patch3f_2
+	251 patch3f_3
+	252 patch3f_4
+	253 patch3f_5
+	254 patch3f_6
+	255 patch3f_7
+
+)
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/regs.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/regs.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/regs.format	(working copy)
@@ -0,0 +1,195 @@
+(
+  0x8000 core_chipid
+  0x8001 core_revid
+  0x8003 core_kick
+  0x8005 core_lpm_wr
+  0x8006 core_misc_ctrl
+  0x8007 core_otp_rdata
+  0x800a core_dma_start
+  0x800b core_sbc_clr
+  0x8010 core_reset
+  0x8011 core_encrypt
+  0x8015 core_uart_txd
+  0x8022 core_ucode_hi
+  0x8023 core_ucode_ctrl
+  0x8024 core_ucode_low
+  0x8025 core_ucode_data
+
+  0x8040 core_rthalfslot
+  0x8042 core_clksel
+  0x8043 core_config 
+  0x8044 core_sec_rsaddr
+  0x8046 core_sec_readdr
+  0x8048 core_sec_tsaddr
+  0x804a core_sec_teaddr
+  0x804c core_lpm_reg
+  0x804e core_lpm_isogate
+
+  0x8100 core_clkn
+  0x8104 core_extmclk
+  0x8108 core_misc_status
+  0x8109 core_debug_baud
+  0x810a core_ccnt_counter
+  0x810e core_gpio_in
+  0x811c core_lpm_ctrl
+  0x8123 core_lpm_ldocnt
+  0x8124 core_lpm_xtalcnt
+  0x8125 core_lpm_buckcnt
+  0x8126 core_lpm_switch
+  0x8127 core_lpm_buckcfg
+  0x8130 core_gpio_wakeup
+
+
+  0x8203 core_ice_ctrl
+  0x8204 core_ice_status
+  0x8205 core_ice_break0
+  0x8207 core_ice_break1
+  
+  0x8400   mem_b_box          /* entire bank */
+  0x8500   mem_e_box          /* entire bank */
+  0x8600   mem_l_box          /* entire bank */
+
+  0x8700 memk
+
+  0x8900 rfen_rx
+  0x8901 rfen_tx
+  0x8902 rfen_mdm
+  0x8903 rfen_sn
+  0x8904 rfen_msc
+  0x8905 rfen_ck
+  0x8906 rfen_adc
+  0x8912 rf_agc_ctrl
+  0x8914 rfen_ulp
+  0x8971 rf_adc_mode
+  0x8972 rf_adc_gc
+  0x8973 rf_adc_ch
+
+  0x894b rf_rx_vctrl_reg1
+  0x894c rf_rx_vctrl_reg2
+  0x894d rf_rx_ib_lna
+  0x894e rf_rx_lna_ctrim
+
+  0x8950 rf_bpf_ctrim
+  0x8951 rf_bpf_ib
+  0x8952 rf_adc_rccal
+  0x8952 rf_rccal_ctrl
+  0x8953 rf_rccal_sel
+  0x8955 rf_tx_pa
+  0x8956 rf_tx_mix
+  0x895f rf_pll_rstn
+  0x8964 rf_sdm_en
+  0x8960 rf_pll_intg
+  0x8961 rf_pll_frac
+  0x8963 rf_pll_frachi
+  0x896c rf_afc_cap
+  0x8967 rf_clkpll_bias
+  0x896f rf_clkpll_en
+  0x8968 rf_clkpll_int
+  0x8969 rf_clkpll_frac
+  0x896d rf_balun_ctrim
+  0x8972 rf_saradc_ctrl
+  0x8973 rfen_chgpump
+  0x897a rf_audio_voll
+  0x897b rf_audio_volr
+  0x897e rfen_aadc
+  0x897f rf_audio_pddac0
+  0x8980 rf_audio_pddac1
+  0x8981 rf_audio_dac_ldo
+
+  0x8990 rf_rccal_result
+  0x8991 rf_afc_d2a
+  0x8992 rf_rssi
+
+
+0x8c00 core_usb_config		
+0x8c01 core_usb_int_mask	
+0x8c04 core_usb_addr
+0x8c10 core_usb_trig	
+0x8c11 core_usb_stall		
+0x8c12 core_usb_clear		
+0x8c18 core_usb_ep
+0x8c18 core_usb_dfifo0 
+0x8c19 core_usb_dfifo1  
+0x8c1a core_usb_dfifo2 
+0x8c20 core_usb_ep_len
+0x8c26 core_usb_status		
+0x8c27 core_usb_fifo_empty
+0x8c28 core_usb_fifo_full
+
+
+4 rx_freq_offset
+1 tx_freq_offset
+
+/* bit difinitions */
+  4 whiteoff_bit
+  6 clksel_rc
+  5 clksel_dpll
+  4 clksel_xtal
+  5 adc_rccal
+  0 bpf_rccal
+  1 demod_clkoff
+
+(
+  7 cold_wake
+  3 gpio_latch
+  6 enable_retmem
+  19 hibernate
+  20 xram_switch
+  21 pram_switch
+  23 isogate
+  0xb0 isogate_mask
+)
+
+// misc ctrl
+(
+  0x04 set_tea_key
+  0x08 lock_otp
+  0x10 x_sethi
+  0x20 y_sethi
+  0x40 z_sethi
+  0x80 ccnt_start
+)
+
+// dma start
+(
+  0x01 otpd_start
+  0x02 spid_start
+  0x04 iicd_start
+  0x08 qspi_start
+)
+
+// dma status bit
+(
+  0 otpd_crcok
+  1 otpd_done
+  2 spid_crcok
+  3 spid_done
+  4 iicd_crcok
+  5 iicd_done
+  6 iicd_ack
+)
+
+// core_misc_status
+(
+  0 CCNT_DONE
+  1 KICKED
+  2 SEC_PWRUP
+)
+
+0x8b uart_ctrl_default //BCSP
+0x81 uart_ctrl_h4 //H4
+0x81 uart_ctrl_normal
+0x81 uart_ctrl_57600
+2 uart_baud_len
+0x01 uartclk_dpll
+0x1a0 uart_baud_115200
+0xbb uart_baud_256000
+0x340 uart_baud_57600
+0x2dc6c00 uart_clk
+
+//core_config
+(
+3 CLOCK_ON_AUTH_ROM
+)
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/rfcomm.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/rfcomm.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/rfcomm.format	(working copy)
@@ -0,0 +1,391 @@
+/*****************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                                */
+/* $Author: Administrator $                                                           */
+/* $Id: bt_rfcomm_format.upper,v 1.1 2009-09-28 04:06:17 Administrator Exp $ */
+/* Orisil Technology                                                      */
+/*****************************************************************************/
+
+/**********/
+/* memory */
+/**********/
+
+memalloc(
+1 memRemoteRPNBitRate
+1 memRemotePRNDataBits
+1 memRemotePRNStopBit
+1 memRemotePRNParity
+1 memRemotePRNFlowControl
+1 memRemotePRNXon
+1 memRemotePRNXoff
+
+
+3 mem_mod2div_temp
+2 mem_contw_temp
+2 mem_attrib_list
+
+//rfcomm head
+1 mem_current_adss
+1 mem_current_channel
+1 mem_current_frame_type
+1 mem_current_fcs
+2 mem_current_length
+2 mem_rfcomm_uih_payload_ptr
+
+//rfcomm uih
+1 mem_uih_cmd_type
+2 mem_uih_length
+2 mem_param_payload_ptr
+
+
+//rfcomm modem status
+1 mem_ms_param
+
+//rfcomm pn
+1 mem_pn_credit_flow_type_info
+1 mem_pn_priority
+1 mem_pn_acknowledg_timer
+1 mem_pn_max_retrans
+
+1 mem_rfcomm_send_adss
+1 mem_rfcomm_send_frame_type
+1 mem_rfcomm_send_fcs
+1 mem_rfcomm_send_offset
+
+)
+
+xmemalloc(
+1 mem_pn_dlci
+2 mem_pn_max_frame_size
+
+1 memFCStemp1
+1 memFCStemp2
+1 memFCStemp3
+
+1 mem_rfcomm_initiator
+
+1 mem_remote_spp_channel
+
+1 mem_HIUfcs_SPP
+1 mem_HIUfcs_SPP_WCredits
+
+1 mem_rfcomm_send_more_pkt
+
+1 mem_remote_credits
+1 mem_credit_given
+
+//rfcomm modem status
+1 mem_ms_channel
+
+1 mem_credit_flag
+
+2 mem_rfcomm_max_frame_size
+1 mem_rfcomm_credit_init_data
+
+2 mem_cb_receive_spp_data
+
+2 mem_nl_rx_data_src
+2 mem_nl_rx_len_all
+)
+
+
+(
+0 CREDIT_DISABLE
+1 CREDIT_ENABLE
+)
+
+
+/************************************************************************/
+  
+
+ 
+/************/
+/* constant */
+/************/
+
+/* RFCOMM state for Headset (memRFCOMM_State) */ 
+  (
+    0 RFCOMM_IDLE           /* before the responsor HS receive SABM            */
+    1 RFCOMM_W4_DLCI0_OPEN
+    2 RFCOMM_W4_DLCI0_CLOSE
+    3 RFCOMM_START_DLCI0    /* After respond SABM frame (DLCI=0)               */
+    4 RFCOMM_W4_DLCI_OPEN
+    5 RFCOMM_W4_DLCI_CLOSE
+    6 RFCOMM_DLCI_OPENED    
+   
+  )
+  
+/* RFCOMM timer constants   */
+  (
+    1000  RFCOMM_T1         /* Used by SABM and DISC frames,100*20ms = 20s     */     
+    1000  RFCOMM_T2         /* Used by commands send in UIH on DLCI0,          */
+    300   RFCOMM_T3_RINGON  /* 6s for ring fade time                           */
+  
+  )
+
+/* Command Type */
+  (
+    0x3F RSP_RX_SABM        /*responsor expect SABM from initiator             */
+    0x3F INI_TX_SABM
+	
+    0x73 RSP_TX_UA          /*responsor send out UA command                    */
+    0x73 UA_WFBIT_SET	    /* UA control field with F bit set                 */
+	
+    0xEF RSP_RX_UIH         /*responsor expect UIH from initiator              */
+
+    0xEF RSP_TX_UIH         /*responsor send UIH to initiator                  */
+     
+    0x1F RSP_TX_DM          /*responsor send DM to initiator                   */
+    0x1F DM_WFBIT_SET       /* DM control field with F bit set                 */
+    0x0F DM_WFBIT_CLEAR     /* DM control field with F bit clear               */
+
+    0x53 RSP_RX_DISC        /*responsor expect DISC from initiator             */
+    0x53 INI_TX_DISC	    /*initiator send DISC control type command         */
+     
+    0xFF RSP_RX_UIH_WDATA   /*UIH data with credit flow control info           */
+    
+    
+  )
+
+/* Multiplexor commands and responses frames */
+  (
+    0x83 PN_COMMAND           /* Bit 0 EA C/R Type = 000001         */
+    0x81 PN_RESPONSOR         /* Bit 0 EA C/R Type = 000001         */
+    
+    0xE3 MSC_COMMAND          /* Bit 0 EA C/R Type = 000111         */
+    0xE1 MSC_RESPONSOR
+ 
+    0x13 NSC_COMMAND          /* Bit 0 EA C/R Type = 001000         */
+    0x11 NSC_RESPONSOR        /* Bit 0 EA C/R Type = 001000         */
+
+    0x23 TEST_COMMAND         /* Bit 0 EA C/R Type = 000111         */
+    0x21 TEST_RESPONSOR 
+    
+    0x93 RPN_COMMAND          /* Bit 0 EA C/R Type = 001001         */
+    0x91 RPN_RESPONSOR 
+    
+    0x53 RLS_COMMAND          /* Bit 0 EA C/R Type = 001010         */
+    0x51 RLS_RESPONSOR 
+
+    0xA3 FCON_COMMAND         /* Bit 0 EA C/R Type = 000101         */
+    0xA1 FCON_RESPONSOR 
+    
+    0x63 FCOFF_COMMAND        /* Bit 0 EA C/R Type = 000110         */
+    0x61 FCOFF_RESPONSOR 
+    	
+    0x03 RLS_OVERRUN
+    0x05 RLS_PARITY_ERROR
+    0x09 RLS_FRAMING_ERROR
+  )
+
+/* memLocalCredit */
+  (
+    0x01 RFCOMM_CREDIT
+  )
+
+  (
+  	0x007f RFCOMM_MAX_FRAME_SIZE
+  )
+
+/* UIH received Data length */
+  (
+    0  LENGTH_ZERO
+    
+    6  LENGTH_OK
+    7  LENGTH_HOT
+    8  LENGTH_RING
+    9  LENGTH_ERROR
+    9  LENGTH_AGVOL_ONEBYTE
+    10 LENGTH_AGVOL_TWOBYTE
+    10 LENGTH_VOL_ONEBYTE
+    11 LENGTH_VOL_TWOBYTE
+    12 LENGTH_BRSF
+    13 LENGTH_PLUS_CIEV
+    15 LENGTH_INBANDRING
+    14 LENGTH_CIEV_CALL
+    17 LENGTH_CRING
+    20 LENGTH_BRSF_OK
+    24 LENGTH_CIND0
+    28 LENGTH_CIEV_TWO
+    32 LENGTH_CIND_OK
+    59 LENGTH_CIND_OK2
+    100 LENGTH_DISCARD
+  )
+  
+/************/
+/* flags    */
+/************/
+  
+/* memRFCOMM_L2CAP_Interface */
+  (
+    0 RFCOMM_TX_W4BUF_FLAG    /* Wait for Tx buffer empty flag */
+    1 RFCOMM_CLOSE_LINK_FLAG
+  )
+  
+
+    
+/* memRemoteMSC		*/
+  (
+    0 MSC_EA_BIT
+    1 MSC_FC_BIT
+    2 MSC_RTC_BIT
+    3 MSC_RTR_BIT
+    6 MSC_IC_BIT
+    7 MSC_DV_BIT
+  )
+
+/* memRemoteRLS         */
+  (
+    0x0C OVERRUN_ERROR
+    0x0A PARITY_ERROR
+    0x09 FRAMING_RERROR
+  )
+  
+/* memRemoteRPNBitRate  */
+  (
+    0x00 BITS2400
+    0x01 BITS4800
+    0x02 BITS7200
+    0x03 BITS9600
+    0x04 BITS19200
+    0x05 BITS38400
+    0x06 BITS57600
+    0x07 BITS115200
+    0x08 BITS230400
+  )
+  
+/* memRemotePRNDataBits	*/
+  (
+    0x00 DATABITS5
+    0x01 DATABITS6
+    0x02 DATABITS7
+    0x03 DATABITS8
+  )
+  
+/* memRemotePRNStopBit	*/
+  (
+    0    ONESTOP
+    1    ONEHALFSTOP
+  )
+  
+/* memRemotePRNParity   */
+  (
+    0    ODDPARITY
+    1    EVENPARITY
+    2    MARKPARITY
+    3    SPACEPARITY
+    
+    7    PARITY_ENABLE_BIT
+  )
+
+/* RPN bit mask(in)     */
+  (
+     0   BIT_RATE_MASK_BIT
+     1   DATA_BITS_MASK_BIT
+     2   STOP_BITS_MASK_BIT
+     3   PARITY_MASK_BIT
+     4   PARITY_TYPE_MASK_BIT
+     5   XON_CHAR_MASK_BIT
+     6   XOFF_CHAR_MASK_BIT
+  )
+  
+/* RPN bit mask(in) 2    */
+  (
+     0   XON_XOFF_INPUT_MASK_BIT
+     1   XON_XOFF_OUTPUT_MASK_BIT
+     2	 RTR_INPUT_MASK_BIT
+     3   RTR_OUTPUT_MASK_BIT
+     4   RTC_INPUT_MASK_BIT
+     5   RTC_OUTPUT_MASK_BIT
+
+  )
+
+/* memRFCOMM_Request	*/
+  (
+    0 SEND_MSC_CMD_REQ_FLAG
+    1 SEND_AT_CKPD_REQ_FLAG
+    2 SEND_RING_REQ_FLAG
+    3 SEND_SABM_CMD
+  )
+  
+/* memRFCOMM_Misc_Flag  */
+  (
+    0 MSC_CDM_ALREADY_SEND_FLAG
+    1 CREDIT_FLOW_USED_FLAG
+    2 DONT_EMBEDDED_CREDIT_FLAG 
+    3 MSC_EXCHANGE_DONE_FLAG
+    4 FLOW_CONTROL_FCOFF_BIT            /* set when receive FCoff, clear when FCon   */
+  )
+  
+/* memRemoteMSC		*/
+  (
+    1 FLOW_CONTROL_FC_BIT		/* received MSC FC bits                      */
+  
+  )
+/* Address filed        */
+  (
+    0 ADDR_EA_BIT
+    1 ADDR_CR_BIT
+    2 ADDR_D_BIT
+  )
+//should be same as descripted in SDP
+(
+    1 SPP_SLAVE_CHANNEL
+    7 OBEX_SERVER_CHANNEL
+    8 HF_SERVER_CHANNEL 
+    9 HS_SERVER_CHANNEL
+)
+/* memRFCOMM_Flag */
+(
+	0 USING_HF_PROFILE
+	1 USING_HS_PROFILE
+	2 USING_SPP_PROFILE
+)
+/*RFCOMM Frame Type*/
+(
+	0x3f RFCOMM_FRAME_TYPE_SABM
+	0x73 RFCOMM_FRAME_TYPE_UA
+	0xEF RFCOMM_FRAME_TYPE_UIH
+	0xFF RFCOMM_FRAME_TYPE_UIH_CREDITS
+	0x53 RFCOMM_FRAME_TYPE_DISCONN
+)
+/*RFCOMM UIH CMD TYPE*/
+(
+	0x41 UIH_PARAM_NEG_CMD
+	0x40 UIH_PARAM_NEG_RES
+	0x49 UIH_PARAM_CMD_REMOVE_PORT
+	0x71 UIH_MODEM_STATUS_CMD
+	0x70 UIH_MODEM_STATUS_RES
+)
+
+/*bits in rfcomm address*/
+(
+	0 RFCOMM_ADDRESS_EXT_LEN
+	1 RFCOMM_ADDRESS_CR
+	2 RFCOMM_ADDRESS_DERECTION
+
+
+)
+
+	(                                   
+	0 RFCOMM_CHANNEL_STATE_PN_CMD
+	1 RFCOMM_CHANNEL_STATE_PN_RES
+	2 RFCOMM_CHANNEL_STATE_SABM
+	3 RFCOMM_CHANNEL_STATE_UA
+	4 RFCOMM_CHANNEL_STATE_SND_MS_CMD
+	5 RFCOMM_CHANNEL_STATE_RCV_MS_CMD
+	6 RFCOMM_CHANNEL_STATE_SND_MS_RES
+	7 RFCOMM_CHANNEL_STATE_RCV_MS_RES
+	0xff RFCOMM_CHANNEL_SETUP_COMPLETE
+	) 
+
+	/*mem_rfcomm_send_more_pkt*/
+	(
+	1 MORE_PKT_MSC_CMD_HF
+	2 MORE_PKT_MSC_CMD_HS
+	3 MORE_PKT_MSC_CMD_SPP
+	4 MORE_PKT_MSC_CMD_OBEX
+	)
+
+	(
+	127 RFCOMM_MALLOC_SIZE
+	)
\ No newline at end of file
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/sdp.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/sdp.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/sdp.format	(working copy)
@@ -0,0 +1,70 @@
+
+memalloc(
+0 mem_sdp_mem_start
+8 mem_sdp_uuid_search_ptr
+2 mem_sdp_continue_byte
+1 mem_sdp_pduid
+2 mem_sdp_transactionid
+2 mem_sdp_transactionid_local
+2 mem_sdp_attribute_maxbyte
+2 mem_sdp_record_maxcnt
+4 mem_sdp_record_handle
+1 mem_sdp_LACAP_found
+1 mem_sdp_RFCOMM_found
+0 mem_sdp_handle_list
+32 mem_sdp_attrib_list
+2 mem_sdp_error_code
+2 mem_sdp_all_length
+1 mem_handle_humber
+2 mem_search_uuid
+0 mem_sdp_mem_end
+)
+xmemalloc(
+2 mem_ui_uuid_table
+22 mem_all_uuid_16bits
+34 mem_all_uuid_128bits
+2 mem_sdp_l2capch_ptr
+)
+(
+0 AGORHS_SERVICE
+1 GENAUDIO_SERVICE
+2 HANDSFREE_SERVICE
+)
+(
+0 ATTRIBUTEID_0000
+1 ATTRIBUTEID_0001
+2 ATTRIBUTEID_0004
+3 ATTRIBUTEID_0009
+4 ATTRIBUTEID_0100
+5 ATTRIBUTEID_0302
+6 ATTRIBUTEID_0006
+7 ATTRIBUTEID_0311
+)
+
+(
+0x01 SDP_ERROR_RES
+0x02 SDP_SEARCH_REQ
+0x03 SDP_SEARCH_RES
+0x04 SDP_ATTRIBUTE_REQ
+0x05 SDP_ATTRIBUTE_RES
+0x06 SDP_SEARCHATTRIB_REQ
+0x07 SDP_SEARCHATTRIB_RES
+)
+0x2600 sdp_max_amount
+250 SDP_MALLOC_SIZE
+0x6e sdp_tid_spp //any number
+
+(
+0x1f11 SDP_UUID_HS_AUDIO_GATEWAY
+)
+
+(
+0X09 SDP_ATTRIBUTE_ID
+0x0a SDP_ATTRIBUTE_RANGE
+)
+
+(//mem_sdp_handle_list
+7 SDP_MAX_HANDLE_NUMBER
+)
+
+ 
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/security.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/security.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/security.format	(working copy)
@@ -0,0 +1,141 @@
+
+memalloc(
+/* moved from bt.format for 3dh5 1021bytes packet buffer */
+17 mem_rxbuf
+
+16 mem_random_number
+16 mem_round_key
+16 mem_kinit
+
+16 mem_input_store
+16 mem_x
+15 mem_y
+1 mem_y15
+17 mem_key_store
+1 mem_key_store_end
+2 memp_ar_key
+2 memp_ar_input
+10 mem_ar_hround
+
+
+1 mem_ec_infinite
+2 mem_ec_loopc
+1 mem_aes_cmac_data_length
+
+0 memdat
+/* ecc calculation */
+
+24 mem_ax
+24  mem_ay
+24  mem_az
+24 mem_bx
+0 mem_ax_256 //32 bytes
+24 mem_by
+8 mem_bz
+16 mem_ay_256 // 32 bytes
+16 mem_cx
+8 mem_az_256 // 32 bytes
+23 mem_cy
+1 mem_cy5
+0 mem_bx_256 // 32 bytes
+24 mem_cz
+8  mem_k
+16 mem_by_256 // 31 bytes
+16 mem_align
+
+0 mem_bz_256  //32 bytes
+0 mem_tmp1
+24 memahbak
+8 mem_tmp5
+0 mem_cx_256  //32 bytes
+16 memahsave
+16  mem_tmp2
+0 mem_cy_256  // 32 bytes
+0  memahsave_end 
+1  mem_addr_padding 
+7   mem_addr_value         /* 12 bytes     */ 
+0 mem_tmp3
+5 mem_t1
+3  mem_addr_value_end   
+15 mem_addr_iocap_end
+1 mem_cy5_256 // 1 byte
+0 mem_cz_256 // 32 bytes
+0 mem_tmp0
+8 mem_t0
+16 mem_tmp0a
+8  mem_t2
+16 mem_k_256 //32 bytes
+16 mem_t3
+8  mem_tmp1_256 //32 bytes
+24 mem_t7
+
+
+32 mem_tmp5_256
+32  mem_tmp2_256
+0 mem_tmp3_256
+32 mem_t1_256
+0 mem_tmp0_256
+32 mem_t0_256
+32 mem_t2_256
+32 mem_t3_256
+32 mem_t7_256
+
+24 mem_p		
+24 mem_a
+24 mem_b
+24 mem_gx
+24 mem_gy
+32 memh0
+
+//p256
+//2 mem_ec_loopc_256
+//32 mem_ax_256
+//32 mem_ay_256
+//32 mem_az_256
+//32 mem_bx_256
+//32 mem_by_256
+//32 mem_bz_256
+//32 mem_cx_256
+//31 mem_cy_256
+//1 mem_cy5_256
+//32 mem_cz_256
+//32 mem_k_256
+
+
+//32 mem_tmp1_256
+//32 mem_tmp5_256
+//32  mem_tmp2_256
+
+//0 mem_tmp3_256
+//32 mem_t1_256
+//0 mem_tmp0_256
+//32 mem_t0_256
+//32 mem_t2_256
+//32 mem_t3_256
+//32 mem_t7_256
+
+32 mem_p_256		
+32 mem_a_256
+32 mem_gx_256
+32 mem_gy_256
+//4 mem_le_keyid
+16 mem_le_slat
+
+
+//64 mem_regext
+//1 mem_regext_index
+
+//16 mem_le_mackey
+
+
+//1 mem_AES_CMAC_flag
+//16 mem_AES_CMAC_temp
+//16 mem_AES_CMAC_M_last
+
+//4 mem_le_gkey
+
+//16 mem_le_r
+
+)
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/simple_pairing.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/simple_pairing.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/simple_pairing.format	(working copy)
@@ -0,0 +1,188 @@
+/* simple pairing page */
+
+memalloc(
+
+//4 mem_hci_ssp_mode
+0 mem_sp_state_start
+1 mem_sp_state
+1 mem_master_sp_state
+1 mem_sp_flag
+1 mem_master_sp_flag
+1 mem_sp_calc
+1 mem_sp_dh_ready
+1 mem_sp_localsm
+1 mem_pairing_auth
+
+0 mem_sp_flag_start
+1 mem_sp_local_key_send_count
+1 mem_sp_remote_key_recv_count
+1 mem_sp_remote_key_invalid
+1 mem_sp_dhkey_invalid
+
+
+4 mem_gkey
+
+
+8 mem_le_pubkey_remote_x_256
+0 mem_sp_pubkey_remote
+24 mem_sp_pubkey_remote_x
+0 mem_sp_pubkey_remote_x_end
+8 mem_le_pubkey_remote_y_256
+24 mem_sp_pubkey_remote_y
+
+8 mem_le_dhkey_256
+24 mem_sp_dhkey
+0 mem_sp_dhkey_end
+
+16 mem_sp_random_local
+0 mem_sp_random_local_end
+16 mem_sp_random_remote
+0 mem_sp_random_remote_end
+0 memresult
+0 mem_sp_calc_result
+4 memh
+4 memg
+4 memf
+4 meme
+0 mem_sp_calc_result_high
+4 memd
+4 memc
+4 memb
+4 mema
+16 mem_sp_check_result
+16 mem_sp_confirm_remote
+16 mem_sp_prarm_stack
+)
+
+xmemalloc(
+1 mem_sp_local_key_invalid
+
+
+32 mem_le_private_key_256
+32 mem_le_pubkey_local_x_256
+32 mem_le_pubkey_local_y_256
+
+24 mem_sp_private_key
+0 mem_sp_pubkey_local
+24 mem_sp_pubkey_local_x
+0 mem_sp_pubkey_local_x_end
+24 mem_sp_pubkey_local_y
+
+1 mem_ssp_enable
+3 mem_sp_iocap_local
+3 mem_sp_iocap_remote
+
+1 mem_flag_mode_ssp_pin
+1 mem_ssp_mode_flag
+1 mem_authentication_passkey_times
+1 mem_passkey_1bit
+1 mem_flag_pairing_state
+
+)
+/* simple pairing status flag */
+(
+  0x00   SP_FLAG_STANDBY
+  0x01   SP_FLAG_COMMIT
+  0x02   LE_SP_FLAG_COMMIT_256
+
+)
+
+/* simple pairing calc flag */
+(
+  0x00   SP_CALC_STANDBY
+  0x01   SP_CALC_PUBKEY
+  0x02   SP_CALC_DHKEY
+  0x03   SP_CALC_PUBKEY_256
+  0x04   SP_CALC_DHKEY_256
+)
+
+/* simple pairing state */
+(
+  0x00   SP_STAT_NULL
+  0x01   SP_STAT_KEY_RECV
+  0x02   SP_STAT_KEY_GENERATE
+  0x03   SP_STAT_KEY_SEND
+  0x04   SP_STAT_COMMIT_CALC
+  0x05   SP_STAT_COMMIT_SEND
+  0x06   SP_STAT_RANDOM_RECV
+  0x07   SP_STAT_RANDOM_SEND
+  0x08   SP_STAT_CONFIRM_RECV
+  0x09   SP_STAT_CONFIRM_CHECK
+  0x0A   SP_STAT_CONFIRM_CALC
+  0x0B   SP_STAT_CONFIRM_SEND
+  0x0C   SP_STAT_LINK_KEY_CALC
+  0x0F   SP_STAT_DONE
+  0x10   SP_STAT_FEATURE_EXT_SEND
+  0x11   SP_STAT_GKEY_CALC
+  /*simple pairing master only*/
+  0x12   SP_MASTER_STAT_START_SKIP
+  0x13   SP_MASTER_STAT_START_DONE
+  0x14   SP_STAT_COMMITMENT_COMPARE
+  0x15   SP_STATE_END
+)
+
+
+/* simple paring invalid flag */
+(
+  0x00   SP_KEY_INVALID
+  0x01   SP_KEY_VALID
+  0x03   SP_KEY_VALID_256
+
+)
+
+/* encapsulated defination for P-192 key */
+(
+  0x01  ENCAPSULATED_MAJOR_TYPE_P192
+  0x01  ENCAPSULATED_MINOR_TYPE_P192
+  0x30  ENCAPSULATED_LEN_P192
+)
+
+/* bluetooth 2.1 support flag */
+(
+  0x00  SIMPLE_PAIRING_ENABLE
+  0x01  ENCRYPTION_PAUSE_ENABLE
+  0x02  EXTENDED_INQUIRY_RESPOSE_ENABLE
+  0x03  SNIFF_SUBRATING_ENABLE
+)
+
+/*mem_sp_localsm*/
+(
+  0x00 DEFAULT_STATEMACHINE
+  0x01 LOCAL_STATEMACHINE
+)
+
+(
+ 0x00 DEFALT_PAIRING_AUTH
+ 0x01 PAIRING_AUTH
+)
+
+(
+1 SSP_MODE_SSP_PIN_FLAG
+2 SSP_MODE_PASSKEY_ENTRY_FLAG
+3 SSP_MODE_JUST_WORK_FLAG
+)
+
+(//ssp mode
+0x040003 SSP_MODE_JUST_WORK_IO_CAP_DATA
+0X040001 SSP_MODE_SSP_PIN_IO_CAP_DATA
+0X040002 SSP_MODE_PASSKEY_IO_CAP_DATA
+)
+
+(
+0x00 DISPLAY_ONLY
+0x01 DISPLAY_YESNO
+0x02 KEYBOARD_ONLY
+0x03 NO_INPUT_NO_OUTPUT
+)
+
+(
+7 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT
+6 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT
+0 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT
+)
+(
+1 FLAG_PAIRING_STATE_PAIRING
+0 FLAG_PAIRING_STATE_NOT_PAIRING
+)
+
+  
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/ui.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/ui.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/ui.format	(working copy)
@@ -0,0 +1,425 @@
+/*****************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                                */
+/* $Author: Administrator $                                                           */
+/* $Id: bt_ui_format.upper,v 1.1 2009-09-28 04:06:17 Administrator Exp $     */
+/************************************************************************/
+
+
+	/* ========= memory ============== */
+memalloc(
+2 mem_UI_data_txbuff_length
+
+1 mem_ipc_skip_continue_proc
+0 mem_ui_timer_temp  //length 4
+4 mem_ipc_rega_temp
+) 
+
+xmemalloc(
+//UI Work area
+1 mem_ipc_lock_bt
+1 mem_ipc_lock_c51
+8 mem_ipc_fifo_bt2c51
+8 mem_ipc_fifo_c512bt
+
+4 mem_ui_timer_last_btclk
+2 mem_discovery_timeout_timer_count
+1 mem_hid_handshake_timer_count
+1 memui_reconnect_mode
+2 mem_ui_state_map
+
+//UI Config area
+1 mem_ui_profile_supported
+2 mem_discovery_timeout
+1 mem_pin_length
+16 mem_pin
+
+)
+/************/
+/* constant */
+/************/
+
+//mem_ui_state_map
+(
+0 UI_STATE_BT_CONNECTED
+1 UI_STATE_BT_SETUP_COMPLETE
+2 UI_STATE_BT_HID_CONN
+3 UI_STATE_BT_HID_HANDSHAKE
+4 UI_STATE_BT_SPP_CONN
+5 UI_STATE_BT_SNIFF
+6 UI_STATE_BT_DISCOVERY
+7 UI_STATE_BT_RECONNECT
+8 UI_STATE_BT_SLAVE_ROLE
+9 UI_STATE_BLE_CONNECTED
+10 UI_STATE_BLE_WRITE_RCV
+11 UI_STATE_BLE_ADV
+)
+
+(
+1 UI_STATE_SPP_NL_AUTO_DISCOVER
+
+)
+
+/* UI state for Headset (memui_HS_State) */ 
+   (
+    0 UI_HEADSET_DISCONNECT
+    1 UI_HEADSET_IDLE                   /* before the responsor HS receive SABM      */
+    2 UI_HEADSET_W4CONNECT
+    3 UI_HEADSET_RINGING
+    4 UI_HEADSET_CONNECTED
+    5 UI_HEADSET_PARING
+  )
+/* memui_BB_State */
+(
+  0 UI_BB_OFF
+  1 UI_BB_IDLE
+  2 UI_BB_DISCOVERY
+  3 UI_BB_CONNECTED_ACTIVE_NO_SCO
+  4 UI_BB_CONNECTED_ACTIVE_WITH_SCO
+  5 UI_BB_CONNECTED_ACTIVE_WAIT_SNIFF
+  6 UI_BB_CONNECTED_SNIFF
+  7 UI_BB_RECONNECT
+  8 UI_BB_CONNECTED_SNIFF_WITH_SCO
+)
+
+/************/
+/* flags    */
+/************/
+  
+/* memui_Misc_Flags */
+  (
+    5 NO_IDLE_TURN_OFF
+    7 ANSWER_RING_FLAG               /* 1 Answer,0 no*/
+  )
+
+/* mem_UI_SCH_Interface */
+  (
+    0  UI_HS_PAIRING 
+    2  UI_REQ_CLOSE_RFCOMM
+    3  UI_LINK_LOST
+    4  UI_REQ_OPEN_SCO
+    6  UI_REQ_CLOSE_SCO
+  )
+  
+/* memui_PassOverKey */
+  (
+    0  ANSWER_RING_BIT
+    0  AG_SEND_RING_BIT
+    1  VOL_UP_BIT
+    2  VOL_DOWN_BIT
+    3  INI_CALL_BIT
+    4  DAIL_LAST_CALL
+    5  END_CALL_BIT
+    6  NOKIA_VOICE_ACTIVE 
+    7  REJECT_CALL_BIT
+  )
+  
+/* memui_reconnect_mode */
+(
+  0 NO_RECONNECTION
+  1 RECONNECT_HID
+  2 RECONNECT_HF
+  3 RECONNECT_HS
+  4 RECONNECT_HID_HF
+  5 RECONNECT_HID_HS
+)
+/* memui_Commands */
+(
+0 BT_CMD_STANDBY
+1 BT_CMD_START_DISCOVERY
+2 BT_CMD_STOP_DISCOVERY
+3 BT_CMD_RECONNECT
+4 BT_CMD_DISCONNECT
+5 BT_CMD_ENTER_SNIFF
+6 BT_CMD_EXIT_SNIFF
+7 BT_CMD_ENTER_SNIFF_SUBRATING
+8 BT_CMD_EXIT_SNIFF_SUBRATING
+9 BT_CMD_SNIFF_TEST
+10 BT_CMD_SET_PIN_CODE
+11 BT_CMD_START_INQUIRY
+12 BT_CMD_STOP_INQUIRY
+13 BT_CMD_START_ADV
+14 BT_CMD_STOP_ADV
+15 BT_CMD_START_DIRECT_ADV
+16 BT_CMD_STOP_DIRECT_ADV
+17 BT_CMD_LE_DISCONNECT
+18 BT_CMD_LE_UPDATE_CONN
+19 BT_CMD_LED_OFF
+20 BT_CMD_LED_ON
+21 BT_CMD_LED_BLINK
+22 BT_CMD_LE_START_CONN
+23 BT_CMD_LE_START_SCAN
+24 BT_CMD_LE_STOP_SCAN
+25 BT_CMD_ENTER_HIBERNATE
+27 BT_CMD_LE_SMP_SECURITY_REQUEST
+29 BT_CMD_ROLE_SWITCH
+30 BT_CMD_BB_RECONN_CANCEL
+31 BT_CMD_STORE_RECONN_INFO_LE
+32 BT_CMD_STORE_RECONN_INFO_BT
+33 BT_CMD_DHKEY_NOT_ACCEPT
+34 BT_CMD_START_24G
+35 BT_CMD_STOP_24G
+36 BT_CMD_PAIR_24G
+37 BT_CMD_STORE_RECONN_INFO
+)
+
+(
+0x00 BT_EVT_NULL
+0x01 BT_EVT_BB_CONNECTED
+0x02 BT_EVT_BB_DISCONNECTED
+0x03 BT_EVT_RECONN_STARTED
+0x04 BT_EVT_RECONN_FAILED
+0x05 BT_EVT_SETUP_COMPLETE
+0x06 BT_EVT_HID_CONNECTED
+0x07 BT_EVT_HID_DISCONNECTED
+0x08 BT_EVT_SPP_CONNECTED
+0x09 BT_EVT_SPP_DISCONNECTED
+0x0A BT_EVT_PINCODE_REQ
+0x0B BT_EVT_ENTER_SNIFF
+0x0C BT_EVT_EXIT_SNIFF
+0x0D BT_EVT_ENTER_SNIFF_SUB
+0x0E BT_EVT_EXIT_SNIFF_SUB
+0x0F BT_EVT_DISCOVERY_STOPED
+0x10 BT_EVT_BUTTON_LONG_PRESSED
+0x12 BT_EVT_HID_HANDSHAKE
+0X13 BT_EVT_RECONN_PAGE_TIMEOUT
+0x14 BT_EVT_LE_CONNECTED
+0X15 BT_EVT_LE_DISCONNECTED
+0x16 BT_EVT_ML2CAP_CONN_REFUSED
+0x17 BT_EVT_BUTTON_ENTER_HIBERNATE
+0x18 BT_EVT_LINKKEY_GENERATE
+0x19 BT_EVT_SWITCH_NOT_ACCEPT
+0x20 BT_EVT_SWITCH_ACCEPT
+0x21 BT_EVT_SNIFF_NOT_ACCEPT
+0x22 BT_EVT_SNIFF_ACCEPT
+0x23 BT_EVT_UNSNIFF_ACCEPT
+0x24 BT_EVT_UNSNIFF_NOT_ACCEPT
+0x25 BT_EVT_BUTTON_ADJUST_DPI
+0x26 BT_EVT_SEND_UNSNIFF_ACCEPT
+0x27 BT_EVT_VIRTUAL_CABLE_UNPLUG
+0x28 BT_EVT_LE_WRITE_REQUEST
+0x29 BT_EVT_LE_ENC_INFO
+0x2a BT_EVT_SWITCH_FAIL_MASTER
+0x2b BT_EVT_SWITCH_SUCCESS_MASTER
+0x2c BT_EVT_BUTTON_DOWN
+0x2d BT_EVT_BUTTON_UP
+0x2e BT_EVT_REMOTE_UNSNIFF
+0x30 BT_EVT_LE_PAIRING_FAIL
+0x31 BT_EVT_LE_PAIRING_SUCCESS
+0x32 BT_EVT_LE_START_ENC
+0X33 BT_EVT_LE_PAUSE_ENC
+0X34 BT_EVT_LE_TK_GENERATE
+0x35 BT_EVT_BT_GKEY_GENERATE
+0x36 BT_EVT_BT_GET_PASSKEY
+0x37 BT_EVT_BT_PAIRING_FAIL
+0x38 BT_EVT_BT_PAIRING_SUCCESS
+0x39 BT_EVT_24G_PAIRING_COMPLETE
+0x3a BT_EVT_24G_ATTEMPT_FAIL
+0x3b BT_EVT_LE_GKEY_GENERATE
+0x3c BT_EVT_24G_ATTEMPT_SUCCESS
+0x3d BT_EVT_STORE_NVRAM
+0x3e BT_EVT_LE_PAIRING_COMPLETE
+0x3F BT_EVT_LE_RECONNECT_COMPLETE
+0x40 BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP
+0x41 BT_EVT_LE_LTK_LOST
+
+
+0x42 BT_EVT_HID_INT_CONNECT
+0x43 BT_EVT_SNIFF_REPORT
+)
+//switch
+(
+0 OFF
+1 ON
+)
+/* memui_mem_lock */
+(
+    0 MEM_UNLOCK
+    1 MEM_LOCK
+)
+/* memui_flag0 */
+(
+    0 UI_USER_DATA_FLAG
+    1 UI_WII_WAITING_SLEEP
+    2 UI_KEYBOARD_SNIFF_SKIP
+)
+/* mem_master_type */
+(
+    0 MTYPE_HID_DEFAULT
+    1 MTYPE_HID_SSP
+    2 MTYPE_SPP
+)
+
+	(	
+	0x01 RECIEVE_SDP_CONN_RES
+	0x02 RECIEVE_SDP_CFG_REQ
+	0x03 RECIEVE_SDP_CFG_RES
+	0x04 RECIEVE_RFCOMM_CONN_RES
+	0x05 RECIEVE_RFCOMM_CFG_REQ
+	0x06 RECIEVE_RFCOMM_CFG_RES
+	0x07 RECIEVE_HID_CTRL_CONN_RES
+	0x08 RECIEVE_HID_CTRL_CFG_REQ
+	0x09 RECIEVE_HID_CTRL_CFG_RES
+	0x0A RECIEVE_HID_INT_CONN_RES
+	0x0B RECIEVE_HID_INT_CFG_REQ
+	0x0C RECIEVE_HID_INT_CFG_RES
+	0x0D RECIEVE_AVCTP_CONN_RES
+	0x0E RECIEVE_AVCTP_CFG_REQ
+	0x0F RECIEVE_AVCTP_CFG_RES
+	0x10 RECIEVE_AVDTP_SIGNAL_CONN_RES
+	0x11 RECIEVE_AVDTP_SIGNAL_CFG_REQ
+	0x12 RECIEVE_AVDTP_SIGNAL_CFG_RES
+	0x13 RECIEVE_AVDTP_MEDIA_CONN_RES
+	0x14 RECIEVE_AVDTP_MEDIA_CFG_REQ
+	0x15 RECIEVE_AVDTP_MEDIA_CFG_RES
+	0x16 RECIEVE_SS_REASULT_HS                  
+	0x17 RECIEVE_SS_REASULT_HF                  
+	0x18 RECIEVE_SS_REASULT_AVTARG		          
+	0x19 RECIEVE_SS_REASULT_OBEX		            
+	0x1A RECIEVE_DLCI0_UA
+	0x1B RECIEVE_HS_PARAM_NEG_RES
+	0x1C RECIEVE_HS_UA
+	0x1D RECIEVE_HS_MODEM_STATUS_RES
+	0x1E RECIEVE_HS_MODEm_STATUS_CMD
+	0x1F RECIEVE_HF_PARAM_NEG_RES   
+	0x20 RECIEVE_HF_UA              
+	0x21 RECIEVE_HF_MODEM_STATUS_RES
+	0x22 RECIEVE_HF_MODEm_STATUS_CMD 
+	0x23 RECIEVE_OBEX_PARAM_NEG_RES     
+	0x24 RECIEVE_OBEX_UA              
+	0x25 RECIEVE_OBEX_MODEM_STATUS_RES
+	0x26 RECIEVE_OBEX_MODEm_STATUS_CMD    
+	0x27 RECIEVE_SPP_PARAM_NEG_RES   
+	0x28 RECIEVE_SPP_UA              
+	0x29 RECIEVE_SPP_MODEM_STATUS_RES
+	0x2A RECIEVE_SPP_MODEm_STATUS_CMD
+	0x2b RECIEVE_SDP_DISCONN_RES
+	)
+
+
+
+	(
+	0 UPPERSM_RP_IDLE
+	1 UPPERSM_RP_SDP_CONN
+	2 UPPERSM_RP_SDP_CONN_WAIT
+	3 UPPERSM_RP_SDP_CFG
+	4 UPPERSM_RP_SDP_CFG_WAIT
+	5 UPPERSM_RP_SS_AVTARG
+	6 UPPERSM_RP_SS_AVTARG_WAIT
+	7 UPPERSM_RP_SS_OBEX
+	8 UPPERSM_RP_SS_OBEX_WAIT
+	9 UPPERSM_RP_SDP_DISCONN
+	10 UPPERSM_RP_SDP_DISCONN_WAIT
+	11 UPPERSM_RP_AVDTP_CONN_WAIT
+	12 UPPERSM_RP_AVCTP_CONN
+	13 UPPERSM_RP_AVCTP_CONN_WAIT
+	14 UPPERSM_RP_AVCTP_CFG
+	15 UPPERSM_RP_AVCTP_CFG_WAIT
+	16 UPPERSM_RP_OBEX_CMD_PN
+	17 UPPERSM_RP_OBEX_CMD_PN_WAIT
+	18 UPPERSM_RP_OBEX_SABM
+	19 UPPERSM_RP_OBEX_SABM_WAIT
+	20 UPPERSM_RP_OBEX_CMD_MS
+	21 UPPERSM_RP_OBEX_CMD_MS_WAIT
+	)
+	(		/*mem_upper_sm_reconn*/
+	0 UPPERSM_RECONN_IDLE		
+	1 UPPERSM_RECONN_SDP_CONN		
+	2 UPPERSM_RECONN_SDP_CONN_WAIT		
+	3 UPPERSM_RECONN_SDP_CFG		
+	4 UPPERSM_RECONN_SDP_CFG_WAIT		
+	5 UPPERSM_RECONN_SS_HS
+	6 UPPERSM_RECONN_SS_HS_WAIT
+	7 UPPERSM_RECONN_SS_HF
+	8 UPPERSM_RECONN_SS_HF_WAIT
+	9 UPPERSM_RECONN_SS_AVTARG		
+	10 UPPERSM_RECONN_SS_AVTARG_WAIT		    
+	11 UPPERSM_RECONN_SS_OBEX		            
+	12 UPPERSM_RECONN_SS_OBEX_WAIT		      
+	13 UPPERSM_RECONN_SDP_DISCONN		        
+	14 UPPERSM_RECONN_SDP_DISCONN_WAIT      
+	15 UPPERSM_RECONN_HID_CTRL_CONN		      
+	16 UPPERSM_RECONN_HID_CTRL_CONN_WAIT		
+	17 UPPERSM_RECONN_HID_CTRL_CFG		      
+	18 UPPERSM_RECONN_HID_CTRL_CFG_WAIT     
+	19 UPPERSM_RECONN_HID_INT_CONN		      
+	20 UPPERSM_RECONN_HID_INT_CONN_WAIT		  
+	21 UPPERSM_RECONN_HID_INT_CFG		        
+	22 UPPERSM_RECONN_HID_INT_CFG_WAIT      
+	23 UPPERSM_RECONN_RFCOMM_CONN		        
+	24 UPPERSM_RECONN_RFCOMM_CONN_WAIT		  
+	25 UPPERSM_RECONN_RFCOMM_CFG		        
+	26 UPPERSM_RECONN_RFCOMM_CFG_WAIT       
+	27 UPPERSM_RECONN_RFCOMM_SABM		        
+	28 UPPERSM_RECONN_RFCOMM_SABM_WAIT		  
+	29 UPPERSM_RECONN_SPP_CMD_PN		        
+	30 UPPERSM_RECONN_SPP_CMD_PN_WAIT		    
+	31 UPPERSM_RECONN_SPP_SABM		          
+	32 UPPERSM_RECONN_SPP_SABM_WAIT		      
+	33 UPPERSM_RECONN_SPP_CMD_MS		        
+	34 UPPERSM_RECONN_SPP_CMD_MS_WAIT       
+	35 UPPERSM_RECONN_HF_CMD_PN		          
+	36 UPPERSM_RECONN_HF_CMD_PN_WAIT		    
+	37 UPPERSM_RECONN_HF_SABM		            
+	38 UPPERSM_RECONN_HF_SABM_WAIT		      
+	39 UPPERSM_RECONN_HF_CMD_MS		          
+	40 UPPERSM_RECONN_HF_CMD_MS_WAIT        
+	41 UPPERSM_RECONN_AVDTPs_CONN		        
+	42 UPPERSM_RECONN_AVDTPs_CONN_WAIT		  
+	43 UPPERSM_RECONN_AVDTPs_CFG		        
+	44 UPPERSM_RECONN_AVDTPs_CFG_WAIT       
+	45 UPPERSM_RECONN_AVDTPm_CONN		        
+	46 UPPERSM_RECONN_AVDTPm_CONN_WAIT		  
+	47 UPPERSM_RECONN_AVDTPm_CFG		        
+	48 UPPERSM_RECONN_AVDTPm_CFG_WAIT       
+	49 UPPERSM_RECONN_AVCTP_CONN		        
+	50 UPPERSM_RECONN_AVCTP_CONN_WAIT		    
+	51 UPPERSM_RECONN_AVCTP_CFG		          
+	52 UPPERSM_RECONN_AVCTP_CFG_WAIT		    
+	53 UPPERSM_RECONN_OBEX_CMD_PN		        
+	54 UPPERSM_RECONN_OBEX_CMD_PN_WAIT		  
+	55 UPPERSM_RECONN_OBEX_SABM		          
+	56 UPPERSM_RECONN_OBEX_SABM_WAIT		    
+	57 UPPERSM_RECONN_OBEX_CMD_MS		        
+	58 UPPERSM_RECONN_OBEX_CMD_MS_WAIT     
+	59 UPPERSM_RECONN_SS_SPP
+	60 UPPERSM_RECONN_SS_SPP_WAIT
+	)
+	(/*mem_UI_profile_supported*/
+	0 support_HID
+	1 support_A2DP
+	2 support_AVRCP
+	3 support_HF
+	4 support_HS
+	5 support_PBAP
+	6 support_SPP
+	)
+	/*mem_upper_sm_ss*/
+	(
+	0 UPPERSM_SS_HS
+	1 UPPERSM_SS_HF
+	2 UPPERSM_SS_AVTARG
+	3 UPPERSM_SS_OBEX
+	)
+
+	(
+	160 UI_HUNDRED_MILLISECOND_TIME
+	0XFF UI_BUTTON_GPIO_DISABLE
+	)
+	(
+	0x01 UI_BB_INCONNECT
+	0x10 UI_BB_DISCONNECT
+	)
+(
+0x00 UI_BUTTON_STATE_DOWN
+0x01 UI_BUTTON_STATE_UP
+)
+
+//mem_ipc_skip_continue_proc
+(
+	0 IPC_CONTINUE_PROCESS
+	1 IPC_SKIP_CONTINUE_PROCESS
+)
+
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/utility.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/utility.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/utility.format	(working copy)
@@ -0,0 +1,97 @@
+/**
+*  @file:bt_utility_format.upper
+*  @author: lei.zhu
+*  utility header file. inlcude timer
+*  Copyright:  (C)Hanlynn Technology    
+*/
+
+memalloc(
+
+/*
+    temp parameter
+*/
+2 mem_hold_contr
+2 mem_hold_contw
+1 mem_fifo_temp
+
+8 mem_pdatatemp
+8 mem_temp //8 bytes
+4 mem_timeup // 4 bytes
+4 mem_rega //4 bytes
+4 mem_regb //4 bytes
+3 mem_regc //3 bytes
+2 mem_contr //2 bytes
+2 mem_contw //2 bytes
+
+1 mem_wakup_from_power_flag
+4 mem_saved_gpio_in
+
+0 mem_shutter_random_mac_data_temp
+0 mem_shutter_config_data_temp
+0 mem_le_adv_channel_map_temp
+0 mem_le_data_len_temp	//1byte
+0 mem_tx_fifo_map_temp
+0 mem_rpn_dlci		//1byte
+0 mem_event_cmd_response_content	//2byte
+0 mem_le_prand		//16byte
+0 mem_AES_CMAC_k	 //16 bytes
+0 mem_regext_index 	//1 bytes
+1 mem_temp_block0
+0 mem_le_data_temp	//15bytes
+15 mem_temp_block1
+0 mem_le_aes_128	//16byte
+0 mem_regext   //64 bytes
+0 mem_AES_CMAC_k1  //16 bytes
+16 mem_temp_block2
+0 mem_AES_CMAC_k2  //16 bytes
+16 mem_temp_block3
+0 mem_AES_CMAC_temp  // 16 bytes
+16 mem_temp_block4
+0 mem_AES_CMAC_M_last // 16 bytes
+1 mem_module_uart_cmd
+1 mem_module_uart_opcode
+1 mem_module_uart_len
+1 mem_module_temp_nl_discard_packet
+12 mem_temp_block5
+0 mem_le_mackey //16 bytes
+0 mem_app_receive_temp
+2 mem_key_value_temp
+2 mem_key_value
+1 mem_key_value_temp1
+1 mem_key_value_temp2
+1 mem_key_value_temp3
+1 mem_key_value_temp4
+1 mem_key_value_temp5
+1 mem_key_value_temp6
+6 mem_temp_block6
+)
+
+
+(
+/*mem_util_timer_flag0_7*/
+    0   UTIL_TIMER_0_USED
+    1   UTIL_TIMER_1_USED
+    2   UTIL_TIMER_2_USED
+    3   UTIL_TIMER_3_USED
+    4   UTIL_TIMER_4_USED
+    5   UTIL_TIMER_5_USED
+    6   UTIL_TIMER_6_USED
+    7   UTIL_TIMER_7_USED
+/*mem_util_timer_flag8_15*/
+    0   UTIL_TIMER_8_USED
+    1   UTIL_TIMER_9_USED
+    2   UTIL_TIMER_10_USED
+    3   UTIL_TIMER_11_USED
+    4   UTIL_TIMER_12_USED
+    5   UTIL_TIMER_13_USED
+    6   UTIL_TIMER_14_USED
+    7   UTIL_TIMER_15_USED
+)
+
+//util fifo param
+(
+
+8 UTIL_FIFO_LEN
+-1 UTIL_FIFO_OFFSET
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/format/var.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/var.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/format/var.format	(working copy)
@@ -0,0 +1,442 @@
+/************************************************************************/
+/* RCS HEADER -- DO NOT ERASE                                           */
+/* $Author: Administrator $                                                     */
+/* $Id: bt_var.osi,v 1.1 2009-09-28 04:06:18 Administrator Exp $   */
+/* Orisil Technology                                                 */
+/************************************************************************/
+
+
+/* packet types */
+(
+  0x02 FHS_PACKET 
+  0x03 DM1_PACKET 
+  0x03 DM1_LMP_PACKET 
+  0x04 DH1_PACKET 
+  0x05 HV1_PACKET 
+  0x06 HV2_PACKET 
+  0x07 HV3_PACKET 
+  0x08 DV_PACKET 
+  0x09 AUX1_PACKET 
+  0x0a DM3_PACKET 
+  0x0b DH3_PACKET 
+  0x0e DM5_PACKET 
+  0x0f DH5_PACKET 
+)
+
+
+/* mem_lmp_respond */
+(
+  0 RESPOND_TO_ALL
+  1 PASS_EVERYTHING
+  2 PASS_ONLY_UNKNOWNS
+  3 RESPOND_TO_LMPS
+)
+/* SCO algorithm defines */
+(
+  0 ULAW
+  1 ALAW
+  2 CVSD
+)
+/* encryption modes */
+(
+  0 NO_ENCRYPTION
+  1 PT_PT_ENCRYPTION
+  2 PT_BROADCAST_ENCRYPTION
+)
+
+/* bits used in mem_lmp_state1 variable */
+(
+  0 LMP_STATE_DETACH
+  1 LMP_STATE_HOLD
+  2 LMP_STATE_SNIFF
+  3 LMP_STATE_PARK
+  4 LMP_STATE_WAIT_SCO_CREATE
+  5 LMP_STATE_WAIT_SCO_KILL
+  6 LMP_STATE_SCO3
+  7 LMP_STATE_WAIT_SCO_START
+)
+/* mem_lmp_state2 */
+(
+  0 LMP_WAIT_FOR_SNIFF_ACCEPT
+  1 LMP_WAIT_FOR_PARK_ACCEPT
+  2 LMP_SEND_UNPARK_ACCEPTED
+  3 LMP_SEND_ENCRYPTION_START
+  4 LMP_SEND_ENCRYPTION_STOP
+  5 MESSAGE_QUEUE
+  7 LMP_STATE_WAIT_BEACON
+)
+/* mem_lmp_state3 */
+(
+ 0 INQUIRY_STATE_CHECK
+ 1 HOST_DELAY_MESSAGE
+ 2 VARIABLE_DELAY
+ 3 TEST_MODE_START_LOOPBACK
+ 4 TEST_MODE_START_PATTERN
+ 5 PARSE_TEST_CONTROL_MESSAGE
+ 6 H_AUTH_SEND_COMB_KEY
+)
+/* mem_rx_status */
+(
+  0 FROM_MASTER
+)
+/* mem_ms_flag */
+(
+  0 MS_RECEIVE_SWITCH_REQ
+  1 MS_SEND_SETUP_COMPLATE
+)
+/* mem_conn_sm */
+(
+  0 CONN_SM_STANDBY
+  1 CONN_SM_WAIT_PAGE
+  2 CONN_SM_SEND_FEATURES
+  3 CONN_SM_WAIT_FEATURES_RES
+  4 CONN_SM_SEND_CONN_REQ
+  5 CONN_SM_WAIT_CONN_ACCEPT
+  6 CONN_SM_AUTH_PAIR
+  7 CONN_SM_AUTH_PAIR_WAIT
+  8 CONN_SM_WAIT_MUTAL_AUTH
+  9 CONN_SM_ENCRYPT
+  0xa CONN_SM_ENCRYPT_WAIT
+  0xb CONN_SM_ENCRYPT_WAIT_CLEAR
+  0xc CONN_SM_SEND_SETUP_COMPLETE
+  0xd CONN_SM_WAIT_SETUP_COMPLETE 
+  0xe CONN_SM_SEND_SWITCH
+  0xf CONN_SM_DETACH_DELAY
+  0x10 CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION
+  0x11 CONN_SM_DELAY_RESTART_CONNECTION
+  0x12 CONN_SM_SEND_VERSION
+  0X13 CONN_SM_WAIT_VERSION
+  0x14 CONN_SM_SEND_FEATURES_EXT
+  0x15 CONN_SM_WAIT_FEATURES_EXT
+  0x16 CONN_SM_PAIRING
+  0x17 CONN_SM_AUTH
+  0x18 CONN_SM_PAIRING_WAIT
+  0x19 CONN_SM_AUTH_WAIT
+  0x1a CONN_SM_DONE
+  0x1b CONN_SM_WAIT_DONE
+)
+
+/* btStateConn1 */
+(
+  0 CONN_STANDBY
+  1 CONN_MASTER_SEND_CONN_REQ
+  2 CONN_MASTER_WAIT_FOR_CONN_ACCEPTED
+  3 CONN_MASTER_AUTH
+  4 CONN_MASTER_WAIT_FOR_FEATURES
+  5 CONN_MASTER_WAIT_FOR_SETUP_COMPLETE
+  6 CONN_MASTER_WAIT_FOR_MAX_SLOT
+  7 CONN_SLAVE_CONN_REQUESTED
+  8 CONN_SLAVE_WAIT_FOR_SETUP_COMPLETE
+  9 CONN_SLAVE_AUTH
+  10 CONN_USING_HOST_OPCODE
+  11 CONN_SLAVE_AUTH_WAIT
+  12 CONN_SLAVE_ENCRYPT_WAIT
+)
+
+/* mem_lmp_conn_state */
+(
+  0 RECEIVED_CONN_REQ
+  1 SENT_CONN_REQ
+  2 RECEIVED_SETUP_COMPLETE
+  3 SENT_SETUP_COMPLETE
+  4 HOST_CONNECTION_MADE
+  6 INIT_COMPLETE
+  7 SNIFF_NEGOTIATE
+)
+/* btStateAuth1 */
+(
+  0 WAIT_FOR_KINIT
+  1 WAIT_FOR_LKA
+  2 WAIT_FOR_LKB
+  3 WAIT_FOR_SRES
+  4 EXAMINE_RECEIVED_SRES
+  5 SEND_AU_RAND
+  6 WAIT_FOR_KC
+  7 DELAYED_ENCRYPT_RESPONSE
+)
+/* btStateAuth2 */
+(
+  0 SENT_SRES
+  1 RECEIVED_IN_RAND
+  2 SENT_AU_RAND
+  3 AUTHENTICATION_FAILED
+  4 AUTHENTICATION_PASSED
+  5 STARTED_AUTH
+  6 SENT_COMB_KEY
+  7 SENT_IN_RAND
+)
+/* btStateAuth3 */
+(
+  0 RECEIVED_AU_RAND
+  1 RECEIVED_SRES
+  2 MUTUALLY_AUTHENTICATE
+)
+/* btStateHost */
+(
+  0 H_AUTH_STARTED
+  2 H_ENCRYPTION_MODE_REQ_PT
+  3 H_ENCRYPTION_KEY_SIZE
+  4 H_ENCRYPTION_START
+  5 H_ENCRYPTION_STOP
+  6 H_AUTH_SECOND_TRY
+)
+/* btStateEncrypt2 */
+(
+  0 RECEIVED_ENCRYPT_MODE_REQ_PT
+  1 RECEIVED_ENCRYPT_KEY_SIZE
+  2 RECEIVED_ENCRYPT_START
+  3 RECEIVED_ENCRYPT_STOP
+  4 STARTED_ENCRYPT_START
+)
+/* mem_ms_state */
+(
+  0x00 MS_STANDBY
+  0x11 M_MINIT_1
+  0x12 M_MINIT_2
+  0x20 M_SINIT_0
+  0x30 S_MINIT_0
+  0x31 S_MINIT_1
+  0x32 S_MINIT_2
+  0x41 S_SINIT_1
+  0x42 S_SINIT_2
+  0x43 S_SINIT_3
+)
+/* mem_test_mode */
+(
+  0 TEST_MODE_ALLOWED
+  1 TEST_MODE_ACTIVE
+)
+/* values for mem_tester_emulate */
+(
+  0x00 NO_TEST_MODE
+  0x00 CONTINUOUS_TRANSMIT
+  0x10 TRANSMIT_TEST
+  0x08 LOOPBACK
+)
+
+/* mem_tx_misc */
+(
+  1 SEND_TX_ADDR
+)
+/* BBHWREG_page_stat */
+(
+  5 PAGE_MODE_END
+)
+/* host_return_parameters_status codes */
+(
+  0x00 HOST_RETURN_SUCCESS
+  0x01 HOST_RETURN_SLAVE_CANT_ISSUE
+  0x02 HOST_RETURN_NO_CONNECTION
+  0x04 HOST_RETURN_PAGE_TIMEOUT
+  0x05 HOST_RETURN_INQUIRY_TIMEOUT
+  0x08 HOST_RETURN_CONNECTION_TIMEOUT
+  0x09 HOST_RETURN_MAX_NUM_CONNECTIONS
+  0x0a HOST_RETURN_MAX_NUM_SCO
+  0x0b HOST_RETURN_MAX_NUM_ACL
+  0x0c HOST_RETURN_SECURITY_REASONS
+  0x10 HOST_RETURN_HOST_TIMEOUT
+  0x11 HOST_RETURN_UNSUPPORTED_FEATURE_PARAMETER
+  0x13 HOST_RETURN_OTHER_END_USER
+  0x14 HOST_RETURN_OTHER_END_LOW_RESOURCE
+  0x15 HOST_RETURN_OTHER_END_POWER_OFF
+  0x16 HOST_RETURN_LOCAL_HOST
+  0x18 HOST_RETURN_PAIRING_NOT_ALLOWED
+  0x19 HOST_RETURN_UNKNOWN_PDU
+  0x1a HOST_RETURN_UNSUPPORTED_REMOTE_FEATURE
+  0x1d HOST_RETURN_SCO_AIR_MODE_REJECTED
+  0x20 HOST_RETURN_UNSUPPORTED_LMP_VALUE
+  0x21 HOST_RETURN_AUTHENTICATION_FAILURE
+  0x22 HOST_RETURN_CHANGED_EXISTING_SCO
+  0x23 HOST_RETURN_HOST_REJECTED
+  0x24 HOST_RETURN_UNSPECIFIED_ERROR
+  0x25 HOST_RESET
+  0x26 HOST_RETURN_BAD_HANDLE
+
+  0x00 HOST_RETURN_ACCEPT_COMMAND
+  0x01 HOST_RETURN_REJECT_COMMAND
+)
+/* host_present */
+(
+  0 HOST_IS_PRESENT
+  1 BCI_IS_PRESENT
+  2 DONT_INIT_RADIO
+)
+/* mem_master_state */
+(
+  0 MASTER_STATE_STANDBY
+  1 MASTER_INQUIRY
+)
+/* misc */
+(
+  92 SECOND_SWITCH_REQ
+  93 SLAVE_DELAY_DETACH
+  94 MASTER_DELAY_DETACH
+  95 UNSNIFF_DELAY_DETACH
+  0 WE_STARTED_AS_MASTER
+  1 WE_STARTED_AS_SLAVE
+)
+/* mem_host_commands */
+(
+  0x01 HOST_INQUIRY
+  0x02 HOST_INQUIRY_CANCEL
+  0x03 HOST_CREATE_CONNECTION
+  0x04 HOST_DISCONNECT_CONNECTION
+  0x05 HOST_ADD_SCO_REQUEST
+  0x06 HOST_REMOTE_NAME_REQUEST
+  0x07 HOST_WRITE_SUPPORTED_FEATURES
+  0x08 HOST_SET_TX_LEVEL
+  0x09 HOST_SET_RX_LEVEL
+  0x0a HOST_SNIFF_REQUEST
+  0x0b HOST_UNSNIFF_REQUEST
+  0x0c HOST_WRITE_LINK_SUPERVISION_TIMEOUT
+  0x0e HOST_WRITE_SCAN_ENABLE
+  0x0f HOST_READ_AUDIO_QUALITY
+  0x10 HOST_ENABLE_DEVICE_UNDER_TEST
+  0x14 HOST_BUTTON_CONFIGURE
+  0x15 HOST_SET_LOW_BATTERY_LEVEL
+  0x16 HOST_WRITE_LOCAL_NAME
+  0x17 HOST_WRITE_LOCAL_PIN
+  0x18 HOST_KILL_SCO_REQUEST
+  0x19 HOST_QOS_REQ
+
+  0x1a HOST_FEATURES_REQUEST
+  0x1b HOST_VERSION_REQUEST
+  0x1c HOST_TIMING_REQUEST
+  0x1d HOST_CLK_OFFSET_REQUEST
+  0x1e HOST_AUTHENTICATE
+  0x1f HOST_START_ENCRYPTION
+  0x20 HOST_STOP_ENCRYPTION
+  0x21 HOST_HOLD_REQUEST
+  0x22 HOST_HOLD_FORCE
+  0x23 HOST_PARK_REQUEST
+  0x24 HOST_MOD_BEACON
+  0x25 HOST_SET_BROADCAST_SCAN_WINDOW
+  0x26 HOST_UNPARK_PM_REQUEST
+  0x27 HOST_UNPARK_BD_REQUEST
+  0x28 HOST_SLAVE_REQUEST_UNPARK
+  0x29 HOST_DECREASE_POWER_REQUEST
+  0x2a HOST_INCREASE_POWER_REQUEST
+  0x2b HOST_SEND_PREFERRED_RATE
+  0x2c HOST_MAX_SLOT_REQ
+  0x2d HOST_MAX_SLOT_FORCE
+  0x2e HOST_PAGE_MODE_REQUEST
+  0x2f HOST_PAGE_SCAN_MODE_REQUEST
+  0x30 HOST_MASTER_SLAVE_SWITCH
+  0x31 HOST_SEND_AUTO_RATE
+  0x32 HOST_PAGE_CANCEL
+  0x33 HOST_CHANGE_LINK_KEY
+  0x34 HOST_RADIO_READ
+  0x35 HOST_RADIO_WRITE
+  0x36 HOST_REMOTE_SLAVE_INIT_UNPARK_REQUESTED
+
+  0x40 HOST_REMOTE_CONNECTION_REQUESTED
+  0x41 HOST_REMOTE_DETACH
+  0x42 HOST_REMOTE_SCO_CREATE_REQUESTED
+  0x43 HOST_REMOTE_SCO_KILL_REQUESTED
+  0x44 HOST_REMOTE_PARK_REQUESTED
+  0x45 HOST_REMOTE_UNPARK_REQUESTED
+  0x46 HOST_REMOTE_SNIFF_REQUESTED
+  0x47 HOST_REMOTE_UNSNIFF_REQUESTED
+  0x48 HOST_REMOTE_HOLD_REQUESTED
+  0x49 HOST_REMOTE_AUTHENTICATION
+  0x4a HOST_REMOTE_START_ENCRYPTION_REQUESTED
+  0x4b HOST_REMOTE_STOP_ENCRYPTION_REQUESTED
+  0x4c HOST_MODE_CHANGE_EVENT
+  0x4d HOST_REMOTE_TEST_ACTIVATE
+  0x4e HOST_REMOTE_TEST_CONTROL
+  0x4f HOST_REMOTE_TIMING_REQUEST
+)
+/* BCI interface (not used if not compiled in ) */
+(
+  0x01 BCI_INQUIRY
+  0x02 BCI_INQUIRY_CANCEL
+  0x03 BCI_CREATE_CONNECTION
+  0x04 BCI_DISCONNECT
+  0x05 BCI_ADD_SCO_CONNECTION
+  0x06 BCI_REMOTE_NAME_REQUEST
+  0x07 BCI_WRITE_SUPPORTED_FEATURES
+  0x08 BCI_SET_TX_POWER_LEVEL
+  0x09 BCI_SET_RX_POWER_LEVEL
+  0x0a BCI_SNIFF_MODE
+  0x0b BCI_EXIT_SNIFF_MODE
+  0x0c BCI_WRITE_LINK_SUPERVISION_TIMEOUT
+  0x0d BCI_WRITE_PAGE_TIMEOUT
+  0x0e BCI_WRITE_SCAN_ENABLE
+  0x0f BCI_GET_AUDIO_QUALITY
+  0x10 BCI_ENABLE_DEVICE_UNDER_TEST
+  0x11 BCI_SEND_DATA
+  0x12 BCI_REGISTER_SERVICE_RECORD
+  0x13 BCI_SERVICE_SEARCH_ATTRIB_REQ
+  0x14 BCI_BUTTON_CONFIGURE
+  0x15 BCI_SET_LOW_BATTERY_LEVEL
+  0x16 BCI_WRITE_LOCAL_NAME
+  0x17 BCI_WRITE_LOCAL_PIN
+  0x18 BCI_REMOVE_SCO_CONNECTION
+  0x19 BCI_QUALITY_OF_SERVICE
+  0x40 BCI_REMOTE_CONNECTION_REQUEST
+  0x41 BCI_REMOTE_DETACH
+  0x42 BCI_REMOTE_ADD_SCO_REQUEST
+  0x43 BCI_REMOTE_REMOVE_SCO_REQUEST
+  0x44 BCI_REMOTE_PARK_REQUEST
+  0x45 BCI_REMOTE_UNPARK_REQUEST
+  0x46 BCI_REMOTE_SNIFF_REQUEST
+  0x47 BCI_REMOTE_UNSNIFF_REQUEST
+  0x48 BCI_REMOTE_HOLD_REQUEST
+  0x49 BCI_REMOTE_AUTHENTICATION_PAIRING_REQUEST
+  0x4a BCI_REMOTE_START_ENCRYPTION_REQUEST
+  0x4b BCI_REMOTE_STOP_ENCRYPTION_REQUEST
+  0x4c BCI_MODE_CHANGE_EVENT
+)
+/* mode changes */
+(
+  0 MODE_CHANGE_ACTIVE
+  1 MODE_CHANGE_SNIFFING
+  2 MODE_CHANGE_PARKED
+  3 MODE_CHANGE_HOLDING
+  4 MODE_CHANGE_SCO_ADDED
+  5 MODE_CHANGE_SCO_REMOVED
+  6 MODE_CHANGE_ACL_CONNECTION
+  7 MODE_CHANGE_DISCONNECT
+  8 MODE_CHANGE_SCO_CHANGED
+  9 MODE_CHANGE_ENCRYPTING
+  10 MODE_CHANGE_NOT_ENCRYPTING
+  11 MODE_CHANGE_BUTTON_UP
+  12 MODE_CHANGE_BUTTON_DOWN
+  13 MODE_CHANGE_BATTERY_LOW
+  14 MODE_CHANGE_RESET
+  15 MODE_CHANGE_INQUIRY_CANCELED_RMTCMD
+  16 MODE_ACTIVE_MSSWITCH_PASSED
+  17 MODE_ACTIVE_MSSWITCH_FAILED
+)
+/* mem_battery - low nibble is level information, upper nibble is status info */
+(
+  6 BATTERY_CHECK_LEVEL
+  7 BATTERY_SENT_STATUS
+)
+/* mem_radio_version */
+(
+  0x02 RADIO_2001
+  0x12 RADIO_2002
+  0x32 RADIO_2002_DDM
+  0x42 RADIO_1008A1
+  0x52 RADIO_1018A0
+)
+/* mem_slave_initiated_conn */
+(
+  0 SLAVE_INIT_AUTHENTICATION
+  1 SLAVE_INIT_ENCRYPTION
+  2 SLAVE_INIT_MASTER_SLAVE_SWITCH
+)
+/* connection_options */
+(
+  0 CONNECTION_AUTH
+  1 CONNECTION_ENCRYPT
+  2 CONNECTION_SWITCH
+  3 CONNECTION_ACL
+  4 CONNECTION_FEATURE_EXT
+)
+/* mem_debug_config */
+(
+  7 AA_INSERTION
+)
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/app.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/app.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/app.prog	(working copy)
@@ -0,0 +1,469 @@
+app_init:
+	bpatch patch16_2,mem_patch16
+	fetch 1,mem_device_option
+	branch app_init,blank				/* wait ram to be initialized */
+	beq dvc_op_module,module_init
+	rtn
+	
+app_lpm_init:
+	bpatch patch16_3,mem_patch16
+	jam 0,mem_tester_emulate
+	jam 0,mem_debug_config
+	jam 0, mem_lch_code
+	setarg 0
+	store 5,mem_sp_state_start
+	fetch 1,mem_device_option
+	branch app_lpm_init,blank				/* wait ram to be initialized */
+	beq dvc_op_module,module_lpm_init
+app_lpm_init0:
+	rtn
+
+	
+app_process_idle:
+	call ui_dispatch
+	call check_51cmd
+	call app_process_bb_event
+	fetch 2,mem_cb_idle_process
+	branch callback_func
+	
+app_process_bt:
+	fetch 2,mem_cb_bt_process
+	branch callback_func
+	
+app_process_ble:
+	fetch 2,mem_cb_le_process
+	branch callback_func
+
+app_process_bb_event:
+	bpatch patch16_4,mem_patch16
+	//return if c51 need to process bb event
+	arg mem_ipc_fifo_bt2c51,rega
+	call fifo_out
+	rtn blank
+	//reaching here mains c51 cannot get bb event.
+	copy pdata,regc
+	call app_event_normal_process
+	branch app_process_bb_event_priority
+	
+app_discard_event:
+	arg 0,regc
+	rtn
+
+//************************************************//
+//*APP BB EVENT NORMAL PROCESS**//
+//************************************************//
+app_event_normal_process:
+	beq BT_EVT_BB_CONNECTED,app_evt_bt_conn
+	beq BT_EVT_BUTTON_LONG_PRESSED,app_evt_button_long_pressed
+	beq BT_EVT_SETUP_COMPLETE,app_evt_setup_complete
+	beq BT_EVT_HID_HANDSHAKE,app_evt_hid_handshake
+	beq BT_EVT_HID_CONNECTED,app_bb_event_hid_connected
+	beq BT_EVT_RECONN_FAILED,app_bb_event_reconn_failed
+	beq BT_EVT_BB_DISCONNECTED,app_bb_event_bb_disconn
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,app_bb_event_reconn_failed	
+	beq BT_EVT_LE_CONNECTED,app_le_event_bb_connected
+	beq BT_EVT_LE_DISCONNECTED,app_le_event_bb_disconn
+	beq BT_EVT_RECONN_STARTED,app_event_reconn_start
+	beq BT_EVT_ENTER_SNIFF,app_event_enter_sniff
+	beq BT_EVT_EXIT_SNIFF,app_event_exit_sniff
+	
+	beq BT_EVT_ML2CAP_CONN_REFUSED,app_event_ml2cap_conn_refused
+	beq BT_EVT_LINKKEY_GENERATE,app_event_linkkey_generate
+	beq BT_EVT_SWITCH_FAIL_MASTER,app_event_switch_fail_master
+	beq BT_EVT_SWITCH_SUCCESS_MASTER,app_event_switch_success
+	rtn
+
+
+app_evt_bt_conn:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set0 APP_DISC_BY_BUTTON ,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_event_switch_success:
+	jam 0,mem_switch_fail_master_count
+	rtn	
+
+app_event_switch_fail_master:
+	fetch 1,mem_switch_fail_master_count
+	increase 1,pdata
+	store 1,mem_switch_fail_master_count
+	sub pdata,1,null
+	branch app_bt_role_switch,positive
+	jam 0,mem_switch_fail_master_count
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_SWITCH_FAIL,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch app_bt_disconnect
+	
+app_process_bb_event_priority:
+	fetch 2,mem_cb_bb_event_process
+	branch callback_func
+
+app_check_wake_lock:
+	fetch 2,mem_cb_check_wakelock
+	branch callback_func
+	
+app_will_enter_lpm:
+	fetch 2,mem_cb_before_lpm
+	branch callback_func
+
+app_event_linkkey_generate:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_PAIRING ,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch app_bt_store_reconn_info
+	
+app_event_reconn_start:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_RECONN,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_evt_setup_complete:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SETUP_COMPLETE,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_SETUP_DONE,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_evt_hid_handshake:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_HANDSHAKE,pdata
+	store 2,mem_ui_state_map
+	rtn
+	
+app_event_enter_sniff:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SNIFF,pdata
+	store 2,mem_ui_state_map
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_AFTER_SNIFF,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_event_exit_sniff:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_SNIFF,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_le_event_bb_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	rtn
+	
+app_le_event_bb_disconn:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_CONNECTED,pdata
+	store 2,mem_ui_state_map
+	branch app_lpm_mult_disable
+	
+app_bb_event_hid_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONN,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_evt_button_long_pressed:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_BY_BUTTON,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_event_ml2cap_conn_refused:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_L2CAP_REFUSED,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	branch  app_bt_disconnect
+
+
+app_evt_timer:
+	bpatch patch16_5,mem_patch16
+	store 1,mem_app_evt_timer_count
+app_evt_100ms_loop:
+	fetch 1,mem_app_evt_timer_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_app_evt_timer_count
+	call app_lpm_wake_auto_lock_timer
+	call app_unsniff_delay_timer
+	call app_discovery_timer
+	fetch 2,mem_cb_event_timer
+	call callback_func
+	branch app_evt_100ms_loop
+
+
+//regc:timer addr
+//regb:timer up call back fuction
+timer_single_step:
+	ifetch 1,regc
+	rtn blank
+	pincrease -1
+	istore 1,regc
+	nrtn blank
+	copy regb,pdata
+	branch callback_func
+
+//regc:timer addr
+//regb:timer up call back fuction
+timer_single_step_2B:
+	ifetch 2,regc
+	rtn blank
+	pincrease -1
+	istore 2,regc
+	nrtn blank
+	copy regb,pdata
+	branch callback_func
+	
+app_unsniff_delay_timer:
+	arg mem_unsniff2sniff_timer_count,regc
+	arg app_unsniff_delay_timeout,regb
+	branch timer_single_step
+	
+app_unsniff_delay_timeout:
+	call context_check_idle
+	branch app_bt_enter_sniff,zero
+	rtn
+
+
+app_discovery_timer:
+	arg mem_discovery_timeout_timer_count,regc
+	arg app_discovery_timeout,regb
+	branch timer_single_step_2B
+	
+app_discovery_timeout:
+	call app_bt_stop_discovery
+	call app_led_off
+	fetch 2,mem_cb_discovry_timeout
+	branch callback_func
+
+	
+app_bb_event_reconn_failed:
+	call app_disconn_reason_flag_clear
+app_clear_reconnect_flag:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+app_bb_event_bb_disconn:
+	jam 0,mem_unsniff2sniff_timer_count
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_RECONNECT,app_bb_event_bb_reconn_disconn
+	isolate0 UI_STATE_BT_SETUP_COMPLETE,pdata
+ 	call app_discard_event,true
+app_bb_event_bb_reconn_disconn:
+	bpatch patch16_6,mem_patch16
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_CONNECTED,pdata
+	set0 UI_STATE_BT_SETUP_COMPLETE,pdata
+	set0 UI_STATE_BT_HID_CONN,pdata
+	set0 UI_STATE_BT_HID_HANDSHAKE,pdata
+	set0 UI_STATE_BT_RECONNECT,pdata
+	store 2,mem_ui_state_map
+	branch app_lpm_mult_disable
+	
+app_bb_hibernate:
+	call app_disconn_reason_clear
+	branch app_enter_hibernate
+
+	
+app_disconn_reason_clear:
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	rtn
+app_disconn_reason_flag_clear:
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+app_disconn_reason_collect_bt:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+	
+app_disconn_reason_collect_ble:
+	fetch APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	set1 APP_DISC_BLE,pdata
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason
+	setarg 0
+	store APP_DISC_RSN_SIZE,mem_app_disconn_reason_flag
+	rtn
+
+	
+//************************************************//
+//********APP SHARED FUNCSIONS*******//
+//************************************************//
+
+
+app_check_sniff:
+	fetch 1,mem_ui_state_map
+	isolate1 UI_STATE_BT_SNIFF,pdata
+	rtn
+
+//*****************************************//
+//*****************API********************//
+//*****************************************//
+//app_clearflag_store:
+//	setarg 0
+//	branch app_flag_store
+
+app_start_auto_sniff:
+	fetch 1,mem_unsniff2sniff_timer
+	store 1,mem_unsniff2sniff_timer_count
+	rtn	
+	
+app_get_lpm_wake_lock:
+	arg wake_lock_app,queue
+	branch lpm_get_wake_lock
+
+app_put_lpm_wake_lock:
+	arg wake_lock_app,queue
+	branch lpm_put_wake_lock
+	
+app_lpm_wake_auto_lock:
+	jam  LPM_WAKE_UP_DELAY_TIMER,mem_wake_up_delay_timer
+	branch app_get_lpm_wake_lock
+	
+app_lpm_wake_auto_lock_timer:
+	arg mem_wake_up_delay_timer,regc
+	arg app_put_lpm_wake_lock,regb
+	branch timer_single_step
+
+app_l2cap_flow_control_enable:
+	jam L2CAP_FLOW_CTRL_ENABLE,mem_l2cap_flow_ctrl_flag
+	rtn
+
+app_l2cap_flow_control_disable:
+	jam L2CAP_FLOW_CTRL_DISABLE,mem_l2cap_flow_ctrl_flag
+	rtn
+	
+app_bt_set_pincode:
+	jam BT_CMD_SET_PIN_CODE,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_role_switch:
+	jam BT_CMD_ROLE_SWITCH,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_bt_start_reconnect:
+	bpatch patch16_7,mem_patch16
+	fetch 1,mem_app_connection_options
+	store 1,mem_connection_options
+	jam APP_FLAG_RECONNECT,mem_reconnect_flag
+	jam BT_CMD_RECONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd	
+	
+app_bt_reconnect_cancel:
+	jam BT_CMD_BB_RECONN_CANCEL,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_bt_disconnect:
+	jam BT_CMD_DISCONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd	
+
+app_bt_start_discovery_short:
+	fetch 2,mem_discovery_timeout
+	store 2,mem_discovery_timeout_timer_count
+app_bt_start_discovery_led_blink:
+	call app_led_start_blink
+app_bt_start_discovery:
+	jam BT_CMD_START_DISCOVERY,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_stop_discovery:
+	setarg 0
+	store 2,mem_discovery_timeout_timer_count
+	jam BT_CMD_STOP_DISCOVERY,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_direct_adv:
+	jam BT_CMD_START_DIRECT_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_ble_stop_direct_adv:
+	jam BT_CMD_STOP_DIRECT_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_stop_adv:
+	jam BT_CMD_STOP_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_adv:	
+	jam BT_CMD_START_ADV,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_scan:
+	jam BT_CMD_LE_START_SCAN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_stop_scan:
+	jam BT_CMD_LE_STOP_SCAN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_start_conn:
+	jam BT_CMD_LE_START_CONN,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_ble_disconnect:
+	jam BT_CMD_LE_DISCONNECT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_led_start_blink:	
+	jam BT_CMD_LED_BLINK,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_led_on:
+	jam BT_CMD_LED_ON,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_led_stop_blink:
+app_led_off:
+	jam BT_CMD_LED_OFF,mem_fifo_temp
+	branch ui_ipc_send_cmd
+	
+app_enter_hibernate:
+	jam BT_CMD_ENTER_HIBERNATE,mem_fifo_temp 
+	branch ui_ipc_send_cmd
+	
+app_bt_sniff_exit:
+	jam BT_CMD_EXIT_SNIFF,mem_fifo_temp
+	branch  ui_ipc_send_cmd
+	
+app_bt_enter_sniff:
+	jam BT_CMD_ENTER_SNIFF,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_ble_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO_LE,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_bt_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO_BT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_store_reconn_info:
+	jam BT_CMD_STORE_RECONN_INFO,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+app_lpm_mult_enable:
+	set1 mark_lpm_mult_enable,mark
+	rtn
+
+app_lpm_mult_disable:
+	set0 mark_lpm_mult_enable,mark
+	rtn
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/app_module.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/app_module.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/app_module.prog	(working copy)
@@ -0,0 +1,1336 @@
+
+ifdef COMPILE_MODULE
+
+
+
+
+module_init:
+	rtn wake
+	call le_modified_name
+	setarg module_process_idle
+	store 2,mem_cb_idle_process
+	setarg module_bt_conn_process
+	store 2,mem_cb_bt_process
+	setarg module_process_bb_event
+	store 2,mem_cb_bb_event_process
+	setarg module_le_conn_process
+	store 2,mem_cb_le_process
+	setarg module_lpm_lock
+	store 2,mem_cb_check_wakelock
+	setarg module_hci_cmd_transmit_le_notify
+	store 2,mem_cb_ble_transmit
+	setarg module_hci_event_receive_spp_data
+	store 2,mem_cb_receive_spp_data
+	setarg module_le_receive_data
+	store 2,mem_cb_att_write
+	setarg module_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	call module_spp_clear_last_transmite_clock
+	bpatch patch17_0,mem_patch17
+	call module_lpm_uart_init
+	call module_gpio_init
+	call check_module_disabled
+	branch module_hci_event_enter_standby_mode
+
+
+module_lpm_uart_init:
+	fetch 2,IPC_M02BT_END_ADDR
+	store 2,core_sec_readdr
+	fetch 2,IPC_M02BT_START_ADDR
+	store 2,core_sec_rsaddr
+	copy pdata,contru
+	
+	fetch 2,IPC_BT2M0_END_ADDR
+	store 2,core_sec_teaddr
+	fetch 2,IPC_BT2M0_START_ADDR
+	store 2,core_sec_tsaddr
+	copy pdata,contwu
+	rtn
+	
+
+
+module_lpm_init:
+	call module_lpm_uart_init
+	branch module_spp_clear_last_transmite_clock
+//	branch module_gpio_init
+	
+module_gpio_init:
+	rtn
+module_lpm_lock:
+	fetch 1,IPC_HOLD_BT
+	beq 1,app_get_lpm_wake_lock
+	fetch 1,mem_le_pairing_state
+	bne FLAG_LE_PAIRING_NULL,module_lpm_lock_check_pairing
+	branch app_put_lpm_wake_lock
+module_lpm_lock_check_pairing:
+	beq FLAG_LE_PAIRING_END,app_put_lpm_wake_lock
+	branch app_get_lpm_wake_lock
+	
+module_le_conn_process:
+	rtn
+
+module_bt_conn_process:
+	call module_spp_enter_sniff
+	branch module_control_air_flow
+
+module_spp_enter_sniff:
+	rtn
+	fetch 1,mem_ui_state_map
+	bbit0 UI_STATE_BT_SPP_CONN,module_spp_clear_last_transmite_clock
+	bpatch patch17_1,mem_patch17
+	setarg 0x3eff
+	fetcht 4,mem_last_transmite_clock
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_SNIFF,module_spp_clear_last_transmite_clock
+	fetch 1,mem_module_flag
+	rtnbit1 MOUDLE_TASK_SNIFF
+	call module_set_sniff_task_flag
+	call app_bt_enter_sniff
+module_spp_clear_last_transmite_clock:
+	copy clkn_bt,pdata
+	store 4,mem_last_transmite_clock
+	rtn
+	
+
+module_process_idle:
+	call module_control_air_flow
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	branch module_process
+
+	
+module_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_BB_CONNECTED,module_process_bb_conn
+	beq BT_EVT_BB_DISCONNECTED,module_process_bb_event_disconned
+	beq BT_EVT_RECONN_FAILED,module_process_reconn_fail
+	beq BT_EVT_SETUP_COMPLETE,module_process_setup_complete
+	beq BT_EVT_SPP_CONNECTED,module_process_spp_connected
+	beq BT_EVT_SPP_DISCONNECTED,module_process_spp_disconnected
+	beq BT_EVT_PINCODE_REQ,module_process_evt_pincode_req
+	beq BT_EVT_ENTER_SNIFF,module_process_enter_sniff
+	beq BT_EVT_EXIT_SNIFF,module_process_exit_sniff
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,module_process_page_time_out
+	beq BT_EVT_LE_CONNECTED,module_process_le_conn
+	beq BT_EVT_LE_DISCONNECTED,module_process_bb_even_le_disconn
+	beq BT_EVT_SNIFF_NOT_ACCEPT,module_process_sniff_not_accept
+	beq BT_EVT_UNSNIFF_ACCEPT,module_process_unsniff_accept
+	beq BT_EVT_UNSNIFF_NOT_ACCEPT,module_process_unsniff_not_accept
+	beq BT_EVT_LE_PAIRING_FAIL,module_hci_event_le_pairing_fail
+	beq BT_EVT_LE_PAIRING_SUCCESS,module_hci_event_le_pairing_success
+	beq BT_EVT_LE_START_ENC,module_hci_event_start_enc
+	beq BT_EVT_LE_PAUSE_ENC,module_hci_event_pause_enc
+	beq BT_EVT_LE_TK_GENERATE,module_hci_event_le_tk
+	beq BT_EVT_BT_GKEY_GENERATE,module_hci_event_gkey_generate
+	beq BT_EVT_BT_GET_PASSKEY,module_hci_event_passkey_entry_mode
+	beq BT_EVT_BT_PAIRING_FAIL,module_hci_event_bt_pairing_fail	
+	beq BT_EVT_BT_PAIRING_SUCCESS,module_hci_event_bt_pairing_success
+ifdef SECURE_CONNECTION	
+	beq BT_EVT_LE_GKEY_GENERATE,module_hci_event_le_gkey
+endif
+	beq BT_EVT_STORE_NVRAM,module_hci_event_store_device
+	beq BT_EVT_LE_LTK_LOST,module_process_ble_ltk_lost
+	rtn
+
+	
+module_process_bb_event_disconned:
+	call module_spp_clear_last_transmite_clock
+	fetch 1,mem_flag_pairing_state
+	ncall module_hci_event_bt_pairing_fail,blank
+	call module_disconn_start
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	branch  module_spp_disconnected
+
+module_process_spp_connected:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_SPP_CONN,pdata
+	store 2,mem_ui_state_map
+	fetch 1,mem_module_spp_lpm_mult
+	store 1,mem_lpm_mult
+	branch module_hci_event_spp_connect
+
+module_process_spp_disconnected:
+//	branch module_spp_disconnected
+module_spp_disconnected:
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	set0 UI_STATE_BT_SPP_CONN ,pdata
+	store 2,mem_ui_state_map
+	branch module_hci_event_spp_disconnect
+
+
+module_process_enter_sniff:
+
+module_sniff_param_check:
+	call module_spp_clear_last_transmite_clock
+	//fetch 1,mem_context
+	//rtnbit0 state_insniff
+	fetch 2,mem_context+coffset_tsniff
+	rshift pdata,pdata
+	fetcht 2,mem_sniff_param_interval
+	isub temp,null
+	nbranch module_sniff_param_check_unsniff,zero
+	branch app_lpm_mult_enable
+module_sniff_param_check_unsniff:
+	fetch 1,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+//	fethc 2,core_uart_rxitems    //*
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	ncall module_set_unsniff_task_flag,zero    //*加这两句话
+	branch app_bt_sniff_exit
+
+module_process_exit_sniff:
+	call module_clear_sniff_task_flag
+	branch app_lpm_mult_disable
+ 	
+module_process_setup_complete:
+	call module_spp_clear_last_transmite_clock
+	branch module_conn_start
+	
+module_process_bb_even_le_disconn:
+	call le_clr_config_more_data
+	call module_disconn_start
+	branch module_hci_event_le_disconnect
+
+module_process_evt_pincode_req:
+	branch  app_bt_set_pincode
+	
+
+module_process_sniff_not_accept:
+	branch module_clear_sniff_task_flag
+
+
+module_process_unsniff_accept:
+	fetch 1,mem_module_flag
+	bbit0 MOUDLE_TASK_UNSNIFF,app_bt_enter_sniff
+	branch module_clear_unsniff_task_flag
+
+	
+module_process_unsniff_not_accept:
+	branch module_clear_unsniff_task_flag
+
+	
+module_process_le_conn:
+//	call le_send_att_exchange_mtu_requset
+	call module_conn_start
+	fetch 1,mem_module_le_lpm_mult
+	store 1,mem_lpm_mult
+	branch module_hci_event_le_connect
+
+
+module_process_bb_conn:
+	jam 0,mem_flag_mode_ssp_pin
+	call module_clear_sniff_task_flag
+	branch module_clear_unsniff_task_flag
+
+module_process_page_time_out:
+module_process_reconn_fail:
+module_disconn_start:
+	branch module_start_adv_discovery_by_command
+
+
+module_process_ble_ltk_lost:
+	call le_send_reject_ind
+	branch le_send_smp_security_request
+
+
+module_conn_start:
+	branch module_stop_adv_discovery
+	
+module_stop_adv_discovery:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BT_BIT,pdata
+	call app_bt_stop_discovery,true
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BLE_BIT,pdata
+	call app_ble_stop_adv,true
+	rtn
+
+module_process_with_credit:
+	fetch 1,mem_credit_flag
+	rtneq CREDIT_DISABLE
+	branch rfcomm_send_uih_without_payload
+
+module_process:
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	branch module_process_with_credit,zero
+	call uartd_prepare_rx
+	ifetch 1,contru
+	bne 0x01,module_hci_in_excp
+	ifetch 1,contru
+	store 1,mem_module_uart_opcode
+	ifetcht 1,contru
+	copy contru,rega
+	storet 1,mem_module_uart_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch module_hci_dicard_packet //discard this packet
+
+module_hci_in_excp:
+	call delay_10ms
+	call module_hci_event_invalid_packet
+	branch module_hci_release_except
+
+
+module_hci_release_except:
+	bpatch patch17_2,mem_patch17
+	fetch 2,IPC_M02BT_WRITE_PTR
+	store 2,IPC_M02BT_READ_PTR
+	rtn
+
+
+module_hci_dicard_packet:
+	call uartd_prepare_rx
+	increase 2,contru
+	ifetch 1,contru
+	iadd contru,contru
+module_hci_dicard_bytes:
+	branch uartd_rxdone
+	
+/*********************HCI CONTROL*********************/
+module_hci_cmd_control:
+	bpatch patch17_3,mem_patch17
+	fetch 1,mem_module_uart_opcode
+	beq HCI_CMD_SET_BT_ADDR_REQ,module_hci_cmd_set_bt_addr
+	beq HCI_CMD_SET_LE_ADDR_REQ,module_hci_cmd_set_le_addr
+	beq HCI_CMD_SET_VISIBILITY_REQ,module_hci_cmd_set_visibility	
+	beq HCI_CMD_SET_BT_NAME_REQ,module_hci_cmd_set_bt_name
+	beq HCI_CMD_SET_LE_NAME_REQ,module_hci_cmd_set_le_name
+	beq HCI_CMD_SPP_DATA_REQ,module_hci_cmd_receive_spp_data
+	beq HCI_CMD_LE_DATA_REQ,module_hci_cmd_receive_le_data
+	beq HCI_CMD_STATUS_IRQ,module_hci_cmd_inquire_status
+	beq HCI_CMD_SET_PAIRING_REQ,module_hci_cmd_set_pairing_mode
+	beq HCI_CMD_SET_PINCODE_REQ,module_hci_cmd_set_pincode	
+	beq HCI_CMD_VERSION_REQ,module_hci_cmd_version_request
+	beq HCI_CMD_BT_DISCONNECT,module_hci_cmd_bt_disconnect
+	beq HCI_CMD_BLE_DISCONNECT,module_hci_cmd_ble_disconnect
+	beq HCI_CMD_SET_NVRAM_REQ,module_hci_cmd_set_nvram
+	beq HCI_CMD_CONFIRM_GKEY,module_hci_cmd_confirm_gkey
+	beq HCI_CMD_SET_CREDIT_GIVEN,module_hci_cmd_set_credit_given
+	beq HCI_CMD_AUTO_ADV_SCAN,module_hci_cmd_auto_adv
+	beq HCI_CMD_PASSKEY_ENTRY,module_hci_cmd_passkey_entry
+	beq HCI_CMD_LE_SET_PAIRING,module_hci_cmd_le_set_pairing_mode
+	beq HCI_CMD_LE_SET_ADV_DATA,module_hci_cmd_le_set_adv_data
+	beq HCI_CMD_LE_SET_SCAN_DATA,module_hci_cmd_le_set_scan_data
+	beq HCI_CMD_LE_SEND_CONN_UPDATE_REQ,module_hci_cmd_le_send_conn_update_req
+	beq HCI_CMD_LE_SET_ADV_PARM,module_hci_cmd_set_le_adv_parameter
+	beq HCI_CMD_LE_START_PAIRING,module_hci_cmd_le_start_pairing
+	beq HCI_CMD_SET_TX_POWER,module_hci_cmd_set_tx_power
+	beq HCI_CMD_LE_CONFIRM_GKEY,module_hci_cmd_le_confirm_gkey
+	beq HCI_CMD_REJECT_JUSTWORK,module_hci_cmd_set_reject_justwork_flag
+	beq HCI_CMD_RESET_CHIP_REQ,module_hci_cmd_reset_chip
+	beq HCI_CMD_LE_SET_FIXED_PASSKEY,module_hci_cmd_le_set_fixed_passkey
+	beq HCI_TEST_CMD_CLOSE_LPM,module_hci_test_cmde_close_lpm
+	beq HCI_TEST_CMD_REBACK,module_hci_test_cmd_reback
+	branch  module_hci_event_receive_invalid_cmd
+
+/*********************HCI COMMAND*********************/
+
+//command opcode 0x00
+module_hci_cmd_set_bt_addr:
+	fetch 1,mem_module_uart_len
+	bne 6,module_hci_event_receive_invalid_cmd
+	ifetch 6,contru
+	store 6,mem_lap
+	branch module_hci_event_receive_valid_cmd
+
+//command opcode 0x01
+module_hci_cmd_set_le_addr:
+	fetch 1,mem_module_uart_len
+	bne 6,module_hci_event_receive_invalid_cmd
+	ifetch 6,contru
+	store 6,mem_le_lap
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x02
+module_hci_cmd_set_visibility:
+	fetch 1,mem_module_uart_len
+	bne 1,module_hci_event_receive_invalid_cmd
+	copy rega,contru
+	call module_hci_event_receive_valid_cmd
+	ifetcht 1,contru
+	storet 1,mem_module_bluetooth_stauts_by_command
+	fetch 2,mem_ui_state_map
+	rtnbit1 UI_STATE_BLE_CONNECTED
+	rtnbit1 UI_STATE_BT_CONNECTED
+module_start_adv_discovery_by_command:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BT_BIT,pdata
+	nbranch moudle_start_adv_by_command,true
+	fetcht 1,mem_module_bluetooth_stauts_by_command
+	and temp,0x03,pdata
+	store 1,mem_scan_mode
+moudle_start_adv_by_command:
+	fetch 1,mem_module_state
+	isolate1 MOUDLE_STATE_BLE_BIT,pdata
+	nrtn true
+	fetcht 1,mem_module_bluetooth_stauts_by_command
+	isolate1 2,temp
+	branch app_ble_start_adv,true
+	branch app_ble_stop_adv
+
+
+//command opcode 0x03
+module_hci_cmd_set_bt_name:
+	fetch 1,mem_module_uart_len
+	sub pdata,67,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_local_name_length
+	arg 8,loopcnt
+	call memset0
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	copy rega,contru
+	arg mem_local_name,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x04
+module_hci_cmd_set_le_name:
+	fetch 1,mem_module_uart_len
+	sub pdata,29,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_le_name_len
+	copy pdata,loopcnt
+	copy rega,contru
+	arg mem_le_name,contw
+	call uart_copy_rx_bytes_fast
+	call le_modified_name
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x05
+module_hci_cmd_receive_spp_data:
+	fetch 1,mem_ui_state_map
+	bbit0 UI_STATE_BT_SPP_CONN,module_hci_event_receive_invalid_cmd
+	call app_check_sniff
+	branch module_hci_cmd_spp_exit_sniff,true
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+//	call p_nl_clear_last_transmite_clock
+	call module_spp_clear_last_transmite_clock
+	fetch 1,mem_remote_credits
+	rtn blank
+	fetch 2,mem_nl_rx_len_all
+	bne 0,module_hci_cmd_pass_init_ng_rx_len_all
+	fetch 1,mem_module_uart_len
+	store 2,mem_nl_rx_len_all
+
+	copy rega,contru
+//	ifetch 2,contru
+//	store 2,mem_nl_rx_handle
+	copy contru,pdata
+	store 2,mem_nl_rx_data_src
+module_hci_cmd_pass_init_ng_rx_len_all:
+	call module_hci_cmd_get_current_packet_len_and_remain_len
+	branch spp_tx_rfcomm_packet
+	
+module_hci_cmd_spp_exit_sniff:
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	branch module_exit_sniff
+
+module_hci_cmd_get_current_packet_len_and_remain_len:
+	call module_hci_cmd_get_current_patcket_len
+	fetch 2,mem_nl_rx_len_all
+	fetcht 2,mem_current_packet_length
+	isub temp,pdata
+	store 2,mem_nl_rx_len_all
+	rtn
+
+module_hci_cmd_get_current_patcket_len:
+	fetch 2,mem_nl_rx_len_all
+	arg NL_RFCOMM_BUFF_LEN,temp
+	call not_greater_than
+	fetcht 2,mem_rfcomm_max_frame_size
+	call not_greater_than
+	fetcht 2,mem_pn_max_frame_size
+	call not_greater_than
+	store 2,mem_current_packet_length
+	rtn
+
+module_hci_command_tx_spp_tx_complete:
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	jam HCI_CMD_SPP_DATA_REQ,mem_module_uart_opcode
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x09
+module_hci_cmd_receive_le_data:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	call module_check_ble_encrypt_state
+	branch module_hci_event_receive_invalid_cmd,user
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	fetch 1,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_FINISH,module_hci_cmd_receive_le_data_finish
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	ifetch 2,contru		//handle
+	store 2,mem_module_hci_notify_handle
+	copy contru,pdata
+	store 2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_uart_len
+	pincrease -2
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	branch module_hci_event_receive_invalid_cmd,zero
+	store 1,mem_module_hci_notify_len
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call le_set_config_more_data
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	call module_hci_cmd_transmit_le_notify
+	fetch 1,mem_module_flag
+	rtnbit0 MODULE_FLAG_BLE_DATA_FINISH
+module_hci_cmd_receive_le_data_finish:
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_transmit_le_notify:
+	fetch 1,mem_module_hci_notify_len
+	rtn blank
+	call le_fifo_check_nearly_full
+	nrtn blank				//no fifo
+	call module_get_le_remote_mtu
+	bpatch patch17_4,mem_patch17
+	add temp,-3,pdata		//sub handle and opcode
+	fetcht 1,mem_module_hci_notify_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_module_hci_notify_len
+	fetcht 2,mem_module_hci_notify_handle
+	call le_att_malloc_tx_notify
+	fetch 2,mem_module_hci_nofiy_addr
+	copy pdata,contru
+	copy rega,loopcnt
+	call uart_copy_rx_bytes_fast
+	copy contru,pdata
+	store 2,mem_module_hci_nofiy_addr
+	fetch 1,mem_module_hci_notify_len
+	nrtn blank
+	branch module_set_le_tx_data_flag
+
+
+//output: temp is master mtu
+module_get_le_remote_mtu:
+	arg 0x17,temp
+	fetch 1,mem_module_flag
+	rtnbit1 MODULE_FLAG_BLE_SEND_MTU23
+	fetcht 2,mem_le_remote_mtu
+	rtn
+
+module_check_ble_encrypt_state:
+	fetch 1,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_ENCRYPT,le_check_encrypt_state
+	branch disable_user
+	
+
+//command opcode 0x0b
+module_hci_cmd_inquire_status:
+	branch module_hci_event_status_res
+
+
+//command opcode 0x0c
+module_hci_cmd_set_pairing_mode:
+	copy rega,contru
+	ifetch 1,contru
+	beq PAIRING_PINCODE,module_hci_pairing_pincode_mode
+	beq PAIRING_JUSTWORK,module_hci_pairing_just_work_mode
+	beq PAIRING_PASSKEY,module_hci_pairing_passkey
+	beq PAIRING_CONFIRM,module_hci_pairing_numeric_comparison
+	branch module_hci_event_receive_invalid_cmd
+module_hci_pairing_pincode_mode:
+	call ssp_disable
+	jam 0,mem_ssp_enable
+	branch module_hci_event_receive_valid_cmd
+module_hci_pairing_just_work_mode:
+	setarg SSP_MODE_JUST_WORK_IO_CAP_DATA
+module_hci_sspairing_mode:	
+	store 3,mem_sp_iocap_local
+	store 1,mem_ssp_mode_flag
+	call ssp_enable
+	jam 1,mem_ssp_enable
+	branch module_hci_event_receive_valid_cmd
+module_hci_pairing_passkey:
+	setarg SSP_MODE_PASSKEY_IO_CAP_DATA
+	branch module_hci_sspairing_mode
+
+module_hci_pairing_numeric_comparison:
+	setarg SSP_MODE_SSP_PIN_IO_CAP_DATA
+	branch module_hci_sspairing_mode
+
+//command opcode 0x0d
+module_hci_cmd_set_pincode:
+	fetch 1,mem_module_uart_len
+	sub pdata,16,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_pin_length
+	copy pdata,loopcnt
+	arg mem_pin,contw
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+
+ 	
+
+//command opcode 0x10
+module_hci_cmd_version_request:
+	arg 2,rega
+	arg mem_soft_version_num,regb
+	arg 0,temp
+	branch module_hci_event_set_cmd
+module_hci_event_set_cmd_send_response:
+	store 2,mem_event_cmd_response_content
+	arg mem_event_cmd_response_content,regb
+	arg 0,temp
+	branch module_hci_event_set_cmd
+
+
+//command opcode 0x11
+module_hci_cmd_bt_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd
+module_hci_cmd_bt_disconnect_doing:
+	call module_hci_event_receive_valid_cmd
+	branch app_bt_disconnect
+
+	
+//command opcode 0x12
+module_hci_cmd_ble_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+module_hci_cmd_ble_disconnect_doing:
+	call module_hci_event_receive_valid_cmd
+	branch app_ble_disconnect
+
+
+
+
+//command opcode 0x26
+module_hci_cmd_set_nvram:
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	copy rega,contru
+	fetch 2,mem_nv_data_ptr
+	icopy contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x28
+module_hci_cmd_confirm_gkey:
+	fetch 1,mem_ui_state_map
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd	
+	ifetch 1,contru
+	fetcht 1,mem_flag_mode_ssp_pin
+	setflag blank,FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,temp
+	set1 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT ,temp
+	storet 1,mem_flag_mode_ssp_pin
+
+	call module_hci_event_receive_valid_cmd
+
+	fetch 1,mem_flag_mode_ssp_pin
+	bbit1 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT,module_hci_cmd_spp_number_comparison_result_is1
+	rtn
+
+dhkey_not_accept:
+	jam 0,mem_flag_mode_ssp_pin
+	jam BT_CMD_DHKEY_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_cmd
+
+
+module_hci_cmd_spp_number_comparison_result_is1:
+	bbit1 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,number_comparison_successed
+	branch dhkey_not_accept	
+
+
+//command opcode 0x29
+module_hci_cmd_set_credit_given:
+	fetch 1,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_SPP_CONN
+	fetch 1,mem_credit_flag
+	rtneq CREDIT_DISABLE
+	ifetch 1,contru
+	fetcht 1,mem_credit_given
+	iadd temp,temp
+	storet 1,mem_credit_given
+	rtn
+
+	
+//command opcode 0x2a
+module_hci_cmd_auto_adv:
+	arg 0x40,loopcnt
+	arg mem_le_adv_data_len,contw
+	call clear_mem
+	setarg 0
+	store 1,mem_regb
+	copy rega,contru
+module_hci_cmd_auto_adv_loop:
+	copy contru,pdata
+	store 2,mem_regc
+	call module_hci_cmd_auto_adv_adv_analys
+
+	fetch 1,mem_regb
+	fetcht 1,mem_temp
+	increase 1,temp
+	iadd temp,pdata
+	store 1,mem_regb
+
+	sub pdata,31,null
+	nbranch module_hci_cmd_auto_adv_store_scan,positive
+module_hci_cmd_auto_adv_store_adv:
+	fetcht 1,mem_le_adv_data_len
+	setarg mem_le_adv_data
+	iadd temp,pdata
+	store 2,mem_contw
+	fetcht 1,mem_temp
+	increase 1,temp
+	fetch 1,mem_le_adv_data_len
+	iadd temp,pdata
+	store 1,mem_le_adv_data_len
+	branch module_hci_cmd_auto_adv_store_common
+module_hci_cmd_auto_adv_store_scan:
+	fetcht 1,mem_le_scan_data_len
+	setarg mem_le_scan_data
+	iadd temp,pdata
+	store 2,mem_contw
+	fetcht 1,mem_temp
+	increase 1,temp
+	fetch 1,mem_le_scan_data_len
+	iadd temp,pdata
+	store 1,mem_le_scan_data_len
+module_hci_cmd_auto_adv_store_common:
+	fetch 2,mem_contw
+	copy pdata,contw
+	fetch 2,mem_regc
+	copy pdata,contru
+
+	copy temp,loopcnt
+	call uart_copy_rx_bytes_fast
+
+	fetch 1,mem_module_uart_len
+	fetcht 1,mem_regb
+	isub temp,null
+	nbranch  module_hci_cmd_auto_adv_loop,zero
+	branch module_hci_event_receive_valid_cmd
+
+//block of adv len in mem_temp
+module_hci_cmd_auto_adv_adv_analys:
+	ifetch 1,contru
+	store 1,mem_temp
+	ifetch 1,contru
+	store 1,mem_rega
+	rtn
+
+
+
+//command opcode 0x30
+module_hci_cmd_passkey_entry:
+	ifetch 4,contru
+	store 4,mem_pin
+	jam 4,mem_pin_length
+	jam 0,mem_authentication_passkey_times
+	call module_hci_event_receive_valid_cmd
+	branch authentication_passkey
+
+
+
+//command opcode 0x33
+module_hci_cmd_le_set_pairing_mode:
+	copy rega,contru
+	ifetch 1,contru
+	copy pdata,temp
+ifdef SECURE_CONNECTION
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,module_le_set_pairing_mode_secure_justwork
+	beq LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC,module_le_set_pairing_mode_secure_numeric
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,module_le_set_pairing_mode_secure_passkey
+endif
+	store 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_NONE, module_le_set_no_pairing
+	beq LE_PAIRING_MODE_LAGACY_JUSTWORK,module_le_set_pairing_mode_lagacy_just_work
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,module_le_set_pairing_mode_lagacy_passkey
+	branch module_hci_event_receive_invalid_cmd
+		
+ifdef SECURE_CONNECTION	
+module_le_set_pairing_mode_secure_justwork:
+	fetch 1,mem_le_secure_connect_enable
+	branch module_hci_event_receive_invalid_cmd,blank
+	storet 1,mem_le_pairing_mode
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch module_le_set_noinputnooutput
+module_le_set_pairing_mode_secure_numeric:
+	fetch 1,mem_le_secure_connect_enable
+	branch module_hci_event_receive_invalid_cmd,blank
+	storet 1,mem_le_pairing_mode
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	jam FLAG_IOCAP_DISPLAYYESNO,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+module_le_set_pairing_mode_secure_passkey:	
+	fetch 1,mem_le_secure_connect_enable
+	branch module_hci_event_receive_invalid_cmd,blank
+	storet 1,mem_le_pairing_mode
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch module_le_set_displayonly
+endif
+module_le_set_no_pairing:
+	jam FLAG_LE_NO_BONDING_NO_MITM,mem_le_pres_auth
+module_le_set_noinputnooutput:	
+	jam FLAG_IOCAP_NOINPUTNOOUTPUT,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+module_le_set_pairing_mode_lagacy_just_work:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+	branch module_le_set_noinputnooutput
+module_le_set_pairing_mode_lagacy_passkey:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+module_le_set_displayonly:	
+	jam FLAG_IOCAP_DISPLAYONLY,mem_le_pres_iocap
+	branch module_hci_event_receive_valid_cmd	
+
+	
+//command opcode 0x34
+module_hci_cmd_le_set_adv_data:
+	fetch 1,mem_module_uart_len
+	sub pdata,31,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_le_adv_data_len
+	copy pdata,loopcnt
+	copy rega,contru
+	arg mem_le_adv_data,contw
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+	
+
+//command opcode 0x35
+module_hci_cmd_le_set_scan_data:
+	fetch 1,mem_module_uart_len
+	sub pdata,31,null
+	nbranch module_hci_event_receive_invalid_cmd,positive
+	store 1,mem_le_scan_data_len
+	copy pdata,loopcnt
+	copy rega,contru
+	arg mem_le_scan_data,contw
+	call uart_copy_rx_bytes_fast	
+	branch module_hci_event_receive_valid_cmd	
+
+	
+//command opcode 0x36
+module_hci_cmd_le_send_conn_update_req:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	fetch 1,mem_module_uart_len
+	bne 0x08,module_hci_event_receive_invalid_cmd
+	copy rega,contru
+	ifetch 8,contru
+	store 8,mem_le_interval_min
+	jam BT_CMD_LE_UPDATE_CONN,mem_fifo_temp
+	call  ui_ipc_send_cmd
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x37
+module_hci_cmd_set_le_adv_parameter:
+	ifetch 2,contru
+	store 2,mem_le_adv_interval
+	branch module_hci_event_receive_valid_cmd
+	
+	
+//command opcode 0x38
+module_hci_cmd_le_start_pairing:
+	fetch 1,mem_le_pairing_mode
+	branch module_hci_event_receive_invalid_cmd,blank
+	fetch 1,mem_le_pairing_state
+	bne FLAG_LE_PAIRING_NULL,module_hci_event_receive_invalid_cmd
+	fetch 1,mem_le_enc_state
+	bne FLAG_LE_ENC_NULL,module_hci_event_receive_invalid_cmd
+	call check_51cmd_le_smp_sec_req
+	branch module_hci_event_receive_valid_cmd	
+
+	
+
+//command opcode 0x42
+module_hci_cmd_set_tx_power:
+	fetch 1,mem_module_uart_len
+	bne 0x01,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	store 1,mem_tx_power
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x48
+module_hci_cmd_le_confirm_gkey:
+	ifetch 1,contru
+	beq 0x01,module_hci_cmd_le_confirm_gkey_fail
+	fetch 1,mem_le_secure_connect_state
+	beq LE_SC_STAT_SEND_PUBLIC_KEY,module_hci_cmd_le_confirm_gkey_ok
+	beq LE_SC_STAT_RECEIVE_DHKEY,module_hci_cmd_le_confirm_gkey_ok
+	beq LE_SC_STAT_WAIT_CONFIRM_GKEY,module_hci_cmd_le_confirm_gkey_ok
+	branch module_hci_event_receive_invalid_cmd		
+module_hci_cmd_le_confirm_gkey_ok:
+	jam FLAG_LE_SC_CONFRIM_GKEY_OK,mem_le_sc_confirm_gkey_flag
+	branch module_hci_event_receive_valid_cmd	
+	
+module_hci_cmd_le_confirm_gkey_fail:
+	call le_send_pairing_confirm_value_failed
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0x49
+module_hci_cmd_set_reject_justwork_flag:
+	fetch 1,mem_module_uart_len
+	bne 0x01,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd
+	ifetch 1,contru
+	branch classic_bt_clr_reject_justwork_flag,blank
+	branch classic_bt_set_reject_justwork_flag
+
+
+//command opcode 0x51
+module_hci_cmd_reset_chip:
+	call module_hci_event_receive_valid_cmd
+//	call wait_uarttx
+	hjam 0x01,core_reset // rest YC1021
+	branch loop
+
+
+//command opcode 0x61
+module_hci_cmd_le_set_fixed_passkey:
+	fetch 1,mem_module_uart_len
+	beq 0,module_hci_event_receive_invalid_cmd
+	ifetch 1,contru
+	branch module_hci_cmd_le_set_random_passkey,blank
+	fetch 1,mem_module_uart_len
+	bne 5,module_hci_event_receive_invalid_cmd
+	ifetch 4,contru
+	arg 1000000,temp
+	isub temp,null
+	branch module_hci_event_receive_invalid_cmd,positive
+	store 4,mem_le_tk
+	call le_set_config_fixed_tk
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_le_set_random_passkey:
+	call le_clr_config_fixed_tk
+	branch module_hci_event_receive_valid_cmd
+
+
+//command opcode 0xff
+module_hci_test_cmde_close_lpm:
+	ifetch 1,contru
+	store 1,mem_lpm_mode
+	branch module_hci_event_receive_valid_cmd
+	
+//command opcode 0xee	
+module_hci_test_cmd_reback:
+	fetch 1,mem_module_uart_len
+	call module_hci_prepare_tx
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	copy rega,contru
+	call copy_tx_bytes	
+	branch uartd_send
+
+copy_tx_bytes:
+	deposit loopcnt
+	rtn blank
+copy_tx_bytes_loop:
+	ifetch 1,contru
+	istore 1,contwu
+	loop copy_tx_bytes_loop
+	rtn
+	
+/*********************HCI EVENT*********************/
+
+module_hci_event_receive_invalid_cmd:
+	arg 1,temp
+	arg 0,rega
+	branch module_hci_event_set_cmd
+
+
+module_hci_event_receive_valid_cmd:
+	arg 0,temp
+	arg 0,rega
+	branch module_hci_event_set_cmd
+
+
+//event opcode 0x00
+module_hci_event_spp_connect:
+	jam  HCI_EVENT_SPP_CONN_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x02
+module_hci_event_le_connect:
+	jam  HCI_EVENT_LE_CONN_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x03
+module_hci_event_spp_disconnect:
+	jam  HCI_EVENT_SPP_DIS_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x05
+module_hci_event_le_disconnect:
+	jam  HCI_EVENT_LE_DIS_REP,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x06
+//input:
+//	temp: success 0; fail 1
+//	rega:Response Content length
+//	regb:Response Content address
+module_hci_event_set_cmd:
+	fetch 1,mem_module_uart_opcode
+	copy pdata,regc
+	jam  HCI_EVENT_CMD_RES,mem_module_uart_opcode
+	setarg 2
+	iadd rega,pdata
+	call module_hci_prepare_tx
+	copy regc,pdata
+	istore 1,contwu
+	istoret 1,contwu
+	copy rega,loopcnt
+	copy regb,contr
+	call uart_copy_tx_bytes
+	branch uartd_send
+
+
+//event opcode 0x07
+module_hci_event_receive_spp_data:
+//	call p_nl_clear_last_transmite_clock
+	call module_spp_clear_last_transmite_clock
+	jam HCI_EVENT_SPP_DATA_REP,mem_module_uart_opcode
+	fetch 1,mem_current_length
+	rtn blank
+	call module_hci_prepare_tx
+	fetch 1,mem_current_length
+	copy pdata,loopcnt
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+
+
+//event opcode 0x08
+module_hci_event_receive_le_data:
+	jam HCI_EVENT_LE_DATA_REP,mem_module_uart_opcode
+	fetch 1,mem_module_le_rx_data_len
+	icopy loopcnt
+	increase 2,pdata
+	call module_hci_prepare_tx
+	fetch 2,mem_module_le_rx_data_handle // Attribute handle
+	istore 2,contwu
+	fetch 2,mem_module_le_rx_data_address
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+
+
+//event opcode 0x09
+module_hci_event_enter_standby_mode:
+	jam HCI_EVENT_STANDBY_REP,mem_module_uart_opcode
+module_hci_event_enter_standby_mode_len0:
+	setarg 0
+	call module_hci_prepare_tx
+	branch uartd_send
+
+
+//event opcode 0x0a
+module_hci_event_status_res:
+	jam HCI_EVENT_STATUS_RES,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	
+	call module_hci_read_bt_status
+	
+	fetch 2,mem_ui_state_map	
+	arg UI_STATE_BT_HID_CONN,queue
+	qisolate1 pdata
+	setflag true,3,temp
+
+	arg UI_STATE_BLE_CONNECTED,queue
+	qisolate1 pdata
+	setflag true,5,temp	
+	
+	fetch 1,mem_ui_state_map
+	arg UI_STATE_BT_SPP_CONN,queue
+	qisolate1 pdata
+	setflag true,4,temp	
+	
+	istoret 1,contwu
+	branch uartd_send
+
+//	temp: bit0 3.0 inquiry;bit1 3.0 scan;bit2 ble adv;
+
+module_hci_read_bt_status:
+	arg 0,temp
+	fetch 1,mem_scan_mode
+	arg inq_scan_mode,queue
+	qisolate1 pdata
+	setflag true,0,temp
+	arg page_scan_mode,queue
+	qisolate1 pdata
+	setflag true,1,temp	
+
+	fetch 1,mem_le_adv_enable
+	arg 0,queue
+	qisolate1 pdata
+	setflag true,2,temp	
+	rtn
+
+
+//event opcode 0x0d
+module_hci_event_store_device:
+	jam HCI_EVENT_NVRAM_REP,mem_module_uart_opcode
+	fetch 1,mem_nv_data_number
+	mul32 pdata,34,pdata
+	icopy loopcnt
+	call module_hci_prepare_tx
+	fetch 2,mem_nv_data_ptr
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+
+
+//event opcode 0x0e
+module_hci_event_gkey_generate:
+	jam HCI_EVENT_GKEY,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_gkey
+	istore 4,contwu
+	branch uartd_send
+
+
+//event opcode 0x0f
+module_hci_event_invalid_packet:
+	jam HCI_EVENT_INVALID_PACKET,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+	
+
+//event opcode 0x10
+module_hci_event_passkey_entry_mode:
+	jam  HCI_EVENT_GET_PASSKEY,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+//event opcode 0x11
+module_hci_event_le_tk:
+	jam HCI_EVENT_LE_TK,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_le_tk
+	istore 4,contwu
+	branch uartd_send
+
+
+//event opcode 0x14
+module_hci_event_le_pairing_fail:
+	arg FLAG_BLE_PAIRING_FAIL,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_le_pairing_success:
+	arg FLAG_BLE_PAIRING_SUCCESS,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_bt_pairing_fail:
+	arg FLAG_BT_PAIRING_FAIL,rega
+	branch module_hci_event_pairing_completed
+
+module_hci_event_bt_pairing_success:
+	arg FLAG_BT_PAIRING_SUCCESS,rega
+
+module_hci_event_pairing_completed:
+	jam 0,mem_flag_mode_ssp_pin
+	jam HCI_EVENT_LE_PAIRING_STATE,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	copy rega,pdata
+	istore 2,contwu
+	branch uartd_send
+
+
+//event opcode 0x15
+module_hci_event_pause_enc:
+	arg FLAG_EVENT_PAUSE_ENC,regc
+	branch module_hci_event_enc
+
+module_hci_event_start_enc:
+	arg FLAG_EVENT_START_ENC,regc
+
+module_hci_event_enc:
+	jam HCI_EVENT_LE_ENCRYPTION_STATE,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	copy regc,pdata
+	istore 1,contwu
+	branch uartd_send
+
+
+//event opcode 0x1d
+module_hci_event_le_gkey:
+	jam HCI_EVENT_LE_GKEY,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_gkey
+	istore 4,contwu
+	branch uartd_send
+
+
+//****************************************************************//
+	//module_hci_prepare_tx
+	//function:write hci packet header
+	//input: pdata-----packet length  (1byte)
+	//input: mem_uart_opcode------opcode (1byte)
+	//output:contwu --- pointer to packet payload
+	//use reg: contwu,pdata
+//****************************************************************//	
+module_hci_prepare_tx:
+	jam 0x02,mem_module_uart_cmd
+	store 1,mem_module_uart_len
+	storet 8,mem_temp
+	bpatch patch17_5,mem_patch17
+	fetcht 8,mem_temp
+	call uartd_prepare_tx
+	fetch 3,mem_module_uart_cmd
+	istore 3,contwu
+	rtn
+
+
+
+
+/*********************hci command end*********************/
+
+/*********************hci ble receive data start*********************/
+
+//rega is le rx data address
+//regb is le rx data length
+//mem_le_att_handle is write handle
+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
+	fetch 2,mem_le_att_handle
+	fetcht 2,mem_module_data_write_handle
+	isub temp,null
+	branch module_le_receive_data_ok,zero
+	fetcht 2,mem_module_data_write_handle2
+	isub temp,null
+	nrtn zero
+module_le_receive_data_ok:	
+	store 2,mem_module_le_rx_data_handle
+	branch module_hci_event_receive_le_data
+
+
+/*********************hci ble receive data end*********************/
+
+module_exit_sniff:
+	fetch 1,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+	call module_set_unsniff_task_flag	
+	branch app_bt_sniff_exit
+
+
+module_set_lpm_mult_2:
+	jam 2,mem_lpm_mult
+	rtn
+
+
+
+module_bb_event_timer:
+	rtn
+
+
+check_ipc_tx_buff:
+	call get_ipc_tx_buff
+	arg UART_AIR_CONTROL_THRESHOLD,temp
+pdata_sub_temp:
+	isub temp,null
+	rtn
+	
+calc_ipc_tx_buff_pos:
+	isub rega,pdata
+	sub pdata,0,pdata
+	rtn
+
+get_ipc_tx_buff:
+	fetcht 2,IPC_BT2M0_START_ADDR
+	fetch 2,IPC_BT2M0_END_ADDR
+	isub temp,rega
+	fetcht 2,IPC_BT2M0_READ_PTR
+	fetch 2,IPC_BT2M0_WRITE_PTR
+	isub temp,pdata
+	ncall calc_ipc_tx_buff_pos,positive
+	rtn
+	
+module_control_air_flow:
+	call check_ipc_tx_buff
+	branch app_l2cap_flow_control_enable,positive
+	branch app_l2cap_flow_control_disable
+
+
+/**************module state *******************/
+module_set_sniff_task_flag:
+	arg MOUDLE_TASK_SNIFF,queue
+	branch module_set_state
+
+module_clear_sniff_task_flag:
+	arg MOUDLE_TASK_SNIFF,queue
+	branch module_clr_state
+
+module_set_unsniff_task_flag:
+	arg MOUDLE_TASK_UNSNIFF,queue
+	branch module_set_state
+
+module_clear_unsniff_task_flag:
+	arg MOUDLE_TASK_UNSNIFF,queue
+	branch module_clr_state
+
+module_set_le_tx_data_flag:
+	arg MODULE_FLAG_BLE_DATA_FINISH,queue
+	branch module_set_state
+	
+module_clear_le_tx_data_flag:
+	arg MODULE_FLAG_BLE_DATA_FINISH,queue
+	branch module_clr_state
+
+module_clr_state:
+	fetch 1,mem_module_flag
+	qset0 pdata
+	store 1,mem_module_flag
+	rtn
+
+module_set_state:
+	fetch 1,mem_module_flag
+	qset1 pdata
+	store 1,mem_module_flag
+	rtn
+	
+/**************module state end*******************/
+
+
+else
+
+endif
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/bt.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/bt.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/bt.prog	(working copy)
@@ -0,0 +1,4130 @@
+define REVD
+//define FPGA
+define ROMCODE
+define PATCH
+define ADC
+//define RAM_VERSION
+//define CLK6M
+//define DEBUG_MALLOC
+//define DEBUG_H4LOG_ENABLE
+//define DEBUG_LIGHT_STATE
+//define E2_LOG
+//define LMP_DBG
+//define ACL_DEBUG
+//define DCDC
+define NVRAM
+define RELEASE
+define SECURE_CONNECTION
+define DEBUG_RF_INIT
+//define SPI_SIMULATE
+//define ROM_RESPIN_OPTIONAL
+
+define SIMPLE_PAIRING
+define COMPILE_RFCOMM
+define COMPILE_SHUTTER
+define COMPILE_AntiLost
+//define COMPILE_IR
+define COMPILE_KEYBOARD
+define COMPILE_MOUSE
+define COMPILE_MODULE
+//define COMPILE_AT
+//define COMPILE_PRCP
+//define COMPILE_USB
+//define COMPILE_DONGLE
+define COMPILE_LE
+define COMPILE_24G
+define COMPILE_CAR
+define COMPILE_REMOTE_CAR
+
+INCLUDE "bt_format"
+
+org 0x0000		// start from patch ram address start
+ifdef SIM
+include sim.prog
+else
+include patch.prog
+endif
+
+/******************************************/
+/***********   ROM Start   ***************/
+/******************************************/
+
+org 0x4000		// start from rom address start
+start:
+	call lpmstate
+soft_reset:
+	bpatch patch00_0,mem_patch00
+	clear_stack
+	call initialize_radio
+	call init_param
+	call l2cap_init
+	bpatch patch00_1,mem_patch00
+	call rfcomm_init
+	call init_lmp
+	call ui_init
+	call app_init
+	bpatch patch00_2,mem_patch00
+	call app_lpm_init,wake
+ifdef SIMPLE_PAIRING
+	call publickey_init
+else
+	call ssp_disable
+ifdef SECURE_CONNECTION
+	call publickey_init
+
+endif
+endif
+	call lpm_recover_clk,wake
+main_loop:	
+	bpatch patch00_3,mem_patch00
+ifdef SIMPLE_PAIRING
+	call sp_calc_sequence
+endif
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+endif
+ifdef SIMPLE_PAIRING
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256_check
+endif
+endif
+	call le_dispatch
+	bpatch patch00_4,mem_patch00
+	call idle_dispatch
+	call app_process_idle
+	call inquiry_dispatch
+	call inquiry_scan_dispatch
+	call page_scan_dispatch
+	call connection_dispatch
+	call lpm_dispatch
+	branch main_loop
+
+connection_dispatch:
+	call connection_incontext
+	rtnmark0 mark_context
+	set0 mark_context,mark
+	call context_save
+	branch le_disable
+	
+connection_incontext:
+	bpatch patch00_5,mem_patch00
+	call context_search_insniff
+	nbranch connection_nosniff,zero
+	call context_load
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,le_conn_dispatch
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+connection_nosniff:
+	call context_get_next
+	copy loopcnt,null
+	rtn zero
+	call context_load
+	fetch 1,mem_state
+	bbit1 state_inpage,master_page
+	fetch 1,mem_mode
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+
+
+
+/**************************************/
+/**************idle dispatch*********/
+/**************************************/
+	
+idle_dispatch:
+	fetch 1,mem_hci_cmd
+	rtn blank
+	beq hci_cmd_inquiry,idle_inquiry
+	beq hci_cmd_inquiry_cancel,idle_inquiry_cancel
+	beq hci_cmd_remote_name_req,idle_remote_name_req
+	beq hci_cmd_create_conn,idle_create_conn
+	beq hci_cmd_le_create_conn,idle_le_create_conn
+	call context_search_conn_handle
+	rtn zero
+	call context_search_plap
+	rtn zero
+idle_exit:
+	jam 0,mem_hci_cmd
+	rtn
+
+idle_le_create_conn:
+	jam hci_cmd_le_create_conn,mem_cmd_le_create_conn
+	jam 0,mem_hci_cmd
+	rtn
+	
+idle_inquiry:
+	set1 mark_inquiry_on,mark
+	set0 mark_inquiry_trainb,mark
+	jam param_ninquiry,mem_ninqy_index
+	jam 31,mem_nfreq_index_inq
+	branch idle_exit
+
+idle_inquiry_cancel:
+	set0 mark_inquiry_on,mark
+	force 0,stop_watch
+	branch idle_exit
+
+idle_remote_name_req:
+	call context_search_plap
+	rtn zero
+	force LMP_NAME_REQ,temp
+	jam 5,mem_nameres_cnt
+	branch idle_start_page
+
+idle_create_conn:
+	bpatch patch00_6,mem_patch00
+idle_create_conn_device:
+	fetch 6,mem_hci_plap
+	branch idle_exit,blank
+	jam RECONNECT_HID,memui_reconnect_mode
+	//jam HS_INIT_CALL,mem_hs_mode //init as master
+	jam CONN_SM_WAIT_FEATURES_RES,mem_conn_sm
+	branch idle_create_conn_cont
+	
+idle_create_conn_cont:
+	force LMP_VERSION_REQ,temp
+idle_start_page:
+	bpatch patch00_7,mem_patch00
+	fetch 1,mem_page_mode
+	branch idle_page_mode_r0,blank
+	lshift3 pdata,pdata
+	lshift4 pdata,pdata
+	increase -1,pdata
+idle_page_mode_r0:
+	store 1,mem_npage
+	store 1,mem_npage_index
+	jam 31,mem_nfreq_index_page
+	set0 mark_page_trainb,mark
+	call context_new
+	nbranch idle_page_fail,zero
+	call get_free_amaddr
+	store 1,mem_amaddr
+	storet 1,mem_lmo_opcode2
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	bpatch patch01_0,mem_patch01
+	call timer_reinit
+	force 0,pdata
+	compare LMP_NAME_REQ,temp,0xff
+	nsetflag true,state_init_seq,pdata
+	set1 state_inpage,pdata
+	store 1,mem_state
+	jam BT_EVT_RECONN_STARTED,mem_fifo_temp
+	call ui_ipc_send_event
+	force 0,pdata
+	setflag true,smap_name_req,pdata
+	store 1,mem_state_map
+	setarg 0
+	set1 mode_master,pdata
+	store 1,mem_mode
+	enable master
+	call context_save
+	disable master
+	force page_length_timer,queue
+	fetch 2,mem_page_to
+	call timer_init
+	branch idle_exit
+idle_page_fail:
+	bpatch patch01_1,mem_patch01
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	compare LMP_NAME_REQ,temp,0xff
+	branch idle_name_fail,true
+	branch idle_exit
+idle_name_fail:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	call memset0
+	jam BT_EVT_RECONN_FAILED,mem_fifo_temp
+	call ui_ipc_send_event
+	branch idle_exit
+	
+
+/******************************************/
+/**************  Inquiry  *****************/
+/******************************************/
+
+inquiry_dispatch:
+	rtnmark0 mark_inquiry_on
+	force inquiry_length_timer,queue
+	call timer_check
+	nsetflag blank,mark_inquiry_on,mark
+	nbranch inquiry_start,blank
+	rtn
+	
+
+
+inquiry_start:
+	bpatch patch01_2,mem_patch01
+	fetcht 2,mem_inq_window
+	force 4,queue
+	call sniff_check_window
+	rtn user
+	call afh_clear
+	force 0,freq_mode
+inquiry_restart:
+	rtn timeout
+	set0 mark_fhs_already_good,mark
+	set0 mark_fhs_eir,mark
+inquiry_rx_restart:
+	add clkn_bt,1,bt_clk
+	isolate1 mark_inquiry_trainb,mark
+	setflag true,2,freq_mode
+	compare 0x00,bt_clk,0x02      /* see if this is even slot */
+	nbranch inquiry_receive,true
+
+inquiry_transmit:
+	bpatch patch01_3,mem_patch01
+	fetch 1,mem_inquiry_transmit
+	increase 1,pdata
+	store 1,mem_inquiry_transmit
+	call fetch_giac
+	call tx_radio_freq
+	call fetch_diac
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	call end_of_packet
+	call inquiry_check_train
+	branch inquiry_restart
+
+inquiry_check_train:
+	bpatch patch01_4,mem_patch01
+	fetch 1,mem_nfreq_index_inq
+	increase -1,pdata
+	store 1,mem_nfreq_index_inq
+	rtn positive  /* if it's time to incremnt N */
+	jam 31,mem_nfreq_index_inq
+	fetch 1,mem_ninqy_index
+	increase -1,pdata
+	store 1,mem_ninqy_index
+	rtn positive      /* if it's time to change train */
+	setflip mark_inquiry_trainb,mark
+	jam param_ninquiry,mem_ninqy_index
+	rtn
+
+inquiry_receive:
+	bpatch patch01_5,mem_patch01
+	call fetch_giac
+	call rx_radio_freq
+	call fetch_diac
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt
+	branch inquiry_sync,sync   /* try look for id packet again if not found */
+	call inquiry_check_train
+	branch inquiry_rx_restart
+inquiry_sync:
+	bpatch patch01_6,mem_patch01
+	call save_rssi
+	call scan_mode_whiten
+	call receive_packet_whitened
+	set0 mark_rxbuf_inuse,mark
+	rtnmark0 mark_fhs_already_good
+inquiry_receive_rtn:
+	bpatch patch01_7,mem_patch01
+inquiry_receive_eir_rtn:
+	fetch 1,mem_inquiry_rcv
+	increase 1,pdata
+	store 1,mem_inquiry_rcv
+	rtn
+		
+/******************************************/
+/**************  Master Dispatch  *************/
+/******************************************/
+
+
+
+master_page:
+	bpatch patch02_0,mem_patch02
+	enable master
+	enable clknt
+	fetch 2,mem_page_interval
+	branch master_page_no_interval,blank
+	force page_interval_timer,queue
+	call timer_check               
+	nrtn blank
+master_page_no_interval:
+	bpatch patch02_1,mem_patch02
+	fetcht 2,mem_page_window
+	force 40,queue
+	call sniff_check_window
+	branch page_exit,user
+	force page_length_timer,queue
+	call timer_check
+	nbranch page_start,blank
+	fetch 1,mem_state_map
+	bbit1 smap_name_req,master_npage_timeout
+	branch master_page_timeout
+master_npage_timeout:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	call memset0
+master_page_timeout:
+	bpatch patch02_2,mem_patch02
+	jam 0,mem_state
+	call init_lmp_work
+	jam 0,memui_reconnect_mode
+	jam BT_EVT_RECONN_PAGE_TIMEOUT,mem_fifo_temp
+	call ui_ipc_send_event	
+	branch page_exit
+
+page_start:
+	bpatch patch02_3,mem_patch02
+	force 0,timeup
+	until clkn_rt,meet
+	fetch 1,mem_page_clk
+	increase -1,pdata
+	ixor clkn_bt,pdata
+	compare 0,pdata,3
+	nbranch page_start,true
+	deposit am_addr
+	store 1,mem_fhs_am_addr
+	force 0,N_tx_slot
+	force 0,freq_mode
+
+page_restart:
+	bpatch patch02_4,mem_patch02
+	branch page_exit,timeout
+	call fetch_page_bt_adr
+	arg param_rf_setup, timeup
+	until clkn_rt,meet         /* wait for the start_receiver time against native real clk  */
+page_rx_restart:
+	bpatch patch02_5,mem_patch02
+	fetch 4,mem_page_clk    /* deposit clk_estimate */
+	iforce bt_clk
+	increase 1,pdata
+	store 4,mem_page_clk
+	isolate1 mark_page_trainb,mark
+	setflag true,2,freq_mode
+	compare 0x00,bt_clk,0x02      /* see if this is even slot */
+	nbranch page_receive,true
+	fetch 1, mem_page_transmit
+	increase 1,pdata
+	store 1, mem_page_transmit
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	call end_of_packet
+	call page_check_train
+	branch page_restart	
+page_exit:
+	bpatch patch02_6,mem_patch02
+	disable master
+	fetch 2,mem_page_interval      
+	rtn blank
+	force page_interval_timer,queue
+	branch timer_init              
+
+page_check_train:
+	bpatch patch02_7,mem_patch02
+	fetch 1,mem_nfreq_index_page
+	increase -1,pdata
+	store 1,mem_nfreq_index_page
+	rtn positive
+	jam 31,mem_nfreq_index_page
+	fetch 1,mem_npage_index
+	increase -1,pdata                 /* increment N */
+	store 1,mem_npage_index
+	rtn positive      			/* if it's time to change train */
+	setflip mark_page_trainb,mark             /* change train */
+	fetch 1,mem_npage
+	store 1,mem_npage_index
+	rtn
+	
+page_receive:
+	bpatch patch03_0,mem_patch03
+	call rx_radio_freq
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt	/* try id look for id packet again */
+	branch page_sync,sync         /* restart if didn't receive anything */
+	call page_check_train
+	branch page_rx_restart
+page_sync:
+	call end_of_packet
+	fetch 1, mem_page_rcv
+	increase 1,pdata
+	store 1, mem_page_rcv
+	force 0,stop_watch
+	fetch 4,mem_page_clk
+page_send_fhs:
+	bpatch patch03_1,mem_patch03
+	call rf_setup_time_master_slot
+	call fetch_page_bt_adr
+	increase 1,N_tx_slot
+page_send_fhs_continue:
+	and_into 0x1fd,bt_clk
+	and_into 0x1fc,freq_mode               /* master response = x00, even_train settin must remain the same */
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_native
+	call send_access_word
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	force 0,am_addr
+	force type_fhs,type
+	call scan_mode_whiten
+	call transmit_packet_whitened
+page_wait_fhs_reply:
+	bpatch patch03_2,mem_patch03
+	call rf_setup_time_slave_slot
+	or_into 0x02,bt_clk
+	and_into 0x1fc,freq_mode               /* master response sequence = x00, even train setting must be preserved */
+	call rx_radio_freq
+	call start_rx_native
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_clkn_rt	/* look for that reply */
+	call end_of_packet,sync              /* id reply is enough */
+	branch page_wait_fhs_reply_ok,sync           /* no reply then send fhs again */
+	fetch 1,mem_fhs_wait_counter
+	branch page_restart,blank
+	increase -1,pdata
+	store 1,mem_fhs_wait_counter
+	branch page_send_fhs
+	
+page_wait_fhs_reply_ok:
+	bpatch patch03_3,mem_patch03
+	fetch 1, mem_page_rcv_fhs
+	increase 1,pdata
+	store 1, mem_page_rcv_fhs
+	call prepare_newconn
+master_newconn_loop:
+	call master_newconn_once
+	branch newconn_poll_responded,sync
+	call new_conn_timeout
+	nbranch master_newconn_loop,blank
+	branch page_restart
+
+newconn_poll_responded:
+	bpatch patch03_4,mem_patch03
+	fetch 1,mem_state
+	set0 state_inpage,pdata
+	store 1,mem_state
+	call newconn_init
+	disable master
+	rtn
+	
+
+master_dispatch:
+	bpatch patch03_5,mem_patch03
+	enable master
+	enable clknt
+	call role_switch_master
+	rtn user
+	call check_bt_disabled
+	call rf_setup_time_master_slot
+	add clkn_bt,1,bt_clk
+	call fetch_self_bt_adr
+	force 0x03,freq_mode
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_native
+	call send_access_word
+	call transmit_packet
+master_loop:
+	bpatch patch03_6,mem_patch03
+	call parse_lmp
+	call master_conn_recv_packet
+	nbranch master_notmatch,match
+	call supervision_flush
+	call parse_l2cap
+	fetch 1,mem_master_rcvcnt
+	increase 1,pdata
+	store 1,mem_master_rcvcnt
+master_notmatch:
+	bpatch patch03_7,mem_patch03
+	call scheduler_process
+	call check_master_disconnect
+	nrtn master					/* disconnected */
+	call check_attempt
+	nbranch master_attempt,blank
+master_exit:
+	disable master
+	rtn
+
+master_attempt:
+	call prepare_tx
+	call master_conn_send_packet
+	branch master_loop
+
+
+check_master_disconnect:
+	branch check_master_match,match
+	call supervision_update
+	branch master_disconnect,positive
+check_master_match:
+	call check_disconnect_timeout
+	nbranch master_disconnect,user
+	fetch 1,mem_state_map
+	rtnbit0 smap_name_req
+	rtnbit1 smap_name_res
+	fetch 1,mem_op
+	rtnbit1 op_disconn
+	call conn_timer_expired
+	nrtn blank
+	fetch 1,mem_nameres_cnt
+	increase -1,pdata
+	store 1,mem_nameres_cnt
+	nrtn blank
+	branch lmp_disconnect
+
+master_disconnect:
+	bpatch patch04_0,mem_patch04
+	call quit_connection
+	disable master
+	fetch 1,mem_state_map
+	bbit1 smap_name_req,master_name_disconnect
+	rtn
+	
+master_name_disconnect:
+	fetch 1,mem_state_map
+	rtnbit1 smap_name_res
+master_name_error:
+	arg mem_tmp_buffer,contw
+	arg 8,loopcnt
+	branch memset0
+	
+check_disconnect_timeout:
+	bpatch patch04_1,mem_patch04
+	enable user
+	fetch 1,mem_op
+	rtnbit0 op_disconn
+	call conn_timer_expired
+	nrtn blank
+	branch disable_user
+
+conn_timer_expired:
+	fetch 1,mem_conn_timer
+	increase -1,pdata
+	store 1,mem_conn_timer
+	rtn
+
+linkkey_ready:
+	bpatch patch04_2,mem_patch04
+	fetch 1,mem_state
+	bbit1 state_linkkey,linkkey_set
+	fetch 1,mem_pairing_auth
+	branch linkkey_set,blank
+	jam DEFALT_PAIRING_AUTH,mem_pairing_auth
+	jam BT_EVT_LINKKEY_GENERATE,mem_fifo_temp
+	call ui_ipc_send_event
+	branch linkkey_set
+linkkey_set:
+	bpatch patch04_3,mem_patch04
+	call context_traverse_linkkey
+	fetch 1,mem_state
+	set1 state_linkkey,pdata
+	store 1,mem_state
+	jam 1,mem_link_key_exists
+	fetch 1,mem_conn_sm
+	bne CONN_SM_PAIRING,linkkey_set_continue
+linkkey_set_continue:
+	rtn
+
+generate_linkkey_continue:
+	jam PAIRING_AUTH,mem_pairing_auth
+clear_linkstate:
+	fetch 1,mem_state
+	set0 state_linkkey,pdata
+	store 1,mem_state
+	rtn
+	
+
+	/* rtn user if switch */
+role_switch_check:
+	bpatch patch04_4,mem_patch04
+	disable user
+	fetch 2,mem_tsniff
+	arg 0xffff,temp
+	isub temp,null
+	nrtn zero
+	fetch 4,mem_sniff_anchor
+	branch role_switch_clkn,clknt
+	isub clke_bt,pdata
+	branch role_switch_clke
+role_switch_clkn:
+	isub clkn_bt,pdata
+role_switch_clke:
+	sub pdata,4,null
+	nrtn positive
+	force 0,pdata
+	store 2,mem_tsniff
+	branch enable_user
+
+
+	/* pdata: switch instant, set tsniff=0 for special sniff */	
+role_switch_prepare:
+	copy pdata,temp
+	bpatch patch04_5,mem_patch04
+	storet 4,mem_sniff_anchor
+role_switch_prepare0:
+	jam SWITCH_FLAG_ACCEPT,mem_switch_flag
+	setarg 0xffff
+	store 2,mem_tsniff
+	jam 1,mem_sniff_attempt
+	rtn
+
+
+role_switch_master:
+	bpatch patch04_6,mem_patch04
+	call role_switch_check
+	nrtn user
+	disable user
+	jam param_newconnto,mem_newconnto_counter
+	set0 mark_fhs_already_good,mark
+roles_waitfhs_loop:
+	call rf_setup_time_master_slot
+	call master_recv_packet
+	bmark1 mark_fhs_already_good,roles_replyto_fhs
+	call new_conn_timeout
+	nbranch roles_waitfhs_loop,blank
+role_switch_fail_master:
+	bpatch patch04_7,mem_patch04
+	disable user
+	deposit clkn_bt
+	store 4,mem_next_btclk
+	enable clknt
+	enable master
+	jam BT_EVT_SWITCH_FAIL_MASTER,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+roles_replyto_fhs:
+	bpatch patch05_0,mem_patch05
+	call rf_setup_time_slave_slot
+	arg type_id,type
+	call master_send_packet
+	disable clknt
+	disable master
+	call apply_switch_clke
+	call prepare_newconn
+roles_newconns_loop:
+	bpatch patch05_1,mem_patch05
+	call slave_newconn_once
+	branch roles_newconns_responded,match
+	call new_conn_timeout
+	nbranch roles_newconns_loop,blank
+	branch role_switch_fail_master
+roles_newconns_responded:
+	fetch 1,mem_mode
+	set0 mode_master,pdata
+	store 1,mem_mode
+	call supervision_flush
+	call calc_clke_offset
+	enable user
+	jam BT_EVT_SWITCH_SUCCESS_MASTER,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+
+
+context_load:
+	bpatch patch05_2,mem_patch05
+	set1 mark_context,mark
+	deposit rega
+	store 2,mem_context_ptr
+	force context_size,loopcnt
+	arg mem_le_state,contw
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	copy rega,contr
+	bbit1 mode_le,memcpy
+	arg mem_state,contw
+	call memcpy
+	disable attempt
+	fetch 1,mem_amaddr
+	iforce am_addr
+	jam 1,mem_current_sniff_attempt
+	branch context_load_master,master
+	jam 1,mem_current_sniff_attempt
+context_load_master:
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	fetch 1,mem_sniff_attempt
+	store 1,mem_current_sniff_attempt
+	fetch 1,mem_sniff_timeout
+	store 1,mem_current_sniff_timeout
+	rtn
+	
+context_save:
+	bpatch patch05_3,mem_patch05
+	fetch 2,mem_context_ptr
+	iforce contw
+	force context_size,loopcnt
+	arg mem_le_state,contr
+	branch memcpy,le
+	arg mem_state,contr
+	branch memcpy
+
+	
+
+context_get_next:
+	arg context_num,loopcnt
+	fetcht 1,mem_current_context
+context_get_next_loop:
+	increase 1,temp
+	compare context_num,temp,0xff
+	nbranch context_get_next_cont,true
+	arg 0,temp
+context_get_next_cont:
+	storet 1,mem_current_context
+	mul32 temp,context_size,pdata
+	arg mem_context,rega
+	iadd rega,rega
+	ifetch 1,rega
+	bbit1 state_insniff,context_get_next_sniff
+	rtnbit1 state_inconn
+	rtnbit1 state_inpage
+context_get_next_sniff:
+	loop context_get_next_loop
+	rtn
+	
+context_new:
+	bpatch patch05_4,mem_patch05
+	arg context_search_empty,regc
+	call context_search
+	nrtn zero					// all occupied
+	deposit rega
+	store 2,mem_context_ptr
+	force 0,null
+	rtn
+	
+	//return zero if anyone's wack is 1.
+	//return nzero if all wack is 0
+context_check_all_wack:
+	call check_esco_amaddr
+	branch context_check_esco_wack,true
+	fetch 2,mem_context_ptr
+	add pdata,coffset_arq,contw
+	fetch 1,mem_arq
+	istore 1,contw
+	arg context_check_a_wack,regc
+	branch context_search
+
+context_check_esco_wack:
+	fetch 1,mem_arq
+	isolate1 wack,pdata
+	branch context_esco_wack,true
+	force 1,null
+	rtn
+context_esco_wack:
+	force 0,null
+	rtn
+	
+	//rtn nzero if idle(no conn)
+context_check_idle:
+	arg context_check_inconn,regc
+	branch context_search
+	
+context_traverse_linkkey:
+	fetcht 2,mem_context_ptr
+	arg context_traverse_clearkey,regc
+	branch context_search
+	
+	
+	/* return zero if conn handle is found */
+context_search_conn_handle:
+	fetcht 1,mem_hci_conn_handle
+context_search_conn_handle2:
+	arg context_search_handle,regc
+	branch context_search
+	/* return zero if plap is found */
+context_search_plap:
+	bpatch patch05_5,mem_patch05
+	fetcht 6,mem_hci_plap
+context_search_plap2:
+	arg context_search_lap,regc
+	branch context_search
+	/* return zero if sniff anchor is meet and rega pointers to context */
+context_search_insniff:
+	arg context_search_sniff,regc
+	branch context_search
+	/* return zero if sniff window is in content with current transaction */
+context_search_sniff_window:
+	arg context_search_window,regc
+context_search:
+	bpatch patch05_6,mem_patch05
+	arg mem_context,rega
+	arg context_num,loopcnt
+context_search_loop:
+	ifetch 1,rega
+	copy regc,pc
+context_search_next:
+	increase context_size,rega
+	loop context_search_loop
+	force 1,null
+	rtn
+
+context_search_empty:
+	bbit1 state_inconn,context_search_next
+	bbit1 state_inpage,context_search_next
+	force 0,null
+	rtn
+	
+context_search_lap:
+	bbit1 state_inpage,context_search_lap_cont
+	bbit0 state_inconn,context_search_next
+context_search_lap_cont:
+	add rega,coffset_plap,contr
+	ifetch 6,contr
+	isub temp,null
+	rtn zero
+	branch context_search_next
+
+context_search_handle:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_conn_handle,contr
+	ifetch 1,contr
+	isub temp,null
+	rtn zero
+	branch context_search_next
+
+context_search_sniff:
+	bbit0 state_insniff,context_search_next
+context_search_sniff_loop:
+	call context_get_anchor
+	call sign_pdata_temp
+	isub temp,pdata
+	increase 1,pdata
+	branch context_search_sniff_miss,positive
+	copy contr,regb
+	store 9,mem_temp
+	fetch 1,mem_le_sc_calc
+	nbranch context_search_sniff_sc,blank
+	fetch 9,mem_temp
+	copy regb,contr
+	increase 5,pdata  
+	branch context_search_meet1
+context_search_sniff_sc:
+	fetch 9,mem_temp
+	copy regb,contr	
+	increase 20,pdata  
+context_search_meet1:
+	nbranch context_search_next,positive
+context_search_meet:
+	copy temp,bt_clk
+	call context_next_anchor
+	force 0,null
+	rtn
+	
+	
+context_search_sniff_miss:
+	iforce regb
+	add rega,coffset_tsniff,contr
+	ifetch 2,contr
+	branch context_search_meet,blank
+	call context_next_anchor
+	branch context_search_sniff_loop
+
+sign_pdata_temp:
+	rshift16 pdata,timeup    
+	rshift8 timeup,timeup    
+	branch sign_pdata_temp_p0,zero    
+	compare 0xf,timeup,0xf    
+	nrtn true    
+	rshift16 temp,timeup    
+	rshift8 timeup,timeup    
+	nrtn zero    
+	set1 28,temp    
+	rtn
+sign_pdata_temp_p0:    
+	rshift16 temp,timeup    
+	rshift8 timeup,timeup    
+	compare 0xf,timeup,0xf    
+	nrtn true    
+	set1 28,pdata    
+	rtn
+
+context_check_inconn:
+	bbit0 state_inconn,context_search_next
+	force 0,null 				// found
+	rtn
+	
+context_check_a_wack:
+	bbit0 state_inconn,context_search_next
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,context_search_next
+	add rega,coffset_arq,contr
+	ifetch 1,contr
+	bbit0 wack,context_search_next
+	force 0,null 				// found
+	rtn
+
+context_get_anchor:
+	add rega,coffset_mode,contr
+	ifetcht 1,contr
+	deposit clkn_bt
+	isolate1 mode_master,temp
+	add rega,coffset_sniff_anchor,contr
+	ifetcht 4,contr
+	rtn true
+	add rega,coffset_clk_offset,contr
+	ifetch 6,contr
+	call calc_clke2
+	deposit clke_bt
+	rtn
+
+context_next_anchor:
+	add rega,coffset_tsniff,contr
+	add rega,coffset_sniff_anchor,contw
+	ifetch 2,contr
+	iadd temp,timeup			/* wrap to 28 bits */
+	deposit timeup
+	istore 4,contw
+	branch le_context_nexthop
+	
+
+context_search_window:
+	bbit0 state_insniff,context_search_next
+	call context_get_anchor
+	iadd stop_watch,pdata
+	iadd stop_watch,pdata
+	iadd queue,pdata
+	isub temp,null
+	nbranch context_search_next,positive
+	force 0,null
+	rtn
+
+context_traverse_clearkey:
+	bbit0 state_inconn,context_search_next
+	deposit temp
+	isub rega,null
+	branch context_search_next,null
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,context_search_next
+	ifetch 1,rega
+	set0 state_linkkey,pdata
+	istore 1,rega
+	branch context_search_next
+
+	
+master_conn_send_packet:
+	bpatch patch05_7,mem_patch05
+	call rf_setup_time_master_slot
+master_send_packet:
+	add clkn_bt,1,bt_clk          /* master start to use native clock */
+	call fetch_self_bt_adr
+	force 0x03,freq_mode          /* we are in connection!! */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_native
+	call send_access_word
+	branch transmit_packet
+
+master_conn_recv_packet:
+	bpatch patch06_0,mem_patch06
+	call rf_setup_time_slave_slot
+master_recv_packet:
+	add clkn_bt,1,bt_clk          /* master start to use native clock */
+	call fetch_self_bt_adr
+	force 0x03,freq_mode          /* we are in connection!! */
+	call rx_radio_freq
+	call init_rx_packet_flags
+	call prep_crypt
+	call start_rx_native	/* start listening at start_rx time */
+	call start_receiver
+master_rx_conn_finish_packet:
+	call wait_access_clkn_rt	/* master use native clock */
+	nrtn sync
+	call save_rssi
+	branch receive_packet
+	
+	
+
+master_newconn_once:
+	bpatch patch06_1,mem_patch06
+	fetch 1,mem_fhs_am_addr
+	iforce am_addr			//review
+	force type_poll,type
+	call master_conn_send_packet
+	branch master_conn_recv_packet
+
+
+
+
+
+
+/******************************************/
+/************* Inquiry Scan ***************/
+/******************************************/
+
+inquiry_scan_dispatch:
+	fetch 1,mem_scan_mode
+	rtnbit0 inq_scan_mode
+	force iscan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetcht 2,mem_iscan_window
+	force 4,queue
+	call sniff_check_window
+	rtn user
+	call inquiry_scan_start
+	force iscan_interval_timer,queue
+	fetch 2,mem_iscan_interval
+	nbranch timer_init,sync
+	random pdata				/* inquiry scan backoff */
+	iand mask3ff,pdata
+	branch timer_init
+	
+
+inquiry_scan_start:
+	bpatch patch06_2,mem_patch06
+	jam 0,mem_fhs_am_addr
+	disable clknt
+	disable attempt
+	call afh_clear
+	and clkn_bt,0x1fc,bt_clk      /* freeze the clock, set bit[1] 0, this is version 1.1 */
+	force 0x01,freq_mode     /* slave in inquiry scan, kind of same as inquriy_response, this is version 1.1 */
+	call fetch_giac
+	call rx_radio_freq
+	setflip mark_inquiry_state,mark
+	fetch 1,mem_inquiryscan_waitcnt
+	increase 1,pdata
+	store 1,mem_inquiryscan_waitcnt
+	call fetch_diac
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_forever	/* until there is timeout, or matched (true) */
+	nrtn sync
+	bpatch patch06_3,mem_patch06
+	force 0,stop_watch
+	call shutdown_radio	/* must have heard */
+	fetch 1,mem_inquiryscan_rcvcnt
+	increase 1,pdata
+	store 1,mem_inquiryscan_rcvcnt
+	call fetch_giac
+	call rf_setup_time_slave_slot
+	or_into 0x002,bt_clk               /* put clk(1) to 1 */
+	force 0x01,freq_mode               /* slave in inquriy and page, response only */
+	call tx_radio_freq
+	call fetch_diac
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	call send_access_word
+	force type_fhs,type
+	force 0,am_addr                       /* put 0 into am_addr field for fhs */
+	call scan_mode_whiten
+	call transmit_packet_whitened
+	call send_eir
+	and_into 0x1fd,bt_clk                 /* put clk(1) back to 0 */
+	increase 1,N_tx_slot
+	rtn
+
+send_eir:
+	bpatch patch06_4,mem_patch06
+	fetch 1,mem_eir_enable
+	rtn blank
+	arg mem_eir,contw
+	fetch 1,mem_local_name_length
+	copy pdata,loopcnt
+	increase 1,pdata
+	istore 1,contw	
+	copy contw,temp
+	increase 1,pdata
+	store 2,mem_tx_len	
+	copy temp,contw
+	setarg 0x09  //type:name
+	istore 1,contw		
+	arg  mem_local_name,contr
+	call memcpy       //name
+
+	arg mem_all_uuid_128bits,regc
+	arg 4,loopcnt
+	call get_all_uuid
+	arg mem_all_uuid_16bits,regc
+	arg 1,loopcnt
+	call get_all_uuid
+
+	force type_dm3,type		/* DM3 */
+	jam 2,mem_tx_lch
+	setarg mem_eir
+	store 2,mem_txptr
+	call rf_setup_time_slave_slot
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+	call send_access_word
+	call scan_mode_whiten
+	call transmit_packet_whitened
+	rtn
+
+
+get_all_uuid:
+	copy contw,temp
+	copy regc,contr
+	ifetch 1,contr
+	rtn blank
+lshift_loop:
+	lshift pdata,pdata
+	loop lshift_loop
+	copy pdata,rega
+	increase 2,pdata
+	copy pdata,queue
+	fetch 2,mem_tx_len
+	iadd queue,pdata
+	store 2,mem_tx_len
+	copy temp,contw
+	copy rega,pdata
+	increase 1,pdata
+	istore 1,contw
+	copy regc,contr
+	ifetch 1,contr
+	ifetch 1,contr	//fetch type
+	istore 1,contw
+	copy rega,loopcnt
+	branch memcpy  //copy uuid
+	
+/******************************************/
+/******** Slave dispatch ***********/
+/******************************************/
+
+page_scan_dispatch:	
+	fetch 1,mem_scan_mode
+	rtnbit0 page_scan_mode
+	force pscan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetcht 2,mem_pscan_window
+	force 40,queue
+	call sniff_check_window
+	rtn user
+	force 0,am_addr
+	jam param_pagerespto,mem_fhs_wait_counter
+	set0 mark_fhs_already_good,mark
+	call page_scan_start
+	force pscan_interval_timer,queue
+	fetch 2,mem_pscan_interval
+	branch timer_init
+	
+
+page_scan_start:
+	bpatch patch06_5,mem_patch06
+	disable clknt
+	call afh_clear
+	fetch 1,mem_pagescan_waitcnt
+	increase 1,pdata
+	store 1,mem_pagescan_waitcnt
+	force 0,N_tx_slot
+	call fetch_self_bt_adr
+	add clkn_bt,1,bt_clk      /* freeze the clock on native clock until scan window is up */
+	force 0x02, freq_mode     /* slave in inquiry and page, not response */
+	bpatch patch06_6,mem_patch06
+	call rx_radio_freq
+	call start_receiver	/* wait for that id packet from master */
+	call wait_access_forever
+	nrtn sync                          /* pscan window timeout occured, back to dispatch */
+	call shutdown_radio	/* got the id packet */
+	fetch 1,mem_pagescan_rcvcnt
+	increase 1,pdata
+	store 1,mem_pagescan_rcvcnt
+	force 0,stop_watch
+	call rf_setup_time_slave_slot
+	or_into 0x002,bt_clk               /* put clk(1) to 1 */
+	force 0x01,freq_mode               /* slave in inquriy and page, response only */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	call send_access_word
+	call end_of_packet
+	force 0,am_addr
+	arg param_rf_setup, timeup
+	until clke_rt,meet
+	or_into 0x03,clke_bt
+	and_into 0x1fd,bt_clk
+page_scan_wait_fhs_restart:
+	bpatch patch06_7,mem_patch06
+	increase 1,N_tx_slot
+	call rx_radio_freq
+	call start_receiver
+	call wait_access_mhalfbnd
+	nbranch page_scan_wait_fhs_again,sync	/* go back if didn't find access code */
+	call scan_mode_whiten
+	call receive_packet_whitened
+	bmark1 mark_fhs_already_good,page_scan_reply_to_fhs
+page_scan_wait_fhs_again:
+	bpatch patch07_0,mem_patch07
+	fetch 1,mem_fhs_wait_counter
+	rtn blank
+	increase -1,pdata
+	store 1,mem_fhs_wait_counter
+	call rf_setup_time_master_slot	/* set up expiration time */
+	branch page_scan_wait_fhs_restart
+
+
+page_scan_reply_to_fhs:
+	bpatch patch07_1,mem_patch07
+	set0 1,clke_bt
+	set1 0,clke_bt
+	fetch 1,mem_pagescan_rcvfhscnt
+	increase 1,pdata
+	store 1,mem_pagescan_rcvfhscnt
+	call rf_setup_time_slave_slot
+	or_into 0x02,bt_clk
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	call send_access_word
+	call end_of_packet
+slave_apply_clke_bt:
+	compare 0x03,clke_bt,0x03
+	branch slave_apply_clke_bt_now,true
+	until null,mhalfbnd
+	branch slave_apply_clke_bt
+slave_apply_clke_bt_now:
+	fetch 4,mem_clke_bt
+	or_into 0x03,pdata
+	icopy clke_bt
+
+start_slave_connection:
+	bpatch patch07_2,mem_patch07
+	fetch 6,extm_lap
+	store 6,mem_plap
+	call prepare_newconn
+slave_newconn_loop:
+	call slave_newconn_once
+	branch sconn_successful,match     /* we were talked to */
+	call new_conn_timeout
+	nbranch slave_newconn_loop,blank
+	rtn
+
+	
+sconn_successful:
+	bpatch patch07_3,mem_patch07
+	call newconn_init
+	call context_new
+	nrtn zero
+	jam 0,mem_mode
+	call calc_clke_offset
+	branch context_save
+
+
+
+
+slave_dispatch:
+	bpatch patch07_4,mem_patch07
+	call calc_clke
+	call role_switch_slave
+	rtn user
+slave_loop:
+	bpatch patch07_5,mem_patch07
+	call check_bt_disabled
+	call scheduler_process
+	call slave_conn_recv_packet	/* go listen for a packet */
+	nbranch slave_notmatch,match
+	call supervision_flush
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call slave_conn_send_packet
+	call parse_l2cap
+	call parse_lmp
+	fetch 1,mem_slave_rcvcnt
+	increase 1,pdata
+	store 1,mem_slave_rcvcnt
+	call calc_clke_offset
+slave_notmatch:
+	bpatch patch07_6,mem_patch07
+	call lpm_set_mult
+	call supervision_update
+	branch slave_disconnect,positive
+	call check_disconnect_timeout
+	nbranch slave_disconnect,user
+	call check_attempt
+	nbranch slave_loop,blank
+	rtn
+
+slave_disconnect:
+	bpatch patch07_7,mem_patch07
+	jam 0,mem_tester_emulate
+	jam 0,mem_debug_config
+	call quit_connection
+	set0 mark_testmode,mark
+	call test_enable_white
+	fetch 1,mem_state
+	rtn
+
+
+role_switch_slave:
+	bpatch patch08_0,mem_patch08
+	call role_switch_check
+	nrtn user
+	copy am_addr,temp
+	call get_free_amaddr
+	store 1,mem_fhs_am_addr
+	copy temp,am_addr
+	jam param_newconnto,mem_newconnto_counter
+roles_sendfhs_loop:
+	bpatch patch08_1,mem_patch08
+	call rf_setup_time_master_slot
+	force type_fhs,type
+	call slave_send_access
+	deposit clkn_bt
+	store 4,mem_clkn_bt
+	call transmit_packet
+	call rf_setup_time_slave_slot
+	enable user3
+	call slave_receive_access
+	branch roles_got_fhs_reply,sync
+	call shutdown_radio
+	call new_conn_timeout
+	nbranch roles_sendfhs_loop,blank
+	rtnmark0 mark_accept_switch
+	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	rtn
+roles_got_fhs_reply:
+	enable clknt
+	call prepare_newconn
+	call afh_clear
+roles_newconn_loop:
+	bpatch patch08_2,mem_patch08
+	call master_newconn_once
+	branch roles_newconn_responded,sync
+	call new_conn_timeout
+	nbranch roles_newconn_loop,blank
+	disable clknt
+	deposit clke_bt
+	store 4,mem_next_btclk
+	rtn
+roles_newconn_responded:
+	enable master
+	bmark0 mark_accept_switch,roles_newconn_nolmp
+	set0 mark_accept_switch,mark
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_HOST_CONNECTION_REQ,mem_lmi_opcode2
+	call tid_set_reply
+roles_newconn_nolmp:
+	deposit am_addr
+	store 1,mem_amaddr
+	force 0,pdata
+	store 6,mem_clk_offset
+	fetch 1,mem_mode
+	set1 mode_master,pdata
+	store 1,mem_mode
+	call supervision_flush
+	disable master
+	enable user
+	rtn
+
+	
+
+init_rx_packet_flags:
+	bpatch patch08_3,mem_patch08
+	disable match
+	set0 mark_loopback,mark
+	set0 mark_am_addr_broadcast,mark          /* initialize slave flags */
+	set0 mark_longpacket,mark
+	set0 mark_old_packet,mark
+	fetch 1,mem_arq    /* mem_arq + am_addr */
+	set0 arqnx,pdata
+	set1 flowx,pdata
+	store 1,mem_arq
+	rtn
+
+prepare_newconn:
+	bpatch patch08_4,mem_patch08
+	jam param_newconnto,mem_newconnto_counter
+	jam param_newconn_arq,mem_arq
+	fetch 2,mem_rx_window_init
+	store 2,mem_rx_window
+	deposit clkn_bt
+	store 4,mem_next_btclk
+	rtn clknt
+	deposit clke_bt
+	store 4,mem_next_btclk
+	rtn
+
+newconn_init:
+	bpatch patch08_5,mem_patch08
+	call init_lmp_reinit
+	call new_conn_handle
+	store 1,mem_conn_handle
+	setarg 0
+	store 2,mem_l2cap_rxbuff1_len
+	setarg param_supervision_to
+	store 2,mem_supervision_to
+	fetch 1,mem_state
+	set1 state_inconn,pdata
+	store 1,mem_state
+	jam 0,mem_op
+	jam 0,mem_state_map
+	jam 0,mem_lpm_current_mult
+	branch supervision_flush
+	
+
+clear_linkkey:
+	bpatch patch08_6,mem_patch08
+	force 0,pdata
+	store 8,mem_link_key
+	istore 8,contw
+	call clear_linkstate
+	branch context_traverse_linkkey
+	
+new_conn_timeout:
+	fetch 1,mem_newconnto_counter
+	increase -1,pdata
+	store 1,mem_newconnto_counter
+	rtn
+
+new_conn_handle:
+	fetch 1,mem_handle_num
+	increase 1,pdata
+	store 1,mem_handle_num
+	rtn
+
+
+quit_connection:
+	bpatch patch08_7,mem_patch08
+	fetch 1,mem_hci_cmd
+	beq hci_cmd_remote_name_req,quit_connection_name
+	fetch 1,mem_lmp_to_send
+	bne LMP_NAME_REQ,quit_connection_cont
+quit_connection_name:
+	call cmd_check_plap
+	nbranch quit_connection_cont,zero
+	call master_name_error
+	jam 0,mem_hci_cmd
+quit_connection_cont:
+	bpatch patch09_0,mem_patch09
+	call app_disconn_reason_collect_bt
+	call sniff_exit
+	jam BT_EVT_BB_DISCONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	call init_lmp_work
+	call l2cap_init_work
+ifdef SIMPLE_PAIRING
+	call sp_initialize
+endif
+	fetch 1,mem_state
+	set0 state_inconn
+	store 1,mem_state
+	jam 0,memui_reconnect_mode
+
+	fetch 1,mem_state_map
+	compare 0x0,pdata,0xc0
+	branch quit_connection_not_clear_mark,true
+	set0 mark_rxbuf_inuse,mark
+quit_connection_not_clear_mark:
+	fetch 1,mem_arq
+	bbit0 wack,quit_connection_not_clear_tx
+quit_connection_not_clear_tx:
+	fetch 1,mem_op
+	rtnbit0 op_txl2cap
+	set0 mark_tx_l2cap,mark
+	rtn
+
+slave_newconn_once:
+	bpatch patch09_1,mem_patch09
+	fetch 1,extm_newconn_am_addr
+	rtn blank     
+	icopy am_addr
+	call slave_conn_recv_packet
+	nrtn match
+	force type_null,type
+	call slave_conn_send_packet
+	deposit am_addr
+	store 1,mem_amaddr                 /* now the new am_addr is official */
+	force 0,pdata
+	store 1,extm_newconn_am_addr
+	rtn
+
+
+/******************************************/
+/********  Time consuming task  ***********/
+/******************************************/
+prepare_tx:
+	bpatch patch09_2,mem_patch09
+	fetch 1,mem_state
+	bbit0 state_insco,prepare_tx_not_sco
+	force type_hv3,type
+	bmark0 mark_esco,prepare_tx_not_esco
+	call check_esco_amaddr
+	nbranch prepare_tx_not_sco,true
+	branch prepare_tx_not_sco,attempt	
+	call set_wait_ack					/* send esco only at the first attempt */
+	setarg 2		/* esco only has 1 retry */
+	store 2,mem_retransmission_cnt
+	rtn
+prepare_tx_not_esco:
+	nrtn attempt						/* send sco only at the first attempt */
+prepare_tx_not_sco:
+	bpatch patch09_3,mem_patch09
+	call context_check_all_wack			 //abandon mark_retransmit, use context_check_all_wack instead.
+	nbranch prepare_tx_no_retransmit,zero
+	fetch 1,mem_arq
+	bbit0 wack,prepare_tx_pollnull		/* other wack, tx buffer in use, but not me */
+prepare_tx_retransmit:
+	bmark1 mark_loopback,prepare_tx_loopback
+	fetch 1,mem_debug_config
+	bbit1 debug_tx_pattern,prepare_tx_txpat
+	fetch 2,mem_retransmission_cnt
+	increase -1,pdata
+	store 2,mem_retransmission_cnt
+	branch prepare_tx_nomore_retransmit,blank
+	fetch 1,mem_last_type
+	iforce type
+	rtn
+
+prepare_tx_nomore_retransmit:
+	bpatch patch09_4,mem_patch09
+	call clear_got_tx
+prepare_tx_no_retransmit:
+	call check_esco_amaddr
+	branch prepare_tx_pollnull,true
+	call send_lmp
+	branch prepare_tx_sendlmp,user
+	fetch 1,mem_op
+	bbit1 op_txl2cap,prepare_tx_sendl2cap
+	bmark1 mark_loopback,prepare_tx_loopback
+	fetch 1,mem_debug_config
+	bbit1 debug_tx_pattern,prepare_tx_txpat
+prepare_tx_pollnull:
+	force type_poll,type				/* POLL for master */
+	rtn master
+	force type_null,type				/* default is NULL */
+	rtn
+prepare_tx_loopback:
+	bpatch patch09_5,mem_patch09
+	fetch 1,mem_rx_type
+	iforce type
+	rtnne 1
+	force type_null,type
+	rtn
+prepare_tx_txpat:
+	fetch 1,test_mode_packet_type
+	and pdata,0xf,type
+	set1 mark_loopback,mark
+	rtn
+prepare_tx_sendlmp:
+	force type_lmp,type
+	branch set_wait_ack
+prepare_tx_sendl2cap:
+	call tx_l2cap_type
+
+set_wait_ack:
+	bpatch patch09_6,mem_patch09
+	fetcht 1,mem_arq
+	set1 wack,temp
+	storet 1,mem_arq
+	deposit type
+	store 1,mem_last_type
+	setarg 0xffff
+	store 2,mem_retransmission_cnt
+	rtn
+
+tx_l2cap_type:
+	bpatch patch09_7,mem_patch09
+	fetch 1,mem_state_map
+	isolate1 smap_edr,pdata
+	fetch 2,mem_tx_len
+	branch tx_l2cap_type_edr,true
+	force type_dm1,type		/* DM1 */
+	sub pdata,17,null			
+	rtn positive
+	force type_dh1,type		/* DH1 */
+	sub pdata,27,null				
+	rtn positive
+	force type_dm3,type		/* DM3 */
+	sub pdata,121,null
+	rtn positive
+	force type_dh3,type		/* DH3 */
+	sub pdata,183,null
+	rtn positive	
+	force type_dm5,type		/* DM5 */
+	sub pdata,224,null
+	rtn positive
+	force type_dh5,type		/* DH5 */
+	rtn
+tx_l2cap_type_edr:
+	force type_dm1,type
+	sub pdata,17,null
+	rtn positive
+	force type_dh1,type		/*2-DH1*/
+	sub pdata,54,null
+	rtn positive
+	force type_dm3,type		/*2-DH3*/
+	arg 367,temp
+	isub temp,null
+	nrtn positive
+	force type_dm5,type		/*2-DH5*/
+	arg 679,temp
+	isub temp,null
+	nrtn positive
+	force type_dh5,type		/*3-DH5*/
+	rtn
+
+
+/******************************************/
+/***********  Receive Packet  *************/
+/******************************************/
+
+
+
+slave_receive_master_slot:
+	fetch 1,mem_state
+	bbit0 state_insniff,slave_receive_notsniff
+	fetch 2,mem_tsniff
+	branch slave_receive_notsniff,blank		/* role switch */
+	nbranch slave_receive_sniff,attempt
+slave_receive_notsniff:
+	call rf_setup_time_master_slot
+slave_receive_access:
+	add clke_bt,1,bt_clk
+slave_receive_sniff:
+	enable swfine
+	fetch 2,mem_rx_window
+	rshift pdata,pdata
+	arg param_pll_setup,temp
+	iadd temp,pdata
+	call ahead_window
+	call fetch_extm_bt_adr
+	force 0x03,freq_mode          /* connection hop */
+	call rx_radio_freq
+	call init_rx_packet_flags
+	call prep_crypt
+	bpatch patch0a_0,mem_patch0a
+	fetch 2,mem_rx_window
+	rshift pdata,pdata
+	call ahead_window
+	call start_receiver
+	enable decode_fec0
+	fetch 2,mem_rx_window
+	arg param_clke_cal,temp
+	iadd temp,stop_watch
+	correlate null,timeout
+	copy clke,temp
+	storet 6,mem_sync_clke
+	disable decode_fec0
+	nrtn sync
+	arg param_clke_cal,clke_rt
+	copy bt_clk,clke_bt
+	branch lpm_adjust_clk,wake
+	rtn
+	
+
+slave_conn_recv_packet:
+	bpatch patch0a_1,mem_patch0a
+	call slave_receive_master_slot
+	nbranch shutdown_radio,sync
+	call save_rssi
+	bmark0 mark_testmode,receive_packet
+	fetch 2,mem_tst_pktcnt_sync
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_sync
+receive_packet:
+	rshift bt_clk,temp
+	or temp,0x40,white_init
+receive_packet_whitened:
+	bpatch patch0a_2,mem_patch0a
+	enable enable_white
+	enable enable_hec
+	enable decode_fec1
+	parse demod,bucket,3  /* get am_addr */
+	rshift8 pwindow,pdata
+	store 1,mem_temp_am_addr
+	parse demod,bucket,4  /* get type */
+	inject bucket,7       /* align up to pwindow */
+	copy pwindow,pdata
+	store 1,mem_rx_type
+	parse demod,bucket,3  /* get arq */
+	rshift8 pwindow,pdata
+	store 1,mem_temp_arq
+	fetch 1,mem_rx_type
+	sub pdata,3,null
+	branch receive_packet_noedr,positive
+	beq 7,receive_packet_noedr		/* esco packet */
+	fetch 1,mem_state_map
+	isolate1 smap_edr,pdata
+	setflag true,PSK,radio_ctrl
+receive_packet_noedr:
+	bpatch patch0a_3,mem_patch0a
+	parse demod,bucket,8   /* cycle thru hec */
+	disable decode_fec1
+	disable enable_hec   /* at this moment, 1 seqn + 8 hec is in shift */
+	branch error_header,crc_failed  /* if hec error, nothing is valid */
+	bmark0 mark_testmode,receive_packet_amchk
+	fetch 2,mem_tst_pktcnt_hec
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_hec
+receive_packet_amchk:	
+	bpatch patch0a_4,mem_patch0a
+	fetch 1,mem_temp_am_addr
+	compare 0,pdata,0x07           /* check for broadcast */
+	setflag true,mark_am_addr_broadcast,mark   /* received a broadcast message, can fire ar_addr if during unpark_req */
+	branch am_addr_ok,true
+	icompare 0x07,am_addr
+	branch am_addr_match,true
+	bmark0 mark_esco,end_of_packet
+	fetcht 1,mem_saved_amaddr
+	icompare 0x7,temp
+	nbranch end_of_packet,true
+	fetch 1,mem_arq    /* mem_arq + am_addr */
+	set0 arqnx,pdata
+	set1 flowx,pdata
+	store 1,mem_arq
+am_addr_match:
+	enable match
+am_addr_ok:
+	bpatch patch0a_5,mem_patch0a
+	fetch 1,mem_rx_type
+	icopy type
+	bmark1 mark_am_addr_broadcast,arqn_bypass        /* arqn doesn't make sense */
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	set0 flow,pdata
+	isolate1 flow,temp
+	setflag true,flow,pdata
+	isolate1 arqn,temp
+	setflag true,arqn,pdata
+	store 1,mem_arq
+	isolate0 arqn,temp
+	branch arqn_bypass,true
+	call clear_got_tx
+arqn_bypass:
+	bpatch patch0a_6,mem_patch0a
+	arg 0,temp
+	call reserve_slot
+	and type,0xf,pdata
+	beq type_poll,process_poll
+	beq type_null,end_of_packet	/* null */
+	beq type_fhs,process_fhs
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	icompare 0x04,temp    /* bit 2 is seqn */
+	nbranch rx_type_dispatch,true   /* different then it's new */
+	bmark0 mark_am_addr_broadcast,failed_seqn         /* seqn failed, and not broadcast */
+	bbit0 bcast1,rx_type_dispatch           /* first broadcast never fail seqn */
+failed_seqn:
+	set1 mark_old_packet,mark
+rx_type_dispatch:
+	bpatch patch0a_7,mem_patch0a
+	deposit type
+	beq type_dm1, process_dm1
+	beq type_dh1, process_dh1
+	beq type_hv3, process_hev
+	beq type_3dh1, process_3dh1
+	arg 4,temp
+	call reserve_slot
+	beq type_dm3, process_dm3
+	beq type_dh3, process_dh3
+	arg 8,temp
+	call reserve_slot
+	beq type_dm5, process_dm5
+	beq type_dh5, process_dh5
+	rtn
+
+
+process_hev:
+	bpatch patch0b_0,mem_patch0b
+	enable decode_fec0
+	enable enable_crc
+	enable encrypt
+	arg mem_sco_ibuf,contw
+	force 30,loopcnt
+process_hev_loop:	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop process_hev_loop
+	bmark0 mark_esco,end_of_packet
+	parse demod,bucket,16  /* cycle through the crc */
+	nsetflag crc_failed,mark_esco_rxok,mark
+	branch error_payload,crc_failed
+	branch ack_payload
+
+
+process_poll:
+	branch end_of_packet
+
+process_dm3:
+process_dm5:
+	set1 mark_longpacket,mark
+process_dm1:
+	enable decode_fec2
+	branch process_dmh
+	
+process_dh3:
+process_dh5:
+	set1 mark_longpacket,mark
+process_3dh1:
+	set1 PSK3M,radio_ctrl
+process_dh1:
+	enable decode_fec0
+process_dmh:
+	bpatch patch0b_1,mem_patch0b
+	bmark1 mark_rxbuf_inuse,end_of_packet			/* buffer in use, nack */
+	isolate0 PSK,radio_ctrl
+	branch process_dmh_noedr,true
+	disable enable_white
+	enable decode_fec0
+	disable decode_fec2
+	add clkn_bt,2,timeup
+	correlate clkn_bt,meet
+	nbranch error_payload,sync
+	set1 mark_longpacket,mark
+	enable enable_white
+process_dmh_noedr:
+	bpatch patch0b_2,mem_patch0b
+	enable encrypt
+	enable enable_crc
+	parse demod,bucket,3  /* parse in lch+l2cap flow */
+	rshift8 pwindow,pdata
+	store 1,mem_lch_code		/* for loopback */
+	parse demod,bucket,5  /* parse in 5 bit packetlength */
+	bmark1 mark_longpacket,process_dmh_long
+	rshift3 pwindow,loopcnt
+	rshift3 loopcnt,loopcnt
+	branch process_dmh_common
+process_dmh_long:
+	parse demod,bucket,5		/* multi slot packet length of dh3 dh5 dm3 dm5 */
+	rshift pwindow,loopcnt
+	parse demod,bucket,3  /* undefined+bit 9 of length */
+process_dmh_common:	
+	bpatch patch0b_3,mem_patch0b
+	deposit loopcnt
+	store 2,mem_len
+	branch process_dmh_data_end,blank
+	isub mask3ff,null
+	branch error_payload,positive	/* packet too large, discard */
+	bpatch patch0b_4,mem_patch0b
+	set0 mark_fhs_eir,mark
+	fetch 1,mem_lch_code
+	and_into 0x03,pdata
+	arg mem_rxbuf,contw //lmp_data or test packet
+	beq LLID_LMP,process_lmp
+	bmark1 mark_testmode,process_dmh_data
+	//non-HCI mode
+	fetch 1,mem_lch_code
+	and_into 0x03,pdata
+	beq LLID_L2CAP_START,process_dmh_data_l2cap_start_pkt
+	beq LLID_L2CAP_CONT,process_dmh_data_l2cap_continue_pkt
+	branch error_payload
+
+process_lmp:
+	fetch 2,mem_len
+	sub pdata,0x70,null		//lmp buffer size
+	nbranch error_payload,positive
+	bmark1 mark_old_packet,ack_payload
+	branch process_dmh_data
+
+	
+process_dmh_data_l2cap_start_pkt:
+	bpatch patch0b_5,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x2e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_inuse
+	bbit0 L2CAP_INUSE_BUFF1,process_dmh_data_into_buff1
+	bbit0 L2CAP_INUSE_BUFF2,process_dmh_data_into_buff2
+	branch end_of_packet
+process_dmh_data_into_buff1:
+	jam 1,mem_l2cap_rxbuff_new //new data in buff 1
+	fetch 2,mem_l2cap_rxbuff1_len
+	bne 0,end_of_packet			//baseband head error
+	arg mem_l2cap_rxbuff1,contw
+	branch process_dmh_data
+process_dmh_data_into_buff2:
+	jam 2,mem_l2cap_rxbuff_new //new data in buff 2
+	fetch 2,mem_l2cap_rxbuff2_len
+	bne 0,end_of_packet
+	arg mem_l2cap_rxbuff2,contw
+	branch process_dmh_data
+	
+process_dmh_data_l2cap_continue_pkt:
+	bpatch patch0b_6,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x2e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_dmh_data_l2cap_continue_pkt1
+	beq 2,process_dmh_data_l2cap_continue_pkt2
+	branch end_of_packet
+process_dmh_data_l2cap_continue_pkt1:
+	arg mem_l2cap_rxbuff1,contw
+	fetch 2,mem_l2cap_rxbuff1_len
+	iadd contw,contw
+	branch process_dmh_data
+process_dmh_data_l2cap_continue_pkt2:
+	arg mem_l2cap_rxbuff2,contw
+	fetch 2,mem_l2cap_rxbuff2_len
+	iadd contw,contw
+process_dmh_data:	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop process_dmh_data
+process_dmh_data_end:	
+	bpatch patch0b_7,mem_patch0b
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload_crc,crc_failed
+	fetch 1,mem_l2cap_flow_ctrl_flag
+	beq L2CAP_FLOW_CTRL_ENABLE,end_of_packet
+	bmark1 mark_testmode,process_dmh_cont
+	bmark1 mark_old_packet,redundant_payload
+	fetch 1,mem_lch_code
+	compare 3,pdata,3
+	branch process_dmh_cont,true
+	fetch 2,mem_len
+	branch process_dmh_cont,blank
+	bpatch patch0c_0,mem_patch0c
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_l2cap_pass_crc_buff1
+	beq 2,process_l2cap_pass_crc_buff2
+	branch assert
+process_l2cap_pass_crc_buff1:
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff1_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff1// l2cap payload length
+	increase 4,temp
+	isub temp,null
+	call l2cap_buff1_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+process_l2cap_pass_crc_buff2:
+	fetch 2,mem_l2cap_rxbuff2_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff2_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff2// l2cap payload length 
+	add temp,4,temp
+	isub temp,null
+	call l2cap_buff2_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+process_dmh_cont:
+	bpatch patch0c_1,mem_patch0c
+	fetcht 1,mem_state_map
+	fetch 1,mem_lch_code
+	compare 3,pdata,0x03
+	setflag true,smap_rxlmp,temp
+	nsetflag true,smap_rxl2cap,temp
+	storet 1,mem_state_map
+	nbranch process_dmh_cont_rxbuf_not_use,true
+	set1 mark_rxbuf_inuse,mark
+process_dmh_cont_rxbuf_not_use:
+	bmark0 mark_testmode,ack_payload
+	isolate1 smap_rxlmp,temp
+	branch ack_payload,true
+	fetch 2,mem_tst_pktcnt_crc
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_crc
+	set1 mark_loopback,mark
+	set0 smap_rxl2cap,temp
+	set0 mark_rxbuf_inuse,mark
+	storet 1,mem_state_map
+ack_payload:
+	bpatch patch0c_2,mem_patch0c
+	fetcht 1,mem_temp_arq
+	fetch 1,mem_arq
+	set1 arqnx,pdata
+	isolate1 seqn,temp            /* if accept, seqn always copies from the header */
+	setflag true,seqn,pdata
+	isolate1 mark_am_addr_broadcast,mark
+	setflag true,bcast1,pdata
+	store 1,mem_arq
+	fetch 2,mem_len
+	nbranch end_of_packet,blank
+	fetch 1,mem_state_map
+	set0 smap_rxl2cap,pdata//better to do this in l2cap_flow_ctrl_stop
+	store 1,mem_state_map
+	fetch 1,mem_lch_code
+	compare 0x01,pdata,0x07
+	//call l2cap_flow_ctrl_stop,true
+	branch end_of_packet
+	
+error_header:
+	bpatch patch0c_3,mem_patch0c
+	disable match
+	fetch 2,mem_rx_hec_err
+	increase 1,pdata
+	store 2,mem_rx_hec_err
+	branch end_of_packet
+error_payload_crc:
+	fetch 2,mem_rx_crc_err
+	increase 1,pdata
+	store 2,mem_rx_crc_err
+	call discard_pkt
+	bmark0 mark_testmode,error_payload
+	set1 mark_loopback,mark
+error_payload:
+	branch end_of_packet
+	
+discard_pkt:
+	bpatch patch0c_4,mem_patch0c
+	fetch 1,mem_lch_code
+	compare 3,pdata,0x03
+	nbranch discard_pkt_l2cap,true
+discard_pkt_lmp:	
+	fetcht 1,mem_state_map
+	set0 smap_rxlmp,temp
+	storet 1,mem_state_map
+	rtn
+discard_pkt_l2cap:
+//	isolate1 mark_testmode,mark
+//	setflag true,mark_loopback,mark
+	fetcht 1,mem_state_map
+	set0 smap_rxl2cap,temp
+	storet 1,mem_state_map
+	rtn
+
+redundant_payload:
+	fetch 1,mem_arq
+	set1 arqnx,pdata
+	store 1,mem_arq
+end_of_packet:
+	bpatch patch0c_5,mem_patch0c
+	disable encode_fec0
+	disable encode_fec2
+	disable decode_fec0
+	disable decode_fec2
+	disable enable_crc
+	disable encrypt
+	disable enable_white
+	branch shutdown_radio,is_rx
+	until null,tx_clear
+	nop 100          /* flush out the last bit */
+	branch shutdown_radio
+	
+process_fhs:
+	bpatch patch0c_6,mem_patch0c
+	enable enable_crc
+	enable decode_fec2
+	parse demod,bucket,72
+	isolate1 58,pdata
+	setflag true,mark_fhs_eir,mark
+	copy bt_adr,temp             /* save current address to aside */
+	ialigned bt_adr            /* send it to access gen */
+	ialigned fhs0			/* get fhs_misc */
+	pulse recalc                /* calc the lap just received from the other guy */
+	setsect 2,0xfffff             /* preset ms of shift reg as big mask */
+	setsect 3,0x0ffff             /* preset ms of shift reg as big mask */
+	nop 32                       /* 30 cycles after recalc */
+	iverify fhs_parity             /* check fhs_parity against ls 34 bits at shift reg, with msb 36 bits as mask */
+	deposit lap
+	store 3,extm_lap
+	deposit uap
+	store 1,extm_uap
+	copy temp,bt_adr             /* put the address back */
+	branch fhs_parity_ok,true     /* fhs parity failed */
+	branch error_payload
+fhs_parity_ok:
+	bpatch patch0c_7,mem_patch0c
+	parse demod,bucket,72
+	ialigned fhs1                   /* give host the information on class and fhs_misc */
+	ialigned am_addr                /* store the am_addr the master assigned us */
+	ialigned nap
+	ialigned regb                   /* store external clock in regb according to clock format */
+	force 0,pdata
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload,crc_failed
+	setarg 0x0ffffffc
+	iand regb,pdata
+	store 4,mem_clke_bt
+	deposit fhs_class
+	store 3,extm_class
+	deposit fhs_misc
+	store 1,extm_fhs_misc
+	deposit am_addr
+	store 1,extm_newconn_am_addr
+	deposit nap
+	store 2,extm_nap
+	deposit bt_clk
+	inject rxf,32
+	compare type_fhs,type,0x0f         /* see if this was fhs packet */
+	setflag true,mark_fhs_already_good,mark
+	branch end_of_packet
+
+clear_got_tx:
+	bpatch patch0d_0,mem_patch0d
+	fetch 1,mem_arq
+	rtnbit0 wack
+	set0 wack,pdata
+	setflip seqnx,pdata
+	store 1,mem_arq
+	fetch 1,mem_last_type
+	beq type_lmp,clear_got_txlmp
+	rtneq type_hv3
+	fetch 1,mem_op
+	rtnbit0 op_txl2cap,pdata
+	set0 op_txl2cap,pdata
+	set1 op_pkt_comp,pdata
+	store 1,mem_op
+	set0 mark_tx_l2cap,mark
+	fetch 2,mem_l2cap_tx_multi_offset
+	nrtn blank
+	fetch 1,mem_op
+	set0 op_pkt_comp,pdata
+	store 1,mem_op
+	branch l2cap_malloc_free
+
+clear_got_txlmp:
+	bpatch patch0d_1,mem_patch0d
+	fetch 1,mem_lmo_header_opcode
+	rshift pdata,pdata
+	beq LMP_START_ENCRYPTION_REQ,start_encryption
+	beq LMP_STOP_ENCRYPTION_REQ,stop_encryption
+	beq LMP_UNSNIFF_REQ, sniff_exit
+	beq LMP_ESCAPE,clear_lmp_escape
+	rtnne LMP_ACCEPTED
+	fetch 1,mem_lmo_payload
+	beq LMP_SCO_LINK_REQ,sco_link_req_by_slave
+	beq LMP_START_ENCRYPTION_REQ,clear_send_setup_complete
+	rtn
+
+clear_lmp_escape:
+	fetch 1,mem_lmo_payload
+	set1 7,pdata
+	rtn
+clear_send_setup_complete:
+	rtn master
+	fetch 1,mem_state
+	rtnbit1 state_conn_comp
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn
+	
+// nokia BH-105  CALLING when reconnection
+sco_link_req_by_slave:
+	rtn master
+	fetch 1,mem_mode
+	isolate1 send_sco_when_slave,pdata
+	branch clean_mem_mode,true
+	//jam LMP_REMOVE_SCO_LINK_REQ,mem_lmo_opcode2
+	rtn
+clean_mem_mode:
+	set0 send_sco_when_slave,pdata
+	store 1,mem_mode
+	rtn
+	
+start_encryption:
+	bpatch patch0d_2,mem_patch0d
+	fetch 1,mem_state_map
+	set1 smap_encryption,pdata
+	store 1,mem_state_map
+	hjam 1,core_encrypt
+	fetch 1,mem_state
+	isolate1 state_conn_comp,pdata
+	rtn
+
+stop_encryption:
+	bpatch patch0d_3,mem_patch0d
+	fetch 1,mem_state_map
+	set0 smap_encryption,pdata
+	store 1,mem_state_map
+	hjam 0,core_encrypt
+	rtn
+
+
+sniff_init:
+	bpatch patch0d_4,mem_patch0d
+	copy clkn_bt,pdata
+	store 4,mem_lpm_delay_after_sniff
+	add clkn_bt,3,rega
+	branch sniff_init_master,master
+	add clke_bt,3,rega
+sniff_init_master:
+	fetcht 2,mem_tsniff
+	deposit rega
+	set0 27,pdata
+	idiv temp
+	fetch 2,mem_dsniff
+	call wait_div_end
+	remainder regc
+	isub regc,pdata
+	branch sniff_init_nowrap,positive
+	iadd temp,pdata
+sniff_init_nowrap:
+	iadd rega,pdata
+	store 4,mem_sniff_anchor
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	fetch 1,mem_state
+	set1 state_insniff,pdata
+	store 1,mem_state
+	fetch 1,mem_sniff_attempt
+	store 1,mem_current_sniff_attempt
+	setarg 0
+	store 3,mem_sniff_rcv
+	store 3,mem_sniff_lost
+	store 1,mem_sniff_unint_lost
+	jam BT_EVT_ENTER_SNIFF,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_rx_window
+	nrtn master
+	add am_addr,-1,queue
+	rtn
+
+sniff_exit:
+	bpatch patch0d_5,mem_patch0d
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	set0 state_insniff,pdata
+	store 1,mem_state
+	fetch 2,mem_rx_window_init
+	store 2,mem_rx_window
+	disable wake
+	jam BT_EVT_EXIT_SNIFF,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+check_attempt:
+	bpatch patch0d_6,mem_patch0d
+	enable attempt
+	fetch 1,mem_state
+	bbit1 state_insniff,check_attempt_sniff
+	rtnmark1 mark_testmode						/* pdata won't be blank now, try attempt */
+	fetch 1,mem_arq
+	rtnbit1 wack
+	fetch 1,mem_lmp_to_send
+	nrtn blank
+	fetch 1,mem_op
+	rtnbit1 op_txl2cap
+check_attempt_nomore:
+	force 0,pdata
+	rtn
+
+check_attempt_sniff:
+	bbit0 state_insco,check_attempt_not_sco
+	fetch 1,mem_current_sniff_attempt
+	beq 2,check_attempt_sniff_restore_sco
+	fetch 1,mem_arq
+	bbit1 wack,check_attempt_notimeout
+	bmark0 mark_esco_rxok,check_attempt_notimeout
+check_attempt_sniff_restore_sco:
+	nbranch check_attempt_notimeout,master
+	fetch 1,mem_lmp_to_send
+	nbranch check_attempt_notimeout,blank
+check_attempt_sco_master:
+	fetch 1,mem_sco_poll
+	increase -1,pdata
+	store 1,mem_sco_poll
+	nbranch check_attempt_nomore,blank
+	jam param_sco_poll,mem_sco_poll
+	branch check_attempt_notimeout
+
+
+
+
+
+	
+check_attempt_not_sco:
+	fetch 1,mem_current_sniff_attempt
+	bne 1,check_attempt_notimeout
+	fetch 1,mem_current_sniff_timeout
+	branch check_attempt_notimeout,blank
+	increase -1,pdata
+	store 1,mem_current_sniff_timeout
+	fetch 1,mem_arq
+	rtnbit1 wack						// waiting for next ack
+	nrtn match						// waiting for next poll
+check_attempt_notimeout:
+	fetch 1,mem_current_sniff_attempt
+	increase -1,pdata
+	store 1,mem_current_sniff_attempt
+	rtn
+
+
+
+
+
+
+
+
+
+	/* enable user if sniff window vialation, queue is extra overhead */
+sniff_check_window:
+	bpatch patch0d_7,mem_patch0d
+	disable swfine
+	copy temp,stop_watch
+	call context_search_sniff_window
+	disable user
+	nrtn zero
+	force 0,stop_watch
+	enable user
+	rtn
+
+	//return true if it is esco context
+check_esco_amaddr:
+	fetch 1,mem_esco_addr
+	icompare 0xff,am_addr
+	rtn
+	
+
+parse_l2cap:	
+	bpatch patch0e_0,mem_patch0e
+	set0 mark_rxbuf_inuse,mark 
+parse_l2cap_cont:
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtn blank
+	isolate1 L2CAP_INUSE_BUFF1,pdata
+	arg mem_l2cap_rxbuff1,contr
+	call process_rx_l2cap_pkt,true
+	bpatch patch0e_1,mem_patch0e
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff1
+	
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtnbit0 L2CAP_INUSE_BUFF2
+	arg mem_l2cap_rxbuff2,contr	
+	call process_rx_l2cap_pkt
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff2
+	rtn
+		
+parse_l2cap_release_buff1:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set0 L2CAP_INUSE_BUFF1,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	setarg 0
+	store 2,mem_l2cap_rxbuff1_len
+	rtn
+parse_l2cap_release_buff2:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set0 L2CAP_INUSE_BUFF2,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	setarg 0
+	store 2,mem_l2cap_rxbuff2_len
+	rtn
+
+l2cap_buff1_inuse:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set1 L2CAP_INUSE_BUFF1,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	rtn
+
+l2cap_buff2_inuse:
+	fetch 1,mem_l2cap_rxbuff_inuse
+	set1 L2CAP_INUSE_BUFF2,pdata
+	store 1,mem_l2cap_rxbuff_inuse
+	rtn
+
+/******************************************/
+/**********  Transmit Packet  *************/
+/******************************************/
+
+slave_send_access:
+	bpatch patch0e_2,mem_patch0e
+	add clke_bt,1,bt_clk          /* slave start to use native clock */
+	call fetch_extm_bt_adr
+	force 0x03,freq_mode          /* connection frequency */
+	call tx_radio_freq
+	call start_transmitter
+	call start_tx_external
+	branch send_access_word
+	
+
+slave_conn_send_packet:
+	bpatch patch0e_3,mem_patch0e
+	call rf_setup_time_slave_slot
+	deposit clke_bt
+	fetcht 4,mem_next_btclk
+	isub temp,pdata
+	rtnne 1					/* missed slave slot */
+	compare type_null,type,0x1f
+	nbranch slave_conn_send_access,true
+	fetch 1,mem_rx_type
+	rtn blank					/* null packet, do nothing */
+slave_conn_send_access:
+	call slave_send_access
+transmit_packet:
+	compare type_id,type,0x1f        /* is this id only ? */
+	branch end_of_packet,true
+	rshift bt_clk,temp
+	or temp,0x40,white_init
+transmit_packet_whitened:
+	bpatch patch0e_4,mem_patch0e
+	enable enable_white
+	enable enable_hec
+	enable encode_fec1
+	set0 mark_longpacket,mark
+	deposit am_addr
+	inject mod,3             /* am_addr, temp is disabled */
+	deposit type
+	inject mod,4
+	fetch 1,mem_arq   /* aka mem_arq */
+	inject bucket,4  /* align up to flowx, arqnx, seqnx */
+	inject mod,3
+	enable enable_parity
+	inject mod,8   /* transmit parity */
+	disable encode_fec1
+	disable enable_parity
+	disable enable_hec
+	set0 PSK3M,radio_ctrl
+	arg 0,temp
+	call reserve_slot
+	bpatch patch0e_5,mem_patch0e
+	and type,0x1f,pdata
+	beq type_lmp, transmit_lmp
+	beq type_null, end_of_packet
+	beq type_poll, end_of_packet
+	beq type_fhs, transmit_fhs  /* master mode fhs need got_tx and ack */
+	beq type_dm1, transmit_dm1
+	beq type_dh1, transmit_dh1
+	beq type_hv3, transmit_hev
+	beq type_3dh1, transmit_3dh1
+	arg 4,temp
+	call reserve_slot
+	beq type_dm3, transmit_dm3
+	beq type_dh3, transmit_dh3
+	arg 8,temp
+	call reserve_slot
+	beq type_dh5, transmit_dh5
+	branch transmit_dm5	/* must be 14, dm5 */
+
+
+transmit_hev:
+	bpatch patch0e_6,mem_patch0e
+	enable encode_fec0
+	enable enable_crc
+	enable encrypt
+	force 30,loopcnt
+	arg mem_sco_obuf,contr
+transmit_ev_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop transmit_ev_loop
+	bmark1 mark_esco,transmit_end
+	branch end_of_packet
+	
+transmit_fhs:
+	bpatch patch0e_7,mem_patch0e
+	fetch 1,mem_fhs_am_addr            /* this is the am_addr to assign to slave */
+	icopy am_addr
+	fetch 1,mem_fhs_misc
+	icopy fhs_misc    /* [7:6]SR [5:4]SP [3:1]PS [0]undef  */
+	fetch 3,mem_class   /* store away class */
+	icopy fhs_class
+	fetch 2,mem_nap
+	icopy nap
+	enable enable_crc
+	enable encode_fec2
+	copy bt_adr,rega
+	call fetch_self_bt_adr
+	pulse recalc
+	nop 32                    /* 30 cycles after recalc for sync word generation */
+	copy bt_clk,timeup
+	fetch 4,mem_clkn_bt
+	icopy bt_clk
+	preload fhs0
+	set1 58,pdata		/* eir */
+	inject mod,72
+	preload fhs1
+	inject mod,72
+	copy timeup,bt_clk
+	copy rega,bt_adr
+	enable enable_parity
+	inject mod,16   /* generate CRC */
+	disable enable_parity
+	branch end_of_packet
+
+transmit_lmp:    /* expect the payload ready as in bb spec */
+	bpatch patch0f_0,mem_patch0f
+	enable encrypt
+	enable enable_crc
+	enable encode_fec2
+	fetch 1,mem_lmo_header_length   /* this is the payload header */
+	and pdata,0x1f8,temp       /* temp is number of bits, check payload header format */
+	arg mem_lmo_header_length,contr
+	increase 8,temp   /* temp is in bits */
+transmit_lmp_loop:
+	add temp,-72,regc   /* regc is remainder */
+	nbranch transmit_lmp_finish,positive
+	ifetch 9,contr
+	inject mod,72
+	copy regc,temp
+	branch transmit_lmp_loop
+transmit_lmp_finish:
+	ifetch 9,contr
+	iinject mod,temp
+	branch transmit_end
+
+transmit_dm1:
+	enable encode_fec2
+	branch transmit_dmh
+transmit_dm3:
+transmit_dm5:
+	enable encode_fec2
+	set1 mark_longpacket,mark
+	branch transmit_dmh
+
+transmit_3dh1:
+	set1 PSK3M,radio_ctrl
+transmit_dh1:
+	enable encode_fec0
+	branch transmit_dmh
+	
+transmit_dh3:
+transmit_dh5:
+	set1 PSK3M,radio_ctrl
+	enable encode_fec0
+	set1 mark_longpacket,mark
+
+transmit_dmh:
+	bpatch patch0f_1,mem_patch0f
+	fetch 1,mem_state_map
+	bbit0 smap_edr,transmit_noedr
+	sub type,3,null
+	branch transmit_noedr,positive
+	disable encrypt
+	disable encode_fec2
+	enable encode_fec0
+	disable enable_white
+	set1 PSK,radio_ctrl
+	isolate1 PSK3M,radio_ctrl
+	branch transmit_edr3m,true
+	setarg 0xabeee
+	inject mod,20
+	branch transmit_edr_sync_end
+transmit_edr3m:
+	setarg 0x5faeba
+	inject mod,24
+	setarg 0x12
+	inject mod,6
+transmit_edr_sync_end:	
+	enable enable_white
+	set1 mark_longpacket,mark
+transmit_noedr:
+	enable encrypt
+	enable enable_crc
+	bmark1 mark_loopback,transmit_loopback
+	fetch 1,mem_tx_lch
+	inject mod,3
+	fetch 2,mem_tx_len
+	iforce loopcnt
+	bmark1 mark_longpacket,transmit_long
+	inject mod,5
+	branch transmit_stuff
+transmit_long:	
+	inject mod,13
+transmit_stuff:
+	deposit loopcnt
+	branch transmit_end,blank
+	fetch 2,mem_txptr
+	iforce contr
+transmit_stuff_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop transmit_stuff_loop
+//	branch transmit_end
+
+transmit_end:
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	call set_wait_ack
+	fetch 1,mem_state_map
+	bbit0 smap_edr,end_of_packet
+	force 0,pdata
+	inject mod,6				/* edr trailer */
+	branch end_of_packet
+
+
+transmit_loopback:
+	bpatch patch0f_2,mem_patch0f
+	bmark1 mark_longpacket,transmit_loopback_long
+transmit_loopback_short:
+	fetch 1,mem_lch_code
+	inject mod,3						/* LLID and FLOW */
+	fetch 1,mem_len	/* take packet length */
+	iforce regc
+	inject mod,5
+	branch transmit_loopback_cont
+transmit_loopback_long:
+	fetch 1,mem_lch_code
+	inject mod,3						/* LLID and FLOW */
+	fetch 2,mem_len	/* take packet length */
+	iforce regc
+	inject mod,13
+transmit_loopback_cont:
+	arg mem_rxbuf,contr
+transmit_loopback_loop:	
+	copy regc,null
+	branch transmit_loopback_end,zero
+	ifetch 1,contr
+	inject mod,8
+	increase -1,regc
+	branch transmit_loopback_loop
+transmit_loopback_end:
+	fetch 2,mem_tst_pktcnt_dmh
+	increase 1,pdata
+	store 2,mem_tst_pktcnt_dmh
+	branch transmit_end
+	
+
+apply_switch_clke:
+	fetch 4,mem_clke_bt
+	add pdata,7,rega
+	fetch 2,mem_slot_offset
+	nbranch apply_switch_nozero,blank
+	increase -3,rega
+	branch apply_switch_wait_loop
+apply_switch_nozero:
+	mul32 pdata,12,pdata
+	fetcht 2,core_rthalfslot
+	increase 1,temp
+apply_switch_loop:
+	isub temp,pdata
+	nbranch apply_switch_bt,positive
+	increase -1,rega
+	branch apply_switch_loop
+apply_switch_bt:
+	sub pdata,0,pdata
+apply_switch_wait_loop:
+	until null,oneslot
+	compare 0,clkn_bt,3
+	nbranch apply_switch_wait_loop,true
+	iforce clke_rt
+	copy rega,clke_bt
+	iforce clke_rt
+	rtn
+	
+
+calc_slot_offset:
+	bpatch patch0f_3,mem_patch0f
+	until null,halfslot
+	deposit clke
+	iforce contr
+	rshift16,pdata,pdata
+	isub clkn_bt,loopcnt
+	and_into 3,loopcnt			/* bt portion */
+	nbranch calc_bt_portion,zero
+	force 0,pdata
+	branch calc_skip_bt
+calc_bt_portion:
+	arg 3750,temp
+	force 0,pdata
+calc_slot_offset_loop:
+	iadd temp,pdata
+	loop calc_slot_offset_loop
+calc_skip_bt:
+	iadd contr,pdata			/* add rt portion */
+	div pdata,12
+	call wait_div_end
+	quotient pdata
+	store 2,mem_slot_offset
+	rtn
+
+calc_clke_offset:
+	bpatch patch0f_4,mem_patch0f
+	deposit clke
+	copy clkn,temp
+	isub temp,null
+	nsetflag positive,44,pdata
+	isub temp,temp
+	setarg 3750
+	isolate0 15,temp
+	branch calc_clke_pos,true
+	setarg -61786
+	iadd temp,temp
+calc_clke_pos:
+	storet 6,mem_le_clk_offset
+	rtn le
+	storet 6,mem_clk_offset
+	rtn
+
+calc_clke:
+	disable clknt
+	fetch 6,mem_le_clk_offset
+	branch calc_clke2,le
+	fetch 6,mem_clk_offset
+calc_clke2:
+	iadd clkn,alarm
+	increase 10,alarm
+	setarg 3750
+	isub alarm,pdata
+	isolate0 15,pdata
+	branch calc_clke_pos_adj,true
+	setarg 0xf15a
+	iadd alarm,alarm
+calc_clke_pos2:
+	copy alarm,clke
+	rtn
+calc_clke_pos_adj:		/* add 2 clock */
+	force 0,null
+	branch calc_clke_pos2
+	
+/******************************************/
+/********* RF related functions ***********/
+/******************************************/
+
+
+calc_radio_freq:
+	bpatch patch0f_5,mem_patch0f
+	call set_sync_on
+	copy bt_clk,pdata
+	and_into 0x180,pdata
+	compare 3,freq_mode,0x07
+	nbranch freq_not_connection,true    /* don't do the hack if not in connection */
+	rshift3 pdata,pdata
+	iadd freq_index,pdata
+	branch do_hop_mod_now
+freq_not_connection:	
+	copy freq_index,pdata
+do_hop_mod_now:
+	div pdata,79
+	pulse recalc         /* now is good time to recalc id */
+	call wait_div_end
+	remainder rega
+	add rega,-40,temp
+	branch odd_half,positive
+	lshift rega,temp
+	branch freq_result
+odd_half:
+	lshift temp,temp
+	increase 1,temp
+freq_result:	
+	bpatch patch0f_6,mem_patch0f
+	fetch 1,mem_mode
+	bbit0 afh_change,afh_process_con
+afh_process_0:	
+	fetch 4, mem_afh_instant   
+	isub bt_clk, null
+	branch afh_process_con,positive
+	call afh_clear
+	fetch 1,mem_afh_new_mod
+	rtn blank
+	fetch 1,mem_mode
+	set1 afh_enable,pdata
+	store 1,mem_mode
+	fetch 5,mem_afh_map_new
+	store 5,mem_afh_map_lo
+	ifetch 5,contr
+	store 5,mem_afh_map_hi
+	call afh_process_freq_map
+afh_process_con:
+	fetch 1,mem_mode
+	rtnbit0 afh_enable
+	isolate1 1,bt_clk
+	branch afh_same_channel,true	/* at odd slot, use the same as last even */
+	rshift3 temp,rega
+	and temp,7,queue
+	setarg mem_afh_map_lo  
+	iadd rega, rega
+	ifetch 1, rega
+	qisolate0 pdata
+	branch afh_process_1,true		/* not in map, do afh */
+	deposit temp
+	branch afh_process_end
+afh_process_1:
+	fetch 1, mem_afh_used
+	iforce regb                     
+	deposit bt_clk
+	and_into 0x180, pdata
+	rshift3 pdata,pdata
+	iadd freq_index,pdata
+	idiv regb
+	setarg mem_afh_map     
+	call wait_div_end
+	remainder rega
+	iadd rega,contr
+	ifetch 1,contr
+afh_process_end:	
+	store 1,mem_afh_index
+	iforce temp  
+  	rtn
+
+afh_same_channel:
+	fetch 1, mem_afh_index           /* last afh index  */
+	iforce temp
+	rtn
+
+afh_clear:
+	fetch 1,mem_mode
+	set0 afh_enable,pdata
+	set0 afh_change,pdata
+	store 1,mem_mode
+	rtn
+/*
+fixed_frequency:
+	fetcht 1,mem_fixed_freq
+	rtn
+*/
+afh_process_freq_map:
+	bpatch patch0f_7,mem_patch0f
+	arg mem_afh_map,contw
+	force 10,loopcnt
+	call memset0
+	arg mem_afh_map,contw
+	force 0,regC
+	force 2,queue
+process_freq_3:	
+	fetch 5,mem_afh_map_lo
+	iforce temp
+	compare 2,queue,0xff
+	branch process_freq_1,true
+	rshift temp,temp
+process_freq_1:	
+	isolate0 0,temp
+	branch process_freq_0,true
+	deposit regC
+	istore 1,contw
+process_freq_0:
+	rshift2 temp,temp
+	increase 2,regC
+	compare 40,regC,0xfe
+	nbranch process_freq_2,true
+	fetch 5,mem_afh_map_hi
+	iforce temp
+	compare 2,queue,0xff
+	branch process_freq_2,true
+	rshift temp,temp
+process_freq_2:	
+	sub regC,78,null
+	branch process_freq_1,positive
+	force 1,regC
+	increase -1,queue
+	nbranch process_freq_3,zero
+	arg mem_afh_map,rega
+	deposit contw
+	isub rega,pdata
+	store 1,mem_afh_used
+	rtn
+
+rx_radio_freq:
+	bpatch patch10_0,mem_patch10
+	call calc_radio_freq
+	fetch 1,mem_debug_config
+	bbit0 debug_rx_fixed_freq,rx_radio_freq_now
+	fetcht 1,mem_rx_fixed_freq
+rx_radio_freq_now:
+	branch set_freq_rx
+	
+
+tx_radio_freq:
+	bpatch patch10_1,mem_patch10
+	call calc_radio_freq
+	fetch 1,mem_debug_config
+	bbit0 debug_tx_fixed_freq,tx_radio_freq_now
+	fetcht 1,mem_tx_fixed_freq
+tx_radio_freq_now:
+	branch set_freq_tx
+	
+
+fetch_giac:
+	force 0,uap
+	fetch 3,mem_glap
+	iforce lap
+	rtn
+
+fetch_page_bt_adr:
+	bpatch patch10_2,mem_patch10
+	fetch 1,mem_hci_puap
+	icopy uap
+	fetch 3,mem_hci_plap
+	icopy lap
+	rtn
+
+fetch_self_bt_adr:
+	bpatch patch10_3,mem_patch10
+	fetch 2,mem_nap
+	icopy nap
+	fetch 1,mem_uap
+	icopy uap
+	fetch 3,mem_lap
+	icopy lap                 /* copy self_adr,bt_adr */      /* use own address */
+	rtn
+
+fetch_extm_bt_adr:
+	bpatch patch10_4,mem_patch10
+	fetch 2,mem_pnap
+	icopy nap
+	fetch 1,mem_puap
+	icopy uap
+	fetch 3,mem_plap
+	icopy lap         
+	rtn
+
+
+fetch_diac:
+	bmark1 mark_all_diac,fetch_diac_do
+	rtnmark0 mark_inquiry_state
+	rtnmark0 mark_periodical_diac
+fetch_diac_do:
+	and_into -256,lap
+	pulse recalc
+	nop 32
+	rtn
+
+
+shutdown_radio:
+	bpatch patch10_5,mem_patch10
+	branch shutdown_radio0,is_rx
+	hjam 0xd4, 0x955
+	nop 4
+	hjam 0xd2, 0x955
+	nop 4
+	hjam 0xd1, 0x955
+	nop 4	
+	fetch 1,mem_tx_power
+	beq TX_POWER_0DB,shutdown_radio_0db
+	beq TX_POWER_3DB,shutdown_radio_3db
+	beq TX_POWER_5DB,shutdown_radio_5db
+	beq TX_POWER_f3DB,shutdown_radio_f3db
+	beq TX_POWER_f5DB,shutdown_radio_f5db
+	beq TX_POWER_PAIR,shutdown_radio_pair
+shutdown_radio_5db:	
+shutdown_radio_0db:
+	hjam 0xd0, 0x955
+	hjam 0xe0, 0x956
+shutdown_radio0:
+	force 0x08,radio_ctrl
+	force 0,radio_ctrl
+	disable is_rx
+	disable is_tx
+	pulse packet_end
+	hjam 0x0,rfen_mdm
+	hjam 0x0,rfen_tx
+	hjam 0x0,rfen_rx
+	hjam 0,rfen_sn
+	hjam 0x70,rfen_msc
+	hjam 0x0,rfen_adc
+	rtn
+	
+shutdown_radio_pair:
+shutdown_radio_f5db:
+shutdown_radio_f3db:
+shutdown_radio_3db:
+	hjam 0xd0,0x955
+	hjam 0xc0,0x956
+	branch shutdown_radio0
+
+set_sync_on:
+	bpatch patch10_6,mem_patch10
+	hjam 0x0,rfen_mdm					/* if called from tx or rx */
+	hjam 0x0,rfen_tx
+	hjam 0x18,rfen_rx
+	hjam 0xa7,rfen_sn
+	hjam 0x7f,rfen_msc
+	rtn
+
+set_freq_rx:
+	bpatch patch10_7,mem_patch10
+		/* IF is +2MHz */
+	storet 1,mem_last_freq
+	add temp,rx_freq_offset,rega			/* index to frequency */
+	hjam 0x07,0x96d                                         /*Max added, for best sensitivity*/
+	branch rf_write_freq
+rf_rx_enable:
+	bpatch patch11_0,mem_patch11
+	hjam 0xcf,rfen_tx
+	nop 10					/* wait adc clk48 ready */
+	hjam 0xff,rfen_rx
+	hjam 0xaf,rfen_sn
+	hjam 0xff,rfen_msc
+	nop 10
+	hjam 0xa0,rfen_mdm
+	rtn
+	
+set_freq_tx_offset:
+	fetch 1,mem_250k_freq_enable	//default: 0
+	branch set_freq_tx_2M_offset,blank
+set_freq_tx_0M_offset:
+	add temp,2,rega			//250k
+	rtn
+set_freq_tx_2M_offset:
+	add temp,0,rega			// bt 2M Medium Frequency
+	rtn
+
+set_freq_tx:
+	bpatch patch11_1,mem_patch11
+	storet 1,mem_last_freq
+	call set_freq_tx_offset
+	call rf_write_freq
+	setarg param_pll_setup
+	call sleep
+txon:	
+	hjam 0x1,rfen_adc
+	hjam 0x3c,rfen_rx
+	hjam 0xe0,rfen_tx
+	hjam 0x12,0x96d
+	nop 10
+	hjam 0x01,rfen_mdm
+	hjam 0x3d,rfen_mdm
+	nop 10
+	hjam 0xb7,rfen_sn
+	nop 10
+	hjam 0x7f, rfen_mdm
+	fetch 1,mem_tx_power
+	beq TX_POWER_0DB,set_tx_power_0db
+	beq TX_POWER_3DB,set_tx_power_3db	
+	beq TX_POWER_5DB,set_tx_power_5db
+	beq TX_POWER_f3DB,set_tx_power_f3db	
+	beq TX_POWER_f5DB,set_tx_power_f5db
+	beq TX_POWER_PAIR,set_tx_power_pair
+set_tx_power_0db:	
+	hjam 0xf0,0x956
+	call txon_common
+	hjam 0xd8,0x955
+	rtn
+
+set_tx_power_3db:
+	hjam 0xdf,0x956
+	call txon_common
+	hjam 0xdf,0x955
+	rtn
+
+set_tx_power_5db:
+	hjam 0xff,0x956
+	call txon_common
+	hjam 0xdf,0x955
+	rtn
+set_tx_power_f3db:
+	hjam 0xce,0x956
+	call txon_common
+	hjam 0xd8,0x955
+	rtn
+
+set_tx_power_f5db:
+	hjam 0xcb,0x956
+	call txon_common
+	hjam 0xd8,0x955
+	rtn
+
+set_tx_power_pair:
+	hjam 0xd0,0x955
+	hjam 0xc0,0x956
+	hjam 0x4c,0x957
+	hjam 0x6c,0x958
+	hjam 0x50,0x959
+	rtn
+
+txon_common:
+	nop 4
+	hjam 0xd1,0x955
+	nop 4
+	hjam 0xd2,0x955
+	nop 4
+	hjam 0xd4,0x955
+	nop 4
+	rtn
+
+
+initialize_radio:
+	hjam clksel_rc,core_clksel
+	ncall wake_up_m0,wake
+initialize_radio_wait:
+	fetch 2,mem_rf_init_ptr
+	bbit0 14,initialize_radio_wait
+	iforce contr
+	arg 0x8900,temp
+initialize_radio_loop:
+	ifetch 1,contr
+	beq 0xff,initialize_radio_cont
+	ior temp,contw
+	ifetch 1,contr
+	istore 1,contw
+	branch initialize_radio_loop
+initialize_radio_cont:
+	bpatch patch11_2,mem_patch11
+	call lpm_cal_xtal_startup
+	call switchto_dpllclk
+//	ncall check_dpll,wake
+	setarg param_dpll_start_delay
+	iadd clkn_bt,pdata
+	store 4,mem_dpll_clkn
+	set1 RESET,radio_ctrl
+	force 0,radio_ctrl
+	ncall do_rccal,wake
+	branch set_rccal
+
+	/* rega is frequency, 00=2400Mhz */
+rf_write_freq:
+	bpatch patch11_3,mem_patch11
+	setarg 2400
+	iadd rega,temp
+	fetch 1,mem_fcomp_mul
+	hjam 0x04,rf_pll_rstn
+	imul32 temp,pdata
+	fetcht 1,mem_fcomp_div
+	idiv temp
+	call wait_div_end
+	quotient rega			/* rega is FLOOR(FVCO/fcomp) */
+	remainder pdata		
+	lshift16 pdata,pdata
+	lshift4 pdata,pdata		/* pdata is frac * 2^20 */
+	idiv temp
+	call wait_div_end
+	quotient pdata		/* pdata is frac *2^20/fcomp */
+	lshift8 pdata,pdata
+	lshift pdata,pdata
+	ior rega,pdata
+	hstore 4,rf_pll_intg
+	hjam 0x44,rf_pll_rstn
+	hjam 0xc4,rf_pll_rstn
+	rtn
+
+	
+do_rccal:
+	bpatch patch11_4,mem_patch11
+	hjam 0x02,rfen_adc
+	setarg 250000
+	call sleep					/* wait clkpll&xtal stable */
+	hjam 0x7f,rfen_rx
+	nop 130
+	hjam 0x30,rf_rccal_ctrl
+	hjam 0xd0,rfen_tx
+	hjam 0x70,rf_rccal_ctrl
+	hjam 0xf0,rf_rccal_ctrl
+	force 50,loopcnt
+do_rccal_loop:
+	hfetch 1,rf_rccal_result
+	bbit1 5,do_rccal_end
+	loop do_rccal_loop
+do_rccal_end:
+	store 1,mem_rf_rccal
+	hjam 0,rfen_tx
+	hjam 0,rfen_rx
+	hjam 0x00,rfen_adc
+	rtn
+
+set_rccal:
+	bpatch patch11_5,mem_patch11
+	fetch 1,mem_rf_rccal
+	set1 5,pdata
+	hstore 1,rf_rccal_ctrl
+	hfetcht 1,rf_bpf_ctrim
+	and_into 7,temp
+	lshift3 pdata,pdata
+	ior temp,pdata
+	hstore 1,rf_bpf_ctrim
+	hfetch 1,rf_bpf_ib
+	set0 bpf_rccal,pdata
+	hstore 1,rf_bpf_ib
+	hfetch 1,rf_adc_rccal
+	set0 adc_rccal,pdata
+	hstore 1,rf_adc_rccal
+	rtn
+
+save_rssi:
+	bpatch patch11_6,mem_patch11
+	hfetch 2,rf_afc_d2a
+	rshift4 pdata,pdata
+	rshift3 pdata,pdata
+	sub pdata,0,pdata
+	and_into 0xff,pdata
+	div pdata,10
+	call wait_div_end
+	quotient pdata
+	lshift4 pdata,pdata
+	remainder temp
+	ior temp,pdata
+	store 1,mem_rssi			/* bcd value */
+	rtn
+
+	
+switchto_dpllclk:
+	hjam clksel_rc,core_clksel
+	hfetch 1,rf_clkpll_frac+2
+	set0 4,pdata
+	set0 5,pdata
+	hstore 1,rf_clkpll_frac+2
+	hjam 0x00,rfen_ck
+	hjam 0x00,rfen_msc
+	hjam 0x70,rfen_msc
+	hjam 0xff,rfen_ck
+	hfetch 1,rf_clkpll_frac+2
+	set1 4,pdata
+	set1 5,pdata
+	hstore 1,rf_clkpll_frac+2
+	call init_lpm_ctrl
+	hfetch 1,rf_clkpll_int
+	set1 7,pdata
+	hstore 1,rf_clkpll_int
+	set0 7,pdata
+	hstore 1,rf_clkpll_int
+	set1 7,pdata
+	hstore 1,rf_clkpll_int
+	hjam clksel_dpll,core_clksel
+	nop 1
+	hjam clksel_xtal,core_clksel
+	hfetch 1,rf_clkpll_frac+2
+	and_into 0xcf,pdata
+	hstore 1,rf_clkpll_frac+2
+	or_into 0x30,pdata
+	hstore 1,rf_clkpll_frac+2
+	rtn
+
+	
+xtal_fast_wake:
+	setarg 0xf0f
+	branch lpm_write_config
+
+init_lpm_ctrl:
+	setarg 0x80f
+	branch lpm_write_config
+
+
+
+start_receiver:
+	bpatch patch11_7,mem_patch11
+	call rf_rx_enable
+	disable is_tx
+	enable is_rx
+	pulse init_encrypt
+	rtn
+
+prep_crypt:
+	bpatch patch12_0,mem_patch12
+	fetch 1,mem_state_map
+	isolate1 smap_encryption,pdata
+	setflag true,0,pdata
+	hstore 1,core_encrypt
+	arg mem_kc,contr
+	ifetch 9,contr
+	iforce kc_ls
+	ifetch 7,contr
+	iforce kc_ms
+	fetch 1,mem_key_size
+	add pdata,-1,g1l
+	pulse kc_p_activate               /* immediately start calculating primary Key */
+	rtn
+	
+wait_access_end:
+	deposit clke
+	store 6,mem_sync_clke
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	arg param_clke_cal,clke_rt
+	increase 1,clke_bt
+	and_into 0x1fc,clke_bt
+	rtn
+
+
+
+wait_access_mhalfbnd:
+	enable decode_fec0
+wait_access_mhalfbnd_correlate:
+	correlate null,mhalfbnd    /* keep correlating until sync is found, or clke half */
+	branch wait_access_end,sync
+	compare 0x02,clke_bt,0x02
+	nbranch wait_access_mhalfbnd_correlate,true
+	branch wait_access_end
+
+wait_access_clkn_rt:
+	bpatch patch12_1,mem_patch12
+	arg param_conn_access,timeup	/* found sync must occur within this time */
+	enable decode_fec0
+	correlate clkn_rt,meet    /* keep correlating until sync is found, or until clkn_rt timeup */
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	rtn
+
+wait_access_forever:
+	bpatch patch12_2,mem_patch12
+	enable decode_fec0
+	correlate null,timeout    /* keep correlating until sync is found, or timeout */
+	disable decode_fec0
+	nbranch shutdown_radio,sync
+	arg param_clke_cal,clke_rt
+	and_into 0x1fc,clke_bt
+	rtn
+
+	/* reserve slots for mult-slot packet */
+reserve_slot:
+	bpatch patch12_3,mem_patch12
+	iforce rega
+	deposit bt_clk
+	iadd temp,timeup
+	copy timeup,pdata
+	store 4,mem_next_btclk
+	deposit rega
+	rtn
+
+	/* pdata = clks ahead of bt_clk */
+ahead_window:
+	copy pdata,temp
+	bpatch patch12_4,mem_patch12
+	copy temp,pdata
+	call clk2bt
+	lshift16 bt_clk,pdata
+	set1 44,pdata
+	call clk_diff
+	set0 44,pdata
+	call get_clk
+	call clk_diff
+	rtn user
+	call clk2rt
+	iforce stop_watch
+	until null,timeout
+	rtn
+
+
+setup_clk:
+	bpatch patch12_5,mem_patch12
+	branch setup_clkn,clknt
+	until clke_rt,meet
+skip_setup_clke:
+	copy clke_bt,temp
+	branch setup_clknbt
+setup_clkn:
+	branch skip_setup_clkn,attempt
+	until clkn_rt,meet
+skip_setup_clkn:
+	copy clkn_bt,temp
+setup_clknbt:
+	branch setup_clk11,user
+	compare 1,temp,3
+	nbranch setup_clk,true
+setup_complete:
+	bpatch patch12_6,mem_patch12
+	fetch 1,mem_state
+	rtnbit0 state_inconn
+	fetch 4,mem_next_btclk
+	isub temp,pdata
+	nrtn positive
+	sub pdata,0xff,null
+	branch setup_clk,positive
+	rtn
+setup_clk11:
+	compare 3,temp,3
+	nbranch setup_clk,true
+	branch setup_complete
+
+rf_setup_time:
+	bpatch patch12_7,mem_patch12
+	arg param_rf_setup,timeup
+	branch setup_clk
+	
+rf_setup_time_slave_slot:
+	disable user
+	branch rf_setup_time
+
+rf_setup_time_master_slot:
+	enable user
+	branch rf_setup_time
+	
+start_transmitter:
+	bpatch patch13_0,mem_patch13
+	call prep_crypt
+	disable is_rx
+	enable is_tx
+	rtn
+
+
+
+start_tx_native:
+	bpatch patch13_1,mem_patch13
+	arg param_tx_setup,timeup
+	until clkn_rt,meet         /* wait until start_tx time */
+	pulse init_encrypt
+	rtn
+
+start_rx_native:
+	bpatch patch13_2,mem_patch13
+	arg param_rx_setup,timeup
+	until clkn_rt,meet
+	rtn
+
+
+start_tx_external:
+	bpatch patch13_3,mem_patch13
+	arg param_tx_setup,timeup
+	until clke_rt,meet         /* wait until start_tx time */
+	pulse init_encrypt
+	rtn
+
+send_access_word:
+	bpatch patch13_4,mem_patch13
+	preload access          /* load in access word ready to be sent */
+	enable encode_fec0
+	set1 TXGFSK,radio_ctrl
+	inject mod,72
+	disable encode_fec0
+	rtn
+
+
+scan_mode_whiten:
+	copy xin,temp
+	or_into 0x60,temp                /* extend xin with 5->1, 6->1 */
+	copy temp,white_init
+	rtn
+
+
+
+	/* return blank if free amaddr is found */
+get_free_amaddr:
+	bpatch patch13_5,mem_patch13
+	fetch 1,mem_current_amaddr
+	increase 1,pdata
+	bne param_esco_addr,get_free_amaddr_cont
+	force 1,pdata
+get_free_amaddr_cont:
+	store 1,mem_current_amaddr
+	iforce am_addr
+	rtn
+
+get_clk:
+	copy clkn,temp
+	rtn master
+	copy clke,temp
+	rtn
+
+get_clkbt:
+	deposit clkn_bt
+	rtn master
+	deposit clke_bt
+	rtn
+
+
+supervision_update:
+	bpatch patch13_6,mem_patch13
+	fetcht 4,mem_supervision_timer
+	call get_clkbt
+	isub temp,timeup					/* and to 28 bits */
+	deposit timeup
+	fetcht 2,mem_supervision_to
+	lshift temp,temp
+	isub temp,pdata
+	rtn
+	
+supervision_flush:
+	bpatch patch13_7,mem_patch13
+	call get_clkbt
+	store 4,mem_supervision_timer
+	rtn
+
+assert:
+	bpatch patch14_0,mem_patch14
+	branch assert
+	
+loop:
+	branch loop
+
+sleep:	
+	rtn blank
+	/* sleep pdata clocks, only even clocks are accurate */
+	rshift pdata,pdata
+	increase -3,pdata
+sleep_loop:	
+	increase -1,pdata
+	nbranch sleep_loop,zero
+	force 0,pdata
+	rtn
+
+
+
+init_param:
+	/* clear specified sched ram */
+	arg 0x10,loopcnt
+	arg 0,contw
+	call memset0
+	arg mem_le_state,contw
+	arg 10,loopcnt
+	call memset0
+	jam 0,mem_sp_calc
+	jam 0,mem_fifo_temp
+	jam 0,mem_le_testtype
+	jam 0,mem_debug_config
+	jam 0,mem_lmp_conn_state
+	bpatch patch14_1,mem_patch14
+	jam 0,mem_connection_options
+	jam 0,mem_tester_emulate
+	jam 0,mem_tester_cnt
+	setarg param_glap
+	store 3,mem_glap
+	setarg param_acl_pktlen
+	store 2,mem_acl_pktlen
+	jam param_sco_pktlen,mem_sco_pktlen
+	jam param_acl_pktcnt,mem_acl_pktcnt
+	jam param_sco_pktcnt,mem_sco_pktcnt
+	setarg param_hci_version
+	store 3,mem_hci_version
+//	setarg param_lmp_version
+//	store 3,mem_lmp_version
+//	setarg param_lmp_subversion
+//	store 2,mem_lmp_subversion
+	jam 0x60,mem_fhs_misc		/* R1 for 1.28s ps interval,P2 */
+	jam param_max_slot,mem_max_slot
+	jam 0x02,mem_fw_ver		/* set firmware version */
+ifdef SIMPLE_PAIRING
+	fetch 1,mem_ssp_enable
+	ncall init_memp,blank
+endif
+ifdef SECURE_CONNECTION
+	fetch 1,mem_le_secure_connect_enable
+	ncall init_memp_256,blank
+endif
+	bpatch patch14_2,mem_patch14
+	rtn wake
+	setarg 0
+	store 2,mem_tx_len
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+
+
+
+
+/*****************************************LPO************************************************/
+
+lpmstate:
+	fetch 4,core_lpm_xtalcnt
+	isolate1 hibernate,pdata
+	bbit0 isogate,lpm_open_isogate
+	nbranch clean_mem,true			// power on
+	arg param_hibernate_clks,temp
+	deposit auxcnt
+	branch lpm_enter_sleep,blank		// hibernate timeout, continue sleeping
+lpm_open_isogate:
+	set1 isogate,pdata
+	set1 xram_switch,pdata
+	set1 pram_switch,pdata
+	store 4,core_lpm_reg
+	until null,lpo_edge				// delay to wait lpo rstn release
+	until null,lpo_edge
+	call lpm_write_ctrl2
+	fetch 1,core_lpm_isogate
+	set1 enable_retmem,pdata
+	store 1,core_lpm_isogate
+	call lpm_write_ctrl2
+	branch clean_mem,true			// doze or hibernate
+	enable wake
+lpm_load_context:
+	jam 0x1,core_config				// signal m0 for NOT loading patch
+	fetch 8,mem_saved_mark
+	iforce mark
+	fetch 6,core_gpio_wakeup
+	store 6,mem_gpio_wakeup
+	rtn
+
+lpm_save_context:
+	deposit mark
+	store 8,mem_saved_mark
+	branch lpm_write_gpio_wakeup
+
+
+lpo_calibration:
+	fetcht 1,core_clksel
+	and temp,0xf0,pdata
+	nbranch lpo_cal_inited,blank
+	fetch 3,mem_clks_per_lpo
+	nrtn blank
+	and temp,0xf,pdata
+	or_into 0xc0,pdata
+	store 1,core_clksel
+	jam ccnt_start,core_dma_start
+lpo_cal_inited:
+	fetch 1,core_misc_status
+	rtnbit0 CCNT_DONE
+	fetch 3,core_ccnt_counter
+	store 3,mem_clks_per_lpo
+	rtn
+
+
+	/* temp is synced clke */
+lpm_adjust_clk:
+	bpatch patch14_3,mem_patch14
+	deposit clke
+	call clk_diff_rt
+	fetcht 4,mem_sleep_counter_all
+	sub temp,0xff,null
+	rtn positive				// interval too small
+	lshift8 pdata,pdata
+	lshift4 pdata,pdata
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	arg param_lpm_adjmax,temp
+	call ceiling
+	store 1,mem_lpm_adjust
+	nbranch lpm_adjust_positive,user
+	sub pdata,0,pdata
+lpm_adjust_positive:
+	fetcht 3,mem_clks_per_lpo
+	iadd temp,pdata
+	store 3,mem_clks_per_lpo
+lpm_clear_counter:
+	setarg 0
+	store 4,mem_sleep_counter_all
+	rtn
+
+lpm_doze:
+	fetch 1,mem_lpm_doze_switch
+	branch lpm_hibernate_normal
+
+	/* no retention memory at all */
+lpm_hibernate:
+	fetch 1,mem_lpm_hibernate_switch
+lpm_hibernate_normal:
+	store 1,mem_lpm_xtalcnt + 3
+	bpatch patch14_4,mem_patch14
+	call lpm_write_gpio_wakeup
+	arg param_hibernate_clks,temp
+	fetch 1,mem_lpm_config+1
+	set0 7,pdata					/* lowest lpo */
+	store 1,mem_lpm_config+1
+
+	/* temp is lpo clocks to sleep */
+lpm_sleep:
+	bpatch patch14_5,mem_patch14
+	call xtal_fast_wake
+	fetch 4,mem_sleep_counter_all
+	iadd temp,pdata
+	store 4,mem_sleep_counter_all
+	call lpm_save_context
+	fetch 3,mem_lpm_xtalcnt
+	store 3,core_lpm_reg
+	ifetchr rega,1,contr
+	fetch 1,core_lpm_buckcfg
+	istore 1,contw
+	until null,lpo_edge
+	storer clkn,6,mem_sleep_clkn
+	hjam lpmreg_sel_ctrl2,core_lpm_wr
+	until null,lpo_edge
+	until null,lpo_edge
+	storer rega,1,core_lpm_isogate
+	hjam lpmreg_sel_ctrl2,core_lpm_wr
+lpm_enter_sleep:
+	until null,lpo_edge
+	until null,lpo_edge
+	hstoret 4,core_lpm_reg
+	hjam lpmreg_sel_counter,core_lpm_wr
+	until null,never
+
+
+
+
+lpm_recover_clk:
+	bpatch patch14_6,mem_patch14
+	setarg 0
+	copy auxcnt,null
+	branch lpm_recover_timeout,zero
+	hfetch 1,core_lpm_xtalcnt
+	hfetcht 1,core_lpm_buckcnt
+	isub temp,null
+	branch lpm_recover_xtal,positive
+	deposit temp
+lpm_recover_xtal:
+	isub auxcnt,pdata
+	increase 1,pdata
+lpm_recover_timeout:
+	increase 8,pdata
+	until null,lpo_edge
+	iadd lpo_time,pdata
+	fetcht 4,mem_sleep_counter
+	iadd temp,pdata
+	fetcht 3,mem_clks_per_lpo
+	imul32 temp,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	increase param_lpm_fix,pdata
+	arg 3750,temp
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	lshift16 pdata,pdata
+	remainder temp
+	ior temp,pdata
+	fetcht 6,mem_sleep_clkn
+	call clk_add
+	copy temp,clkn
+	fetch 6,mem_context + coffset_clk_offset
+	call calc_clke2
+	rtn
+	
+lpm_dispatch:
+	bpatch patch14_7,mem_patch14
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+	fetch 1,mem_ssp_enable
+	branch lpm_dispatch_next,blank
+	fetch 1,mem_sp_local_key_invalid	// simple pairing is not ready
+	rtn blank
+lpm_dispatch_next:
+	fetch 1,mem_le_sc_calc
+	nrtn blank	
+	call lpm_check_wake_lock
+	nrtn blank
+	fetch 1,mem_context
+	compare 3,pdata,0x7							/* sco won't sleep */
+	nbranch lpm_dispatch_unconn,true
+	fetch 2,mem_context + coffset_tsniff
+	rtn blank										/* role switch */
+	rtn wake
+	bpatch patch15_0,mem_patch15
+	fetcht 1,mem_lpm_current_mult
+	fetch 2,mem_context + coffset_tsniff
+	imul32 temp,pdata
+	rshift4 temp,temp
+	rshift2 temp,temp
+	isub temp,pdata
+	fetcht 4,mem_context + coffset_sniff_anchor
+	iadd temp,pdata
+	fetcht 1,mem_lpm_overhead
+	isub temp,pdata
+	lshift16 pdata,alarm
+	bpatch patch15_1,mem_patch15
+	fetch 2,mem_context + coffset_rx_window
+	rshift pdata,pdata
+	call clk2bt
+	deposit alarm
+	call clk_diff
+	copy clke,temp
+	call clk_diff_rt
+	rtn user
+lpm_dispatch_sleep:
+	call clk2lpo
+lpm_dispatch_lpo:
+	bpatch patch15_2,mem_patch15
+	fetch 1,mem_lpm_xtalcnt
+	isub temp,null
+	branch lpm_clear_counter,positive
+	storet 4,mem_sleep_counter
+	call app_will_enter_lpm
+	call l2cap_lpm_save_txbuf
+	fetcht 4,mem_sleep_counter
+	branch lpm_sleep
+	
+lpm_dispatch_unconn:
+	bpatch patch15_3,mem_patch15
+	fetch 1,mem_context
+	rtnbit1 state_inconn					// wont sleep in connection
+	rtnbit1 state_inpage					// wont sleep when paging
+	fetch 1,mem_ssp_enable
+	branch lpm_unconn_nossp,blank
+	fetch 1,mem_sp_local_key_invalid	// simple pairing is not ready
+	rtn blank
+lpm_unconn_nossp:
+	bpatch patch15_4,mem_patch15
+	fetch 1,mem_le_adv_enable
+	nbranch lpm_unconn_cont,blank
+	fetch 1,mem_scan_mode
+	rtn blank
+lpm_unconn_cont:
+	fetch 2,mem_lpm_interval
+	rtn blank
+lpm_sleep_btclk:
+	fetcht 1,mem_lpm_overhead
+	isub temp,pdata
+	arg 7500,temp				/* 1.25ms */
+	imul32 temp,pdata
+	branch lpm_dispatch_sleep
+
+lpm_set_mult:
+	bpatch patch15_5,mem_patch15
+	disable wake
+	fetch 1,mem_state
+	rtnbit0 state_insniff
+	nbranch lpm_not_match,match
+	call lpm_match
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_rx_window
+	fetch 1,mem_arq
+	bbit1 wack,lpm_mult_short
+	bmark0 mark_lpm_mult_enable,lpm_mult_short
+	call l2cap_malloc_is_fifo_empty
+	nbranch lpm_mult_short,blank
+	fetch 1,mem_classic_bt_flag
+	bbit1 SHORT_MULT_FLAG,lpm_mult_short
+lpm_mult_wait_timeout:
+	jam 0,mem_lpm_current_mult
+	bmark0 mark_lpm_mult_enable,lpm_mult_short
+	fetch 1,mem_lpm_mult_cnt
+	branch lpm_mult_long,blank
+	increase -1,pdata
+	store 1,mem_lpm_mult_cnt
+	rtn
+
+
+classic_bt_set_mult_short_flag:
+	arg SHORT_MULT_FLAG,queue
+	branch classic_bluetooth_set_flag
+	
+classic_bt_clr_mult_short_flag:
+	arg SHORT_MULT_FLAG,queue
+	branch classic_bluetooth_clr_flag
+
+
+
+lpm_match:
+	jam 0,mem_sniff_unint_lost
+	fetch 3,mem_sniff_rcv
+	increase 1,pdata
+	store 3,mem_sniff_rcv
+	rtn
+
+lpm_not_match:
+	bpatch patch15_6,mem_patch15
+	fetcht 2,mem_rx_window_sniff
+	rshift temp,temp
+	fetch 2,mem_rx_window
+	iadd temp,pdata
+	store 2,mem_rx_window
+lpm_lost:
+	jam 0,mem_lpm_current_mult
+	fetch 3,mem_sniff_lost
+	increase 1,pdata
+	store 3,mem_sniff_lost
+	fetch 1,mem_sniff_unint_lost
+	increase 1,pdata
+	store 1,mem_sniff_unint_lost
+	rtn
+
+lpm_mult_short:
+	jam 0,mem_lpm_current_mult
+	fetch 1,mem_lpm_mult_timeout
+	store 1,mem_lpm_mult_cnt
+	rtn
+
+lpm_mult_long:
+	fetcht 1,mem_lpm_mult
+	storet 1,mem_lpm_current_mult
+	rtn
+
+lpm_cal_xtal_startup:
+	bpatch patch15_7,mem_patch15
+	fetch 1,mem_lpm_xtalcnt
+	nrtn blank
+	hjam clksel_rc,core_clksel
+	setarg 0xf0c
+	call lpm_write_config
+	setarg 200000
+	call sleep
+	until null,lpo_edge
+	copy lpo_time,alarm
+	call xtal_fast_wake
+	hjam clksel_xtal,core_clksel
+	nop 10
+	until null,lpo_edge
+	deposit lpo_time
+	isub alarm,pdata
+	increase 0x30,pdata
+	arg 0xff,temp
+	call ceiling
+	store 1,mem_lpm_xtalcnt
+	nop 30000
+	nop 30000
+	nop 30000	
+	rtn
+
+
+
+	/* pdata is lpm_reg[11:0] */
+lpm_write_config:
+	arg 0xfff,contw
+	iand contw,contw
+	fetch 1,mem_lpm_config
+	and_into 0xf0,pdata
+	lshift8 pdata,pdata
+	ior contw,pdata
+	hstore 2,core_lpm_reg
+	ifetch 2,contr
+	istore 2,contw
+
+lpm_write_ctrl:
+	setarg lpmreg_sel_ctrl
+	branch lpm_write
+
+lpm_write_ctrl2:
+	setarg lpmreg_sel_ctrl2
+lpm_write:
+	hstore 1,core_lpm_wr
+	until null,lpo_edge
+	until null,lpo_edge
+	until null,lpo_edge
+	rtn
+
+
+lpm_write_gpio_wakeup:
+	bpatch patch16_0,mem_patch16
+	fetch 4,mem_gpio_wakeup
+	store 4,core_lpm_reg
+	setarg lpmreg_sel_gpiolow
+	call lpm_write
+	ifetch 2,contr
+	store 4,core_lpm_reg
+	setarg lpmreg_sel_gpiohigh
+	branch lpm_write
+
+lpm_get_wake_lock:
+	fetch 2,mem_lpm_wake_lock
+	qset1 pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+lpm_put_wake_lock:
+	fetch 2,mem_lpm_wake_lock
+	qset0 pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+
+
+lpm_check_wake_lock:
+	bpatch patch16_1,mem_patch16
+	call app_check_wake_lock
+	fetch 2,mem_lpm_wake_lock
+	copy pdata,rega
+	fetch 1,mem_state_map
+	isolate1 smap_rxlmp,pdata
+	setflag true,wake_lock_lmp_rx,rega
+	fetch 1,mem_lmo_opcode1
+	fetcht 1,mem_lmo_opcode2
+	iadd temp,pdata
+	fetcht 1,mem_lmp_to_send
+	iadd temp,pdata
+	nsetflag blank,wake_lock_lmp_tx,rega
+	fetch 1,mem_le_tx_buff_used
+	nsetflag blank,wake_lock_ble_tx,rega
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_l2cap_rxbuff2_len
+	iadd temp,pdata
+	nsetflag blank,wake_lock_l2cap_rx,rega
+	fetch UTIL_FIFO_LEN,mem_ipc_fifo_bt2c51
+	nsetflag blank,wake_lock_ipc_bt2c51,rega
+	fetch UTIL_FIFO_LEN,mem_ipc_fifo_c512bt
+	nsetflag blank,wake_lock_ipc_c512bt,rega
+	fetch 2,IPC_BT2M0_READ_PTR
+	fetcht 2,IPC_BT2M0_WRITE_PTR
+	isub temp,null
+	nsetflag zero,wake_lock_ipc_bt2m0,rega
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	nsetflag zero,wake_lock_ipc_m02bt,rega
+	fetch 1,core_config
+	isolate1 7,pdata
+	setflag true,wake_lock_m0_single,rega
+	fetch 1,mem_hci_cmd
+	nsetflag blank,wake_lock_cmd,rega
+	copy rega,pdata
+	store 2,mem_lpm_wake_lock
+	rtn
+
+lpm_shut_down:
+	hfetch 4,core_lpm_ctrl
+	set0 27,pdata
+	hstore 4,core_lpm_reg
+	call lpm_write_ctrl
+	branch assert
+	
+lpm_disable_exen_output:
+	hfetch 4,core_lpm_xtalcnt
+	set0 20,pdata
+	hstore 4,core_lpm_reg
+	branch lpm_write_ctrl2
+
+check_bt_disabled:
+	fetch 2,mem_chip_functions
+	bbit1 bt_disabled,assert
+	rtn
+check_ble_disabled:
+	fetch 2,mem_chip_functions
+	bbit1 ble_disabled,assert
+	rtn
+check_module_disabled:
+	fetch 2,mem_chip_functions
+	bbit1 module_disable,assert
+	rtn
+
+test_init:
+	setarg test_proc
+	store 2,mem_cb_bt_process
+	setarg test_sleep
+	store 2,mem_cb_bb_event_process
+	setarg test_proc
+	store 2,mem_cb_idle_process
+	rtn wake
+	rtn
+
+test_proc:
+	fetch 1,mem_state
+	bbit0 state_insniff,check_test_cond
+	set1 mark_lpm_mult_enable,mark
+	fetch 6,mem_sniff_rcv
+	store 6,mem_local_name
+	rtn
+
+check_test_cond:
+	fetch 1,mem_tester_emulate
+	rtnbit0 tester_change
+	fetch 1,mem_tester_cnt
+	increase 1,pdata
+	store 1,mem_tester_cnt
+	rtnne 5
+	jam 0,mem_tester_cnt
+	fetch 1,mem_tester_emulate
+	set0 tester_change,pdata
+	store 1,mem_tester_emulate
+	bbit1 tester_exit,check_test_exit
+	isolate1 tester_no_whitening,pdata
+	call test_no_white,true
+	ncall test_enable_white,true
+	fetch 1,test_mode_packet_type
+	compare 0x20,pdata,0x30
+	fetch 1,mem_state_map
+	setflag true,smap_edr,pdata
+	store 1,mem_state_map
+	fetch 1,mem_tester_emulate
+	fetcht 1,mem_debug_config
+	isolate1 tester_pattern_test,pdata
+	setflag true,debug_tx_pattern,temp
+	isolate1 tester_fixed_freq,pdata
+	setflag true,debug_tx_fixed_freq,temp
+	setflag true,debug_rx_fixed_freq,temp
+	storet 1,mem_debug_config
+	fetch 1,test_mode_tx_freq
+	store 1,mem_tx_fixed_freq
+	fetch 1,test_mode_rx_freq
+	store 1,mem_rx_fixed_freq
+	set1 mark_testmode,mark
+	rtn
+
+	
+check_test_exit:
+	set0 mark_testmode,mark
+	jam 0,mem_tester_emulate
+	fetch 1,mem_test_mode_old_debug_config
+	store 1,mem_debug_config
+	hfetch 1,core_config
+	and_into 0xfb,pdata			/* whitening on */
+	hstore 1,core_config	
+	rtn
+	
+
+test_sleep:
+	deposit regc
+	rtnne BT_EVT_BUTTON_LONG_PRESSED
+test_sleep_loop:
+//	call ui_button_polling
+//	fetch 1,mem_ui_button_last_state
+	rtn
+	beq 1,test_sleep_loop
+	branch lpm_hibernate
+
+
+test_tx:
+	force 2,temp
+	increase -2,temp
+	call set_sync_on
+	call set_freq_tx
+	disable enable_white
+	enable encode_fec0
+	set1 TXGFSK,radio_ctrl
+	call start_transmitter
+test_tx_loop:
+	fetch 1,0
+	inject mod,8
+	branch test_tx_loop
+wait_sec_powerup:
+	fetch 1,core_misc_status
+	bbit0 SEC_PWRUP, wait_sec_powerup
+	rtn
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_h4.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_h4.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_h4.prog	(working copy)
@@ -0,0 +1,4 @@
+
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_main.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_main.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hci_main.prog	(working copy)
@@ -0,0 +1,53 @@
+/*********************************/
+/**********   HCI  *****************/
+/*********************************/
+
+cmd_exit:
+	jam 0,mem_hci_cmd
+	rtn
+cmd_check_plap:
+	fetch 6,mem_hci_plap
+	fetcht 6,mem_plap
+	isub temp,null
+	rtn
+
+	
+	
+//enable ssp master sm
+cmd_pair:
+	fetch 1,mem_op
+	bbit1 op_inrand_req,cmd_pair_passive
+	call tid_initiate
+	jam LMP_IN_RAND,mem_lmo_opcode2
+	branch cmd_exit
+cmd_pair_passive:
+	set0 op_inrand_req,pdata
+	store 1,mem_op
+	call lmp_accept_inrand
+	setarg 0
+	setflag master,smap_lmptid,pdata		
+	store 1,mem_lmo_tid2
+	branch cmd_exit
+	rtn
+cmd_in_sniff:
+	jam LMP_SNIFF_REQ,mem_lmo_opcode2
+	arg mem_sniff_payload,contw
+	setarg 0
+	isolate1 27,clke_bt
+	setflag true,1,pdata		/* use init 2 if bit27 of clke is 1 */
+	istore 1,contw	
+	setarg 0	/* dsniff */
+	istore 2,contw
+	fetch 2,mem_sniff_param_interval	/* tsniff */
+	istore 2,contw
+	fetch 1,mem_sniff_param_attempt	/* attempt */
+	istore 2,contw
+	fetch 1,mem_sniff_param_timeout	/* timeout */
+	istore 2,contw
+	branch cmd_exit
+	
+cmd_exit_sniff:
+	jam LMP_UNSNIFF_REQ,mem_lmo_opcode2
+	branch cmd_exit
+	
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/hid.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hid.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/hid.prog	(working copy)
@@ -0,0 +1,84 @@
+/**
+* the following API is to send the HID data
+* 
+*/
+
+/**
+* the following API is to process the hid  rx data
+* 
+*/
+//handle the hid data
+
+hid_rx_process:
+	bpatch patch17_6,mem_patch17
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	ifetch 1,contr
+	and pdata,0x0f,temp
+	rshift4 pdata,pdata //hidtype
+	beq hid_type_set_idle,hid_rx_process_handshake
+	beq hid_type_set_protocol,hid_rx_process_handshake
+	beq hid_type_data,hid_rx_process_data
+	beq HID_TYPE_SET_REPORT,hid_rx_process_set_report
+	beq HID_TYPE_CONTROL,hid_rx_process_hid_control
+	rtn
+
+hid_rx_process_hid_control:
+	copy temp,pdata
+	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,hid_rx_process_virtual_cable_unplug
+	beq HID_CONTROL_P_SUSPEND,hid_rx_process_suspend
+	rtn
+	
+hid_rx_process_virtual_cable_unplug:
+	jam BT_EVT_VIRTUAL_CABLE_UNPLUG,mem_fifo_temp
+	call ui_ipc_send_event
+	fetch 1,mem_device_option
+	rtnbit0 dvc_op_mouse
+	copy temp,pdata
+//	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,mouse_irtual_cable_unplug
+	rtn
+hid_rx_process_suspend:
+	rtn
+
+hid_rx_process_set_report:
+	call hid_rx_process_data
+	arg 0x01,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	setarg 0x00
+	istore 1,contw
+	rtn
+
+hid_rx_process_handshake:
+	arg 1,regA//payload length
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	jam 1,mem_ui_data_txbuff_length
+	fetch 1,mem_hid_control_state
+	set1 l2cap_channel_hid_handshake_done
+	store 1,mem_hid_control_state
+	jam BT_EVT_HID_HANDSHAKE,mem_fifo_temp
+	branch ui_ipc_send_event
+
+hid_rx_process_data:
+	ifetch 1,contr
+	beq HID_REPORT_ID_KB,hid_rx_process_data_hid_kb
+	rtn
+
+hid_rx_process_data_hid_kb:
+	rtn
+
+	
+hid_malloc_tx_buff:
+	call l2cap_malloc
+	copy rega,temp
+	storet 1,mem_ui_data_txbuff_length
+	copy pdata,contw
+	copy rega,pdata
+	istore 2,contw //hid payload length
+	rtn
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/l2cap.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/l2cap.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/l2cap.prog	(working copy)
@@ -0,0 +1,1929 @@
+/************************************/
+/*initialize L2CAP related variables*/
+/************************************/
+l2cap_init:
+	branch l2cap_init_wake,wake
+l2cap_init_work:
+	setarg mem_l2cap_xmem_end
+	arg mem_l2cap_xmem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+l2cap_init_wake:	
+	bpatch patch17_7,mem_patch17
+	setarg mem_sdp_mem_end
+	arg mem_sdp_mem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	setarg mem_l2cap_mem_end
+	arg mem_l2cap_mem_start,contw
+	isub contw,loopcnt
+	call clear_mem
+	branch l2cap_lpm_load_txbuf
+	
+process_rx_l2cap_pkt:
+	bpatch patch18_0,mem_patch18
+	copy contr,temp
+	//call l2cap_malloc_is_fifo_full
+	//nrtn blank
+	copy temp,contr
+	ifetch 2,contr
+	store 2,mem_l2cap_rx_pkt_length
+	ifetch 2,contr
+	store 2,mem_l2cap_rx_cid
+	deposit contr
+	store 2,mem_l2cap_payload_ptr
+	fetch 1,memui_reconnect_mode
+	beq NO_RECONNECTION,l2cap_rx_multiplexing
+	branch ml2cap_rx_multiplexing
+
+l2cap_rx_multiplexing:
+	fetch 2, mem_l2cap_rx_pkt_length
+	branch l2cap_rx_reset_state,blank
+	bpatch patch18_1,mem_patch18
+	fetch 1,mem_l2cap_rx_cid
+	beq L2CAP_signal_channel,l2cap_call_proc_signal
+l2cap_rx_multiplexing0:
+	beq L2CAP_SDP_channel,l2cap_call_proc_sdp
+	beq L2CAP_RFCOMM_channel,l2cap_call_proc_rfcomm
+	beq L2CAP_HID_Control_channel,l2cap_call_proc_hid
+	beq L2CAP_HID_Interrupt_channel,l2cap_call_proc_hid
+	branch l2cap_rx_reset_state
+
+l2cap_check_map:
+//	call l2cap_malloc_is_fifo_full
+//	nrtn blank
+	bpatch patch18_2,mem_patch18
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	beq 0,set_pdata_0
+	beq 1,set_pdata_0
+	beq 2,set_pdata_0
+	beq 3,set_pdata_0
+	beq 0x81,set_pdata_0
+	beq 0xc0,set_pdata_0
+	beq 0x80,set_pdata_0
+	beq 0x40,set_pdata_0
+	rtn
+
+set_pdata_0:
+	setarg 0
+	rtn
+
+
+l2cap_call_proc_signal:
+	call l2cap_check_map
+	nrtn blank
+l2cap_call_proc_signal0:
+	call l2cap_malloc_signal_channel
+	call l2cap_process_signal_pkt
+	fetcht 2,mem_l2cap_signal_tx_length
+	branch l2cap_call_proc_no_reply,blank
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	branch l2cap_rx_reset_state
+	
+l2cap_call_proc_sigal_pending:
+	fetch 1,mem_l2cap_pending_item
+	rtn blank
+	copy pdata,rega
+	bpatch patch18_3,mem_patch18
+	fetch 4,mem_l2cap_sdpres_delay_time
+	arg 0x100,temp
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	jam 0,mem_l2cap_pending_item
+	copy rega,pdata
+	beq L2CAP_SDP_channel,l2cap_sdp_conn_succ
+	branch assert
+l2cap_sdp_conn_succ:
+	arg 0,debug
+	call l2cap_malloc_signal_channel
+	call restore_l2cap_req_param
+	call l2cap_get_signal_tx_payload
+	call save_cont_pointers
+	call send_connection_sdp_res
+	call l2cap_get_signal_tx_buff
+	//fetch 2,mem_l2cap_signal_tx_length
+	setarg 0x000c
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	branch l2cap_rx_reset_state
+
+
+
+l2cap_reset_sdp_map:
+	bpatch patch18_4,mem_patch18
+	fetch 2,mem_sdp_tx_pkt_length
+	increase 4,pdata
+	rshift4 pdata,pdata
+	rshift3 pdata,pdata
+	add pdata,1,temp ///temp: how many128
+	arg mem_tx_fifo3,contr
+	ifetch 3,contr
+	rtn blank
+	store 3,mem_tx_fifo_map_temp
+	fetch 1,mem_tx_fifo_map_temp
+	copy pdata,rega
+	call check_l2cap_map
+	copy regb,pdata
+	store 1,mem_tx_fifo3
+	rtn
+
+check_l2cap_map:
+	arg 0,queue
+	arg 0,regb
+
+check_l2cap_map_loop:
+	sub queue,7,null
+	nrtn positive
+	qisolate1 rega
+	branch check_l2cap_map_used,true
+	branch check_l2cap_map_used2
+
+check_l2cap_map_used:
+	copy temp,pdata
+	branch check_l2cap_map_used2,blank
+	qset1 regb
+	increase -1,temp
+
+check_l2cap_map_used2:
+	increase 1,queue
+	branch check_l2cap_map_loop
+
+l2cap_call_proc_sdp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank// not process this packet until fifo empty
+	call l2cap_check_map
+	nrtn blank
+	call l2cap_malloc_sdp_channel
+	call sdp_process
+	call l2cap_reset_sdp_map
+	branch l2cap_call_proc_sdp_common
+
+	
+ml2cap_call_proc_sdp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank// not process this packet until fifo empty
+	call l2cap_malloc_sdp_channel
+	call sdp_process
+l2cap_call_proc_sdp_common:
+	call l2cap_get_sdp_tx_buff
+	fetch 2,mem_sdp_tx_pkt_length
+	branch l2cap_call_proc_no_reply,blank
+	istore 2,contw
+	fetch 2,mem_sdp_remote_cid
+	istore 2,contw
+	branch l2cap_rx_reset_state
+
+l2cap_call_proc_hid:
+	call hid_rx_process
+	branch l2cap_rx_reset_state
+
+l2cap_call_proc_rfcomm:
+	bpatch patch18_5,mem_patch18
+	jam RFCOMM_MALLOC_SUCCEED,mem_rfcomm_malloc_fail_flag
+	call rfcomm_rx_process
+	fetch 1,mem_rfcomm_malloc_fail_flag
+	rtneq RFCOMM_MALLOC_FAIL
+	branch l2cap_rx_reset_state
+l2cap_call_proc_no_reply:
+	call l2cap_malloc_discard
+	//fall through
+l2cap_rx_reset_state:
+	setarg 0
+	store 2,mem_l2cap_rx_pkt_length
+	store 2,mem_l2cap_rx_cid
+	jam L2CAP_RX_DONE,mem_l2cap_rx_done
+	rtn
+/* To process one L2CAP signalling pkt consisting of 1 or more signalling commands.	*/
+l2cap_process_signal_pkt:
+	bpatch patch18_6,mem_patch18
+	call l2cap_get_signal_tx_payload
+	force 0,regB
+	fetch 2,mem_l2cap_rx_pkt_length
+	copy pdata,regC
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+l2cap_process_signal_pkt_loop:
+	call l2cap_process_one_signal
+	deposit regC
+	increase -4,regC
+	increase -4,pdata
+	nbranch l2cap_process_signal_pkt_loop,blank
+	copy regB,pdata
+	store 2,mem_l2cap_signal_tx_length
+	rtn
+
+l2cap_process_one_signal:
+	bpatch patch18_7,mem_patch18
+	ifetch 1,contr
+	beq signal_cmd_reject,l2cap_proc_signal_cmd_reject
+	beq signal_connect_req,l2cap_proc_signal_connect_req
+	beq signal_connect_rsp,l2cap_proc_signal_connect_rsp
+	beq signal_config_req,l2cap_proc_signal_config_req
+	beq signal_config_rsp,l2cap_proc_signal_config_rsp
+	beq signal_disconnect_req,l2cap_proc_signal_disconnect_req
+	beq signal_disconnect_rsp,l2cap_proc_signal_disconnect_rsp
+	beq signal_echo_req,l2cap_proc_signal_echo_req
+	beq signal_echo_rsp,l2cap_proc_signal_echo_rsp
+	beq signal_info_req,l2cap_proc_signal_info_req
+	beq signal_info_rsp,l2cap_proc_signal_info_rsp
+	call l2cap_reject_command
+l2cap_process_one_signal_rtn:
+	rtn
+
+l2cap_proc_signal_info_req:
+	ifetch 1,contr //IDs
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,rega
+	copy regc,pdata
+	isub rega,regc
+	setarg signal_info_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1, contw
+	ifetch 2,contr 
+l2cap_proc_signal_info_req_reply:
+	beq L2CAP_SIG_EXT_FEATRUE,l2cap_proc_signal_info_req_ext
+	beq L2CAP_SIG_FIX_FEATRUE,l2cap_proc_signal_info_req_fix
+	rtn
+l2cap_proc_signal_info_req_ext:
+	setarg 0x020008
+	istore 6, contw
+	setarg 0x0280
+	istore 4, contw
+	force 12,pdata
+	branch l2cap_proc_signal_info_req_common
+l2cap_proc_signal_info_req_fix:
+	setarg 0x3000c
+	istore 6, contw
+	setarg 0x0006
+	istore 8, contw
+	force 16,pdata
+l2cap_proc_signal_info_req_common:
+	iadd regb,regb
+	branch l2cap_process_one_signal_rtn
+	
+ml2cap_proc_signal_info_req:
+	ifetch 1,contr //IDs
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,rega
+	ifetch 2,contr
+	store 2,mem_temp
+	copy regc,pdata
+	isub rega,regc 
+	call l2cap_get_signal_tx_payload
+	setarg signal_info_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw 
+	fetch 2,mem_temp
+	branch l2cap_proc_signal_info_req_reply
+
+
+/*  Respond to the command reject signal sent from the remote BD.   */
+l2cap_proc_signal_cmd_reject:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	iadd contr,contr
+	copy regC,pdata
+	isub regA,regC
+l2cap_proc_signal_cmd_reject_rtn:
+	branch l2cap_process_one_signal_rtn
+/* Respond to an L2CAP connection request from remote BD. (generate a connection_rsp)	*/
+l2cap_proc_signal_connect_req:
+	call save_cont_pointers
+	//fetch 6,mem_inquiry_bd_addr
+  	//store 6,mem_master_paged_bd_addr
+  	call load_cont_pointers
+	arg 0,debug
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	ifetch 2,contr
+	copy pdata,temp //PSM
+	ifetch 2,contr
+	copy pdata,timeup
+	bpatch patch19_0,mem_patch19
+	copy temp,pdata
+	beq PSM_SDP,l2cap_proc_signal_connect_req_sdp
+	beq PSM_RFCOMM,l2cap_proc_signal_connect_req_rfcomm
+	beq PSM_HID_control,l2cap_proc_signal_connect_req_hid_ctrl
+	beq PSM_HID_interrupt,l2cap_proc_signal_connect_req_hid_int
+	call l2cap_reject_command
+	branch l2cap_proc_signal_connect_req_rtn
+
+l2cap_proc_signal_connect_req_sdp:
+	call save_cont_pointers
+	arg L2CAP_SDP_channel,temp
+	fetch 2,mem_sdp_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	copy clkn_bt,pdata
+	store 4,mem_l2cap_sdpres_delay_time
+	call store_l2cap_req_param
+	branch  send_connection_pending
+
+store_l2cap_req_param:
+	storet 2,mem_psm
+	deposit timeup
+	store 2,mem_scid
+	deposit rega
+	store 2,mem_cmd_length
+	deposit regb
+	store 2,mem_tt2
+	deposit regc
+	store 2,mem_tt3
+	deposit queue
+	store 2,mem_id
+	rtn
+
+restore_l2cap_req_param:
+	fetcht 2,mem_psm
+	fetch 2,mem_scid
+	copy pdata,timeup
+	fetch 2,mem_cmd_length
+	copy pdata,rega
+	fetch 2,mem_tt2
+	copy pdata,regb
+	fetch 2,mem_tt3
+	copy pdata,regc
+	fetch 2,mem_id
+	copy pdata,queue
+	rtn
+
+l2cap_proc_signal_connect_req_rfcomm:
+	call save_cont_pointers
+	setarg L2CAP_RFCOMM_channel
+	arg L2CAP_RFCOMM_channel,temp
+	fetch 2,mem_RFCOMM_remote_CID
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_RFCOMM_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_rfcomm_state
+	branch send_connection_res
+l2cap_proc_signal_connect_req_hid_ctrl:
+	call save_cont_pointers
+	arg L2CAP_HID_Control_channel,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	branch send_connection_res
+l2cap_proc_signal_connect_req_hid_int:
+	call save_cont_pointers
+	deposit clke
+	arg L2CAP_HID_Interrupt_channel,temp
+	fetch 2,mem_hid_int_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	branch send_connection_res
+
+send_connection_pending:
+	setarg L2CAP_connect_pending
+	store 2,memL2CAP_T1
+	jam L2CAP_SDP_channel,mem_l2cap_pending_item
+	branch send_connection_res0
+send_connection_sdp_res:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_sdp_state
+send_connection_res:
+	setarg L2CAP_connect_successful
+	store 2,memL2CAP_T1
+send_connection_res0:
+	bpatch patch19_1,mem_patch19
+	call load_cont_pointers
+	setarg signal_connect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	fetch 2,memL2CAP_T1
+	beq L2CAP_connect_pending,connect_pending
+	isolate0 0,debug
+	branch connect_suc,true
+	setarg L2CAP_connect_refused_no_resources
+connect_suc:
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	setarg 12
+	branch connect_req_update_byte_counts
+connect_pending:
+	istore 2,contw
+	force 0x0002,pdata
+	istore 2,contw
+	setarg 12
+	branch connect_req_update_byte_counts
+	
+already_connected:
+	set1 0,debug
+	branch send_connection_res
+connect_req_update_byte_counts:
+	iadd regB,regB
+	copy regC,pdata
+	isub regA,regC
+	branch l2cap_proc_signal_connect_req_rtn
+l2cap_proc_signal_connect_req_rtn:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_connect_rsp:
+	ifetch 1,contr //identifier
+	copy pdata,queue
+	ifetch 2,contr //length
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr //remote cid
+	copy pdata,timeup
+	ifetch 2,contr //local cid
+	copy pdata,temp
+	bpatch patch19_2,mem_patch19
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_connect_rsp_hid_int,zero
+	rtn
+
+l2cap_proc_signal_connect_rsp_sdp:
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_sdp_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_connect_rsp_rfcomm:
+	copy timeup,pdata
+	store 2,mem_rfcomm_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_rfcomm_state
+	rtn
+l2cap_proc_signal_connect_rsp_hid_int:
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+l2cap_proc_signal_connect_rsp_hid_ctrl:
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	rtn
+
+l2cap_proc_signal_config_req:
+	ifetch 1,contr//identifier
+	copy pdata,queue
+	ifetch 2,contr//length
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr//dest cid
+	copy pdata,temp
+	copy temp,regA
+	bpatch patch19_3,mem_patch19
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_config_req_hid_int,zero
+	branch l2cap_reject_command
+	//branch L2CAP_proc_signal_config_req_rtn
+l2cap_proc_signal_config_req_sdp:
+	copy contw, timeup
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+	copy timeup,contw
+	arg L2CAP_SDP_channel,timeup
+	fetch 2,mem_sdp_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_hid_ctrl:
+	copy contw, timeup
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_control_state
+	copy timeup,contw
+	arg L2CAP_HID_Control_channel,timeup
+	fetch 2,mem_hid_ctrl_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_hid_int:
+	copy contw, timeup
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	copy timeup,contw
+	arg L2CAP_HID_Interrupt_channel,timeup
+	fetch 2,mem_hid_int_remote_cid
+	copy pdata,temp
+	branch l2cap_send_config_rsp
+l2cap_proc_signal_config_req_rfcomm:
+	copy contw, timeup
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	//set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_rfcomm_state
+//	jam UPPERSM_RP_SDP_CONN,mem_upper_sm_remote_page
+	copy timeup,contw
+	arg L2CAP_RFCOMM_channel,timeup
+	fetch 2,mem_RFCOMM_remote_CID
+	copy pdata,temp
+l2cap_send_config_rsp:
+	bpatch patch19_4,mem_patch19
+	setarg  signal_config_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0006
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	force 0x00,pdata
+	istore 2,contw
+	force L2CAP_config_success,pdata
+	istore 2,contw
+	force 10,pdata
+	iadd regB,regB
+	//copy temp,pdata
+	storet 2,mem_config_req_dest_CID
+	copy queue,pdata
+	store 1,mem_config_identifier
+	force L2CAP_SDP_channel,pdata
+	icompare 0xff,timeup
+	branch l2cap_send_config_rsp_is_sdp,true
+	increase 1,pdata
+l2cap_send_config_rsp_is_sdp:
+	//store 1,mem_send_config_req
+	rtn
+l2cap_check_channel_state:
+	disable user
+	rtnbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	copy contr,contw
+	increase -1,contw
+	istore 1,contw
+	enable user
+	rtn
+l2cap_send_config_req:
+l2cap_send_config_req_sdp:
+	fetch 1,mem_sdp_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_rfcomm,user
+	jam L2CAP_SDP_channel,mem_send_config_req
+	fetch 2,mem_sdp_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_rfcomm:
+	fetch 1,mem_rfcomm_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_hid_ctrl,user
+	jam L2CAP_RFCOMM_channel,mem_send_config_req
+	fetch 2,mem_RFCOMM_remote_CID
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	call l2cap_check_channel_state
+	nbranch l2cap_send_config_req_hid_int,user
+	jam L2CAP_HID_Control_channel,mem_send_config_req
+	fetch 2,mem_hid_ctrl_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch l2cap_generate_config_req
+l2cap_send_config_req_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	call l2cap_check_channel_state
+	nrtn user//End of sending config req
+	jam L2CAP_HID_Interrupt_channel,mem_send_config_req
+	fetch 2,mem_hid_int_remote_cid
+	store 2,mem_config_req_dest_CID
+	//branch L2CAP_generate_config_req
+
+l2cap_generate_config_req:
+	bpatch patch19_5,mem_patch19
+	call l2cap_get_req_id
+	call l2cap_malloc_signal_channel
+	force 0,regB
+	call l2cap_get_signal_tx_payload
+	force signal_config_req,pdata
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	fetch 2,mem_config_req_dest_CID
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	force 1,pdata
+	istore 1,contw
+	force 2,pdata
+	istore 1,contw
+	fetch 1,mem_send_config_req
+	beq L2CAP_RFCOMM_channel,l2cap_generate_config_req_rfcomm
+	setarg L2CAP_config_MTU_SDP
+	istore 2,contw
+	branch l2cap_generate_config_req_done
+l2cap_generate_config_req_rfcomm:
+	setarg L2CAP_config_MTU_RFCOMM
+	istore 2,contw
+l2cap_generate_config_req_done:
+	arg 0x0c,temp
+	storet 2,mem_l2cap_signal_tx_length
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	jam 0,mem_send_config_req
+l2cap_proc_signal_config_req_rtn:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_config_rsp:
+	increase 1,contr
+	ifetch 2,contr
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr //source cid
+	copy pdata,regA
+	bpatch patch19_6,mem_patch19
+	setarg L2CAP_SDP_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub rega,null
+	branch l2cap_proc_signal_config_rsp_hid_int,zero
+	increase 2,contr
+	ifetch 2,contr
+	iforce null
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_sdp_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_rfcomm_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_control_state
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_config_rsp_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES,pdata
+	store 1,mem_hid_interrupt_state
+	jam BT_EVT_HID_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+
+
+l2cap_proc_signal_disconnect_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr
+	copy pdata,regA
+	ifetch 2,contr
+	copy pdata,timeup
+	copy regA,temp
+	call save_cont_pointers
+	bpatch patch19_7,mem_patch19
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_req_hid_int,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_proc_signal_disconnect_req_hid_ctrl:
+	copy timeup,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_hid_control_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_proc_signal_disconnect_req_hid_int:
+	copy timeup,temp
+	fetch 2,mem_hid_int_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_hid_interrupt_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+
+l2cap_proc_signal_disconnect_req_sdp:
+	copy timeup,temp
+	fetch 2,mem_sdp_remote_cid
+	isub temp,null
+	branch l2cap_disconnect_sdp_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_disconnect_hid_control_now:
+	call l2cap_reset_hid_ctrl_state
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_disconnect_hid_interrupt_now:
+	call l2cap_reset_hid_int_state
+	fetch 2, mem_hid_ctrl_remote_cid
+	branch l2cap_send_disconnect_rsp_pkt, blank
+	//set the flag,hid channel close
+	//should we set here?
+	//call HID_mem_lock
+	//fetch 1, mem_hid_cb1
+	//set1 HID_CB_APP_HID_DISCONNECTED,pdata
+	//store 1, mem_hid_cb1
+	//call HID_mem_unlock
+	branch l2cap_send_disconnect_rsp_pkt
+
+l2cap_disconnect_sdp_now:
+	call l2cap_reset_sdp_channel_state
+	fetch 1,mem_upper_sm_ss
+	nbranch l2cap_send_disconnect_rsp_pkt,blank
+	//jam LMP_ENCRYPTION_MODE_REQ,mem_lmo_opcode2
+	//jam UPPERSM_RP_SDP_CONN,mem_upper_sm_remote_page
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_proc_signal_disconnect_req_rfcomm:
+	copy timeup,temp
+	fetch 2, mem_RFCOMM_remote_CID
+	isub temp,null
+	branch l2cap_disconnect_rfcomm_now,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_req_err_rtn
+l2cap_disconnect_rfcomm_now:
+	call l2cap_reset_rfcomm_channel_state
+	branch l2cap_send_disconnect_rsp_pkt
+l2cap_send_disconnect_rsp_pkt:
+	call load_cont_pointers
+	setarg signal_disconnect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy regA,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	force 8,pdata
+	branch l2cap_proc_signal_disconnect_req_rtn
+l2cap_proc_signal_disconnect_req_err_rtn:
+	call load_cont_pointers
+	branch l2cap_proc_signal_disconnect_req_rtn
+l2cap_proc_signal_disconnect_req_rtn:
+	iadd regB,regB
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_disconnect_rsp:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr
+	copy pdata,timeup
+	ifetch 2,contr
+	copy pdata,temp
+	call save_cont_pointers
+	bpatch patch1a_0,mem_patch1a
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch l2cap_proc_signal_disconnect_rsp_hid_int,zero
+	call l2cap_reject_command
+	branch l2cap_proc_signal_disconnect_rsp_err_rtn
+l2cap_proc_signal_disconnect_rsp_sdp:
+	copy temp,regA
+	copy timeup,temp
+	fetch 2,mem_sdp_remote_cid
+	isub temp,null
+	call l2cap_reset_sdp_channel_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_rfcomm:
+	copy temp,regA
+	copy timeup,temp
+	fetch 2,mem_rfcomm_remote_CID
+	isub temp,null
+	call l2cap_reset_rfcomm_channel_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_hid_ctrl:
+	copy temp,regA
+	copy timeup,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	isub temp,null
+	call  l2cap_reset_hid_ctrl_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_hid_int:
+	copy temp,regA
+	copy timeup,temp
+	fetch 2,mem_hid_int_remote_cid
+	isub temp,null
+	call l2cap_reset_hid_int_state,zero
+	branch l2cap_proc_signal_disconnect_rsp_rtn
+l2cap_proc_signal_disconnect_rsp_rtn:
+	call load_cont_pointers
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_disconnect_rsp_err_rtn:
+	branch l2cap_process_one_signal_rtn
+
+/* received an echo request from remote BD.  Will echo the 1st 1 byte back,		*/
+l2cap_proc_signal_echo_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	iadd contr,contr
+	setarg 9
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 4,pdata
+	iadd regB,regB
+	copy regC,pdata
+	isub regA,regC
+	branch l2cap_process_one_signal_rtn
+l2cap_proc_signal_echo_rsp:
+	branch l2cap_process_one_signal_rtn
+
+l2cap_proc_signal_info_rsp:
+	branch l2cap_process_one_signal_rtn
+l2cap_reject_command:
+	force 0,regB
+	call l2cap_get_signal_tx_payload
+	setarg signal_cmd_reject
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 2
+	istore 2,contw
+	setarg cmd_not_understood
+	istore 2,contw
+	increase 6,regB
+	arg 4,regC
+	branch l2cap_process_one_signal_rtn
+
+
+
+l2cap_reset_rfcomm_channel_state:
+	setarg 0
+	store 2,mem_RFCOMM_Tx_pkt_length
+	store 2,mem_RFCOMM_remote_CID
+	jam 0,mem_rfcomm_state
+	rtn
+l2cap_reset_sdp_channel_state:
+	setarg 0
+	store 2,mem_sdp_tx_pkt_length
+	store 2,mem_sdp_remote_cid
+	jam 0,mem_sdp_state
+	rtn
+l2cap_reset_hid_ctrl_state:
+	setarg 0
+	store 2,mem_hid_ctrl_remote_cid
+	jam 0,mem_hid_control_state
+	fetch 1,mem_hid_interrupt_state
+	beq 0,l2cap_reset_hid_disconnected
+	rtn
+
+l2cap_reset_hid_int_state:
+	setarg 0
+	store 2,mem_hid_int_remote_cid
+	jam 0,mem_hid_interrupt_state
+	fetch 1,mem_hid_control_state
+	beq 0,l2cap_reset_hid_disconnected
+	rtn
+	
+l2cap_reset_hid_disconnected:
+	jam BT_EVT_HID_DISCONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event	
+
+l2cap_disconnect_interrupt_req:
+	fetch 1,mem_CONTROL_tasks
+	set0  L2CAP_DISCONNECT_INTERRUPT, pdata
+	store 1,mem_CONTROL_tasks
+	fetch 2, mem_hid_int_remote_cid
+	rtn blank
+	call l2cap_malloc_signal_channel
+	fetch 2, mem_hid_int_remote_cid
+	copy pdata,regA
+	force L2CAP_HID_Interrupt_channel,regB
+	branch l2cap_generate_disconnect_req
+l2cap_disconnect_control_req:
+	fetch 1,mem_CONTROL_tasks
+	set0  L2CAP_DISCONNECT_CONTROL, pdata
+	store 1,mem_CONTROL_tasks
+	fetch 2, mem_hid_ctrl_remote_cid
+	rtn blank
+	call l2cap_malloc_signal_channel
+	fetch 2, mem_hid_ctrl_remote_cid
+	copy pdata,regA
+	force L2CAP_HID_Control_channel,regB
+l2cap_generate_disconnect_req:
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	force signal_disconnect_req,pdata
+	istore 1,contw
+	fetch  1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy regA,pdata
+	istore 2,contw
+	copy regB,pdata
+	istore 2,contw
+	force 0x08,temp //signal tx length in temp
+	branch ml2cap_send_signal
+
+ml2cap_send_signal_connect_req:
+	bpatch patch1a_1,mem_patch1a
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_connect_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy temp,pdata	 //PSM
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	arg 8,temp
+	branch ml2cap_send_signal
+ml2cap_send_signal_config_req:
+	bpatch patch1a_2,mem_patch1a
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_config_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	istore 1,contw
+	setarg 0x0008
+	istore 2,contw
+	/****modigy for nokia*****/
+	copy temp,pdata
+	/*setarg 0x0040*/
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	setarg 0x01
+	istore 1,contw
+	setarg 0x02
+	istore 1,contw
+	setarg L2CAP_config_MTU_RFCOMM
+	istore 2,contw
+	arg 0xc,temp
+	branch ml2cap_send_signal
+ml2cap_send_signal_disconn_req:
+	bpatch patch1a_3,mem_patch1a
+	call l2cap_get_req_id
+	call l2cap_get_signal_tx_payload
+	setarg signal_disconnect_req
+	istore 1,contw
+	fetch 1,mem_ML2CAP_comm_id
+	increase 1,pdata
+	copy contw,regA
+	store 1,mem_ML2CAP_comm_id
+	copy regA,contw
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy temp,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	arg 0x8,temp
+	//branch ml2cap_send_signal
+	//Fall through
+ml2cap_send_signal:
+	storet 2,mem_l2cap_signal_tx_length
+	copy temp,pdata
+	branch l2cap_malloc_discard,blank
+	call l2cap_get_signal_tx_buff
+	fetch 2,mem_l2cap_signal_tx_length
+	istore 2,contw //make sure that length is still in temp!
+	force L2CAP_signal_channel,pdata
+	istore 2,contw
+	rtn
+
+msdp_send_req_done:
+	fetch 2,mem_sdp_tx_pkt_length
+	branch assert,blank
+	call l2cap_get_sdp_tx_buff
+	fetch 2,mem_sdp_tx_pkt_length
+	istore 2,contw
+	fetch 2,mem_sdp_remote_cid
+	istore 2,contw
+	rtn
+ml2cap_rx_multiplexing:
+	fetch 2, mem_l2cap_rx_pkt_length
+	branch l2cap_rx_reset_state,blank
+	bpatch patch1a_4,mem_patch1a
+	fetch 1,mem_l2cap_rx_cid
+	beq L2CAP_signal_channel,ml2cap_call_proc_signal
+	beq L2CAP_SDP_channel,ml2cap_call_proc_sdp
+	beq L2CAP_RFCOMM_channel,l2cap_call_proc_rfcomm
+	beq L2CAP_HID_Control_channel,l2cap_call_proc_hid
+	beq L2CAP_HID_Interrupt_channel,l2cap_call_proc_hid
+	branch l2cap_rx_reset_state
+
+ml2cap_call_proc_signal:
+	bpatch patch1a_5,mem_patch1a
+	call l2cap_malloc_signal_channel
+	force 0,regB
+	call l2cap_get_signal_tx_payload
+	copy pdata,contw
+	fetch 2,mem_l2cap_rx_pkt_length
+	copy pdata,regC
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+ml2cap_proc_one_comm_loop:
+	call ml2cap_proc_one_comm
+	increase -4,regC
+	nbranch ml2cap_proc_one_comm_loop,zero
+	copy regB,temp
+	call ml2cap_send_signal
+	branch l2cap_rx_reset_state
+	
+ml2cap_proc_one_comm:
+	ifetch 1,contr
+	beq signal_connect_req,ml2cap_proc_signal_connect_req
+	beq signal_cmd_reject,ml2cap_proc_signal_cmd_reject
+	beq signal_connect_rsp,ml2cap_proc_signal_connect_rsp
+	beq signal_config_rsp,ml2cap_proc_signal_config_rsp
+	beq signal_config_req,ml2cap_proc_signal_config_req
+	beq signal_disconnect_rsp,ml2cap_proc_signal_disconn_rsp
+	beq signal_disconnect_req,ml2cap_proc_signal_disconn_req
+	beq signal_echo_req,l2cap_proc_signal_echo_req
+	beq signal_info_req,ml2cap_proc_signal_info_req
+	branch ml2cap_proc_send_reject
+
+ml2cap_proc_signal_connect_req:
+	call save_cont_pointers
+	//jam NO_RECONNECTION,memui_reconnect_mode
+	call load_cont_pointers
+	branch l2cap_proc_signal_connect_req
+ml2cap_proc_signal_cmd_reject:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+mvptr:
+	ifetch 1,contr
+	increase -1,regA
+	nbranch mvptr,zero
+	rtn
+ml2cap_proc_signal_connect_rsp:
+	ifetch 1,contr //id
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA	//length
+	ifetch 2,contr
+	copy pdata,timeup	//destination	cid
+	ifetch 2,contr
+	copy pdata,temp	//source	cid
+	ifetch 2,contr 		// result
+	sub pdata,0,null
+	branch ml2cap_proc_signal_connect_rsp_sucessful,zero
+	beq L2CAP_connect_refused_PSM_unsupported,ml2cap_proc_signal_connect_refused_result
+	beq L2CAP_connect_refused_no_resources,ml2cap_proc_signal_connect_refused_result
+	branch ml2cap_proc_signal_connect_rsp_mnosucc
+ml2cap_proc_signal_connect_refused_result:
+	jam BT_EVT_ML2CAP_CONN_REFUSED,mem_fifo_temp
+	call ui_ipc_send_event
+ml2cap_proc_signal_connect_rsp_mnosucc:
+	ifetch 2,contr //reason
+	branch mnosucc
+ml2cap_proc_signal_connect_rsp_sucessful:
+	call save_cont_pointers
+	//fetch 1,mem_ML2CAP_comm_id
+	//icompare 0xff,queue
+	//nbranch mnosucc1,true
+	bpatch patch1a_6,mem_patch1a
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_rfcomm,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_hid_int,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_connect_rsp_hid_ctrl,zero
+	branch mnosucc
+ml2cap_proc_signal_connect_rsp_sdp:
+	copy timeup,pdata
+	store 2,mem_sdp_remote_cid
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES
+	store 1,mem_sdp_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_rfcomm:
+	copy timeup,pdata
+	store 2,mem_RFCOMM_remote_CID
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES
+	store 1,mem_rfcomm_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_hid_ctrl:
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES
+	store 1,mem_hid_control_state
+	branch mnosucc1
+ml2cap_proc_signal_connect_rsp_hid_int:
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_RES
+	store 1,mem_hid_interrupt_state
+	//branch mnosucc1
+
+mnosucc1:
+	call load_cont_pointers
+mnosucc:
+	copy regC,pdata
+	isub regA,regC
+	rtn
+
+ml2cap_proc_signal_config_rsp:
+	ifetch 1,contr		//	Ident
+	copy pdata,queue
+	ifetch 2,contr		//	SigLen
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr		//	DestnCID
+	copy pdata,timeup
+	ifetch 2,contr
+	ifetch 2,contr		//	Get the result value, check success
+	nbranch mcrsdone1,blank
+	call save_cont_pointers
+	//fetch 1,mem_ML2CAP_comm_id
+	//icompare 0xff,queue
+	//nbranch mcfrsdone,true
+	copy timeup,temp
+	bpatch patch1a_7,mem_patch1a
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_rsp_hid_int,zero
+ml2cap_proc_signal_config_rsp_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+	store 1,mem_sdp_state
+	rtn
+ml2cap_proc_signal_config_rsp_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+	store 1,mem_rfcomm_state
+	rtn
+ml2cap_proc_signal_config_rsp_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+	store 1,mem_hid_control_state
+	rtn
+ml2cap_proc_signal_config_rsp_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_RES
+	store 1,mem_hid_interrupt_state
+	jam BT_EVT_HID_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+mcfrsdone:
+	call load_cont_pointers
+mcrsdone1:
+	increase -6,regA
+mloop2:
+	branch mcrsdone,zero
+	increase 1,contr
+	increase -1,regA
+	branch mloop2
+mcrsdone:
+	rtn
+ml2cap_proc_signal_config_req:
+	ifetch 1,contr		//	Ident
+	copy pdata,queue
+	ifetch 2,contr		//	SigLen
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+	ifetch 2,contr		//	DestnCID
+	increase 2,contr
+	copy pdata,temp
+	setarg  signal_config_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	increase 2,regA
+	copy regA,pdata
+	istore 2,contw
+	call save_cont_pointers
+	bpatch patch1b_0,mem_patch1b
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_rfcomm,zero
+	setarg L2CAP_HID_Control_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	isub temp,null
+	branch ml2cap_proc_signal_config_req_hid_int,zero
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_sdp:
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_sdp_state
+	bbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,ml2cap_proc_signal_config_req_sdp_nsndreq
+	fetcht 1,mem_CONTROL_tasks
+	set1 L2CAP_init_Config_Req,temp
+	storet 1,mem_CONTROL_tasks
+	copy queue,pdata
+	increase 1,pdata
+	store 1,mem_config_identifier
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+ml2cap_proc_signal_config_req_sdp_nsndreq:
+	fetch 2,mem_sdp_remote_cid
+	store 2,mem_config_req_dest_CID
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_rfcomm:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_rfcomm_state
+	fetch 2,mem_RFCOMM_remote_CID
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_hid_ctrl:
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_hid_control_state
+	fetch 2,mem_hid_ctrl_remote_cid
+	branch mcfgrq_done
+ml2cap_proc_signal_config_req_hid_int:
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_RCV_CFG_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_RES,pdata
+	store 1,mem_hid_interrupt_state
+	fetch 2,mem_hid_int_remote_cid
+	//branch mcfgrq_done
+
+mcfgrq_done:
+	copy pdata,timeup
+	call load_cont_pointers
+/*******for Nokia**************/
+	copy timeup,pdata
+	/*setarg 0x0040*/
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 0x0000,pdata
+	istore 2,contw
+	force 10,pdata
+	iadd regB,regB
+	increase -6,regA
+mloop1:
+	branch mcrqdone,zero
+	ifetch 1,contr
+	istore 1,contw
+	increase 1,regB
+	increase -1,regA
+	branch mloop1
+mcrqdone:
+	rtn
+ml2cap_proc_signal_disconn_req:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	copy regC,pdata
+	isub regA,regC
+
+	ifetch 2,contr
+	copy pdata,regA
+	ifetch 2,contr
+	copy pdata,timeup
+	call save_cont_pointers
+	bpatch patch1b_1,mem_patch1b
+	setarg L2CAP_SDP_channel
+	copy regA,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_sdp,zero
+	setarg L2CAP_HID_Control_channel
+	copy regA,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_hid_ctrl,zero
+	setarg L2CAP_HID_Interrupt_channel
+	copy regA,temp
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_hid_int,zero
+	branch mclsrfc
+ml2cap_proc_signal_disconn_sdp:
+	setarg 0x0000
+	store 2,mem_sdp_tx_pkt_length
+	store 2,mem_sdp_remote_cid
+	store 1,mem_sdp_state
+	branch mclssdp
+ml2cap_proc_signal_disconn_hid_ctrl:
+	call l2cap_reset_hid_ctrl_state
+	branch mclssdp
+ml2cap_proc_signal_disconn_hid_int:
+	call l2cap_reset_hid_int_state
+	//call HID_mem_lock
+	//fetch 1, mem_hid_cb1
+	//set1 HID_CB_APP_HID_DISCONNECTED,pdata
+	//store 1, mem_hid_cb1
+	//call HID_mem_unlock
+	branch mclssdp
+mclsrfc:
+	setarg 0x0000
+	store 2,mem_RFCOMM_Tx_pkt_length
+mclssdp:
+	call load_cont_pointers
+	setarg signal_disconnect_rsp
+	istore 1,contw
+	copy queue,pdata
+	istore 1,contw
+	setarg 0x0004
+	istore 2,contw
+	copy regA,pdata
+	istore 2,contw
+	copy timeup,pdata
+	istore 2,contw
+	force 8,pdata
+	iadd regB,regB
+	rtn
+
+ml2cap_proc_signal_disconn_rsp:
+	ifetch 1,contr
+	copy pdata,queue
+	ifetch 2,contr
+	copy pdata,regA
+	ifetch 2,contr
+	copy pdata,timeup
+	ifetch 2,contr
+	copy pdata,temp
+	call save_cont_pointers
+	bpatch patch1b_2,mem_patch1b
+	fetch 1,mem_ML2CAP_comm_id
+	icompare 0xff,queue
+	nbranch mdisdone,true
+	setarg L2CAP_SDP_channel
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_rsp_sdp,zero
+	setarg L2CAP_RFCOMM_channel
+	isub temp,null
+	branch ml2cap_proc_signal_disconn_rsp_rfcomm,zero
+	branch mdisdone
+ml2cap_proc_signal_disconn_rsp_sdp:
+	jam 0,mem_sdp_remote_cid
+	jam 0,mem_sdp_state
+	branch mdisdone
+ml2cap_proc_signal_disconn_rsp_rfcomm:
+	//
+	//
+mdisdone:
+	call load_cont_pointers
+	copy regC,pdata
+	isub regA,regC
+	rtn
+
+ml2cap_proc_send_reject:
+	setarg signal_cmd_reject
+	istore 1,contw
+	ifetch 1,contr
+	istore 1,contw
+	setarg 0x0002
+	istore 2,contw
+	setarg 0x0000
+	istore 2,contw
+	setarg 0x0006
+	iadd regB,regB
+	force 4,regC
+	rtn
+	
+//l2cap command id, 0 is not allowed
+l2cap_get_req_id:
+	fetch 1,mem_ML2CAP_comm_id
+	increase 1,pdata
+	bne 0,l2cap_get_req_id_ok
+	increase 1,pdata
+l2cap_get_req_id_ok:
+	store 1,mem_ML2CAP_comm_id
+	rtn
+
+
+/*********************************************************/
+//char* malloc(short len)
+//input: regA -> len
+//rtn: regB -> pbuff;return from pdata
+//val: queue -> i
+//val: timeup -> buff_cnt
+/*********************************************************/
+l2cap_malloc:
+	bpatch patch1b_3,mem_patch1b
+	arg 0,regb
+	call l2cap_malloc_is_fifo_full
+	nbranch assert,blank//assert when fifo full
+	call l2cap_malloc_get_full_map
+ifdef DEBUG_MALLOC
+	call l2cap_malloc_log_get_ptr
+	copy regA,pdata
+	istore 2,contw
+	sub pdata,1024,null
+	branch assert,positive
+	branch assert,blank
+endif
+	arg mem_tx_buff0,regB//pbuff = buff0;
+	arg 0,queue // i = 0;
+l2cap_malloc_loop:
+	fetcht 1,mem_used_map
+	qisolate1 temp
+	branch l2cap_malloc_next,true//if(1 == (used_map & (1 << i)))goto next;
+	call l2cap_malloc_enough
+	sub timeup,0,null// (0 - timeup)
+	branch l2cap_malloc_next,positive//if(buff_cnt <= 0)goto next;
+	call l2cap_malloc_into_fifo
+	branch l2cap_malloc_rtn//return (pbuff);
+l2cap_malloc_next:
+	increase 128,regB//pbuff += BUFF_SIZE;//point to next buff
+	increase 1,queue
+	setarg 8//BUFF_MAX_COUNT
+	isub queue,null //BUFF_MAX_COUNT - i
+	branch l2cap_malloc_loop,positive//while(i < buff_max_count)
+	arg 0,regB//return NULL
+l2cap_malloc_rtn:
+ifdef DEBUG_MALLOC
+	call l2cap_malloc_log_get_ptr
+	copy regB,pdata
+	istore 2,contw
+endif
+	copy regB,pdata
+	branch assert,blank
+	rtn//return pointer via pdata
+	
+/*********************************************************/
+//void* l2cap_malloc_fifo_out(void)
+//output:len -> temp
+//output:ptr ->pdata
+//only get ptr,not free
+/*********************************************************/
+l2cap_malloc_fifo_out:
+	bpatch patch1b_4,mem_patch1b
+	call l2cap_malloc_fifo_get_first_ptr
+	increase 1,contr
+	ifetch 2,contr //ptr ->pdata
+	rtn 
+
+/*********************************************************/
+//void free_first_buff_in_fifo(void)
+//only free the first one
+/*********************************************************/
+l2cap_malloc_free:
+	bpatch patch1b_5,mem_patch1b
+	call l2cap_malloc_fifo_get_first_ptr
+	copy contr,contw
+	copy contr,temp
+	setarg 0
+	istore 3,contw
+ifdef DEBUG_MALLOC
+	call l2cap_malloc_log_get_ptr
+	setarg 0xaa
+	istore 1,contw
+	istoret 1,contw
+endif
+	rtn
+/*********************************************************/
+//void l2cap_malloc_discard(void)
+//discard the latest malloc
+/*********************************************************/
+l2cap_malloc_discard:
+	bpatch patch1b_6,mem_patch1b
+	call l2cap_malloc_is_fifo_empty
+	branch assert,blank
+	fetch 3,mem_tx_fifo2
+	store 3,mem_tx_fifo3
+	fetch 3,mem_tx_fifo1
+	store 3,mem_tx_fifo2
+	fetch 3,mem_tx_fifo0
+	store 3,mem_tx_fifo1
+	rtn
+/*********************************************************/
+//bool fifo_is_full(void)
+//blank == 1: not full
+//blank == 0: full
+/*********************************************************/
+l2cap_malloc_is_fifo_full:
+	bpatch patch1b_7,mem_patch1b
+	fetch 3,mem_tx_fifo0
+	rtn
+/*********************************************************/
+//bool fifo_nearly_full(void)
+//blank == 1: nearly full
+//blank == 0: not nearly full
+/*********************************************************/
+l2cap_malloc_is_fifo_nearly_full:
+	bpatch patch1c_0,mem_patch1c
+	fetch 3,mem_tx_fifo1
+	rtn
+/*********************************************************/
+//bool fifo_is_empty(void)
+//blank == 1: empty
+//blank == 0: not empty
+/*********************************************************/
+l2cap_malloc_is_fifo_empty:
+	bpatch patch1c_1,mem_patch1c
+	fetch 3,mem_tx_fifo3
+	rtn
+/*********************************************************/
+//char* l2cap_malloc_fifo_get_first_ptr(void)
+//output:contr  -->ptr
+/*********************************************************/	
+l2cap_malloc_fifo_get_first_ptr:
+	call l2cap_malloc_is_fifo_empty
+	branch assert,blank // fifo is empty
+	arg mem_tx_fifo0,contr
+ifdef DEBUG_MALLOC
+	arg 5,loopcnt
+l2cap_malloc_free_loop:
+	increase -1,loopcnt
+	copy loopcnt,pdata
+	branch assert,blank
+else
+l2cap_malloc_free_loop:
+endif
+	ifetch 3,contr
+	branch l2cap_malloc_free_loop,blank
+	increase -3,contr
+	rtn
+
+/*********************************************************/
+//char* l2cap_malloc_get_full_map(void)
+//output:mem_used_map  -->full_map
+//add all maps into one
+/*********************************************************/	
+l2cap_malloc_get_full_map:
+	bpatch patch1c_2,mem_patch1c
+	arg 4,loopcnt
+	arg mem_tx_fifo0_map,contr
+	arg 0,temp
+l2cap_malloc_get_full_map_loop:	
+	ifetch 3,contr
+	and pdata,0xff,pdata
+	ior temp,temp
+	loop l2cap_malloc_get_full_map_loop
+	storet 1,mem_used_map
+	rtn
+/*********************************************************/
+//void buff_into_fifo(char buff_index, char buff_cnt, short len)
+//input: regA -> len
+//input: regC -> buff_index
+//input: timeup -> buff_cnt
+//val:temp ->   (fifo->map)
+/*********************************************************/
+l2cap_malloc_into_fifo:
+	bpatch patch1c_3,mem_patch1c
+	call l2cap_malloc_is_fifo_full
+	nbranch assert,blank //fifo full
+	call l2cap_malloc_is_fifo_empty
+	branch l2cap_malloc_into_fifo_no_push,blank//fifo empty, no need to push
+	fetch 3,mem_tx_fifo1
+	store 3,mem_tx_fifo0
+	ifetch 3,contr//mem_tx_fifo2
+	istore 3,contw//mem_tx_fifo1
+	ifetch 3,contr//mem_tx_fifo3
+	istore 3,contw//mem_tx_fifo2
+	setarg 0
+	istore 3,contw//mem_tx_fifo3
+l2cap_malloc_into_fifo_no_push:
+	arg 0,temp
+	copy timeup,pdata
+	iadd queue,pdata
+l2cap_malloc_into_fifo_loop:
+	qset1 temp//fifo->map |= 1 << i;
+	increase 1,queue
+	isub queue,null
+	nbranch l2cap_malloc_into_fifo_loop,zero
+	//map in temp
+	lshift8 regB,pdata
+	ior temp,pdata
+	store 3,mem_tx_fifo3
+	rtn
+
+/*********************************************************/
+//char is_size_enough(char buff_index, short len)
+//input: regA -> len
+//input: queue -> buff_index
+//rtn: timeup -> buff_cnt
+//val: max_size_fom_buff_index -> temp
+//val: i -> loopcnt
+/*********************************************************/
+l2cap_malloc_enough:
+	bpatch patch1c_4,mem_patch1c
+	call l2cap_malloc_get_full_map
+	copy queue,regC//restore buff_index to regC
+	arg 0,temp
+	arg 0,timeup//default return val
+	//increase 1,queue
+l2cap_malloc_enough_loop:
+	copy queue,pdata
+	beq 8,l2cap_malloc_enough_end
+	fetch 1,mem_used_map
+	qisolate1 pdata
+	branch l2cap_malloc_enough_end,true
+	increase 128,temp
+	increase 1,queue
+	copy regA,pdata
+	isub temp,null
+	branch l2cap_malloc_enough_end,zero//(max_size_fom_buff_index ==  len)
+	branch l2cap_malloc_enough_loop,positive//(max_size_fom_buff_index <  len)
+l2cap_malloc_enough_end:
+	copy temp,pdata
+	isub regA,null
+	nbranch l2cap_malloc_enough_rtn,positive// max_size_fom_buff_index - len > 0
+	copy queue,pdata//i
+	copy regC,temp//buff_index
+	isub temp,timeup//return (i - buff_index)
+l2cap_malloc_enough_rtn:
+	copy regC,queue//restore buff_index to queue
+	rtn
+	
+ifdef DEBUG_MALLOC
+l2cap_malloc_log_get_ptr:
+	fetch 2,mem_tx_malloc_log
+	increase 2,pdata
+	store 2,mem_tx_malloc_log
+	sub pdata,62,null
+	nbranch l2cap_malloc_log_clean,positive
+	increase -2,pdata
+	iadd contw,contw
+	rtn
+l2cap_malloc_log_clean:
+	jam 0x00,mem_tx_malloc_log
+	branch l2cap_malloc_log_get_ptr	
+endif
+
+l2cap_malloc_signal_channel:
+	bpatch patch1c_5,mem_patch1c
+	arg L2CAP_SIGNAL_MALLOC_SIZE,regA
+	call l2cap_malloc
+	store 2,mem_l2cap_signal_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_l2cap_signal_tx_payload_ptr
+	setarg 0
+	store 2,mem_l2cap_signal_tx_length
+	rtn
+
+l2cap_get_signal_tx_buff:
+	fetch 2,mem_l2cap_signal_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+
+l2cap_get_signal_tx_payload:
+	fetch 2,mem_l2cap_signal_tx_payload_ptr
+	branch l2cap_util_pdata_to_contw
+
+
+l2cap_malloc_sdp_channel:
+	bpatch patch1c_6,mem_patch1c
+	arg SDP_MALLOC_SIZE,regA
+	call l2cap_malloc
+	store 2,mem_sdp_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_sdp_tx_payload_ptr
+	setarg 0
+	store 2,mem_sdp_tx_pkt_length
+	rtn
+
+l2cap_get_sdp_tx_buff:
+	fetch 2,mem_sdp_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+
+l2cap_get_sdp_tx_payload:
+	fetch 2,mem_sdp_tx_payload_ptr
+	branch l2cap_util_pdata_to_contw
+
+
+l2cap_malloc_rfcomm_channel:
+	bpatch patch1c_7,mem_patch1c
+	call push_stack
+	jam RFCOMM_MALLOC_FAIL,mem_rfcomm_malloc_fail_flag
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	arg RFCOMM_MALLOC_SIZE,regA
+	call l2cap_malloc
+	store 2,mem_rfcomm_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_rfcomm_tx_payload_ptr
+	setarg 0
+	store 2,mem_rfcomm_tx_pkt_length
+	jam RFCOMM_MALLOC_SUCCEED,mem_rfcomm_malloc_fail_flag
+	branch pop_stack
+
+l2cap_get_rfcomm_tx_buff:
+	fetch 2,mem_rfcomm_tx_buff_ptr
+	branch l2cap_util_pdata_to_contw
+	
+l2cap_util_pdata_to_contw:
+	branch assert,blank
+	copy pdata,contw
+	rtn
+	
+
+l2cap_lpm_save_calc_len:
+	bpatch patch1d_0,mem_patch1d
+	arg 0,regb
+	arg mem_tx_fifo0_map,rega
+	increase -2,rega
+l2cap_lpm_save_calc_len_loop:
+	increase 2,rega
+	setarg mem_tx_fifo_end
+	isub rega,null
+	branch l2cap_lpm_save_calc_len_end,zero //end of 2lcap tx fifo
+	ifetch 1,rega
+	increase 1,rega
+	branch l2cap_lpm_save_calc_len_loop,blank
+	ifetcht 2,rega
+	ifetch 2,temp
+	iadd regb,regb
+	increase 4,regb //l2cap header len
+	branch l2cap_lpm_save_calc_len_loop
+l2cap_lpm_save_calc_len_end:
+	copy regb,pdata
+	rtn
+
+
+l2cap_lpm_get_wake_lock:
+	arg wake_lock_l2cap_tx,queue
+	branch lpm_get_wake_lock
+
+l2cap_lpm_put_wake_lock:
+	arg wake_lock_l2cap_tx,queue
+	branch lpm_put_wake_lock
+	
+l2cap_lpm_save_txbuf:
+	bpatch patch1d_1,mem_patch1d
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	rtn blank
+	call l2cap_lpm_save_calc_len
+	arg l2cap_lpm_txbuf_len,temp
+	isub temp,null
+	branch l2cap_lpm_get_wake_lock,positive //no enougth space to save l2cap tx data
+	call l2cap_lpm_put_wake_lock
+	arg mem_l2cap_lpm_txbuf,contw
+	arg mem_tx_fifo0,rega
+l2cap_lpm_save_txbuf_loop:
+	setarg mem_tx_fifo_end
+	isub rega,null
+	rtn zero //end of 2lcap tx fifo
+	ifetch 1,rega  //mem_tx_fifoX_map
+	increase 1,rega
+	nbranch l2cap_lpm_save_txbuf_nempty,blank
+	istore 2,contw // length = 0
+	increase 2,rega
+	branch l2cap_lpm_save_txbuf_loop
+l2cap_lpm_save_txbuf_nempty:
+	ifetch 2,rega //ptr
+	increase 2,rega
+	copy pdata,contr
+	ifetch 2,contr  //l2cap len
+	istore 2,contw
+	copy pdata,loopcnt
+	increase 2,loopcnt //add CID len
+	call memcpy
+	branch l2cap_lpm_save_txbuf_loop
+	
+l2cap_lpm_load_txbuf:
+	bpatch patch1d_2,mem_patch1d
+	call l2cap_malloc_get_full_map
+	fetch 1,mem_used_map
+	rtn blank
+	arg mem_tx_fifo0_ptr,rega
+	increase -3,rega //mem_tx_fifo0_ptr -3
+	arg mem_l2cap_lpm_txbuf,contr
+l2cap_lpm_load_txbuf_loop:
+	increase 3,rega //mem_tx_fifoX_ptr
+	setarg mem_tx_fifo_end+1
+	isub rega,null
+	rtn zero //end of 2lcap tx fifo
+	ifetch 2,contr
+	branch l2cap_lpm_load_txbuf_loop,blank
+	increase 4,pdata //l2cap header len
+	copy pdata,loopcnt
+	copy contr,regb
+	ifetch 2,rega //ptr
+	copy pdata,contw
+	copy regb,contr
+	increase -2,contr
+	call memcpy
+	branch l2cap_lpm_load_txbuf_loop
+	
+
+
+	
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/le.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le.prog	(working copy)
@@ -0,0 +1,1849 @@
+ifdef COMPILE_LE
+//******************************************//
+//*************LE INIT ****************//
+//******************************************//
+
+
+le_init_conn:
+	bpatch patch1d_3,mem_patch1d
+	disable wake
+	jam 1,mem_le_conn_handle
+	jam 3,mem_le_state
+	jam 1,mem_le_arq
+	setarg -1
+	store 2,mem_le_event_count
+	force 0,pdata
+	store 1,mem_le_ch
+	store 1,mem_le_op
+	store 3,mem_sniff_rcv
+	store 3,mem_sniff_lost
+	store 5,mem_le_pcnt_tx
+	set1 39,pdata
+	store 5,mem_le_pcnt_rx
+	jam 1,mem_le_txheader
+	jam 0,mem_le_txlen
+	branch le_supervision_flush
+
+le_init_master:
+	bpatch patch1d_4,mem_patch1d
+	enable master
+	jam lemode_master,mem_le_mode
+	jam 1,mem_le_att_handle
+	jam 1,mem_le_search_handle_start
+	setarg 0xffff
+	store 2,mem_le_search_handle_end
+	force 0,pdata
+	store 5,mem_le_pcnt_rx
+	set1 39,pdata
+	store 5,mem_le_pcnt_tx	
+	branch le_init_conn
+
+
+le_init_slave:
+	bpatch patch1d_5,mem_patch1d
+	disable master
+ 	setarg 0x17
+ 	store 2,mem_le_remote_mtu
+	jam lemode_slave,mem_le_mode
+	jam 0,mem_le_adv_enable
+	jam 0,mem_lpm_current_mult
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	fetch 2,mem_le_superto
+	store 2,mem_le_init_superto
+	fetch 2,mem_le_tsniff
+	mul32 pdata,5,pdata
+	rshift4 pdata,pdata
+	store 2,mem_le_superto			// vol.6 part B 4.5.2 only 6*conninterval before establish
+	branch le_init_conn
+	
+
+//******************************************//
+//*************LE main process*********//
+//******************************************//
+le_dispatch:
+	call le_enable
+	call le_scan
+	call le_adv
+	branch le_disable
+
+le_conn_dispatch:
+	bpatch patch1d_6,mem_patch1d
+	call le_enable
+	call app_process_ble
+	fetch 1,mem_le_mode
+	beq lemode_master,le_master_dispatch
+	branch le_slave_dispatch
+	
+//******************************************//
+//***********LE master process*********//
+//******************************************//
+	
+le_master_dispatch:
+	bpatch patch1d_7,mem_patch1d
+	enable master
+	call le_supervision_update
+	branch le_master_disconn,positive
+	call check_ble_disabled
+	call le_setup
+	call le_prepare_tx
+	disable match
+	call le_transmit_receive_sifs
+	nrtn match
+	bpatch patch1e_0,mem_patch1e
+	fetch 1,mem_le_conn_rcv
+	increase 1,pdata
+	store 1,mem_le_conn_rcv
+	call le_acknowledge
+	disable master
+	rtn
+	
+le_master_disconn:
+	call le_disconnect
+	disable master
+	rtn
+	
+//******************************************//
+//***********LE slave process***********//
+//******************************************//
+le_slave_dispatch:
+	bpatch patch1e_1,mem_patch1e
+	jam 0,mem_le_md_count
+ifdef SECURE_CONNECTION
+	call sp_calc_sequence_256
+	call le_secure_connect_sm
+endif
+	disable attempt
+	call le_supervision_update
+	branch le_slave_disconn,positive
+	call check_ble_disabled
+	call le_setup
+	call le_receive_slave
+	nbranch le_slave_unsync,sync	// vol.6 part B 4.5.1 respond even crc error
+	call le_got_first_packet
+	branch le_slave_match,match
+	branch le_slave_cont
+	
+
+le_slave_match:
+	bpatch patch1e_2,mem_patch1e
+	fetch 1,mem_le_md_count
+	pincrease 1
+	store 1,mem_le_md_count
+	beq LE_MD_MAX_COUNT,le_slave_cont
+	call le_acknowledge
+	call le_prepare_tx
+	call le_transmit_norx
+	call le_parse
+	fetch 2,mem_cb_ble_transmit
+	call callback_func
+	call le_check_md
+	branch le_slave_more_data,user
+le_slave_cont:
+	bpatch patch1e_3,mem_patch1e
+	call le_pairing_sm
+ 	call le_check_paring_time
+	call check_51cmd
+	fetch 1,mem_le_op
+	bbit1 op_disconn,le_slave_disconn
+le_slave_unsync:
+	bpatch patch1e_4,mem_patch1e
+	call le_lpm_set_mult
+	call le_update_channel_map
+	call le_update_param
+	branch calc_clke_offset
+
+
+le_check_md:
+	disable user
+	bmark1 mark_ble_rx_md,enable_user
+	bmark1 mark_ble_tx_md,enable_user
+	rtn
+
+
+le_slave_more_data:
+	bpatch patch1e_5,mem_patch1e
+	enable attempt
+	call le_transmit_receive_sifs_notx
+	branch le_slave_match,match
+	branch le_slave_cont
+
+le_slave_disconn:
+
+	//fall through
+le_disconnect:
+	bpatch patch1e_6,mem_patch1e
+	call le_clear_connection_info
+	call app_disconn_reason_collect_ble
+ifdef SECURE_CONNECTION
+	call sp_initialize_256
+endif
+	jam BT_EVT_LE_DISCONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_clear_connection_info:
+	setarg 0
+	store 9,mem_le_tx_buff_used
+	jam 0,mem_le_conn_handle
+	jam lemode_idle,mem_le_mode
+	jam 0,mem_le_state
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
+	rtn
+	
+le_got_first_packet:
+	bpatch patch1e_7,mem_patch1e
+	fetch 1,mem_le_conn_rcv
+	increase 1,pdata
+	store 1,mem_le_conn_rcv
+	fetch 1,mem_le_state
+	rtnbit1 lestate_got_first_packet
+	set1 lestate_got_first_packet
+	store 1,mem_le_state
+	fetch 2,mem_le_init_superto
+	store 2,mem_le_superto
+	setarg 0
+	store 4,mem_le_transmit_window
+	rtn
+
+
+le_enable:
+	bpatch patch1f_0,mem_patch1f
+	hjam 0x36,0x90f        /*For BLE, tune AGC_gain_offset, Max added*/
+	hjam 0x5f,0x90b        //for BLE
+	enable le
+	hjam 7,rfen_ulp			/* enable ulp */
+	call check_ble_disabled
+	fetch 1,mem_250k_freq_enable	//default: 0
+	rtn blank
+	hjam 0xb8,0x90a
+	rtn
+	
+le_disable:
+	bpatch patch1f_1,mem_patch1f
+	hjam 0x2e,0x90f        /*For BR/EDR, tune AGC_gain_offset, Max added*/
+	hjam 0xff,0x90b         //for EDR&BR
+	disable le
+	hjam 3,rfen_ulp
+	arg 0,stop_watch
+	rtn
+	
+le_prep:
+	disable enable_crc
+	disable enable_white
+	fetch 3,mem_le_crcinit
+	iforce crc24_init
+	fetch 1,mem_le_ch_mapped
+	reverse pdata,temp
+	set1 1,temp
+	rshift temp,white_init
+	rtn
+	
+
+lerx_setfreq:
+	call le_setfreq
+	call set_freq_rx
+	setarg param_pll_setup
+	call sleep
+	branch rf_rx_enable
+
+letx_setfreq:
+	branch txon,match
+letx_setfreq0:
+	call le_setfreq
+	branch set_freq_tx
+le_setfreq:
+	bpatch patch1f_2,mem_patch1f
+	call set_sync_on
+	fetch 1, mem_le_testtype
+	nbranch le_ctf_test,blank
+	fetch 1,mem_le_ch_mapped
+	sub pdata,36,null
+	branch le_ctf_normal,positive
+	force 0,temp
+	rtneq 37
+	force 24,temp
+	rtneq 38
+	force 78,temp
+	rtn
+	
+le_ctf_normal:
+	sub pdata,10,null
+	branch le_ctf_low,positive
+	increase 1,pdata
+	
+le_ctf_low:	
+	lshift pdata,pdata
+	add pdata,2,temp
+	rtn
+	
+le_ctf_test:
+	fetch 1,mem_le_ch_mapped
+	lshift pdata,temp
+	rtn
+
+le_sca_map:
+	arg 500,temp
+	rtn blank
+	arg 250,temp
+	rtneq 1
+	arg 150,temp
+	rtneq 2
+	arg 100,temp
+	rtneq 3
+	arg 75,temp
+	rtneq 4
+	arg 50,temp
+	rtneq 5
+	arg 40,temp
+	rtneq 6
+	arg 20,temp
+	rtn
+
+
+	
+le_adv_access:
+	setarg 0x8e89be
+	lshift8 pdata,pdata
+	or_into 0xd6,pdata
+	iforce access
+	setarg 0x555555
+	store 3,mem_le_crcinit
+	rtn
+
+le_setup:
+	bpatch patch1f_3,mem_patch1f
+	enable swfine
+	fetch 4,mem_le_access
+	iforce access
+	call le_map_channel
+	setarg 0x200
+	branch le_setup_master,master
+	fetch 2,mem_le_receive_window
+	rshift pdata,pdata
+le_setup_master:
+	arg param_pll_setup,temp
+	iadd temp,pdata
+	call ahead_window
+	deposit clke
+	store 6,mem_le_rxon_ts
+	rtn
+
+le_next_adv_channel:
+	bpatch patch1f_4,mem_patch1f
+	fetch 1,mem_le_ch_mapped
+	beq 37,le_next_adv_channel_curr_channel_37
+	beq 38,le_next_adv_channel_curr_channel_38
+	beq 39,le_next_adv_channel_curr_channel_39
+	branch le_next_adv_channel_curr_channel_39
+
+le_next_adv_channel_curr_channel_37:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_38,temp		//check 38 channel enable
+	branch set_le_next_adv_channel_38,true
+	isolate1 BIT_ADV_CHANNEL_MAP_39,temp		//check 39 channel enable
+	branch set_le_next_adv_channel_39,true
+	branch set_le_next_adv_channel_37
+
+
+le_next_adv_channel_curr_channel_38:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_39,temp		//check 39 channel enable
+	branch set_le_next_adv_channel_39,true
+	isolate1 BIT_ADV_CHANNEL_MAP_37,temp		//check 37 channel enable
+	branch set_le_next_adv_channel_37,true
+	branch set_le_next_adv_channel_38
+
+
+le_next_adv_channel_curr_channel_39:
+	fetcht 1,mem_le_adv_channel_map
+	isolate1 BIT_ADV_CHANNEL_MAP_37,temp		//check 37 channel enable
+	branch set_le_next_adv_channel_37,true
+	isolate1 BIT_ADV_CHANNEL_MAP_38,temp		//check 38 channel enable
+	branch set_le_next_adv_channel_38,true
+	branch set_le_next_adv_channel_39
+
+
+
+set_le_next_adv_channel_37:
+	jam 37,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_37,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+set_le_next_adv_channel_38:
+	jam 38,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_38,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+set_le_next_adv_channel_39:
+	jam 39,mem_le_ch_mapped
+	fetch 1,mem_le_adv_channel_map_temp
+	set1 BIT_ADV_CHANNEL_MAP_39,pdata
+	store 1,mem_le_adv_channel_map_temp
+	rtn
+
+
+
+le_context_nexthop:
+	bpatch patch1f_5,mem_patch1f
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	rtnbit0 mode_le
+	add rega,coffset_le_event_cnt,contw
+	ifetch 2,contw
+	increase 1,pdata
+	istore 2,contw
+	add rega,coffset_le_hop,contr
+	ifetch 1,contr
+	add rega,coffset_le_ch,contw
+	ifetcht 1,contw
+	iadd temp,pdata
+	sub pdata,36,null
+	branch le_nexthop_nowrap,positive
+	increase -37,pdata
+le_nexthop_nowrap:
+	istore 1,contw
+	rtn
+
+
+le_calc_channel_map:
+	bpatch patch1f_6,mem_patch1f
+	fetch 5,mem_le_channel_map
+	force 0,temp
+	force 37,loopcnt
+le_count_channels_loop:
+	bbit0 0,le_count_channels_notused
+	increase 1,temp
+le_count_channels_notused:
+	rshift pdata,pdata
+	loop le_count_channels_loop
+	add temp,-1,pdata
+	store 1,mem_le_channels
+	rtn
+
+le_map_channel:
+	bpatch patch1f_7,mem_patch1f
+	fetch 1,mem_le_ch
+	iforce queue
+	fetcht 5,mem_le_channel_map
+	qisolate1 temp
+	branch le_map_channel_end,true
+le_map_channel_next:
+	bpatchx patch20_0,mem_patch20
+	fetch 1,mem_le_channels
+	isub queue,pdata
+	branch le_map_channel_cont,positive
+	sub pdata,-1,queue
+	branch le_map_channel_next
+le_map_channel_cont:
+	copy queue,loopcnt
+	force 0,queue
+le_map_channel_loop:
+	qisolate1 temp
+	branch le_map_channel_skip,true
+	increase 1,loopcnt
+le_map_channel_skip:
+	deposit loopcnt
+	branch le_map_channel_end,blank
+	increase 1,queue
+	increase -1,loopcnt
+	branch le_map_channel_loop
+le_map_channel_end:
+	deposit queue
+	store 1,mem_le_ch_mapped
+	rtn
+
+
+le_wait_tx:
+	branch le_wait_master,master
+	until null,timeout
+	rtn
+	
+le_wait_master:
+	arg 0xea0,timeup
+	until clkn_rt,meet
+	rtn
+
+le_receive_adv:
+	disable swfine
+	fetch 2,mem_le_scan_window
+	copy pdata,timeup
+	branch le_receive_packet
+
+
+le_receive_slave:
+	bpatchx patch20_1,mem_patch20
+	enable swfine
+	fetch 2,mem_le_receive_window
+	fetcht 4,mem_le_transmit_window
+	iadd temp,timeup
+le_receive_packet:
+	call lerx_setfreq
+le_receive_rxon:
+	bpatchx patch20_2,mem_patch20
+	call le_prep
+	disable match
+	enable decode_fec0
+	enable is_rx
+	disable is_tx
+	copy timeup,stop_watch
+	correlate null,timeout
+	branch le_receive_on_attempt,attempt
+	copy clke,temp
+	storet 6,mem_sync_clke
+le_receive_on_attempt:
+	nbranch end_of_packet,sync
+	branch le_receive_skip,attempt
+	arg param_clke_cal_le,clke_rt
+	copy bt_clk,clke_bt
+	fetch 1,mem_le_state
+	bbit0 lestate_got_first_packet,le_receive_skip
+	call lpm_adjust_clk,wake
+le_receive_skip:
+	bpatchx patch20_3,mem_patch20
+	call save_rssi
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	and pdata,0x3f,loopcnt
+	branch lerx_nopayload,zero
+	
+lerx_loop:
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop lerx_loop
+	
+lerx_nopayload:
+	bpatchx patch20_4,mem_patch20
+	parse demod,bucket,24	
+	enable swfine
+	arg param_sifs,stop_watch		// start SIFS timer after last bit of crc
+	rshift32 pdata,pdata
+	rshift16 pdata,pdata
+	istore 3,contw
+	branch end_of_packet,crc_failed
+	enable match
+	fetch 1,mem_last_freq
+	add pdata,0,rega				// ble 2M Medium Frequency
+	call rf_write_freq				/* set frequency to tx mode freq */
+	disable decode_fec0
+	branch set_sync_on
+
+le_transmit_receive_sifs:
+	bpatchx patch20_5,mem_patch20
+	call le_transmit
+le_transmit_receive_sifs_notx:
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup 
+	branch le_receive_rxon
+
+le_transmit_norx:
+	call le_transmit
+	branch end_of_packet
+	
+le_transmit:
+	bpatchx patch20_6,mem_patch20
+	call le_prep
+	call letx_setfreq
+	branch le_transmit0
+	
+le_transmit0:
+	set1 TXGFSK,radio_ctrl
+	enable encode_fec0
+	enable is_tx
+	disable is_rx
+	call le_wait_tx
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,40
+	enable enable_white
+	enable enable_crc
+	bpatchx patch20_7,mem_patch20
+	fetch 1,mem_le_txheader
+	inject mod,8
+	ifetch 1,contr
+	and pdata,0x3f,loopcnt
+	inject mod,8
+	branch letr_nopayload,zero
+letr_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop letr_loop
+	
+letr_nopayload:
+	enable enable_parity
+	inject mod,24
+	disable enable_parity
+	until null,tx_clear
+	nop 100          /* flush out the last bit */
+	disable encode_fec0
+	rtn
+	
+le_send_adv_ind:
+	bpatchx patch21_0,mem_patch21
+	fetch 1,mem_le_adv_type
+	beq ADV_DIRECT_IND,le_send_adv_direct_ind
+	fetch 1,mem_le_adv_own_addr_type
+	lshift4 pdata,pdata
+	lshift2 pdata,pdata
+	store 1,mem_le_txheader
+	fetcht 1,mem_le_adv_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	copy temp,loopcnt
+	arg mem_le_adv_data,contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+le_send_adv_direct_ind:
+	fetch 1,mem_le_adv_direct_addr_type
+	lshift4 pdata,pdata
+	lshift2 pdata,pdata
+	increase 1,pdata
+	store 1,mem_le_txheader
+	setarg 12
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	fetch 6,mem_hci_plap
+	istore 6,contw
+le_send_adv_transmit:
+	bpatchx patch21_1,mem_patch21
+	fetch 1,mem_le_adv_transmit
+	increase 1,pdata
+	store 1,mem_le_adv_transmit
+	arg 1800,stop_watch
+	disable match
+	branch le_transmit_receive_sifs
+	
+le_send_scan_request:
+	bpatchx patch21_2,mem_patch21
+	fetch 1,mem_le_scan_type
+	rtnne LE_SCAN_TYPE_ACTIVE
+	fetch 1,mem_le_adv_transmit
+	increase 1,pdata
+	store 1,mem_le_adv_transmit
+	arg 0x0c03,temp// length + SCAN_REQ PDU
+	fetch 1,mem_le_scan_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,temp
+	copy regA,pdata
+	nsetflag blank,LE_RECEIVER_ADDR_BIT,temp	
+	storet 2,mem_le_txheader
+	fetch 6,mem_le_lap
+	istore 6,contw
+	fetch 6,mem_le_plap
+	istore 6,contw
+	branch le_transmit_receive_sifs
+
+
+le_send_scan_response:
+	bpatchx patch21_3,mem_patch21
+	arg SCAN_RSP,temp
+	fetch 1,mem_le_adv_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,temp
+	storet 1,mem_le_txheader
+	fetcht 1,mem_le_scan_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload
+	arg mem_le_scan_data,contr
+	copy temp,loopcnt
+	call memcpy_fast
+	call le_transmit_norx
+	branch le_adv_not_match
+
+le_connect_request:
+	bpatchx patch21_4,mem_patch21
+	force -1,pdata
+	setsect 2,1
+	store 5,mem_le_channel_map
+	call le_calc_channel_map	
+	force 4,loopcnt
+	arg mem_le_access,contw
+	call generate_random_loop	
+	fetch 2,mem_le_timeout
+	store 2,mem_le_superto
+le_con_req_hop_retry:
+	random pdata
+	and_into 0xf,pdata
+	sub pdata,4,null
+	branch le_con_req_hop_retry,positive
+	store 1,mem_le_hop
+	store 1,mem_tmp1
+	bpatchx patch21_5,mem_patch21
+	fetcht 2,mem_le_conn_interval
+	storet 2,mem_le_tsniff	
+	copy temp,regc			// tsniff in regc
+	add clkn_bt,7,pdata			// leave space for offset
+	idiv regc
+	call wait_div_end
+	remainder rega
+	isub rega,pdata
+	iadd regc,pdata
+	fetcht 2,mem_le_dsniff
+	iadd temp,pdata
+	store 4,mem_le_anchor
+	isub clkn_bt,rega
+	increase -6,rega			// window offset
+	arg 0x2205,regb			// length & CONN_REQ PDU
+	fetch 1,mem_le_conn_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,regb
+	fetch 1,mem_le_conn_peer_addr_type
+	nsetflag blank,LE_RECEIVER_ADDR_BIT,regb
+	copy regb,pdata
+	store 2,mem_le_txheader
+	fetch 6,mem_le_lap
+	istore 6,contw//own addr
+	fetch 6,mem_le_plap
+	istore 6,contw// peer addr
+	fetch 4,mem_le_access
+	istore 4,contw
+	random pdata
+	istore 2,contw				/* crc init */
+	random pdata
+	istore 1,contw
+	force 2,pdata				/* window size */	
+	istore 1,contw
+	rshift2 rega,pdata
+	istore 2,contw				/* window offset */
+	rshift2 regc,pdata			
+	istore 2,contw				/* conn Interval */
+	bpatchx patch21_6,mem_patch21
+	setarg 0					/* slave latency */
+	istore 2,contw
+	fetch 2,mem_le_timeout
+	istore 2,contw
+	fetch 5,mem_le_channel_map
+	istore 5,contw				/* channel map */
+	fetch 1,mem_le_hop
+	arg param_le_sca,temp
+	ior temp,pdata
+	istore 1,contw
+	call le_transmit_norx
+	setarg mem_le_txheader
+	add pdata,18,contr
+	ifetch 3,contr
+	store 3,mem_le_crcinit
+	rtn
+		
+le_init_adv:
+	bpatchx patch21_7,mem_patch21
+	disable master
+	branch le_adv_access
+	
+
+
+le_update_param:
+	fetch 1,mem_le_state
+	rtnbit0 lestate_update_param
+	fetch 2,mem_le_event_count
+	fetcht 2,mem_le_instant
+	isub temp,pdata
+	nrtn positive
+	store 2,mem_pdatatemp
+	bpatchx patch22_0,mem_patch22
+	fetch 1,mem_le_state
+	set0 lestate_update_param,pdata
+	set0 lestate_got_first_packet,pdata
+	store 1,mem_le_state
+	fetch 4,mem_le_anchor
+	fetcht 2,mem_le_tsniff
+	storet 2,mem_temp
+	isub temp,rega
+	bpatchx patch22_1,mem_patch22
+	fetch 1,mem_le_new_param
+	store 1,mem_le_window_size
+	ifetcht 2,contr
+	ifetch 2,contr
+	lshift2 pdata,pdata
+	store 2,mem_le_tsniff
+	lshift2 temp,temp
+	iadd temp,pdata
+	ifetcht 4,contr
+	storet 4,mem_le_slave_latency	// and superTO
+	iadd rega,pdata
+	copy pdata,regab
+	fetch 2,mem_le_tsniff
+	fetcht 2,mem_temp	//last sniff
+	isub temp,pdata		//last sniff - new sniff
+	fetcht 2,mem_pdatatemp
+	imul32 temp,pdata
+	iadd regab,pdata
+	store 4,mem_le_anchor
+	call le_receive_window_size
+	fetch 2,mem_le_superto
+	store 2,mem_le_init_superto
+	rtn
+
+
+le_update_channel_map:
+	bpatchx patch22_2,mem_patch22
+	fetch 1,mem_le_state
+	rtnbit0 lestate_update_map
+	fetch 2,mem_le_event_count
+	fetcht 2,mem_le_instant
+	isub temp,pdata
+	nrtn positive
+	fetch 1,mem_le_state
+	set0 lestate_update_map,pdata
+	store 1,mem_le_state
+ 	fetch 5,mem_le_new_map
+	store 5,mem_le_channel_map
+	branch le_calc_channel_map	
+	
+	
+le_acknowledge:
+	bpatchx patch22_3,mem_patch22
+	call le_supervision_flush
+	call le_check_wak
+	fetch 1,mem_le_rxbuf
+	isolate1 md,pdata
+	setflag true,mark_ble_rx_md,mark
+	rshift pdata,pdata
+	ixor temp,pdata
+	isolate1 nesn,pdata
+	setflag true,mark_old_packet,mark	/* retransmit */
+	rtnmark1 mark_old_packet
+	fetch 1,mem_le_rxbuf+1			
+	branch le_ack_unenc,blank		/* empty packet, no decryption */
+	fetch 1,mem_le_state
+	bbit0 lestate_encryption,le_ack_unenc
+	call load_sk
+	call le_decrypt
+	nrtn blank
+le_ack_unenc:
+	fetcht 1,mem_le_arq
+	setflip nesn,temp
+	storet 1,mem_le_arq
+	rtn
+
+	
+le_check_wak:
+	bpatchx patch22_4,mem_patch22
+	fetcht 1,mem_le_arq
+	isolate0 wak,temp
+	rtn true
+	fetch 1,mem_le_rxbuf
+	lshift pdata,pdata
+	ixor temp,pdata
+	rtnbit0 sn			/* received NESN is same as SN, NAK */
+	set0 wak,temp
+	setflip sn,temp
+	storet 1,mem_le_arq
+	compare 3,temp,3
+	nrtn true
+	fetch 1,mem_le_txpayload
+	beq LL_START_ENC_REQ,le_set_enc
+	fetch 1,mem_le_enc_state
+	beq FLAG_LE_ENC_PAUSE,le_clear_enc
+	rtn
+	
+
+le_set_enc:
+	fetch 1,mem_le_state
+	set1 lestate_encryption,pdata
+	store 1,mem_le_state
+	rtn	
+	
+le_clear_enc:
+	bpatchx patch22_5,mem_patch22
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	arg 0,pdata
+	store 4,mem_le_last_mic
+	store 5,mem_le_pcnt_tx
+	set1 39,pdata
+	store 5,mem_le_pcnt_rx
+	fetch 1,mem_le_state
+	set0 lestate_encryption,pdata
+	store 1,mem_le_state
+	rtn
+
+
+le_wait_adv:
+	bpatchx patch22_6,mem_patch22
+	call le_next_adv_channel
+	call le_receive_adv
+	fetch 1,mem_le_adv_waitcnt
+	increase 1,pdata
+	store 1,mem_le_adv_waitcnt
+	rtn
+
+
+le_scan:
+	bpatchx patch22_7,mem_patch22
+	fetch 1,mem_le_scan_enable
+	rtnne LE_SCAN_ENABLE
+	arg le_scan_interval_timer,queue
+	call timer_check
+	nrtn blank
+	fetch 2,mem_le_scan_interval
+	fetcht 2,mem_le_scan_window
+	isub temp,pdata
+	arg le_scan_interval_timer,queue
+	call timer_init
+	disable master
+	call le_init_adv
+	call le_wait_adv
+	nrtn match
+	bpatchx patch23_0,mem_patch23
+	fetch 6,mem_le_rxbuf+2
+	store 6,mem_le_plap
+//	call le_scan_dongle
+
+	fetch 1,mem_le_adv_rcv
+	increase 1,pdata
+	store 1,mem_le_adv_rcv
+	call le_create_conn
+	rtn master
+	call le_send_scan_request
+	nrtn match
+	bpatchx patch23_1,mem_patch23
+	fetch 1,mem_le_scanrsp_rcv
+	increase 1,pdata
+	store 1,mem_le_scanrsp_rcv
+	fetch 9,mem_le_rxbuf+8
+	store 9,mem_tmp_buffer
+	rtn
+	
+le_create_conn:
+	bpatchx patch23_2,mem_patch23
+	fetch 1,mem_cmd_le_create_conn
+	rtnne hci_cmd_le_create_conn
+	fetch 6,mem_le_plap
+	fetcht 6,mem_le_conn_peer_addr
+	isub temp,null
+	nrtn zero
+	call context_new
+	nrtn zero
+	call le_connect_request
+	call le_init_master
+	bpatchx patch23_3,mem_patch23
+	jam 0,mem_hci_cmd
+	jam 0,mem_le_peer_sca
+	jam 0,mem_le_scan_enable
+	jam 0,mem_cmd_le_create_conn
+	branch context_save
+	
+le_scan_check_sender_addr_type:
+	arg 1,rega// sender_addr_type
+	fetch 1,mem_le_rxbuf
+	rtnbit1 LE_SENDER_ADDR_BIT
+	arg 0,rega
+	rtn
+
+
+
+le_prepare_tx:
+	bpatchx patch23_4,mem_patch23
+	fetch 1,mem_le_arq
+	rtnbit1 wak
+	call le_check_tx_md
+	call le_fifo_get_first_tx_ptr	//no packet to send
+	branch le_send_empty,blank
+	ifetch 1,contr
+	ifetcht 1,contr
+	copy temp,rega
+	isub rega,pdata
+	arg LE_MAX_PAKET_LEN,temp
+	call not_greater_than
+	copy pdata,temp
+	ifetch 1,contr
+	copy pdata,type
+	copy rega,pdata
+	iadd contr,contr
+	arg mem_le_txpayload,contw
+	copy temp,loopcnt
+	call memcpy
+	call le_update_tx_type
+	call le_send_packet
+	
+	call le_fifo_get_first_tx_ptr
+	ifetch 1,contr
+	copy pdata,rega
+	copy contr,regc
+	ifetcht 1,contr
+	copy temp,regb
+	isub regb,pdata
+	arg LE_MAX_PAKET_LEN,temp
+	call not_greater_than
+	iadd regb,pdata
+	istore 1,regc
+	isub rega,null
+	nrtn zero
+	branch le_fifo_release_first_node
+
+	
+le_check_tx_md:
+	call le_check_continue
+	rtnmark1 mark_ble_tx_md
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_TRANSMIT_PACKET_BY_MD,le_clear_md
+	call le_fifo_get_second_tx_ptr	//no packet to send
+	branch le_clear_md,blank
+	branch le_set_md
+
+	
+le_check_continue:
+	call le_fifo_get_first_tx_ptr	//no packet to send
+	branch le_clear_md,blank
+	ifetch 1,contr				//pdata:length
+	ifetcht 1,contr				//temp:offest
+	isub temp,pdata			//pdata:length - offset
+	sub pdata,LE_MAX_PAKET_LEN,null	
+	branch le_clear_md,positive				//27 > length -offset
+le_set_md:
+	set1 mark_ble_tx_md,mark
+	rtn
+
+le_clear_md:
+	set0 mark_ble_tx_md,mark
+	rtn
+
+le_update_tx_type:
+	copy rega,pdata
+	rtn blank
+	arg LLID_CONTINUE,type
+	rtn
+
+
+le_att_check_notification_enable: // temp ->handle,output-> pdata,output :contr->rega
+	bpatchx patch23_5,mem_patch23
+	increase 1,temp
+	call le_att_get_handle_ptr
+	increase -2,contr
+	ifetch 2,contr
+	arg CLIENT_CHARACTERTIC_CONFIGURATION,temp
+	isub temp,null
+	nrtn zero
+	increase 1,contr
+	copy contr,rega
+	ifetch 1,contr
+	rtn
+	
+
+le_send_empty:
+	force 0,temp
+	force 1,type
+	
+le_send_packet:
+	bpatchx patch23_6,mem_patch23
+	storet 1,mem_le_txlen
+	fetcht 1,mem_le_arq
+	set1 wak,temp
+	and temp,0xfc,pdata
+	ior type,pdata
+	store 1,mem_le_arq
+	and_into 0x1f,pdata
+	isolate1 mark_ble_tx_md,mark
+	setflag true,md,pdata
+	store 1,mem_le_txheader
+
+	fetch 1,mem_le_txheader
+	compare 1,type,3
+	nbranch le_send_no_txlen,true
+	fetch 1,mem_le_txlen
+	rtn blank
+le_send_no_txlen:	
+	fetch 1,mem_le_state
+	rtnbit0 lestate_encryption
+	call load_sk
+	branch le_encrypt
+
+
+get_lpm_wake_ble_rx_lock:
+	arg wake_lock_ble_rx,queue
+	branch lpm_get_wake_lock
+
+put_lpm_wake_ble_rx_lock:
+	arg wake_lock_ble_rx,queue
+	branch lpm_put_wake_lock
+
+
+le_parse:
+	bpatchx patch23_7,mem_patch23
+	rtnmark1 mark_old_packet
+	call le_fifo_check_full
+	nrtn blank
+	fetch 1,mem_le_rxbuf
+	and pdata,0x3,pdata
+	store 1,mem_le_packet_llid
+	ifetch 1,contr
+	and pdata,0x1f,pdata
+	store 1,mem_le_packet_size
+	rtn blank							//empty rtn
+	copy contr,pdata
+	store 2,mem_le_payload_ptr
+	bpatchx patch24_0,mem_patch24
+	fetch 1,mem_le_packet_llid
+	beq LLID_LE_LL,le_parse_ll
+le_parse_l2cap:
+	bpatchx patch24_1,mem_patch24
+	call le_check_l2cap_complete
+	nbranch get_lpm_wake_ble_rx_lock,user
+	call put_lpm_wake_ble_rx_lock
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	ifetch 2,contr	//l2cap len
+	store 2,mem_le_l2cap_size
+	bpatchx patch24_2,mem_patch24
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,le_parse_att
+	beq LE_L2CAP_CID_SMP,le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+
+
+le_check_l2cap_complete:
+	fetch 1,mem_le_packet_llid
+	beq LLID_START,le_check_l2cap_llid_start
+	beq LLID_CONTINUE,le_check_l2cap_llid_continue
+	rtn
+
+//input: pdata is CID number
+//output: 	if CID is legal ,enable user
+//		if ICD is illegal,disable user 
+le_check_l2cap_CID_legal:
+	call enable_user
+	arg LE_L2CAP_CID_ATT,temp
+	isub pdata,null
+	rtn zero
+	arg LE_L2CAP_CID_SIGNAL,temp
+	isub pdata,null
+	rtn zero
+	arg LE_L2CAP_CID_SMP,temp
+	isub pdata,null
+	rtn zero
+	branch disable_user
+
+	
+le_check_l2cap_llid_start:
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	ifetch 2,contr
+	store 2,mem_le_l2cap_size
+	ifetch 2,contr			//CID
+	call le_check_l2cap_CID_legal
+	nrtn user
+	fetcht 1,mem_le_packet_size
+	storet 1,mem_le_packet_len_recved
+	fetch 2,mem_le_l2cap_size
+	increase 4,pdata
+	isub temp,null
+	branch enable_user,zero
+	fetch 1,mem_le_packet_size
+	copy pdata,loopcnt
+	arg mem_le_l2capbuf,contw
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	call memcpy
+	branch disable_user
+
+//no input
+//output: 	if CID is legal ,enable user
+//		if ICD is illegal,disable user 
+le_check_l2cap_continue_legal:
+	call enable_user
+	fetch 1,mem_le_packet_len_recved
+	nrtn blank
+	branch disable_user
+
+le_check_l2cap_llid_continue:
+	call le_check_l2cap_continue_legal
+	nrtn user
+	fetch 1,mem_le_packet_len_recved
+	arg mem_le_l2capbuf,contw
+	iadd contw,rega
+	fetcht 1,mem_le_packet_size
+	iadd temp,pdata
+	store 1,mem_le_packet_len_recved
+	fetch 1,mem_le_packet_size
+	copy pdata,loopcnt
+	copy rega,contw
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	call memcpy_fast
+	setarg mem_le_l2capbuf
+	store 2,mem_le_payload_ptr		//update ptr->mem_le_l2capbuff
+	fetch 2,mem_le_l2cap_size
+	increase 4,pdata
+	fetcht 1,mem_le_packet_len_recved
+	isub temp,null
+	branch enable_user,zero
+	branch disable_user
+
+
+
+
+	
+le_get_search_att_type:
+	call store_contr
+	arg mem_le_search_att_type_length,contw
+le_get_search_common:	
+	fetch 2,mem_le_l2cap_size
+	increase -5,pdata
+le_get_search_common2:		
+	istore 1,contw
+	copy pdata,loopcnt
+	call get_contr
+	branch memcpy_fast	
+	
+le_get_search_att_uuid:
+	call store_contr
+	arg mem_le_search_uuid_length,contw
+	branch le_get_search_common
+
+
+	/* rega pointers to data, regb is length */
+le_writeatt_cb:
+	fetch 2,mem_cb_att_write
+	branch callback_func
+	
+le_supervision_update:
+	fetcht 4,mem_le_supervision_timer
+	call get_clkbt
+	isub temp,timeup					/* and to 28 bits */
+	deposit timeup
+	fetcht 2,mem_le_superto
+	lshift4 temp,temp
+	lshift temp,temp
+	isub temp,pdata
+	rtn
+	
+le_supervision_flush:
+	call get_clkbt
+	store 4,mem_le_supervision_timer
+	rtn
+
+
+le_adv:
+	jam 36,mem_le_ch_mapped
+	jam 0,mem_le_adv_channel_map_temp
+le_adv_loop:
+	bpatchx patch24_3,mem_patch24
+	fetch 1,mem_le_adv_enable
+	rtn blank
+	arg le_adv_interval_timer,queue
+	call timer_check
+	nrtn blank
+	bpatchx patch24_4,mem_patch24
+le_adv_loop_tx:
+	disable master
+	enable swfine
+	call le_init_adv
+	call le_next_adv_channel
+	call le_send_adv_ind
+	nbranch le_adv_not_match,match
+	fetch 1,mem_le_req_rcv
+	increase 1,pdata
+	store 1,mem_le_req_rcv
+	fetch 1,mem_le_rxbuf
+	and pdata,0x0f,pdata
+	beq SCAN_REQ,le_send_scan_response
+	beq CONNECT_REQ,le_parse_connect_req
+le_adv_not_match:
+	bpatchx patch24_5,mem_patch24
+	random pdata 
+	arg 0x1ff,temp
+	iand temp,pdata
+	add pdata,250,pdata
+	call delay
+	fetch 1,mem_le_adv_channel_map_temp
+	fetcht 1,mem_le_adv_channel_map
+	isub temp,null
+	nbranch le_adv_loop,zero
+	arg le_adv_interval_timer,queue
+	fetch 2,mem_le_adv_interval
+	branch timer_init
+
+delay:
+	increase -1,pdata
+	nop 38
+	nbranch delay,blank
+	rtn
+	
+
+le_receive_window_size:
+	bpatchx patch24_6,mem_patch24
+	fetch 1,mem_le_peer_sca
+	call le_sca_map
+	fetch 2,mem_le_tsniff
+	imul32 temp,pdata
+	arg 375,temp
+	imul32 temp,pdata
+	arg 100000,temp
+	idiv temp
+	fetch 1,mem_le_window_size
+	arg 20000,temp
+	imul32 temp,pdata
+	iadd temp,pdata
+	store 4,mem_le_transmit_window
+	bpatchx patch24_7,mem_patch24
+	fetch 2,mem_rx_window_sniff
+	call wait_div_end
+	quotient temp
+	iadd temp,pdata
+	store 2,mem_le_receive_window
+	rtn
+
+le_parse_connect_req:
+	bpatchx patch25_0,mem_patch25
+	fetch 6,mem_le_rxbuf+8
+	fetcht 6,mem_le_lap
+	isub temp,null
+	nrtn zero
+	call le_scan_check_sender_addr_type
+	copy rega,pdata
+	store 1,mem_le_conn_peer_addr_type
+	fetch 7,mem_le_rxbuf+21
+	store 7,mem_tmp_buffer
+	ifetch 8,contr
+	istore 8,contw
+	fetch 6,mem_le_rxbuf+2
+	store 6,mem_le_plap
+	increase 6,contr
+	ifetch 8,contr
+	store 8,mem_le_access 	// and crcinit & window size
+	ifetcht 2,contr				// transmit offset
+	bpatchx patch25_1,mem_patch25
+//	increase 1,temp
+	lshift2 temp,temp			
+	ifetch 2,contr				// connInterval
+	lshift2 pdata,pdata
+	store 2,mem_le_tsniff
+	store 4,mem_le_anchor
+	isub temp,pdata
+	add pdata,-2,clke_bt
+	ifetch 9,contr
+	store 9,mem_le_slave_latency// and super to & channel map
+	bpatchx patch25_2,mem_patch25
+	ifetch 1,contr
+	rshift4 pdata,temp
+	rshift temp,temp
+	storet 1,mem_le_peer_sca
+	and_into 0x1f,pdata
+	store 1,mem_le_hop
+	call le_receive_window_size
+	call le_calc_channel_map
+	call le_init_slave
+	call context_new
+	nrtn zero
+	bpatchx patch25_3,mem_patch25
+	call calc_clke_offset
+	call le_l2cap_reset_signaling_identifier
+	jam BT_EVT_LE_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+//	call app_get_lpm_wake_lock
+	branch context_save
+	
+
+le_init_attlist_search:
+	bpatchx patch25_4,mem_patch25
+	fetch 2,mem_le_search_handle_start
+	iforce regb
+	fetch 2,mem_le_search_handle_end
+	iforce regc
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+	enable user
+	rtn
+
+	/* return handle in pdata, blank:end of list, positive:in range */
+le_att_handle_inrange:
+	ifetch 2,contr
+	rtn blank
+	isub regb,null			/* less than start ? */
+	nrtn positive
+	isub regc,null			/* greater than end ? */
+	rtn zero
+	branch le_att_handle_blank,positive
+	force 1,null
+	rtn
+le_att_handle_blank:
+	force 0,pdata
+	rtn
+
+
+	/* handle in temp, return pointer in contr to length, blank not found */
+le_att_get_handle_ptr:
+	call le_att_get_handle_ptr2
+	branch le_att_get_handle_ptr_found,zero
+	rtn
+	
+le_att_get_handle_ptr2:
+	bpatchx patch25_5,mem_patch25
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_handle_loop1:
+	ifetch 2,contr
+	rtn blank
+	isub temp,null
+	rtn zero
+	ifetch 1,contr
+	iadd contr,contr	
+	ifetch 1,contr			// length  
+	iadd contr,contr
+	branch le_att_get_handle_loop1
+le_att_get_handle_ptr_found:
+	ifetch 1,contr
+	iadd contr,contr	
+	rtn	
+
+
+
+le_att_get_short_uuid_ptr:
+	bpatchx patch25_6,mem_patch25
+	fetch 2,mem_ui_le_uuid_table
+	iforce contr
+le_att_get_short_uuid_loop:
+	ifetch 2,contr
+	rtn blank
+	ifetch 1,contr
+	iadd contr,contr
+	increase -2,contr
+	ifetch 2,contr
+	isub temp,null
+	rtn zero
+	ifetch 1,contr			 
+	iadd contr,contr
+	branch le_att_get_short_uuid_loop	
+
+
+
+le_att_get_handle_info_from_ptr:
+	fetch 2, mem_le_cur_attlist_start_ptr
+	branch le_att_get_handle_info_fast
+
+le_att_get_handle_info:
+	bpatchx patch25_7,mem_patch25
+	fetch 2,mem_ui_le_uuid_table
+le_att_get_handle_info_fast:
+	iforce contr
+	copy temp,rega
+le_att_get_handle_loop:
+	ifetch 2,contr
+	branch le_att_unfind_handle,blank
+	isub rega,null
+	branch le_att_finded_handle, zero
+	ifetch 1,contr			// length  
+	iadd contr,contr	
+	ifetch 1,contr			//length 
+	iadd contr,contr
+	branch le_att_get_handle_loop
+le_att_unfind_handle:
+	branch disable_blank
+
+le_att_finded_handle:
+	ifetch 1,contr
+	store 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	arg mem_le_cur_uuid,contw
+	call memcpy_fast
+	ifetch 1,contr
+	store 1,mem_le_curr_att_len
+	call store_contr
+	branch enable_blank
+
+	
+le_modified_name:
+	bpatchx patch26_0,mem_patch26
+	call le_modified_name_att_list
+	branch le_modified_name_adv
+
+le_modified_name_att_list:
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	call le_att_get_short_uuid_ptr
+	rtn blank
+	ifetch 1,contr						// attribute length
+	copy contr,contw
+	fetcht 1,mem_le_name_len
+	copy temp,loopcnt
+	isub temp,null
+	nbranch le_name_length_longer_than_att,positive
+	isub temp,temp
+	arg mem_le_name,contr
+	call memcpy
+	copy temp,loopcnt
+	ncall memcpy_empty,zero
+	rtn
+le_name_length_longer_than_att:
+	copy pdata,loopcnt
+	arg mem_le_name,contr
+	branch memcpy_fast
+
+
+le_modified_name_adv:
+	arg mem_le_adv_data_len+32,regc
+	arg mem_le_adv_data,rega
+	call le_modified_name_adv_and_scan
+	setarg 0
+	setflag user,0,pdata
+	store 1,mem_pdatatemp
+	arg mem_le_scan_data_len+32,regc
+	arg mem_le_scan_data,rega
+	call le_modified_name_adv_and_scan
+	rtn user
+	fetch 1,mem_pdatatemp
+	branch assert,blank
+	rtn
+
+
+le_modified_name_adv_and_scan:
+	bpatchx patch26_1,mem_patch26
+	call enable_user
+	call clear_temp_block
+	arg 0,regb	//current length
+	arg mem_le_data_temp,contw
+	call le_modified_name_adv_loop
+	fetch 1,mem_le_name_len
+	add pdata,1,temp
+	iadd regb,rega	
+	increase 2,rega
+	sub rega,0x1f,null
+	nbranch le_modified_name_adv_and_scan_name_overflow,positive
+	istoret 1,contw		//store ble name length
+	arg GAP_ADTYPE_LOCAL_NAME_COMPLETE,temp
+	istoret 1,contw		//store ble name type
+	iforce loopcnt
+	call memcpy_fast
+	copy rega,regb
+le_modified_name_adv_and_scan_store_data:
+	deposit regb
+	store 1,mem_le_data_len_temp
+	arg mem_le_data_len_temp,contr
+	setarg -32
+	iadd regc,contw
+	branch memcpy32
+
+le_modified_name_adv_and_scan_name_overflow:
+	call disable_user
+	branch le_modified_name_adv_and_scan_store_data
+	
+le_modified_name_adv_loop:
+	ifetch 1,rega		//pdata:length
+	rtn blank			//length is zero,ending find
+	pincrease 1		//length += 1
+	ifetcht 1,contr		//pdata:type
+	sub temp,GAP_ADTYPE_LOCAL_NAME_COMPLETE,null
+	branch le_modified_name_adv_found_name,zero
+	iadd regb,regb	
+	copy rega,contr
+	iforce loopcnt
+	call memcpy_fast
+	copy contr,rega
+le_modified_name_adv_loop2:
+	deposit rega
+	isub regc,null
+	rtn positive
+	branch le_modified_name_adv_loop
+
+le_modified_name_adv_found_name:
+	iadd rega,rega
+	branch le_modified_name_adv_loop2
+
+
+memcpy_empty:
+	setarg SPACE
+	istore 1,contw
+	loop memcpy_empty
+	rtn
+
+	
+le_lpm_set_mult:
+	bpatchx patch26_2,mem_patch26
+	disable wake
+	branch le_lpm_set_mult_attempt,attempt
+	nbranch le_lpm_lost,match
+le_lpm_set_mult_attempt:
+	call lpm_match
+	fetch 2,mem_rx_window_sniff
+	store 2,mem_le_receive_window
+
+	nbranch lpm_mult_short,match
+	bmark1 mark_old_packet,lpm_mult_short
+
+	fetch 1,mem_le_packet_size
+	nbranch lpm_mult_short,blank		// rx not empty, short interval
+	fetch 1,mem_le_txlen
+	nbranch lpm_mult_short,blank		// tx not empty, short interval
+	
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_SHORT_MULT,lpm_mult_short	//check flag,if flag is 1,always short mult
+	
+	fetch 1,mem_le_state
+	bbit1 lestate_update_param,lpm_mult_short
+	branch lpm_mult_wait_timeout
+	
+le_lpm_lost:
+	fetcht 2,mem_rx_window_sniff
+	rshift temp,temp
+	fetch 2,mem_le_receive_window
+	iadd temp,pdata
+	store 2,mem_le_receive_window
+	branch lpm_lost
+
+///////////////////////////////BLE CONFIG//////////////////////////////////////////
+le_set_config_fixed_tk:
+	arg BIT_BLE_PASSKEY_FIXED_KEY,queue
+	branch le_set_config
+
+le_clr_config_fixed_tk:
+	arg BIT_BLE_PASSKEY_FIXED_KEY,queue
+	branch le_clr_config
+
+le_set_config_fixed_ltk:
+	arg BIT_BLE_PAIRING_FIXED_LTK,queue
+	branch le_set_config
+
+le_clr_config_fixed_ltk:
+	arg BIT_BLE_PAIRING_FIXED_LTK,queue
+	branch le_clr_config
+
+le_set_config_more_data:
+	arg BIT_BLE_TRANSMIT_PACKET_BY_MD,queue
+	branch le_set_config
+
+le_clr_config_more_data:
+	arg BIT_BLE_TRANSMIT_PACKET_BY_MD,queue
+	branch le_clr_config
+
+le_set_config_read_authentication:
+	arg BIT_BLE_READ_AUTH,queue
+	branch le_set_config
+
+le_clr_config_read_authentication:
+	arg BIT_BLE_READ_AUTH,queue
+	branch le_clr_config
+
+le_set_config_write_authentication:
+	arg BIT_BLE_WRITE_AUTH,queue
+	branch le_set_config
+
+le_clr_config_write_authentication:
+	arg BIT_BLE_WRITE_AUTH,queue
+	branch le_clr_config
+
+le_set_config_short_mult:
+	arg BIT_BLE_SHORT_MULT,queue
+	branch le_set_config
+
+le_clr_config_short_mult:
+	arg BIT_BLE_SHORT_MULT,queue
+	branch le_clr_config
+
+
+le_set_config:
+	fetch 1,mem_le_configuration
+	qset1 pdata
+	store 1,mem_le_configuration
+	rtn
+
+le_clr_config:
+	fetch 1,mem_le_configuration
+	qset0 pdata
+	store 1,mem_le_configuration
+	rtn
+
+le_set_fixed_ltk:
+	setarg 0x112233
+	store 3,mem_le_fixed_ltk
+	setarg 0x445566
+	istore 3,contw
+	setarg 0x778899
+	istore 3,contw
+	setarg 0x001122
+	istore 3,contw
+	setarg 0x334455
+	istore 3,contw
+	setarg 0x66
+	istore 1,contw
+	rtn
+
+
+le_set_justwork:
+	setarg 0x01000302
+	store 4,mem_le_pres
+	setarg 0x010010
+	store 3,mem_le_pres_max_keysize
+	jam 1,mem_le_pairing_mode
+	rtn
+
+/////////////////////////////////////////////////////////////////////////
+
+le_fifo_malloc_tx_empty:
+	arg 0,rega
+	arg LLID_EMPTY,type
+	branch le_fifo_malloc_tx
+
+
+//rega:len regb:ll opcode
+le_fifo_malloc_tx_ll:
+	arg LLID_LE_LL,type
+	call le_fifo_malloc_tx
+	copy regb,pdata
+	istore 1,contw
+	rtn
+	
+
+//rega:len regb:cid
+le_fifo_malloc_tx_l2cap:
+	force LLID_START,type
+	increase 4,rega
+	call le_fifo_malloc_tx
+	increase -4,rega
+	copy rega,pdata
+	istore 2,contw
+	copy regb,pdata
+	istore 2,contw
+	rtn
+
+
+//rega:len type:llid
+le_fifo_malloc_tx:
+	sub rega,240,null			//check max len
+	nbranch assert,positive
+	fetch 1,mem_le_tx_buff_used
+	arg 1,temp
+	arg LE_TX_BUFF_COUNT,loopcnt
+le_fifo_malloc_tx_loop:
+	iand temp,null
+	branch le_fifo_malloc_tx_got_empty,zero
+	lshift temp,temp
+	loop le_fifo_malloc_tx_loop
+	branch assert				//no empty buff
+le_fifo_malloc_tx_got_empty:
+	ixor temp,pdata
+	store 1,mem_le_tx_buff_used
+	sub loopcnt,LE_TX_BUFF_COUNT,pdata
+	lshift4 pdata,pdata
+	lshift4 pdata,pdata
+	arg mem_le_tx_buffer0,temp
+	iadd temp,temp
+le_fifo_tx_find_empty_ptr:
+	arg 0,loopcnt
+	arg mem_le_tx_ptr0,contr
+le_fifo_tx_find_empty_ptr_loop:
+	ifetch 2,contr
+	branch le_fifo_tx_found_empty_ptr,blank
+	copy loopcnt,pdata
+	increase 1,loopcnt
+	bne LE_TX_BUFF_COUNT,le_fifo_tx_find_empty_ptr_loop
+	branch assert
+
+	
+le_fifo_tx_found_empty_ptr:
+	increase -2,contr
+	istoret 2,contr
+	copy temp,contw
+	copy rega,pdata
+	istore 1,contw				//lengh
+	setarg 0
+	istore 1,contw				//offset
+	copy type,pdata
+	istore 1,contw				//LLID
+	rtn
+
+
+
+le_fifo_get_first_tx_ptr:
+	fetch 2,mem_le_tx_ptr0
+	copy pdata,contr
+	rtn
+
+le_fifo_get_second_tx_ptr:
+	fetch 2,mem_le_tx_ptr1
+	copy pdata,contr
+	rtn
+
+le_fifo_get_last_tx_ptr:
+	call le_fifo_get_last_tx_ptr0
+	copy pdata,contr
+	rtn
+le_fifo_get_last_tx_ptr0:
+	fetch 2,mem_le_tx_ptr3
+	nrtn blank
+	fetch 2,mem_le_tx_ptr2
+	nrtn blank
+	fetch 2,mem_le_tx_ptr1
+	nrtn blank
+	fetch 2,mem_le_tx_ptr0
+	rtn
+
+le_fifo_get_first_l2cap_ptr:
+	call le_fifo_get_first_tx_ptr
+	increase 3,contr
+	rtn
+
+le_fifo_get_first_att_ptr:
+	call le_fifo_get_first_tx_ptr
+	increase 7,contr
+	rtn
+
+le_fifo_get_last_att_ptr:
+	call le_fifo_get_last_tx_ptr
+	increase 7,contr
+	rtn
+
+le_fifo_get_last_l2cap_ptr:
+	call le_fifo_get_last_tx_ptr
+	increase 3,contr
+	rtn
+
+	
+
+le_fifo_check_full:
+	fetch 2,mem_le_tx_ptr3
+	rtn
+
+
+le_fifo_check_nearly_full:
+	fetch 2,mem_le_tx_ptr2
+	rtn
+
+	
+le_fifo_check_empty:
+	fetch 2,mem_le_tx_ptr0
+	rtn
+
+
+le_fifo_release_first_node:
+	fetch 2,mem_le_tx_ptr0
+	arg mem_le_tx_buffer0,temp
+	isub temp,pdata
+	rshift4 pdata,pdata
+	rshift4 pdata,queue
+	fetch 1,mem_le_tx_buff_used
+	qset0 pdata
+	store 1,mem_le_tx_buff_used
+	arg 0,loopcnt
+le_fifo_release_first_node_loop:
+	lshift loopcnt,pdata
+	arg mem_le_tx_ptr1,temp
+	iadd temp,temp
+	ifetch 2,temp
+	increase -2,temp
+	istore 2,temp
+	copy loopcnt,pdata
+	increase 1,loopcnt
+	bne LE_TX_BUFF_UPDATE_LOOPCNT,le_fifo_release_first_node_loop
+	setarg 0
+	istore 2,temp
+	rtn
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_att.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_att.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_att.prog	(working copy)
@@ -0,0 +1,713 @@
+
+
+le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_EXCHANGE_MTU_REQUEST,le_parse_att_exchange_mtu_request
+	beq ATTOP_EXCHANGE_MTU_RESPONSE,le_parse_att_exchange_mtu_response
+	beq ATTOP_FIND_INFORMATION_REQUEST,le_parse_att_find_information_request
+	beq ATTOP_FIND_BY_TYPE_VALUE_REQUEST,le_parse_att_find_by_type_value_request
+	beq ATTOP_READ_BY_TYPE_REQUEST,le_parse_att_read_by_type_request
+	beq ATTOP_READ_REQUEST,le_parse_att_read_request
+	beq ATTOP_READ_BLOB_REQUEST,le_parse_att_read_blob_request
+	beq ATTOP_READ_BY_GROUP_TYPE_REQUEST,le_parse_att_read_by_group_type_request
+	beq ATTOP_WRITE_REQUEST,le_parse_att_write_request
+	beq ATTOP_PREPARE_WRITE_REQUEST,le_parse_att_prepare_write_request
+	beq ATTOP_EXECUTE_WRITE_REQUEST,le_parse_att_execute_write_request
+	beq ATTOP_WRITE_COMMAND,le_parse_att_write_command
+	rtn
+
+
+le_send_att_exchange_mtu_requset:
+	force 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXCHANGE_MTU_REQUEST
+	istore 1,contw
+	fetch 2,mem_le_local_mtu
+	istore 2,contw
+	rtn
+
+
+le_parse_att_exchange_mtu_request:
+	call le_parse_att_exchange_mtu_response
+le_send_att_exchange_mtu_response:
+	force 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXCHANGE_MTU_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_local_mtu
+	istore 2,contw
+	rtn
+
+le_parse_att_exchange_mtu_response:
+	rshift8 pdata,pdata
+	store 2,mem_le_remote_mtu
+	rtn
+
+le_parse_att_find_information_request:
+	call le_get_search_handle_start_end_common
+	call enable_user
+	branch le_send_att_find_information_response
+	
+le_send_att_find_information_response:
+	arg 3,timeup
+	call le_init_attlist_search
+le_send_att_find_information_res_loop:
+	call le_att_handle_inrange
+	branch le_send_att_find_information_res_end,blank
+	nbranch le_send_att_find_information_res_next,positive
+	increase -2,contr
+	call store_contr
+	call get_contw
+	nbranch le_send_att_find_information_res_store_info,user
+	call push_stack_rega_b_c
+	call disable_user
+	force 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	call pop_stack_rega_b_c
+	setarg ATTOP_FIND_INFORMATION_RESPONSE
+	istore 1,contw
+	setarg UUID_SIZE_16BIT
+	istore 1,contw
+le_send_att_find_information_res_store_info:
+	call get_contr
+	ifetch 2,contr
+	istore 2,contw
+	ifetch 1,contr
+	copy pdata,loopcnt
+	call memcpy
+	call store_contw
+	increase -1,timeup
+	branch le_send_att_find_information_res_end,zero
+le_send_att_find_information_res_cont:
+	ifetch 1,contr
+	iadd contr,contr
+	branch le_send_att_find_information_res_loop
+le_send_att_find_information_res_next:
+	ifetch 1,contr
+	iadd contr,contr
+	branch le_send_att_find_information_res_cont
+le_send_att_find_information_res_end:
+	branch le_send_att_error_response_notfound,user
+	branch le_send_auto_len_by_mem
+
+
+le_parse_att_find_by_type_value_request:
+	call le_get_search_handle_start_end_common
+	ifetch 2,contr
+	store 2,mem_le_search_uuid
+	call store_contr
+	arg mem_le_search_att_type_length,contw
+	fetch 2,mem_le_l2cap_size
+	increase -7,pdata
+	call le_get_search_common2
+	branch le_send_att_find_by_type_value_response
+
+
+le_start_end_handle_check_1:
+	disable user
+	fetcht 2,mem_le_search_handle_start
+	fetch 2,mem_le_search_handle_end
+	isub temp,null
+	nbranch le_start_end_handle_check_1_fail,positive
+	deposit temp
+	rtnne 0
+le_start_end_handle_check_1_fail:
+	enable user
+	jam ATT_ERR_INVALID_HANDLE,mem_le_err_code
+	branch le_send_att_error_response
+
+
+le_send_att_find_by_type_value_response:
+	call le_start_end_handle_check_1
+	rtn user
+	fetcht 2,mem_le_search_uuid
+	setarg UUID_GATT_PRIMARY_SERVICE
+	isub temp,null
+	branch le_send_att_find_by_type_value_res_primary,zero
+	branch le_send_att_error_response_notfound
+	
+
+le_send_att_find_by_type_value_res_primary:
+	jam LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND,mem_le_search_res
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_att_get_handle_info
+	nbranch le_send_att_error_response_notfound,blank
+le_send_att_find_primary_search_loop:
+	fetcht 2,mem_temp
+	call le_att_get_handle_info
+	nbranch le_send_att_error_response_notfound2,blank	
+	copy contr,rega
+	fetch 1,mem_le_curr_att_len
+	copy pdata,loopcnt
+	fetcht 1,mem_le_search_att_type_length
+	isub temp,null
+	nbranch le_send_att_find_primary_search_loop1,zero
+	arg mem_le_search_att_type,regb
+	call string_compare
+
+	branch le_send_att_find_primary_search_end_start_handle_found,zero
+
+	fetch 2,mem_le_cur_uuid
+	fetcht 2,mem_le_search_uuid
+	isub temp,null
+	branch le_send_att_find_primary_search_end_ending_handle_found,zero
+le_send_att_find_primary_search_loop1:
+	fetch 2,mem_temp
+	increase 1,pdata
+	store 2,mem_temp
+	branch le_send_att_find_primary_search_loop
+
+le_send_att_error_response_notfound2:
+	fetch 1,mem_le_search_res
+	beq LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE,le_send_att_find_primary_search_end_ending_handle_found
+	branch le_send_att_error_response_notfound
+
+	
+le_send_att_find_primary_search_end_start_handle_found:
+	fetch 2,mem_le_cur_uuid
+	fetcht 2,mem_le_search_uuid
+	isub temp,null
+	nbranch  le_send_att_find_primary_search_loop1,zero
+	jam LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE,mem_le_search_res
+//	copy rega,temp
+	fetcht 2,mem_temp
+	storet 2,mem_le_cur_handle_start
+	branch le_send_att_find_primary_search_loop1
+
+le_send_att_find_primary_search_end_ending_handle_found:
+	fetch 1,mem_le_search_res
+	beq LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND,le_send_att_find_primary_search_loop1
+	jam LE_FIND_BY_TYPE_VAL_RES_FOUND_ENDING_HANDLE,mem_le_search_res
+	fetcht 2,mem_temp
+	increase -1,temp
+	storet 2,mem_le_cur_handle_end
+	
+le_send_att_find_primary_search_end:
+	arg 5,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_FIND_BY_TYPE_VALUE_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_cur_handle_start
+	istore 2,contw
+	fetch 2,mem_le_cur_handle_end
+	istore 2,contw
+	rtn
+
+
+
+le_parse_att_read_by_type_request:
+	call le_get_search_handle_start_end_common
+	call le_get_search_att_uuid
+	branch le_send_att_read_by_type_response
+	
+le_send_att_read_by_type_response:
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+	call le_init_attlist_search
+	call le_att_get_handle_ptr2
+	increase -2,contr
+	copy contr,pdata
+	store 2,mem_le_cur_attlist_start_ptr
+
+	fetcht 2,mem_le_search_uuid
+	setarg UUID_CHRCTR_DEVICE_NAME
+	isub temp,null
+	branch le_send_att_read_by_type_res_device_name,zero
+	setarg UUID_GATT_CHARACTERISTIC
+	isub temp,null
+	nbranch le_send_att_read_by_type_res_not_characteristic,zero
+	arg 2,timeup
+le_send_att_read_by_type_response_loop:
+	call le_att_check_handle_end
+	nbranch le_send_att_read_by_type_response_end,positive
+	fetcht 2,mem_temp
+	call le_att_get_handle_info_from_ptr
+	beq 1,le_send_att_read_by_type_response_end
+	call le_att_same_uuid
+	nbranch le_send_att_read_by_type_response_next_handle,zero
+	nbranch le_send_att_read_by_type_res_found_next,user
+	disable user
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	copy contw,alarm
+	increase 1,contw
+	
+	call le_send_att_read_by_type_write_properties
+	call le_att_next_handle
+	call le_att_get_handle_info_from_ptr
+	call le_send_att_read_by_type_write_uuid
+	fetch 1,mem_le_cur_uuid_length
+	increase 5,pdata
+	istore 1,alarm
+	fetch 1,mem_le_cur_uuid_length
+	beq 16,le_send_att_read_by_type_response_end
+	increase -1,timeup
+	branch le_send_att_read_by_type_response_end,zero
+le_send_att_read_by_type_response_next_handle:
+	call le_att_next_handle
+	branch le_send_att_read_by_type_response_loop
+le_send_att_read_by_type_response_end:
+	branch le_send_att_error_response_notfound,user
+	branch le_send_auto_len_by_mem
+
+le_send_att_read_by_type_res_found_next:
+	call le_store_att_record
+	call le_att_next_handle
+	call le_att_get_handle_info_from_ptr
+	fetch 1,mem_le_cur_uuid_length
+	beq 16,le_send_att_read_by_type_response_end
+	
+	call get_contw
+	fetch 2,mem_temp
+	increase -1,pdata
+	istore 2,contw
+	call le_write_att_record_common
+	call le_send_att_read_by_type_write_uuid
+	increase -1,timeup
+	branch le_send_att_read_by_type_response_end,zero
+	branch le_send_att_read_by_type_response_next_handle
+
+	
+le_send_att_read_by_type_write_properties:
+	fetch 2,mem_temp
+	istore 2,contw
+	
+	fetch 1,mem_le_curr_att_len
+	copy pdata,loopcnt
+	call get_contr
+	call memcpy_fast
+	branch store_contw
+le_send_att_read_by_type_write_uuid:
+	call get_contw
+	fetch 2,mem_temp
+	istore 2,contw
+	call store_contw
+	fetch 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	call get_contw	
+	call get_contr
+	isub loopcnt,contr
+	increase -1,contr
+	call memcpy_fast
+	branch store_contw
+
+
+
+le_send_att_read_by_type_res_not_characteristic:
+	fetcht 2,mem_le_search_handle_start
+	storet 2,mem_temp
+le_send_att_read_by_type_res_not_char_loop:
+	call le_att_check_handle_end
+	nbranch le_send_att_error_response_notfound,positive
+	call le_att_get_handle_info_from_ptr
+	beq 1,le_send_att_error_response_notfound
+	call le_att_same_uuid
+	nbranch le_send_att_read_by_type_res_not_char_next,zero
+
+le_send_att_read_by_type_res_not_char_common:
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_curr_att_len
+	copy pdata,loopcnt
+	increase 2,pdata
+	istore 1,contw
+	fetch 2,mem_temp
+	istore 2,contw
+	call get_contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+	
+le_send_att_read_by_type_res_not_char_next:
+ 	call le_att_next_handle
+	branch le_send_att_read_by_type_res_not_char_loop
+
+
+le_send_att_read_by_type_res_device_name:
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	call le_att_get_short_uuid_ptr
+	rtn blank
+	increase -5,contr // point to handle
+	ifetch 2,contr		
+	store 2,mem_temp
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_TYPE_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_name_len
+	copy pdata,loopcnt
+	increase 2,pdata
+	istore 1,contw
+	fetch 2,mem_temp
+	istore 2,contw
+	arg mem_le_name,contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+
+
+
+le_parse_att_read_request:
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,le_send_att_read_response_check_auth
+
+le_send_att_read_response:
+	call le_att_get_handle_ptr
+	branch le_send_att_error_response_notfound,blank
+	increase -2,contr
+	ifetch 2,contr
+	arg UUID_CHRCTR_DEVICE_NAME,temp
+	isub temp,null
+	branch le_send_device_name,zero
+	ifetch 1,contr
+	sub pdata,22,null
+	branch le_send_att_read_response_less,positive
+	force 22,pdata
+le_send_att_read_response_less:
+	copy pdata,regc
+	call store_contr
+	add regc,1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_RESPONSE
+	istore 1,contw
+	copy regc,loopcnt
+	call get_contr
+	branch memcpy
+
+le_send_device_name:
+	call store_contr
+	fetch 1,mem_le_name_len
+	add pdata,1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_name_len
+	copy pdata,loopcnt
+	arg mem_le_name,contr
+	branch memcpy
+	
+	
+le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+//le_send_att_read_response_error_insufficient_auth:
+	call le_check_encrypt_state
+	nbranch le_send_att_read_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+
+le_parse_att_read_blob_request:
+	ifetch 2,contr
+	store 2,mem_le_att_offset
+le_send_att_read_blob_response:
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BLOB_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_att_offset
+	iforce rega
+	fetcht 2,mem_le_att_handle
+	call le_att_get_handle_ptr 
+	branch le_send_att_error_response_notfound,blank
+	ifetch 1,contr
+	isub rega,loopcnt
+	nbranch le_send_att_error_response_notfound,positive
+	sub loopcnt,22,null
+	branch le_send_att_read_blob_response_less,positive
+	force 22,loopcnt
+le_send_att_read_blob_response_less:
+	deposit rega
+	iadd contr,contr
+	call memcpy_fast
+	call store_contw
+	branch le_send_auto_len_by_mem
+
+
+le_parse_att_read_by_group_type_request:
+	call le_get_search_handle_start_end_common
+ 	call le_get_search_att_type
+	branch le_send_att_read_by_group_type_response
+	
+//mem_le_search_att_type
+//mem_le_search_handle_start
+//mem_le_search_handle_end
+le_send_att_read_by_group_type_response:
+	arg 2,timeup
+	fetcht 2,mem_le_search_handle_start
+//	arg 23,pdata
+//	isub temp,null
+//	call ice_break,zero
+	storet 2,mem_temp
+	call le_init_attlist_search
+	call le_att_get_handle_ptr2
+	increase -2,contr
+	copy contr,pdata
+	store 2,mem_le_cur_attlist_start_ptr
+le_send_att_read_by_group_type_response_loop:
+	call le_att_check_handle_end
+	nbranch le_send_att_read_by_group_type_end0,positive
+	fetcht 2,mem_temp
+	call le_att_get_handle_info_from_ptr
+	beq 1,le_send_att_read_by_group_type_end1
+
+	call le_att_same_type
+	nbranch le_send_att_read_by_group_type_next_handle,zero
+	copy timeup,pdata
+	beq 0,le_send_att_read_by_group_type_end1
+	nbranch le_send_att_read_by_group_type_store_write_record,user		//un first
+	disable user
+	//first att uuid
+	arg 20,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_READ_BY_GROUP_TYPE_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_curr_att_len
+	increase 4,pdata
+	istore 1,contw
+	call store_contw
+	branch le_send_att_read_by_group_type_store_record
+le_send_att_read_by_group_type_store_write_record:
+	fetch 1,mem_le_curr_att_len
+	beq 16,le_send_att_read_by_group_type_end1
+	fetch 2,mem_temp
+	increase -1,pdata
+	store 2,mem_le_cur_handle_end
+	call le_write_att_record
+le_send_att_read_by_group_type_store_record:
+	fetch 2,mem_temp
+	store 2,mem_le_cur_handle_start
+	call le_store_att_record
+	increase -1,timeup
+//	branch le_send_att_read_by_group_type_last_find,zero		
+le_send_att_read_by_group_type_next_handle:
+	call le_att_next_handle
+	branch le_send_att_read_by_group_type_response_loop
+
+le_send_att_read_by_group_type_end0:	//> att handle end
+	fetch 2,mem_temp
+	store 2,mem_le_cur_handle_end
+	branch le_send_att_read_by_group_type_end_common
+le_send_att_read_by_group_type_end1:	//>att max list handle or diff len 
+	fetch 2,mem_temp
+	increase -1,pdata
+	store 2,mem_le_cur_handle_end
+	branch le_send_att_read_by_group_type_end_common
+le_send_att_read_by_group_type_end_common:
+	branch le_send_att_error_response_notfound,user
+	call le_write_att_record
+	branch le_send_auto_len_by_mem
+
+
+
+
+le_parse_att_write_request:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	call le_writeatt_cb
+le_send_att_write_response_check_auth:
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_WRITE_AUTH,le_send_att_write_response
+	
+	fetcht 2,mem_le_att_handle
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_write_response,zero
+	call le_check_encrypt_state
+	nbranch le_send_att_write_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+le_send_att_write_response:
+	force 1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_WRITE_RESPONSE
+	istore 1,contw
+	rtn
+
+le_check_encrypt_state:
+	call disable_user
+	fetch 1,mem_le_pairing_mode
+	rtneq LE_PAIRING_MODE_NONE
+	fetch 1,mem_context
+	rtnbit1 lestate_encryption
+	branch enable_user
+
+
+le_parse_att_prepare_write_request:
+	add contr,2,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-5,regb
+	call le_writeatt_cb
+	branch le_send_att_prepare_write_response
+
+
+le_send_att_prepare_write_response:
+	fetch 2,mem_le_l2cap_size
+	copy pdata,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_PREPARE_WRITE_RESPONSE
+	istore 1,contw
+	fetch 2,mem_le_att_handle
+	istore 2,contw
+	fetch 2,mem_le_l2cap_size
+	add pdata,-5,loopcnt	
+	fetch 2,mem_le_payload_ptr
+	add pdata,7,contr
+	ifetch 2,contr		//offset
+	istore 2,contw
+	branch memcpy_fast
+
+
+
+le_parse_att_execute_write_request:
+
+le_send_att_execute_write_response:
+	force 1,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_EXECUTE_WRITE_RESPONSE
+	istore 1,contw
+	rtn
+
+
+
+le_parse_att_write_command:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	branch le_writeatt_cb
+
+
+
+//rga:len temp:handle;rgea,regb,regc already used
+le_att_malloc_tx_notify:
+	copy temp,regc
+	increase 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	increase -3,rega
+	setarg ATTOP_HANDLE_VALUE_NOTIFICATION
+	istore 1,contw
+	copy regc,temp
+	istoret 2,contw
+	rtn
+
+//rga:len temp:handle;rgea,regb,regc already used
+le_att_malloc_tx_indication:
+	copy temp,regc
+	increase 3,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	increase -3,rega
+	setarg ATTOP_HANDLE_VALUE_INDICATION
+	istore 1,contw
+	copy regc,temp
+	istoret 2,contw
+	rtn
+
+
+///////////////////////////ATT common function////////////////////////////////////
+
+le_send_att_error_response_notfound:	
+	jam ATT_ERR_ATTRIBUTE_NOT_FOUND,mem_le_err_code
+le_send_att_error_response:	
+	force 5,rega
+	call le_fifo_malloc_tx_l2cap_gatt
+	setarg ATTOP_ERROR_RESPONSE
+	istore 1,contw
+	fetch 1,mem_le_att_opcode
+	istore 1,contw
+	fetch 2,mem_le_att_handle
+	istore 2,contw
+	fetch 1,mem_le_err_code
+	istore 1,contw
+	rtn
+
+
+le_fifo_malloc_tx_l2cap_gatt:
+	force LE_L2CAP_CID_ATT,regb
+	branch le_fifo_malloc_tx_l2cap
+
+
+le_att_next_handle:
+	fetcht 2,mem_temp
+	increase 1,temp
+	storet 2,mem_temp
+	rtn
+
+le_att_check_handle_end:
+	fetcht 2,mem_temp
+	fetch 2,mem_le_search_handle_end
+	isub temp,null
+	rtn
+
+
+le_att_same_type:
+	fetcht 1,mem_le_search_att_type_length
+	arg mem_le_search_att_type,rega
+le_att_check_same_common:
+	fetch 1,mem_le_cur_uuid_length
+	copy pdata,loopcnt
+	isub temp,null
+	nrtn zero
+	arg mem_le_cur_uuid ,regb
+	branch string_compare
+
+le_att_same_uuid:
+	fetcht 1,mem_le_search_uuid_length
+	arg mem_le_search_uuid,rega
+	branch le_att_check_same_common
+
+
+le_store_att_record:
+	fetch 1,mem_le_curr_att_len
+	store 1, mem_tmp_buffer
+	copy pdata,loopcnt
+	call get_contr
+	branch memcpy_fast
+
+
+le_write_att_record:
+	call get_contw
+	fetch 2,mem_le_cur_handle_start
+	istore 2,contw
+	fetch 2,mem_le_cur_handle_end
+	istore 2,contw
+le_write_att_record_common:
+	fetch 1,mem_tmp_buffer
+	copy pdata,loopcnt
+	call memcpy_fast
+	branch store_contw
+
+
+
+le_send_auto_len_by_mem:
+	call get_contw
+	call le_fifo_get_last_att_ptr
+	copy contw,pdata
+	isub contr,rega
+	call le_fifo_get_last_l2cap_ptr
+	copy rega,pdata
+	istore 2,contr
+	increase 4,rega
+	call le_fifo_get_last_tx_ptr
+	copy rega,pdata
+	istore 1,contr
+	rtn
+
+
+le_get_search_handle_start_end_common:
+	rshift8 pdata,pdata
+	store 2,mem_le_search_handle_start
+	ifetch 2,contr
+	store 2,mem_le_search_handle_end
+	rtn
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_signalling.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_signalling.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_signalling.prog	(working copy)
@@ -0,0 +1,54 @@
+
+
+le_parse_signaling:
+	ifetch 1,contr
+	ifetcht 1,contr //id
+	ifetcht 2,contr //length
+	beq L2CAP_CONNECTION_PARAMETER_UPDATE_RESPONSE,le_l2cap_parse_conn_parameter_update_rsp
+	rtn
+le_l2cap_parse_conn_parameter_update_rsp:
+	ifetch 2,contr	//result
+	store 2,mem_le_l2cap_signaling_conn_param_update_rsp_result
+	jam BT_EVT_LE_PARSE_CONN_PAPA_UPDATE_RSP,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+//mem_le_interval_min:the ptr that connection parameter,
+//include 	ConnIntervalMin,ConnIntervalMax,
+//		ConnSlaveLatency,ConnSupervisionTimeout
+le_l2cap_tx_update_req:
+	arg 0x0c,rega
+	arg L2CAP_CONNECTION_PARAMETER_UPDATE_REQUEST,regc
+	call le_fifo_malloc_tx_l2cap_signaling
+	setarg 0x08
+	istore 2,contw
+	fetch 8,mem_le_interval_min
+	istore 8,contw
+	rtn
+
+
+//rega:len regc:signaling opcode
+le_fifo_malloc_tx_l2cap_signaling:
+	call le_l2cap_update_signaling_identifier
+	arg LE_L2CAP_CID_SIGNAL,regb
+	call le_fifo_malloc_tx_l2cap
+	copy regc,pdata
+	istore 1,contw
+	fetch 1,mem_le_signaling_identifier
+	istore 1,contw
+	rtn
+
+
+le_l2cap_update_signaling_identifier:
+	fetch 1,mem_le_signaling_identifier
+	//beq 0xff,le_l2cap_signaling_identifier_set_1
+	pincrease 1
+	store 1,mem_le_signaling_identifier
+	rtnne 0
+	
+le_l2cap_reset_signaling_identifier:
+	jam 1,mem_le_signaling_identifier
+	rtn
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_smp.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_smp.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_l2cap_smp.prog	(working copy)
@@ -0,0 +1,594 @@
+
+le_pairing_mode_init:
+	fetch  1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_NONE, le_set_no_pairing
+	beq LE_PAIRING_MODE_LAGACY_JUSTWORK,le_set_pairing_mode_lagacy_just_work
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,le_set_pairing_mode_lagacy_passkey
+ifdef SECURE_CONNECTION
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,le_set_pairing_mode_secure_justwork
+	beq LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC,le_set_pairing_mode_secure_numeric
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_set_pairing_mode_secure_passkey
+endif
+	rtn
+
+ifdef SECURE_CONNECTION	
+le_set_pairing_mode_secure_justwork:
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch le_set_noinputnooutput
+le_set_pairing_mode_secure_numeric:
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	jam FLAG_IOCAP_DISPLAYYESNO,mem_le_pres_iocap
+	rtn
+le_set_pairing_mode_secure_passkey:	
+	jam FLAG_LE_BONDING_MITM_SECURE,mem_le_pres_auth
+	branch le_set_displayonly
+endif
+le_set_no_pairing:
+	jam FLAG_LE_NO_BONDING_NO_MITM,mem_le_pres_auth
+le_set_noinputnooutput:	
+	jam FLAG_IOCAP_NOINPUTNOOUTPUT,mem_le_pres_iocap
+	rtn
+le_set_pairing_mode_lagacy_just_work:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+	branch le_set_noinputnooutput
+le_set_pairing_mode_lagacy_passkey:
+	jam FLAG_LE_BONDING_MITM,mem_le_pres_auth
+le_set_displayonly:	
+	jam FLAG_IOCAP_DISPLAYONLY,mem_le_pres_iocap
+	rtn
+
+	
+le_secure_connection_enable:
+	fetch 1,mem_le_pres_auth
+	set1 LE_AUTH_SECURE_CONNECTION_PAIRING_BIT,pdata
+	store 1,mem_le_pres_auth
+	rtn
+le_secure_connection_disable:
+	fetch 1,mem_le_pres_auth
+	set0 LE_AUTH_SECURE_CONNECTION_PAIRING_BIT,pdata
+	store 1,mem_le_pres_auth
+	rtn
+
+le_parse_smp:
+	ifetch 1,contr
+	beq SMP_PAIRING_REQUEST,le_parse_smp_pairing_request
+//	beq SMP_PAIRING_RESPONSE,le_parse_smp_pairing_response
+	beq SMP_PAIRING_CONFIRM,le_parse_smp_pairing_confirm
+	beq SMP_PAIRING_RANDOM,le_parse_smp_pairing_random
+	beq SMP_PAIRING_FAILED,le_parse_smp_pairing_failed
+	beq SMP_ENCRYPTION_INFORMATION,le_parse_smp_encryption_information
+	beq SMP_MASTER_IDENTIFICATION,le_parse_smp_master_identification
+	beq SMP_IDENTITY_INFORMATION,le_parse_smp_identity_information
+	beq SMP_IDENTITY_ADDRESS_INFORMATION,le_parse_smp_identity_address_information
+	beq SMP_SIGNING_INFORMATION,le_parse_smp_signing_information
+	beq SMP_SECURITY_REQUEST,le_parse_smp_security_request
+ifdef SECURE_CONNECTION
+	beq SMP_PAIRING_PUBLIC_KEY,le_parse_smp_public_key
+	beq SMP_PAIRING_DHKEY_CHECK,le_parse_smp_dhkey_check
+endif
+	rtn
+
+
+
+le_send_smp_security_request:
+	force 2,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_SECURITY_REQUEST
+	istore 1,contw
+	fetch 1,mem_le_pres_auth
+	istore 1,contw
+	rtn
+		
+le_parse_smp_pairing_request:
+	store 1,mem_le_preq
+	ifetch 6,contr
+	istore 6,contw
+	fetch 1,mem_le_pairing_mode
+	beq  LE_PAIRING_MODE_NONE,le_smp_pairing_fail_reason_not_support_pairing
+	call le_send_smp_pairing_response
+	call le_check_master_support_secure_connect
+	jam FLAG_LE_PAIRING_RCV_PAIRING_REQ,mem_le_pairing_state
+	fetch 1,mem_le_preq_iocap
+	beq  FLAG_IOCAP_DISPlAYONLY,le_set_tk_0
+	beq  FLAG_IOCAP_DISPLAYYESNO,le_set_tk_0
+	beq  FLAG_IOCAP_NOINPUTNOOUTPUT,le_set_tk_0
+	fetch 1,mem_le_pairing_mode	
+	beq LE_PAIRING_MODE_LAGACY_PASSKEY,le_parse_smp_pairing_req_passkey
+	rtneq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY
+le_set_tk_0:
+	arg 0,pdata
+	store 4,mem_le_tk
+	rtn
+
+le_parse_smp_pairing_req_passkey:
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_PASSKEY_FIXED_KEY,le_parse_smp_pairing_req_fixed_passkey
+le_genernate_tk:
+	arg mem_le_tk,rega
+	copy rega,contw
+	arg 3,loopcnt
+	call generate_random_loop
+	fetch 2,mem_le_tk + 2
+	and_into 0x7,pdata
+	store 2,mem_le_tk + 2
+le_parse_smp_pairing_req_fixed_passkey:
+	jam BT_EVT_LE_TK_GENERATE,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_check_master_support_secure_connect:
+	fetch 1,mem_le_preq_auth
+	rtnbit1  LE_AUTH_SECURE_CONNECTION_PAIRING_BIT
+	fetch 1,mem_le_pairing_mode
+	rtnbit0 LE_PAIRING_MODE_SECURE_CONNECT_BIT
+	branch app_ble_disconnect	
+
+le_send_smp_pairing_response:
+	force 7,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	fetch 7,mem_le_pres
+	istore 7,contw
+	rtn
+		
+
+le_parse_smp_pairing_confirm:
+ifdef SECURE_CONNECTION
+	copy contr,rega
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_parse_smp_pairing_confirm_secure_passkey
+	copy rega,contr
+endif
+	arg mem_le_rconfirm,contw
+	call memcpy16
+	branch le_send_smp_pairing_confirm
+ifdef SECURE_CONNECTION
+le_parse_smp_pairing_confirm_secure_passkey:
+	copy rega,contr
+	arg mem_le_rconfirm,contw
+	call memcpy16
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_PASSKEY_WAIT_CONFIRM,mem_le_secure_connect_state	
+	rtn
+endif	
+
+
+le_send_smp_pairing_confirm:
+ifdef SECURE_CONNECTION
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_send_smp_pairing_confirm_sc
+endif
+	call generate_confirm
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_CONFIRM
+	istore 1,contw
+	branch  store_aes_result
+
+	
+ifdef SECURE_CONNECTION
+le_send_smp_pairing_confirm_sc:
+	arg mem_le_srand,contw	
+	call generate_random
+	call function_f4_cb
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_CONFIRM
+	istore 1,contw
+	branch  load_inverse_result
+
+endif
+
+	
+le_parse_smp_pairing_random:	
+ifdef SECURE_CONNECTION
+	copy contr,rega
+	fetch 1,mem_le_pairing_mode
+	bbit1 LE_PAIRING_MODE_SECURE_CONNECT_BIT,le_parse_smp_pairing_random_sc
+	copy rega,contr
+endif
+	call authenticate_rconfirm
+	branch le_parse_smp_pairing_random_success,zero
+le_send_pairing_confirm_value_failed:
+	jam PAIRING_FAILED_CONFIRM_VALUE_FAILED,mem_le_ll_pairing_fail_reason
+le_send_pairing_failed:
+	force 2,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_FAILED
+	istore 1,contw
+	fetch 1,mem_le_ll_pairing_fail_reason
+	istore 1,contw	
+le_parse_smp_pairing_failed:
+	force smp_pairing_timer,queue
+	call timer_stop
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
+	jam BT_EVT_LE_PAIRING_FAIL,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_smp_pairing_fail_reason_not_support_pairing:
+	jam PAIRING_FAILED_PAIRING_NOT_SUPPORTED,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+	
+	
+ifdef SECURE_CONNECTION	
+le_parse_smp_pairing_random_sc:
+	arg mem_le_mrand,contw
+	copy rega,contr
+	call memcpy16	
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_parse_smp_pairing_random_sc_passkey
+	call function_g2
+//	jam LE_SC_STAT_RECEIVE_RANDOM,mem_le_secure_connect_state
+//	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	call le_send_smp_pairing_random
+	fetch 1,mem_le_pairing_mode
+	rtnne LE_PAIRING_MODE_SECURE_CONNECT_NUMERIC
+	jam BT_EVT_LE_GKEY_GENERATE,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+le_parse_smp_pairing_random_sc_passkey:
+	call function_f4_ca
+	arg mem_AES_CMAC_temp,contw
+	call load_inverse_result	
+	arg mem_AES_CMAC_temp,rega
+	arg mem_le_rconfirm ,regb
+	arg 16,loopcnt
+	call string_compare
+	nbranch le_send_pairing_confirm_value_failed,zero
+	branch le_send_smp_pairing_random
+endif
+	
+le_parse_smp_pairing_random_success:
+	call generate_stk
+	jam BT_EVT_LE_PAIRING_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event
+	jam 1,mem_ltk_exists
+	jam FLAG_LE_PAIRING_AFTER_AUTH,mem_le_pairing_state
+	
+le_send_smp_pairing_random:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_RANDOM
+	istore 1,contw
+	arg mem_le_srand,contr
+	branch memcpy16
+	
+le_parse_smp_encryption_information:
+	arg mem_le_peer_ltk,contw
+	branch memcpy16
+
+le_send_smp_encryption_information:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_ENCRYPTION_INFORMATION
+	istore 1,contw
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_PAIRING_FIXED_LTK,le_send_fixed_ltk
+	arg mem_le_ltk,contr
+	branch memcpy16
+
+le_send_fixed_ltk:
+	arg mem_le_fixed_ltk,contr
+	branch memcpy16
+
+
+le_send_smp_master_identification:
+	arg mem_le_ediv,contw
+	force 10,loopcnt
+	call generate_random_loop
+	force 11,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_MASTER_IDENTIFICATION
+	istore 1,contw
+	fetch 2,mem_le_ediv
+	istore 2,contw
+	fetch 8,mem_le_rand
+	istore 8,contw
+	rtn
+
+le_send_smp_identity_information:
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_IDENTITY_INFORMATION
+	istore 1,contw
+	setarg 0
+	istore 8,contw
+	istore 8,contw
+	rtn
+	
+
+le_send_smp_identity_address_information:
+	force 8,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_IDENTITY_ADDRESS_INFORMATION
+	istore 1,contw
+	fetch 1,mem_le_conn_own_addr_type
+	istore 1,contw
+	fetch 6,mem_le_lap	
+	istore 6,contw
+	rtn	
+
+
+le_send_pairing_fail_unspecified_reason:
+	jam PAIRING_FAILED_UNSPECIFIED_REASON,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+
+le_check_init_key_distribution:
+	fetch 1,mem_le_pres_init_key_distribution
+	fetcht 1,mem_le_pres_init_key_distribution
+	iand temp,pdata
+	rtn	
+
+le_parse_smp_identity_information:
+	arg mem_le_irk,contw
+	call memcpy16
+	call le_check_init_key_distribution
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_send_pairing_fail_unspecified_reason,true
+	fetch 1,mem_device_option
+	rtnne dvc_op_module
+	call le_check_master_addr_type
+	nrtn user
+	branch app_ble_store_reconn_info
+
+//output:user is enable ,random addr type
+le_check_master_addr_type:
+	call disable_user
+	fetch 1,mem_le_conn_peer_addr_type
+	rtneq MASTER_PUBLIC_ADDR
+	fetch 1,mem_le_plap+5
+	compare 0xc0,pdata,0xc0
+	rtn true
+	branch enable_user
+
+le_parse_smp_identity_address_information:
+	call le_check_init_key_distribution
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_send_pairing_fail_unspecified_reason,true
+	rtn
+
+le_parse_smp_master_identification:
+le_parse_smp_signing_information:	
+le_parse_smp_security_request:
+	rtn
+	
+ifdef SECURE_CONNECTION
+le_parse_smp_public_key:
+	arg mem_le_pubkey_remote_x_256,contw	
+	call memcpy64
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_RECEIVE_PUBLIC_KEY,mem_le_secure_connect_state
+	rtn
+
+le_parse_smp_dhkey_check:
+	arg mem_sp_confirm_remote,contw
+	call memcpy16	
+	jam LE_SC_STAT_RECEIVE_DHKEY,mem_le_secure_connect_state
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn	
+
+le_send_smp_pairing_public_key:
+	force 65,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_PUBLIC_KEY
+	istore 1,contw	
+	arg mem_le_pubkey_local_x_256,contr
+	branch memcpy64
+	
+le_send_smp_pairing_dhkey_check:
+	call function_f6_eb	
+	force 17,rega
+	call le_fifo_malloc_tx_l2cap_smp
+	setarg SMP_PAIRING_DHKEY_CHECK
+	istore 1,contw
+	branch load_inverse_result
+	
+endif
+
+le_check_paring_time:
+	fetch 1,mem_le_pairing_state
+	rtneq FLAG_LE_PAIRING_END
+	arg FLAG_LE_PAIRING_RCV_PAIRING_REQ,temp
+	isub temp,null
+	nrtn positive
+	arg smp_pairing_timer,queue
+	call timer_check
+	nrtn blank
+	branch le_send_pairing_fail_unspecified_reason
+
+le_pairing_sm:
+	bpatchx patch26_3,mem_patch26
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_NULL,le_pairing_sm_null
+	beq FLAG_LE_PAIRING_START,le_pairing_sm_start
+	beq FLAG_LE_PAIRING_SEND_RECURITY_REQ,le_pairing_sm_send_sec_req
+	beq FLAG_LE_PAIRING_RCV_PAIRING_REQ,le_pairing_sm_rcv_pairing_req
+	beq FLAG_LE_PAIRING_AFTER_AUTH,le_pairing_sm_after_auth
+	beq FLAG_LE_PARING_SEND_ENC_INFORMATION,le_pairng_sm_send_enc_information
+	beq FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,le_pairng_sm_send_master_indentification
+	beq FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,le_pairng_sm_send_indentity_information
+	rtn
+
+le_pairing_sm_null:
+le_pairing_sm_send_sec_req:
+	fetch 1,mem_le_enc_state
+	rtnne FLAG_LE_SEND_START_ENC_RSP
+	jam FLAG_LE_ENC_END,mem_le_enc_state
+	jam FLAG_LE_PAIRING_END,mem_le_pairing_state
+	jam BT_EVT_LE_RECONNECT_COMPLETE ,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+	
+le_pairing_sm_start:
+	jam FLAG_LE_PAIRING_SEND_RECURITY_REQ,mem_le_pairing_state
+	branch le_send_smp_security_request
+
+le_pairing_sm_rcv_pairing_req:
+	jam FLAG_LE_PAIRING_AUTH,mem_le_pairing_state
+	setarg TIMER_SMP_PAIRING_TIMEOUT
+	arg smp_pairing_timer,queue
+	branch timer_init
+	
+le_pairing_sm_after_auth:
+	fetch 1,mem_le_enc_state
+	beq FLAG_LE_SEND_START_ENC_RSP,le_pairing_sm_after_auth_start_enc
+	rtn
+	
+le_pairing_sm_after_auth_start_enc:
+	jam FLAG_LE_PARING_SEND_ENC_INFORMATION,mem_le_pairing_state
+	jam BT_EVT_LE_ENC_INFO,mem_fifo_temp
+	call ui_ipc_send_event
+	call le_send_smp_encryption_information
+	fetch 1,mem_device_option
+	rtnne dvc_op_module
+	call le_check_master_addr_type
+	rtn user
+	branch app_ble_store_reconn_info
+
+
+le_pairng_sm_send_enc_information:	
+	jam FLAG_LE_PARING_SEND_MASTER_IDENTIFICATION,mem_le_pairing_state
+	branch le_send_smp_master_identification
+
+le_pairng_sm_send_master_indentification:	
+	fetch 1,mem_le_preq_resp_key_distribution
+	fetcht 1,mem_le_pres_resp_key_distribution
+	iand temp,pdata
+	isolate0 LE_INITATOR_IRK_BIT,pdata
+	branch le_parse_start_enc_rsp_after_auth_end,true
+	jam FLAG_LE_PARING_SEND_INDENTITY_INFORMATION,mem_le_pairing_state
+	branch le_send_smp_identity_information
+
+le_pairng_sm_send_indentity_information:		
+	call le_send_smp_identity_address_information
+	branch le_parse_start_enc_rsp_after_auth_end
+
+
+le_parse_start_enc_rsp_after_auth_end:
+	force smp_pairing_timer,queue
+	call timer_stop
+	jam FLAG_LE_ENC_END,mem_le_enc_state
+	jam FLAG_LE_PAIRING_END,mem_le_pairing_state
+	jam BT_EVT_LE_PAIRING_COMPLETE ,mem_fifo_temp
+	branch ui_ipc_send_event	
+	
+
+ifdef SECURE_CONNECTION
+
+le_secure_connect_sm:
+	bpatchx patch26_4,mem_patch26
+	fetch 1,mem_le_pairing_mode
+	rtnbit0 LE_PAIRING_MODE_SECURE_CONNECT_BIT
+	fetch 1,mem_le_secure_connect_flag
+	rtnne LE_SP_FLAG_COMMIT_256
+	jam SP_FLAG_STANDBY,mem_le_secure_connect_flag
+	fetch    1,mem_le_secure_connect_state
+	beq  LE_SC_STAT_RECEIVE_PUBLIC_KEY,le_sc_sm_receive_public_key
+	beq LE_SC_STAT_WAIT_SEND_PUBLIC_KEY,le_sc_sm_wait_send_public_key
+	beq LE_SC_STAT_SEND_PUBLIC_KEY,le_sc_sm_send_public_key
+	beq LE_SC_STAT_RECEIVE_DHKEY,le_sc_sm_receive_dhkey
+	beq LE_SC_STAT_WAIT_CONFIRM_GKEY,le_sc_sm_wait_confirm_gkey
+	beq  LE_SC_STAT_PASSKEY_WAIT_CONFIRM,le_sc_sm_passkey_wait_confirm
+	rtn	
+
+
+le_sc_sm_passkey_wait_confirm:
+	fetch 1,mem_authentication_passkey_times
+	copy pdata,queue
+	increase 1,pdata
+	store 1,mem_authentication_passkey_times
+	fetch 4,mem_le_tk
+	qisolate1 pdata
+	setarg 0x80
+	setflag true,0,pdata
+	store 1,mem_passkey_1bit
+	branch le_sc_sm_ready_send_pairing_confirm
+	
+le_sc_sm_wait_confirm_gkey:
+	fetch 1,mem_le_sc_confirm_gkey_flag
+	jam FLAG_LE_SC_CONFRIM_NULL,mem_le_sc_confirm_gkey_flag
+	beq FLAG_LE_SC_CONFRIM_GKEY_OK,le_sc_confirm_gkey_ok
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn
+	
+le_sc_confirm_gkey_ok:
+	jam BT_EVT_LE_PAIRING_SUCCESS,mem_fifo_temp
+	call ui_ipc_send_event	
+	jam FLAG_LE_PAIRING_AFTER_AUTH,mem_le_pairing_state
+	branch le_send_smp_pairing_dhkey_check
+
+le_sc_sm_receive_dhkey:
+	fetch 1,mem_sp_dhkey_invalid
+	beq SP_KEY_VALID_256,le_dhkey_ready
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn
+
+le_dhkey_ready:
+	call function_f5
+//	arg mem_le_r,contw
+//	force 2,loopcnt
+//	call memset0
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY ,le_dhkey_ready_common
+	call le_set_tk_0 
+le_dhkey_ready_common:
+	call function_f6_ea
+	arg mem_AES_CMAC_temp,rega
+	arg mem_sp_confirm_remote ,regb
+	arg 16,loopcnt
+	call string_compare
+	branch le_dhkey_check_ok,zero
+le_dhkey_check_fail:	
+	jam PAIRING_FAILED_DHKEY_CHECK_FAILED,mem_le_ll_pairing_fail_reason
+	branch le_send_pairing_failed
+
+	
+le_dhkey_check_ok:
+	call sp_calc_check_publickey_256
+	nbranch le_dhkey_check_fail,zero
+	jam 1,mem_ltk_exists
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_JUSTWORK,le_sc_confirm_gkey_ok
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY ,le_sc_confirm_gkey_ok	
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_WAIT_CONFIRM_GKEY,mem_le_secure_connect_state	
+	rtn	
+
+le_sc_sm_send_public_key:
+	fetch 1,mem_le_pairing_mode
+	beq LE_PAIRING_MODE_SECURE_CONNECT_PASSKEY,le_sc_sm_send_public_key_passkey
+	jam 0,mem_passkey_1bit
+le_sc_sm_ready_send_pairing_confirm:
+	branch le_send_smp_pairing_confirm
+
+le_sc_sm_send_public_key_passkey:
+//	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+//	jam LE_SC_STAT_PASSKEY_WAIT_CONFIRM,mem_le_secure_connect_state	
+//	branch p_ng_event_le_get_passkey
+	jam 0,mem_authentication_passkey_times
+	branch le_parse_smp_pairing_req_passkey
+
+	
+le_sc_sm_receive_public_key:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	fetch 1,mem_le_sc_local_key_invalid
+	beq SP_KEY_VALID_256,le_public_key_ready
+//	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	rtn
+	
+le_public_key_ready:
+	jam LE_SC_STAT_WAIT_SEND_PUBLIC_KEY,mem_le_secure_connect_state	
+	jam SP_KEY_INVALID,mem_sp_dhkey_invalid
+	branch sp_dhkey_calc_256	
+
+le_sc_sm_wait_send_public_key:
+	jam LE_SP_FLAG_COMMIT_256,mem_le_secure_connect_flag
+	jam LE_SC_STAT_SEND_PUBLIC_KEY,mem_le_secure_connect_state
+	branch le_send_smp_pairing_public_key
+
+endif
+
+
+le_fifo_malloc_tx_l2cap_smp:
+	force LE_L2CAP_CID_SMP,regb
+	branch le_fifo_malloc_tx_l2cap
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_ll.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_ll.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/le_ll.prog	(working copy)
@@ -0,0 +1,213 @@
+
+le_parse_ll:
+	bpatchx patch26_5,mem_patch26
+	fetch 1,mem_le_rxbuf+2
+	beq LL_CONNECTION_UPDATE_REQ,le_parse_connection_update_req
+	beq LL_CHANNEL_MAP_REQ,le_parse_channel_map_req
+	beq LL_TERMINATE_IND,le_parse_terminate_ind
+	beq LL_ENC_REQ,le_parse_enc_req
+	beq LL_ENC_RSP,le_parse_enc_rsp
+	beq LL_START_ENC_REQ,le_parse_start_enc_req
+	beq LL_START_ENC_RSP,le_parse_start_enc_rsp
+	beq LL_UNKNOWN_RSP,le_parse_unknown_rsp
+	beq LL_FEATURE_REQ,le_parse_feature_req
+	beq LL_FEATURE_RSP,le_parse_feature_rsp
+	beq LL_PAUSE_ENC_REQ,le_parse_pause_enc_req
+	beq LL_PAUSE_ENC_RSP,le_parse_pause_enc_rsp
+	beq LL_VERSION_IND,le_parse_version_ind
+	beq LL_REJECT_IND,le_parse_reject_ind
+	beq LL_PING_REQ,le_parse_ping_req
+	beq LL_PING_RSP,le_parse_ping_rsp
+	arg 2,rega
+	arg LL_UNKNOWN_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 1,mem_le_rxbuf+2
+	istore 1,contw
+	rtn	
+
+
+le_parse_connection_update_req:
+	ifetch 9,contr
+	store 9,mem_le_new_param
+	ifetch 2,contr
+	store 2,mem_le_instant
+	fetch 1,mem_le_state
+	set1 lestate_update_param,pdata
+	store 1,mem_le_state
+	rtn
+
+le_parse_channel_map_req:
+	ifetch 5,contr
+	store 5,mem_le_new_map
+	ifetch 2,contr
+	store 2,mem_le_instant
+	fetcht 2,mem_le_event_count
+	isub temp,null
+	nbranch le_parse_terminate_ind,positive
+	fetch 1,mem_le_state
+	set1 lestate_update_map,pdata
+	store 1,mem_le_state
+	rtn
+
+
+le_parse_terminate_ind:
+	setarg 20 // 200ms
+	store 2,mem_le_superto
+	store 2,mem_le_init_superto
+	rtn
+
+le_send_terminate_ind_user_terminated:
+	arg ERROR_REMOTE_USER_TERMINATED_CONNECTION,regc
+
+//regc:The ErrorCode field shall be set to inform the remote device why the connection is about to be terminated.
+le_send_terminate_ind:
+	arg 2,rega
+	arg LL_TERMINATE_IND,regb
+	call le_fifo_malloc_tx_ll
+	copy regc,pdata
+	istore 1,contw
+	rtn
+
+le_parse_feature_req:
+
+le_send_feature_rsp:
+	arg 9,rega
+	arg LL_FEATURE_RSP,regb
+	call le_fifo_malloc_tx_ll
+	setarg param_le_features
+	istore 8,contw
+	rtn
+
+
+le_parse_version_ind:
+	rtn master
+le_send_version_ind:
+	arg 6,rega
+	arg LL_VERSION_IND,regb
+	call le_fifo_malloc_tx_ll
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	rtn
+
+
+le_parse_ping_req:
+	arg LL_PING_RSP,regb
+	branch le_send_ll_one_lenth
+
+//regb:ll opcode
+le_send_ll_one_lenth:
+	arg 1,rega
+	branch le_fifo_malloc_tx_ll
+
+	
+le_parse_enc_req:
+	ifetch 8,contr
+	store 8,mem_le_rand
+	ifetch 2,contr
+	store 2,mem_le_ediv
+	ifetch 8,contr
+	store 8,mem_le_skdm
+	ifetch 4,contr
+	store 4,mem_le_ivm
+	call le_send_enc_rsp
+	bpatchx patch26_6,mem_patch26
+	fetch 1,mem_le_pairing_state
+	beq FLAG_LE_PAIRING_AFTER_AUTH,le_parse_enc_req_after_auth
+	fetch 1,mem_le_configuration
+	bbit1  BIT_BLE_PAIRING_FIXED_LTK,le_parse_enc_req_fixed_ltk
+	fetch 1,mem_nv_data_number
+	ncall load_device_list_mode_4,blank
+	fetch 1,mem_ltk_exists
+	beq 0,le_ltk_lost
+le_parse_enc_req_after_auth:
+	jam FLAG_LE_RCV_ENC_START,mem_le_enc_state
+	call  le_send_start_enc_req
+	branch generate_sk
+
+le_parse_enc_req_fixed_ltk:
+	jam 1,mem_ltk_exists
+	arg mem_le_fixed_ltk,contr
+	arg mem_le_ltk,contw
+	call memcpy16
+	branch le_parse_enc_req_after_auth
+
+
+le_ltk_lost:
+	bpatchx patch26_7,mem_patch26
+	jam FLAG_LE_ENC_NULL,mem_le_enc_state
+	jam FLAG_LE_ENC_NULL,mem_le_pairing_state
+	jam BT_EVT_LE_LTK_LOST,mem_fifo_temp
+	branch ui_ipc_send_event
+
+le_send_reject_ind:
+	arg 2,rega
+	arg LL_REJECT_IND,regb
+	call le_fifo_malloc_tx_ll
+	setarg LE_ERR_PIN_OR_KEY_MISSING
+	istore 1,contw
+	rtn		
+	
+le_send_enc_rsp:
+	arg mem_le_skds,contw
+	force 8,loopcnt
+	call generate_random_loop
+	arg mem_le_ivs,contw
+	force 4,loopcnt
+	call generate_random_loop
+	arg 13,rega
+	arg LL_ENC_RSP,regb
+	call le_fifo_malloc_tx_ll
+	fetch 8,mem_le_skds
+	istore 8,contw
+	fetch 4,mem_le_ivs
+	istore 4,contw
+	rtn
+
+le_send_start_enc_req:
+	arg LL_START_ENC_REQ,regb
+	branch le_send_ll_one_lenth
+
+le_send_start_enc_rsp:
+	arg LL_START_ENC_RSP,regb
+	branch le_send_ll_one_lenth
+	
+	
+le_parse_enc_rsp:
+	ifetch 8,contr
+	store 8,mem_le_skds
+	ifetch 4,contr
+	store 4,mem_le_ivs
+	branch generate_sk
+	
+le_parse_start_enc_req:
+	fetch 1,mem_le_state
+	set1 lestate_encryption,pdata
+	store 1,mem_le_state
+	rtn
+	
+le_parse_start_enc_rsp:
+	rtn master
+	jam BT_EVT_LE_START_ENC,mem_fifo_temp
+	call ui_ipc_send_event	
+	jam FLAG_LE_SEND_START_ENC_RSP,mem_le_enc_state
+	branch le_send_start_enc_rsp
+	
+le_parse_pause_enc_req:
+	jam FLAG_LE_ENC_PAUSE,mem_le_enc_state
+	call le_send_pause_enc_rsp	
+	jam BT_EVT_LE_PAUSE_ENC,mem_fifo_temp
+	branch ui_ipc_send_event	
+
+le_send_pause_enc_rsp:
+	arg LL_PAUSE_ENC_RSP,regb
+	branch le_send_ll_one_lenth	
+			
+
+le_parse_feature_rsp:
+le_parse_unknown_rsp:
+le_parse_pause_enc_rsp:
+le_parse_reject_ind:
+le_parse_ping_rsp:
+	rtn
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/lmp.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/lmp.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/lmp.prog	(working copy)
@@ -0,0 +1,2522 @@
+	
+/******************************************/
+/*************   LMP Parse   **************/
+/******************************************/
+init_lmp:
+	rtn wake
+init_lmp_work:
+	bpatchx patch27_0,mem_patch27
+	setarg 0
+	store 1,mem_lmp_to_send
+	store 1,mem_conn_sm
+	store 1,mem_lmo_opcode1
+	store 1,mem_lmo_opcode2
+	store 1,mem_esco_addr
+	store 1,mem_auth_enable
+	store 1,mem_connection_options
+	store 1,mem_pairing_auth
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	jam 0,mem_switch_fail_master_count
+	jam NULL_ENCRYP,mem_wait_encryption
+init_lmp_reinit:	
+	jam 0,mem_pairing_auth
+	jam 0,mem_sp_localsm
+	jam 0,mem_lmp_conn_state
+	//fall through
+parse_rx_done:
+	rtn
+
+parse_lmp:
+	bpatchx patch27_1,mem_patch27
+	call setlocalsm_master,master	//use this flag in hci
+	ncall setlocalsm_slave,master
+	call lmo_fifo_check
+	nrtn blank
+	fetch 1,mem_state_map
+	rtnbit0 smap_rxlmp
+	set0 smap_rxlmp,pdata
+	set0 mark_rxbuf_inuse,mark
+	store 1,mem_state_map
+	fetch 1,mem_rxbuf
+	fetcht 1,mem_state_map
+	isolate1 smap_lmptidinit,pdata
+	setflag true,smap_lmptid,temp
+	storet 1,mem_state_map
+	and_into 0x2,temp //smap_lmptid only
+	storet 1,mem_lmo_tid2
+	fetcht 1,mem_state_map
+	rshift pdata,pdata			/* align lmp_opcode */
+  	store 1,mem_lmi_opcode2
+	bpatchx patch27_2,mem_patch27
+  	fetch 1,mem_lmi_opcode2
+  	beq LMP_ESCAPE,parse_lmp_escape//multi
+  	beq LMP_ACCEPTED,parse_lmp_accepted//multi
+	beq LMP_NOT_ACCEPTED,parse_lmp_not_accepted//multi
+  	beq LMP_SET_AFH, parse_lmp_set_afh
+  	beq LMP_CLKOFFSET_REQ, parse_lmp_clkoffset_req
+ 	beq LMP_ENCRYPTION_MODE_REQ, parse_lmp_encryption_mode_req
+ 	beq LMP_ENCRYPTION_KEY_SIZE_REQ,parse_lmp_crypt_key
+	beq LMP_AUTO_RATE,parse_lmp_auto_rate
+	beq LMP_TEST_CONTROL,parse_lmp_test_control//multi
+	beq LMP_TEST_ACTIVATE,parse_lmp_test_activate
+	beq LMP_SETUP_COMPLETE,parse_lmp_setup_complete
+	beq LMP_SUPERVISION_TIMEOUT,parse_lmp_supervision_timeout
+	beq LMP_FEATURES_REQ,parse_lmp_features_req
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_conn_req
+	beq LMP_VERSION_REQ,parse_lmp_version_req
+	beq LMP_VERSION_RES,parse_lmp_version_res
+	beq LMP_DETACH,parse_lmp_detach
+	beq LMP_MAX_SLOT,parse_lmp_max_slot
+	beq LMP_MAX_SLOT_REQ,parse_lmp_max_slot_req
+	beq LMP_NAME_REQ,parse_lmp_name_req
+	beq LMP_NAME_RES,parse_lmp_name_res
+	beq LMP_FEATURES_RES,parse_lmp_features_res
+	beq LMP_COMB_KEY,parse_lmp_comb_key
+	beq LMP_AU_RAND, parse_lmp_au_rand
+	beq LMP_IN_RAND,parse_lmp_in_rand
+	beq LMP_SRES,parse_lmp_sres
+	beq LMP_INCR_POWER_REQ,parse_lmp_incr_power
+	beq LMP_DECR_POWER_REQ,parse_lmp_decr_power
+	beq LMP_MAX_POWER, parse_lmp_max_power
+	beq LMP_MIN_POWER, parse_lmp_min_power
+	beq LMP_PAGE_MODE_REQ, parse_lmp_page_mode_req
+	beq LMP_PAGE_SCAN_MODE_REQ, parse_lmp_page_scan_mode_req
+	beq LMP_PREFERRED_RATE, parse_lmp_preferred_rate
+	beq LMP_SLOT_OFFSET, parse_lmp_slot_offset
+	beq LMP_SNIFF_REQ, parse_lmp_sniff_req
+	beq LMP_START_ENCRYPTION_REQ, parse_lmp_start_encryption_req
+	beq LMP_STOP_ENCRYPTION_REQ, parse_lmp_stop_encryption_req
+	beq LMP_SWITCH_REQ, parse_lmp_switch_req
+	beq LMP_TEMP_RAND, parse_lmp_temp_rand
+	beq LMP_TEMP_KEY, parse_lmp_temp_key
+	beq LMP_TIMING_ACCURACY_REQ, parse_lmp_timing_accuracy_req
+	beq LMP_TIMING_ACCURACY_RES, parse_lmp_timing_accuracy_res
+	beq LMP_UNIT_KEY, parse_lmp_unit_key
+	beq LMP_UNSNIFF_REQ, parse_lmp_unsniff_req
+	beq LMP_USE_SEMI_PERMANENT_KEY, parse_lmp_use_semi_permanend_key
+	beq  LMP_ENCAPSULATED_HEADER,parse_lmp_encapsulated_header
+	beq  LMP_ENCAPSULATED_PAYLOAD,parse_lmp_encapsulated_payload
+	beq	LMP_SIMPLE_PAIRING_CONFIRM,parse_simple_pairing_confirm
+	beq  LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_simple_pairing_number
+	beq  LMP_DHKEY_CHECK,parse_dhkey_check
+	beq LMP_CLKOFFSET_RES, parse_lmp_clkoffset_res
+	beq LMP_ENC_KEY_SIZE_MASK_REQ,parse_enc_key_size_mask_req
+/* lmp is not recognized, check to see if we respond to all messages */ 
+/* rejecting the unrecognized message with PDU not recognized */
+reject_unknown_packet:
+	jam UNKNOWN_LMP_PDU,mem_lmo_reason2
+reject_lmp_packet:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	rtn
+
+parse_lmp_clkoffset_req:
+	jam LMP_CLKOFFSET_RES,mem_lmo_opcode2
+	rtn	
+
+parse_enc_key_size_mask_req:
+	jam LMP_ENC_KEY_SIZE_MASK_RES,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_set_afh:
+	fetch 4,mem_rxbuf+1
+	lshift pdata,pdata
+	store 4,mem_afh_instant
+	fetch 1,mem_rxbuf+5
+	store 1,mem_afh_new_mod
+	fetch 5,mem_rxbuf+6
+	store 5,mem_afh_map_new
+	fetch 5,mem_rxbuf+11
+	istore 5,contw
+	fetch 1,mem_mode
+	set1 afh_change,pdata
+	store 1,mem_mode
+	rtn
+parse_lmp_escape:
+	bpatchx patch27_3,mem_patch27
+	fetch 1,mem_rxbuf+1
+	set1 7,pdata
+	store 1,mem_lmi_opcode2
+	beq LMP_EXT_ACCEPTED,parse_lmpext_accepted
+	beq LMP_NOT_ACCEPTED_EXT,parse_lmpext_not_accepted
+	beq LMP_SNIFF_SUBRATING_REQ, parse_lmp_sniff_subrating_req
+	beq LMP_SNIFF_SUBRATING_RES, parse_lmp_sniff_subrating_res
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_packet_type_table_req
+	beq LMP_EXT_FEATURES_REQ,parse_lmpext_features_req
+	beq LMP_EXT_FEATURES_RES,parse_lmpext_features_res
+	beq LMP_EXT_CHN_CLASSIFICATION_REQ,parse_lmpext_chn_classification_req
+	beq LMP_PAUSE_ENCRYPTION_REQ,parse_lmpext_pause_encrypt
+	beq LMP_RESUME_ENCRYPTION_REQ,parse_lmpext_resume_encrypt
+	beq LMP_IO_CAP_REQ,parse_lmpext_iocap_req
+	beq LMP_IO_CAP_RES,parse_lmpext_iocap_res
+	rtneq LMP_EXT_FEATURES_RES
+
+
+reject_unknown_ext_packet:
+	jam LMP_NOT_ACCEPTED_EXT,mem_lmo_opcode2
+	jam UNKNOWN_LMP_PDU,mem_lmo_reason2
+	
+	rtn
+parse_lmpext_chn_classification_req:
+	jam LMP_NOT_ACCEPTED_EXT,mem_lmo_opcode2
+	jam NOT_SUPPORT_CHN_CLASSIFICATION,mem_lmo_reason2
+	rtn
+	
+parse_lmpext_iocap_req:
+	call iocap_lmpext_load
+	jam LMP_IO_CAP_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmpext_iocap_res:
+	call iocap_lmpext_load
+	branch iocap_lmpext_common
+	
+iocap_lmpext_load:
+	arg      mem_sp_iocap_remote,contw
+	fetch 3, mem_rxbuf+2
+	istore    3,contw
+	rtn
+	
+iocap_lmpext_common:
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag,true//is un very ok to use master flag,but we have to add many codes if wo don't
+endif
+	rtn
+parse_lmpext_accepted:
+	fetch 1,mem_rxbuf+3
+	set1 7,pdata
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_accepted_ptt
+	rtn
+
+	
+parse_lmpext_not_accepted:
+	fetch 1,mem_rxbuf+3
+	set1 7,pdata
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_PACKET_TYPE_TABLE_REQ,parse_lmpext_not_accepted_ptt
+	rtn
+
+parse_lmpext_accepted_ptt:
+	fetch 1,mem_ptt
+	fetcht 1,mem_state_map
+	nsetflag blank,smap_edr,temp
+	storet 1,mem_state_map
+parse_lmpext_not_accepted_ptt:
+	fetch 1,mem_state
+	rtnbit0 state_init_seq
+	set0 state_init_seq,pdata
+	store 1,mem_state
+	fetch 1,mem_auth_enable
+	nrtn blank
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn
+
+parse_lmpext_pause_encrypt:
+	nbranch parse_lmpext_pause_encrypt_slave, master
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	branch tid_reply
+
+parse_lmpext_pause_encrypt_slave:	
+	jam LMP_PAUSE_ENCRYPTION_REQ, mem_lmo_opcode2
+	rtn
+
+parse_lmpext_resume_encrypt:
+//trans file to pc may cause pause/resume encrypt
+//if ms is conn_sm_wait_end the controllor won't send ack after recieved start_encypt_accept
+	call tid_reply
+	branch lmp_start_encryption
+
+parse_lmpext_features_req:
+	jam LMP_EXT_FEATURES_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmpext_features_res:
+	fetcht 1,mem_rxbuf+4
+	and temp,0x1,temp
+	storet 1,mem_remote_sppcap
+	fetch 1,mem_hci_cmd
+	bne hci_cmd_wait_remote_ext_feature,parse_lmpext_features_res_not_hci
+	jam 0,mem_hci_cmd
+parse_lmpext_features_res_not_hci:
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_WAIT_FEATURES_EXT
+	jam CONN_SM_SEND_CONN_REQ,mem_conn_sm
+	branch process_conn_sm
+
+parse_lmp_accepted:
+	bpatchx patch27_4,mem_patch27
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_accepted_hostconn//ok
+	beq LMP_IN_RAND,parse_lmp_accepted_inrand//ok
+	beq LMP_ENCRYPTION_MODE_REQ,parse_lmp_accepted_enc_mode//ok
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,parse_lmp_accepted_enc_keysize//ok
+	beq LMP_START_ENCRYPTION_REQ,parse_lmp_accepted_start_enc//ok
+	beq LMP_STOP_ENCRYPTION_REQ,parse_lmp_accepted_stop_enc//ok
+	beq LMP_UNSNIFF_REQ,parse_lmp_accepted_unsniff_req//ok
+	beq LMP_SNIFF_REQ,parse_lmp_accepted_sniff_req//ok
+	beq LMP_SWITCH_REQ,parse_lmp_accepted_switch
+	// simple pairing 
+	beq LMP_ENCAPSULATED_HEADER,parse_lmp_accepted_encapsulated_header//ok
+	beq LMP_ENCAPSULATED_PAYLOAD,parse_lmp_accepted_encapsulated_payload//ok
+	beq LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_accepted_simple_pairing_number//ok
+	beq LMP_DHKEY_CHECK,parse_lmp_accepted_dhkey_check//ok
+	rtn
+	
+parse_lmp_not_accepted:
+	bpatchx patch27_5,mem_patch27
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_NAME_REQ,parse_lmp_not_accepted_name_req//ok
+	beq LMP_HOST_CONNECTION_REQ,parse_lmp_not_accepted_hostconn//ok
+	beq LMP_AU_RAND,parse_lmp_not_accepted_aurand//ok
+	beq LMP_IN_RAND,parse_lmp_not_accepted_inrand//ok
+	beq LMP_SWITCH_REQ,parse_lmp_not_accepted_switch//ok
+	/* simple pairing support */
+	beq  LMP_SIMPLE_PAIRING_NUMBER,parse_lmp_not_accepted_simple_pairing_number//ok
+	beq  LMP_DHKEY_CHECK,parse_lmp_not_accepted_dhkey_check//ok
+	beq LMP_UNSNIFF_REQ,parse_lmp_not_accepted_unsniff_req
+	beq LMP_SNIFF_REQ,parse_lmp_not_acdcept_sniff_req
+	rtn
+
+parse_lmp_accepted_switch:
+	jam BT_EVT_SWITCH_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	branch role_switch_prepare0
+parse_lmp_not_accepted_switch:
+	jam BT_EVT_SWITCH_NOT_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	jam SWITCH_FLAG_NOT_ACCEPT,mem_switch_flag
+	setarg TIMER_SWITCH_WAITE
+	arg switch_wait_timer,queue
+	branch timer_init
+
+
+parse_lmp_accepted_hostconn:
+	//fetch 1,mem_state
+	//rtnbit0 state_init_seq
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//nbranch parse_lmp_accepted_hostconn_ctn,master
+parse_lmp_accepted_hostconn_ctn:
+	/* checking to see if we requested host connection */
+	fetch 1,mem_conn_sm
+	bne CONN_SM_WAIT_CONN_ACCEPT, parse_rx_done
+	//branch parse_lmp_accepted_hostconn_master,master
+	/* continuing on with host connection state machine */
+	jam CONN_SM_AUTH_PAIR,mem_conn_sm
+	rtn
+	//branch host_create_conn_auth_pair
+
+	/* we need to move fast and send au_rand...jumping to next part of state machine for conn */
+//parse_lmp_accepted_hostconn_master:
+	//jam CONN_SM_AUTH_PAIR ,mem_conn_sm
+//	rtn
+
+parse_lmp_not_accepted_hostconn:
+	jam ACL_CONNECTION_ALREADY_EXISTS,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	/* clearing connection state machine */
+	jam CONN_SM_STANDBY,mem_conn_sm
+	/* sending error message to host */
+	branch parse_rx_done,true
+	rtn
+
+parse_lmp_accepted_inrand:
+	fetch 1,mem_link_key_exists
+	nrtn blank
+	call clear_linkkey
+	call  lmp_generate_key
+	rtn master
+	set1 mark_slave_in_rand_accepted,mark
+	rtn
+
+parse_lmp_accepted_enc_mode:
+	nrtn master
+	jam LMP_ENCRYPTION_KEY_SIZE_REQ,mem_lmo_opcode2
+	fetch 1,mem_state_map
+	rtnbit0 smap_encryption
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	rtn
+
+parse_lmp_accepted_enc_keysize:
+	branch lmp_start_encryption
+	
+parse_lmp_accepted_start_enc:
+	call send_create_conn_start_l2cap_timer_sm
+	fetch 1,mem_state
+	rtnbit1 state_conn_comp
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_ENCRYPT_WAIT
+	jam CONN_SM_ENCRYPT_WAIT_CLEAR,mem_conn_sm
+	rtn
+	
+parse_lmp_accepted_stop_enc:
+	/* again this won't work with multipoint. keep track of anyone else encrypting */
+	//jam HOST_STOP_ENCRYPTION,message_queue_B0
+	//jam 1,message_queue_B1
+	//jam HOST_RETURN_SUCCESS,message_queue_B2
+	//fetch 1,mem_lmp_state2
+	//set1 MESSAGE_QUEUE,pdata
+	//store 1,mem_lmp_state2
+	rtn
+
+parse_lmp_not_accepted_aurand:	
+parse_lmp_not_accepted_aurand_send_detach:	
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam OTHER_END_TERMINATED,mem_disconn_reason_send
+	rtn
+/*in pair remote cancel the pair*/
+parse_lmp_not_accepted_inrand:
+	fetch 1,mem_rxbuf+2
+	beq KEY_MISSING,parse_lmp_inrand_key_missing
+	rtnne PAIRING_NOT_ALLOWED
+	jam PAIRING_NOT_ALLOWED,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	rtn	
+parse_lmp_inrand_key_missing:
+	jam KEY_MISSING,mem_disconn_reason_send
+	jam LMP_DETACH,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_not_accepted_name_req:
+	rtn
+	
+parse_lmp_not_accepted_simple_pairing_number:
+	jam      SP_STAT_NULL,mem_sp_state
+	jam LMP_DETACH,mem_lmo_opcode2
+	branch   parse_rx_done
+	
+parse_lmp_not_accepted_dhkey_check:
+ifdef LMP_DBG
+	call ice_break
+endif
+	jam      SP_STAT_NULL,mem_sp_state
+	jam LMP_DETACH,mem_lmo_opcode2
+	branch   parse_rx_done
+parse_lmp_not_accepted_unsniff_req:
+	jam BT_EVT_UNSNIFF_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+parse_lmp_accepted_unsniff_req:
+	jam BT_EVT_UNSNIFF_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	branch sniff_exit
+	
+parse_lmp_accepted_sniff_req:
+	jam BT_EVT_SNIFF_ACCEPT,mem_fifo_temp
+	call ui_ipc_send_event
+	setarg 0
+	store 2,mem_dsniff
+	fetch 2,mem_sniff_param_interval
+	lshift pdata,pdata
+	store 2,mem_tsniff
+	fetch 1,mem_sniff_param_attempt
+	store 1,mem_sniff_attempt
+	fetch 1,mem_sniff_param_timeout
+	store 1,mem_sniff_timeout
+	branch sniff_init
+	
+parse_lmp_not_acdcept_sniff_req:
+	jam BT_EVT_SNIFF_NOT_ACCEPT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+parse_lmp_crypt_key:
+	fetcht 1,mem_rxbuf+1
+	storet 1,mem_key_size
+	branch accept_lmp_msg
+	
+parse_lmp_setup_complete:
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_SETUP_COMPLETE,pdata
+	store 1,mem_lmp_conn_state
+	rtnbit1 SENT_SETUP_COMPLETE
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	branch parse_rx_done
+	
+parse_lmp_max_slot:
+	//jam LMP_MAX_SLOT,mem_lmi_opcode2
+	//branch accept_lmp_msg
+	rtn
+	
+parse_lmp_max_slot_req:
+	fetch 1,mem_max_slot
+	fetcht 1,mem_rxbuf+1
+	isub temp,null
+	//jam LMP_MAX_SLOT_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg,positive
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam UNSPECIFIED_ERROR,mem_lmo_reason2
+	jam LMP_MAX_SLOT_REQ,mem_lmi_opcode2
+	rtn
+	
+parse_lmp_detach:
+	call prepare_disconnect
+	branch accept_lmp_msg
+	
+accept_lmp_msg:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	rtn
+
+parse_lmp_incr_power:
+	jam LMP_MAX_POWER,mem_lmo_opcode2
+	rtn
+
+parse_lmp_decr_power:
+	jam LMP_MIN_POWER,mem_lmo_opcode2
+	rtn
+	
+parse_lmp_version_res:
+	fetch 1,mem_conn_sm
+	rtneq CONN_SM_WAIT_VERSION
+	/* continuing on with host connection state machine */
+	jam CONN_SM_SEND_FEATURES ,mem_conn_sm
+	/* we need to move fast and send au_rand...jumping to next part of state machine for conn */
+	rtn
+
+
+parse_lmp_auto_rate:
+	rtn	
+
+parse_lmp_in_rand:
+	call lmp_copy_rand
+	jam pincode_state_wait_pincode,mem_pincode_state
+	jam BT_EVT_PINCODE_REQ,mem_fifo_temp
+	call ui_ipc_send_event
+
+	call tid_check
+	nbranch lmp_accept_inrand,true
+	//fetch 1,mem_auth_enable
+	nbranch parse_lmp_inrand_res,master // ignore this because of not ssp temporary
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam LMP_IN_RAND,mem_lmi_opcode2
+	jam TRANSACTION_COLLISION,mem_lmo_reason2
+	rtn
+parse_lmp_inrand_res:
+	fetch 1,mem_op
+	set1 op_inrand_req,pdata
+	store 1,mem_op
+	rtn
+
+//store current tid
+pop_tid_follow:
+	fetcht 1,mem_state_map
+	nsetflag blank,smap_lmptid,temp
+	storet 1,mem_state_map
+	rtn
+	
+//restore current tid
+push_tid_follow:
+	fetch 1,mem_lmo_tid2
+	rshift pdata,pdata
+	and_into 1,pdata
+	rtn
+
+parse_lmp_au_rand_moudle:
+	fetch 1,mem_nv_data_number
+	rtn blank
+	fetch 1,mem_pairing_auth
+	call load_device_list,blank
+	rtn	
+
+parse_lmp_au_rand:
+	call parse_lmp_au_rand_moudle
+	call push_tid_follow
+	store 1,mem_sres_tid
+	call lmp_copy_rand
+	jam LMP_SRES,mem_lmo_opcode2
+	fetch 1,mem_link_key_exists
+	nrtn blank
+	fetch 1,mem_state
+	rtnbit1 state_combkey		/* we have comb key, but not verified */
+	jam KEY_MISSING,mem_lmo_reason2
+	branch reject_lmp_packet
+
+parse_lmp_sres:	
+	arg mem_plap,rega
+	call function_e1
+	fetch 4,mem_rxbuf+1
+	fetcht 4,mem_input_store
+	isub temp,null
+	branch authentication_ok,zero
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam AUTHENTICATION_FAILURE_ERROR,mem_disconn_reason_send	
+	rtn
+authentication_ok:
+	call authentication_ok_common
+	fetch 1,mem_ssp_enable
+	branch  pairing_success,blank
+	rtn
+
+	
+authentication_ok_common:
+	call copy_aco
+	call linkkey_ready///save link key
+	fetch 1,mem_op
+	isolate1 op_auth_req,pdata
+	set0 op_auth_req,pdata
+	store 1,mem_op
+	fetch 1,mem_conn_sm
+	beq CONN_SM_AUTH_WAIT,authentication_ok_conn_sm
+	beq CONN_SM_PAIRING_WAIT,authentication_ok_conn_sm
+	rtn
+authentication_ok_conn_sm:
+	fetch 1,mem_pairing_auth
+	rtnne DEFALT_PAIRING_AUTH
+	fetch 1,mem_state_map
+	rtnbit1 smap_encryption
+	branch host_create_conn_encrypt
+
+parse_lmp_comb_key:
+	arg mem_rxbuf+1,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg mem_plap,rega
+	call generate_linkkey
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	fetch 1,mem_state
+	bbit0 state_combkey,lmp_generate_key
+	rtn
+	
+parse_lmp_name_res:
+	fetch 2,mem_len
+	add pdata,-3,loopcnt	//for remote name length error
+	fetcht 1,mem_rxbuf+1
+	setarg mem_tmp_buffer
+	iadd temp,contw
+	arg mem_rxbuf+3,contr
+	call memcpy
+	fetcht 1,mem_name_offset
+	fetch 1,mem_rxbuf+2
+	isub temp,pdata
+	sub pdata,14,null
+	branch parse_lmp_name_res_end,positive
+	add temp,14,pdata
+	store 1,mem_name_offset
+	jam LMP_NAME_REQ,mem_lmo_opcode2
+	rtn
+parse_lmp_name_res_end:
+	fetch 1,mem_state_map
+	set1 smap_name_res,pdata
+	store 1,mem_state_map
+	bbit1 smap_name_req,lmp_disconnect
+	rtn
+parse_lmp_name_req:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_opcode2 //offset 
+	jam LMP_NAME_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_conn_req:
+	branch accept_lmp_msg
+
+parse_lmp_timing_accuracy_req:
+	jam LMP_TIMING_ACCURACY_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_features_req:
+	jam LMP_FEATURES_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_version_req:
+	jam LMP_VERSION_RES,mem_lmo_opcode2
+	rtn
+
+parse_lmp_supervision_timeout:
+//	fetch 2,mem_rxbuf+1
+//	store 2,mem_supervision_to
+	rtn
+	
+
+
+parse_lmp_sniff_subrating_req:
+	fetch 2,mem_tsniff
+	iforce temp
+	fetch 1,mem_rxbuf+2
+	store 1,mem_subsniff_rate
+	imul32 temp,temp
+	fetch 2,mem_rxbuf+3
+	lshift pdata,pdata
+	store 2,mem_subsniff_tcmax
+	fetch 4,mem_rxbuf+5
+	lshift pdata,pdata
+ 	store 4,mem_subsniff_instant
+	//product pdata
+	deposit temp
+	store 2,mem_subsniff_tsniff
+	rtn
+parse_lmpext_packet_type_table_req:
+	fetcht 1,mem_ptt
+	fetch 1,mem_rxbuf+2
+	ixor temp,null
+	nbranch reject_unknown_ext_packet,zero
+	isolate1 0,pdata
+	fetch 1,mem_state_map
+	setflag true,smap_edr,pdata
+	store 1,mem_state_map
+	jam LMP_EXT_ACCEPTED,mem_lmo_opcode2
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmi_opcode2
+	rtn
+
+	
+parse_lmp_sniff_subrating_res:
+parse_lmp_preferred_rate:
+parse_lmp_max_power:
+parse_lmp_min_power:
+	rtn
+parse_lmp_page_mode_req:
+	//jam LMP_PAGE_MODE_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg
+parse_lmp_page_scan_mode_req:
+	//this can influence connection. need accepted
+	//jam LMP_PAGE_SCAN_MODE_REQ,mem_lmi_opcode2
+	branch accept_lmp_msg
+
+
+	
+parse_lmp_slot_offset:
+	fetch 2,mem_rxbuf+1
+	store 2,mem_slot_offset
+	rtn
+
+parse_lmp_sniff_req_check_sniff_para:
+	fetch 2,mem_rxbuf+4 /* tsniff */
+	fetcht 1,mem_lpm_mult
+	imul32 temp,pdata
+	arg 0x640,temp
+	isub temp,null
+//	branch lmp_reject_sniff,positive
+	rtn
+	
+parse_lmp_sniff_req:
+	branch lmp_reject_sniff
+	fetch 2,mem_rxbuf+6
+	branch lmp_reject_sniff,blank
+	call parse_lmp_sniff_req_check_sniff_para
+	branch lmp_reject_sniff,positive
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_module,null
+	call module_set_lpm_mult_2,zero
+	fetch 1,mem_state
+	bbit1 state_insniff,lmp_reject_sniff
+	fetch 2,mem_rxbuf+2 /* dsniff */
+	lshift pdata,pdata
+	store 2,mem_dsniff	
+	fetch 2,mem_rxbuf+4 /* tsniff */
+	lshift pdata,pdata
+	store 2,mem_tsniff
+	fetch 2,mem_rxbuf+6 /* sniff attempt */
+	store 1,mem_sniff_attempt
+	iforce temp
+	fetch 2,mem_rxbuf+8 /* sniff timeout */
+	store 1,mem_sniff_timeout
+	isub temp,null
+	nbranch set_big_value_to_attempt,positive
+	store 1,mem_sniff_attempt
+set_big_value_to_attempt:	
+	//call sniff_init
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_SNIFF_REQ,mem_lmi_opcode2
+	rtn
+
+lmp_reject_sniff:
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+parse_lmp_start_encryption_req:
+	call accept_lmp_msg
+	call lmp_copy_rand
+	call function_e3
+	branch start_encryption
+	
+parse_lmp_stop_encryption_req:
+	call accept_lmp_msg
+	branch stop_encryption
+	
+
+parse_lmp_switch_req:
+	fetch 4,mem_rxbuf+1
+	lshift pdata,pdata
+	//branch parse_lmp_switch_req_not_accept
+	branch parse_lmp_switch_accept,master
+	fetcht 1,mem_link_key_exists
+	nbranch parse_lmp_switch_req_clear_mark,blank
+parse_lmp_switch_req_not_accept:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam LMP_SWITCH_REQ,mem_lmi_opcode2
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	rtn
+parse_lmp_switch_req_clear_mark:
+	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	jam 0,mem_conn_sm
+	branch role_switch_prepare
+
+parse_lmp_switch_accept:
+	call role_switch_prepare
+	set1 mark_reconn_recieve_switch,mark
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	branch accept_lmp_msg
+
+	
+
+parse_lmp_temp_rand:
+parse_lmp_temp_key:
+parse_lmp_timing_accuracy_res:	
+parse_lmp_unit_key:	
+parse_lmp_use_semi_permanend_key:
+	rtn
+
+	
+parse_lmp_unsniff_req:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_UNSNIFF_REQ,mem_lmi_opcode2
+	jam BT_EVT_REMOTE_UNSNIFF,mem_fifo_temp
+	call ui_ipc_send_event
+	branch sniff_exit
+	
+parse_lmp_encapsulated_header:
+	fetch 1,mem_rxbuf+1
+	bne ENCAPSULATED_MAJOR_TYPE_P192,parse_lmp_encapsulated_header_reject
+	fetch 1,mem_rxbuf+2
+	bne ENCAPSULATED_MINOR_TYPE_P192,parse_lmp_encapsulated_header_reject
+	fetch 1,mem_rxbuf+3
+	bne ENCAPSULATED_LEN_P192,parse_lmp_encapsulated_header_reject
+	call check_localsm
+	branch parse_lmp_encapsulated_header_master,true
+	jam SP_STAT_KEY_RECV,mem_sp_state
+parse_lmp_encapsulated_header_master:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_ENCAPSULATED_HEADER,mem_lmi_opcode2
+	branch parse_rx_done
+	
+parse_lmp_encapsulated_header_reject:
+	jam      PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch   reject_lmp_packet
+	
+parse_lmp_accepted_encapsulated_header:
+	//jam LMP_ENCAPSULATED_PAYLOAD,mem_lmi_opcode2
+	//branch   accept_lmp_msg  	
+	jam LMP_ENCAPSULATED_PAYLOAD,mem_lmo_opcode2
+      //   branch   accept_lmp_msg  	
+         rtn
+parse_lmp_accepted_simple_pairing_number:
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_SSP_PIN_FLAG,parse_lmp_accepted_simple_pairing_number_ssp_pin
+	beq SSP_MODE_PASSKEY_ENTRY_FLAG,parse_lmp_accepted_simple_pairing_number_passkey
+parse_lmp_accepted_simple_pairing_number_common:
+	call check_localsm
+	rtn true
+	jam SP_STAT_CONFIRM_RECV,mem_sp_state
+	rtn
+
+parse_lmp_accepted_simple_pairing_number_ssp_pin:
+	call g_noninit_number_confirm
+	jam BT_EVT_BT_GKEY_GENERATE,mem_fifo_temp
+	call ui_ipc_send_event
+	branch parse_lmp_accepted_simple_pairing_number_common
+
+
+parse_lmp_accepted_simple_pairing_number_passkey:
+	call check_localsm
+	rtn true
+	fetch 1,mem_authentication_passkey_times
+	beq 19,authentication_passkey_end
+	increase 1,pdata
+	store 1,mem_authentication_passkey_times
+//	branch p_authentication_passkey
+
+authentication_passkey:
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	jam      SP_STAT_COMMIT_CALC,mem_sp_state 
+	fetch 1,mem_authentication_passkey_times
+	copy pdata,queue
+	fetch 6,mem_pin
+	qisolate1 pdata
+	setarg 0x80
+	setflag true,0,pdata
+	store 1,mem_passkey_1bit
+	rtn
+
+authentication_passkey_end:	
+	jam SP_STAT_CONFIRM_RECV,mem_sp_state
+	rtn
+
+parse_lmp_accepted_dhkey_check:
+	call parse_lmp_accepted_dhkey_check_common
+pairing_success:
+	fetch 1,mem_flag_pairing_state
+	rtn blank
+	jam FLAG_PAIRING_STATE_NOT_PAIRING,mem_flag_pairing_state
+	jam BT_EVT_BT_PAIRING_SUCCESS,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+parse_lmp_accepted_dhkey_check_common:
+	//here must be change***  shyd
+	call check_localsm
+ifdef SIMPLE_PAIRING
+	ncall g_noninit,true	//when be master  call g_init
+	call g_init,true
+endif
+	call check_localsm
+	rtn true
+	jam SP_STAT_LINK_KEY_CALC,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+
+parse_simple_pairing_confirm:
+	arg mem_sp_confirm_remote,contw
+	arg mem_rxbuf+1,contr
+	call memcpy16
+	fetch 1,mem_ssp_mode_flag
+	rtneq  SSP_MODE_PASSKEY_ENTRY_FLAG
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag
+endif
+	
+parse_lmp_encapsulated_payload:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_RANDOM_SEND,parse_encapsulated_payload_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_KEY_RECV,parse_lmp_encapsulated_payload_reject
+parse_encapsulated_payload_master:
+	fetch    1,mem_sp_remote_key_recv_count
+	sub      pdata,0x20,contw
+	nbranch  parse_lmp_encapsulated_payload_reject,positive
+	arg      mem_sp_pubkey_remote,contw
+	iadd     contw,contw
+	fetch 8,mem_rxbuf+1
+	istore   8,contw
+	fetch 8,mem_rxbuf+9
+	istore   8,contw
+	fetch    1,mem_sp_remote_key_recv_count
+	increase 16,pdata
+	store    1,mem_sp_remote_key_recv_count
+	bne ENCAPSULATED_LEN_P192,accept_lmp_msg
+parse_lmp_encapsulated_payload_completed:
+	call check_localsm
+	branch accept_lmp_msg,true
+	jam      SP_KEY_VALID,mem_sp_remote_key_invalid
+	jam      SP_STAT_KEY_GENERATE,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag  
+	branch   accept_lmp_msg
+parse_lmp_encapsulated_payload_reject:
+	jam      PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch   reject_lmp_packet	
+parse_lmp_accepted_encapsulated_payload: 
+	fetch 1,mem_sp_local_key_send_count
+	beq	ENCAPSULATED_LEN_P192,parse_lmp_encapsulated_payload_all_accepted
+	jam LMP_ENCAPSULATED_PAYLOAD,mem_lmo_opcode2
+	branch   parse_rx_done 
+	
+parse_lmp_encapsulated_payload_all_accepted:   
+	call check_localsm
+	branch parse_lmp_encapsulated_payload_all_accepted_master,true
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_PASSKEY_ENTRY_FLAG,parse_lmp_encapsulated_payload_all_accepted_get_passkey
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	jam      SP_STAT_COMMIT_CALC,mem_sp_state 
+	branch   parse_rx_done
+
+parse_lmp_encapsulated_payload_all_accepted_get_passkey:
+	jam BT_EVT_BT_GET_PASSKEY,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+parse_lmp_encapsulated_payload_all_accepted_master:
+	//call sp_master_generate_local_key
+	branch   parse_rx_done   
+
+parse_lmp_simple_pairing_number:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_RANDOM_SEND,parse_lmp_simple_pairing_number_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_RANDOM_RECV,parse_lmp_simple_pairing_number_reject
+parse_lmp_simple_pairing_number_master:
+	arg      mem_sp_random_remote,contw
+	fetch 8,mem_rxbuf+1
+	istore   8,contw
+	fetch 8,mem_rxbuf+9
+	istore   8,contw
+	call check_localsm
+	branch parse_lmp_simple_pairing_number_master0,true
+	jam      SP_STAT_RANDOM_SEND,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	branch accept_lmp_msg  
+parse_lmp_simple_pairing_number_master0:
+	jam SP_STAT_COMMIT_CALC,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	branch master_set_mem_master_sp_flag
+endif
+	//jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmi_opcode2
+	//branch accept_lmp_msg  
+parse_lmp_simple_pairing_number_reject:
+	jam      PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+	
+parse_dhkey_check:
+	fetch    1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_SEND,parse_dhkey_check_master
+	fetch    1,mem_sp_state
+	bne SP_STAT_CONFIRM_RECV,parse_lmp_dhkey_check_reject
+parse_dhkey_check_master:
+	arg      mem_sp_check_result,contw
+	arg mem_rxbuf+1,contr
+	call memcpy16
+	call check_localsm
+	branch parse_dhkey_check_master0,true
+	fetch 1,mem_ssp_mode_flag
+	beq SSP_MODE_SSP_PIN_FLAG,number_comparison_mode
+number_comparison_successed:
+	jam 0,mem_flag_mode_ssp_pin
+	jam SP_STAT_CONFIRM_CHECK,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch   parse_rx_done
+	
+parse_dhkey_check_master0:
+	jam      SP_STAT_CONFIRM_CHECK,mem_master_sp_state
+	jam      SP_FLAG_COMMIT,mem_master_sp_flag
+	branch   parse_rx_done
+parse_lmp_dhkey_check_reject:
+	jam      PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+number_comparison_mode:
+	fetch 1,mem_flag_mode_ssp_pin
+	bbit1 FLAG_MODE_SSP_PIN_REVICEVE_COMPARISON_BIT ,comparison_result
+	set1 FLAG_MODE_SSP_PIN_RECIEVE_DHKEY_BIT,pdata
+	store 1,mem_flag_mode_ssp_pin
+	rtn
+	
+comparison_result:
+	bbit1 FLAG_MODE_SSP_PIN_COMPARISON_RESULT_BIT,number_comparison_successed
+	jam 0,mem_flag_mode_ssp_pin
+	branch parse_lmp_dhkey_check_reject
+
+	
+parse_lmp_clkoffset_res:
+	branch parse_rx_done
+		
+parse_lmp_encryption_mode_req:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_ENCRYPT
+	store 1,mem_connection_options
+	call accept_lmp_msg
+	nrtn master					/* do sth only if we're master */
+	fetch 1,mem_rxbuf+1
+	fetcht 1,mem_op
+	setflag blank,op_stop_enc,temp
+	nsetflag blank,op_start_enc,temp
+	storet 1,mem_op
+	rtn 
+	
+parse_lmp_features_res:
+	fetcht 8,mem_rxbuf+1		/*fix bcp(baoshijie) err*/
+parse_lmp_features_res_not_hci:	
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_WAIT_FEATURES_RES
+
+	fetch 1,mem_connection_options
+	bbit0 CONNECTION_FEATURE_EXT,parse_lmp_send_conn
+
+	jam CONN_SM_SEND_FEATURES_EXT,mem_conn_sm
+	rtn
+parse_lmp_send_conn:
+	jam CONN_SM_SEND_CONN_REQ,mem_conn_sm
+	rtn
+parse_lmp_test_activate:
+	fetch 1,mem_debug_config
+	store 1,mem_test_mode_old_debug_config
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_TEST_ACTIVATE,mem_lmi_opcode2
+	rtn
+parse_lmp_test_control:
+	/* the 9 test control parameters are XORed with 0x55 */
+	/* doing the XOR here and storing in mem_temp_payload */
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_TEST_CONTROL,mem_lmi_opcode2
+	force 9,loopcnt
+	arg mem_rxbuf+1,contr
+	arg mem_temp_payload,contw
+parse_lmp_test_xor:
+	ifetch 1,contr
+	xor_into 0x55,pdata
+	istore 1,contw
+	loop parse_lmp_test_xor
+	fetch 1,test_mode_scenario
+	fetcht 1,mem_tester_emulate
+	set0 tester_no_whitening,temp
+	set0 tester_pattern_test,temp
+	beq EXIT_TEST_MODE,	 parse_lmp_test_control_exit
+	beq PAUSE_TEST_MODE,	 parse_lmp_test_control_pause
+	beq CLOSED_LOOP_BACK_ACL,	 parse_lmp_test_control_loopback
+	beq ACL_WITHOUT_WHITENING,	 parse_lmp_test_control_loopback_nowhite
+	beq CLOSED_LOOP_BACK_SCO,	 parse_lmp_test_control_loopback
+	beq SCO_WITHOUT_WHITENING,	 parse_lmp_test_control_loopback_nowhite
+	beq ZERO_PATTERN,	 parse_lmp_test_control_pattern
+	beq ONE_PATTERN,	 parse_lmp_test_control_pattern
+	beq ALT_PATTERN,	 parse_lmp_test_control_pattern
+	beq ALT2_PATTERN,	 parse_lmp_test_control_pattern
+	beq PSEUDORANDOM,	 parse_lmp_test_control_pattern
+	rtn
+parse_lmp_test_control_exit:
+	/* restoring old parameters */
+	fetch 1,mem_tester_emulate
+	set1 tester_exit,pdata
+	set1 tester_change,pdata
+	store 1,mem_tester_emulate
+	rtn
+parse_lmp_test_control_pattern:
+	set1 tester_pattern_test,temp
+	jam 5,mem_lch_code
+	fetch 2,test_mode_data_length
+	iforce loopcnt
+	store 2,mem_len
+	arg mem_rxbuf,contw
+	call pn9
+parse_lmp_test_control_loopback_nowhite:
+	set1 tester_no_whitening,temp
+parse_lmp_test_control_loopback:
+	set1 tester_change,temp
+	force 0,pdata
+	store 1,mem_slave_rcvcnt
+	store 2,mem_tst_pktcnt_crc
+	store 2,mem_tst_pktcnt_dmh
+	store 2,mem_tst_pktcnt_hec
+	store 2,mem_tst_pktcnt_sync
+	fetch 1,test_mode_hopping_mode
+	compare FIXED_FREQ,pdata,0xff
+	setflag true,tester_fixed_freq,temp
+	storet 1,mem_tester_emulate
+	rtn
+
+parse_lmp_test_control_pause:
+	set0 mark_testmode,mark
+	jam 0,mem_tester_emulate
+	fetch 1,mem_debug_config
+	set0 debug_tx_pattern,pdata
+	store 1,mem_debug_config
+	rtn
+
+
+	
+	
+
+lmp_copy_rand:	
+	arg mem_rxbuf+1,contr
+	arg mem_random_number,contw
+	branch memcpy16
+
+lmp_generate_key:
+	jam LMP_COMB_KEY,mem_lmo_opcode2
+	rtn
+
+lmp_start_encryption:
+	nrtn master
+	jam LMP_START_ENCRYPTION_REQ,mem_lmo_opcode2
+	rtn
+	
+lmp_accept_inrand:
+	arg mem_lap,rega
+	call generate_kinit
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_IN_RAND,mem_lmi_opcode2
+	rtn
+
+lmp_disconnect:
+	jam 10,mem_conn_timer
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam LOCAL_HOST,mem_disconn_reason_send	
+	rtn
+
+/*********************************/
+/*********lmp send*************/
+/********************************/
+	/* enable user if a lmp packet is to send */
+send_lmp:
+	bpatchx patch27_6,mem_patch27
+	disable user
+	call lmo_fifo_process
+	fetch 1,mem_lmp_to_send
+	rtn blank
+/* lmp message to be processed. this will either be because host??? */
+/* wants to send a lmp message or because one resulted from the LMP */
+/* processing section */
+/********* outgoing lmp lookup table *************/
+	bbit1 7,send_lmp_escape
+send_lmp0:
+	beq LMP_NAME_REQ,	 send_lmp_name_req
+	beq LMP_NAME_RES,	 send_lmp_name_res
+	beq LMP_ACCEPTED,	 send_lmp_accepted
+	beq LMP_NOT_ACCEPTED,	 send_lmp_not_accepted
+	beq LMP_FEATURES_REQ,	 send_lmp_features_req
+	beq LMP_FEATURES_RES,	 send_lmp_features_res
+	beq LMP_TIMING_ACCURACY_RES,	 send_lmp_timing_accuracy_res
+	beq LMP_VERSION_REQ,	 send_lmp_version_req
+	beq LMP_VERSION_RES,	 send_lmp_version_res
+	beq LMP_SETUP_COMPLETE,	 send_lmp_setup_complete
+	beq LMP_SUPERVISION_TIMEOUT,	 send_lmp_superto
+	beq LMP_HOST_CONNECTION_REQ,send_lmp_no_payload
+	beq LMP_IN_RAND,send_lmp_inrand
+	beq LMP_COMB_KEY,send_lmp_comb_key
+	beq LMP_AU_RAND,send_lmp_aurand
+	beq LMP_SRES,send_lmp_sres
+	beq LMP_ENCRYPTION_MODE_REQ,send_lmp_encryption_mode_req
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,send_lmp_encryption_key_size_req
+	beq LMP_START_ENCRYPTION_REQ,send_lmp_start_encryption
+	beq LMP_DETACH,send_lmp_detach
+	beq LMP_QUALITY_OF_SERVICE_REQ, send_lmp_quality_of_service_req
+	beq LMP_UNIT_KEY,send_lmp_unit_key
+	//Optional (O)
+	beq LMP_INCR_POWER_REQ,send_lmp_inc_power	
+	beq LMP_CLKOFFSET_RES, send_lmp_clkoffset_res	
+	beq LMP_MAX_POWER,send_lmp_nopayload_reply
+	beq LMP_MAX_SLOT, send_lmp_max_slot
+	beq LMP_MAX_SLOT_REQ, send_lmp_max_slot_req
+	beq LMP_MIN_POWER,send_lmp_nopayload_reply
+	beq LMP_SLOT_OFFSET, send_lmp_slot_offset
+	beq LMP_SWITCH_REQ, send_lmp_switch_req
+	beq LMP_SNIFF_REQ, send_lmp_sniff_req
+	beq LMP_STOP_ENCRYPTION_REQ, send_lmp_stop_encryption_req	
+	beq LMP_TIMING_ACCURACY_REQ, send_lmp_timing_accuracy_req
+	beq LMP_UNSNIFF_REQ, send_lmp_unsniff_req
+	beq LMP_ENCAPSULATED_HEADER,send_lmp_encapsulated_header
+	beq LMP_ENCAPSULATED_PAYLOAD,send_lmp_encapsulated_payload
+	beq LMP_SIMPLE_PAIRING_CONFIRM,send_lmp_simple_pairing_comfirm
+	beq LMP_SIMPLE_PAIRING_NUMBER,send_lmp_simple_pairing_number
+	beq LMP_DHKEY_CHECK,send_lmp_dhkey_check
+	beq LMP_AUTO_RATE,send_lmp_auto_rate
+	beq LMP_ENC_KEY_SIZE_MASK_RES,send_lmp_enc_key_size_mask_res
+	//master only must(M)
+	beq LMP_CLKOFFSET_REQ, send_lmp_clkoffset_req
+	beq LMP_QUALITY_OF_SERVICE, send_lmp_quality_of_service
+	beq LMP_TEST_ACTIVATE, send_lmp_test_activate
+	beq LMP_TEST_CONTROL, send_lmp_test_control
+send_lmp_error:
+	branch assert
+	rtn
+send_lmp_escape:
+	beq LMP_EXT_ACCEPTED,send_lmpext_accepted
+	beq LMP_EXT_FEATURES_RES,send_lmpext_features_res
+	beq LMP_NOT_ACCEPTED_EXT,send_lmpext_not_accepted
+	beq LMP_EXT_FEATURES_REQ,send_lmpext_features_req
+	beq LMP_PACKET_TYPE_TABLE_REQ,send_lmpext_packet_type_table_req
+	beq LMP_PAUSE_ENCRYPTION_REQ,send_lmpext_pause_encryption_req
+	beq LMP_IO_CAP_REQ,send_lmp_io_cap_req
+         beq LMP_IO_CAP_RES,send_lmpext_io_cap_res
+         beq LMP_SNIFF_SUBRATING_REQ,send_lmpext_sniff_subrating_req
+         beq LMP_SNIFF_SUBRATING_RES,send_lmpext_sniff_subrating_res
+	branch assert
+
+
+/******** LMP follow messages **********/
+/****** TID follow received packet  *******/
+
+send_lmp_accepted:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode
+	istore 1,contw
+	call send_lmp_follow
+	bpatchx patch27_7,mem_patch27
+	fetch 1,mem_lmi_opcode
+	beq LMP_IN_RAND,send_lmp_accepted_inrand
+	beq LMP_ENCRYPTION_MODE_REQ,send_lmp_accepted_enc_mode
+	beq LMP_ENCRYPTION_KEY_SIZE_REQ,send_lmp_accepted_enc_key
+	beq LMP_SNIFF_REQ,send_lmp_accept_sniff_req
+	beq LMP_HOST_CONNECTION_REQ,send_lmp_accepted_connection
+	beq LMP_DHKEY_CHECK,send_lmp_accept_dhkey_check
+	beq LMP_START_ENCRYPTION_REQ,send_create_conn_start_l2cap_timer_sm  
+	rtn	
+	
+send_create_conn_start_l2cap_timer_sm:
+	fetch 1,mem_conn_sm
+	rtn blank
+	jam CONN_SM_WAIT_DONE,mem_conn_sm
+	setarg TIMER_ENPT_WAITE
+	arg enpt_delay_timer,queue
+	branch timer_init
+	
+send_lmp_accept_sniff_req:
+	branch sniff_init
+send_lmp_not_accepted:
+	force 3,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode
+	beq LMP_AU_RAND,send_not_accept_aurand
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	branch send_lmp_follow
+
+send_not_accept_aurand:
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	arg mem_sres_tid,temp
+	branch special_tid_store
+
+send_lmpext_accepted:	
+	force 4,queue
+	call send_lmpext
+	setarg LMP_ESCAPE
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	set0 7,pdata
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	branch send_lmp_follow
+
+send_lmpext_not_accepted:
+	force 5,queue
+	call send_lmpext
+	setarg LMP_ESCAPE
+	istore 1,contw
+	fetch 1,mem_lmi_opcode
+	set0 7,pdata
+	istore 1,contw
+	fetch 1,mem_lmo_reason
+	istore 1,contw
+	branch send_lmp_follow
+	
+
+send_lmp_accepted_inrand:
+	call clear_linkkey
+	call tid_check	
+	rtn true
+	branch lmp_generate_key
+
+send_lmp_accepted_enc_mode:
+	fetch 1,mem_op
+	bbit1 op_start_enc,send_lmp_accepted_enc_start
+	rtnbit0 op_stop_enc
+	jam LMP_STOP_ENCRYPTION_REQ,mem_lmo_opcode2
+	set0 op_stop_enc,pdata
+	call tid_reply
+	branch send_lmp_accepted_enc_exit
+send_lmp_accepted_enc_start:
+	jam LMP_ENCRYPTION_KEY_SIZE_REQ,mem_lmo_opcode2
+	set0 op_start_enc,pdata
+send_lmp_accepted_enc_exit:
+	store 1,mem_op
+	rtn
+
+send_lmp_accepted_enc_key:
+	call check_localsm
+	branch lmp_start_encryption,true
+	rtn
+
+send_lmp_accepted_connection:
+	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+send_lmp_accept_dhkey_check:
+	rtn
+/******** LMP reply messages **********/
+/****** TID always set to remote  *******/
+
+send_lmpext_features_res:
+	force 12,queue
+	call send_lmpext
+	setarg 0x01
+	istore 1,contw
+	fetch 2,mem_lmpext_ssp_enable
+	istore 2,contw
+	setarg 0
+	istore 3,contw
+	setarg 0x00
+	istore 4,contw
+	branch send_lmp_reply
+send_lmpext_io_cap_res:     
+	force 5,queue
+         call send_lmpext
+       	fetch 3,mem_sp_iocap_local
+         istore 3,contw
+	call send_lmp_reply
+	jam FLAG_PAIRING_STATE_PAIRING,mem_flag_pairing_state
+	fetch 1,mem_sp_iocap_local
+	beq DISPLAY_YESNO,responder_iocap_display_yesno
+	beq KEYBOARD_ONLY,responder_iocap_keyboard_only
+	beq NO_INPUT_NO_OUTPUT,responder_iocap_no_input_no_output
+	rtn
+
+responder_iocap_keyboard_only:
+	fetch 1,mem_sp_iocap_remote
+	beq DISPLAY_ONLY,responder_iocap_keyboard_only_initiator_iocap_display_only
+	beq DISPLAY_YESNO,responder_iocap_keyboard_only_initiator_iocap_display_yesno
+	beq KEYBOARD_ONLY,responder_iocap_keyboard_only_initiator_iocap_keyboard_only
+	beq NO_INPUT_NO_OUTPUT,responder_iocap_keyboard_only_initiator_iocap_no_input_no_output
+	rtn
+
+
+responder_iocap_display_yesno:
+	fetch 1,mem_sp_iocap_remote
+	beq DISPLAY_ONLY,responder_iocap_display_yesno_initiator_iocap_display_only
+	beq DISPLAY_YESNO,responder_iocap_display_yesno_initiator_iocap_display_yesno
+	beq KEYBOARD_ONLY,responder_iocap_display_yesno_initiator_iocap_keyboard_only
+	beq NO_INPUT_NO_OUTPUT,responder_iocap_display_yesno_initiator_iocap_no_input_no_output
+	rtn
+
+	
+responder_iocap_no_input_no_output:
+	fetch 1,mem_sp_iocap_remote
+	beq DISPLAY_ONLY,responder_iocap_no_input_no_output_initiator_iocap_display_only
+	beq DISPLAY_YESNO,responder_iocap_no_input_no_output_initiator_iocap_display_yesno
+	beq KEYBOARD_ONLY,responder_iocap_no_input_no_output_initiator_iocap_keyboard_only
+	beq NO_INPUT_NO_OUTPUT,responder_iocap_no_input_no_output_initiator_iocap_no_input_no_output
+	rtn
+
+responder_iocap_keyboard_only_initiator_iocap_no_input_no_output:
+responder_iocap_display_yesno_initiator_iocap_no_input_no_output:
+responder_iocap_display_yesno_initiator_iocap_display_only:
+responder_iocap_no_input_no_output_initiator_iocap_display_only:
+responder_iocap_no_input_no_output_initiator_iocap_display_yesno:
+responder_iocap_no_input_no_output_initiator_iocap_keyboard_only:
+responder_iocap_no_input_no_output_initiator_iocap_no_input_no_output:
+set_ssp_mode_justwork: 
+	jam SSP_MODE_JUST_WORK_FLAG,mem_ssp_mode_flag
+	fetch 1,mem_classic_bt_flag
+	bbit1 FLAG_SSP_REJECT_JUSTWORK,app_bt_disconnect
+	rtn
+
+responder_iocap_display_yesno_initiator_iocap_display_yesno:
+set_ssp_mode_numeric_comparison: 
+	jam SSP_MODE_SSP_PIN_FLAG,mem_ssp_mode_flag
+	rtn
+
+responder_iocap_keyboard_only_initiator_iocap_display_yesno:
+responder_iocap_keyboard_only_initiator_iocap_keyboard_only:	
+responder_iocap_keyboard_only_initiator_iocap_display_only:	
+responder_iocap_display_yesno_initiator_iocap_keyboard_only:
+set_ssp_mode_passkey: 
+	jam SSP_MODE_PASSKEY_ENTRY_FLAG,mem_ssp_mode_flag
+	rtn
+
+
+classic_bt_set_reject_justwork_flag:
+	arg FLAG_SSP_REJECT_JUSTWORK,queue
+	branch classic_bluetooth_set_flag
+
+classic_bt_clr_reject_justwork_flag:
+	arg FLAG_SSP_REJECT_JUSTWORK,queue
+	branch classic_bluetooth_clr_flag
+
+classic_bluetooth_set_flag:
+	fetch 1,mem_classic_bt_flag
+	qset1 pdata
+	store 1,mem_classic_bt_flag
+	rtn
+
+classic_bluetooth_clr_flag:
+	fetch 1,mem_classic_bt_flag
+	qset0 pdata
+	store 1,mem_classic_bt_flag
+	rtn
+
+         
+send_lmp_io_cap_req:
+	force 5,queue
+	call send_lmpext
+	fetch 3,mem_sp_iocap_local
+	istore 3,contw
+	branch send_lmp_request
+	
+
+send_lmpext_sniff_subrating_req: 
+
+	rtn
+send_lmpext_sniff_subrating_res: 
+         force 9,queue
+         call send_lmpext
+         fetch 1,mem_subsniff_rate
+         istore 1,contw
+         fetch 2,mem_subsniff_tcmax
+         istore 2,contw
+         fetch 4,mem_subsniff_instant
+         istore 4,contw
+	branch send_lmp_reply
+
+send_lmp_name_res:
+	force 17,pdata
+	call msg_send_lmp
+	fetch 1,mem_lmi_opcode  /* loading name offset */
+	copy pdata,temp
+	beq 0x00,send_lmp_name_res_offset_ok
+	beq 0x0e,send_lmp_name_res_offset_ok
+	beq 0x1c,send_lmp_name_res_offset_ok
+	rtn
+send_lmp_name_res_offset_ok:
+	istore 1,contw	/* writing name offset */
+	fetch 1,mem_local_name_length
+	istore 1,contw	/* writing name length */
+	arg 14,loopcnt
+	setarg mem_local_name
+	iadd temp,contr	/* setting read location */
+	call memcpy
+	branch send_lmp_reply
+
+
+send_lmp_timing_accuracy_res:
+	force 3,pdata
+	call msg_send_lmp
+	setarg 0x0114
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_clkoffset_res:
+	// dopod s505 must wait for this res
+	force 3,pdata
+	call msg_send_lmp
+	fetch 4,mem_clke_bt
+	isub clkn_bt,pdata
+	branch send_lmp_clkoffset_res_master,master
+	sub pdata,0,pdata		/* our role is slave */
+send_lmp_clkoffset_res_master:	
+	// bit 16-2 of clkslave-clkmaster
+	rshift2 pdata,pdata
+	set0 15,pdata
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_version_res:
+	force 6,pdata
+	call msg_send_lmp
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	branch send_lmp_reply
+
+send_lmp_features_res:
+	force 9,pdata
+	call msg_send_lmp
+	fetch 8,mem_features
+	istore 8,contw
+	branch send_lmp_reply  
+
+
+/******** LMP request messages **********/
+/****** TID always set to local initiated *******/
+	
+
+send_lmpext_features_req:
+	force 12,queue
+	call send_lmpext
+	setarg 0x01
+	istore 1,contw
+	fetch 2,mem_lmpext_ssp_enable
+	istore 2,contw
+	setarg 0
+	istore 3,contw
+	setarg 0x00
+	istore 4,contw
+	branch send_lmp_request
+
+send_lmpext_packet_type_table_req:
+	force 3,queue
+	call send_lmpext
+	fetch 1,mem_ptt
+	istore 1,contw
+	disable user
+	call send_lmp_request
+	nrtn user
+	nrtn master
+	fetch 1,mem_afh_cfg
+	rtnbit0 AFH_CFG_ON
+	call afh_init
+	branch afh_open_all_channels
+	
+//default:featrue is enable,extfeature is disable
+ssp_enable:
+	bpatchx patch28_0,mem_patch28
+	fetch 1,mem_features+6
+	set1 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg param_lmpext_ssp_enable
+	store 2,mem_lmpext_ssp_enable
+	rtn
+
+ssp_disable:
+	bpatchx patch28_1,mem_patch28
+	fetch 1,mem_features+6
+	set0 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg 0
+	store 2,mem_lmpext_ssp_enable
+	rtn
+	
+afh_init:
+	jam 0x3,mem_afh_cfg
+	setarg 0
+	store 4,mem_afh_timer
+	arg mem_afh_map_lo,contw
+	call afh_reset_map
+	arg mem_afh_map_new,contw
+	call afh_reset_map
+	arg mem_afh_classify_channel_map,contw
+	call afh_reset_map
+	branch afh_clear_error_counter
+afh_open_all_channels:
+	arg mem_afh_map_new,contw
+	call afh_reset_map
+	call afh_clear_error_counter
+	branch afh_set_send_flag
+
+
+afh_reset_map:
+	setarg 0xffffff
+	istore 3,contw
+	istore 3,contw
+	istore 3,contw
+	setarg 0x7f
+	istore 1,contw
+	rtn
+afh_clear_error_counter:
+	setarg 0
+	store 2,mem_afh_error_total
+	rtn
+afh_set_send_flag:
+	fetch 1,mem_afh_cfg
+	set1 send_lmp_set_afh,pdata
+	store 1,mem_afh_cfg
+	rtn
+
+
+send_lmpext_pause_encryption_req:
+	force 2,queue
+	call send_lmpext
+	nbranch send_lmp_reply,master
+	// assume slave will not send pause req firstly???
+	branch send_lmp_request
+
+
+	
+send_lmp_detach:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_disconn_reason_send
+	istore 1,contw
+	call send_lmp_request
+prepare_disconnect:
+	fetch 1,mem_op
+	set1 op_disconn,pdata
+	store 1,mem_op
+	jam 50,mem_conn_timer
+	rtn
+	
+
+send_lmp_no_payload:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_request
+send_lmp_nopayload_reply:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_reply
+	
+	
+send_lmp_encryption_mode_req:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_state_map
+	isolate0 smap_encryption,pdata
+	setflag true,0,pdata
+	and_into 1,pdata
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_superto:
+	force 3,pdata
+	call msg_send_lmp
+	fetch 2,mem_supervision_to
+	istore 2,contw
+	branch send_lmp_request
+
+send_lmp_name_req:
+	jam 250,mem_conn_timer
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_name_offset
+	istore 1,contw
+	branch send_lmp_request
+
+send_lmp_test_control:
+	force 10,pdata
+	call msg_send_lmp
+	arg mem_temp_payload,contr
+	force 9,loopcnt
+send_lmp_test_control_loop:	
+	ifetch 1,contr
+	xor_into 0x55,pdata
+	istore 1,contw
+	loop send_lmp_test_control_loop
+	branch send_lmp_request  
+
+send_lmp_quality_of_service_req:
+	branch send_lmp_request
+send_lmp_unit_key:
+	branch send_lmp_request
+
+send_lmp_slot_offset:
+	rtn master
+	call calc_slot_offset
+	force 9,pdata
+	call msg_send_lmp
+	fetch 2,mem_slot_offset
+	istore 2,contw
+	fetch 3,mem_lap
+	istore 3,contw
+	fetch 1,mem_uap
+	istore 1,contw
+	fetch 2,mem_nap
+	istore 2,contw
+	bmark0 mark_switch_initiated,send_lmp_slot_offset_reply
+	set0 mark_switch_initiated,mark
+	call send_lmp_request
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	rtn
+send_lmp_slot_offset_reply:
+	call send_lmp_reply
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam LMP_SWITCH_REQ,mem_lmi_opcode2
+	rtn
+	
+send_lmp_switch_req:
+	arg 0x200,temp
+	branch switch_on_native,master
+	deposit clke_bt
+	branch switch_slack
+switch_on_native:
+	deposit clkn_bt
+switch_slack:
+	deposit bt_clk
+	iadd temp,pdata
+	and_into 0x1fc,pdata
+	store 4,mem_sniff_anchor
+	force 5,pdata
+	call msg_send_lmp
+	fetch 4,mem_sniff_anchor		/* reused as switch instant */
+	rshift pdata,pdata
+	istore 4,contw
+	branch send_lmp_request
+	
+send_lmp_sniff_req:
+	force 10,pdata
+	call msg_send_lmp
+	arg mem_sniff_payload,contr
+	ifetch 9,contr
+	istore 9,contw
+	branch send_lmp_request
+
+	
+send_lmp_timing_accuracy_req:
+/* default to TID_NORM_SEND */
+	force 3,pdata
+	call msg_send_lmp
+	setarg 0x0114
+	istore 2,contw
+	branch send_lmp_request
+	
+send_lmp_unsniff_req:
+//--------------------need to completa
+	force 1,pdata
+	call msg_send_lmp
+	//fetch 1,mem_unsniff_pending
+	//nbranch send_msg_done,blank
+	//jam 1,mem_unsniff_pending
+	//fetch 2,mem_sniff_attempt
+	//fetch 2,mem_nsniff_attempt
+	//lshift3 pdata,pdata
+	//lshift pdata,pdata
+	//store 1,mem_unsniff_cnt
+	branch send_lmp_request
+
+	
+send_lmp_max_slot:
+	force 2,pdata
+	call msg_send_lmp
+	fetch 1,mem_max_slot
+	istore 1,contw
+	branch send_lmp_request
+	
+	
+send_lmp_max_slot_req:
+	force 2,pdata
+	call msg_send_lmp
+	setarg 0x05		/*5 slot*/
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_inc_power:
+	force 2,pdata
+	call msg_send_lmp
+	setarg 0x00		/*5 slot*/
+	istore 1,contw
+	branch send_lmp_request
+
+
+send_lmp_setup_complete_by_module:
+	jam LMP_MAX_SLOT_REQ,mem_lmo_opcode2
+	rtn
+send_lmp_setup_complete:
+	fetch 1,mem_device_option
+	sub pdata,dvc_op_module,null
+	call send_lmp_setup_complete_by_module,zero
+	fetch 1,mem_state
+	set1 state_conn_comp,pdata
+	store 1,mem_state
+	copy clkn_bt,pdata
+	store 4,mem_aurand_send_delay_time
+	fetch 1,mem_lmp_conn_state
+	bbit1 SENT_SETUP_COMPLETE,send_lmp_setup_complete_has_sent
+	set1 SENT_SETUP_COMPLETE,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_SETUP_COMPLETE,mem_fifo_temp
+	call ui_ipc_send_event
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_request
+send_lmp_setup_complete_has_sent:
+	jam 0,mem_lmp_to_send
+	rtn
+	
+send_lmp_version_req:
+	force 6,pdata
+	call msg_send_lmp
+	fetch 5,mem_lmp_version
+	istore 5,contw
+	branch send_lmp_request
+
+send_lmp_features_req:
+	force 9,pdata
+	call msg_send_lmp
+	fetch 8,mem_features
+	istore 8,contw
+	branch send_lmp_request  
+
+sp_master_send_io_cap_get:
+	jam SP_FLAG_COMMIT,mem_master_sp_flag
+	fetch 1,mem_sp_local_key_invalid
+	rtnne SP_KEY_VALID
+	jam SP_MASTER_STAT_START_DONE,mem_master_sp_state
+	rtn
+
+sp_master_send_io_cap_send:
+	call tid_initiate
+	jam LMP_IO_CAP_REQ,mem_lmo_opcode2
+	jam SP_STAT_KEY_SEND,mem_master_sp_state
+	rtn
+	
+	
+sp_master_send_LMP_ENCAPSULATED_HEADER:
+	call tid_initiate
+	jam      LMP_ENCAPSULATED_HEADER,mem_lmo_opcode2
+	jam SP_STAT_RANDOM_SEND,mem_master_sp_state
+	rtn
+	
+sp_master_commitment_compare:
+	arg mem_sp_calc_result_high,rega
+	arg mem_sp_confirm_remote,regb
+	arg 16,loopcnt
+	call string_compare
+	branch sp_master_commitment_compare_success,zero
+	jam SP_STAT_NULL,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	call master_clear_mem_master_sp_flag
+endif
+	jam   PDU_NOT_ALLOWED,mem_lmo_reason2
+	jam 	LMP_SIMPLE_PAIRING_NUMBER,mem_lmi_opcode2 
+ifdef LMP_DBG
+	call ice_break
+endif
+	branch reject_lmp_packet
+sp_master_commitment_compare_success:
+	jam 	SP_STAT_CONFIRM_CALC,mem_master_sp_state
+ifdef SIMPLE_PAIRING
+	call master_set_mem_master_sp_flag
+endif
+	jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmi_opcode2
+	branch accept_lmp_msg  
+	
+
+	
+sp_master_send_lmp_simple_pairing_number:
+	jam LMP_SIMPLE_PAIRING_NUMBER,mem_lmo_opcode2
+	rtn
+	
+
+
+sp_send_lmp_encapsulated_header:
+	// calculate the private & public key here
+	//jam      LMP_ENCAPSULATED_HEADER,mem_lmp_to_send
+	jam      LMP_ENCAPSULATED_HEADER,mem_lmo_opcode2
+	//jam      TID_PAIRING,mem_lmp_tid
+	rtn
+	//fetch 1,mem_tid_table
+	//set1 TID_PAIRING,pdata
+	//store 1,mem_tid_table
+     
+    
+send_lmp_encapsulated_header: 
+	jam 0,mem_sp_local_key_send_count
+	force 4,pdata
+	call msg_send_lmp
+	force ENCAPSULATED_MAJOR_TYPE_P192,pdata
+	istore 1,contw
+	force ENCAPSULATED_MINOR_TYPE_P192,pdata
+	istore 1,contw  
+	force ENCAPSULATED_LEN_P192,pdata
+	istore 1,contw 
+	call check_localsm
+	branch send_lmp_request,true
+	branch send_lmp_reply
+
+send_lmp_encapsulated_payload:
+	//jam      TID_PAIRING,mem_lmp_tid
+	 force 17,pdata
+	call msg_send_lmp
+	fetch 1,mem_sp_local_key_send_count
+	arg mem_sp_pubkey_local,contr
+	iadd contr,contr    
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw
+	fetch    1,mem_sp_local_key_send_count
+	increase 16,pdata
+	store    1,mem_sp_local_key_send_count
+	call check_localsm
+	branch send_lmp_request,true
+	branch send_lmp_reply
+	//branch send_lmp_request
+	
+sp_send_lmp_simple_pairing_comfirm:
+        jam      SP_STAT_RANDOM_RECV,mem_sp_state
+        jam      LMP_SIMPLE_PAIRING_CONFIRM,mem_lmo_opcode2
+        rtn
+send_lmp_simple_pairing_comfirm:
+        //jam      SP_STAT_RANDOM_RECV,mem_sp_state
+        //jam      TID_PAIRING,mem_lmp_tid
+        force    17,pdata
+        call msg_send_lmp   
+        arg      mem_sp_calc_result_high,contr
+        ifetch   8,contr
+        istore   8,contw
+        ifetch   8,contr
+        istore   8,contw 
+        branch send_lmp_reply
+
+sp_send_lmp_simple_pairing_number:
+	jam      LMP_SIMPLE_PAIRING_NUMBER,mem_lmo_opcode2
+	rtn
+
+send_lmp_simple_pairing_number:
+	//jam      TID_PAIRING,mem_lmp_tid
+	call check_localsm
+ifdef SIMPLE_PAIRING
+	call sp_local_random_key_generator,true
+endif
+	force    17,pdata
+	call msg_send_lmp
+	arg      mem_sp_random_local,contr
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw
+	call check_localsm
+	nbranch send_lmp_reply,true
+	branch send_lmp_request,true
+
+master_sp_sm_end:
+	//jam DEFAULT_STATEMACHINE,mem_sp_localsm
+	jam SP_STAT_DONE,mem_master_sp_state
+sp_aurand_send:
+	call tid_initiate
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	call check_localsm_master
+ifdef SIMPLE_PAIRING
+	branch sp_master_key_prarm_push,true
+	branch sp_link_key_prarm_push
+endif
+master_sp_send_lmp_dhkey_check:
+	call tid_reply
+sp_send_lmp_dhkey_check: 
+	jam      LMP_DHKEY_CHECK,mem_lmo_opcode2
+	rtn
+send_lmp_dhkey_check: 
+	//jam      TID_PAIRING,mem_lmp_tid
+	force    17,pdata
+	call     msg_send_lmp
+	arg      mem_sp_calc_result_high,contr
+	ifetch   8,contr
+	istore   8,contw
+	ifetch   8,contr
+	istore   8,contw 
+	call check_localsm
+	nbranch send_lmp_reply,true
+	branch send_lmp_request,true
+
+send_lmp_enc_key_size_mask_res:
+	force 3,pdata
+	call msg_send_lmp   
+	setarg 0xfffe //enc key size mask
+	istore 2,contw
+	branch send_lmp_reply
+
+send_lmp_auto_rate:
+	branch send_lmp_request
+send_lmp_clkoffset_req:
+	branch send_lmp_request
+send_lmp_quality_of_service:
+	branch send_lmp_request
+send_lmp_test_activate:
+	branch send_lmp_request
+
+/******** LMP request/reply messages **********/
+/****** TID transaction specific *******/
+
+send_lmp_comb_key:
+	call generate_random_number
+	arg mem_lap,rega
+	call generate_linkkey
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_kinit,rega
+	arg mem_random_number,regb
+	call xor16
+	nbranch send_lmp_follow,master
+	branch send_lmp_tid
+
+send_lmp_inrand:
+	call generate_random_number
+	arg mem_plap,rega
+	call generate_kinit
+send_lmp_rand:	/* used by in_rand,au_rand,start_encrypt */
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_random_number,contr
+	call memcpy16
+	fetch 1,mem_conn_sm 
+	beq CONN_SM_AUTH_WAIT,send_lmp_request
+	beq CONN_SM_PAIRING_WAIT,send_lmp_request
+	branch send_lmp_tid
+
+send_lmp_aurand:
+	fetch 1,mem_pairing_auth
+	branch send_lmp_aurand_notpairing,blank
+	call check_localsm
+	call tid_initiate,true
+	ncall tid_reply,true
+	branch send_lmp_aurand_common
+send_lmp_aurand_notpairing:
+	call tid_initiate
+send_lmp_aurand_common:
+	call generate_random_number
+	branch send_lmp_rand
+
+send_lmp_sres:
+	arg mem_lap,rega
+	call function_e1
+	force 5,pdata
+	call msg_send_lmp
+	fetch 4,mem_input_store
+	istore 4,contw
+	arg mem_sres_tid,temp
+	call special_tid_store
+	call copy_aco
+	call check_localsm
+	branch send_lmp_sres_master,true
+	jam DONE_ENCRYP,mem_wait_encryption
+	fetch 1,mem_pairing_auth
+	rtn blank
+	jam LMP_AU_RAND,mem_lmo_opcode2
+send_lmp_sres_master:
+	fetch 1,mem_link_key_exists
+	rtn blank
+send_lmp_sres_startenc:
+	call check_localsm
+	nbranch send_lmp_sres_startenc_slave,true
+	fetch 1,mem_auth_enable
+	rtn blank
+	jam LMP_ENCRYPTION_MODE_REQ, mem_lmo_opcode2
+	rtn
+send_lmp_sres_startenc_slave:
+	rtnmark0 mark_slave_in_rand_accepted
+	set0 mark_slave_in_rand_accepted,mark
+	jam LMP_ENCRYPTION_MODE_REQ, mem_lmo_opcode2
+	rtn
+	
+
+	
+send_lmp_start_encryption:
+	call generate_random_number
+	call function_e3
+	force 17,pdata
+	call msg_send_lmp
+	arg mem_random_number,contr
+	call memcpy16
+	branch send_lmp_tid
+
+send_lmp_stop_encryption_req:
+	force 1,pdata
+	call msg_send_lmp
+	branch send_lmp_tid
+
+send_lmp_encryption_key_size_req:
+	force 2,pdata
+	call msg_send_lmp
+	force 16,pdata
+	istore 1,contw
+	store 1,mem_key_size
+	branch send_lmp_tid
+
+msg_send_lmp:
+/* FLOW is set high and LMP is indicated */
+	lshift3 pdata,pdata
+	or_into 0x07,pdata
+	store 1,mem_lmo_header_length
+	arg 17,loopcnt
+	arg mem_lmo_payload,contw
+	call clear_mem
+	arg mem_lmo_payload,contw
+	rtn
+
+send_lmpext:
+	and pdata,0x7f,rega
+	jam LMP_ESCAPE,mem_lmp_to_send
+	deposit queue
+	call msg_send_lmp
+	deposit rega
+	istore 1,contw
+	rtn
+
+send_lmp_follow:
+	fetch 1,mem_lmp_to_send
+	lshift pdata,pdata
+	fetcht 1,mem_state_map
+	isolate1 smap_lmptid,temp
+	setflag true,0,pdata
+	branch send_lmp_exit
+
+
+send_lmp_tid:
+	fetcht 1,mem_state_map
+	and_into 1,temp
+	branch send_lmp_end
+
+send_lmp_reply:
+	force 0,temp
+	branch send_lmp_end
+	
+send_lmp_request:
+	force 1,temp
+send_lmp_end:
+	fetch 1,mem_lmp_to_send
+	lshift pdata,pdata
+	setflag master,0,pdata
+	ixor temp,pdata
+send_lmp_exit:
+	store 1,mem_lmo_header_opcode
+	jam 0,mem_lmp_to_send
+	call lmo_fifo_process_lmo0empty
+	enable user
+	rtn
+
+//blank : not full 
+lmo_fifo_check:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	call lmo_fifo_process
+	fetch 1,mem_lmo_opcode2
+	rtn
+
+lmo_fifo_process:
+	bpatchx patch28_2,mem_patch28
+	fetch 1,mem_lmp_to_send
+	branch lmo_fifo_process_lmo0empty,blank
+	fetch 1,mem_lmo_opcode1
+	nrtn blank
+	branch lmo_fifo_process_lmo2to1
+lmo_fifo_process_lmo0empty:
+	fetch 1,mem_lmo_opcode1
+	branch lmo_fifo_process_lmo1_empty,blank
+	fetch 3,mem_lmo_opcode1
+	store 3,mem_lmp_to_send//1=>0
+	fetcht 1,mem_lmo_tid1
+	fetch 1,mem_state_map
+	set0 smap_lmptid,pdata
+	ior temp,pdata
+	store 1,mem_state_map
+	jam 0,mem_lmo_opcode1
+lmo_fifo_process_lmo2to1:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	fetch 4,mem_lmo_opcode2
+	store 4,mem_lmo_opcode1//2=>1
+	jam 0,mem_lmo_opcode2
+	rtn
+lmo_fifo_process_lmo1_empty:
+	fetch 1,mem_lmo_opcode2
+	rtn blank
+	fetch 3,mem_lmo_opcode2
+	store 3,mem_lmp_to_send//2=>0	
+	fetcht 1,mem_lmo_tid2
+	fetch 1,mem_state_map
+	set0 smap_lmptid,pdata
+	ior temp,pdata
+	store 1,mem_state_map
+	jam 0,mem_lmo_opcode2
+	rtn
+	
+//input:temp
+special_tid_store:
+	bpatchx patch28_3,mem_patch28
+	fetch 1,mem_state_map
+	copy pdata,regc
+	ifetch 1,temp
+	call pop_tid_follow
+	call send_lmp_follow
+	copy regc,pdata
+	store 1,mem_state_map
+	rtn
+	
+tid_reply:
+	fetcht 1,mem_state_map
+	set0 smap_lmptidinit,temp
+	storet 1,mem_state_map
+	rtn
+	
+tid_initiate:
+	fetcht 1,mem_state_map
+	set1 smap_lmptidinit,temp
+	storet 1,mem_state_map
+	rtn
+	
+	/* true if transaction from remote */
+tid_check:
+	nsetflag master,smap_lmptid,pdata //it is ok
+	fetcht 1,mem_state_map
+	ixor temp,pdata
+	isolate1 smap_lmptid,pdata
+	rtn	
+
+	/* set to remote */
+tid_set_reply:
+	fetch 1,mem_state_map
+	setflag master,smap_lmptid,pdata //it is ok
+	store 1,mem_state_map
+	rtn
+
+	/*rtn true when we lead lmp*/
+check_localsm:
+	fetch 1,mem_sp_localsm
+	compare 	LOCAL_STATEMACHINE,pdata,0x7f
+	rtn
+setlocalsm_master:
+	fetch 1,mem_sp_localsm
+	set1 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+setlocalsm_slave:
+	fetch 1,mem_sp_localsm
+	set0 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+check_localsm_master:
+	fetch 1,mem_sp_localsm
+	isolate1 7,pdata
+	store 1,mem_sp_localsm
+	rtn
+	
+generate_random_number:
+	/* generating a 16 byte random number,storing in ape_random_number */
+	arg mem_random_number,contw
+generate_random:
+	force 16,loopcnt
+generate_random_another:
+generate_random_loop:
+	random pdata
+	istore 1,contw
+	loop generate_random_another
+	rtn
+
+generate_linkkey:
+	call function_e21
+	arg mem_link_key,rega
+	arg mem_input_store,regb
+	ifetch 8,rega					/* check if already got comb key */
+	fetcht 1,mem_state
+	nsetflag blank,state_combkey,temp
+	storet 1,mem_state
+	copy rega,contw
+	call  xor16
+	branch generate_linkkey_continue
+
+/*********************************/
+/*********lmp send*************/
+/********************************/
+
+process_conn_sm:
+	//nrtn master
+	bpatchx patch28_4,mem_patch28
+
+	call lmo_fifo_check
+	nrtn blank
+process_conn_sm_continue:
+	fetch 1,mem_conn_sm
+	rtn blank
+	/* state machine begins in standby */
+	//beq CONN_SM_STANDBY, host_create_conn_begin
+	//beq CONN_SM_WAIT_PAGE, host_create_conn_wait_page
+	beq CONN_SM_SEND_CONN_REQ, host_create_conn_send_conn_req
+	beq CONN_SM_WAIT_CONN_ACCEPT, host_create_conn_wait_accept
+	beq CONN_SM_SEND_FEATURES, host_create_conn_send_features
+	beq CONN_SM_WAIT_FEATURES_RES, host_create_conn_waiting
+	beq CONN_SM_SEND_SWITCH,host_create_conn_send_switch
+	beq CONN_SM_AUTH_PAIR, host_create_conn_auth_pair
+	beq CONN_SM_AUTH_PAIR_WAIT, host_create_conn_auth_pair_wait
+	beq CONN_SM_ENCRYPT, host_create_conn_encrypt
+	beq CONN_SM_ENCRYPT_WAIT, host_create_conn_encrypt_wait
+	beq CONN_SM_ENCRYPT_WAIT_CLEAR, host_create_conn_encrypt_wait_clear
+	beq CONN_SM_SEND_SETUP_COMPLETE, host_create_conn_send_setup_complete
+	beq CONN_SM_WAIT_SETUP_COMPLETE, host_create_conn_wait_setup_complete
+	beq CONN_SM_DETACH_DELAY,host_create_conn_master_detach
+	beq CONN_SM_SEND_VERSION, host_create_conn_send_version
+	beq CONN_SM_WAIT_VERSION, host_create_conn_waiting
+	beq CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION, host_creat_conn_wait_switch
+	beq CONN_SM_SEND_FEATURES_EXT,host_creat_conn_send_feat_ext
+	beq CONN_SM_WAIT_FEATURES_EXT,host_create_conn_waiting
+	beq CONN_SM_PAIRING,host_create_conn_pairing
+	beq CONN_SM_PAIRING_WAIT,host_create_conn_pairing_wait
+	beq CONN_SM_AUTH,host_create_conn_auth
+	beq CONN_SM_AUTH_WAIT,host_create_conn_auth_wait
+	beq CONN_SM_DONE,host_create_conn_done
+	beq CONN_SM_WAIT_DONE,host_create_conn_done_wait
+	jam CONN_SM_STANDBY,mem_conn_sm
+	/* sending error message to host */
+	rtn
+host_create_conn_done:
+	fetch 1,mem_lmp_conn_state		
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	rtnbit0 SENT_SETUP_COMPLETE
+	jam CONN_SM_STANDBY,mem_conn_sm
+	call host_conn_judge_encrypt
+	branch scheduler_start_upper_sm
+	
+host_conn_judge_encrypt:
+	fetch 1,mem_connection_options
+	rtnbit0 CONNECTION_ENCRYPT
+	jam CONN_SM_ENCRYPT_WAIT,mem_conn_sm
+	rtn
+
+host_create_conn_done_wait:
+	arg enpt_delay_timer,queue
+	call timer_check
+	nrtn blank
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn
+	
+host_create_conn_auth:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_AUTH,pdata
+	store 1,mem_connection_options
+	jam CONN_SM_AUTH_WAIT,mem_conn_sm
+	jam LMP_AU_RAND,mem_lmo_opcode2
+	rtn 
+host_create_conn_auth_wait:
+	rtn
+host_create_conn_pairing:
+	fetch 1,mem_pincode_state
+	rtnne pincode_state_pincode_ready //wait for pincode
+	call host_auth
+	jam CONN_SM_PAIRING_WAIT,mem_conn_sm
+	rtn
+
+host_create_conn_pairing_wait:
+	rtn
+host_creat_conn_send_feat_ext:
+	jam CONN_SM_WAIT_FEATURES_EXT,mem_conn_sm
+	jam LMP_EXT_FEATURES_REQ,mem_lmo_opcode2
+	rtn
+host_create_conn_send_version:
+	jam CONN_SM_WAIT_VERSION,mem_conn_sm
+	jam LMP_VERSION_REQ,mem_lmo_opcode2
+	rtn 
+	
+host_creat_conn_wait_switch:
+	fetch 1,mem_switch_flag
+	rtneq SWITCH_FLAG_INIT
+	beq SWITCH_FLAG_ACCEPT,host_create_conn_switch_accept
+	arg switch_wait_timer,queue
+	call timer_check
+	nrtn blank
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	branch host_create_conn_switch
+host_create_conn_switch_accept:
+	rtn master
+	branch host_create_conn_auth_pair
+
+host_create_conn_send_features:
+	jam CONN_SM_WAIT_FEATURES_RES,mem_conn_sm
+	jam LMP_FEATURES_REQ,mem_lmo_opcode2
+	rtn 
+host_create_conn_send_switch:
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	jam CONN_SM_WAIT_CONN_ACCEPT,mem_conn_sm
+	setarg 0x1ff
+	store 2, mem_soft_timer
+	rtn
+host_create_conn_send_conn_req:
+	jam CONN_SM_WAIT_CONN_ACCEPT,mem_conn_sm
+	jam 0xff,mem_soft_timer
+	set0 mark_reconn_recieve_switch,mark
+	jam LMP_HOST_CONNECTION_REQ,mem_lmo_opcode2
+	branch init_lmp_reinit
+host_create_conn_wait_accept:
+	rtnmark1 mark_reconn_recieve_switch
+	fetch 2,mem_soft_timer
+	sub pdata,1,pdata
+	branch host_create_conn_resend,zero
+	store 2, mem_soft_timer
+	rtn
+host_create_conn_resend:
+	jam CONN_SM_SEND_SWITCH,mem_conn_sm
+	rtn
+host_create_conn_waiting:
+	/* we will exit waiting for connection request accepted, features res, or other commands to finish */
+	rtn 
+
+host_create_conn_switch:
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 SENT_SETUP_COMPLETE
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	jam LMP_SWITCH_REQ,mem_lmo_opcode2
+	jam CONN_SM_WAIT_SWITCH_AFTER_HOST_CONNECTION,mem_conn_sm
+	rtn 
+
+host_create_conn_send_setup_complete:
+	jam CONN_SM_WAIT_SETUP_COMPLETE,mem_conn_sm	
+	jam LMP_SETUP_COMPLETE,mem_lmo_opcode2
+	rtn 
+
+host_create_conn_wait_setup_complete:
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	jam CONN_SM_STANDBY,mem_conn_sm	
+
+	rtn
+host_create_conn_wait_setup_complete_rtn:	
+	jam CONN_SM_AUTH_PAIR ,mem_conn_sm
+	rtn
+
+host_create_conn_master_detach:
+	fetch 1, mem_soft_timer
+	increase -1,pdata
+	branch host_create_conn_send_detach,blank//detach
+	store 1, mem_soft_timer
+	rtn 
+host_create_conn_send_detach:
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam LOCAL_HOST,mem_disconn_reason_send
+	jam 0,mem_conn_sm
+	rtn
+host_create_conn_auth_pair:
+	/* checking whether or not to do m/s switch */
+	fetch 1,mem_connection_options
+	bbit1 CONNECTION_SWITCH,host_create_conn_switch
+	bbit1 CONNECTION_AUTH,host_create_conn_auth_pair_true
+host_create_conn_sm_done:
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn
+host_create_conn_auth_pair_true:
+	fetch 1,mem_link_key_exists
+	branch host_create_conn_auth_pair_nokey,blank
+	fetch 1,mem_lmp_conn_state
+	rtnbit0 SENT_SETUP_COMPLETE
+	rtnbit0 RECEIVED_SETUP_COMPLETE
+	fetch 4,mem_aurand_send_delay_time
+	arg 100,temp
+	iadd temp,temp
+	copy clkn_bt,pdata
+	isub temp,null
+	nrtn positive
+	branch host_create_conn_auth
+
+
+
+host_create_conn_auth_pair_nokey:
+	jam CONN_SM_PAIRING,mem_conn_sm
+	jam 4,mem_pin_length
+	setarg 0x3030
+	store 2,mem_pin
+	istore 2,contw
+	jam pincode_state_pincode_ready,mem_pincode_state
+	branch host_create_conn_pairing
+
+host_create_conn_auth_pair_wait:
+	rtn
+host_create_conn_encrypt:
+	fetch 1,mem_connection_options
+	bbit1 CONNECTION_ENCRYPT,host_create_conn_encrypt_start
+	jam CONN_SM_DONE,mem_conn_sm
+	rtn 
+
+host_create_conn_encrypt_start:
+	fetch 1,mem_connection_options
+	set0 CONNECTION_ENCRYPT,pdata
+	store 1,mem_connection_options
+	jam LMP_ENCRYPTION_MODE_REQ,mem_lmo_opcode2  
+	rtn
+
+host_create_conn_encrypt_wait:
+	fetch 1, mem_wait_encryption
+	rtn blank
+	jam CONN_SM_STANDBY,mem_conn_sm
+	branch host_create_conn_encrypt_start 
+
+host_create_conn_encrypt_wait_clear:
+	jam CONN_SM_SEND_SETUP_COMPLETE,mem_conn_sm
+	rtn 
+
+host_auth:
+	fetch 1,mem_op
+	bbit1 op_inrand_req,remote_auth
+	call tid_initiate
+	jam LMP_IN_RAND,mem_lmo_opcode2
+	branch cmd_exit
+remote_auth:
+	fetch 1,mem_op
+	set0 op_inrand_req,pdata
+	store 1,mem_op
+	call lmp_accept_inrand
+	call tid_set_reply
+	branch cmd_exit
+
+pincode_reinit:
+	setarg 4
+	store 1,mem_pin_length
+	setarg 0x3030
+	istore 2,contw
+	istore 2,contw
+	rtn
+	
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/peripherals.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/peripherals.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/peripherals.prog	(working copy)
@@ -0,0 +1,387 @@
+
+/* ===================== SPI dma ======================= */
+
+/*****************************************************************************
+*soft reset chip
+*****************************************************************************/
+soft_reset_chip:
+	hjam 1,core_reset
+	rtn
+
+/* ===================== uart dma ======================= */
+uartd_prepare_tx:
+	bpatchx patch29_0,mem_patch29
+	fetch 2,IPC_BT2M0_WRITE_PTR
+	copy pdata,contwu
+	rtn
+
+uartd_send:
+	bpatchx patch29_1,mem_patch29
+	copy contwu,pdata
+	store 2,IPC_BT2M0_WRITE_PTR
+wake_up_m0:
+	fetch 1,core_config
+	rtnbit1 7
+	set1 7,pdata
+	store 1,core_config
+	rtn
+
+
+uart_copy_tx_bytes_fast:
+	deposit loopcnt
+	rtn blank
+uart_copy_tx_bytes_fast_loop:
+	increase -8,loopcnt
+	call uart_tx_8_bytes,positive
+	rtn zero
+	branch uart_copy_tx_bytes_fast_loop,positive
+	increase 8,loopcnt
+uart_copy_tx_bytes_fast_loop_four:
+	increase -4,loopcnt
+	call uart_tx_4_bytes,positive
+	rtn zero
+	branch uart_copy_tx_bytes_fast_loop_four,positive
+	increase 4,loopcnt
+	branch uart_copy_tx_bytes
+
+uart_tx_8_bytes:
+	ifetch 8,contr
+	istore 8,contwu
+	rtn
+
+uart_tx_4_bytes:
+	ifetch 4,contr
+	istore 4,contwu
+	rtn
+
+uart_copy_tx_bytes:
+	deposit loopcnt
+	rtn blank
+uart_copy_tx_bytes_loop:
+	ifetch 1,contr
+	istore 1,contwu
+	loop uart_copy_tx_bytes_loop
+	rtn
+
+uart_copy_rx_bytes_fast:
+	deposit loopcnt
+	rtn blank
+uart_copy_rx_bytes_fast_loop:
+	increase -8,loopcnt
+	call uart_rx_8_bytes,positive
+	rtn zero
+	branch uart_copy_rx_bytes_fast_loop,positive
+	increase 8,loopcnt
+uart_copy_rx_bytes_fast_loop_four:
+	increase -4,loopcnt
+	call uart_rx_4_bytes,positive
+	rtn zero
+	branch uart_copy_rx_bytes_fast_loop_four,positive
+	increase 4,loopcnt
+	branch uart_copy_rx_bytes
+
+uart_rx_8_bytes:
+	ifetch 8,contru
+	istore 8,contw
+	rtn
+
+uart_rx_4_bytes:
+	ifetch 4,contru
+	istore 4,contw
+	rtn
+
+
+uart_copy_rx_bytes:
+	deposit loopcnt
+	rtn blank
+uart_copy_rx_bytes_loop:
+	ifetch 1,contru
+	istore 1,contw
+	loop uart_copy_rx_bytes_loop
+	rtn
+	
+uartd_rxdone:
+	bpatchx patch29_2,mem_patch29
+	copy contru,pdata
+	store 2,IPC_M02BT_READ_PTR
+	rtn
+	
+uartd_prepare_rx:
+	bpatchx patch29_3,mem_patch29
+	fetch 2,IPC_M02BT_READ_PTR
+	copy pdata,contru
+	rtn
+
+/* ===================== eeprom data ======================= */
+
+app_store_nvram_event:
+	jam BT_EVT_STORE_NVRAM,mem_fifo_temp
+	branch ui_ipc_send_event
+
+eeprom_store_le_reconn_info:
+eeprom_store_bd_reconn_info:
+check_51cmd_store_reconn_info:
+check_51cmd_update_device_record:
+	bpatchx patch29_4,mem_patch29
+	fetch 1,mem_nv_data_number
+	rtn blank		// not nv data
+	call check_nvram
+	call init_device_list,zero
+	call nvram_find_addr_from_bd_list
+write_device_record:
+	fetch 1,mem_nv_data_number
+	icopy regc
+	fetcht 2,mem_nv_data_ptr
+	storet 2,mem_list_item_ptr
+write_device_loop_find:
+	copy regc,pdata
+	branch app_store_nvram_event,blank  //EEPROM
+	increase -1,regc
+	copy temp,rega
+	ifetch 1,rega
+	fetcht 1,mem_select_list_item
+	isub temp,null
+	call set_index_finded_device,zero
+	branch write_device_loop_find0,positive
+	ifetch 1,rega
+	increase 1,pdata
+	istore 1,rega
+write_device_loop_find0:
+	fetcht 2,mem_list_item_ptr
+	increase NV_DATA_LEN,temp
+	storet 2,mem_list_item_ptr
+	branch write_device_loop_find
+
+set_index_finded_device:
+	setarg 0
+	istore 1,rega
+	fetch 1,mem_temp_reconn_record
+	istore 1,contw	
+	bne REC_3_MODE,set_index_finded_device_ble_mode
+	arg mem_link_key,regb
+set_index_find_device_MASTER_ADDR:
+	ifetch 6,contr
+	istore 8,contw
+	setarg 0
+	istore 8,contw
+	copy regb,contr
+store_rec_data_common:
+	call memcpy16
+	force 1,null
+	rtn
+
+set_index_finded_device_ble_mode:
+	beq REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,set_index_finded_device_IRK
+	beq REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,set_index_finded_device_EDIV
+	arg mem_le_ltk,regb
+	branch set_index_find_device_MASTER_ADDR
+
+set_index_finded_device_IRK:
+	arg mem_le_irk,contr
+	call memcpy16
+store_ble_rec_data_common:
+	arg mem_le_ltk,contr
+	branch store_rec_data_common
+
+set_index_finded_device_EDIV:
+	arg mem_le_rand,contr
+	call memcpy16
+	branch store_ble_rec_data_common
+
+
+nvram_find_addr_from_bd_list:
+	call disable_user
+	fetch 1,mem_nv_data_number
+	rtn blank		// not nv data
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,find_addr_from_bd_list_SPP_mode
+find_addr_from_bd_list_ble_mode:
+	bpatchx patch29_5,mem_patch29
+	fetch 1,mem_le_conn_peer_addr_type
+	beq MASTER_PUBLIC_ADDR,find_addr_from_bd_list_static_addr
+	fetch 1,mem_le_plap+5
+	compare 0xc0,pdata,0xc0
+	branch find_addr_from_bd_list_static_addr,true
+	compare 0x40,pdata,0xc0
+	branch find_addr_from_bd_list_random_addr,true
+	compare 0x00,pdata,0xc0
+	branch find_addr_from_bd_list_random_non_resolvable_private_address,true
+find_addr_from_bd_list_static_addr:
+	jam REC_4_MODE_STATIC_ADDRESS,mem_temp_reconn_record
+	fetch 6,mem_le_plap
+	branch find_addr_from_bd_list_common
+	
+find_addr_from_bd_list_random_non_resolvable_private_address:	
+	jam REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,mem_temp_reconn_record
+	branch find_addr_from_bd_list_common
+
+//input :pdata EDIV and rands
+find_addr_from_bd_list_random_addr:
+	jam REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,mem_temp_reconn_record
+	branch find_addr_from_bd_list_common
+	
+//input :pdata EDIV and rands
+find_addr_from_bd_list_SPP_mode:
+	bpatchx patch29_6,mem_patch29
+	jam REC_3_MODE,mem_temp_reconn_record
+	fetch 6,mem_plap
+find_addr_from_bd_list_common:
+	store 6,mem_temp_reconn_record+1
+	fetch 2,mem_nv_data_ptr
+	ifetcht 1,pdata
+	pincrease 1
+	store 2,mem_list_item_ptr
+	storet 1,mem_select_list_item
+	fetch 1,mem_nv_data_number
+	icopy regc
+nvram_find_addr_from_list:
+	fetch 2,mem_list_item_ptr
+	copy pdata,rega
+	call nvram_find_addr_from_list_compare
+	rtn user
+	fetcht 2,mem_list_item_ptr
+	increase NV_DATA_LEN,temp
+	storet 2,mem_list_item_ptr
+	increase -1,temp
+	ifetch 1,temp
+	store 1,mem_select_list_item
+	increase -1,regc
+	nbranch nvram_find_addr_from_list,zero
+	fetch 1,mem_nv_data_number
+	pincrease DECREASED_ONE
+	store 1,mem_select_list_item
+	rtn
+nvram_find_addr_from_list_compare:
+	fetch 1,mem_temp_reconn_record
+	bne REC_3_MODE,find_addr_from_list_compare_ble_mode
+find_master_addr_from_list_compare:
+	arg mem_temp_reconn_record,regb
+	arg 7,loopcnt
+	call string_compare
+	branch enable_user,zero
+	rtn
+
+find_addr_from_list_compare_ble_mode:
+	beq REC_4_MODE_RANDOM_RESOLVABLE_PRIVATE_ADDRESS,find_irk_form_list_compare
+	beq REC_4_MODE_RANDOM_NON_RESOLVABLE_PRIVATE_ADDRESS,find_ediv_form_list_compare
+	branch find_master_addr_from_list_compare
+
+find_irk_form_list_compare:
+	ifetcht 1,rega
+	isub temp,null
+	nrtn zero
+	arg mem_le_prand,contw
+	arg 16,loopcnt
+	call clear_mem
+	fetch 3,mem_le_plap+3
+	store 3,mem_le_prand
+	call genernate_master_MacAddress
+	fetch 2,mem_le_aes_128+13
+	byteswap pdata,pdata
+	lshift8 pdata,temp
+	ifetch 1,contr
+	iadd temp,pdata
+	fetcht 3,mem_le_plap
+	isub temp,null
+	branch enable_user,zero
+	rtn
+
+
+genernate_master_MacAddress:
+	arg mem_le_prand ,contr
+	call load_data128
+//	arg mem_le_irk,contr
+	ifetch 1,rega
+	call load_key128
+	force aes_big_endian | aes_load,aes_ctrl
+	force 0,aes_ctrl					// change result to little endian
+	call wait_aes
+	arg mem_le_aes_128,contw
+	branch store_aes_result
+
+find_ediv_form_list_compare:
+	ifetcht 1,rega
+	isub temp,null
+	nrtn zero
+	copy contr,rega
+	add contr,8,regc
+	arg mem_le_rand,regb
+	arg 8,loopcnt
+	call string_compare
+	branch enable_user,zero
+	copy regc,rega
+	arg mem_le_irk,regb
+	arg 8,loopcnt
+	call string_compare
+	branch enable_user,zero
+	rtn
+
+check_nvram:
+	fetch 2,mem_nv_data_ptr
+	ifetcht 1,pdata
+	pincrease NV_DATA_LEN
+	ifetch 1,pdata
+	isub temp,null
+	rtn
+
+init_device_list:
+	fetch 1,mem_nv_data_number
+	icopy loopcnt
+	fetcht 2,mem_nv_data_ptr
+	setarg 0
+init_device_list_loop:
+	istore 1,temp
+	increase NV_DATA_LEN,temp
+	pincrease 1
+	loop init_device_list_loop
+	rtn
+
+load_device_list:
+	bpatchx patch29_7,mem_patch29
+	call nvram_find_addr_from_bd_list
+	fetch 1,mem_state
+	setflag user,state_combkey,pdata	/* we have link key */
+	store 1,mem_state
+	nbranch clear_key_exists,user
+	add rega,10,contr
+//	copy rega,contr
+	arg mem_link_key,contw
+	call  memcpy16
+	branch check_link_key_load
+clear_key_exists:
+	jam 0,mem_link_key_exists
+	rtn
+
+load_device_list_mode_4:
+	fetch 9,mem_le_ediv
+	branch clear_ltk_exists,blank
+	call nvram_find_addr_from_bd_list
+	nbranch clear_ltk_exists,user
+	fetch 2,mem_list_item_ptr
+	add pdata,1,contr
+	arg mem_le_irk,contw
+	call  memcpy16
+	arg mem_le_ltk,contw
+	call  memcpy16
+	jam 1,mem_ltk_exists
+	rtn
+
+clear_ltk_exists:
+	jam 0,mem_ltk_exists
+	rtn
+
+
+	
+
+check_link_key_load:
+	fetch 8,mem_link_key
+	fetcht 8,mem_link_key+8
+	ior temp,pdata
+	rtn blank
+	jam 1,mem_link_key_exists
+	rtn
+	
+
+/* =============== GPIO CONTROL ================= */
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/rfcomm.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/rfcomm.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/rfcomm.prog	(working copy)
@@ -0,0 +1,960 @@
+
+ifdef COMPILE_RFCOMM
+rfcomm_init:
+	rtn wake
+	jam 0,mem_rfcomm_send_more_pkt
+	jam BITS9600,memRemoteRPNBitRate        
+	jam DATABITS8,memRemotePRNDataBits      
+	jam 0x11,memRemotePRNXon
+	jam 0x13,memRemotePRNXoff
+	setarg 0
+	store 3,memRemotePRNStopBit
+	store 1,mem_spp_state                  
+	jam 0,memui_reconnect_mode
+	//branch rfcomm_init_spp
+rfcomm_init_spp:
+	bpatchx patch2a_0,mem_patch2a
+	setarg 0
+	store 1,mem_spp_state
+	store 1,mem_remote_spp_channel
+	store 1,mem_pn_dlci
+	fetch 1,mem_credit_flag
+	beq CREDIT_ENABLE,rfcomm_init_spp_with_credit
+	jam 0x50,mem_credit_given
+	rtn
+
+rfcomm_init_spp_with_credit:
+	jam 0x00,mem_credit_given
+	rtn
+
+set_CR_bit:
+	or_into 0x02,temp
+	rtn
+
+
+/*below added by koufan*/
+
+/*rfcomm_send */
+
+
+
+	/*rfcomm_calculate_FCS_sabm*/
+	/*input: address in temp*/
+	/*output: FCS in pdata  */
+rfcomm_calculate_FCS_sabm:
+	copy temp,pdata
+	reverse pdata,pdata //address
+	store 1,memFCStemp3
+	force INI_TX_SABM,pdata
+	reverse pdata,pdata
+	store 1,memFCStemp2
+	force 0x01,pdata                        
+	reverse pdata,pdata
+	store 1,memFCStemp1
+	call caculate_fcs
+	copy temp,pdata                        
+	rtn
+rfcomm_calculate_FCS_ua:
+	reverse pdata,pdata //address
+	store 1,memFCStemp3
+	force   RSP_TX_UA, pdata
+	reverse pdata, pdata
+	store   1, memFCStemp2
+	force   0x01, pdata
+	reverse pdata, pdata
+	store   1, memFCStemp1
+	branch caculate_fcs
+	/* FCS return from temp                */
+rfcomm_calculate_FCS_dlci0:
+	fetch 1,mem_rfcomm_initiator
+	branch rfcomm_calculate_FCS_dlci0_res,blank
+	setarg 0x70 //FCS of initiator
+	rtn
+rfcomm_calculate_FCS_dlci0_res:
+	setarg 0xaa//FCS of responder
+	rtn
+	
+rfcomm_save_FCS_uih:
+	reverse pdata, pdata //address 
+	store 1,memFCStemp3                     /* contw distroided                    */
+	force RSP_RX_UIH,pdata 
+	call caculate_UIHdata_fcs
+	fetcht 2,mem_contw_temp
+	copy temp,contw
+	istore 1,contw                      /* save FCS for later use              */
+	copy contw,temp
+	storet 2,mem_contw_temp
+	force RSP_RX_UIH_WDATA,pdata             /* P/F =1 + RSP_RX_UIH                 */
+	call caculate_UIHdata_fcs
+	fetcht 2,mem_contw_temp
+	copy temp,contw
+	istore 1,contw             /* save FCS for later use              */
+	rtn	
+/**********************************************************************/
+/* This subroutine caculates the FCS for UIH data                     */
+/* Input:                                                             */
+/*        the address byte at memFCStemp3(bit reversed), control byte */
+/*        at pdata (not bit reversed)                                 */
+/* Output:                                                            */
+/*        pdata: the FCS                                              */
+/**********************************************************************/  
+caculate_UIHdata_fcs:
+	reverse pdata,pdata
+	store   1,memFCStemp2
+	fetch   2, memFCStemp2                     
+	lshift8 pdata,pdata
+	store 3,mem_mod2div_temp
+	arg     0x107,regA
+	arg 0xf,regB
+	call mod2div
+	xor_into     0xd7, pdata
+	invert  pdata,pdata
+	reverse pdata,pdata
+	rtn
+	
+/**********************************************************************/
+/* This subroutine caculates the FCS                                  */
+/* Input:                                                             */
+/*        the address byte at memFCStemp3, control byte at memFCStemp2*/  
+/*        lenght at memFCStemp1 (all above data are bit reversed)     */
+/* Output:                                                            */
+/*        temp: the FCS                                               */
+/**********************************************************************/     
+caculate_fcs:
+	fetch 3, memFCStemp1                    /* load 3 bytes start at memFCStemp1   */
+	store 3,mem_mod2div_temp
+	arg 0x107,regA
+	arg 0xf,regB  //24bit(memFCStemp1+..+memFCStemp3) - 9bit(regA) = 15bit
+	call mod2div
+	lshift8 pdata,pdata 
+	arg 0x7, regB  //16bit(lshift8 pdata,pdata ) - 9bit(regA) = 7bit
+	call mod2div
+	xor_into     0x2b, pdata		//0x3d
+	invert  pdata, pdata                        
+	reverse pdata, pdata                      /* FCS at pdata                        */
+	copy    pdata, temp
+	rtn
+
+mod2div:
+	arg 0,regC
+	copy regB,loopcnt
+	call right_shift_n // right shift pdata (regB)bit
+	icopy temp
+mod2div_loop:
+	//jam 1,0x1fff
+//mod2div_loop1:
+	//fetch 1,0x1fff
+	//nbranch mod2div_loop1,blank
+	copy temp,pdata
+	lshift regC,regC//quotient
+	bbit0 8, mod2div_not_enough_reduction//the high bit of 0x107
+	ixor regA,temp// temp----remainer
+	increase 1,regC// quotient
+mod2div_not_enough_reduction: //Minuend smaller than Subtrahend
+	lshift temp,temp
+	fetch 3,mem_mod2div_temp
+	increase -1,regB
+	compare 0xff,regB,0xff
+	branch mod2div_end,true
+	copy regB,loopcnt
+	call right_shift_n // right shift pdata (regB)bit
+	isolate1 0,pdata
+	setflag true,0,temp //move a new bit from Dividend(queue) into Minuend(pdata)
+	branch mod2div_loop
+mod2div_end:
+	//output:remainer in pdata
+	rshift  temp,pdata
+	rtn
+
+get_rfcomm_snd_adss:
+	fetcht 1,mem_pn_dlci
+dlci_to_address_cmd:
+	//input DLCI from temp
+	lshift2 temp,temp
+	set1 RFCOMM_ADDRESS_EXT_LEN,temp
+	fetch 1,mem_rfcomm_initiator
+	ncall set_CR_bit,blank
+	storet 1,mem_rfcomm_send_adss
+	rtn
+
+channel_to_dlci:
+	//input channel from temp
+	lshift temp,temp
+	fetch 1,mem_rfcomm_initiator
+	setflag blank,0,temp //direction in dlci
+	//output dlci to temp
+	rtn
+rfcomm_rx_process_DLCI0_sabm:
+	fetcht 1,mem_current_channel //address
+	jam 0xd7,mem_current_fcs //FCS
+	call rfcomm_send_ua
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_SABM,pdata
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_UA,pdata
+	store 1,mem_rfcomm_state
+	jam 0,mem_rfcomm_initiator
+	branch rfcomm_rx_process_end
+rfcomm_rx_process_DLCI0_ua:
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_UA,pdata
+	store 1,mem_rfcomm_state
+	branch rfcomm_rx_process_end
+
+	
+rfcomm_rx_process:
+	bpatchx patch2a_1,mem_patch2a
+	fetch 1,memui_reconnect_mode
+	beq NO_RECONNECTION,rfcomm_rx_process_remote_page
+	branch rfcomm_rx_process_reconn
+
+rfcomm_rx_process_remote_page:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_head_struct
+	fetch 1,mem_current_channel
+	beq 0,parse_dlci0_rp
+	branch parse_uih_rp
+parse_dlci0_rp:
+	bpatchx patch2a_2,mem_patch2a
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_SABM,rfcomm_rx_process_DLCI0_sabm
+	beq RFCOMM_FRAME_TYPE_UA,rfcomm_rx_process_DLCI0_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_DLCI0_rp_uih
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_rp_spp_disconn_send_event
+	rtn
+
+
+parse_DLCI0_rp_uih:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_uih_head_struct
+	fetch 1,mem_uih_cmd_type
+	beq UIH_PARAM_NEG_CMD,parse_DLCI0_rp_uih_pn_cmd
+	beq UIH_PARAM_NEG_RES,parse_DLCI0_rp_uih_pn_res
+	beq UIH_MODEM_STATUS_CMD,parse_DLCI0_rp_uih_ms_cmd
+	beq UIH_MODEM_STATUS_RES,parse_DLCI0_rp_uih_ms_res
+	beq UIH_PARAM_CMD_REMOVE_PORT,parse_DLCI0_rp_uih_cmd_port	
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_pn_cmd:
+	call parse_DLCI0_rp_uih_pn_res_common
+
+	branch parse_DLCI0_rp_uih_pn_cmd_spp
+
+parse_DLCI0_rp_uih_pn_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_PN_RES,pdata
+	store 1,mem_spp_state
+	call rfcomm_send_param_neg_res
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_pn_res:
+	call parse_DLCI0_rp_uih_pn_res_common
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_rp_uih_pn_res_common:
+	call get_param_payload_ptr
+	branch  get_rfcomm_prarmer_negotiation
+
+get_rfcomm_param_modem_status:
+	call get_param_payload_ptr
+	ifetch 1,contr
+	rshift3 pdata,pdata
+	store 1,mem_ms_channel
+	ifetch 1,contr
+	store 1,mem_ms_param
+	rtn
+
+
+get_rfcomm_head_struct:
+	ifetch 1,contr
+	store 1,mem_current_adss
+	rshift3 pdata,pdata
+	store 1,mem_current_channel
+	ifetch 1,contr
+	store 1,mem_current_frame_type
+get_rfcomm_current_length:
+	call get_rfcomm_length_common
+	storet 2,mem_current_length
+	copy contr,pdata
+	store 2,mem_rfcomm_uih_payload_ptr
+	rtn
+
+get_rfcomm_uih_head_struct:
+	ifetch 1,contr
+	rshift pdata,pdata
+	store 1,mem_uih_cmd_type
+	call get_rfcomm_length_common
+	storet 2,mem_uih_length
+	copy contr,pdata
+	store 2,mem_param_payload_ptr
+	rtn
+
+
+get_param_payload_ptr:
+	fetch 2,mem_param_payload_ptr
+	copy pdata,contr
+	rtn
+
+get_rfcomm_length_common:
+	ifetch 1,contr
+	copy pdata,temp
+	rshift temp,temp
+	rtnbit1 0
+	ifetch 1,contr
+	lshift3 pdata,pdata
+	lshift4 pdata,pdata
+	iadd temp,temp
+	rtn
+
+get_rfcomm_prarmer_negotiation:
+	ifetch 1,contr
+	store 1,mem_pn_dlci
+	ifetch 1,contr
+	store 1,mem_pn_credit_flow_type_info
+	ifetch 1,contr
+	store 1,mem_pn_priority
+	ifetch 1,contr
+	store 1,mem_pn_acknowledg_timer
+	ifetch 2,contr
+	store 2,mem_pn_max_frame_size
+	ifetch 1,contr
+	store 1,mem_pn_max_retrans
+	ifetch 1,contr
+	store 1,mem_remote_credits
+	rtn
+
+
+parse_DLCI0_rp_uih_ms_cmd:
+	call get_rfcomm_param_modem_status
+
+	branch parse_DLCI0_rp_uih_ms_cmd_spp
+
+parse_DLCI0_rp_uih_ms_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_RES,pdata
+	store 1,mem_spp_state
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+	or_into 3,temp
+	call rfcomm_send_modem_status_res
+	jam MORE_PKT_MSC_CMD_SPP,mem_rfcomm_send_more_pkt
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_rp_uih_ms_res:
+	jam BT_EVT_SPP_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	sub pdata,1,null
+	branch parse_DLCI0_rp_uih_MS_RES_spp,zero
+	branch assert
+parse_DLCI0_rp_uih_ms_res_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_rp_uih_cmd_port:
+	call get_param_payload_ptr
+	ifetch 1,contr
+	store 1,mem_rpn_dlci
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	//setarg 5
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch2a_3,mem_patch2a
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1191
+	istore 2,contw
+	//fetch 1,mem_pn_dlci
+	//setarg 0x0b
+	fetch 1,mem_rpn_dlci
+	istore 1,contw //DLCI
+	setarg 0x000007
+	istore 5,contw
+//	setarg 0 //max frame size
+//	istore 2,contw 
+	setarg 0x01 //max retrans
+	istore 2,contw
+//	setarg 0x00
+//	istore 1,contw // init credits
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+
+
+parse_uih_rp:
+	branch parse_uih_rp_spp
+
+parse_uih_rp_spp:
+	bpatchx patch2a_4,mem_patch2a
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_UA,parse_uih_rp_spp_ua
+	beq RFCOMM_FRAME_TYPE_SABM,parse_uih_rp_spp_sabm
+	beq RFCOMM_FRAME_TYPE_UIH,parse_uih_spp_uih
+	beq RFCOMM_FRAME_TYPE_UIH_CREDITS,parse_uih_spp_uih_credits
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_rp_spp_disconn
+	rtn
+parse_uih_rp_spp_ua:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+parse_uih_rp_spp_sabm:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	set1 RFCOMM_CHANNEL_STATE_SABM,pdata
+	store 1,mem_spp_state
+	fetch 1,mem_current_adss
+	call rfcomm_calculate_FCS_ua
+	store 1,mem_current_fcs
+	call rfcomm_send_ua
+	fetch 1,mem_current_adss
+	rshift2 pdata,pdata
+	store 1,mem_pn_dlci
+	lshift2 pdata,pdata
+	set0 RFCOMM_ADDRESS_CR,pdata
+	set1 RFCOMM_ADDRESS_EXT_LEN,pdata 
+	arg mem_HIUfcs_spp,temp // mem_HIUfcs_HF_WCredits in regB++
+	storet 2,mem_contw_temp
+	call rfcomm_save_FCS_uih
+	branch rfcomm_rx_process_end
+	
+parse_uih_spp_uih_credits:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	increase 1,pdata
+	store 2,mem_rfcomm_uih_payload_ptr
+	ifetch 1,contr //remote credits
+	fetcht 1,mem_remote_credits
+	iadd temp,pdata
+	store 1,mem_remote_credits
+parse_uih_spp_uih:
+	call rfcomm_increase_credit_given
+parse_uih_spp_uih_cont:
+	call get_rfcomm_snd_adss
+	call rfcomm_send_uih_without_payload
+	call spp_process_rx_data
+	branch rfcomm_rx_process_end
+
+parse_uih_rp_spp_disconn_send_event:
+	jam BT_EVT_SPP_DISCONNECTED,mem_fifo_temp
+	call ui_ipc_send_event	
+parse_uih_rp_spp_disconn:
+	call rfcomm_init_spp
+	fetch 1,mem_current_adss
+	call rfcomm_calculate_FCS_ua
+	store 1,mem_current_fcs
+	call rfcomm_send_ua
+	branch rfcomm_rx_process_end
+	
+///////////////////////////////////////////
+///////////////////////////////////////////
+///////////////////////////////////////////
+rfcomm_rx_process_reconn:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_head_struct
+	fetch 1,mem_current_channel
+	beq 0,parse_DLCI0_reconn
+	branch parse_uih_reconn
+		
+parse_DLCI0_reconn:
+	bpatchx patch2a_5,mem_patch2a
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_SABM,rfcomm_rx_process_DLCI0_sabm
+	beq RFCOMM_FRAME_TYPE_UA,rfcomm_rx_process_DLCI0_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_DLCI0_reconn_uih
+	branch rfcomm_rx_process_end
+parse_DLCI0_reconn_uih:
+	fetch 2,mem_rfcomm_uih_payload_ptr
+	copy pdata,contr
+	call get_rfcomm_uih_head_struct
+	fetch 1,mem_uih_cmd_type
+	beq UIH_PARAM_NEG_CMD,parse_DLCI0_reconn_uih_pn_cmd
+	beq UIH_PARAM_NEG_RES,parse_DLCI0_reconn_uih_pn_cmd
+	beq UIH_MODEM_STATUS_CMD,parse_DLCI0_reconn_uih_ms_cmd
+	beq UIH_MODEM_STATUS_RES,parse_DLCI0_reconn_uih_ms_res
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_reconn_uih_pn_cmd:
+	call parse_DLCI0_rp_uih_pn_res_common
+	fetch 1,mem_pn_dlci
+	rshift pdata,pdata
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_pn_cmd_spp,zero
+	branch assert
+parse_DLCI0_reconn_uih_pn_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_DLCI0_reconn_uih_ms_cmd:
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_ms_cmd_spp,zero
+	branch assert
+	branch rfcomm_rx_process_end
+parse_DLCI0_reconn_uih_ms_cmd_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_CMD,pdata
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_RES,pdata
+	store 1,mem_spp_state
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+	or_into 3,temp
+	call rfcomm_send_modem_status_res
+	branch rfcomm_rx_process_end
+	
+parse_DLCI0_reconn_uih_ms_res:
+	call get_rfcomm_param_modem_status
+	fetch 1,mem_ms_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_DLCI0_reconn_uih_ms_res_spp,zero
+	branch assert
+parse_DLCI0_reconn_uih_ms_res_spp:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_RCV_MS_RES,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+
+parse_uih_reconn:
+	fetch 1,mem_current_channel
+	fetcht 1,mem_remote_spp_channel
+	isub temp,null
+	branch parse_uih_reconn_spp,zero
+	branch assert
+	branch rfcomm_rx_process_end
+
+parse_uih_reconn_spp:
+	fetch 1,mem_current_frame_type
+	beq RFCOMM_FRAME_TYPE_UA,parse_uih_reconn_spp_ua
+	beq RFCOMM_FRAME_TYPE_UIH,parse_uih_spp_uih
+	beq RFCOMM_FRAME_TYPE_UIH_CREDITS,parse_uih_spp_uih_credits
+	beq RFCOMM_FRAME_TYPE_DISCONN,parse_uih_reconn_spp_disconn
+parse_uih_reconn_spp_ua:
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_UA,pdata
+	store 1,mem_spp_state
+	branch rfcomm_rx_process_end
+parse_uih_reconn_spp_sabm:
+	branch parse_uih_reconn_spp_sabm//loop
+parse_uih_reconn_spp_disconn:
+	branch parse_uih_rp_spp_disconn
+rfcomm_rx_process_end:
+	rtn
+	
+rfcomm_send_more_pkt:
+	fetch 1,mem_rfcomm_send_more_pkt
+	rtn blank
+	beq MORE_PKT_MSC_CMD_SPP,rfcomm_send_more_pkt_msc_cmd_spp
+	branch assert
+	
+rfcomm_send_more_pkt_msc_cmd_spp:
+	jam 0,mem_rfcomm_send_more_pkt
+	call l2cap_malloc_rfcomm_channel
+	arg SPP_SLAVE_CHANNEL,temp
+	fetcht 1,mem_pn_dlci
+	lshift2 temp,temp
+rfcomm_send_more_pkt_msc_cmd_spp0:
+	or_into 0x03,temp
+	arg 0xaa,regA
+	call rfcomm_send_modem_status_cmd
+	call l2cap_get_rfcomm_tx_buff
+	copy contw,contr
+	ifetch 2, contr
+	branch assert,blank
+	rtn
+
+rfcomm_send_sabm:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0004
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_current_adss
+	istore 1,contw //address
+	bpatchx patch2a_6,mem_patch2a
+	setarg 0x013f
+	istore 2,contw
+	fetch 1,mem_current_fcs
+	istore 1,contw
+	rtn
+rfcomm_send_ua:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0004
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_current_adss
+	istore 1,contw //address
+	bpatchx patch2a_7,mem_patch2a
+	setarg 0x0173
+	istore 2,contw
+	fetch 1,mem_current_fcs
+	istore 1,contw
+	rtn
+rfcomm_send_param_neg_cmd:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch2b_0,mem_patch2b
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1183
+	istore 2,contw
+	copy temp,pdata //DLCI in temp
+	istore 1,contw
+	setarg 0x0000f0
+	istore 3,contw
+	setarg RFCOMM_MAX_FRAME_SIZE
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	setarg 0x01		//change here later
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	jam 0x10,mem_credit_given
+	rtn
+rfcomm_send_param_neg_res:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x000e
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch2b_1,mem_patch2b
+	setarg 0x15ef
+	istore 2,contw
+	setarg 0x1181
+	istore 2,contw
+	fetch 1,mem_pn_dlci
+	istore 1,contw //DLCI
+	setarg 0x0000e0
+	istore 3,contw
+	fetch 2,mem_rfcomm_max_frame_size
+	istore 2,contw 
+	setarg 0x00 //max retrans
+	istore 1,contw
+	fetch 1,mem_rfcomm_credit_init_data
+	istore 1,contw // init credits
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+rfcomm_send_modem_status_cmd:
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0008
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch2b_2,mem_patch2b
+	setarg 0x09ef
+	istore 2,contw
+	setarg 0x05e3
+	istore 2,contw
+	copy temp,pdata //DLCI adress
+	istore 1,contw
+	setarg 0x8d
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+rfcomm_send_modem_status_res:
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x0008
+	istore 2,contw //l2cap len
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw//cid
+	copy temp,timeup
+	fetch 1,mem_rfcomm_initiator
+	lshift pdata,pdata
+	set1 0,pdata //ext len
+	istore 1,contw //DLCI0 address
+	bpatchx patch2b_3,mem_patch2b
+	setarg 0x09ef
+	istore 2,contw
+	setarg 0x05e1
+	istore 2,contw
+	copy timeup,pdata //DLCI address in temp
+	istore 1,contw
+	setarg 0x8d
+	istore 1,contw
+	call rfcomm_calculate_FCS_dlci0
+	istore 1,contw
+	rtn
+
+rfcomm_send_uih_without_payload:
+	bpatchx patch2b_4,mem_patch2b
+	fetch 1,mem_credit_given
+	rtn blank
+//	hfetch 2,core_uart_rxitems
+//	nrtn blank
+	copy rega,pdata
+	store 1,mem_pdatatemp+1
+	storet 1,mem_pdatatemp
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	call l2cap_malloc_rfcomm_channel
+	call l2cap_get_rfcomm_tx_buff
+	setarg 0x05
+	istore 2,contw
+	fetch 2,mem_RFCOMM_remote_CID
+	istore 2,contw
+	fetch 1,mem_rfcomm_send_adss
+	istore 1,contw
+	setarg 0x01ff
+	istore 2,contw
+	fetch 1,mem_credit_given
+	istore 1,contw
+	fetch 1,mem_HIUfcs_SPP_WCredits
+	istore 1,contw
+	jam 0,mem_credit_given
+	rtn
+	
+rfcomm_increase_credit_given:
+	bpatchx patch2b_5,mem_patch2b
+	fetch 1,mem_credit_flag
+	rtneq CREDIT_ENABLE
+	fetch 2,mem_current_length
+	rtn blank
+	fetch 1,mem_credit_given
+	increase 1,pdata
+	store 1,mem_credit_given
+	rtn
+
+spp_process_rx_data:
+	fetch 2,mem_cb_receive_spp_data
+	branch callback_func
+
+spp_tx_rfcomm_packet:
+	bpatchx patch2b_6,mem_patch2b
+	//credit
+	fetch 1,mem_remote_credits
+	rtn blank
+	increase -1,pdata
+	store 1,mem_remote_credits
+	fetch 2,mem_pn_max_frame_size
+	fetcht 2,mem_current_packet_length
+	isub temp,null
+	branch ssp_tx_rfcomm_from_uart,positive
+	store 2,mem_current_packet_length
+ssp_tx_rfcomm_from_uart:
+	fetch 1,mem_credit_given
+	branch ssp_tx_rfcomm_from_uart_without_credit,blank
+	jam 1,mem_rfcomm_send_offset
+	fetch 1,mem_HIUfcs_SPP_WCredits
+	store 1,mem_rfcomm_send_fcs
+	setarg RSP_RX_UIH_WDATA
+	store 1,mem_rfcomm_send_frame_type
+	branch ssp_tx_rfcomm_from_uart_common
+ssp_tx_rfcomm_from_uart_without_credit:
+	jam 0,mem_rfcomm_send_offset
+	fetch 1,mem_HIUfcs_SPP
+	store 1,mem_rfcomm_send_fcs
+	setarg RSP_TX_UIH
+	store 1,mem_rfcomm_send_frame_type
+ssp_tx_rfcomm_from_uart_common:
+	bpatchx patch2b_7,mem_patch2b
+	fetch 2,mem_current_packet_length
+	sub pdata,127,null
+	branch ssp_tx_rfcomm_from_uart_common0,positive
+	fetch 1,mem_rfcomm_send_offset
+	increase 1,pdata
+	store 1,mem_rfcomm_send_offset
+ssp_tx_rfcomm_from_uart_common0:
+	call get_rfcomm_snd_adss
+	fetch 2,mem_current_packet_length
+	increase 8,pdata	//fcs + rfcommhead + l2caphead == 8
+	fetcht 1,mem_rfcomm_send_offset
+	iadd temp,rega
+	//rfcomm payload
+	call l2cap_malloc
+	store 2,mem_rfcomm_tx_buff_ptr
+	increase 4,pdata
+	store 2,mem_rfcomm_tx_payload_ptr
+	copy pdata,contw
+	fetch 1,mem_rfcomm_send_adss
+	istore 1,contw
+	fetch 1,mem_rfcomm_send_frame_type
+	istore 1,contw
+	call ssp_tx_write_length
+	call ssp_tx_write_given_credit
+	bpatchx patch2c_0,mem_patch2c
+	fetch 2,mem_nl_rx_data_src		//src
+	copy pdata,contru
+	fetch 2,mem_current_packet_length
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	copy contw,temp
+	copy contru,pdata
+	store 2,mem_nl_rx_data_src
+	copy temp,contw	
+	fetch 1,mem_rfcomm_send_fcs
+	istore 1,contw
+	fetch 2,mem_rfcomm_tx_buff_ptr
+	copy pdata,contw
+	fetch 2,mem_current_packet_length
+	fetcht 1,mem_rfcomm_send_offset
+	iadd temp,pdata
+	increase 4,pdata
+	istore 2,contw
+	fetch 2,mem_rfcomm_remote_cid
+	istore 2,contw
+	jam 0,mem_credit_given	//whatever mem_credit_given is set to 0
+	fetch 2,mem_nl_rx_len_all
+	beq 0,module_hci_command_tx_spp_tx_complete
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	rtn
+
+ssp_tx_write_length:
+	bpatchx patch2c_1,mem_patch2c
+	fetch 2,mem_current_packet_length
+	sub pdata,0x7f,null
+	nbranch ssp_tx_write_long_packet,positive
+	lshift pdata,pdata
+	set1 0,pdata
+	istore 1,contw
+	rtn
+ssp_tx_write_long_packet:
+	fetch 2,mem_current_packet_length
+	rshift3 pdata,pdata
+	rshift4 pdata,temp
+	and_into 0x7f,pdata
+	lshift pdata,pdata
+	set0 0,pdata
+	istore 1,contw
+	istoret 1,contw
+	rtn
+ssp_tx_write_given_credit:
+	fetch 1,mem_credit_given
+	rtn blank
+	istore 1,contw
+	rtn
+
+	
+
+
+else
+
+rfcomm_init:
+	rtn
+rfcomm_init_spp:
+set_CR_bit:
+rfcomm_calculate_FCS_sabm:
+rfcomm_calculate_FCS_ua:
+rfcomm_calculate_FCS_dlci0:
+rfcomm_calculate_FCS_dlci0_res:
+rfcomm_save_FCS_uih:
+caculate_UIHdata_fcs:
+caculate_fcs:
+mod2div:
+mod2div_loop:
+mod2div_not_enough_reduction:
+mod2div_end:
+get_rfcomm_snd_adss:
+dlci_to_address_cmd:
+dlci_to_address_res:
+channel_to_dlci:
+rfcomm_rx_process_DLCI0_sabm:
+rfcomm_rx_process_DLCI0_ua:
+rfcomm_rx_process:
+rfcomm_rx_process_remote_page:
+parse_dlci0_rp:
+parse_DLCI0_rp_uih:
+parse_DLCI0_rp_uih_pn_cmd:
+parse_DLCI0_rp_uih_pn_cmd_spp:
+parse_DLCI0_rp_uih_pn_res:
+parse_DLCI0_rp_uih_pn_res_common:
+get_rfcomm_param_modem_status:
+get_rfcomm_head_struct:
+get_rfcomm_current_length:
+get_rfcomm_uih_head_struct:
+get_param_payload_ptr:
+get_rfcomm_param_length_common:
+get_rfcomm_length_common:
+get_rfcomm_prarmer_negotiation:
+parse_DLCI0_rp_uih_ms_cmd:
+parse_DLCI0_rp_uih_ms_cmd_spp:
+parse_DLCI0_rp_uih_ms_res:
+parse_DLCI0_rp_uih_ms_res_spp:
+parse_uih_rp:
+parse_uih_rp_spp:
+parse_uih_rp_spp_ua:
+parse_uih_rp_spp_sabm:
+parse_uih_spp_uih_credits:
+parse_uih_spp_uih:
+parse_uih_spp_uih_cont:
+parse_uih_rp_spp_disconn:
+rfcomm_rx_process_reconn:
+	branch assert 
+parse_DLCI0_reconn:
+parse_DLCI0_reconn_uih:
+parse_DLCI0_reconn_uih_pn_cmd:
+parse_DLCI0_reconn_uih_pn_cmd_spp:
+parse_DLCI0_reconn_uih_ms_cmd:
+parse_DLCI0_reconn_uih_ms_cmd_spp:
+parse_DLCI0_reconn_uih_ms_res:
+parse_DLCI0_reconn_uih_ms_res_noext:
+parse_DLCI0_reconn_uih_ms_res_spp:
+parse_uih_reconn:
+parse_uih_reconn_spp:
+parse_uih_reconn_spp_ua:
+parse_uih_reconn_spp_sabm:
+parse_uih_reconn_spp_disconn:
+rfcomm_rx_process_end:
+rfcomm_send_more_pkt:
+rfcomm_send_more_pkt_msc_cmd_spp:
+rfcomm_send_sabm:
+rfcomm_send_ua:
+rfcomm_send_param_neg_cmd:
+rfcomm_send_param_neg_res:
+rfcomm_send_modem_status_cmd:
+rfcomm_send_modem_status_res:
+rfcomm_send_uih_without_payload:
+rfcomm_increase_credit_given:
+spp_process_rx_data:
+spp_tx_rfcomm_packet:
+ssp_tx_rfcomm_from_uart:
+ssp_tx_rfcomm_from_uart_without_credit:
+ssp_tx_rfcomm_from_uart_common:
+ssp_tx_rfcomm_from_uart_common0:
+ssp_tx_write_length:
+ssp_tx_write_long_packet:
+ssp_tx_write_given_credit:
+	branch assert
+endif
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/scheduler.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/scheduler.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/scheduler.prog	(working copy)
@@ -0,0 +1,461 @@
+scheduler_process:
+	bpatchx patch2c_2,mem_patch2c
+	call check_51cmd
+	call app_process_bb_event
+	call process_conn_sm
+/* check the connection state sequence byte */
+	bpatchx patch2c_3,mem_patch2c
+ifdef SIMPLE_PAIRING
+	call sp_calc_sequence
+	call simple_pairing_sequence
+	call master_simple_paring_sequence
+endif
+//return if it is hci mode. 'cause the following is host part.
+//notify BB to tx a l2cap packet
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	//for conn to MTK 
+	call l2cap_call_proc_sigal_pending
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	bpatchx patch2c_4,mem_patch2c
+//to generat a new l2cap packet
+	call process_upper_sm
+	call l2cap_send_config_req
+ifdef COMPILE_RFCOMM
+	call rfcomm_send_more_pkt//use this function to send msc_cmd after msc_rep sent
+endif
+scheduler_process0:
+	call scheduler_tx_disconnect_hid //may not used
+	bpatchx patch2c_5,mem_patch2c
+//	call l2cap_malloc_is_fifo_full
+//	nrtn blank
+	branch app_process_bt
+	
+scheduler_tx_disconnect_hid:
+	fetch 1,mem_CONTROL_tasks		
+	bbit1 L2CAP_DISCONNECT_INTERRUPT,L2CAP_disconnect_interrupt_req
+	bbit1 L2CAP_DISCONNECT_CONTROL,L2CAP_disconnect_control_req
+	rtn
+	
+scheduler_tx_l2cap_pkt:
+	bpatchx patch2c_6,mem_patch2c
+	call l2cap_malloc_is_fifo_empty
+	rtn blank //empty
+	fetch 1,mem_op
+	rtnbit1 op_txl2cap
+	call l2cap_malloc_fifo_out
+	store 2,mem_txptr
+	copy pdata,contr
+	ifetch 2,contr
+	increase 4,pdata
+	store 2,mem_tx_len
+	jam 6,mem_tx_lch//start pkt
+	bpatchx patch2c_7,mem_patch2c
+	fetch 2,mem_l2cap_tx_multi_offset
+	branch scheduler_tx_l2cap_start_pkt,blank
+	fetch 1,mem_op
+	rtnbit0 op_pkt_comp
+	set0 op_pkt_comp,pdata
+	store 1,mem_op
+	jam 5,mem_tx_lch//continue pkt
+	fetcht 2,mem_l2cap_tx_multi_offset
+	fetch 2,mem_txptr
+	iadd temp,pdata
+	store 2,mem_txptr
+	fetch 2,mem_tx_len
+	isub temp,pdata
+	store 2,mem_tx_len
+scheduler_tx_l2cap_start_pkt:
+	bpatchx patch2d_0,mem_patch2d
+	fetch 2,mem_tx_len
+	branch assert,blank
+	arg l2cap_max_pkt_len,temp //max len of dh3 pkt
+	isub temp,pdata
+	nbranch scheduler_Tx_l2cap_last_pkt,positive
+	bpatchx patch2d_1,mem_patch2d
+	storet 2,mem_tx_len //l2cap_max_pkt_len
+	fetch 2,mem_l2cap_tx_multi_offset
+	iadd temp,pdata
+	store 2,mem_l2cap_tx_multi_offset
+	branch scheduler_Tx_l2cap_pkt_end
+scheduler_Tx_l2cap_last_pkt:
+	setarg 0
+	store 2,mem_l2cap_tx_multi_offset
+scheduler_Tx_l2cap_pkt_end:
+	fetch 1,mem_op
+	set1 op_txl2cap,pdata
+	store 1,mem_op
+	rtn
+
+scheduler_start_upper_sm:
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_HID,scheduler_start_upper_sm_hid
+	jam UPPERSM_RECONN_SDP_CONN,mem_upper_sm_reconn
+	rtn
+scheduler_start_upper_sm_hid:
+	jam UPPERSM_RECONN_HID_CTRL_CONN,mem_upper_sm_reconn
+	rtn
+	
+process_upper_sm:
+	fetch 1,memui_reconnect_mode
+	nbranch process_upper_sm_reconn,blank
+process_upper_sm_remote_page:
+	fetch 1,mem_upper_sm_remote_page
+	//beq UPPERSM_RP_IDLE,process_upper_sm_rp_idle
+	rtn blank
+	//nothing to do when remote page to create a connection.
+	jam 0,mem_upper_sm_remote_page
+process_upper_sm_rp_wait:
+	rtn
+
+
+process_upper_sm_reconn:
+	bpatchx patch2d_2,mem_patch2d
+	fetch 1,mem_upper_sm_reconn
+	rtn blank
+	beq UPPERSM_RECONN_SDP_CONN,process_upper_sm_reconn_sdp_conn
+	beq UPPERSM_RECONN_SDP_CONN_WAIT,process_upper_sm_reconn_sdp_conn_wait
+	beq UPPERSM_RECONN_SDP_CFG,process_upper_sm_reconn_sdp_cfg
+	beq UPPERSM_RECONN_SDP_CFG_WAIT,process_upper_sm_reconn_sdp_cfg_wait
+	beq UPPERSM_RECONN_SS_SPP,process_upper_sm_reconn_ss_spp
+	beq UPPERSM_RECONN_SS_SPP_WAIT,process_upper_sm_reconn_ss_spp_wait
+	beq UPPERSM_RECONN_SDP_DISCONN,process_upper_sm_reconn_sdp_disconn
+	beq UPPERSM_RECONN_SDP_DISCONN_WAIT,process_upper_sm_reconn_sdp_disconn_wait
+	beq UPPERSM_RECONN_HID_CTRL_CONN,process_upper_sm_reconn_hid_ctrl_conn
+	beq UPPERSM_RECONN_HID_CTRL_CONN_WAIT,process_upper_sm_reconn_hid_ctrl_conn_wait
+	beq UPPERSM_RECONN_HID_CTRL_CFG,process_upper_sm_reconn_hid_ctrl_cfg
+	beq UPPERSM_RECONN_HID_CTRL_CFG_WAIT,process_upper_sm_reconn_hid_ctrl_cfg_wait
+	beq UPPERSM_RECONN_HID_INT_CONN,process_upper_sm_reconn_hid_int_conn
+	beq UPPERSM_RECONN_HID_INT_CONN_WAIT,process_upper_sm_reconn_hid_int_conn_wait
+	beq UPPERSM_RECONN_HID_INT_CFG,process_upper_sm_reconn_hid_int_cfg
+	beq UPPERSM_RECONN_HID_INT_CFG_WAIT,process_upper_sm_reconn_hid_int_cfg_wait
+	beq UPPERSM_RECONN_RFCOMM_CONN,process_upper_sm_reconn_rfcomm_conn
+	beq UPPERSM_RECONN_RFCOMM_CONN_WAIT,process_upper_sm_reconn_rfcomm_conn_wait
+	beq UPPERSM_RECONN_RFCOMM_CFG,process_upper_sm_reconn_rfcomm_cfg
+	beq UPPERSM_RECONN_RFCOMM_CFG_WAIT,process_upper_sm_reconn_rfcomm_cfg_wait
+	beq UPPERSM_RECONN_RFCOMM_SABM,process_upper_sm_reconn_rfcomm_sabm
+	beq UPPERSM_RECONN_RFCOMM_SABM_WAIT,process_upper_sm_reconn_rfcomm_sabm_wait
+	beq UPPERSM_RECONN_SPP_CMD_PN,process_upper_sm_reconn_spp_cmd_pn
+	beq UPPERSM_RECONN_SPP_CMD_PN_WAIT,process_upper_sm_reconn_spp_cmd_pn_wait
+	beq UPPERSM_RECONN_SPP_SABM,process_upper_sm_reconn_spp_sabm
+	beq UPPERSM_RECONN_SPP_SABM_WAIT,process_upper_sm_reconn_spp_sabm_wait
+	beq UPPERSM_RECONN_SPP_CMD_MS,process_upper_sm_reconn_spp_cmd_ms
+	beq UPPERSM_RECONN_SPP_CMD_MS_WAIT,process_upper_sm_reconn_spp_cmd_ms_wait
+process_upper_sm_reconn_wait:
+	rtn
+process_upper_sm_reconn_sdp_conn:
+	call upper_sm_send_sdp_conn //return n-user if sending failed
+	jam UPPERSM_RECONN_SDP_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_sdp_state
+	rtn
+process_upper_sm_reconn_sdp_cfg:
+	jam UPPERSM_RECONN_SDP_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	rtnbit1 L2CAP_CHANNEL_STATE_SND_CFG_REQ
+	jam UPPERSM_RECONN_SDP_CFG,mem_upper_sm_reconn
+	call upper_sm_send_sdp_cfg //return n-user if sending failed
+	jam UPPERSM_RECONN_SDP_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_sdp_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_sdp_state
+	rtn
+process_upper_sm_reconn_ss_spp:
+	call l2cap_malloc_is_fifo_empty
+	nrtn blank
+	call upper_sm_send_ss_spp
+	jam UPPERSM_RECONN_SS_SPP_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_sdp_disconn:
+	call upper_sm_send_sdp_disconn
+	jam UPPERSM_RECONN_SDP_DISCONN_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_hid_ctrl_conn:
+	call upper_sm_send_hid_ctrl_conn
+	jam UPPERSM_RECONN_HID_CTRL_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_hid_control_state
+	rtn
+process_upper_sm_reconn_hid_ctrl_cfg:    
+	call upper_sm_send_hid_ctrl_cfg
+	jam UPPERSM_RECONN_HID_CTRL_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_control_state
+	rtn
+process_upper_sm_reconn_hid_int_conn:
+	call upper_sm_send_hid_int_conn
+	jam UPPERSM_RECONN_HID_INT_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+process_upper_sm_reconn_hid_int_cfg:    
+	call upper_sm_send_hid_int_cfg
+	jam UPPERSM_RECONN_HID_INT_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_hid_interrupt_state
+	rtn
+process_upper_sm_reconn_rfcomm_conn:
+	call upper_sm_send_rfcomm_conn
+	jam UPPERSM_RECONN_RFCOMM_CONN_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_rfcomm_cfg: 
+	call upper_sm_send_rfcomm_cfg
+	jam UPPERSM_RECONN_RFCOMM_CFG_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_STATE_SND_CFG_REQ,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_rfcomm_sabm:
+	call upper_sm_send_rfcomm_sabm
+	jam UPPERSM_RECONN_RFCOMM_SABM_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_rfcomm_state
+	set1 L2CAP_CHANNEL_RFCOMM_ONLY_SABM,pdata
+	store 1,mem_rfcomm_state
+	rtn
+process_upper_sm_reconn_spp_cmd_pn: 
+	call upper_sm_send_spp_cmd_pn
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_PN_CMD
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_CMD_PN_WAIT,mem_upper_sm_reconn
+	rtn
+process_upper_sm_reconn_spp_sabm:   
+	call upper_sm_send_spp_sabm
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_SABM
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_SABM_WAIT,mem_upper_sm_reconn
+	fetch 1,mem_remote_spp_channel //address in pdata
+	lshift3 pdata,pdata
+	or_into 3,pdata
+	arg mem_HIUfcs_SPP,temp // mem_HIUfcs_spp_WCredits in regB++
+	storet 2,mem_contw_temp
+	branch rfcomm_save_FCS_uih
+process_upper_sm_reconn_spp_cmd_ms: 
+	call upper_sm_send_spp_cmd_ms
+	fetch 1,mem_spp_state
+	set1 RFCOMM_CHANNEL_STATE_SND_MS_CMD
+	store 1,mem_spp_state
+	jam UPPERSM_RECONN_SPP_CMD_MS_WAIT,mem_upper_sm_reconn
+	rtn
+
+process_upper_sm_reconn_sdp_conn_wait:
+	fetch 1,mem_sdp_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_SDP_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_sdp_cfg_wait:
+	fetch 1,mem_sdp_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_SS_SPP ,mem_upper_sm_reconn
+process_upper_sm_reconn_ss_spp_wait:
+	fetch 1,mem_message_to_uppersm
+	rtnne RECIEVE_SS_REASULT_HF
+	jam 0,mem_message_to_uppersm
+	jam UPPERSM_RECONN_SDP_DISCONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_sdp_disconn_wait:
+	fetch 1,mem_sdp_state
+	nrtn blank
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_HID,process_upper_sm_reconn_setup_hid
+	bbit1 support_SPP,process_upper_sm_reconn_setup_rfcomm
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_hid_ctrl_conn_wait:
+	fetch 1,mem_hid_control_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_HID_CTRL_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_ctrl_cfg_wait:
+	fetch 1,mem_hid_control_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_HID_INT_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_int_conn_wait:  
+	fetch 1,mem_hid_interrupt_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_HID_INT_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_hid_int_cfg_wait:  
+	fetch 1,mem_hid_interrupt_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_SPP,process_upper_sm_reconn_setup_rfcomm
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_rfcomm_conn_wait: 
+	fetch 1,mem_rfcomm_state
+	rtnbit0 L2CAP_CHANNEL_STATE_CONN_RES
+	jam UPPERSM_RECONN_RFCOMM_CFG,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_rfcomm_cfg_wait:
+	fetch 1,mem_rfcomm_state
+	rtnne L2CAP_CHANNEL_SETUP_COMPLETE
+	jam UPPERSM_RECONN_RFCOMM_SABM,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_rfcomm_sabm_wait:  
+	fetch 1,mem_rfcomm_state
+	rtnne L2CAP_CHANNEL_RFCOMM_DLCI0_OPENED
+	fetch 1,mem_UI_profile_supported
+	bbit1 support_SPP,process_upper_sm_reconn_setup_spp
+	branch process_upper_sm_reconn_termination
+process_upper_sm_reconn_spp_cmd_pn_wait:
+	fetch 1,mem_spp_state
+	rtnbit0 RFCOMM_CHANNEL_STATE_PN_RES
+	jam UPPERSM_RECONN_SPP_SABM,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_spp_sabm_wait:
+	fetch 1,mem_spp_state
+	rtnbit0 RFCOMM_CHANNEL_STATE_UA
+	jam UPPERSM_RECONN_SPP_CMD_MS ,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_spp_cmd_ms_wait: 
+	fetch 1,mem_spp_state
+	rtnne RFCOMM_CHANNEL_SETUP_COMPLETE
+	branch process_upper_sm_reconn_termination
+
+process_upper_sm_reconn_setup_hid:
+	jam UPPERSM_RECONN_HID_CTRL_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+
+process_upper_sm_reconn_setup_rfcomm:
+	jam UPPERSM_RECONN_RFCOMM_CONN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+process_upper_sm_reconn_setup_spp:
+	jam UPPERSM_RECONN_SPP_CMD_PN,mem_upper_sm_reconn
+	branch process_upper_sm_reconn
+
+
+
+process_upper_sm_reconn_termination:
+	jam 0,mem_upper_sm_reconn
+	rtn
+upper_sm_send_sdp_conn:
+	bpatchx patch2d_3,mem_patch2d
+	call l2cap_malloc_signal_channel
+	setarg PSM_SDP
+	copy pdata,temp
+	setarg L2CAP_SDP_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+	
+upper_sm_send_sdp_cfg:
+	bpatchx patch2d_4,mem_patch2d
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_SDP_remote_CID
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+	
+upper_sm_send_sdp_disconn:
+	bpatchx patch2d_5,mem_patch2d
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_SDP_remote_CID
+	copy pdata,temp
+	arg L2CAP_SDP_channel,timeup
+	call ML2CAP_send_signal_disconn_req
+	fetch 1,mem_sdp_state
+	set0 L2CAP_CHANNEL_STATE_RCV_CFG_RES ,pdata
+	store 1,mem_sdp_state
+	rtn
+//service search
+upper_sm_send_ss_spp:
+	bpatchx patch2d_6,mem_patch2d
+	call l2cap_malloc_sdp_channel
+	call sdp_send_spp_request
+	branch MSDP_send_req_done
+
+upper_sm_send_rfcomm_conn:
+	bpatchx patch2d_7,mem_patch2d
+	call l2cap_malloc_signal_channel
+	setarg PSM_RFCOMM
+	copy pdata,temp
+	setarg L2CAP_RFCOMM_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+
+upper_sm_send_rfcomm_cfg:
+	bpatchx patch2e_0,mem_patch2e
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_rfcomm_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_hid_ctrl_conn:
+	bpatchx patch2e_1,mem_patch2e
+	call l2cap_malloc_signal_channel
+	setarg PSM_HID_control
+	copy pdata,temp
+	setarg L2CAP_HID_Control_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+
+upper_sm_send_hid_ctrl_cfg:
+	bpatchx patch2e_2,mem_patch2e
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_hid_ctrl_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_hid_int_conn:
+	bpatchx patch2e_3,mem_patch2e
+	call l2cap_malloc_signal_channel
+	setarg PSM_HID_interrupt
+	copy pdata,temp
+	setarg L2CAP_HID_interrupt_channel
+	copy pdata,timeup
+	branch ML2CAP_send_signal_connect_req
+	
+upper_sm_send_hid_int_cfg:
+	bpatchx patch2e_4,mem_patch2e
+	call l2cap_malloc_signal_channel
+	fetch 2,mem_hid_int_remote_cid
+	copy pdata,temp
+	branch ML2CAP_send_signal_config_req
+
+upper_sm_send_rfcomm_sabm:
+	bpatchx patch2e_5,mem_patch2e
+	call l2cap_malloc_rfcomm_channel
+	//force 3,temp //address
+	jam 3,mem_current_adss
+	jam 0x1c,mem_current_fcs
+	call rfcomm_send_sabm
+	jam 1,mem_rfcomm_initiator
+	rtn
+
+upper_sm_send_spp_cmd_pn:
+	bpatchx patch2e_6,mem_patch2e
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_remote_spp_channel
+	call channel_to_dlci
+	storet 1,mem_pn_dlci
+	branch rfcomm_send_param_neg_cmd
+
+upper_sm_send_spp_sabm:
+	bpatchx patch2e_7,mem_patch2e
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd
+	call rfcomm_calculate_FCS_sabm //sabm fcs use once only,not need to save
+	store 1,mem_current_fcs
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd
+	storet 1,mem_current_adss
+	branch rfcomm_send_sabm
+
+upper_sm_send_spp_cmd_ms:
+	bpatchx patch2f_0,mem_patch2f
+	call l2cap_malloc_rfcomm_channel
+	fetcht 1,mem_pn_dlci
+	call dlci_to_address_cmd //address in temp
+	branch rfcomm_send_modem_status_cmd
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/sdp.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/sdp.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/sdp.prog	(working copy)
@@ -0,0 +1,1206 @@
+/**********************************************************************/
+/* Subroutine: sdp_process                                         */
+/* Process Service Discovery Request                                  */
+/* Called from L2CAP, check PDUID, branch to different req processings*/
+/*                                                                    */  
+/* Input:       mem_L2CAP_Rx_payload                                  */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process:
+	bpatchx patch2f_1,mem_patch2f
+	fetch 2,mem_l2cap_payload_ptr
+	iforce contr
+//	ifetchr regb,1,contr				/* PDUID */
+//	storer regb,1,mem_sdp_pduid
+	ifetch 1,contr
+	copy pdata,regb
+	store 1,mem_sdp_pduid
+	ifetch 2,contr
+	store 2,mem_sdp_transactionid			/* save transaction id */
+	ifetch 1,contr				/* higher byte of parameter length */
+	lshift8 pdata,timeup				
+	ifetch 1,contr				/* lower byte of parameter length */
+	iadd timeup,timeup				/* parameter length stored in "timeup" */
+	bpatchx patch2f_2,mem_patch2f
+	copy contr,temp
+	arg 4,loopcnt
+	arg mem_sdp_handle_list,contw
+	call memset0
+	copy temp,contr 
+	deposit regb						/* PDUID  */
+	beq SDP_ERROR_RES,sdp_process_error_res
+	beq SDP_SEARCH_REQ,sdp_process_ss_req
+	beq SDP_SEARCH_RES,sdp_process_ss_res
+	beq SDP_ATTRIBUTE_REQ,sdp_process_sa_req
+	beq SDP_ATTRIBUTE_RES,sdp_process_sa_res
+	beq SDP_SEARCHATTRIB_REQ,sdp_process_ssa_req
+	beq SDP_SEARCHATTRIB_RES,sdp_process_ssa_res
+	branch sdp_insufficient_resource
+
+/**********************************************************************/
+/* ss_req			                              */
+/* Processing Service Search Request                                  */
+/* Call: ask_serviceclassid, empty_response                     */
+/*                                                                    */  
+/* Input:       mem_L2CAP_Rx_payload pointer in contr                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ss_req:
+	bpatchx patch2f_3,mem_patch2f
+	call ask_serviceclassid
+	compare 1,temp,0xff
+	branch ss_empty_rsp,true
+	compare 0xff,temp,0xff
+	branch sdp_invalid_request_syntax,true
+
+	ifetch 2,contr				/* max aservice record count */
+	store 2,mem_sdp_record_maxcnt
+	increase -2,timeup
+
+	increase -1,timeup				/* continuation state 1 byte (0) */
+	nbranch sdp_invalid_pdu_size,zero		/* invalid pdu size */
+	arg mem_sdp_uuid_search_ptr,timeup
+	ifetch 2,timeup
+	rtn blank
+	call search_all_uuid
+	call l2cap_get_sdp_tx_payload			/* put the pointer to Tx buffer  */
+	force 3,pdata						/* PDUID 3, Service Search Response */
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid			/* write transaction id */
+	istore 2,contw
+	lshift2 queue,pdata
+	add pdata,5,pdata
+	add pdata,5,regc
+	byteswap pdata,pdata
+	istore 2,contw							/* write parLength */
+	deposit queue
+	byteswap pdata,pdata
+	istore 2,contw							/* write TotSrvRecCount */
+	istore 2,contw							/* write CurSrvRecCount */
+	arg mem_sdp_handle_list,contr
+	copy queue,loopcnt
+	branch ss_req_blank,zero
+ss_req_loop:	
+	ifetch 4,contr
+	istore 4,contw
+	loop ss_req_loop
+ss_req_blank:	
+	force 0,pdata
+	istore 1,contw							/* continuation state */
+	deposit regc
+	store 2,mem_sdp_tx_pkt_length
+//	branch assert,blank
+	rtn
+
+/**********************************************************************/
+/* sa_req			                              */
+/* Processing Service Attribute Request                               */
+/* Call: ask_attributeid, empty_response (if 3 stored attr.     */
+/* not asked) or answer_attributelist                              */  
+/* Input:       mem_L2CAP_Rx_payload pointer in contr                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length	      */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_sa_req:
+	bpatchx patch2f_4,mem_patch2f
+	ifetch 4,contr				/* service record handle */
+	store 4,mem_sdp_record_handle	 
+	increase -4,timeup
+	call sdp_store_maxbyte
+	store 2,mem_sdp_attribute_maxbyte
+	increase -2,timeup
+	call dataelementtype6		/* result: data size stored in rega */
+	branch sdp_invalid_request_syntax,zero
+	compare 5,rega,0xff  // length
+	//branch sa_req_all,true
+	branch sa_judge_wholerange,true
+sa_isnot_wholerange:
+	arg mem_sdp_attrib_list,contw
+	force 0,queue
+	branch sa_req_loop
+sa_judge_wholerange:
+	ifetch 1,contr
+	bne SDP_ATTRIBUTE_RANGE,sdp_invalid_request_syntax
+	ifetch 2,contr
+	nbranch sa_judge_wholerange_false1,blank
+	ifetch 1,contr
+	bne 0xff,sa_judge_wholerange_false2
+	ifetch 1,contr
+	bne 0xff,sa_judge_wholerange_false3		//also exist potential bug because mem_sdp_attrib_list length is only 7f
+	branch sa_req_all
+sa_judge_wholerange_false3:
+	increase -5,contr
+	branch sa_isnot_wholerange
+sa_judge_wholerange_false2:
+	increase -4,contr
+	branch sa_isnot_wholerange
+sa_judge_wholerange_false1:
+	increase -3,contr
+	branch sa_isnot_wholerange
+sa_req_loop:	
+	ifetch 1,contr
+	beq SDP_ATTRIBUTE_ID, sa_req_one_id
+	beq SDP_ATTRIBUTE_RANGE, sa_req_range
+sa_req_range:
+	ifetch 2, contr
+	istore 2, contw
+	increase 1,queue
+	byteswap pdata,regb
+	ifetch 2, contr
+	byteswap pdata,pdata
+sa_req_range_id_increase:	
+	increase 1, regb
+	isub regb, null
+	nbranch sa_req_range_id_finish,positive
+	copy pdata, regc
+	byteswap regb,pdata
+	istore 2, contw
+	increase 1,queue
+	copy regc, pdata
+	branch sa_req_range_id_increase
+sa_req_range_id_finish:
+	increase -5,timeup
+	increase -5,rega
+	branch sa_req_check_next_id
+sa_req_one_id:
+	ifetch 2,contr
+	istore 2,contw //save the attribute id in mem_sdp_attrib_list
+	increase 1,queue
+	increase -3,timeup
+	increase -3,rega
+sa_req_check_next_id:	
+	nbranch sdp_invalid_request_syntax,positive
+	nbranch sa_req_loop,zero //another attribute 
+	increase -1,timeup
+	nbranch sdp_invalid_request_syntax,zero
+	
+	call l2cap_get_sdp_tx_payload
+	increase 10,contw
+	arg mem_sdp_attrib_list,rega
+sa_req_handle_attributelist_next:
+	copy queue,pdata
+	branch sa_req_handle_attributelist_end,blank
+	ifetch 2,rega
+	branch sa_req_handle_attributelist_end,blank
+	iforce regb /* regb is the attribute ID */
+	fetch 4,mem_sdp_record_handle	
+	iforce temp
+	call search_handle_attrib
+	copy contr,pdata
+	branch sa_req_handle_attributelist_notfound,blank
+	increase -3,contr
+	ifetch 3,contr
+	istore 3,contw
+	call sdp_data_len
+	iforce loopcnt	
+	call memcpy
+sa_req_handle_attributelist_notfound:
+	increase 2,rega
+	increase -1, queue
+	branch sa_req_handle_attributelist_next
+
+sa_req_handle_attributelist_end:	
+	arg SDP_ATTRIBUTE_RES,rega
+	call ssa_req_range_lastfreg_common
+	fetch 2,mem_sdp_tx_pkt_length	
+	beq 11,sa_empty_rsp
+	branch  ssa_req_range_attrbutes_length_no_continue
+
+
+sdp_store_continue_common:
+	ifetch 1, contr
+	beq 0, sdp_store_continue_0byte
+	beq 1,sdp_store_continue_1byte
+	beq 2, sdp_store_continue_2byte
+sdp_store_continue_0byte:	
+	increase -1,timeup				/* continuation state byte (0) */
+	branch sdp_store_continue_end
+sdp_store_continue_1byte:
+	ifetch 1, contr
+	increase -2,timeup				/* continuation state byte (1) */
+	branch sdp_store_continue_end
+sdp_store_continue_2byte:
+	ifetch 2, contr
+	byteswap pdata,pdata
+	increase -3,timeup				/* continuation state byte (2) */
+sdp_store_continue_end:
+	store 2, mem_sdp_continue_byte	
+	rtn
+	
+sa_req_all:	
+	increase -5,timeup
+	call sdp_store_continue_common
+	nbranch sdp_invalid_pdu_size,zero
+	fetcht 4,mem_sdp_record_handle		
+	call search_handle
+	nbranch sdp_invalid_service_record_handle,zero
+	copy contr,rega
+	call l2cap_get_sdp_tx_payload
+	copy rega,contr
+	increase 3,contw//arg mem_SDP_Tx_payload+3,contw
+	copy contr,timeup //sdp start pointer
+	call sdp_get_data
+	copy pdata, rega //sdp total length
+//	fetchr regb,2,mem_sdp_continue_byte
+	fetch 2,mem_sdp_continue_byte
+	copy pdata,regb
+	copy rega,pdata
+	isub regb,regb //total_length - continue_byte in regb
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub regb, null
+	nbranch sa_req_all_fragment_sdp, positive
+	// the last fragment
+	disable user
+	fetch 2, mem_sdp_continue_byte
+	branch sa_req_all_fisrt_fragment,blank
+	iadd timeup, contr //set the read pointer
+	increase 3,regb //include the total length field, 3 bytes
+	copy regb, loopcnt
+	copy loopcnt, pdata
+	increase 3, pdata
+	byteswap pdata,pdata
+	istore 2, contw
+	copy loopcnt, pdata
+	byteswap pdata,pdata
+	istore 2, contw
+	branch sa_req_all_answer_attributelist_full_loop
+sa_req_all_fisrt_fragment:
+	add rega,6,loopcnt
+	branch sa_req_all_parlength_continue_byte, user
+	byteswap loopcnt,pdata
+	branch sa_req_all_parlength_continue_byte_end
+sa_req_all_parlength_continue_byte:
+	copy loopcnt, pdata
+	increase 2, pdata
+	byteswap pdata,pdata
+sa_req_all_parlength_continue_byte_end:
+	istore 2,contw				/* ParLength */
+	increase -3,loopcnt
+	byteswap loopcnt,pdata			
+	istore 2,contw				/* AttrListByteCount */
+	copy timeup,contr
+	branch sa_req_all_answer_attributelist_full_loop
+sa_req_all_fragment_sdp:
+	enable user
+//	fetchr rega,2,mem_sdp_attribute_maxbyte
+	fetch 2,mem_sdp_attribute_maxbyte
+	copy pdata,rega
+	copy rega,loopcnt
+	fetch 2, mem_sdp_continue_byte
+	branch sa_req_all_fisrt_fragment,blank
+	iadd timeup, contr
+	copy rega,pdata
+	increase 5,pdata
+	byteswap pdata,pdata	
+	istore 2, contw
+	copy rega,pdata
+	byteswap pdata,pdata
+	istore 2, contw
+sa_req_all_answer_attributelist_full_loop:
+	call memcpy
+	nbranch sa_req_all_last_frag_continue, user
+	force 2,pdata
+	istore 1,contw
+	copy contr, pdata
+	isub timeup, pdata
+	byteswap pdata,pdata
+	istore 2, contw   // continuation length
+	branch sa_req_all_frag_end
+sa_req_all_last_frag_continue:
+	force 0,pdata
+	istore 1,contw
+sa_req_all_frag_end:	
+	arg SDP_ATTRIBUTE_RES,rega
+	branch ssa_req_range_common	
+	
+/**********************************************************************/
+/* ssa_req                          		      */
+/* Processing Service Search Attribute Request                        */
+/* Call: ask_serviceclassid, ask_attributeid, empty_response */
+/*       or answer_attributelist                                   */  
+/* Input:       contr                                                 */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length             */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ssa_req:
+	bpatchx patch2f_5,mem_patch2f
+	call ask_serviceclassid
+	compare 0xff,temp,0xff
+	branch sdp_invalid_request_syntax,true
+	call sdp_store_maxbyte
+	store 2,mem_sdp_attribute_maxbyte
+	increase -2,timeup
+	call dataelementtype6
+	arg mem_sdp_attrib_list,contw
+	force 0,queue
+ssa_req_loop:	
+	ifetch 1,contr 
+	beq SDP_ATTRIBUTE_RANGE,ssa_req_range
+	ifetch 2,contr 
+	istore 2,contw //save the attribute id in mem_sdp_attrib_list
+	increase 1,queue
+	increase -3,timeup
+	increase -3,rega
+	nbranch sdp_invalid_request_syntax,positive
+	nbranch ssa_req_loop,zero
+	increase -1,timeup
+	nbranch sdp_invalid_request_syntax,zero
+	call l2cap_get_sdp_tx_payload
+	increase 13,contw//arg mem_SDP_Tx_payload+13,contw
+	fetch 2,mem_sdp_uuid_search_ptr
+	iforce regc
+	arg mem_sdp_attrib_list,rega
+ssa_req_attributelist_next:	
+	ifetch 2,rega
+	branch ssa_req_attributelist_end,blank
+	iforce regb						/* regb is the attribute ID */
+	call search_attrib
+	branch ssa_req_attributelist_notfound,blank
+	increase -3,contr
+	ifetch 3,contr
+	istore 3,contw
+	call sdp_data_len
+	iforce loopcnt	
+  	call memcpy
+ssa_req_attributelist_notfound:
+	increase 2,rega
+	branch ssa_req_attributelist_next
+
+ssa_req_attributelist_end:
+	call ssa_req_range_lastfreg
+	fetch 2,mem_sdp_tx_pkt_length	
+	beq 14,ssa_empty_rsp
+	call ssa_req_range_attrbutes_length_no_continue
+	branch ssa_req_range_attrbutes_length_no_continue
+
+
+sdp_store_maxbyte:	
+	ifetch 2,contr				 
+	byteswap pdata,pdata
+	increase -3,pdata	
+	arg 200,temp
+	isub temp,null
+	nrtn positive
+	setarg 200
+	rtn
+	
+
+ssa_req_range:
+	increase 4,contr
+	increase -5,timeup
+	increase -5,rega
+	nbranch sdp_invalid_request_syntax,zero
+	call 	sdp_store_continue_common
+	nbranch sdp_invalid_pdu_size,zero
+	arg mem_sdp_uuid_search_ptr,timeup
+	call search_all_uuid  
+	deposit queue
+	branch ssa_empty_rsp,blank
+	store 1,mem_handle_humber
+//	storer regb,2,mem_sdp_all_length
+	copy regb,pdata
+	store 2,mem_sdp_all_length
+	arg 0,queue
+	arg 0,rega
+	call l2cap_get_sdp_tx_payload
+	increase 10,contw 
+ssa_req_range_find_handle:
+	call ssa_req_range_get_length	
+	nbranch assert,user
+	copy contr,timeup
+	copy pdata,regc
+	iadd rega,rega
+//	copy pdata,rega 
+//	fetch 2,mem_sdp_all_length
+	fetch 2,mem_sdp_continue_byte
+	copy pdata,regb
+	branch ssa_req_range_first_freg,blank
+ssa_req_range_later_freg_with_continue:
+	copy rega,pdata
+	isub regb,regb //total_length - continue_byte in rega
+	branch ssa_req_range_next_handle,zero
+	nbranch ssa_req_range_next_handle,positive
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub regb, null
+	branch ssa_req_range_maxbyte_with_continue,zero
+	nbranch ssa_req_range_maxbyte_with_continue, positive  
+	
+ // data length < =maxbyte 
+ssa_req_range_send_not_maxbyte:
+ 	copy regb,loopcnt
+	call ssa_req_range_maxbyte_with_continue_cpy
+ 	fetch 1,mem_handle_humber
+	increase 1,queue
+	isub queue,null
+	branch ssa_req_range_lastfreg,zero
+	branch ssa_req_range_freg_with_continue
+	
+ssa_req_range_maxbyte_with_continue:
+ 	copy pdata,loopcnt
+ 	call ssa_req_range_maxbyte_with_continue_cpy
+ 	branch ssa_req_range_freg_with_continue
+ 	
+ssa_req_range_maxbyte_with_continue_cpy:
+	increase -3,contw   
+	copy loopcnt,temp
+ 	copy regc,pdata
+	isub regb,pdata
+	iadd timeup,contr
+ 	branch memcpy
+
+ssa_req_range_next_handle:
+	fetch 1,mem_handle_humber
+	increase 1,queue
+	isub queue,null
+	rtn zero //
+	branch ssa_req_range_find_handle
+
+ssa_req_range_get_length:	
+	call disable_user
+	arg mem_sdp_handle_list,contr
+	lshift2 queue,pdata
+	iadd contr,contr
+	ifetcht 4, contr
+	call search_handle
+	nrtn zero
+	call sdp_data_len
+	branch enable_user
+
+ssa_req_range_first_freg:
+	fetch 2, mem_sdp_attribute_maxbyte
+	isub rega, null
+	nbranch ssa_req_range_firstfreg_maxbyte_with_continue,positive
+	copy rega,loopcnt
+	copy loopcnt,temp
+	copy timeup,contr
+	call memcpy
+	fetch 2,mem_sdp_all_length
+	isub rega,null
+	branch ssa_req_range_freg_no_continue,zero
+ssa_req_range_firstfreg_not_maxbyte_with_continue:
+	call ssa_req_range_freg_with_continue
+	branch ssa_req_range_attrbutes_length
+	
+ssa_req_range_freg_no_continue:
+	call ssa_req_range_lastfreg
+	branch ssa_req_range_attrbutes_length
+	
+ssa_req_range_lastfreg:
+	arg SDP_SEARCHATTRIB_RES,rega  //PUD ID
+ssa_req_range_lastfreg_common:
+	force 0,pdata
+	istore 1,contw
+	call ssa_req_range_common
+	fetcht 2,mem_sdp_tx_pkt_length
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw
+	increase -3,temp
+	byteswap temp,pdata
+	istore 2, contw  //attribute length
+	rtn
+
+ssa_req_range_firstfreg_maxbyte_with_continue:
+	copy pdata,loopcnt
+	copy loopcnt,temp
+	copy timeup,contr
+	call memcpy
+	call ssa_req_range_freg_with_continue
+ssa_req_range_attrbutes_length:	
+	setarg 0x36
+	istore 1,contw
+	fetch 2,mem_sdp_all_length
+	byteswap pdata,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_attrbutes_length_no_continue:	
+	setarg 0x36
+	istore 1,contw
+	increase -3,temp
+	byteswap temp,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_freg_with_continue:
+	arg SDP_SEARCHATTRIB_RES,rega  //PUD ID
+	setarg 2
+	istore 1,contw	
+	fetch 2,mem_sdp_continue_byte
+	iadd temp,temp
+	byteswap temp,pdata
+	istore 2,contw
+	call ssa_req_range_common
+	fetcht 2,mem_sdp_tx_pkt_length
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw
+	increase -5,temp
+	byteswap temp,pdata
+	istore 2, contw 
+	rtn	
+
+ssa_req_range_common:
+	fetch 2,mem_sdp_tx_payload_ptr
+	isub contw,pdata
+	sub pdata,0,pdata
+	store 2,mem_sdp_tx_pkt_length
+	call l2cap_get_sdp_tx_payload 
+	copy rega,pdata  //PUD ID
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid
+	istore 2,contw
+	rtn
+
+
+
+
+/**********************************************************************/
+/* ssa_res			                      */
+/* Processing Service Search Attribute Response                       */
+/* Call: dataelementtype6, attribute_reading                    */
+/* Input:       contr                                                 */
+/* Output:      mem_sdp_record_handle,mem_sdp_search_failed           */
+/*                                                                    */
+/**********************************************************************/     
+sdp_process_ssa_res:
+sdp_process_ss_res:
+sdp_process_sa_res:
+sdp_process_error_res:
+	rtn
+/*
+sdp_process_ss_res:
+	bpatchx patch2f_6,mem_patch2f
+	ifetch 2,contr
+	ifetch 2,contr
+	byteswap pdata,pdata
+	bne 1,assert
+	ifetch 4,contr
+	store 4,mem_sdp_record_handle
+	fetchr regc,2,mem_sdp_l2capch_ptr
+	add regc,offset_lc_state,regc
+	ifetch 1,regc
+	set1 L2CAP_CHANNEL_STATE_RECV_SEARCH_RES,pdata
+	istore 1,regc
+	rtn
+	
+sdp_process_sa_res:
+	bpatchx patch2f_7,mem_patch2f
+	fetchr regc,2,mem_sdp_l2capch_ptr
+	add regc,offset_lc_state,regc
+	ifetch 1,regc
+	set1 L2CAP_CHANNEL_STATE_RECV_ATTRIB_RES,pdata
+	istore 1,regc
+	copy temp,contr
+	ifetch 2,contr
+	call search_rfcomm_cn
+	store 1,mem_profile_channel	
+	rtn
+*/
+
+				    
+
+sdp_invalid_service_record_handle:		
+	setarg 0x0200
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_invalid_pdu_size:				
+	setarg 0x0400
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_insufficient_resource:			
+	setarg 0x0600
+	store 2,mem_sdp_error_code
+	branch sdp_error_response
+sdp_invalid_request_syntax:			
+	setarg 0x0300
+	store 2,mem_sdp_error_code
+sdp_error_response:	
+	call l2cap_get_sdp_tx_payload
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid			
+	istore 2,contw
+	setarg 0x0200					
+	istore 2,contw
+	fetch 2,mem_sdp_error_code			
+	istore 2,contw
+	jam  7,mem_sdp_tx_pkt_length
+	rtn
+
+
+//store uuid in mem_sdp_uuid_search_ptr,
+//return temp 0xff if wrong 
+ask_serviceclassid:  
+	arg 0,regb
+	force 0,temp					/* use "temp" to mark syntax error or to mark 128 bit uuid */
+	arg mem_sdp_uuid_search_ptr,contw
+	call dataelementtype6
+	branch asksrv_error,zero
+classidloop:
+	increase 1,regb
+	ifetch 1,contr
+	increase -1,rega
+	increase -1,timeup
+	compare 0x18,pdata,0xf8			/* 5 MSB: b00011: uuid */
+	nbranch asksrv_error,true
+	compare 0x04,pdata,0x07			/* 3 LSB: b100 128 bits uuid */
+	nbranch cmp032,true
+	force 1,temp					/* mark it as 128 bit uuid */
+skip2bytes:
+	ifetch 1,contr
+	increase -1,rega	
+	increase -1,timeup
+	bne 0x00, frstbwrong
+	ifetch 1,contr
+	increase -1,rega	
+	increase -1,timeup
+	beq 0x00, cmpuuid
+	branch scndbwrong
+frstbwrong:  
+	increase 1,contr
+	increase -1,rega	
+	increase -1,timeup
+scndbwrong:  
+	increase 2,contr				/* skip 2 bytes, first 2 bytes already wrong */
+	increase -2,rega	
+	increase -2,timeup
+	compare 0x00,temp,0xff                        /* 128 bits or 32 bits ? */
+	branch loopornot,true
+	increase 12,contr				/* skip 12 bytes, first 2 bytes already wrong */
+	increase -12,rega	
+	increase -12,timeup
+	branch loopornot
+cmp032:
+	compare 0x02,pdata,0x07			/* 3 LSB: b010 32 bits uuid */
+	nbranch cmp016,true
+	branch skip2bytes			
+cmp016:
+	compare 0x01,pdata,0x07			/* 3 LSB: b001 16 bit uuid */
+	nbranch asksrv_error,true
+cmpuuid:
+	increase -2,rega
+	increase -2,timeup
+	ifetch 2,contr				/* higher order byte */
+	sub regb,4,null
+	branch uuidsize,zero //max store uuids =3 
+	istore 2,contw
+uuidsize:
+	compare 0x00,temp,0xff			/* is this 128 bits uuid */
+	branch loopornot,true
+	copy contr,temp
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x10, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x80, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x00, wrong12b
+	ifetch 1,contr
+	bne 0x80, wrong12b
+	ifetch 1,contr
+	bne 0x5f, wrong12b
+	ifetch 1,contr
+	bne 0x9b, wrong12b
+	ifetch 1,contr
+	bne 0x34, wrong12b
+	ifetch 1,contr
+	beq 0xfb, chck12dn
+wrong12b:
+	copy temp,contr  
+wrong12b1:
+	increase 12,contr				/* skip 12 bytes */
+	force 0x00,queue
+	force 0x00,temp
+	branch chck12dn
+
+chck12dn:
+	increase -12,timeup
+	increase -12,rega
+loopornot:
+	force 0x00,temp
+	compare 0x00,rega,0xff
+	nbranch classidloop,true
+	force 0,pdata
+	istore 2,contw			/* end list with null */
+	rtn
+asksrv_error:
+	arg 0xff,temp
+	rtn
+
+/**********************************************************************/
+/* Subroutine: dataelementtype6                                    */
+/* Parse Data Element Sequence, obtain the data size                  */
+/* Input:  SDP Rx Buf Pointer in contr, parameter count in timeup     */
+/* Output: data length in rega, data pointer in contr             */
+/*         and  parameter count in timeup, return with zero flag set: */
+/*         syntax error                                               */
+/**********************************************************************/     
+dataelementtype6:
+	bpatchx patch30_0,mem_patch30
+	ifetch 1,contr
+	increase -1,timeup
+	compare 0x30,pdata,0xf8			/* 5 MSB: b00110: type 6 */
+	nbranch dsize_error,true
+	compare 0x07,pdata,0x07			/* 3 LSB: b111: 32 bits */
+	branch dsize32,true
+	compare 0x06,pdata,0x07			/* 3 LSB: b110: 16 bits */
+	branch dsize16,true
+	compare 0x05,pdata,0x07			/* 3 LSB: b101: 8 bits */
+	nbranch dsize_error,true
+//	ifetchr rega,1,contr				/* data length in reg A */
+	ifetch 1,contr
+	copy pdata,rega
+	increase -1,timeup
+	branch dsize
+dsize32:
+	increase 2,contr				 
+	increase -2,timeup
+dsize16:
+	ifetch 2,contr
+	byteswap pdata,rega
+	increase -2,timeup
+dsize:
+	force 0x01,pdata
+	rtn
+dsize_error:
+	force 0x00,pdata
+	rtn
+
+/**********************************************************************/
+/* Subroutine: sa_empty_rsp                                      */
+/* Send empty response                                                */
+/*                                                                    */
+/* Input:       mem_sdp_pduid, mem_sdp_transactionid                  */
+/* Output:      mem_SDP_Tx_payload, mem_SDP_Tx_pkt_length             */
+/*                                                                    */
+/**********************************************************************/     
+ss_empty_rsp:
+	setarg SDP_SEARCH_RES
+	store 1, mem_sdp_pduid
+	branch empty_response
+sa_empty_rsp:
+	setarg SDP_ATTRIBUTE_RES
+	store 1, mem_sdp_pduid
+	branch empty_response
+ssa_empty_rsp:
+	setarg SDP_SEARCHATTRIB_RES
+	store 1, mem_sdp_pduid
+empty_response:
+	call l2cap_get_sdp_tx_payload			/* empty attribute list */
+//	fetchr regb,1,mem_sdp_pduid				/* PDUID */
+//	istorer regb,1,contw
+	fetch 1,mem_sdp_pduid
+	copy pdata,regb
+	istore 1,contw 
+	fetch 2,mem_sdp_transactionid			/* copy back transaction id */
+	istore 2,contw
+	setarg 0x0500
+	istore 2, contw
+	compare SDP_ATTRIBUTE_RES,regb,0xff			 
+	branch fullsearch,true
+	compare SDP_SEARCHATTRIB_RES,regb,0xff			 
+	branch fullsearch,true
+	setarg 0x000000
+	istore 5,contw
+	branch outempty
+
+fullsearch:					/* pduid must be 5 or 7 */
+	setarg 0x350200
+	istore 5,contw
+outempty:
+	jam 10,mem_sdp_tx_pkt_length
+	rtn
+
+//return length in pdata(whole element ,include header and data ), contr not change
+sdp_data_len:
+	call store_contw
+	call store_contr
+	call sdp_get_data
+	call get_contw
+	call get_contr
+	copy temp,pdata
+	rtn
+
+//return data length in pdata, contr is data pionter,return length in temp(whole element ,include header and data )
+sdp_get_data:
+	ifetch 1,contr
+	and pdata,0x7,loopcnt
+	rshift3 pdata,pdata
+	bne 0,sdp_get_data_type_not0
+sdp_get_data_type0:	
+	force 1,pdata
+	force 1,temp
+	rtn
+	
+sdp_get_data_type_not0_sizeindex01234:
+	call left_shift_n
+	add pdata,1,temp  //add header length
+	rtn
+sdp_get_data_type_not0:
+	deposit loopcnt
+	sub pdata,4,null
+	branch sdp_get_data_type_not0_sizeindex01234,positive
+	beq 5,sdp_get_data_type_not0_sizeindex5
+	beq 6,sdp_get_data_type_not0_sizeindex6
+	beq 7,sdp_get_data_type_not0_sizeindex7
+	rtn
+	
+sdp_get_data_type_not0_sizeindex5:
+	ifetch 1,contr
+	add pdata,2,temp  //add header length
+	rtn
+sdp_get_data_type_not0_sizeindex6:
+	ifetch 2,contr
+	byteswap pdata,pdata
+	add pdata,3,temp  //add header length
+	rtn
+sdp_get_data_type_not0_sizeindex7:
+	ifetch 2,contr	
+	byteswap pdata,pdata
+	ifetcht 2,contr	
+	byteswap temp,temp
+	lshift16 temp,temp
+	iadd temp,pdata
+	add pdata,5,temp  //add header length
+	rtn
+
+/* find with uuids
+input uuids pionter in timeup
+return handles in mem_sdp_handle_list; handles number in queue if found 
+return regb all length*/
+search_all_uuid:
+	bpatchx patch30_1,mem_patch30
+	force 0,queue
+	arg 0,regb
+	arg mem_sdp_handle_list,contw
+search_all_uuid_llop:
+	ifetch 2,timeup
+ 	rtn blank
+	call search_uuid
+	copy queue,pdata
+	rtneq SDP_MAX_HANDLE_NUMBER 
+	increase 2,timeup
+ 	branch search_all_uuid_llop
+	
+search_uuid:
+//	arg 0,regb
+	iforce regc
+//	force 0,queue
+	fetch 2, mem_ui_uuid_table
+	iforce contr
+search_uuid_next:
+	copy queue,pdata
+	rtneq SDP_MAX_HANDLE_NUMBER   
+	disable user
+	ifetch 1,contr
+	rtn blank
+	iforce loopcnt
+search_uuid_loop:	
+	ifetch 2,contr
+	isub regc,null
+	nbranch search_uuid_not_found,zero
+	enable user					// uuid match
+search_uuid_not_found:
+	loop search_uuid_loop
+	ifetcht 4,contr					// get handle 
+	copy contr,rega
+	nbranch search_uuid_nomatch,user
+	arg mem_sdp_handle_list,contr
+	arg SDP_MAX_HANDLE_NUMBER,loopcnt 
+search_uuid_check_same_handle:
+	ifetch 4,contr
+	branch search_uuid_store_handle,blank
+	isub temp,null
+	branch search_uuid_nomatch,zero
+	loop search_uuid_check_same_handle
+	rtn 
+search_uuid_store_handle:
+	istoret 4,contw
+	increase 1,queue
+	copy rega,contr
+	call sdp_data_len
+	iadd regb,regb
+	iadd contr,contr		 
+	branch search_uuid_next
+search_uuid_nomatch:	
+	copy rega,contr
+	call sdp_get_data
+	iadd contr,contr			// next paragraph 
+	branch search_uuid_next
+
+/* temp is handle,
+return zero  if found
+return data pointer in contr 
+*/
+search_handle:
+	bpatchx patch30_2,mem_patch30
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_handle_loop:	
+	ifetch 1,contr
+	branch disable_zero,blank
+	lshift pdata,pdata
+	iadd contr,contr
+	ifetch 4,contr
+	isub temp,null
+	rtn zero
+	deposit contw
+	store 2,mem_contw
+	storet 8,mem_temp
+	call sdp_get_data
+	iadd contr,contr
+	copy contr,pdata
+	fetcht 2,mem_contw
+	copy temp,contw
+	fetcht 8,mem_temp
+	copy pdata,contr
+	branch search_handle_loop
+
+/**
+* input regb and regc.regb is the attribute ID and regc is UUID.
+* set contr if find attribute or 0 if not
+*/
+search_attrib:
+	bpatchx patch30_3,mem_patch30
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_attrib_next:
+	ifetch 1,contr
+	branch search_attrib_end, blank
+	iforce loopcnt
+search_attrib_loop:	
+	ifetch 2,contr
+	isub regc,null						/* regc is UUID, compare it */
+	branch search_attrib_found_uuid,zero
+	loop search_attrib_loop
+	increase 4,contr
+	call sdp_get_data
+	iadd contr,contr			/* next paragraph */
+	branch search_attrib_next	
+search_attrib_found_uuid:
+	increase -1,loopcnt
+	lshift loopcnt,pdata
+	iadd contr,contr
+	increase 4,contr
+	call sdp_get_data
+	iadd contr,timeup					/* attribute list end */
+search_attrib_loop_attribs:	
+	increase 1,contr
+	ifetch 2,contr
+	isub regb,null
+	//force 0x1,pdata,zero
+//	setflag zero, 0,pdata
+//	copy timeup, timeup
+	branch disable_blank,zero			/* attribute found */
+	call sdp_data_len
+	iadd contr,contr
+	deposit timeup
+	isub contr,null
+	branch search_attrib_end, zero /*attribute end, not found the attribute, return contr = 0*/
+	branch search_attrib_loop_attribs	
+search_attrib_end:
+	force 0,contr
+	force 0,pdata
+	rtn
+	
+
+//search the attribute according the record handle
+//record handle in temp, attribute in regb
+//set the contr to zero if not found
+search_handle_attrib:	
+	bpatchx patch30_4,mem_patch30
+	fetch 2,mem_ui_uuid_table
+	iforce contr
+search_handle_attrib_next:
+	ifetch 1,contr
+	branch search_handle_attrib_end, blank
+	lshift pdata,pdata
+	iadd contr, contr
+	ifetch 4,contr
+	isub temp,null						/* regc is UUID, compare it */
+	branch search_handl_attrib_found_handle,zero
+	call sdp_get_data
+	iadd contr,contr			/* next paragraph */
+	branch search_handle_attrib_next	
+search_handl_attrib_found_handle:
+	call sdp_get_data
+	iadd contr,timeup					/* attribute list end */
+search_handle_attrib_loop_attribs:	
+	increase 1,contr
+	ifetch 2,contr
+	isub regb,null
+	rtn zero							/* attribute found */
+	call sdp_data_len
+	iadd contr,contr
+	deposit timeup
+	isub contr,null
+	branch search_handle_attrib_end, zero /*attribute end, not found the attribute, return contr = 0*/
+	branch search_handle_attrib_loop_attribs
+search_handle_attrib_end:
+	force 0,contr
+	rtn	
+
+
+//enable user if find rfcomm channel number, pdata is channel number
+search_rfcomm_cn:
+	arg 0x0400,regb  // attribute protocol edscriptor list
+	call search_handl_attrib_found_handle
+	arg 0x0300,regb  // uuid rfcomm
+	call search_uuid_in_data
+	nrtn user
+	sub rega,3,null
+	branch disable_user,positive
+	ifetch 1,contr
+	bne 0x08,disable_user
+	ifetch 1,contr
+	rtn
+	
+ //input timeup is lenth
+ //input contr is data ptr
+ //return contr is end of uuid; enable user if found uuid
+search_uuid_in_data:
+	bpatchx patch30_5,mem_patch30
+	call sdp_get_data
+	copy pdata,rega
+search_uuid_in_data_loop:	
+	ifetch 1,contr
+	and pdata,0x7,loopcnt
+	rshift3 pdata,pdata
+	sub pdata,3,null
+	branch search_uuid_in_data_found_uuid,zero
+	copy loopcnt,pdata
+	beq 5,search_uuid_in_data_found_element_index5
+	beq 6,search_uuid_in_data_found_element_index6
+	beq 7,search_uuid_in_data_found_element_index7
+	increase -1,contr
+	call sdp_get_data
+	iadd contr,contr
+	copy rega,pdata
+	isub temp,rega
+	branch disable_user,zero
+	branch search_uuid_in_data_loop
+	
+search_uuid_in_data_found_element_index5:
+	increase -2,rega
+	increase 1,contr
+	branch search_uuid_in_data_loop
+search_uuid_in_data_found_element_index6:
+	increase -3,rega
+	increase 2,contr
+	branch search_uuid_in_data_loop
+search_uuid_in_data_found_element_index7:
+	increase -5,rega
+	increase 4,contr
+	branch search_uuid_in_data_loop		
+	
+search_uuid_in_data_found_uuid:
+	increase -1,rega
+	copy loopcnt,pdata
+	beq 1,search_uuid_in_data_type_uuid_16
+	beq 2,search_uuid_in_data_type_uuid_32
+	beq 4,search_uuid_in_data_type_uuid_128
+	branch disable_user 
+search_uuid_in_data_type_uuid_128:
+	increase -12,rega
+search_uuid_in_data_type_uuid_32:
+	ifetch 2,contr
+	increase -2,rega
+search_uuid_in_data_type_uuid_16:
+	ifetch 2,contr
+	isub regb,null
+	branch enable_user,zero
+	increase -2,rega
+	branch disable_user,zero
+	branch search_uuid_in_data_loop
+
+/*
+//rega:l2cap len ,mem_search_uuid:uuid to search
+sdp_send_search_req:
+	call l2cap_malloc_sdp_req
+	setarg SDP_SEARCH_REQ
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid_local
+	byteswap pdata,pdata
+	istore 2,contw
+	increase -5,rega
+	byteswap rega,rega
+	//istorer rega,2,contw
+	copy rega,pdata
+	istore 2,contw
+	setarg 0x0335
+	istore 2,contw
+	setarg 0x19
+	istore 1,contw
+	fetch 2,mem_search_uuid
+	istore 2,contw
+	setarg 0x0008
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	rtn
+
+//rega:l2cap len
+sdp_send_attribute_req:
+	call l2cap_malloc_sdp_req
+	setarg SDP_ATTRIBUTE_REQ
+	istore 1,contw
+	fetch 2,mem_sdp_transactionid_local
+	byteswap pdata,pdata
+	istore 2,contw
+	increase -5,rega
+	byteswap rega,rega
+//	istorer rega,2,contw
+	copy rega,pdata
+	istore 2,contw
+	fetch 4,mem_sdp_record_handle
+	istore 4,contw
+	setarg 0x2c01
+	istore 2,contw
+	setarg 0x0535
+	istore 2,contw
+	setarg 0x0a
+	istore 1,contw
+	setarg 0
+	istore 2,contw
+	setarg -1
+	istore 2,contw
+	setarg 0
+	istore 1,contw
+	rtn
+*/	
+	
+
+sdp_send_spp_request:
+	call l2cap_get_sdp_tx_payload
+	copy pdata,contw
+	setarg 6//Search Attr Req
+	istore 1,contw
+	setarg sdp_tid_spp					
+	istore 2,contw
+	setarg 0x0f00 //length15
+	istore 2,contw
+	setarg 0x1a0535
+	istore 3,contw
+	setarg 0x0111
+	lshift16 pdata,pdata //UUID
+	istore 4,contw
+	setarg 0x2600 //max return len
+	istore 2,contw
+	setarg 0x0335
+	istore 2,contw
+	setarg 0x0009
+	istore 2,contw
+	setarg 0x0004
+	istore 2,contw
+	jam 0x14,mem_sdp_tx_pkt_length
+	rtn
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/security.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/security.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/security.prog	(working copy)
@@ -0,0 +1,1642 @@
+
+ifdef SECURE_CONNECTION
+	
+function_g2:
+	bpatchx patch30_6,mem_patch30
+	jam 80,mem_AES_CMAC_data_length
+	arg memdat,contw
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_le_pubkey_local_x_256,contr
+	call memcpy32
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	call inverse_memdat	
+	arg mem_le_mrand,contr
+	call store_inverse_k	
+	call function_AES_CMAC	
+
+	arg mem_AES_CMAC_temp,contw
+	call load_inverse_result
+	setarg 1000000
+	copy pdata,rega
+	fetch 4,mem_AES_CMAC_temp
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	store 4,mem_gkey
+//call ice_break
+	rtn
+
+function_f6_eb:
+	jam 65,mem_AES_CMAC_data_length
+	arg memdat,contw
+	call store_addr_common_a
+	call store_addr_common_b
+	fetch 3,mem_le_pres+1
+	istore 3,contw
+//	arg mem_le_r,contr
+//	call memcpy16	
+	call get_r
+	
+	arg mem_le_mrand,contr
+	call memcpy16
+	arg mem_le_srand,contr
+	call memcpy16
+	call inverse_memdat
+	arg mem_le_mackey ,contr
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+//	call p_store_inverse_k	
+	branch function_AES_CMAC
+//	arg mem_AES_CMAC_temp,contw
+//	branch p_load_inverse_result
+
+get_r:
+	fetch 4,mem_le_tk
+	istore 4,contw
+	call memset0_4
+	branch memset0_8
+
+function_f6_ea:
+	bpatchx patch30_7,mem_patch30
+	jam 65,mem_AES_CMAC_data_length
+	arg memdat,contw
+	call store_addr_common_b
+	call store_addr_common_a
+	fetch 3,mem_le_preq+1
+	istore 3,contw
+//	arg mem_le_r,contr
+//	call memcpy16	
+	call get_r
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_le_mrand,contr
+	call memcpy16
+	call inverse_memdat
+	arg mem_le_mackey ,contr
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+//	call p_store_inverse_k	
+	call function_AES_CMAC
+	arg mem_AES_CMAC_temp,contw
+	branch load_inverse_result
+
+function_f5:
+	jam 32,mem_AES_CMAC_data_length
+	arg mem_le_dhkey_256 ,contr
+	arg memdat,contw
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_slat,contr
+	call store_inverse_k	
+	call function_AES_CMAC
+	arg mem_AES_CMAC_k,contw
+	call store_aes_result
+	arg 1,temp
+	call function_f5_common
+	arg mem_le_ltk,contw
+	call load_inverse_result
+	arg 0,temp
+	call function_f5_common
+	arg mem_le_mackey,contw
+//	branch p_load_inverse_result
+	branch store_aes_result
+
+
+function_f5_common:
+	bpatchx patch31_0,mem_patch31
+	jam 53,mem_AES_CMAC_data_length
+	setarg 0x100
+	store 2,memdat
+	call store_addr_common_b
+	call store_addr_common_a
+	arg mem_le_srand,contr
+	call memcpy16
+	arg mem_le_mrand,contr
+	call memcpy16
+//	fetch 4,mem_le_keyid 0x62746c65
+	setarg 0x6c65
+	istore 2,contw
+	setarg 0x6274
+	istore 2,contw
+	istoret 1,contw   //counter
+	call inverse_memdat	
+	branch function_AES_CMAC
+
+store_addr_common_b:
+	fetch 6,mem_le_lap
+	istore 6,contw
+	fetch 1,mem_le_conn_own_addr_type
+	istore 1,contw
+	rtn
+
+store_addr_common_a:
+	fetch 6,mem_le_plap
+	istore 6,contw
+//	setarg 0x2dcfc1
+//	istore 3,contw
+//	setarg 0xa71370
+//	istore 3,contw
+	fetch 1,mem_le_conn_peer_addr_type
+	istore 1,contw
+	rtn
+
+function_f4_ca:
+	jam 65,mem_AES_CMAC_data_length
+	fetch 1,mem_passkey_1bit
+	store 1,memdat
+	arg mem_le_pubkey_local_x_256,contr
+	call memcpy32
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_mrand,contr
+	call store_inverse_k	
+	branch function_AES_CMAC
+	
+
+function_f4_cb:
+	jam 65,mem_AES_CMAC_data_length
+	fetch 1,mem_passkey_1bit
+	store 1,memdat
+	arg mem_le_pubkey_remote_x_256,contr
+	call memcpy32
+	arg mem_le_pubkey_local_x_256,contr
+	call memcpy32
+	call inverse_memdat
+	arg mem_le_srand,contr
+	call store_inverse_k	
+	branch function_AES_CMAC
+
+function_AES_CMAC:
+	bpatchx patch31_1,mem_patch31
+	call function_AES_CMAC_Generate_Subkey
+//call ice_break
+//	jam 65,mem_AES_CMAC_data_length
+//call ice_break
+	fetch 1,mem_AES_CMAC_data_length
+	copy pdata,temp
+function_ceil16:
+	increase 15,pdata
+	rshift4 pdata,pdata
+	copy pdata,regb
+	branch function_AES_CMAC_set_flag_0_balnk,blank
+	and temp,0x0f,pdata
+	nbranch function_AES_CMAC_set_flag_0,blank
+//	flag =1;
+	arg mem_AES_CMAC_k1,regc
+	arg memdat,pdata
+	increase -16,pdata
+//	iadd temp,pdata
+//	isub rega,rega
+	iadd temp,rega	
+	arg mem_AES_CMAC_M_last,contw
+	arg 4,loopcnt	
+	call xor_loop
+//call ice_break
+//	arg mem_f4_k1,contr
+//	call load_key
+	branch function_AES_CMAC_aes
+
+function_AES_CMAC_set_flag_0_balnk:
+	arg 1,regb
+	arg 0,rega
+//	arg mem_f4_test_data,pdata
+	branch function_AES_CMAC_set_flag_0_common
+//call ice_break
+
+function_AES_CMAC_set_flag_0:
+//	flag = 0;
+	and temp,0x0f,rega
+function_AES_CMAC_set_flag_0_common:
+	arg memdat,pdata
+	iadd temp,pdata
+	isub rega,contr
+//call ice_break
+	arg mem_AES_CMAC_temp,contw
+	call function_AES_CMAC_padding
+//call ice_break
+	arg mem_AES_CMAC_k2,regc
+	arg mem_AES_CMAC_temp,rega
+	arg mem_AES_CMAC_M_last,contw
+	arg 4,loopcnt	
+	call xor_loop	
+//call ice_break
+
+//	arg mem_f4_k2,contr
+//	call load_key
+
+//	branch p_function_f4_aes
+function_AES_CMAC_aes:
+//	arg mem_f4_k,contr
+//	call load_key
+//	arg mem_AES_CMAC_xor,contr
+//	call load_data128
+	call aes_clear_data
+	call aes_init	
+//	arg mem_f4_k,contr
+//	call load_key
+	arg memdat,contr
+function_AES_CMAC_aes_loop:
+//generate_mic_loop:
+	increase -1,regb
+	deposit regb
+	branch function_AES_CMAC_aes_loop_end,blank
+	call load_data128
+	call do_aes_cbc
+	branch function_AES_CMAC_aes_loop
+//generate_mic_end:
+function_AES_CMAC_aes_loop_end:	
+	arg mem_AES_CMAC_temp,contw
+	call store_aes_result
+	arg mem_AES_CMAC_M_last,contr
+	call load_data128
+	call aes_init	
+	arg mem_AES_CMAC_temp,contr
+	call load_data128	
+	branch do_aes_cbc
+
+
+
+load_inverse_result:
+//	arg mem_AES_CMAC_temp,contw
+	copy contw,rega
+	call store_aes_result
+//	arg mem_AES_CMAC_temp,rega
+	arg 16,loopcnt
+	branch inverse_data
+	
+store_inverse_k:
+	arg mem_AES_CMAC_k,contw
+	call memcpy16
+inverse_k:	
+	arg 16,loopcnt
+	arg mem_AES_CMAC_k,rega	
+	branch inverse_data
+	
+inverse_memdat:
+	fetch 1,mem_AES_CMAC_data_length
+	copy pdata,loopcnt
+	arg memdat,rega
+	branch inverse_data
+
+bn_lshift_0_inverse:
+	ifetch 1,regA
+	lshift pdata,pdata
+	isolate1 0,regC
+	setflag true,0,pdata	
+	isolate1 8,pdata
+	setflag true,0,regC	
+	istore 1,rega
+         increase -1,rega
+	loop bn_lshift_0_inverse
+	rtn	
+
+function_AES_CMAC_k1_inverse:
+	arg mem_AES_CMAC_k1,regA
+function_AES_CMAC_inverse_common:
+	increase 15,rega
+	force 16,loopcnt
+	force 0,regC
+	branch  bn_lshift_0_inverse	
+
+function_AES_CMAC_k2_inverse:
+	arg mem_AES_CMAC_k2,regA
+	branch function_AES_CMAC_inverse_common
+	
+
+function_AES_CMAC_Generate_Subkey:
+	arg mem_AES_CMAC_k,contr
+	call load_key128
+//	arg mem_AES_CMAC_xor,contr
+//	call aes_load_xor
+	force regidx_xor,regext_index
+	call aes_clear
+	call aes_clear_data
+
+	call do_aes_ecb
+	
+//	force 0x38,aes_ctrl
+//	force 0x0,aes_ctrl
+//	call wait_aes
+	arg mem_AES_CMAC_k1,contw
+	call store_aes_result
+function_AES_CMAC_k1:
+	bpatchx patch31_2,mem_patch31
+	fetch 1,mem_AES_CMAC_k1
+	isolate1 7,pdata
+	nbranch function_AES_CMAC_k1_0,true	
+	call function_AES_CMAC_k1_inverse
+	
+//p_function_f4_k1_xor:
+	arg mem_AES_CMAC_k1,regc
+//	arg mem_AES_CMAC_rb,rega
+	arg mem_AES_CMAC_k1,contw
+//	arg 3,loopcnt
+//	call xor_loop
+	call function_AES_CMAC_xor_rb
+	branch function_AES_CMAC_k2
+function_AES_CMAC_k1_0:	
+	call function_AES_CMAC_k1_inverse
+function_AES_CMAC_k2:
+//call ice_break
+	arg mem_AES_CMAC_k1,contr
+	arg mem_AES_CMAC_k2,contw
+	call memcpy16
+	fetch 1,mem_AES_CMAC_k2
+	isolate1 7,pdata
+	nbranch function_AES_CMAC_k2_inverse,true		
+	call function_AES_CMAC_k2_inverse
+//p_function_f4_k2_xor:
+	arg mem_AES_CMAC_k2,regc
+//	arg mem_AES_CMAC_rb,rega
+	arg mem_AES_CMAC_k2,contw
+//	arg 3,loopcnt
+//	branch xor_loop	
+
+
+//rb:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 87 
+function_AES_CMAC_xor_rb:
+	arg 3,loopcnt
+function_AES_CMAC_xor_rb_loop:	
+	arg 0,temp
+	call function_AES_CMAC_xor_loop_common	
+	increase 4,regc
+	loop  function_AES_CMAC_xor_rb_loop
+	arg 0x8700,temp
+	lshift16 temp,temp
+function_AES_CMAC_xor_loop_common:	
+	ifetch   4,regc
+	ixor  temp,pdata
+	istore   4,contw	
+	rtn
+		
+
+
+
+//input rega :length <16	contr,contw
+function_AES_CMAC_padding:
+	bpatchx patch31_3,mem_patch31
+	arg 16,loopcnt
+	arg 0,pdata
+function_AES_CMAC_padding_loop:
+	isub rega,null
+	branch function_AES_CMAC_padding_beq_length,zero
+	branch function_AES_CMAC_padding_big_length,positive
+	ifetcht 1,contr
+	istoret 1,contw
+function_AES_CMAC_padding_loop2:	
+	increase 1,pdata
+	loop function_AES_CMAC_padding_loop
+	rtn
+function_AES_CMAC_padding_beq_length:	
+	arg 0x80,temp
+function_AES_CMAC_padding_common:
+	istoret 1,contw
+	branch  function_AES_CMAC_padding_loop2
+
+function_AES_CMAC_padding_big_length:
+	arg 0,temp
+	branch function_AES_CMAC_padding_common
+
+endif
+	
+generate_kinit:
+	call function_e22
+	arg mem_input_store,contr
+	arg mem_kinit,contw		/* Kinit is ready */
+	branch memcpy16
+
+
+function_e21:	/* rega pointers to bdaddr */
+	disable user
+	call function_expand
+	arg mem_random_number,contr
+	arg mem_x,contw
+	force 15,loopcnt
+	call memcpy			
+	ifetch 1,contr
+	xor_into 6,pdata
+	istore 1,contw
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+
+
+	
+function_e22:		/* rega pointers to bdaddr */
+	fetcht 1,mem_pin_length
+	force 16,regb			/* total 16 bytes */
+	add temp,6,regc		/* regc is l' */
+	sub regc,16,null		
+	branch function_e22_pin_init,positive 
+	force 16,regc
+function_e22_pin_init:			/* generate x from pin and bdaddr */
+	arg mem_x,contw
+function_e22_genx_pin:
+	arg mem_pin,contr
+	copy temp,loopcnt
+	disable user
+function_e22_genx_loop:
+	ifetch 1,contr
+	istore 1,contw
+	increase -1,regb
+	branch function_e22_genx_end,zero
+	loop function_e22_genx_loop
+	branch function_e22_genx_pin,user
+	enable user
+	force 6,loopcnt
+	copy rega,contr
+	branch function_e22_genx_loop
+function_e22_genx_end:
+	arg mem_random_number,contr
+	arg mem_y,contw
+	call memcpy16
+	fetch 1,mem_y15
+	ixor regc,pdata
+	store 1,mem_y15	/* inpy[15] = rand_num[15]^l'; */
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+
+
+
+
+function_e1:	/* rega pointers to bdaddr */
+	disable user
+	call function_expand
+	branch function_hash
+
+function_e3:
+	arg mem_aco,rega
+	enable user
+	call function_expand
+	call function_hash
+	arg mem_input_store,contr
+	arg mem_kc,contw
+	branch memcpy16
+
+	/* costs 41769 clocks */
+function_hash:
+	setarg mem_random_number
+	store 2,memp_ar_input
+	setarg mem_link_key
+	store 2,memp_ar_key
+	set0 mark_ar2,mark
+	call function_ar
+	arg mem_input_store,rega
+	arg mem_random_number,regb
+	arg mem_x,contw
+	call xor16
+	arg mem_x,rega
+	arg mem_y,regb
+	copy regb,contw
+	enable user
+	call add16
+	call key_offset
+	setarg mem_y
+	store 2,memp_ar_input
+	setarg mem_x
+	store 2,memp_ar_key
+	set1 mark_ar2,mark
+	branch function_ar
+	
+
+	/* totally costs 20700 clocks */
+function_ar:
+	jam 0,mem_ar_hround
+	fetch 2,memp_ar_key
+	iforce contr
+	arg mem_key_store,contw
+	call memcpy16
+	fetch 2,memp_ar_input
+	iforce contr
+	arg mem_input_store,contw
+	call memcpy16
+	
+function_ar_loop:
+	call key_scheduling
+	disable user
+	bmark0 mark_ar2,function_ar_original
+	fetch 1,mem_ar_hround
+	bne 4,function_ar_original
+	fetchr regb,2,memp_ar_input
+	call xor_mod32_ar2
+function_ar_original:
+	call xor_mod32
+	call el_boxes
+	fetch 1,mem_ar_hround
+	increase 1,pdata
+	store 1,mem_ar_hround
+
+	call key_scheduling
+	enable user
+	call xor_mod32
+	call pht
+	call permute
+	call pht
+	call permute
+	call pht
+	call permute
+	call pht
+	fetch 1,mem_ar_hround
+	increase 1,pdata
+	store 1,mem_ar_hround
+	bne 16,function_ar_loop
+	call key_scheduling
+	disable user
+	branch xor_mod32
+	
+/* input round number and temp key in mem_key_store, and output the next temp key in mem_key_store */
+/* round key is generated and store in mem_round_key */
+key_scheduling:
+	fetch 1,mem_ar_hround
+	arg mem_key_store,contr
+	branch key_sched_zero,blank
+	iforce regb      			/* regb is half round */
+	force 17,loopcnt
+	copy contr,contw
+key_rotateloop:
+	ifetch 1,contr
+	lshift3 pdata,temp
+	rshift2 pdata,pdata
+	rshift3 pdata,pdata
+	ior temp,pdata
+	istore 1,contw
+	loop key_rotateloop
+	setarg mem_key_store
+	iadd regb,contr
+	force 16,loopcnt    
+	arg mem_round_key,contw
+key_select_octet_loop:
+	ifetch 1,contr
+	istore 1,contw
+	compare mem_key_store_end,contr,0xff
+	nbranch key_select_octet_nwrap,true
+	increase -17,contr
+key_select_octet_nwrap:
+	loop key_select_octet_loop
+	force 0,rega         /* rega is index of octet within row */
+	add regb,-1,regc    /* this is the row index, half_round#1 is 0 */
+	lshift2 regc,regc
+	lshift2 regc,regc
+	call enable_authrom
+	setarg mem_b_box
+	iadd regc,regc       /* regc hold the starting address of the row */
+	arg mem_round_key,contw
+	force 16,loopcnt
+bias_round_key_loop:
+	ifetcht 1,regc
+	ifetch 1,contw
+	iadd temp,pdata
+	istore 1,contw
+	increase 1,regc
+	loop bias_round_key_loop
+	branch disable_authrom
+
+key_sched_zero:    /* round 0, key1 */
+	force 16,loopcnt
+	force 0,temp
+create_byte_16_loop:
+	ifetch 1,contr
+	ixor temp,temp
+	loop create_byte_16_loop
+	deposit temp
+	istore 1,contr    	/* store the byte #16 */
+	arg mem_key_store,contr
+	arg mem_round_key,contw
+	branch memcpy16
+
+xor_mod32:     /* xor on 0,3, add on 1,2. if user is set, invert. x in rega and y in regb, out in contw */
+	arg mem_round_key,regb
+xor_mod32_ar2:
+	force 16,loopcnt
+	arg mem_input_store,rega
+	copy rega,contw
+xor_mod32_loop:	
+	ifetcht 1,rega
+	ifetch 1,regb
+	ixor temp,alarm
+	and loopcnt,3,regc
+	nbranch xor_mod32_invert,user
+	xor_into 3,regc
+xor_mod32_invert:
+	sub regc,1,regc
+	branch xor_even,positive
+	iadd temp,alarm
+xor_even:
+	istorer alarm,1,contw
+	increase 1,rega
+	increase 1,regb
+	loop xor_mod32_loop
+	rtn
+
+el_boxes:
+	call enable_authrom
+	force 16,loopcnt
+	arg mem_input_store,rega
+el_box_loop:	
+	ifetch 1,rega
+	arg mem_e_box,contr
+	and loopcnt,3,regc
+	sub regc,1,null
+	branch e_boxes,positive
+	arg mem_l_box,contr
+e_boxes:
+	iadd contr,contr
+	ifetch 1,contr
+	istore 1,rega
+	increase 1,rega
+	loop el_box_loop
+	branch disable_authrom
+
+pht:				
+	force 8,loopcnt
+	arg mem_input_store,contr
+	copy contr,contw
+pht_loop:
+	ifetchr rega,1,contr
+	ifetchr regb,1,contr
+	lshift rega,pdata
+	iadd regb,pdata
+	istore 1,contw
+	deposit rega
+	iadd regb,pdata
+	istore 1,contw
+	loop pht_loop
+	rtn
+
+/* 8 11 12 15 2 1 6 5 10 9 14 13 0 7 4 3 */
+permute:			
+	setarg 0x8ae42c
+	iforce temp
+	force 7,loopcnt
+	call permute_exchange
+	setarg 0xd751b
+	iforce temp
+	force 5,loopcnt
+	call permute_exchange
+	fetchr rega,1,mem_input_store+15
+	fetch 1,mem_input_store+3
+	store 1,mem_input_store+15
+	storer rega,1,mem_input_store+3
+	rtn
+
+permute_exchange:
+	and temp,0xf,regb
+permute_loop:
+	and temp,0xf,pdata
+	arg mem_input_store,contw
+	iadd contw,contw
+	ifetchr regc,1,contw
+	istorer rega,1,contw
+	copy regc,rega
+	rshift4 temp,temp
+	loop permute_loop	
+	setarg mem_input_store
+	iadd regb,contw
+	istorer rega,1,contw
+	rtn
+
+add16:
+	enable user
+	branch xor_add16
+
+xor16:
+	disable user
+xor_add16:	/* if user is set, do add, else do xor */
+	force 16,loopcnt	/* rega and regb pointers to src, contw is result */
+xoradd_loop:
+	ifetcht 1,rega
+	ifetch 1,regb
+	branch xoradd_add,user
+	ixor temp,pdata
+	branch xoradd_store
+xoradd_add:	
+	iadd temp,pdata
+xoradd_store:	
+	istore 1,contw
+	increase 1,rega
+	increase 1,regb
+	loop xoradd_loop
+	rtn
+
+	
+function_expand:		/* rega pointers to bdaddr, or aco and user is set */
+	arg mem_y,contw
+	ifetch 6,rega
+	istore 6,contw
+	branch expand_12,user
+	ifetch 6,rega
+	branch expand_cont
+expand_12:
+	ifetch 6,contr
+expand_cont:
+	istore 6,contw
+	ifetch 4,rega
+	istore 4,contw
+	rtn
+
+key_offset:
+	arg mem_link_key,contr
+	arg mem_x,contw
+	arg 0,temp
+	setarg 0x8395a7
+	call concatenate_temp24
+	setarg 0xb3c1df
+	call concatenate_temp24
+	setarg 0xe5e9
+	call concatenate_temp16
+	copy temp,regab
+	disable user
+	call key_addxor
+	copy regab,temp
+	enable user
+	branch key_addxor
+
+key_addxor:
+	force 8,loopcnt
+key_addxor_loop:	
+	ifetch 1,contr
+	compare 1,loopcnt,1
+	branch key_high,user
+	branch key_xor,true
+key_add:	
+	iadd temp,pdata
+	branch key_store
+key_high:
+	branch key_add,true
+key_xor:
+	ixor temp,pdata
+key_store:
+	istore 1,contw
+	rshift8 temp,temp
+	loop key_addxor_loop
+	rtn
+
+copy_aco:
+	fetch 6,mem_input_store+4
+	store 6,mem_aco
+	ifetch 6,contr
+	istore 6,contw
+	rtn
+	
+concatenate_temp24:
+	lshift8 temp,temp
+concatenate_temp16:
+	lshift16 temp,temp
+	ior temp,temp
+	rtn
+
+ifdef TESTING
+test_security:
+	fetch 1,0xff
+	branch test_security,blank
+
+	/* inrand */
+	setarg 0x1BC683
+	store 3,0x0
+	setarg 0x122980
+	istore 3,contw
+	setarg 0xD0DB17
+	istore 3,contw
+	setarg 0x2B1D78
+	istore 3,contw
+	setarg 0x2743A6
+	istore 3,contw
+	setarg 0xD8
+	istore 1,contw
+
+	/* comb A */
+	setarg 0xA6D0C9
+	store 3,0x10
+	setarg 0xA9E86C
+	istore 3,contw
+	setarg 0x9E89D5
+	istore 3,contw
+	setarg 0xC61838
+	istore 3,contw
+	setarg 0x6F0318
+	istore 3,contw
+	setarg 0x9F
+	istore 1,contw
+
+	/* comb B */
+	setarg 0x7F6833
+	store 3,0x20
+	setarg 0xE62E1B
+	istore 3,contw
+	setarg 0x9F67FC
+	istore 3,contw
+	setarg 0x8D3712
+	istore 3,contw
+	setarg 0x0B846C
+	istore 3,contw
+	setarg 0x4A
+	istore 1,contw
+
+	/* auth rand A */
+	setarg 0xFBB686
+	store 3,0x30
+	setarg 0x19FE7F
+	istore 3,contw
+	setarg 0x16A439
+	istore 3,contw
+	setarg 0xF4F6A4
+	istore 3,contw
+	setarg 0x10D61D
+	istore 3,contw
+	setarg 0xDE
+	istore 1,contw
+
+	/* auth rand B */
+	setarg 0x735B0C
+	store 3,0x40
+	setarg 0xA7F06B
+	istore 3,contw
+	setarg 0x04625E
+	istore 3,contw
+	setarg 0x3463B0
+	istore 3,contw
+	setarg 0xB8F17A
+	istore 3,contw
+	setarg 0x7C
+	istore 1,contw
+
+	/* address A */
+	setarg 0xf91330
+	store 3,0xb0
+	setarg 0x664c7d
+	istore 3,contw
+
+	/* address B */
+	setarg 0xdc7100
+	store 3,0xb8
+	setarg 0x2ea003
+	istore 3,contw
+
+	/* sres A */
+	setarg 0x2EEE19
+	store 3,0x50
+	setarg 0x7E
+	istore 1,contw
+
+	/* sres B */
+	setarg 0x4231A4
+	store 3,0x58
+	setarg 0xD1
+	istore 1,contw
+
+	/* linkA */
+	setarg 0xa6a026
+	store 3,0x60
+	setarg 0x2569d2
+	istore 3,contw
+	setarg 0xab4a9d
+	istore 3,contw
+	setarg 0x5e87c0
+	istore 3,contw
+	setarg 0x792aa9
+	istore 3,contw
+	setarg 0x4b
+	istore 1,contw
+
+	/* linkB */
+	setarg 0xa1f07d
+	store 3,0x70
+	setarg 0xec97a6
+	istore 3,contw
+	setarg 0xae31eb
+	istore 3,contw
+	setarg 0x6fe3c4
+	istore 3,contw
+	setarg 0xa1ae1a
+	istore 3,contw
+	setarg 0x3a
+	istore 1,contw
+
+	/* linkkey */
+	setarg 0x07505b
+	store 3,0x80
+	setarg 0xc9fe74
+	istore 3,contw
+	setarg 0x057b76
+	istore 3,contw
+	setarg 0x316404
+	istore 3,contw
+	setarg 0xd884b3
+	istore 3,contw
+	setarg 0x71
+	istore 1,contw
+
+	/* K */
+	setarg 0x0c333f
+	store 3,0x90
+	setarg 0x41de70
+	istore 3,contw
+	setarg 0x9b05a2
+	istore 3,contw
+	setarg 0xb954a2
+	istore 3,contw
+	setarg 0xb37516
+	istore 3,contw
+	setarg 0x36
+	istore 1,contw
+
+	/* kinit */
+	setarg 0x5ff91a
+	store 3,0xa0
+	setarg 0x39b5a4
+	istore 3,contw
+	setarg 0x258f2d
+	istore 3,contw
+	setarg 0x5d4a85
+	istore 3,contw
+	setarg 0x656ad3
+	istore 3,contw
+	setarg 0xab
+	istore 1,contw
+
+	arg 0,contr
+	arg mem_random_number,contw
+	call memcpy16
+	setarg 0x3131
+	store 2,mem_pin
+	istore 2,contw
+	jam 4,mem_pin_length
+	arg 0xb8,rega
+	call function_e22
+	arg mem_input_store,contr
+	arg mem_kinit,contw
+	call memcpy16
+	arg 0x10,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg 0xb0,rega
+	call function_e21
+	arg 0x60,regb
+	call compare16
+error_lka:
+	nbranch error_lka,zero
+	arg mem_input_store,contr
+	arg mem_link_key,contw	
+	call memcpy16
+	arg 0x20,rega
+	arg mem_kinit,regb
+	arg mem_random_number,contw
+	call xor16
+	arg 0xb8,rega
+	call function_e21
+	arg 0x70,regb
+	call compare16
+error_lkb:
+	nbranch error_lkb,zero
+	arg mem_input_store,rega
+	arg mem_link_key,regb
+	arg mem_link_key,contw
+	call xor16
+	arg 0x30,contr
+	arg mem_random_number,contw
+	call memcpy16
+	arg 0xb8,rega
+	call function_e1
+	arg 0x50,regb
+	force 4,loopcnt
+	call compare_key
+error_sresa:
+	nbranch error_sresa,zero
+	arg 0x40,contr
+	arg mem_random_number,contw
+	call memcpy16
+	arg 0xb0,rega
+	call function_e1
+	arg 0x58,regb
+	force 4,loopcnt
+	call compare_key
+error_sresb:
+	nbranch error_sresb,zero
+	branch loop1
+	
+	arg 0,contr
+	arg mem_random_number,contw
+	call memcpy16
+	force 12,loopcnt
+	call memcpy
+	arg 0x1c,contr
+	arg mem_link_key,contw
+	call memcpy16
+	arg 0x10,rega
+	call function_e3
+	branch loop1
+
+compare16:
+	force 16,loopcnt
+compare_key:
+	arg mem_input_store,rega
+compare_loop:
+	ifetch 1,rega
+	ifetcht 1,regb
+	isub temp,null
+	nrtn zero
+	increase 1,rega
+	increase 1,regb
+	loop compare_loop
+	force 0,pdata
+	rtn
+
+endif
+
+
+loop1:	
+	branch loop1
+
+/* ==================== LE security ================= */
+
+generate_stk:
+	bpatchx patch31_4,mem_patch31
+	call function_s1
+	arg mem_le_ltk,contw
+	branch store_aes_result
+
+	/* contr = rand pointer */
+authenticate_rconfirm:
+	arg mem_le_srand,contw
+	branch authenticate_mconfirm,master
+	arg mem_le_mrand,contw
+authenticate_mconfirm:
+	copy contr,rega
+	call memcpy16
+	call function_c1
+	arg mem_le_rconfirm,contr
+	branch compare_res
+
+generate_confirm:
+	arg mem_le_mrand,rega
+	branch generate_mrand,master
+	arg mem_le_srand,rega
+generate_mrand:
+	copy rega,contw
+	call generate_random
+	branch function_c1
+
+generate_sk:
+	arg mem_le_skdm,contr
+	call load_data128
+	arg mem_le_ltk,contr
+	call load_key128
+	force aes_big_endian | aes_load,aes_ctrl
+	force 0,aes_ctrl					// change result to little endian
+	call wait_aes
+	arg mem_le_sk,contw
+	branch store_aes_result
+
+	/* temp=packet counter, rega = length or block counter*/
+first_block_counter:
+	force 0x49,pdata
+	branch first_block
+first_block_data:
+	force 1,pdata
+first_block:
+	force regidx_data,regext_index			/* B0 */
+	lshift8 temp,regext
+	ior regext,regext
+	increase 1,regext_index
+	rshift8 temp,regext
+	rshift16 regext,regext
+	fetch 2,mem_le_ivm
+	lshift16 pdata,pdata
+	ior regext,regext				/* octet3&octet4 of counter and low 16 bit of IV */
+	increase 1,regext_index
+	ifetch 4,contr					/* IV2-IV5 */
+	iforce regext
+	increase 1,regext_index
+	ifetch 2,contr					/* IV6-IV7 */
+	byteswap rega,regext
+	lshift16 regext,regext
+	ior regext,regext
+	increase 1,regext_index
+	rtn
+
+
+	/* temp=packet counter, regc pointers to header, return mic in regb */	
+generate_mic:
+	add regc,1,contr
+	ifetchr rega,1,contr
+	call first_block_counter
+	call do_aes_ecb
+
+	force regidx_data,regext_index			/* B1 */
+	ifetch 1,regc
+	and_into 0x3,pdata
+	lshift16 pdata,regext
+	set1 8,regext
+	call clear_hidata
+	call do_aes_cbc
+
+	copy rega,loopcnt
+	add regc,2,contr
+	call padding_data
+generate_mic_loop:
+	call aes_load_data
+	call do_aes_cbc
+	deposit loopcnt
+	branch generate_mic_end,blank
+	branch generate_mic_loop
+generate_mic_end:
+	force regidx_result,regext_index
+	copy regext,regb
+	storer regb,4,mem_le_mic
+	rtn
+
+aes_crypt_data:
+	increase 1,rega
+	call first_block_data
+	call aes_init
+	copy regc,contr
+	call load_data128
+	call do_aes_cfb
+	call store_enc_data
+	increase 16,regc
+	increase -16,regb
+	branch aes_crypt_data,positive
+	rtn
+	
+le_encrypt:
+	bpatchx patch31_5,mem_patch31
+	arg mem_le_txheader,regc
+	fetcht 5,mem_le_pcnt_tx
+	call generate_mic
+	force 0,rega
+	call first_block_data
+	call aes_init
+	force regidx_data,regext_index
+	copy regb,regext
+	call do_aes_cfb
+	arg mem_le_txpayload,regc
+	fetch 1,mem_le_txlen
+	add pdata,-1,regb
+	iadd regc,contw
+	force regidx_result,regext_index
+	istorer regext,4,contw	
+	force 0,rega					/* rega is block counter */
+	call aes_crypt_data
+	fetch 1,mem_le_txlen
+	increase 4,pdata
+	store 1,mem_le_txlen
+	fetcht 5,mem_le_pcnt_tx
+	increase 1,temp
+	storet 5,mem_le_pcnt_tx
+	rtn
+
+le_decrypt:
+	fetcht 5,mem_le_pcnt_rx
+	force 0,rega
+	call first_block_data
+	call aes_init
+	fetch 1,mem_le_rxbuf+1
+	arg mem_le_rxbuf+2,regc
+	add pdata,-1,regb
+	increase -4,pdata				/* mic will be discarded */
+	store 1,mem_le_rxbuf+1
+	iadd regc,contr
+	force regidx_data,regext_index
+	ifetchr regext,4,contr
+	call do_aes_cfb
+	force regidx_result,regext_index
+	storer regext,4,mem_le_peer_mic
+	force 0,rega					/* rega is block counter */
+	call aes_crypt_data
+	arg mem_le_rxbuf,regc
+	call generate_mic
+	fetch 4,mem_le_peer_mic
+	isub regb,pdata					/* MIC ok? */
+	nrtn blank
+	fetch 4,mem_le_last_mic			/* reduntdant packet? */
+	isub regb,pdata
+	rtn blank
+	storet 4,mem_le_last_mic
+	fetch 5,mem_le_pcnt_rx
+	increase 1,pdata
+	store 5,mem_le_pcnt_rx
+	force 0,pdata
+	rtn
+
+wait_aes:
+	nbranch wait_aes,aes_ready
+	rtn
+
+
+do_aes_ecb256:
+	force aes_load | aes_256,aes_ctrl
+	force aes_256,aes_ctrl
+	branch wait_aes
+
+do_aes_ecb192:
+	force aes_load | aes_192,aes_ctrl
+	force aes_192,aes_ctrl
+	branch wait_aes
+
+do_aes_ecb:
+	force aes_load,aes_ctrl
+	force 0,aes_ctrl
+	branch wait_aes
+
+
+do_aes_cbc:
+	force aes_load | aes_cbc,aes_ctrl
+	force 0,aes_ctrl
+	branch wait_aes
+
+do_aes_cfb:
+	force aes_load | aes_cfb,aes_ctrl
+	force aes_cfb,aes_ctrl
+	branch wait_aes
+
+do_aes_ecb_be:
+	force aes_big_endian | aes_load,aes_ctrl
+	force aes_big_endian,aes_ctrl
+	branch wait_aes
+
+do_aes_cbc_be:
+	force aes_big_endian | aes_load | aes_cbc,aes_ctrl
+	force aes_big_endian,aes_ctrl
+	branch wait_aes
+
+
+aes_init:
+	force aes_initialize,aes_ctrl
+	force 0,aes_ctrl
+	rtn
+
+function_s1:
+	force regidx_data,regext_index
+	fetch 4,mem_le_mrand
+	iforce regext
+	increase 1,regext_index
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	fetch 4,mem_le_srand
+	iforce regext
+	increase 1,regext_index
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	call aes_clear
+	increase -4,regext_index
+	fetch 4,mem_le_tk
+	copy pdata,regext
+	branch do_aes_ecb_be
+
+	/* rega pointers to random number */
+function_c1:
+	copy rega,contr
+	call load_data128					// load r
+	force aes_big_endian | aes_initialize,aes_ctrl
+	force 0,aes_ctrl
+	fetch 1,mem_le_conn_peer_addr_type
+	fetcht 1,mem_le_adv_own_addr_type
+	nbranch function_c1_irat,master
+	fetch 1,mem_le_conn_own_addr_type
+	fetcht 1,mem_le_conn_peer_addr_type
+function_c1_irat:
+	store 1,mem_le_iat
+	storet 1,mem_le_rat
+	arg mem_le_iat,contr
+	call load_data128					// load p1
+	call aes_clear				
+	increase -4,regext_index
+	fetch 4,mem_le_tk
+	copy pdata,regext
+	force aes_big_endian | aes_cbc | aes_load,aes_ctrl
+	force aes_big_endian,aes_ctrl
+	fetch 6,mem_le_lap
+	fetcht 6,mem_le_plap
+	branch function_c1_master,master
+	fetch 6,mem_le_plap
+	fetcht 6,mem_le_lap
+function_c1_master:
+	force regidx_data,regext_index
+	copy temp,regext
+	increase 1,regext_index
+	rshift32 temp,regext
+	lshift16 pdata,pdata
+	ior regext,regext
+	increase 1,regext_index
+	rshift32 pdata,regext
+	increase 1,regext_index
+	force 0,regext						/* p2 = ia || ra */
+	branch do_aes_cbc_be
+
+
+padding_data:
+	compare 0,loopcnt,3
+	rtn true
+	deposit contr
+	iadd loopcnt,contw
+	force 0,pdata
+padding_loop:
+	istore 1,contw
+	increase 1,loopcnt
+	compare 0,loopcnt,3
+	rtn true
+	branch padding_loop
+
+aes_load_data:
+	force regidx_data,regext_index
+load_data_loop:
+	deposit loopcnt
+	branch load_data_padding,blank
+	ifetch 4,contr
+	increase -4,loopcnt
+load_data_padding:
+	iforce regext
+	increase 1,regext_index
+	compare regidx_key,regext_index,0xf
+	rtn true
+	branch load_data_loop
+
+load_key256:
+	force 8,loopcnt
+	branch load_key
+load_key192:
+	force 6,loopcnt
+	branch load_key
+load_key128:
+	force 4,loopcnt
+load_key:
+	force regidx_key,regext_index
+	branch load_regext_loop
+load_data128:
+	force regidx_data,regext_index
+	force 4,loopcnt
+load_regext_loop:
+//	ifetchr regext,4,contr
+	ifetch 4,contr
+ 	icopy regext	
+	increase 1,regext_index
+	loop load_regext_loop
+	rtn
+
+
+load_sk:
+	arg mem_le_sk,contr
+	branch load_key128
+
+clear_hidata:
+	force 4,loopcnt
+	branch clear_data_rest
+
+aes_clear_data:
+	force regidx_data,regext_index
+aes_clear:
+	force 4,loopcnt
+clear_loop:
+	force 0,regext
+clear_data_rest:
+	increase 1,regext_index
+	loop clear_loop
+	rtn
+
+store_aes_result:
+	force regidx_result,regext_index
+	force 4,loopcnt
+send_aes_result_loop:
+	deposit regext
+	istore 4,contw
+	increase 1,regext_index
+	loop send_aes_result_loop
+	rtn
+
+store_enc_data:
+	force regidx_result,regext_index
+	copy regc,contw
+	add regb,1,loopcnt
+	sub loopcnt,15,null
+	branch store_enc_loop,positive
+	force 16,loopcnt
+store_enc_loop:
+	deposit regext
+	sub loopcnt,3,null
+	branch store_enc_byte,positive
+	istore 4,contw
+	increase -4,loopcnt
+	rtn zero
+	increase 1,regext_index
+	branch store_enc_loop
+store_enc_byte:
+	istore 1,contw
+	rshift8 pdata,pdata
+	loop store_enc_byte
+	rtn
+	
+	/* contr pointers to value to be compared */
+compare_res:
+	force regidx_result,regext_index
+	force 4,loopcnt
+compare_res_loop:
+	ifetch 4,contr
+	isub regext,null
+	nrtn zero
+	increase 1,regext_index
+	loop compare_res_loop
+	force 0,null
+	rtn
+
+enable_authrom:
+	fetch 1,core_config
+	set1 CLOCK_ON_AUTH_ROM,pdata
+	store 1,core_config
+	rtn
+
+disable_authrom:
+	fetch 1,core_config
+	set0 CLOCK_ON_AUTH_ROM,pdata
+	store 1,core_config
+	rtn
+
+init_memp:
+	arg mem_p,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3fbff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3cfff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffef
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x3ffff
+	setsect 2,0x3ffff
+	setsect 3,0x3ffff
+	istore 9,contw
+	setsect 0,0x3ffff
+	setsect 1,0x26c7f
+	setsect 2,0x146b
+	setsect 3,0x37bb3
+	istore 9,contw
+	setsect 0,0x1feb8
+	setsect 1,0x10c12
+	setsect 2,0x2b722
+	setsect 3,0x29fa6
+	istore 9,contw
+	setsect 0,0xe70f
+	setsect 1,0x16720
+	setsect 2,0x519e
+	setsect 3,0x19084
+	istore 9,contw
+	setsect 0,0x31012
+	setsect 1,0x360bf
+	setsect 2,0x3f0af
+	setsect 3,0x3d3
+	istore 9,contw
+	setsect 0,0x3a188
+	setsect 1,0x3ad0
+	setsect 2,0x3cbf2
+	setsect 3,0x243d9
+	istore 9,contw
+	setsect 0,0x2b030
+	setsect 1,0x36a03
+	setsect 2,0x11188
+	setsect 3,0x1e520
+	istore 9,contw
+	setsect 0,0x3a11e
+	setsect 1,0xfe5d
+	setsect 2,0xdd57
+	setsect 3,0x1ac93
+	istore 9,contw
+	setsect 0,0x11ed
+	setsect 1,0x218c4
+	setsect 2,0x8da7
+	setsect 3,0x257ff
+	istore 9,contw
+	setsect 0,0x3192b
+	setsect 1,0x34641
+	setsect 2,0x1be0c
+	setsect 3,0x366ad
+	istore 9,contw
+	setsect 0,0x1f83
+	setsect 1,0x15a23
+	setsect 2,0x3f9b0
+	setsect 3,0x3949
+	istore 9,contw
+	setsect 0,0x13a51
+	setsect 1,0x153fd
+	setsect 2,0x3372a
+	setsect 3,0xf1bb
+	istore 9,contw
+	setsect 0,0x3ae85
+	setsect 1,0x1eed9
+	setsect 2,0x9e66
+	setsect 3,0x1a8
+	istore 8,contw
+	rtn
+	
+ifdef SECURE_CONNECTION
+
+
+init_memp_256:
+ 	arg mem_p_256,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3ffff
+        setsect 2,0x3ffff
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3f
+        setsect 2,0x0
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x0
+        setsect 1,0x0
+        setsect 2,0x1000
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x3ff00
+        setsect 1,0x3ffff
+        setsect 2,0x3ffcf
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x3ffff
+        setsect 1,0x3ffff
+        setsect 2,0x3ffff
+        setsect 3,0x3ff
+        istore 9,contw
+        setsect 0,0x0
+        setsect 1,0x0
+        setsect 2,0x0
+        setsect 3,0x0
+        istore 9,contw
+        setsect 0,0x10000
+        setsect 1,0x0
+        setsect 2,0x3f000
+        setsect 3,0x3ffff
+        istore 9,contw
+        setsect 0,0x296ff
+        setsect 1,0x22630
+        setsect 2,0x3945d
+        setsect 3,0x3d284
+        istore 9,contw
+        setsect 0,0x333a0
+        setsect 1,0x4b7a
+        setsect 2,0x37d8
+        setsect 3,0x3c9dc
+        istore 9,contw
+        setsect 0,0x3a440
+        setsect 1,0x1b958
+        setsect 2,0x38bce
+        setsect 3,0x1091f
+        istore 9,contw
+        setsect 0,0x2e12c
+        setsect 1,0x1f47c
+        setsect 2,0x356b1
+        setsect 3,0x2fd47
+        istore 9,contw
+        setsect 0,0x6837
+        setsect 1,0x2ed90
+        setsect 2,0x1ecec
+        setsect 3,0x1acc5
+        istore 9,contw
+        setsect 0,0x23357
+        setsect 1,0x18af3
+        setsect 2,0xf9e1
+        setsect 3,0x129f0
+        istore 9,contw
+        setsect 0,0x2e7eb
+        setsect 1,0x3e6e3
+        setsect 2,0x3e1a7
+        setsect 3,0x10b8b
+        istore 9,contw
+        setsect 0,0x24fe3
+        setsect 1,0x20ef
+        setsect 2,0x1b5a6
+        setsect 3,0xdc2f
+        istore 9,contw
+        setsect 0,0x13860
+        setsect 1,0x2bd69
+        setsect 2,0x391a
+        setsect 3,0x1b222
+        istore 9,contw
+        rtn
+endif
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/sim.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/sim.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/sim.prog	(working copy)
@@ -0,0 +1,222 @@
+simstart:
+//	call sim_qspi
+	force 8,radio_ctrl
+	force 0,radio_ctrl
+	jam 0xe0,0x8907			// set if_phase=7 for simulation environment
+	jam 0xe0,0x890a
+	jam 0x25,0x8912
+	jam 0xff,rfen_ck
+	jam 0x5,core_clksel
+	setarg 0x100
+	store 2,core_sec_readdr
+	arg 0x133,contru
+	ifetch 1,contru
+	fetch 1,core_config
+//	jam 5,core_clksel
+//	call sim_dac
+//	call sim_cvsd
+	branch sim_lpm
+//	branch sim_aes
+//	branch sim_clk
+	branch sim_ahb
+//	call sim_adcd
+//	branch sim_assert
+//	call sim_aes
+//	branch test_tx
+//	branch sim_le
+//	branch sim_250k
+//	branch sim_clk
+//	branch sim_c1
+//	branch loop
+	branch sim_main
+
+sim_assert:
+	branch sim_assert
+
+sim_ahb:
+	call wait_sec_powerup
+	arg 0xf,addhi
+	setarg 0
+	store 3,0x10
+	store 1,0x18532
+testbus_loop:
+	arg 0xf,addhi
+	fetch 1,0x18532
+	fetcht 1,0x10
+	isub temp,null
+	nbranch assert,zero
+	increase 1,pdata
+	store 1,0x10
+	store 1,0x18532
+	arg 0x100,addhi
+	fetcht 3,0x10091
+	setarg 0x584049
+	isub temp,null
+	nbranch assert,zero
+	branch testbus_loop
+
+	
+sim_main:
+	call init_param
+	setarg 0xff00
+	store 2,core_lpm_reg+2
+	jam lpmreg_sel_ctrl2,core_lpm_wr
+	jam 4,core_config
+	fetch 1,0x87ff
+	beq 1,sim_slave
+	jam dvc_op_hci,mem_device_option
+	fetch 6,mem_lap
+	store 6,mem_hci_plap
+	setarg 0xbdbdbd
+	store 3,mem_lap
+	istore 3,contw
+	jam hci_cmd_create_conn,mem_hci_cmd
+	force 0x10,pdata
+	add pdata,-2,clkn_bt
+	store 4,mem_page_clk
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	jam 0,mem_scan_mode
+sim_loop:
+	call idle_dispatch
+	fetch 1,mem_context
+	bbit0 state_inconn,sim_skip
+	set1 mark_tx_l2cap,mark
+	fetch 1,mem_context + coffset_state_map
+	set1 smap_edr,pdata
+	store 1,mem_context + coffset_state_map
+	fetch 1,mem_context + coffset_op		
+	set1 op_txl2cap,pdata
+	store 1,mem_context + coffset_op
+	jam 0,mem_context + coffset_lmp_to_send
+	jam 0,mem_lmo_opcode2
+	setarg 700
+	store 2,mem_tx_len
+	setarg mem_tmp_buffer
+	store 2,mem_txptr
+	jam 6,mem_tx_lch
+	jam 1,mem_hci_conn_handle
+sim_skip:
+	call connection_dispatch
+	branch sim_loop		
+
+sim_slave:
+	jam 2,mem_scan_mode
+	call page_scan_dispatch
+	branch sim_loop
+
+
+sim_lpm:
+	jam 0x40,mem_gpio_wakeup + 5
+	branch sim_lpm_sleep
+	branch lpm_doze
+	branch lpm_hibernate
+	jam 0x30,core_clksel
+	jam ccnt_start,core_dma_start
+sim_lpm_wait:
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	branch sim_lpm_wait,blank
+	call lpm_recover_clk,wake
+sim_lpm_sleep:
+	arg 30,temp
+	branch lpm_sleep
+
+
+ifdef NULL
+
+sim_250k:
+	call init_250k
+	fetch 1,1
+	bbit1 7,sim_250k_rx
+	call tx_radio_freq
+	call start_transmitter	/* get ready for that id packet */
+	nop 600
+	enable encode_fec0
+	set1 TXGFSK,radio_ctrl
+	force 0,pdata
+	inject mod,9
+	setarg 0xaa
+	inject mod,8
+	preload access
+	inject mod,32
+	setarg 0x1da861
+	inject mod,24
+	setarg 0x94445b
+	inject mod,24
+	setarg 0x1275f
+	inject mod,24
+	branch loop
+sim_250k_rx:
+	call rx_radio_freq
+	call start_receiver	/* wait for that id packet from master */
+	enable decode_fec0
+	correlate null,never
+	parse demod,bucket,72
+	branch loop
+
+
+
+sim_clk:
+	add lpo_time,12,alarm
+	snooze
+clock_loop:
+	nop 10
+	random pdata
+	and_into 0x1f,pdata
+	store 1,core_clksel
+	branch clock_loop
+	jam 2,core_kick
+	nop 200
+	jam 2,core_clksel
+	setarg 1500
+	call sleep
+	jam 0x42,core_clksel
+	add lpo_time,200,alarm
+	snooze
+	branch 0x4000
+
+
+
+
+sim_aes:
+	arg mem_x,contw
+	setsect 0,0x17e2b
+	setsect 1,0x20585
+	setsect 2,0x12ae2
+	setsect 3,0x2ae9b
+	istore 9,contw
+	setsect 0,0x15f7
+	setsect 1,0x3c262
+	setsect 2,0x3c4fc
+	setsect 3,0x0
+	istore 7,contw
+	setsect 0,0x2c16b
+	setsect 1,0x3b8af
+	setsect 2,0x1f402
+	setsect 3,0x3a65a
+	istore 9,contw
+	setsect 0,0x17e3d
+	setsect 1,0xdcc4
+	setsect 2,0x2a179
+	setsect 3,0x0
+	istore 7,contw
+	setsect 0,0x3d73a
+	setsect 1,0x36d1e
+	setsect 2,0x367a0
+	setsect 3,0x2a180
+	istore 9,contw
+	setsect 0,0x3ca9e
+	setsect 1,0x1893c
+	setsect 2,0x17ef6
+	setsect 3,0x2
+	istore 7,contw
+	arg mem_x,contr
+	call load_key128
+	call load_data128
+	call do_aes_ecb
+	call compare_res
+	branch loop,zero
+	branch sim_assert
+
+endif
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/simple_pairing.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/simple_pairing.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/simple_pairing.prog	(working copy)
@@ -0,0 +1,2362 @@
+
+publickey_init:
+	fetch 1,mem_ssp_enable
+	nbranch sp_initialize,blank
+	branch sp_initialize_256
+
+sp_calc_sequence_256_check:
+	bpatchx patch31_6,mem_patch31
+	fetch 1,mem_ssp_enable
+	rtn blank
+	fetch 1,mem_sp_local_key_invalid
+	rtnne SP_KEY_VALID
+	fetch 1,mem_le_secure_connect_enable
+	rtn blank
+	fetch 1,mem_le_sc_local_key_invalid
+	rtneq SP_KEY_VALID_256
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,stop_publickey_calc_256
+	fetch 1,mem_le_sc_calc
+	beq SP_CALC_STANDBY,sp_initialize_256
+	rtn
+stop_publickey_calc_256:
+	jam SP_CALC_STANDBY,mem_le_sc_calc	
+	rtn
+	
+ifdef SIMPLE_PAIRING
+
+sp_initialize:
+	bpatchx patch31_7,mem_patch31
+	fetch 1,mem_ssp_enable 
+	branch ssp_disable, blank
+	call ssp_enable
+	call sp_clear_flags
+	branch sp_pubkey_calc 
+	
+sp_clear_flags:
+	setarg 0
+	store 8,mem_sp_state_start
+	store 4,mem_sp_flag_start
+	store 7,mem_sp_iocap_remote
+	rtn
+
+sp_generate_local_key:
+	jam SP_FLAG_COMMIT,mem_sp_flag  
+	branch sp_generate_local_key0
+sp_master_generate_local_key:
+	fetch 1,mem_sp_local_key_invalid
+	beq SP_KEY_VALID,sp_dhkey_calc
+	branch assert
+sp_generate_local_key0:
+	fetch 1,mem_sp_local_key_invalid
+	beq SP_KEY_VALID,sp_start_send_pubkey
+	branch sp_pubkey_calc
+    
+sp_start_send_pubkey:
+	call sp_dhkey_calc
+	fetch 1,mem_master_sp_state
+	nrtn blank
+	jam SP_STAT_KEY_SEND,mem_sp_state
+	rtn
+
+
+sp_calc_check_publickey_256:
+	call sp_calc_b256
+	arg mem_le_pubkey_remote_y_256,regA
+	arg mem_t7_256,contw
+	call bn_sqrmod_256   
+	arg mem_le_pubkey_remote_x_256,regA
+	arg mem_t2_256,contw
+	call bn_sqrmod_256   
+  	arg mem_t2_256,regA
+	arg mem_le_pubkey_remote_x_256,regB
+	arg mem_t2_256,contw
+	call bn_mulmod_256	
+  	arg mem_a_256,regA
+	arg mem_le_pubkey_remote_x_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256	
+  	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod_256	 
+  	arg mem_t0_256,regA
+	arg mem_t2_256,regB
+	arg mem_t0_256,contw
+	call bn_addmod_256	 
+	arg 32,loopcnt
+  	arg mem_t7_256,regA
+	arg mem_t0_256,regB
+	branch  string_compare
+	
+sp_calc_b256:
+	arg mem_gy_256,regA
+	arg mem_t0_256,contw
+	call bn_sqrmod_256   
+	arg mem_gx_256,regA
+	arg mem_t2_256,contw
+	call bn_sqrmod_256    
+  	arg mem_t2_256,regA
+	arg mem_gx_256,regB
+	arg mem_t2_256,contw
+	call bn_mulmod_256	
+  	arg mem_a_256,regA
+	arg mem_gx_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256	 
+  	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod_256	 
+  	arg mem_t0_256,regA
+	arg mem_t2_256,regB
+	arg mem_t0_256,contw
+	branch  bn_submod_256	
+	
+sp_calc_check_publickey:
+	call sp_calc_b
+	arg mem_sp_pubkey_remote_y,regA
+	arg mem_t7_256,contw
+	call bn_sqrmod 
+	arg mem_sp_pubkey_remote_x,regA
+	arg mem_t2_256,contw
+	call bn_sqrmod
+  	arg mem_t2_256,regA
+	arg mem_sp_pubkey_remote_x,regB
+	arg mem_t2_256,contw
+	call bn_mulmod	
+  	arg mem_a,regA
+	arg mem_sp_pubkey_remote_x,regB
+	arg mem_t3_256,contw
+	call bn_mulmod	
+  	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod	 
+  	arg mem_t0_256,regA
+	arg mem_t2_256,regB
+	arg mem_t0_256,contw
+	call bn_addmod	 
+ 	arg 24,loopcnt
+ 	arg mem_t7_256,regA
+	arg mem_t0_256,regB
+	branch  string_compare
+	
+sp_calc_b:
+	arg mem_gy,regA
+	arg mem_t0_256,contw
+	call bn_sqrmod   
+	arg mem_gx,regA
+	arg mem_t2_256,contw
+  	call bn_sqrmod
+  	arg mem_t2_256,regA
+	arg mem_gx,regB
+	arg mem_t2_256,contw
+	call bn_mulmod	
+	arg mem_a,regA
+	arg mem_gx,regB
+	arg mem_t3_256,contw
+	call bn_mulmod	 
+  	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod	 
+  	arg mem_t0_256,regA
+	arg mem_t2_256,regB
+	arg mem_t0_256,contw
+	branch  bn_submod	
+
+   
+sp_calculate_commitment:
+	fetch 1,mem_sp_calc
+	bne SP_CALC_STANDBY,sp_calculate_commitment_wait_dhkey_calc
+	call sp_local_random_key_generator
+	arg mem_sp_prarm_stack,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+	setarg mem_sp_pubkey_local_x_end
+	istore 2,contw
+	setarg mem_sp_pubkey_remote_x_end
+	istore 2,contw
+	branch sp_calculate_commitment0
+master_sp_calculate_commitment:
+	arg mem_sp_prarm_stack,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	setarg mem_sp_pubkey_remote_x_end
+	istore 2,contw
+	setarg mem_sp_pubkey_local_x_end
+	istore 2,contw
+sp_calculate_commitment0:
+	call function_f1
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_COMMIT_CALC,master_sp_calculate_commitment0
+	jam SP_FLAG_COMMIT,mem_sp_flag
+	jam SP_STAT_COMMIT_SEND,mem_sp_state
+	rtn
+master_sp_calculate_commitment0:
+	jam SP_STAT_COMMITMENT_COMPARE,mem_master_sp_state
+	call sp_master_generate_local_key
+	branch master_set_mem_master_sp_flag 
+
+sp_local_random_key_generator:
+	arg mem_sp_random_local,contw
+	force 8,queue
+	branch random_generator
+  
+sp_calculate_commitment_wait_dhkey_calc:
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+    
+sp_confirm_check:
+    /* calculate Ea here */
+	bpatchx patch32_0,mem_patch32
+	arg      mem_addr_value,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    3,mem_sp_iocap_remote
+	istore   3,contw 
+
+	call     function_f3a
+
+	arg      mem_sp_calc_result_high,regA
+	arg      mem_sp_check_result,regB    
+	force    4,queue 
+	call     compare4
+	nbranch  sp_confirm_check_failed,true  
+
+	call sp_confirm_check_success
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch tid_set_reply
+    
+sp_confirm_check_success:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check_success_master
+	jam SP_STAT_CONFIRM_CALC,mem_sp_state
+	jam SP_FLAG_COMMIT,mem_sp_flag  
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	rtn
+sp_confirm_check_success_master:
+	jam LMP_ACCEPTED,mem_lmo_opcode2
+	jam SP_STATE_END,mem_master_sp_state
+	branch master_set_mem_master_sp_flag
+	//accept opcode?
+	
+sp_confirm_check_failed:
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check_failed_master
+	jam SP_STAT_NULL,mem_sp_state
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	//accept opcode?
+	jam      AUTHENTICATION_FAILURE_ERROR,mem_lmo_reason2 
+	rtn
+sp_confirm_check_failed_master:
+	jam LMP_NOT_ACCEPTED,mem_lmo_opcode2
+	jam SP_STAT_NULL,mem_master_sp_state
+	rtn
+    
+sp_confirm_calc:
+	fetch 1,mem_sp_dh_ready
+	beq SP_FLAG_COMMIT, sp_confirm_calc_ready
+	jam 	SP_STAT_CONFIRM_CALC,mem_master_sp_state
+	branch master_set_mem_master_sp_flag
+sp_confirm_calc_ready:
+	arg      mem_addr_value,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    3,mem_sp_iocap_local
+	istore   3,contw 
+
+	call     function_f3b
+	fetch 1,mem_master_sp_state
+	beq SP_STAT_CONFIRM_CALC,sp_confirm_calc_master
+	jam      SP_STAT_CONFIRM_SEND,mem_sp_state
+	jam      SP_FLAG_COMMIT,mem_sp_flag
+	rtn
+sp_confirm_calc_master:
+	jam      SP_STAT_CONFIRM_SEND,mem_master_sp_state
+	jam      SP_FLAG_COMMIT,mem_master_sp_flag
+	rtn   
+
+sp_master_key_prarm_push:
+	arg mem_sp_prarm_stack,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	branch sp_link_key_calc
+sp_link_key_prarm_push:
+	jam      SP_STAT_DONE,mem_sp_state    
+	arg mem_sp_prarm_stack,contw
+	fetch    6,mem_lap
+	istore   6,contw
+	fetch    6,mem_plap
+	istore   6,contw
+	setarg mem_sp_random_remote_end
+	istore 2,contw
+	setarg mem_sp_random_local_end
+	istore 2,contw
+sp_link_key_calc:
+    /*calculate Link key here */
+	arg      mem_addr_value,contw
+	fetch    6,mem_sp_prarm_stack
+	istore   6,contw
+	fetch    6,mem_sp_prarm_stack+6
+	istore   6,contw
+	
+	call     function_f2    
+
+	/*handle linkkey  */
+	jam 1,mem_link_key_exists
+	arg mem_link_key,contw
+	arg mem_sp_calc_result_high,contr
+	call memcpy16
+	branch  generate_linkkey_continue
+
+    
+sp_pubkey_calc:
+	bpatchx patch32_1,mem_patch32
+	fetch    1,mem_sp_local_key_invalid
+	rtnne SP_KEY_INVALID
+	fetch    1,mem_sp_calc
+	rtnne  SP_CALC_STANDBY
+	arg      mem_sp_private_key,contw 
+	force    11,queue
+	call     random_generator
+	random   pdata
+	rshift   pdata,pdata
+	istore   2,contw 
+/* we don't need fixed private key,generate random key instead */ 
+	arg      mem_k,contw
+	arg      mem_sp_private_key,contr	
+	call     memcpy24 //mem_sp_private_key=>mem_k 24BYTES
+
+	arg      mem_ax,contw
+	arg      mem_gx,contr
+	call     memcpy48 //mem_gx=>mem_ax 48bytes
+
+	arg      mem_az,contw
+	call     bn_zero
+	jam      1,mem_az //0=>mem_az 24bytes
+
+	call     eckp_calc_init
+	jam SP_CALC_PUBKEY,mem_sp_calc
+	rtn    
+	
+sp_pubkey_generated:
+	arg      mem_sp_pubkey_local,contw
+	arg      mem_bx,contr
+	call     memcpy48   
+	jam      SP_KEY_VALID,mem_sp_local_key_invalid
+	jam      SP_CALC_STANDBY,mem_sp_calc
+	rtn
+
+sp_dhkey_calc:
+	bpatchx patch32_2,mem_patch32
+	fetch    1,mem_sp_dhkey_invalid
+	rtnne  SP_KEY_INVALID
+	fetch    1,mem_sp_calc
+	rtnne  SP_CALC_STANDBY
+
+	arg      mem_k,contw
+	arg      mem_sp_private_key,contr	
+	call     memcpy24
+
+	arg      mem_ax,contw
+	arg      mem_sp_pubkey_remote,contr
+	call     memcpy48
+
+	arg      mem_az,contw
+	call     bn_zero
+	jam      1,mem_az
+
+	call     eckp_calc_init
+	jam      SP_CALC_DHKEY,mem_sp_calc
+	rtn 	
+	
+sp_dhkey_generated:
+	jam SP_FLAG_COMMIT,mem_sp_dh_ready
+	arg mem_sp_dhkey,contw
+	arg mem_bx,contr
+	call memcpy24
+	jam SP_KEY_VALID,mem_sp_dhkey_invalid
+	jam SP_CALC_STANDBY,mem_sp_calc
+	rtn
+
+random_generator:
+	increase -1,queue
+	nrtn     positive
+	random   pdata
+	istore   2,contw  
+	branch   random_generator
+compare4:
+	increase -1,queue
+	nbranch  compare4_success,positive
+	ifetch   4,regA
+	copy     pdata,temp
+	ifetch   4,regB
+	iflip    temp,pdata
+	nbranch  compare4_failed,zero
+	increase 4,regA
+	increase 4,regB
+	branch   compare4
+compare4_failed:
+	disable  true
+	rtn
+compare4_success:
+	enable   true
+	rtn
+
+/*************************************************/
+/** Message state machine routines ***************/
+/*************************************************/
+// simple pairing support 
+
+simple_pairing_sequence:
+	bpatchx patch32_3,mem_patch32
+         fetch 1,mem_sp_flag
+         rtn blank
+	call lmo_fifo_check
+	nrtn blank
+	jam      SP_FLAG_STANDBY,mem_sp_flag
+	fetch    1,mem_sp_state
+	beq  SP_STAT_KEY_SEND,sp_send_LMP_ENCAPSULATED_HEADER
+	beq  SP_STAT_COMMIT_SEND,sp_send_LMP_SIMPLE_PAIRING_COMFIRM
+	beq  SP_STAT_RANDOM_SEND,sp_send_LMP_SIMPLE_PAIRING_NUMBER
+	beq  SP_STAT_CONFIRM_SEND,sp_send_LMP_DHKEY_CHECK
+	beq  SP_STAT_KEY_GENERATE,sp_generate_local_key
+	beq  SP_STAT_COMMIT_CALC,sp_calculate_commitment
+	beq  SP_STAT_CONFIRM_CHECK,sp_confirm_check
+	beq  SP_STAT_CONFIRM_CALC,sp_confirm_calc
+	beq  SP_STAT_LINK_KEY_CALC,sp_link_key_prarm_push
+	//beq  SP_STAT_FEATURE_EXT_SEND,send_LMP_FEATURES_REQ_EXT
+	rtn  
+
+master_simple_paring_sequence:
+	bpatchx patch32_4,mem_patch32
+	fetch 1,mem_master_sp_flag
+	rtn blank
+	call lmo_fifo_check
+	nrtn blank
+	jam SP_FLAG_STANDBY,mem_master_sp_flag
+	fetch 1,mem_master_sp_state
+	beq SP_MASTER_STAT_START_SKIP,sp_master_send_io_cap_get
+	beq SP_MASTER_STAT_START_DONE,sp_master_send_io_cap_send
+	beq SP_STAT_KEY_SEND,sp_master_send_LMP_ENCAPSULATED_HEADER
+	beq SP_STAT_COMMIT_CALC,master_sp_calculate_commitment
+	beq SP_STAT_COMMITMENT_COMPARE,sp_master_commitment_compare
+	beq SP_STAT_RANDOM_SEND,sp_master_send_LMP_SIMPLE_PAIRING_NUMBER
+	beq SP_STAT_CONFIRM_CALC,sp_confirm_calc
+	beq SP_STAT_CONFIRM_SEND,master_sp_send_lmp_dhkey_check
+	beq SP_STAT_CONFIRM_CHECK,sp_confirm_check
+	beq SP_STATE_END,master_sp_sm_end
+	rtn
+
+master_set_mem_master_sp_flag:
+	jam SP_FLAG_COMMIT,mem_master_sp_flag
+	rtn
+	
+master_clear_mem_master_sp_flag:
+	jam SP_FLAG_STANDBY,mem_master_sp_flag
+	rtn
+sp_calc_sequence:
+	bpatchx patch32_5,mem_patch32
+	fetch 1,mem_ssp_enable
+	rtn blank
+	fetch 1,mem_sp_calc
+	rtn blank
+	increase 0x80,pdata
+	store    1,mem_sp_calc
+	rtnbit1 7
+	fetch    1,mem_ec_loopc
+	branch   sp_calc_sequence_done,blank
+	branch   eckp_calc
+
+sp_calc_sequence_done:    
+	call ecunmapz
+	fetch 1,mem_sp_calc
+	beq  SP_CALC_PUBKEY,sp_pubkey_generated
+	beq  SP_CALC_DHKEY,sp_dhkey_generated
+	rtn
+
+
+bn_testbit:
+	and pdata,7,queue
+	rshift3 pdata,pdata
+	iadd contr,contr
+	ifetch 1,contr
+	qisolate0 pdata
+	rtn
+
+
+ec_copy:
+	call memcpy24
+	call memcpy24
+	branch memcpy24
+	
+	
+bn_eq_zero:
+	ifetch 8,contr
+	nrtn blank
+	ifetch 8,contr
+	nrtn blank
+	ifetch 8,contr
+	rtn
+	
+	
+	/* return zero if eq */
+
+bn_eq_0:	
+	ifetch 4,regA
+	iforce temp
+	ifetch 4,regB
+	isub temp,null
+	nrtn zero
+	increase 4,regA
+	increase 4,regB
+	loop bn_eq_0
+	rtn
+
+	/* return positive if A >= B */
+bn_bigeq:
+	force 6,loopcnt
+	increase 20,regA
+	increase 20,regB
+bn_bigeq_0:	
+	ifetch 4,regB
+	iforce temp
+	ifetch 4,regA
+	isub temp,pdata
+	nrtn positive
+	nrtn blank
+	increase -4,regA
+	increase -4,regB
+	loop bn_bigeq_0
+	rtn
+
+bn_add:
+	force 6,loopcnt
+	force 0,regC
+bn_add_0:	
+	ifetch 4,regA
+	iforce temp
+	ifetch 4,regB
+	iadd temp,pdata
+	iadd regC,pdata
+	istore 4,contw
+	isolate1 32,pdata
+	setflag true,0,regC
+	increase 4,regA
+	increase 4,regB
+	loop bn_add_0
+	rtn
+
+bn_sub:
+	force 6,loopcnt
+	force 0,regC
+bn_sub_0:	
+	ifetch 4,regB
+	iforce temp
+	ifetch 4,regA
+	isub temp,pdata
+	isub regC,pdata
+	istore 4,contw
+	isolate1 32,pdata
+	setflag true,0,regC
+	increase 4,regA
+	increase 4,regB
+	loop bn_sub_0
+	rtn
+
+bn_rshift6:
+	force 6,loopcnt
+	increase 20,regA
+bn_rshift:
+	force 0,regC
+bn_rshift_0:	
+	ifetch 4,regA
+	isolate1 0,pdata
+	setflag true,1,regC
+	rshift pdata,pdata
+	isolate1 0,regC
+	setflag true,31,pdata
+	istore 4,regA
+	increase -4,regA
+	rshift regC,regC
+	loop bn_rshift_0
+	rtn
+
+bn_lshift:
+	force 6,loopcnt
+	force 0,regC
+bn_lshift_0:	
+	ifetch 4,regA
+	isolate1 31,pdata
+	setflag true,1,regC
+	lshift pdata,pdata
+	isolate1 0,regC
+	setflag true,0,pdata
+	istore 4,regA
+	increase 4,regA
+	rshift regC,regC
+	loop bn_lshift_0
+	rtn
+	
+bn_lshiftmod:
+	call bn_lshift
+bn_lshiftmod_ismod:	
+	isolate1 0,regC
+	branch bn_lshiftmod_0,true
+	arg mem_p,regB
+	copy regA,regC
+	increase -24,regA
+	call bn_bigeq
+	nrtn positive
+	copy regC,regA
+bn_lshiftmod_0:
+	increase -24,regA
+	arg mem_p,regB
+	copy regA,contw
+	branch bn_sub
+	
+
+bn_addmod:
+	call bn_add
+	copy contw,regA
+	branch bn_lshiftmod_ismod
+	
+bn_submod:
+	call bn_sub
+	isolate0 0,regC
+	rtn true
+	arg mem_p,regB
+	add contw,-24,regA
+	copy regA,contw
+	branch bn_add
+	
+
+bn_p192mod:
+	copy contw,timeup				/* save result ptr */
+	copy regA,alarm				/* temp save regA */
+	arg mem_tmp2,regB
+	copy regB,contw
+	add regA,24,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	force 0,pdata
+	istore 8,contw
+	copy timeup,contw
+	call bn_addmod
+	arg mem_tmp2,regB
+	copy regB,contw
+	force 0,pdata
+	istore 8,contw
+	add alarm,32,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	copy timeup,regA
+	copy regA,contw
+	call bn_addmod
+	arg mem_tmp2,regB
+	copy regB,contw
+	add alarm,40,contr
+	ifetch 8,contr
+	istore 8,contw
+	istore 8,contw
+	istore 8,contw
+	copy timeup,regA
+	copy regA,contw
+	branch bn_addmod
+		
+
+bn_load:
+	force 6,loopcnt
+bn_load_0:	
+	ifetch 4,contr
+	iforce regext
+	increase 1,regext_index
+	loop bn_load_0
+	rtn
+
+
+	/* cost 1562 clks */	
+bn_mulmod:
+	copy contw,timeup					/* save result ptr */
+	arg mem_tmp1,contw
+	call bn_zero
+	arg mem_tmp1,contw
+	copy regA,contr
+	force 0,regext_index
+	call bn_load
+	copy regB,contr
+	call bn_load
+	force 0,regB
+bn_mulmod_1:	
+	force 0,temp
+	force 6,regC
+bn_mulmod_0:
+	ifetch 4,contw					/* d[i+j] */
+	iforce regA
+	copy regB,regext_index
+	deposit regext
+	copy regC,regext_index
+	imul32 regext,pdata
+	iadd regA,pdata					/* uv = a[i]*b[j] + d[i+j] */
+	iadd temp,pdata					/* uv += u */
+	istore 4,contw					/* ->d[i+j] */
+	rshift32 pdata,temp				/* temp = u = uv >> 32 */
+	increase 1,regC
+	compare 12,regC,0xff
+	nbranch bn_mulmod_0,true
+	deposit temp
+	istore 4,contw					/* d[i + 12] = u */
+	increase -24,contw
+	increase 1,regB
+	compare 6,regB,0xff
+	nbranch bn_mulmod_1,true
+	arg mem_tmp1,regA
+	copy timeup,contw
+	branch bn_p192mod
+
+	
+bn_sqrmod:
+	copy regA,regB
+	branch bn_mulmod
+
+bn_rshifteven:
+	copy regA,alarm
+bn_rshifteven_1:
+	copy alarm,regA
+	ifetch 1,regA
+	isolate1 0,pdata
+	rtn true
+	call bn_rshift6
+	ifetch 1,regB
+	isolate0 0,pdata
+	branch bn_rshifteven_0,true
+	arg mem_p,regA
+	copy regB,contw
+	call bn_add
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB						/* [6] */
+	increase -24,regB
+bn_rshifteven_0:
+	add regB,24,regA
+	force 7,loopcnt
+	call bn_rshift
+	branch bn_rshifteven_1
+
+	/* cost 141910 clks */
+bn_invmod:
+	copy contw,timeup					/* save result ptr */
+	arg mem_tmp0,contw				/* x */
+	call bn_zero
+	force 0,pdata
+	store 4,mem_tmp5
+	store 4,mem_t2
+	jam 1,mem_tmp0
+	arg mem_tmp1,contw				/* y */
+	call bn_zero
+	arg mem_p,contr
+	arg mem_tmp2,contw				/* a */
+	call memcpy24
+	copy regA,contr
+	arg mem_tmp3,contw				/* b */
+	call memcpy24
+bn_invmod_2:	
+	arg mem_tmp3,contr
+	call bn_eq_zero
+	branch bn_invmod_0,blank
+	arg mem_tmp3,regA
+	arg mem_tmp0,regB
+	call bn_rshifteven
+
+	arg mem_tmp2,regA
+	arg mem_tmp1,regB
+	call bn_rshifteven
+	arg mem_tmp3,regA
+	arg mem_tmp2,regB
+	call bn_bigeq
+	branch bn_invmod_1,positive
+	arg mem_tmp2,regA
+	arg mem_tmp3,regB
+	copy regA,contw
+	call bn_sub
+	arg mem_tmp0,regA
+	arg mem_tmp1,regB
+	copy regB,contw
+	call bn_add
+	ifetch 1,regA
+	iadd regC,regC
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB
+	branch bn_invmod_2
+bn_invmod_1:
+	arg mem_tmp3,regA
+	arg mem_tmp2,regB
+	copy regA,contw
+	call bn_sub
+	arg mem_tmp1,regA
+	arg mem_tmp0,regB
+	copy regB,contw
+	call bn_add
+	ifetch 1,regA
+	iadd regC,regC
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB
+	branch bn_invmod_2
+bn_invmod_0:
+	arg mem_tmp0,contw
+	call bn_zero
+	fetch 1,mem_tmp5
+	store 1,mem_tmp0
+	store 1,mem_tmp0a
+	arg mem_tmp0,regA
+	arg mem_tmp1,regB
+	copy regB,contw
+	call bn_addmod
+	arg mem_p,regA
+	arg mem_tmp1,regB
+	copy timeup,contw
+	branch bn_submod
+	
+
+
+	/* cost 64742 clks */
+ecdbl:
+	arg mem_cz,regA
+	arg mem_t2,contw
+	call bn_sqrmod
+	arg mem_t2,regA
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_a,regA
+	arg mem_t3,regB
+	arg mem_t3,contw
+	call bn_mulmod		/* t3=a*z4	*/
+	arg mem_cx,regA
+	arg mem_t2,contw
+	call bn_sqrmod
+	arg mem_t2,contr
+	arg mem_t1,contw
+	call memcpy24
+	arg mem_t1,regA
+	call bn_lshiftmod
+	arg mem_t2,regA
+	arg mem_t1,regB
+	arg mem_t2,contw
+	call bn_addmod
+	arg mem_t2,regA
+	arg mem_t3,regB
+	arg mem_t2,contw
+	call bn_addmod		/* t2=3*x2 + z*z4		D  */
+	arg mem_cx,contr
+	arg mem_t1,contw
+	call memcpy24
+	arg mem_cy,regA
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_t1,regA
+	call bn_lshiftmod
+	arg mem_t1,regA
+	call bn_lshiftmod
+	arg mem_t1,regA		
+	arg mem_t3,regB
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=4x*y2	B	*/
+	arg mem_t3,regA
+	arg mem_t0,contw
+	call bn_sqrmod
+	arg mem_t0,regA
+	call bn_lshiftmod
+	arg mem_t0,regA
+	call bn_lshiftmod		
+	arg mem_t0,regA		
+	call bn_lshiftmod		/* t0=8*y4		C */
+	arg mem_cy,contr
+	arg mem_t3,contw
+	call memcpy24
+	arg mem_t3,regA
+	call bn_lshiftmod
+	arg mem_t3,regA
+	arg mem_cz,regB
+	arg mem_cz,contw
+	call bn_mulmod		
+	arg mem_t2,regA
+	arg mem_t3,contw
+	call bn_sqrmod
+	arg mem_t3,regA
+	arg mem_t1,regB
+	arg mem_t3,contw
+	call bn_submod
+	arg mem_t3,regA
+	arg mem_t1,regB
+	arg mem_cx,contw
+	call bn_submod
+	arg mem_t1,regA
+	arg mem_cx,regB
+	arg mem_t3,contw
+	call bn_submod
+	arg mem_t3,regA
+	arg mem_t2,regB
+	arg mem_t3,contw
+	call bn_mulmod		
+	arg mem_t3,regA
+	arg mem_t0,regB
+	arg mem_cy,contw
+	branch bn_submod
+	
+
+	/* cost 104904	clks */
+ecadd:
+	arg mem_az,regA
+	arg mem_t7,contw
+	call bn_sqrmod
+	arg mem_cx,regA
+	arg mem_t7,regB
+	arg mem_t0,contw
+	call bn_mulmod		/* n1=t0=xa*zb2  */
+	arg mem_az,regA
+	arg mem_t7,regB
+	arg mem_t7,contw
+	call bn_mulmod	
+	arg mem_cy,regA
+	arg mem_t7,regB
+	arg mem_t1,contw
+	call bn_mulmod		/* n2=t1=ya*zb3 */
+	arg mem_cz,regA
+	arg mem_t7,contw
+	call bn_sqrmod
+	arg mem_ax,regA
+	arg mem_t7,regB
+	arg mem_t2,contw
+	call bn_mulmod		/* n3=t2=xb*za2 */
+	arg mem_cz,regA
+	arg mem_t7,regB
+	arg mem_t7,contw
+	call bn_mulmod	
+	arg mem_ay,regA
+	arg mem_t7,regB
+	arg mem_t3,contw
+	call bn_mulmod		/* n4=t3=yb*za3 */
+	arg mem_t0,regA
+	arg mem_t2,regB
+	arg mem_t7,contw
+	call bn_submod		/* n5=t7=n1-n3=t0-t2 */
+	arg mem_t0,regA
+	arg mem_t2,regB
+	arg mem_t0,contw
+	call bn_addmod		/* n7=t0=n1+n3=t0+t2 */
+	arg mem_t1,regA
+	arg mem_t3,regB
+	arg mem_t2,contw
+	call bn_submod		/* n6=t2=n2-n4=t1-t3 */
+	arg mem_t1,regA
+	arg mem_t3,regB
+	arg mem_t1,contw
+	call bn_addmod		/* n8=t1=n2+n4=t1+t3 */
+	arg mem_t1,regA
+	arg mem_t7,regB
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=n8*n5 */
+	arg mem_cz,regA
+	arg mem_az,regB
+	arg mem_t3,contw
+	call bn_mulmod	
+	arg mem_t3,regA
+	arg mem_t7,regB
+	arg mem_cz,contw
+	call bn_mulmod		/* z=za*zb*n5 */
+	arg mem_t7,regA
+	arg mem_t7,contw
+	call bn_sqrmod		/* t7=n5^2 */
+	arg mem_t7,regA
+	arg mem_t0,regB
+	arg mem_t3,contw
+	call bn_mulmod		/* t3=n5^2*n7 */
+	arg mem_t7,regA
+	arg mem_t1,regB
+	arg mem_t1,contw
+	call bn_mulmod		/* t1=n8*n5^3 */
+	arg mem_t2,regA
+	arg mem_cx,contw
+	call bn_sqrmod		
+	arg mem_cx,regA
+	arg mem_t3,regB
+	arg mem_cx,contw
+	call bn_submod		/* x=n6^2-n5^2*n7 */
+	arg mem_cx,contr
+	arg mem_t7,contw
+	call memcpy24
+	arg mem_t7,regA
+	call bn_lshiftmod		/* t7=2*x */
+	arg mem_t3,regA
+	arg mem_t7,regB
+	arg mem_t3,contw
+	call bn_submod		/* t3=n9 */
+	arg mem_t3,regA
+	arg mem_t2,regB
+	arg mem_t2,contw
+	call bn_mulmod		/* t2=n9*n6 */
+	arg mem_t2,regA
+	arg mem_t1,regB
+	arg mem_cy,contw
+	call bn_submod	
+	arg mem_cy,regA
+	arg mem_p,regB
+	arg mem_cy,contw
+	force 0,regC
+	fetch 1,mem_cy
+	isolate1 0,pdata
+	call bn_add,true
+	copy regC,alarm
+	arg mem_cy,regA
+	call bn_rshift6
+	fetch 1,mem_cy5
+	isolate1 0,alarm
+	setflag true,7,pdata
+	store 1,mem_cy5
+	rtn
+
+	/* cost 22276983 clks */
+
+eckp_0:	
+	fetch 1,mem_ec_loopc
+	increase -1,pdata
+	nrtn positive
+	store 1,mem_ec_loopc
+	fetch 1,mem_ec_infinite
+	call ecdbl,blank
+	fetch 1,mem_ec_loopc
+	arg mem_k,contr
+	call bn_testbit
+	branch eckp_0,true
+	fetch 1,mem_ec_infinite
+	nbranch eckp_1,blank
+	call ecadd
+	branch eckp_0
+eckp_1:
+	jam 0,mem_ec_infinite
+	arg mem_ax,contr
+	arg mem_cx,contw
+	call ec_copy
+	branch eckp_0
+
+	/* cost 162522 clks */
+ecunmapz:
+	arg mem_cz,regA
+	arg mem_t3,contw
+	call bn_invmod			/* t3 = 1/z */
+	arg mem_t3,regA
+	arg mem_t1,contw		
+	call bn_sqrmod			/* t1 = 1/z2 */
+	arg mem_cx,regA
+	arg mem_t1,regB
+	arg mem_bx,contw
+	call bn_mulmod
+	arg mem_t3,regA
+	arg mem_t1,regB
+	arg mem_t2,contw			
+	call bn_mulmod			/* t2 = 1/z3 */
+	arg mem_cy,regA
+	arg mem_t2,regB
+	arg mem_by,contw
+	branch bn_mulmod		
+	
+	
+
+sha_endian_swap2:	
+	ifetch 4,contr
+	force 4,regA
+	increase 3,contw
+sha_endian_loop:	
+	istore 1,contw
+	rshift8 pdata,pdata
+	increase -2,contw
+	increase -1,regA
+	nbranch sha_endian_loop,zero
+	increase 5,contw
+	loop sha_endian_swap2
+	rtn	
+
+
+sha_getw:
+	lshift2 queue,pdata
+	iadd timeup,contr
+	ifetch 4,contr
+	rtn
+	
+sha_r:
+	force 16,alarm
+	arg memdat,timeup
+sha_r_loop:	
+	add alarm,-7,queue
+	call sha_getw
+	iforce temp						/* W[t - 7] */
+	add alarm,-16,queue
+	call sha_getw
+	iadd temp,temp					/* W[t-7] + W[t-16] */
+	add alarm,-2,queue
+	call sha_getw
+	shasx pdata,1,pdata
+	iadd temp,temp					/* S1(W[t -  2]) + W[t-7] + W[t-16] */
+	add alarm,-15,queue
+	call sha_getw
+	shasx pdata,0,pdata
+	iadd temp,temp					/* S0(W[t - 15]) + S1(W[t -  2]) + W[t-7] + W[t-16] */
+	lshift2 alarm,pdata
+	iadd timeup,contw
+	istoret 4,contw
+	increase 1,alarm
+	compare 64,alarm,0xff
+	nbranch sha_r_loop,true
+	rtn
+	
+
+sha_init:
+	arg memh0,contr
+	force 7,regext_index
+sha_init_0:	
+	ifetch 4,contr
+	iforce regext
+	increase -1,regext_index
+	branch sha_init_0,positive
+	rtn
+
+sha:
+	bpatchx patch32_6,mem_patch32
+	call sha_r		/* preprocessing data into R() */
+	arg memahbak,contw
+	force 0,regext_index
+sha_0:	
+	deposit regext
+	istore 4,contw
+	increase 1,regext_index
+	compare 8,regext_index,0xff
+	nbranch sha_0,true
+	call enable_authrom
+	arg memk,timeup
+	arg memdat,alarm
+	force 64,loopcnt
+sha_loop:	
+	ifetcht 4,alarm
+	ifetch 4,timeup
+	increase 4,timeup
+	increase 4,alarm
+	iadd temp,pdata			/* x+K */
+	force 7,regext_index
+	iadd regext,temp			/* x+K+h */
+	force 4,regext_index
+	shasx regext,3,pdata
+	iadd temp,temp			/* temp = s3(e)+x+K+h */
+	force 5,regext_index
+	deposit regext
+	force 6,regext_index
+	ixor regext,pdata
+	force 4,regext_index
+	iand regext,pdata			/* (e & (f ^ g)) */
+	force 6,regext_index
+	ixor regext,pdata			/* F1(e, f, g) = g ^ (e & (f ^ g)) */
+	iadd temp,temp			/* temp1 = h + S3(e) + F1(e,f,g) + K + x */
+	force 7,regext_index
+	copy temp,regext			/* save to H */
+	force 3,regext_index
+	deposit regext
+	iadd temp,regext			/* save to D */
+	force 0,regext_index
+	deposit regext
+	force 1,regext_index
+	iand regext,temp			/* a & b */
+	ior regext,pdata			/* a | b */			
+	force 2,regext_index
+	iand regext,pdata			/* (c & (a | b)) */
+	ior temp,temp				/* F0:(a & b) | (c & (a | b)) */
+	force 0,regext_index
+	shasx regext,2,pdata
+	iadd temp,pdata			/* temp2 = S2(a) + F0(a,b,c) */
+	force 7,regext_index
+	iadd regext,regext			/* h = temp1 + temp2 */
+	regexrot					/* rotate move h,a-g => a-h */
+	loop sha_loop
+	arg memahbak,contr
+	force 0,regext_index
+sha_1:	
+	ifetch 4,contr
+	iadd regext,regext
+	increase 1,regext_index
+	compare 8,regext_index,0xff
+	nbranch sha_1,true
+	branch disable_authrom
+
+	
+sha_result:
+	arg   memresult,contw
+	force 7,regext_index
+sha_regext_save:
+	deposit regext
+	istore  4,contw 
+	increase -1,regext_index
+	branch   sha_regext_save,positive
+	rtn	
+
+pad_xor:
+//	arg memx_end,contr
+	arg      memdat,contw
+	increase -4,contr
+	sub      loopcnt,16,regA
+pad_xor_0:	    
+	ifetch   4,contr
+	ixor     temp,pdata
+	istore   4,contw	
+	increase -8,contr	
+	loop  pad_xor_0
+	copy     regA,loopcnt
+	deposit  temp
+pad_xor_1:	
+	istore 4,contw
+	loop pad_xor_1
+	rtn
+
+g_noninit_number_confirm:
+	call g_noninit0
+	call sha_result
+	branch g_common0
+
+g_noninit:
+	call g_noninit0
+	branch g_common0
+	
+g_noninit0:
+ 	arg      mem_sp_pubkey_remote_x_end,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_pubkey_local_x_end,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_random_remote_end,contr
+	call     memcpy_dword_swap4
+	call     sha_init
+	call     sha	
+ 	arg      mem_sp_random_local_end,contr
+	arg      memdat,contw
+	branch g_common
+	
+g_init:
+ 	arg      mem_sp_pubkey_local_x_end,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_pubkey_remote_x_end,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	arg      mem_sp_random_local_end,contr
+	call     memcpy_dword_swap4
+	call     sha_init
+	call     sha	
+ 	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call g_common
+	branch g_common0
+	
+g_common:	
+	call     memcpy_dword_swap4
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    5,loopcnt
+	call memset0
+	setarg 640
+	istore 4,contw
+	branch sha
+g_common0:
+	fetch 4,memresult
+//	store 4,mem_gkey
+	arg 1000,rega
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	store 4,mem_gkey
+	quotient pdata
+	arg 1000,rega
+	idiv rega
+	call wait_div_end
+	remainder pdata
+	arg 1000,rega
+	imul32 rega,pdata
+	fetcht 4,mem_gkey
+	iadd temp,pdata
+	store 4,mem_gkey
+	rtn
+
+function_f1_no_key:
+	jam 0,mem_passkey_1bit
+	branch function_f1_common
+	
+function_f1:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f1_no_key
+function_f1_common:
+	bpatchx patch32_7,mem_patch32
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	fetch 2,mem_sp_prarm_stack
+	copy pdata,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+2
+	copy pdata,contr
+	arg      memdat,contw
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	fetch 2,mem_sp_prarm_stack+4
+	copy pdata,contr
+	force    6,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	istore   3,contw
+	
+	fetch 1,mem_passkey_1bit
+	
+	istore   1,contw
+	force    0,pdata
+	istore   8,contw
+	setarg   0x0388
+	istore   4,contw
+	call     sha
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	fetch 2,mem_sp_prarm_stack
+	copy pdata,contr
+	force    4,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call		bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha
+	branch     sha_result
+	
+	
+function_f2:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	fetch 2,mem_sp_prarm_stack+12
+	copy pdata,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	fetch 2,mem_sp_prarm_stack+14
+	copy pdata,contr
+	call     memcpy_dword_swap4
+
+	setarg   0x62746c
+	lshift8  pdata,pdata
+	or_into       0x6b,pdata       
+	istore   4,contw
+	arg      mem_addr_value_end,contr
+	force    3,loopcnt
+	call     memcpy_dword_swap
+	
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	force    0,pdata
+	istore   8,contw
+	setarg   0x0380
+	istore   4,contw
+	call     sha
+
+	call     sha_result
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha
+	branch     sha_result
+	
+
+function_f3a:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3a_no_pin
+function_f3a_common:
+	bpatchx patch33_0,mem_patch33
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      mem_sp_random_remote_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_local_end,contr
+	call     memcpy_dword_swap4
+	branch function_f3_common
+
+function_f3a_no_pin:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3a_common
+
+function_f3b_no_pin:
+	setarg 0
+	store 4,mem_pin
+	branch function_f3b_common
+
+
+function_f3b:
+	fetch 1,mem_ssp_mode_flag
+	bne  SSP_MODE_PASSKEY_ENTRY_FLAG,function_f3b_no_pin
+function_f3b_common:
+	setarg   0x363636
+	lshift8  pdata,temp
+	or_into       0x36,temp
+	arg      mem_sp_dhkey_end,contr
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+
+	arg      mem_sp_random_local_end,contr
+	arg      memdat,contw
+	call     memcpy_dword_swap4
+	arg      mem_sp_random_remote_end,contr
+	call     memcpy_dword_swap4
+function_f3_common:    
+	setarg   0x0    
+	istore   8,contw
+	istore   4,contw
+	fetch 4,mem_pin
+	istore   4,contw
+	
+	copy     contw,temp
+	jam      0x80,mem_addr_padding
+	copy     temp,contw
+	arg      mem_addr_iocap_end,contr
+	call     memcpy_dword_swap4
+
+	call     sha
+    
+	arg      memdat,contw
+	force 7,loopcnt
+	call memset0
+	istore   4,contw
+	setarg   0x03F8
+	istore   4,contw
+	call     sha
+	call     sha_result
+	
+	arg      memresult,contr
+	arg      memahsave,contw 
+	call     memcpy32
+    
+	setarg   0x5c5c5c
+	lshift8  pdata,temp
+	or_into       0x5c,temp
+	arg      mem_sp_dhkey_end,contr 
+	force    6,loopcnt
+	call     pad_xor
+	call     sha_init
+	call     sha
+	arg      memahsave_end,contr
+	arg      memdat,contw
+	force    8,loopcnt
+	call     memcpy_dword_swap
+	setarg   0x800000
+	lshift8  pdata,pdata 
+	istore   4,contw
+	call bn_zero
+	setarg   0x0300
+	istore   4,contw
+	call     sha	
+	branch     sha_result
+		
+/*
+eckp:
+	jam 192,mem_ec_loopc
+	jam 1,mem_ec_infinite
+*/
+eckp_calc_init:
+	jam      192,mem_ec_loopc
+eckp_calc_init_1:    
+	fetch    1,mem_ec_loopc
+	rtn      blank
+	increase -1,pdata
+	store    1,mem_ec_loopc 	
+	arg      mem_k,contr
+	call     bn_testbit
+	branch eckp_calc_init_1,true
+	arg      mem_ax,contr
+	arg      mem_cx,contw
+	branch     ec_copy	
+	
+eckp_calc:
+	call     ecdbl  
+	fetch    1,mem_ec_loopc
+	increase -1,pdata
+	store    1,mem_ec_loopc
+	arg      mem_k,contr
+	call     bn_testbit
+	rtn	true
+	branch     ecadd                
+	             
+memcpy_dword_swap4:
+	force 4,loopcnt
+memcpy_dword_swap:
+	increase -4,contr
+memcpy_dword_swap_loop:
+	ifetch   4,contr
+	istore   4,contw
+	increase -8,contr
+	loop   memcpy_dword_swap_loop 
+    	rtn
+
+else
+sp_initialize:
+	rtn
+
+endif
+	
+
+ifdef SECURE_CONNECTION
+
+sp_initialize_256:	
+	bpatchx patch33_1,mem_patch33
+	fetch 1,mem_le_secure_connect_enable
+	branch  le_secure_connection_disable,blank
+	call le_secure_connection_enable
+	call sp_clear_flags
+//	jam SP_KEY_INVALID_256,mem_le_sc_local_key_invalid
+	branch sp_pubkey_calc_256
+    	
+
+
+
+sp_pubkey_calc_256:
+	fetch    1,mem_le_sc_local_key_invalid
+	rtnne SP_KEY_INVALID
+	fetch    1,mem_le_sc_calc
+	rtnne  SP_CALC_STANDBY
+	
+	arg      mem_le_private_key_256,contw 
+	force    15,queue
+	call     random_generator
+	random   pdata
+	rshift   pdata,pdata
+	istore   2,contw 
+
+	arg      mem_k_256,contw
+	arg      mem_le_private_key_256,contr	
+	call     memcpy32 //mem_sp_private_key=>mem_k 
+
+	arg      mem_ax_256,contw
+	arg      mem_gx_256,contr
+	call     memcpy64 //mem_gx=>mem_ax 
+	
+	arg      mem_az_256,contw
+	call      clear_mem_256
+	jam      1,mem_az_256 //0=>mem_az 
+
+	call     eckp_calc_init_256
+	jam SP_CALC_PUBKEY_256,mem_le_sc_calc
+	rtn    
+
+sp_pubkey_generated_256:
+	arg      mem_le_pubkey_local_x_256,contw
+	arg      mem_bx_256,contr
+	call     memcpy64   
+	jam      SP_KEY_VALID_256,mem_le_sc_local_key_invalid
+	jam      SP_CALC_STANDBY,mem_le_sc_calc
+	rtn
+	
+
+
+sp_dhkey_calc_256:
+	fetch    1,mem_sp_dhkey_invalid
+	rtnne  SP_KEY_INVALID
+	fetch    1,mem_le_sc_calc
+	rtnne  SP_CALC_STANDBY
+
+	arg      mem_k_256,contw
+	arg      mem_le_private_key_256,contr	
+	call     memcpy32
+
+	arg      mem_ax_256,contw
+	arg      mem_le_pubkey_remote_x_256,contr
+	call     memcpy64
+
+	arg      mem_az_256,contw
+	call     clear_mem_256
+	jam      1,mem_az_256 //0=>mem_az 
+
+	call     eckp_calc_init_256
+	jam     SP_CALC_DHKEY_256,mem_le_sc_calc
+	rtn 
+
+
+sp_dhkey_generated_256:
+//	jam SP_FLAG_COMMIT,mem_sp_dh_ready
+	arg mem_le_dhkey_256,contw
+	arg mem_bx_256,contr
+	call memcpy32
+	jam SP_KEY_VALID_256,mem_sp_dhkey_invalid
+	jam SP_CALC_STANDBY,mem_le_sc_calc
+	rtn
+
+
+
+sp_calc_sequence_256:
+	fetch 1,mem_le_secure_connect_enable
+	rtn blank
+	fetch 1,mem_le_sc_calc
+	rtn blank
+	increase 0x80,pdata
+	store    1,mem_le_sc_calc
+	rtnbit1 7
+	fetch    2,mem_ec_loopc
+	branch   sp_calc_sequence_done_256,blank
+	branch   eckp_calc_256
+
+sp_calc_sequence_done_256:    
+	bpatchx patch33_2,mem_patch33
+	call ecunmapz_256
+	fetch 1,mem_le_sc_calc
+	beq  SP_CALC_PUBKEY_256,sp_pubkey_generated_256
+	beq  SP_CALC_DHKEY_256,sp_dhkey_generated_256
+	rtn
+
+
+eckp_calc_256:
+	call     ecdbl_256  
+	fetch    2,mem_ec_loopc
+	increase -1,pdata
+	store    2,mem_ec_loopc
+	arg      mem_k_256,contr
+	call     bn_testbit
+	rtn	true
+	branch     ecadd_256   
+
+eckp_calc_init_256:
+	bpatchx patch33_3,mem_patch33
+	setarg 256,pdata
+	store 2,mem_ec_loopc
+eckp_calc_init_256_1:    
+	fetch    2,mem_ec_loopc
+	rtn      blank
+	increase -1,pdata
+	store    2,mem_ec_loopc
+	arg      mem_k_256,contr
+	call     bn_testbit
+	branch eckp_calc_init_256_1,true
+	arg      mem_ax_256,contr
+	arg      mem_cx_256,contw
+	branch     memcpy96	
+
+
+ecunmapz_256:
+	arg mem_cz_256,regA
+	arg mem_t3_256,contw
+	call bn_invmod_256			/* t3 = 1/z */
+	arg mem_t3_256,regA
+	arg mem_t1_256,contw		
+	call bn_sqrmod_256			/* t1 = 1/z2 */
+	arg mem_cx_256,regA
+	arg mem_t1_256,regB
+	arg mem_bx_256,contw
+	call bn_mulmod_256
+	arg mem_t3_256,regA
+	arg mem_t1_256,regB
+	arg mem_t2_256,contw			
+	call bn_mulmod_256			/* t2 = 1/z3 */
+	arg mem_cy_256,regA
+	arg mem_t2_256,regB
+	arg mem_by_256,contw
+	branch bn_mulmod_256	
+	
+ecdbl_256:
+	arg mem_cz_256,regA
+	arg mem_t2_256,contw
+	call bn_sqrmod_256
+	arg mem_t2_256,regA
+	arg mem_t3_256,contw
+	call bn_sqrmod_256
+//call ice_break
+	arg mem_a_256,regA
+	arg mem_t3_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* t3=a*z4	*/
+	arg mem_cx_256,regA
+	arg mem_t2_256,contw
+	call bn_sqrmod_256
+//call ice_break
+	arg mem_t2_256,contr
+	arg mem_t1_256,contw
+	call memcpy32
+	arg mem_t1_256,regA
+	call bn_lshiftmod_256
+	arg mem_t2_256,regA
+	arg mem_t1_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod_256
+//call ice_break
+	arg mem_t2_256,regA
+	arg mem_t3_256,regB
+	arg mem_t2_256,contw
+	call bn_addmod_256		/* t2=3*x2 + z*z4		D  */
+//call ice_break
+	arg mem_cx_256,contr
+	arg mem_t1_256,contw
+	call memcpy32
+	arg mem_cy_256,regA
+	arg mem_t3_256,contw
+	call bn_sqrmod_256
+	arg mem_t1_256,regA
+	call bn_lshiftmod_256
+	arg mem_t1_256,regA
+	call bn_lshiftmod_256
+	arg mem_t1_256,regA		
+	arg mem_t3_256,regB
+	arg mem_t1_256,contw
+	call bn_mulmod_256		//S = 4X1Y1^2/* t1=4x*y2	B	*/
+	arg mem_t3_256,regA
+	arg mem_t0_256,contw
+	call bn_sqrmod_256
+	arg mem_t0_256,regA
+	call bn_lshiftmod_256
+	arg mem_t0_256,regA
+	call bn_lshiftmod_256		
+	arg mem_t0_256,regA		
+	call bn_lshiftmod_256	//T = 8Y1^4	/* t0=8*y4		C */
+	arg mem_cy_256,contr
+	arg mem_t3_256,contw
+	call memcpy32
+	arg mem_t3_256,regA
+	call bn_lshiftmod_256
+	arg mem_t3_256,regA
+	arg mem_cz_256,regB
+	arg mem_cz_256,contw
+	call bn_mulmod_256		//z = 2Y1Z1
+
+
+	arg mem_t2_256,regA
+	arg mem_t3_256,contw
+	call bn_sqrmod_256   // M ^2
+//call ice_break
+	arg mem_t3_256,regA
+	arg mem_t1_256,regB
+	arg mem_t3_256,contw
+	call bn_submod_256  // t2^2 - 4*cx *cy^2 
+	arg mem_t3_256,regA
+	arg mem_t1_256,regB
+	arg mem_cx_256,contw
+	call bn_submod_256   //X2
+	arg mem_t1_256,regA
+	arg mem_cx_256,regB
+	arg mem_t3_256,contw
+	call bn_submod_256   //S-X2
+	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256	//M(S-X2)	
+	arg mem_t3_256,regA
+	arg mem_t0_256,regB
+	arg mem_cy_256,contw
+	branch bn_submod_256  //M(S-X2)-T Y2	
+
+ecadd_256:
+
+	arg mem_az_256,regA
+	arg mem_t7_256,contw
+	call bn_sqrmod_256
+	arg mem_cx_256,regA
+	arg mem_t7_256,regB
+	arg mem_t0_256,contw
+	call bn_mulmod_256		/* n1=t0=xa*zb2 U1 = X1Z0^2*/
+
+
+	arg mem_az_256,regA
+	arg mem_t7_256,regB
+	arg mem_t7_256,contw
+	call bn_mulmod_256	
+	arg mem_cy_256,regA
+	arg mem_t7_256,regB
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* n2=t1=ya*zb3   S1 = Y1Z0^3*/
+
+
+	arg mem_cz_256,regA
+	arg mem_t7_256,contw
+	call bn_sqrmod_256
+	arg mem_ax_256,regA
+	arg mem_t7_256,regB
+	arg mem_t2_256,contw
+	call bn_mulmod_256		/* n3=t2=xb*za2  U0 = X0Z1^2*/
+
+	arg mem_cz_256,regA
+	arg mem_t7_256,regB
+	arg mem_t7_256,contw
+	call bn_mulmod_256	
+	arg mem_ay_256,regA
+	arg mem_t7_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* n4=t3=yb*za3 S0 = Y0Z1^3*/
+
+
+//	arg mem_t0_256,regA
+//	arg mem_t2_256,regB
+	arg mem_t0_256,regb
+	arg mem_t2_256,rega
+	arg mem_t7_256,contw
+	call bn_submod_256		/* n5=t7=n1-n3=t0-t2   W=U1-U0*/
+	arg mem_t0_256,regA
+	arg mem_t2_256,regB
+	arg mem_t0_256,contw
+	call bn_addmod_256		/* n7=t0=n1+n3=t0+t2    T=U1+U0 */
+//	arg mem_t1_256,regA
+//	arg mem_t3_256,regB
+	arg mem_t1_256,regb
+	arg mem_t3_256,rega
+	arg mem_t2_256,contw
+	call bn_submod_256		/* n6=t2=n2-n4=t1-t3  S1-S0 */
+	arg mem_t1_256,regA
+	arg mem_t3_256,regB
+	arg mem_t1_256,contw
+	call bn_addmod_256		/* n8=t1=n2+n4=t1+t3 M=S1+S0*/
+	arg mem_t1_256,regA
+	arg mem_t7_256,regB
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* t1=n8*n5     MW */
+	arg mem_cz_256,regA
+	arg mem_az_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256	      //Z0Z1
+	arg mem_t3_256,regA
+	arg mem_t7_256,regB
+	arg mem_cz_256,contw
+	call bn_mulmod_256		/* z=za*zb*n5   Z0Z1W */
+
+	arg mem_t7_256,regA
+	arg mem_t7_256,contw
+	call bn_sqrmod_256		/* t7=n5^2 */
+	arg mem_t7_256,regA
+	arg mem_t0_256,regB
+	arg mem_t3_256,contw
+	call bn_mulmod_256		/* t3=n5^2*n7 */
+	arg mem_t7_256,regA
+	arg mem_t1_256,regB
+	arg mem_t1_256,contw
+	call bn_mulmod_256		/* t1=n8*n5^3 */
+	arg mem_t2_256,regA
+	arg mem_cx_256,contw
+	call bn_sqrmod_256		
+	arg mem_cx_256,regA
+	arg mem_t3_256,regB
+	arg mem_cx_256,contw
+	call bn_submod_256		/* x=n6^2-n5^2*n7 */
+	arg mem_cx_256,contr
+	arg mem_t7_256,contw
+	call memcpy32
+	arg mem_t7_256,regA
+	call bn_lshiftmod_256		/* t7=2*x */
+	arg mem_t3_256,regA
+	arg mem_t7_256,regB
+	arg mem_t3_256,contw
+	call bn_submod_256		/* t3=n9 */
+	arg mem_t3_256,regA
+	arg mem_t2_256,regB
+	arg mem_t2_256,contw
+	call bn_mulmod_256		/* t2=n9*n6 */
+	arg mem_t2_256,regA
+	arg mem_t1_256,regB
+	arg mem_cy_256,contw
+	call bn_submod_256	
+	arg mem_cy_256,regA
+	arg mem_p_256,regB
+	arg mem_cy_256,contw
+	force 0,regC
+	fetch 1,mem_cy_256
+	isolate1 0,pdata
+	call bn_add_256,true
+	copy regC,alarm
+	arg mem_cy_256,regA
+	call bn_rshift_256
+	fetch 1,mem_cy5_256
+	isolate1 0,alarm
+	setflag true,7,pdata
+	store 1,mem_cy5_256
+	rtn	
+
+bn_invmod_256:
+	copy contw,timeup					 
+	arg mem_tmp0_256,contw			 
+	call clear_mem_256
+	force 0,pdata
+//	store 4,mem_tmp52
+	store 4,mem_t2_256
+	jam 1,mem_tmp0_256      //y1
+	arg mem_tmp1_256,contw	//y2			 
+	call clear_mem_512      
+	arg mem_p_256,contr
+	arg mem_tmp2_256,contw		//j		 
+	call memcpy32
+	copy regA,contr
+	arg mem_tmp3_256,contw		//i		 
+	call memcpy32
+	
+//	arg mem_tmp22,regA
+//	arg mem_tmp32,regB
+//	call p_bn_bigeq_256
+//	branch assert,positive
+bn_invmod_256_2:	
+	arg mem_tmp3_256,contr
+	call bn_eq_zero_256
+	branch bn_invmod_256_0,blank
+//call ice_break    	
+//fetch 1,0x4ffe
+//increase 1,pdata
+//store 1,0x4ffe
+	arg mem_tmp3_256,regA
+	arg mem_tmp0_256,regB
+	call bn_rshifteven_256
+	arg mem_tmp2_256,regA
+	arg mem_tmp1_256,regB
+	call bn_rshifteven_256
+	
+	arg mem_tmp3_256,regA
+	arg mem_tmp2_256,regB
+	call bn_bigeq_256
+	branch bn_invmod_256_1,positive
+	arg mem_tmp2_256,regA
+	arg mem_tmp3_256,regB
+	copy regA,contw
+	call bn_sub_256
+	arg mem_tmp0_256,regA
+	arg mem_tmp1_256,regB
+	copy regB,contw
+	call bn_add_256
+	ifetch 1,regA
+	iadd regC,regC
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB
+	branch bn_invmod_256_2
+bn_invmod_256_1:
+	arg mem_tmp3_256,regA
+	arg mem_tmp2_256,regB
+	copy regA,contw
+	call bn_sub_256
+	arg mem_tmp1_256,regA
+	arg mem_tmp0_256,regB
+	copy regB,contw
+	call bn_add_256
+	ifetch 1,regA
+	iadd regC,regC
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB
+	branch bn_invmod_256_2
+bn_invmod_256_0:
+//call ice_break
+	arg mem_tmp1_256,regA
+	copy timeup,contw
+	call  bn_p256mod
+//call ice_break
+	arg mem_p_256,regA
+	copy timeup,regB
+	copy timeup,contw
+	branch bn_submod_256
+
+
+bn_mulmod_256:
+	copy contw,timeup					/* save result ptr */
+	
+	force 0,regext_index
+	
+	arg mem_tmp1_256,contw
+	call clear_mem_512
+	arg mem_regext,contw
+	call clear_mem_512
+//	jam 0,mem_regext_index
+
+//	arg mem_tmp12,contw
+	copy regA,contr
+//	force 0,regext_index
+	jam 0,mem_regext
+	setarg 0
+	call bn_load_mem
+	copy regB,contr
+	call bn_load_256
+//	force 0,regB
+//	jam 0,mem_regb
+	force 0,queue
+	arg mem_tmp1_256,contw	
+bn_mulmod_256_1:	
+//	copy regb,pdata
+//	store 1,
+	arg mem_regext,temp
+	copy queue,regb
+	lshift2 regb,pdata
+//	lshift4 pdata,pdata
+	iadd temp,regb	
+	force 0,temp
+	force 0,regC
+bn_mulmod_256_0:
+//	copy contw,pdata
+//	store 2,mem_contw
+//call ice_break
+//	copy pdata,contw
+	ifetch 4,contw					/* d[i+j] */
+	iforce regA
+//	copy regB,regext_index
+//	deposit regext
+	ifetch 4,regb
+	copy regC,regext_index
+	imul32 regext,pdata
+	iadd regA,pdata					/* uv = a[i]*b[j] + d[i+j] */
+	iadd temp,pdata					/* uv += u */
+	istore 4,contw					/* ->d[i+j] */
+	rshift32 pdata,temp				/* temp = u = uv >> 32 */
+	increase 1,regC
+	compare 8,regC,0xff
+	nbranch bn_mulmod_256_0,true
+//call ice_break
+	deposit temp
+	istore 4,contw					/* d[i + 12] = u */
+	increase -32,contw
+//	fetch 1,mem_regb
+//	copy pdata,regb
+	increase 1,queue
+	compare 8,queue,0xff
+	nbranch bn_mulmod_256_1,true
+	arg mem_tmp1_256,regA
+	copy timeup,contw
+	branch bn_p256mod
+
+bn_p256mod:
+	bpatchx patch33_4,mem_patch33
+	copy contw,timeup				/* save result ptr */
+	copy regA,alarm				/* temp save regA */
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	call memset0_4	
+	istore 8,contw
+	add regA,44,contr
+	call memcpy8
+	call memcpy12
+	copy regb,rega
+	call  bn_lshiftmod_256 //2S1
+	arg mem_tmp2_256,regB
+	copy alarm,rega   
+	copy timeup,contw
+	call bn_addmod_256 //T+2S1
+//call ice_break	
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	call memset0_4	
+	istore 8,contw
+	add alarm,48,contr
+	call memcpy16
+	call memset0_4	
+	copy regb,rega
+	call  bn_lshiftmod_256 //2S2
+//call ice_break	
+//	arg 0,regB
+
+	arg mem_tmp2_256,regB
+	copy timeup,rega   
+	copy regA,contw	
+	call bn_addmod_256  //+2S2
+//call ice_break	
+//	arg 0,regB
+		
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,32,contr
+	call memcpy12
+	call memset0_4	
+	istore 8,contw
+	add alarm,56,contr
+	call memcpy8
+	copy timeup,regA
+	copy regA,contw
+	call bn_addmod_256 //+S3
+//call ice_break	
+//	arg 0,regB
+
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,36,contr
+	call memcpy12
+	add alarm,52,contr	
+	call memcpy12
+	add alarm,52,contr
+	call memcpy4
+	add alarm,32,contr
+	call memcpy4
+	copy timeup,regA
+	copy regA,contw
+	call bn_addmod_256 //+S4	
+//call ice_break	
+//	arg 1,regB
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,44,contr
+	call memcpy12
+	call memset0_4	
+	istore 8,contw
+	add alarm,32,contr
+	call memcpy4
+	add alarm,40,contr
+	call memcpy4
+	copy timeup,regA
+	copy regA,contw
+	call bn_submod_256 //-D1	
+//call ice_break	
+//	arg 2,regB
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,48,contr
+	call memcpy8
+	call memcpy8
+	force 0,pdata
+	istore 8,contw
+	add alarm,36,contr
+	call memcpy4
+	add alarm,44,contr
+	call memcpy4
+	copy timeup,regA
+	copy regA,contw
+	call bn_submod_256 //-D2	
+//call ice_break	
+//	arg 3,regB
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,52,contr
+	call memcpy12
+	add alarm,32,contr
+	call memcpy12
+	call memset0_4	
+	add alarm,48,contr
+	call memcpy4
+	copy timeup,regA
+	copy regA,contw
+	call bn_submod_256 //-D3
+//call ice_break	
+//	arg 4,regB
+	arg mem_tmp2_256,regB
+	copy regB,contw
+	add alarm,56,contr
+	call memcpy8
+	call memset0_4	
+	add alarm,36,contr
+	call memcpy12
+	call memset0_4	
+	add alarm,52,contr
+	call memcpy4
+	copy timeup,regA
+	copy regA,contw
+	branch  bn_submod_256 //-D4	
+
+
+bn_load_mem:
+	force 32,loopcnt
+	arg mem_regext,contw
+	iadd contw,contw
+	branch memcpy
+
+bn_load_256:
+	force 8,loopcnt
+	branch bn_load_0
+
+bn_sqrmod_256:
+	copy regA,regB
+	branch bn_mulmod_256
+
+bn_add_256:
+	force 8,loopcnt
+ 	branch bn_add+1
+
+bn_addmod_256:
+	call bn_add_256
+	copy contw,regA
+	branch bn_lshiftmod_ismod_256
+
+bn_lshiftmod_256:
+	call bn_lshift_256
+bn_lshiftmod_ismod_256:	
+	isolate1 0,regC
+	branch bn_lshiftmod_p_256,true
+	arg mem_p_256,regB
+	copy regA,regC
+	increase -32,regA
+	call bn_bigeq_256
+	nrtn positive
+	copy regC,regA
+	branch sub_p2_256
+	
+bn_lshiftmod_p_256:
+	call sub_p2_256
+//	nrtn true
+	copy regA,regC
+	increase -32,regA
+	arg mem_p_256,regB
+	call bn_bigeq_256
+	nrtn positive
+	copy regC,regA
+	branch sub_p2_256
+		
+	
+sub_p2_256:
+	increase -32,regA
+	arg mem_p_256,regB
+	copy regA,contw
+	branch bn_sub_256
+	
+
+
+	
+bn_submod_256:
+	call bn_sub_256
+//	isolate1 0,regC
+	branch  bn_submod_256_np,true
+//	copy regA,regC
+//	increase -32,regA
+	add contw,-32,regA
+	arg mem_p_256,regB
+	call bn_bigeq_256
+	nrtn positive
+	arg mem_p_256,regB
+	add contw,-32,regA
+//	copy regC,regA
+	copy rega,contw
+	branch  bn_sub_256
+bn_submod_256_np:	
+	add contw,-32,regA
+	arg mem_p_256,regB
+	copy regA,contw
+	call bn_add_256
+//	isolate1 0,regC
+	rtn true
+	add contw,-32,regA
+	arg mem_p_256,regB
+	copy regA,contw
+	branch bn_add_256	
+
+
+ 
+bn_sub_256:
+	force 8,loopcnt
+	branch bn_sub+1
+
+bn_rshift_256:
+	force 8,loopcnt
+	increase 28,regA
+	branch bn_rshift
+
+bn_lshift_256:
+	force 8,loopcnt
+	force 0,regC
+	branch bn_lshift_0
+
+bn_bigeq_256:
+	force 8,loopcnt
+	increase 28,regA
+	increase 28,regB
+	branch bn_bigeq_0
+
+
+bn_eq_zero_256:
+	ifetch 8,contr
+	nrtn blank
+	branch bn_eq_zero
+
+
+
+	
+bn_rshifteven_256:
+	copy regA,alarm
+bn_rshifteven_256_1:
+	copy alarm,regA
+	ifetch 1,regA
+	isolate1 0,pdata
+	rtn true
+	call bn_rshift_256
+	ifetch 1,regB
+	isolate0 0,pdata
+	branch bn_rshifteven_256_0,true
+	arg mem_p_256,regA
+	copy regB,contw
+	call bn_add_256
+	ifetch 1,regB
+	iadd regC,pdata
+	istore 1,regB						 
+	increase -32,regB
+bn_rshifteven_256_0:
+	add regB,32,regA
+	force 9,loopcnt
+	call bn_rshift
+	branch bn_rshifteven_256_1		
+
+else
+sp_initialize_256:
+	rtn
+
+endif
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/ui.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/ui.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/ui.prog	(working copy)
@@ -0,0 +1,349 @@
+ui_init:
+	call lpm_disable_exen_output
+	rtn wake
+	branch ui_timer_init
+	
+ui_dispatch:	
+	branch ui_timer_check
+	
+	
+
+
+ui_timer_timeout:
+	setarg 0x1000
+	lshift16 pdata,pdata
+	iadd regb,regb
+	rtn
+	
+ui_timer_check:
+	bpatchx patch33_5,mem_patch33
+	arg 0,rega
+	fetcht 4,mem_ui_timer_last_btclk
+	copy clkn_bt,regb
+	copy regb,pdata
+	isub temp,null
+	ncall ui_timer_timeout,positive
+	//call ice_break
+ui_timer_check_loop:
+	copy regb,pdata
+	increase 160,temp    //320btclk = 100ms
+	increase 160,temp
+	isub temp,null
+	nbranch ui_timer_check_end,positive
+	increase 1,rega   //increase 1 every 100ms count
+	and rega,0x0f,pdata
+	nbranch ui_timer_check_loop,blank
+	arg 0,rega  //reset timer if it's longer than 1.5s between 2 checks
+	call ui_timer_check_send_evt
+ui_timer_init:
+	copy clkn_bt,pdata
+	store 4,mem_ui_timer_last_btclk
+	rtn
+ui_timer_check_end:
+	bpatchx patch33_6,mem_patch33
+	copy rega,pdata
+	rtn blank
+	increase -160,temp    //320btclk = 100ms
+	increase -160,temp
+	set0 28,temp
+	storet 4,mem_ui_timer_last_btclk
+ui_timer_check_send_evt:
+	branch app_evt_timer
+
+	
+
+//**********************************************************//
+//************UI Inter-Processor Communication*******//
+//**********************************************************//
+ui_ipc_get_lock:
+	jam 1,mem_ipc_lock_bt
+ui_ipc_get_lock_wait:
+	fetch 1,mem_ipc_lock_c51
+	nbranch ui_ipc_get_lock_wait,blank
+	rtn
+	
+ui_ipc_put_lock:
+	jam 0,mem_ipc_lock_bt
+	rtn
+	
+
+	
+ui_ipc_send_event:
+	bpatchx patch33_7,mem_patch33
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_ipc_rega_temp
+	arg mem_ipc_fifo_bt2c51,rega
+	call fifo_in
+	fetch 4,mem_ipc_rega_temp
+	copy pdata,rega
+	branch ui_ipc_put_lock
+
+ui_ipc_send_cmd:
+	bpatchx patch34_0,mem_patch34
+	call ui_ipc_get_lock
+	copy rega,pdata
+	store 4,mem_ipc_rega_temp	
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_in
+	fetch 4,mem_ipc_rega_temp
+	copy pdata,rega	
+	branch ui_ipc_put_lock
+
+ui_ipc_clean_all_fifo:
+	setarg 0
+	store UTIL_FIFO_LEN,mem_ipc_fifo_c512bt
+	store UTIL_FIFO_LEN,mem_ipc_fifo_bt2c51
+	rtn
+	
+check_51cmd:
+	bpatchx patch34_1,mem_patch34
+	fetch 1,mem_hci_cmd
+	nrtn blank
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_is_empty
+	rtn blank
+	jam IPC_CONTINUE_PROCESS,mem_ipc_skip_continue_proc
+	call check_51cmd_once
+	fetch 1,mem_ipc_skip_continue_proc
+	branch check_51cmd,blank
+	rtn
+
+check_51cmd_once:
+	call ui_ipc_get_lock
+	arg mem_ipc_fifo_c512bt,rega
+	call fifo_out
+	copy pdata,temp
+	call ui_ipc_put_lock
+	bpatchx patch34_2,mem_patch34
+	copy temp,pdata
+	rtn blank
+ 	beq BT_CMD_START_DISCOVERY,check_51cmd_start_discovery
+  	beq BT_CMD_STOP_DISCOVERY,check_51cmd_stop_discovery
+  	beq BT_CMD_RECONNECT,check_51cmd_reconnect
+  	beq BT_CMD_ENTER_SNIFF_SUBRATING,check_51cmd_enter_sniff_subrating
+  	beq BT_CMD_EXIT_SNIFF_SUBRATING,check_51cmd_exit_sniff_subrating
+  	beq BT_CMD_SNIFF_TEST,check_51cmd_sniff_test
+	beq BT_CMD_START_INQUIRY,check_51cmd_inq
+	beq BT_CMD_STOP_INQUIRY,check_51cmd_stop_inq
+	beq BT_CMD_START_ADV,check_51cmd_adv
+	beq BT_CMD_STOP_ADV,check_51cmd_stop_adv
+	beq BT_CMD_START_DIRECT_ADV,check_51cmd_direct_adv
+	beq BT_CMD_STOP_DIRECT_ADV,check_51cmd_stop_direct_adv
+	beq BT_CMD_LE_START_CONN,check_51cmd_le_start_con
+	beq BT_CMD_LE_START_SCAN,check_51cmd_start_scan
+	beq BT_CMD_LE_STOP_SCAN,check_51cmd_stop_scan
+	beq BT_CMD_ENTER_HIBERNATE,check_51cmd_hibernate
+	beq BT_CMD_LE_SMP_SECURITY_REQUEST,check_51cmd_le_smp_sec_req
+	beq BT_CMD_BB_RECONN_CANCEL,check_51cmd_bb_reconn_cancel
+	//context related, process in context
+	store 1,mem_fifo_temp
+	bpatchx patch34_3,mem_patch34
+	call lmo_fifo_check
+	nbranch check_51cmd_restore,blank  //process this cmd next time while lmo fifo is full
+check_51cmd_once_continue:
+	fetch 1,mem_fifo_temp
+	bmark0 mark_context,check_51cmd_check_idle
+	beq BT_CMD_DISCONNECT,check_51cmd_disconnect
+  	beq BT_CMD_ENTER_SNIFF,cmd_in_sniff
+  	beq BT_CMD_EXIT_SNIFF,cmd_exit_sniff
+  	beq BT_CMD_SET_PIN_CODE,check_51cmd_pincode
+	beq BT_CMD_LE_DISCONNECT,check_51cmd_le_disconnect
+	beq BT_CMD_LE_UPDATE_CONN,check_51cmd_ble_update_connect_param
+	beq BT_CMD_ROLE_SWITCH,check_51cmd_role_switch
+	beq BT_CMD_STORE_RECONN_INFO_LE,eeprom_store_le_reconn_info
+	beq BT_CMD_STORE_RECONN_INFO_BT,eeprom_store_bd_reconn_info
+	beq BT_CMD_DHKEY_NOT_ACCEPT,check_51cmd_dhkey_not_accept
+	beq BT_CMD_STORE_RECONN_INFO,check_51cmd_store_reconn_info
+	rtn
+
+check_51cmd_check_idle:
+	store 1,mem_fifo_temp
+  	call context_check_idle
+	branch check_51cmd_restore,zero
+	call context_search_plap
+	nrtn zero
+check_51cmd_restore:
+	jam IPC_SKIP_CONTINUE_PROCESS,mem_ipc_skip_continue_proc
+	branch ui_ipc_send_cmd
+  
+ /******************** 51COMMAND*********************/
+
+//command opcode 0x01	
+check_51cmd_start_discovery:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_DISCOVERY
+	store 2,mem_ui_state_map
+	jam 3,mem_scan_mode
+	rtn
+
+
+//command opcode 0x02	
+check_51cmd_stop_discovery:
+	jam 0,mem_hid_handshake_timer_count
+	jam 0,mem_scan_mode
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_DISCOVERY
+	store 2,mem_ui_state_map
+	rtn	
+
+
+//command opcode 0x03	
+check_51cmd_reconnect:	
+	jam hci_cmd_create_conn,mem_hci_cmd
+	rtn	
+
+
+//command opcode 0x04
+check_51cmd_disconnect:
+	jam LMP_DETACH,mem_lmo_opcode2
+	jam OTHER_END_TERMINATED,mem_disconn_reason_send
+	rtn
+
+	
+//command opcode 0x07
+check_51cmd_enter_sniff_subrating:
+	rtn
+
+
+//command opcode 0x08
+check_51cmd_exit_sniff_subrating:
+	rtn	
+
+
+//command opcode 0x09
+check_51cmd_sniff_test:
+	rtn	
+
+
+//command opcode 0x10
+check_51cmd_pincode:
+	jam pincode_state_pincode_ready,mem_pincode_state
+	branch cmd_pair
+
+
+//command opcode 0x11
+check_51cmd_inq:
+	rtn
+
+
+//command opcode 0x12
+check_51cmd_stop_inq:
+	rtn
+
+
+//command opcode 0x13
+check_51cmd_adv:
+	jam ON,mem_le_adv_enable
+	jam ADV_IND,mem_le_adv_type
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+
+//command opcode 0x14
+check_51cmd_stop_adv:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	jam OFF,mem_le_adv_enable
+	rtn
+
+
+//command opcode 0x15
+check_51cmd_direct_adv:
+	jam ON,mem_le_adv_enable
+	jam ADV_DIRECT_IND,mem_le_adv_type
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	rtn
+
+
+//command opcode 0x16
+check_51cmd_stop_direct_adv:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+	jam OFF,mem_le_adv_enable
+	rtn
+
+
+//command opcode 0x17
+check_51cmd_le_disconnect:
+	setarg 20 // 100ms
+	store 2,mem_le_superto
+	store 2,mem_le_init_superto
+	branch le_send_terminate_ind_user_terminated
+
+
+//command opcode 0x18
+check_51cmd_ble_update_connect_param:
+	branch le_l2cap_tx_update_req
+
+
+
+//command opcode 0x22
+check_51cmd_le_start_con:
+	jam ON,mem_le_scan_enable
+	jam hci_cmd_le_create_conn,mem_hci_cmd
+//	fetch 6,mem_app_peer_addr
+//	store 6,mem_le_conn_peer_addr
+	rtn
+
+
+//command opcode 0x23
+check_51cmd_start_scan:
+	jam ON,mem_le_scan_enable
+	rtn
+
+
+//command opcode 0x24
+check_51cmd_stop_scan:
+	jam OFF,mem_le_scan_enable
+	jam 0,mem_hci_cmd
+	rtn
+
+
+//command opcode 0x25
+check_51cmd_hibernate:
+	fetch 2,mem_cb_before_hibernate
+	call callback_func
+	call ui_ipc_clean_all_fifo
+	branch lpm_hibernate	
+
+
+//command opcode 0x27
+check_51cmd_le_smp_sec_req:
+	branch le_send_smp_security_request
+
+
+//command opcode 0x29
+check_51cmd_role_switch:
+  	jam LMP_SLOT_OFFSET,mem_lmo_opcode2
+	set1 mark_switch_initiated,mark
+	nrtn master
+	jam SWITCH_FLAG_INIT,mem_switch_flag
+	jam LMP_SWITCH_REQ ,mem_lmo_opcode2
+	fetch 1,mem_connection_options
+	set0 CONNECTION_SWITCH,pdata
+	store 1,mem_connection_options
+	rtn
+
+
+//command opcode 0x30
+check_51cmd_bb_reconn_cancel:
+	force page_length_timer,queue
+	branch timer_stop
+
+
+//command opcode 0x33
+check_51cmd_dhkey_not_accept:
+	call tid_set_reply
+	jam LMP_DHKey_Check,mem_lmi_opcode2
+	branch parse_lmp_dhkey_check_reject	
+
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/program/utility.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/utility.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/program/utility.prog	(working copy)
@@ -0,0 +1,609 @@
+
+right_shift_n: //rshiftN pdata,pdata
+	sub loopcnt,0,null
+	rtn zero
+right_shift_n_loop: 
+	rshift pdata,pdata
+	loop right_shift_n_loop
+	rtn
+
+/* lshift. 0:1 byte; 1:2byte; 2:4byte; 3:8byte; 4:16byte*/
+left_shift_n:
+	force 1,pdata
+	sub loopcnt,0,null
+	rtn zero
+left_shift_n_loop:
+	lshift pdata,pdata
+	loop left_shift_n_loop
+	rtn
+push_stack:
+	deposit contw
+	store 2, mem_contw
+	storet 8,mem_temp
+	deposit timeup
+	store 4,mem_timeup
+	call push_stack_rega_b_c
+	deposit contr
+	store 2, mem_contr
+	rtn
+
+push_stack_rega_b_c:
+	deposit rega
+	store 4, mem_rega
+	deposit regb
+	store 4, mem_regb
+	deposit regc
+	store 3, mem_regc
+	rtn
+
+pop_stack:
+	fetcht 8,mem_temp
+	fetch 4,mem_timeup
+	iforce timeup
+	call pop_stack_rega_b_c
+	fetch 2, mem_contw
+	iforce contw
+	fetch 2, mem_contr
+	iforce contr
+	rtn
+
+pop_stack_rega_b_c:
+	fetch 4, mem_rega
+	iforce rega
+	fetch 4, mem_regb
+	iforce regb
+	fetch 3,mem_regc
+	iforce regc
+	rtn
+
+get_contw:
+	fetch 2,mem_contw
+	copy pdata,contw
+	rtn
+get_contr:
+	fetch 2,mem_contr
+	copy pdata,contr
+	rtn
+store_contw:
+	copy contw,pdata
+	store 2,mem_contw
+	rtn
+store_contr:
+	copy contr,pdata
+	store 2,mem_contr
+	rtn	
+	
+
+//
+save_cont_pointers:
+	copy contw,pdata
+	store 2,mem_hold_contw
+	copy contr,pdata
+	store 2,mem_hold_contr
+	rtn
+load_cont_pointers:
+	fetch 2,mem_hold_contw
+	copy pdata,contw
+	fetch 2,mem_hold_contr
+	copy pdata,contr
+	rtn
+
+memcpy96:
+	call memcpy32
+memcpy64:
+	call memcpy32
+	branch memcpy32
+memcpy12:
+	call memcpy8
+memcpy4:
+	ifetch 4,contr
+	istore 4,contw
+	rtn	
+memcpy8:
+	ifetch 8,contr
+	istore 8,contw
+	rtn	
+
+memcpy48:
+	call memcpy16
+memcpy32:
+	call memcpy8
+memcpy24:
+	call memcpy8
+memcpy16:
+	call memcpy8
+	branch memcpy8
+
+
+
+delay_10ms:
+	arg 10,loopcnt
+delay_ms_wait:
+	nop 12000
+	loop delay_ms_wait
+	rtn
+
+bn_zero:
+	force 3,loopcnt
+memset0:
+	force 0,pdata
+memset8:
+	istore   8,contw
+	loop   memset8
+	rtn
+
+memset0_8:
+	force 0,pdata
+	istore 8,contw
+	rtn
+memset0_4:
+	force 0,pdata
+	istore 4,contw
+	rtn	
+	
+clear_mem_256:
+	force 4,loopcnt
+	branch memset0 
+clear_mem_512:
+	force 8,loopcnt
+	branch memset0 
+
+clear_mem:
+	deposit loopcnt
+	rtn blank
+	setarg 0
+clear_mem_loop:
+	istore 1,contw
+	loop clear_mem_loop
+	rtn
+	
+
+clear_temp_block:
+	arg 32,loopcnt
+	arg mem_temp_block0,contw
+	branch clear_mem
+	
+xor_loop:
+	ifetch   4,regc
+	ifetcht 4,rega
+	ixor     temp,pdata
+	istore   4,contw	
+	increase 4,rega
+	increase 4,regc
+	loop  xor_loop
+	rtn
+	
+// 11 22 -> 22 11; 11 22 33 -> 33 22 11 
+// rega:data addr ;loopnct:length
+inverse_data:
+	bpatchx patch34_4,mem_patch34
+	copy loopcnt,pdata
+	sub pdata,1,null
+	rtn positive
+	iadd rega,regb	
+	increase -1,regb
+	rshift loopcnt,loopcnt
+inverse_loop:
+	ifetcht 1,rega
+	ifetch 1,regb
+	istore 1,rega
+	istoret 1,regb
+	increase -1,regb
+	increase 1,rega
+	loop inverse_loop
+	rtn
+
+
+memcpy_fast:
+	deposit loopcnt
+	rtn blank
+memcpy_fast_loop:
+	increase -8,loopcnt
+	call memcpy8,positive
+	rtn zero
+	branch memcpy_fast_loop,positive
+	increase 8,loopcnt
+memcpy_fast_loop_four:
+	increase -4,loopcnt
+	call memcpy4,positive
+	rtn zero
+	branch memcpy_fast_loop_four,positive
+	increase 4,loopcnt
+	branch memcpy
+ 
+memcpy:
+	deposit loopcnt
+	rtn blank
+memcpy_loop:
+	ifetch 1,contr
+	istore 1,contw
+	loop memcpy_loop
+	rtn
+
+timer_stop:
+	setarg 0
+timer_init:
+	rshift clkn_bt,temp
+	storet 4,mem_last_clkn
+	arg mem_timers,contw
+	iforce temp
+	lshift queue,pdata
+	iadd contw,contw
+	istoret 2,contw
+	bpatchx patch34_5,mem_patch34
+	rtn
+
+timer_check_timeout:
+	arg 0x800,timeup
+	lshift16 timeup,timeup
+	iadd timeup,pdata
+	rtn
+
+
+timer_reinit:
+	arg 0,queue
+timer_check:
+	bpatchx patch34_6,mem_patch34
+	fetcht 4,mem_last_clkn
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn	
+	isub temp,null
+	ncall timer_check_timeout,positive	
+	isub temp,timeup
+	copy timeup,temp
+	arg mem_timers,contr
+	copy contr,contw
+	arg 16,loopcnt
+timer_loop:
+	ifetch 2,contr
+	isub temp,pdata
+	branch timer_counting,positive
+	force 0,pdata
+timer_counting:
+	istore 2,contw
+	loop timer_loop	
+	arg mem_timers,contr
+	lshift queue,pdata
+	iadd contr,contr
+	ifetch 2,contr
+	rtn
+
+
+
+	/* pdata 28+16 bit add temp 26+16 bit, result in temp */
+clk_add:
+	iadd temp,temp
+	copy temp, loopcnt
+	setarg 3750
+	isub loopcnt,pdata
+	rtn positive
+	sub pdata,0,pdata
+	rshift16 temp,temp
+	increase 1,temp
+	lshift16 temp,temp
+	ior temp,temp
+	rtn
+
+clk_diff_rt:
+	call clk_diff
+	branch clk2rt
+
+/* pdata -temp -> pdata, all are 28+16 bits, set user if negative */
+clk_diff:
+	disable user
+	isub temp,pdata
+	branch clk_diff_pos,positive
+	enable user
+	sub pdata,0,pdata
+clk_diff_pos:
+	rtnbit0 15
+	arg -61786,temp
+	iadd temp,pdata
+	set0 64,pdata
+	rtn
+
+clk2rt:
+	iforce contr
+	rshift16 pdata,pdata
+	arg 3750,temp
+	imul32 temp,pdata
+	iadd contr,pdata
+	rtn
+
+	/* pdata = clks in, temp = lpo out */
+clk2lpo:
+	lshift8 pdata,pdata
+	lshift4 pdata,pdata
+	fetcht 3,mem_clks_per_lpo
+	idiv temp
+	call wait_div_end
+	quotient temp
+	rtn
+
+	/* rt clk -> bt+rt clk */
+clk2bt:
+	arg 3750,temp
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	lshift16 pdata,pdata
+	remainder temp
+	ior temp,temp
+	rtn
+
+
+
+//input:contru 
+//output:temp
+//used register: temp regc
+string2dec_from_uart:
+	arg 0,temp
+string2dec_from_uart_done:
+         copy temp,regc
+	ifetch 1,contru
+	call uchar2dialog	
+	copy regc,temp
+	call swap
+	arg 10,regb
+	imul32 regb,pdata
+	iadd temp,pdata
+	copy pdata,temp
+	loop string2dec_from_uart_done
+	rtn
+	
+
+
+uchar2dialog:
+	arg 0x3a,temp
+	isub temp,null
+	nbranch uchar2dialog_number,positive
+	arg 0x61,temp
+	isub temp,null
+	branch uchar2dialog_a2f,positive
+	arg 0x37,temp
+	isub temp,pdata
+	rtn
+uchar2dialog_number:
+	arg 0x30,temp
+	isub temp,pdata
+	rtn
+uchar2dialog_a2f:
+	arg 0x57,temp
+	isub temp,pdata
+	rtn
+
+pn9:
+	copy temp,alarm
+	setarg 0x1ff
+	force 0,regb
+pn9_loop:	
+	rshift3 pdata,rega
+	rshift rega,rega
+	ixor rega,rega
+	isolate1 0,rega
+	setflag true,9,pdata
+	rshift temp,temp
+	isolate1 0,pdata
+	setflag true,7,temp
+	rshift pdata,pdata
+	increase 1,regb
+	compare 0,regb,0x7
+	nbranch pn9_loop,true
+	istoret 1,contw
+	loop pn9_loop
+	copy alarm,temp
+	rtn
+
+
+wait_div_end:	
+	rtn modone
+	branch wait_div_end
+
+
+
+//input:
+//	count:loopcnt str1:rega str2:regb
+//output:
+//	same:set falg true ,diff set falg false
+// using:
+//	reg:temp null flag:zero
+compare_loop:
+string_compare:
+	ifetch 1,rega
+	ifetcht 1,regb
+	isub temp,null
+	nrtn zero
+	increase 1,rega
+	increase 1,regb
+	loop string_compare
+	force 0,null
+	rtn
+
+	/* pdata = temp if pdata > temp */
+ceiling:
+	isub temp,null
+	nrtn positive
+	deposit temp
+	rtn
+	
+swap:
+	iadd temp,pdata
+	isub temp,temp
+	isub temp,pdata
+	rtn
+
+clean_mem:
+	arg 0x200,loopcnt
+	arg 0x4000,contw
+	branch memset0				// clear xram at boot
+
+	//cb function ptr in pdata
+callback_func:
+	rtn blank
+	copy pdata,pc	//rtn through cb functon.
+	//branch assert
+
+
+ice_break:
+	hjam 0x1,core_ice_ctrl
+	rtn
+
+ice_setbp:
+	hstore 2,core_ice_break0
+	hfetch 1,core_ice_ctrl
+	set1 4,pdata
+	hstore 1,core_ice_ctrl
+	rtn
+ice_setbp2:
+	hstore 2,core_ice_break1
+	hfetch 1,core_ice_ctrl
+	set1 6,pdata
+	hstore 1,core_ice_ctrl
+	rtn
+	
+ice_set_write_bp:
+	hstore 2,core_ice_break0
+	hjam 0x30,core_ice_ctrl
+	rtn
+	
+test_no_white:
+	hfetch 1,core_config
+	set1 whiteoff_bit,pdata
+	hstore 1,core_config			/* whitening off */
+	rtn
+
+
+test_enable_white:
+	hfetch 1,core_config
+	set0 whiteoff_bit,pdata
+	hstore 1,core_config			/* whitening on */
+	rtn
+
+
+	//fuction fifo_in
+	//rega pointer to fifo memory , *(rega+len) is the end of fifo
+	//mem_fifo_temp data into fifo
+	//assert if fifo was full
+fifo_in:
+	bpatchx patch34_7,mem_patch34
+	ifetcht UTIL_FIFO_LEN,rega
+	and temp,0xff,pdata
+	nbranch fifo_in_push,blank
+	rshift8 temp,pdata
+	istore UTIL_FIFO_LEN,rega
+fifo_in_push:
+	increase UTIL_FIFO_LEN+UTIL_FIFO_OFFSET,rega
+	ifetch 1,rega
+	nbranch assert,blank //fifo full
+	fetch 1,mem_fifo_temp
+	istore 1,rega
+	rtn
+	
+	//fuction fifo_out
+	//rega pointer to fifo memory
+	//pdata  data from fifo, blank mains fifo empty
+fifo_out:
+	bpatchx patch35_0,mem_patch35
+	arg UTIL_FIFO_LEN,loopcnt
+	ifetch UTIL_FIFO_LEN,rega
+	rtn blank
+fifo_out_loop:
+	ifetch 1,rega
+	nbranch fifo_out_end,blank
+	increase 1,rega
+	loop fifo_out_loop
+	branch assert
+fifo_out_end:
+	arg 0,temp
+	istoret 1,rega
+	rtn
+
+	//fuction fifo_is_empty
+	//rega pointer to fifo memory
+	//blank--- fifo is empty
+fifo_is_empty:
+	ifetch UTIL_FIFO_LEN,rega
+	rtn
+
+	//fuction fifo_is_full
+	//rega pointer to fifo memory
+	//blank--- fifo is NOT full
+fifo_is_full:
+	ifetch 1,rega
+	rtn
+	//rega pointer to fifo memory
+	//blank--- fifo is NOT near full
+fifo_is_near_full:
+	ifetch 2,rega
+	rtn
+
+	//rega pointer to fifo memory
+	//count output via pdata
+fifo_content_count:
+	arg 0,temp
+fifo_content_count_loop:
+	fetch 1,contr
+	loop fifo_content_count_loop,blank
+	increase 1,temp
+	loop fifo_content_count_loop
+	copy temp,pdata
+	rtn
+	
+not_greater_than:
+	isub temp,null
+	nrtn positive
+	copy temp,pdata
+	rtn
+
+
+disable_positive:
+	force -1,null
+	rtn
+enable_positive:
+disable_zero:
+	force 1,null
+	rtn
+enable_zero:
+	force 0,null
+	rtn
+
+enable_user:
+	enable user
+	rtn
+	
+disable_user:
+	disable user
+	rtn
+	
+enable_user2:
+	enable user2
+	rtn
+	
+disable_user2:
+	disable user2
+	rtn
+
+disable_blank:
+	setarg 1
+	rtn
+
+enable_blank:
+	setarg 0
+	rtn
+
+
+reverse_byte:
+	copy loopcnt,pdata
+	rtn blank
+	copy contr,pdata
+	iadd loopcnt,pdata
+	increase -1,pdata
+	copy pdata,contr	
+reverse_loop:
+	ifetch 1,contr
+	increase -2,contr
+	istore 1,contw
+	loop reverse_loop
+	rtn
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/util/memalloc.pl
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/memalloc.pl	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/memalloc.pl	(working copy)
@@ -0,0 +1,90 @@
+$path=$ARGV[0];
+open file, $path;
+@f = <file>;
+close file;
+open file, ">$path";
+$path =~ s/\/.*//;
+open file1, ">$path/memmap.format";
+$xaddr = 0x4000;
+$addr = 0;
+#if($#ARGV == 1) {
+#	$addr = hex($ARGV[0]);
+#	$xaddr = hex($ARGV[1]);
+#}
+for($i = 0;$i < @f;$i++) { $cmalloc[$i] = (); }
+for($i = 0;$i < @f;$i++) { 
+	$_ = $f[$i];
+	$start = 1 if(/^\s*memalloc\s*\(\s*$/);
+	$start = 2 if(/^\s*xmemalloc\s*\(\s*$/);
+	$start = 3 if(/^\s*omemalloc\s*\(\s*$/);
+	$start = 4 if(/^\s*bmemalloc\s*\(\s*$/);
+	$start = 10 + $1 if(/^\s*cmemalloc\s+([0-9])\s*\(\s*$/);
+	if($start) {
+		if(/^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+			if($start == 1) {
+				$str = sprintf "0x%04x %s%s\n", $addr, $2, $3;
+				$addr += $1;
+				$bstr .= $str;
+				$sstr .= $str;
+			} elsif($start == 2) {
+				$str = sprintf "0x%04x %s%s\n", $xaddr, $2, $3;
+				$xaddr += $1;
+				$xstr .= $str;
+			} else {
+				push @ostr, $_;
+			}
+		}
+		if(/^\s*\)\s*$/) {
+			if(@ostr > 0) {
+				if($start == 3) {
+					push @omalloc,[@ostr];
+				} elsif($start == 4) {
+					push @bmalloc,[@ostr];
+				} elsif($start > 9) {
+					$j = $start - 10;
+					push @{$cmalloc[$j]},@ostr;
+				} 
+			}
+			$start = 0;
+			@ostr = ();
+		}
+	} else {
+		$sstr .= $_;
+	}
+}
+for($i = 0;$i <= $#cmalloc;$i++) {
+	push @omalloc,$cmalloc[$i];
+#	for($j = 0;$j <= $#{$cmalloc[$i]};$j++) {		print $cmalloc[$i][$j];	}
+}
+
+$xend = $xaddr;
+for($i = 0;$i <= $#omalloc;$i++) {
+	for($j = 0, $oaddr = $xaddr;$j <= $#{$omalloc[$i]};$j++) {
+		if($omalloc[$i][$j] =~ /^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+			$str = sprintf "0x%04x %s%s\n", $oaddr, $2, $3;
+			$oaddr += $1;
+			$xstr .= $str;
+		}
+	}
+	$xend = $oaddr if($oaddr > $xend);
+}
+
+$bend = $addr;
+for($i = 0;$i <= $#bmalloc;$i++) {
+	for($j = 0, $baddr = $addr;$j <= $#{$bmalloc[$i]};$j++) {
+		if($bmalloc[$i][$j] =~ /^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+			$str = sprintf "0x%04x %s%s\n", $baddr, $2, $3;
+			$baddr += $1;
+			$xstr .= $str;
+		}
+	}
+	$bend = $baddr if($baddr > $bend);
+}
+
+
+print file $xstr, $sstr;
+print file1 $bstr, $xstr;
+close file;
+close file1;
+printf "\nLast allocated address is %04x\n", $bend;
+printf "\nLast allocated xmem address is %04x\n", $xend;
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/util/mergepatch.pl
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/mergepatch.pl	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/mergepatch.pl	(working copy)
@@ -0,0 +1,52 @@
+$defs = "";
+$fmt = 0;
+
+
+sub parseif {
+	my($fname) = @_;
+	if (@ARGV<2){
+		$faddr="program";
+	} else{
+		$faddr=$ARGV[1];
+	}
+	#printf "$faddr\n";
+	open file, $fname;
+	@f = <file>;
+	close file;
+	open file, ">$fname";
+	@valid = (1);
+	for($i = 0;$i < @f;$i++) { 
+		$_ = $f[$i];
+		$defs .= $1 . " " if(/^define\s+(\w+)\s*/);
+		if(/^ifdef\s+(\w+)\s*/) {
+			push @valid, ($defs =~ /$1 / ? 1 : 0) & $valid[$#valid];
+		} elsif(/^ifndef\s+(\w+)\s*/) {
+			push @valid, ($defs =~ /$1 / ? 0 : 1) & $valid[$#valid];
+		} elsif(/^else/) {
+			printf "%s\nelse without if at line %d\n", $f[$i - 3], $i if($#valid == 0);
+			$valid[$#valid] = (1 - $valid[$#valid]) & $valid[$#valid - 1];
+		} elsif(/^endif/) {
+			printf "%s\nendif without if at line %d\n", $_, $i if($#valid == 0);
+			pop @valid;
+		} elsif($valid[$#valid]) {
+			if(/^include\s+(.+)\s*/) {
+				open file2, "$faddr/$1";
+				#printf "$faddr/$1\n";
+				@f2 = <file2>;
+				close file2;
+				splice(@f, $i + 1, 0, @f2);
+			} else {
+				next if(/^\s*bpatch\s+/ && $defs !~ /ROMCODE/);
+				next if(/^\s*set[01] mark_ext_patch/ && $defs !~ /ROMCODE/);
+				print file $_;
+			}
+		}
+	}
+	close file;
+}
+
+parseif("output/bt_program23.meta");
+$fmt = 1;
+parseif("output/bt_format.meta");
+
+
Index: BlueTooth/BT_code_patch/shoubing/bt_rom/util/rom2h.pl
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/rom2h.pl	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/bt_rom/util/rom2h.pl	(working copy)
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+@dat = <stdin>;
+printf "const unsigned char bt_code[] = {\n";
+for($i = 0;$i < @dat;$i++) {
+	$dat[$i] =~ s/\s//g;
+	printf "0x%s%s", $dat[$i], $i == $#dat ? "\n" : $i % 16 == 15 ? ",\n" : "," if(length($dat[$i]) == 2);
+}
+printf "};\n";
Index: BlueTooth/BT_code_patch/shoubing/do.bat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/do.bat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/do.bat	(working copy)
@@ -0,0 +1,251 @@
+cls
+@echo off
+
+::get Rom path
+set now_path=%~dp0
+::call:getstrlocation %now_path% ModuleDemo location
+::call:get_fix_len_str  %now_path% location soft_path
+::set lib_path=%soft_path%Librarier
+set rom_path=%now_path%\bt_rom
+set program=%rom_path%\program
+set format=%rom_path%\format
+set util=%rom_path%\util
+set patch_path=%now_path%patch
+set sched=%now_path%sched
+set format_ex=%now_path%format
+
+rem @echo rom_path=%rom_path%
+rem @echo program_path=%program%
+rem @echo format_path=%format%
+rem @echo util_path=%util%
+rem @echo patch_path=%patch_path%
+
+setlocal enabledelayedexpansion
+
+for /f %%f in ('dir /b /o program_patch\*.prog') do @if not %%f==main_patch.prog set progs_patch=!progs_patch! program_patch\%%f
+rem for /f %%f in ('dir /b /o program_patch\keyboard_24g_spec_code\*.prog') do @set progs_patch=!progs_patch! program_patch\keyboard_24g_spec_code\%%f
+for /f %%f in ('dir /b /o program_patch\keyboard_ble_spec_code\*.prog') do @set progs_patch=!progs_patch! program_patch\keyboard_ble_spec_code\%%f
+for /f %%f in ('dir /b /o program_patch\keyboard_bt_spec_code\*.prog') do @set progs_patch=!progs_patch! program_patch\keyboard_bt_spec_code\%%f
+type program_patch\main_patch.prog %progs_patch% > patch\patch.prog
+
+set progs=""
+for /f %%f in ('dir /b /o %program%\*.prog') do @if not %%f==bt.prog if not %%f==patch.prog if not %%f==sim.prog set progs=!progs! + %program%\%%f
+copy %program%\bt.prog + %progs%  output\bt_program23.meta > output\1
+
+set fmts=""
+for /f %%f in ('dir /b /o %format%\*.format') do @if not %%f==bt.format if not %%f==command.format set fmts=!fmts! + %format%\%%f
+copy %format%\bt.format + %fmts%  + %format_ex%\app_module.format + %format_ex%\ui.format + %format_ex%\le.format + %format_ex%\utility.format + %format%\command.format output\bt_format.meta > output\2
+
+perl %util%/mergepatch.pl 				output/bt_program23.meta %patch_path%
+perl %util%/memalloc.pl 				output/bt_format.meta
+
+cd output
+osiuasm bt_program23 -O-W
+copy  ..\sched\ble_keyboard.dat + ..\sched\bt_keyboard.dat + ..\sched\DM_module.dat  + ..\sched\109x.dat ..\output\sched.rom
+Creat_patch_Module
+if "%1" equ "eep" (
+	goto genromrevc
+)else (
+  goto downloadram
+)
+
+:genromrevc
+echo off
+@echo Start to generate EEPROM code
+geneep -n
+
+rem perl eeprom2hciimage_1021s.pl
+echo bt_patch.bin Generated......
+
+:gen_eep_end
+cd ..
+echo **********************************
+echo EEPROM Generated.
+echo Use command "e fp" to download EEPROM.
+echo **********************************
+goto end
+
+
+
+:genrom
+@rem echo on
+perl ..\util\rom2mif.pl romcode
+del ..\..\%FPGA_PATH%\romcode.mif
+copy .\romcode.mif ..\..\%FPGA_PATH%\romcode.mif
+perl ..\util\gen_patch_h.pl >%YC_PATCH_FILE%
+copy .\%YC_PATCH_FILE% ..\..\%MV_PATCH%\%YC_PATCH_FILE%
+copy .\%YC_PATCH_FILE% D:\work\yichip\mv_proj\src\inc\%YC_PATCH_FILE%
+cd ..\..\%FPGA_PATH%
+quartus_cdb btspi -c btspi --update_mif
+quartus_asm --read_settings_files=off --write_settings_files=off btspi -c btspi
+quartus_pgm -c USB-Blaster[USB-0] -m jtag -o "p;.\output\btspi.sof" 
+@echo bitstream_compression=on >1
+@echo memory_map_file=on >> 1
+quartus_cpf -c -o 1 -s EP3C55 -d EPCS16 output\btspi.sof output\btspi.jic  
+@rem quartus_pgm -c USB-Blaster[USB-0] -m jtag -o "pi;.\output\btspi.jic"   
+@del 1
+goto end
+
+
+
+:downloadram
+echo on
+@echo Start to download ram code
+e ku
+e hu
+e su sched.rom
+@echo **********************************
+@echo RAM CODE has been downloaded. 
+@echo **********************************
+cd ..
+
+
+:end
+echo create bt_code.c file
+perl %util%/rom2h.pl  <.\output\eeprom.dat>  .\output\bt_code.c
+copy   .\output\bt_code.c  E:\my_svn\yc3121\SDK\Librarier\core
+goto:eof
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+::------------------------------------------
+::---------------func:getstrlocation-------
+::------------------------------------------
+:getstrlocation
+setlocal
+set "bstr=%1"
+set "cstr=%2"
+set %3=0
+set "num=0"
+set "len_bstr=0"
+set "len_cstr=0"
+
+call:getstrlen %bstr% len_bstr
+call:getstrlen %cstr% len_cstr
+
+:getstrlocation_next
+set /a len_remain=len_bstr-num
+if %len_remain% lss %len_cstr% (
+echo "cann't get str location"
+set /a num =0
+goto getstrlocation_last
+)
+
+call:get_fix_len_str %bstr%  len_cstr compar_str
+
+if not %compar_str%==%cstr% (
+set /a num+=1
+set "bstr=%bstr:~1%"
+goto getstrlocation_next
+)
+
+:getstrlocation_last
+(endlocal
+	set %3=%num%
+)
+goto:eof
+::---------------end:func-------------------
+
+
+::------------------------------------------
+::---------------func:get_fix_len_str-------
+::------------------------------------------
+:get_fix_len_str
+setlocal
+set "getstr=%NULL%"
+set str=%1
+set /a len=%2
+set num=0
+:get_fix_len_str_loop
+set getstr=%getstr%%str:~0,1%
+set /a num+=1
+set str=%str:~1%
+if %num% lss %len% goto get_fix_len_str_loop
+(endlocal
+ set %3=%getstr%
+)
+goto:eof
+::---------------end:func-------------------
+
+
+
+
+::------------------------------------------
+::---------------func:getstrlen-------------
+::------------------------------------------
+:getstrlen
+setlocal
+set str=%1
+set %2=0
+set /a "num=0"
+
+:getstrlen_next
+if "%str%"=="" goto getstrlen_last
+
+if not "%str%"=="" (
+set /a num+=1 
+set "str=%str:~1%"
+goto getstrlen_next
+)
+
+:getstrlen_last
+(endlocal
+	set /a "%2=%num%"
+)
+goto:eof
+::---------------end:func-------------------
+
+
+
+
+::------------------------------------------
+::---------------func:getcharlocation-------
+::------------------------------------------
+:getcharlocation
+setlocal
+set "str=%1"
+set "ch=%2"
+set %3=0
+set /a "num=0"
+
+:getcharnext
+if "%str%"=="" ( 
+set /a num=0
+goto getcharlast
+)
+
+if not "%str%"=="" (
+set /a num+=1
+if "%str:~0,1%"=="%ch%" goto getcharlast
+set "str=%str:~1%"
+goto getcharnext
+)
+:getcharlast
+(endlocal
+set %3=%num%
+)
+goto:eof 
+::---------------end:func-------------------
+
+
+
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/format/app_module.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/app_module.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/app_module.format	(working copy)
@@ -0,0 +1,221 @@
+bmemalloc(
+
+
+25 mem_m_process_sync_buffer
+2 mem_m_snd_op
+2 mem_m_rcv_op
+
+
+)
+omemalloc(	
+	2 mem_soft_version_num
+
+	2 mem_current_packet_length
+	1 mem_module_state
+	
+	1 mem_module_spp_lpm_mult
+	1 mem_module_le_lpm_mult	
+	1 mem_module_bluetooth_stauts_by_command
+
+	//ble
+	1 mem_module_le_rx_data_len
+	2 mem_module_le_rx_data_address
+	2 mem_module_le_rx_data_handle
+	//ble write handle
+	2 mem_module_data_write_handle
+	2 mem_module_data_write_handle2
+	//flag
+	1 mem_module_flag
+
+	1 mem_module_hci_notify_len
+	2 mem_module_hci_notify_handle
+	2 mem_module_hci_nofiy_addr
+
+	4 mem_last_transmite_clock
+	
+	754 mem_module_uuid_list
+	0 mem_module_uuid_list_end
+	336 mem_module_le_att_list
+	0 mem_module_le_att_list_end
+	0 mem_module_nv_data
+	34 mem_module_nv_data0
+	34 mem_module_nv_data1
+	34 mem_module_nv_data2
+	34 mem_module_nv_data3
+	34 mem_module_nv_data4
+	
+	15 mem_rf_init
+
+	//classic shutter config
+	1 mem_classic_shutter_cable_unplug_conut
+	1 mem_classic_shutter_hid_disconn_count
+
+	// Be aware of memory boundaries  limit 0x4bff
+	1 mem_suspend_flag
+
+
+1 mem_power_ctrl_pac_succ_cnt
+1 mem_power_ctrl_level
+
+1 mem_rssi_avg_received
+1 mem_rssi_hex_received
+8 mem_rssi_signal_buf
+8 mem_rssi_noise_buf
+1 mem_rssi_noise_index
+1 mem_rssi_signal_index
+
+28 mem_read_otp_data
+1 mem_en_24g_flag
+2 mem_module_uart_len_new
+
+1 mem_m_process_enable
+2 mem_m_wake_send_window
+8 mem_m_p_sequence
+9 mem_m_access_code
+4 mem_m_wake_data
+5 mem_m_save_lmp_Ye
+2 mem_m_wakeup_timer
+
+1 mem_btsniff
+1 mem_ns_wake_up_flag
+160 mem_context_new
+0 mem_module_end
+)
+(
+0x55aa OTP_INIT_VAL
+)
+(
+0x18508 sec_otp_addr
+0x1850a sec_otp_ctrl
+0x1850c sec_otp_data
+)
+
+//mem_24g_pairing_sm
+(
+0 STATE_24G_PAIRING_NULL
+1 STATE_24G_PAIRING_1
+2 STATE_24G_PAIRING_2
+3 STATE_24G_PAIRING_3
+0X11 STATE_24G_PAIRING_1_WAITING_ACK
+0X12 STATE_24G_PAIRING_2_WAITING_ACK
+0X13 STATE_24G_PAIRING_3_WAITING_ACK
+0XFF STATE_24G_PAIRING_SUCCESS
+)
+
+(
+0 ENSURE_OFF_24G
+1 ENSURE_ON_24G
+0x4e G24_PAIR_CH
+)
+
+(
+7 RSSI_BUF_LEN_SIGNAL
+255 RSSI_BUF_LEN_NOISE
+0x50 RSSI_THRESH_NOISE
+
+0x77 RSSI_DIS_MIN_24G
+0x82 RSSI_DIS_MAX_24G
+
+0x75 RSSI_DIS_MIN_BLE
+0x80 RSSI_DIS_MAX_BLE
+)
+
+/* 24g */
+(
+6 dlen_24g
+14 plen_24g
+90 blen_tx_24g
+106 blen_rx_24g
+42 blen_txack_24g
+58 blen_rxack_24g
+7 retry_24g
+0xaaf08e acc_24g
+0x15c4 crc_data_3byte
+0xbb81 crc_data_6byte
+0x4160 crc_ack
+41390 crc_ack_4byte
+)
+
+//mem_24g_data_type
+(
+0x07 bits_data
+//0-2 data type
+3 bit_abort
+4 bit_hop
+5 bit_sync
+//6-7 channel offset
+)
+
+
+(
+249 LE_BASEBAND_MAX_BUFFER
+)
+(
+	0x200 UART_AIR_CONTROL_THRESHOLD
+)
+(//Command
+0x15 HCI_CMD_SET_COD
+0x76 HCI_CMD_DELETE_CUSTOMIZE_SERVICE
+0x77 HCI_CMD_ADD_SERVICE_UUID
+0x78 HCI_CMD_ADD_CHARACTERISTIC_UUID
+
+0xb0 HCI_CMD_SEND_HID_DATA
+0xb1 HCI_CMD_CREAT_BT_RECONNECT
+0xb2 HCI_CMD_SEND_HID_CONTROL_DATA
+
+
+0xc0 HCI_CMD_START_24G
+0xC1 HCI_CMD_STOP_24G
+0xC2 HCI_CMD_PAIR_24G
+0xC3 HCI_CMD_DISCONNECTED_24G
+0xC4 HCI_CMD_SEND_24G_DATA
+
+
+0xa0 HCI_CMD_RESET_SDP_SERVICE
+0xa1 HCI_CMD_SET_FEATURE
+0xa2 HCI_CMD_SET_SNIFF
+
+0xfe HCI_CMD_ALL_ROUND
+)
+
+(//event
+0x29 HCI_EVENT_UUID_HANDLE
+
+0xb0 HCI_EVENT_BT_HID_CONNECT
+0xb1 HCI_EVENT_BT_RECONNECT_FAIL
+0xb2 HCI_EVENT_RECEIVE_BT_HID_DATA
+0xb3 HCI_EVENT_BLE_HID_CONNECT
+0xb4 HCI_EVENT_BLE_ENC_INFO
+0xb5 HCI_EVENT_BT_ENC_INFO
+0xb6 HCI_EVENT_BT_HID_DISCONNECT
+0xb7 HCI_EVENT_HID_INT_CONNECT
+0xb8 HCI_EVENT_HID_SNIFF_REPORT
+0xb9 HCI_EVNET_BB_CONN
+0xba HCI_EVENT_WAKEUP_TIMEOUT
+0Xbb HCI_EVENT_WAKEUP_FAIL
+
+
+
+0xc0 HCI_EVENT_24G_PAIRING_COMPLETE
+0xC1 HCI_EVENT_24G_ATTEMPT_FAIL
+0xC2 HCI_EVENT_24G_ATTEMPT_SUCCESS
+0xC3 HCI_EVENT_24G_RECEIVE_LOCK
+0xC4 HCI_EVENT_24G_PC_SLEEP
+)
+
+(
+1  FLAG_SHUTTER_HID_DISCONN_TIMEOUT
+5 FLAG_SHUTTER_CABLE_UNPLUG_TIMEOUT
+)
+
+(
+0x0007 HANDLE_UUID_CHRCTR_DEVICE_NAME
+0x000e HANDLE_UUID_CHRCTR_MANUFACTURER_NAME
+0x0010 HANDLE_UUID_PNP_ID
+0x0021 HANDLE_UUID_CHRCTR_REPORT_ID1_OUTPUT
+0x002d HANDLE_UUID_END
+)
+(
+	7 MODULE_READ_OTP_BIT
+)
+
Index: BlueTooth/BT_code_patch/shoubing/format/le.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/le.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/le.format	(working copy)
@@ -0,0 +1,17 @@
+	/* LE control packet type */
+	(
+	0x14 LL_LENGTH_REQ
+	0x15 LL_LENGTH_RSP
+	)
+(
+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: BlueTooth/BT_code_patch/shoubing/format/ui.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/ui.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/ui.format	(working copy)
@@ -0,0 +1,4 @@
+//mem_ui_state_map
+(
+12 UI_STATE_BT_HID_CONNECT
+)
Index: BlueTooth/BT_code_patch/shoubing/format/utility.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/utility.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/format/utility.format	(working copy)
@@ -0,0 +1,29 @@
+bmemalloc(
+
+)
+(// mem_bb_flag
+0 OLD_PACKET				//0:new packet   1: old packet  
+1 USE_BB_BUFFER_NOW		//0:BB BUFFER1  1:BB BUFFER2
+)
+(
+0 CACHE_BUFFER_FLAG
+1 CACHE_BUFFER_LCH
+2 CACHE_BUFFER_LEN
+4 CACHE_BUFFER_DATA_PTR
+
+
+)
+(
+0x0b1b mem_bb_cache_bufptr
+0x0b1d mem_bb_flag
+
+0x0b20 mem_baseband_buffer1_flag
+0x0b21 mem_baseband_buffer1_lch
+0x0b22 mem_baseband_buffer1_len
+0x0b24 mem_baseband_buffer1
+
+0x0c20 mem_baseband_buffer2_flag
+0x0c21 mem_baseband_buffer2_lch
+0x0c22 mem_baseband_buffer2_len
+0x0c24 mem_baseband_buffer2 
+)
Index: BlueTooth/BT_code_patch/shoubing/output/bt_code.c
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/bt_code.c	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/bt_code.c	(working copy)
@@ -0,0 +1,426 @@
+const unsigned char bt_code[] = {
+0x00,0x02,0xaa,0x55,0x4a,0x14,0xc2,0x84,0x00,0x19,0xc0,0x00,0x83,0xba,0xc0,0x02,
+0x80,0x31,0xc0,0x17,0x00,0x2e,0xc0,0x1a,0x00,0x2a,0xc0,0x2f,0x80,0x76,0xc0,0x30,
+0x00,0x7b,0xc0,0x2e,0x80,0x5c,0xc0,0x2f,0x00,0x6b,0xc0,0x38,0x00,0x4b,0xc0,0x1e,
+0x83,0x91,0xc0,0x42,0x83,0xc1,0xc0,0x44,0x83,0xe7,0xc0,0x4a,0x03,0xa0,0xc0,0x51,
+0x03,0xf0,0xc0,0x51,0x83,0xab,0xc0,0x54,0x83,0xae,0xc0,0x56,0x03,0xf7,0xc0,0x5c,
+0x00,0xc1,0xc0,0x5d,0x81,0x4b,0xc0,0x5e,0x01,0xfd,0xc0,0x5f,0x04,0xe9,0xc0,0x64,
+0x00,0x9f,0xc0,0x6d,0x80,0x93,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x84,0x07,0xc0,0x02,
+0x83,0xfe,0xc0,0x03,0x03,0xe2,0xc0,0x09,0x84,0x36,0xc0,0x0f,0x84,0x13,0xc0,0x10,
+0x84,0x25,0xc0,0x12,0x84,0x2a,0xc0,0x18,0x00,0x9a,0xc0,0x1e,0x02,0x15,0xc0,0x1d,
+0x02,0x25,0xc0,0x1e,0x82,0x35,0xc0,0x1f,0x82,0x42,0xc0,0x1f,0x02,0x48,0xc0,0x20,
+0x82,0x5b,0xc0,0x4c,0x82,0x61,0xc0,0x51,0x82,0x65,0x20,0x20,0x4a,0x8b,0x6f,0xe2,
+0x00,0x4c,0x79,0x3f,0xfe,0x02,0x67,0xe2,0x00,0x4c,0x20,0x20,0x43,0x2f,0xda,0x20,
+0x4b,0xd7,0xdf,0x20,0x00,0x02,0x20,0x20,0x42,0x60,0x20,0x40,0x42,0x5a,0x24,0x22,
+0x80,0x39,0x20,0x40,0x42,0x06,0x1a,0x20,0x8c,0x01,0xef,0xe2,0x00,0x06,0xc2,0x80,
+0x57,0x3a,0xc2,0x80,0xc1,0x62,0x20,0x20,0x43,0xcb,0x20,0x40,0x00,0x3b,0x20,0x20,
+0x40,0x2c,0xdf,0x20,0x00,0x02,0x68,0x42,0x00,0x15,0x18,0x40,0x84,0x01,0x28,0x41,
+0xfe,0x02,0x24,0x20,0x80,0x41,0xd8,0x40,0x00,0x00,0x60,0x42,0x00,0x15,0x18,0x4f,
+0xfe,0x50,0xda,0x20,0x4b,0xd7,0x9a,0x20,0xa2,0x00,0xef,0xe2,0x00,0x11,0xc2,0x80,
+0x80,0x49,0xc3,0x80,0x00,0x00,0xc3,0x81,0x80,0x00,0xc2,0x00,0x00,0x3d,0x20,0x60,
+0x00,0x00,0x79,0x3f,0x80,0x01,0x70,0x02,0x66,0x00,0x6f,0xe2,0x02,0x5f,0x20,0x7a,
+0x00,0x00,0x2f,0xef,0xfe,0x00,0xd8,0xc0,0x10,0x00,0x20,0x40,0xd1,0x53,0x6f,0xe2,
+0x02,0x66,0xc0,0x00,0xc7,0x37,0x70,0x02,0x66,0x00,0x6f,0xe2,0x02,0x5f,0xc4,0x00,
+0x80,0x00,0xd8,0xc0,0x12,0x00,0x20,0x40,0x51,0x53,0x6f,0xe2,0x02,0x66,0xc0,0x00,
+0xc7,0x3d,0x20,0x60,0x00,0x00,0xc5,0x07,0xc6,0x1c,0x6f,0xe4,0x01,0x5d,0xd8,0x40,
+0x01,0xe0,0x98,0x46,0x7c,0x00,0x20,0x21,0x46,0x39,0x6f,0xe2,0x02,0x5f,0xc2,0x80,
+0xc6,0x49,0xc3,0x00,0x45,0xc5,0xc3,0x00,0x80,0x66,0x20,0x20,0x46,0x49,0x70,0x02,
+0x5d,0x02,0x6f,0xe4,0x02,0x5b,0xc0,0x80,0x46,0x49,0xd8,0xa0,0x12,0x00,0x20,0x20,
+0x45,0xe0,0xc5,0x07,0xc6,0x1c,0x6f,0xe4,0x01,0x5d,0xd8,0x40,0x01,0xe0,0x98,0x46,
+0x7c,0x00,0x20,0x21,0x46,0x39,0x6f,0xe2,0x02,0x5d,0xc0,0x00,0xc5,0xd9,0xc0,0x01,
+0x00,0x74,0x20,0x20,0x46,0x49,0xd8,0xa0,0x12,0x00,0x20,0x20,0x45,0xde,0x09,0x80,
+0x00,0x10,0x20,0x23,0x46,0x33,0x6f,0xe2,0x43,0x35,0xc0,0x00,0xc6,0x33,0x20,0x20,
+0x45,0xe9,0x6f,0xe2,0x02,0x5d,0xc0,0x00,0x80,0x7f,0xc0,0x01,0x00,0x89,0x20,0x20,
+0x4a,0x8b,0x6f,0xe4,0x02,0x59,0x68,0x44,0x01,0x5d,0x98,0x40,0xfe,0x00,0x67,0xe4,
+0x02,0x59,0xc0,0x00,0x4a,0x8b,0x68,0x44,0x10,0x00,0x18,0x40,0x84,0x04,0x98,0x46,
+0x7c,0x00,0x20,0x42,0xc7,0x43,0x20,0x20,0x46,0x09,0x6f,0xe4,0x02,0x5b,0x68,0x44,
+0x01,0x5d,0x98,0x40,0xfe,0x00,0x67,0xe4,0x02,0x5b,0xc0,0x00,0x4a,0x8b,0x68,0x44,
+0x12,0x00,0x18,0x40,0x84,0x04,0x98,0x46,0x7c,0x00,0x20,0x42,0xc7,0x47,0x20,0x20,
+0x46,0x09,0xda,0x40,0x00,0x00,0x20,0x40,0x56,0x49,0x24,0x3a,0x4a,0x8b,0x20,0x40,
+0x56,0x58,0xda,0x40,0x14,0x00,0xd8,0xe0,0x00,0x00,0x20,0x20,0x56,0x21,0x20,0x40,
+0x5b,0x86,0x20,0x20,0x00,0x9c,0xda,0x60,0x43,0x81,0xda,0x20,0x43,0x62,0x20,0x20,
+0x5b,0xa5,0x18,0x42,0x7e,0x00,0xc0,0x00,0xd2,0x3e,0xc0,0x01,0xd2,0x60,0xc0,0x08,
+0x80,0xa6,0xc0,0x09,0x80,0xb3,0x20,0x40,0x54,0x3c,0x20,0x20,0x52,0xae,0x20,0x40,
+0x7c,0x83,0xd8,0x40,0x00,0x52,0x6f,0xe4,0x42,0x1e,0x24,0x3a,0x52,0xa8,0x19,0x62,
+0x7e,0x00,0x67,0xe4,0x42,0x1e,0x6f,0xe2,0x42,0x24,0x79,0x20,0x7e,0x00,0x79,0x20,
+0x7e,0x01,0x67,0xe2,0x42,0x24,0x20,0x40,0x52,0x8b,0x70,0x0a,0x95,0x42,0x20,0x20,
+0x7b,0xab,0x20,0x40,0x7c,0x83,0x1b,0x42,0x7e,0x00,0xd8,0x40,0x00,0x53,0x6f,0xe4,
+0x42,0x20,0x24,0x3a,0x52,0xa8,0x19,0x62,0x7e,0x00,0x67,0xe4,0x42,0x20,0x6f,0xe2,
+0x42,0x25,0x79,0x20,0x7e,0x00,0x79,0x20,0x7e,0x01,0x67,0xe2,0x42,0x25,0x20,0x40,
+0x52,0x8b,0x70,0x0a,0x95,0x42,0x20,0x20,0x7b,0xab,0x58,0x00,0x00,0xf8,0x67,0xe4,
+0x41,0xf6,0x58,0x00,0x01,0x3a,0x67,0xe4,0x41,0xfe,0x58,0x00,0x00,0xd2,0x67,0xe4,
+0x41,0xf4,0x58,0x00,0x01,0x3e,0x67,0xe4,0x41,0xfa,0x58,0x00,0x01,0x46,0x67,0xe4,
+0x41,0xea,0x58,0x00,0x01,0x47,0x67,0xe4,0x41,0xf2,0x20,0x40,0x03,0xf8,0x20,0x40,
+0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,0x50,0x4d,0x20,0x40,
+0x02,0xd5,0x20,0x40,0x50,0xd3,0x20,0x40,0x00,0xd5,0x20,0x40,0x56,0x48,0x24,0x7a,
+0x00,0x00,0x20,0x20,0x00,0xd8,0x6f,0xe4,0x4f,0xfc,0x68,0x44,0x4f,0xfe,0x98,0x46,
+0x7c,0x00,0x20,0x22,0xce,0x3a,0x20,0x40,0x67,0xf7,0xef,0xe2,0x00,0x03,0xc0,0x80,
+0xce,0x4e,0xef,0xe2,0x00,0x03,0xc0,0x50,0x00,0xea,0x67,0xe2,0x0a,0xff,0xe8,0x42,
+0x00,0x03,0x18,0x62,0x22,0x00,0x60,0x42,0x0b,0x00,0x70,0x0b,0x01,0x01,0x20,0x40,
+0x4e,0x5a,0x6f,0xe2,0x0b,0x01,0xc1,0x00,0x00,0x00,0x20,0x20,0x4e,0x55,0x67,0xe2,
+0x0a,0xff,0xe8,0x44,0x00,0x03,0x18,0x62,0x22,0x00,0x60,0x44,0x4b,0xb4,0x70,0x0b,
+0x01,0x01,0x20,0x40,0x4e,0x5a,0x6f,0xe2,0x0b,0x01,0xc1,0x00,0x00,0x00,0x20,0x20,
+0x00,0xf3,0x20,0x40,0x67,0xf7,0x18,0x60,0x86,0x02,0xef,0xe4,0x00,0x03,0x98,0x60,
+0x86,0x00,0x20,0x20,0x4e,0x59,0x1a,0x62,0x7e,0x00,0xc0,0x00,0x81,0x0d,0xc0,0x01,
+0x01,0x18,0xc0,0x02,0x01,0x1b,0xc0,0x02,0x84,0x9a,0xc0,0x03,0x04,0x9b,0xc0,0x03,
+0x84,0x9e,0xc0,0x09,0x04,0xa7,0xc0,0x09,0x81,0x1b,0xc0,0x13,0x84,0xb2,0xc0,0x17,
+0x04,0xb5,0xc0,0x0c,0x04,0xb7,0xc0,0x19,0x04,0x49,0xc0,0x14,0x84,0x4b,0xc0,0x05,
+0x81,0x2c,0xc0,0x11,0x01,0x1c,0xc0,0x21,0x81,0x1c,0xc0,0x21,0x01,0x23,0xc0,0x0a,
+0x4e,0x29,0xc0,0x0a,0x81,0x15,0x20,0x20,0x4d,0xdf,0x70,0x4b,0x7f,0x00,0x70,0x4b,
+0x7e,0x00,0x70,0x0a,0xff,0xb9,0x58,0x00,0x00,0x01,0x20,0x40,0x50,0xa5,0x58,0x00,
+0x00,0x00,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x67,0xb9,0x20,0x40,0x5b,0xf6,0x20,0x40,
+0x4d,0x75,0x20,0x20,0x50,0x28,0x70,0x4b,0xd6,0x00,0x20,0x40,0x4d,0x69,0x20,0x20,
+0x04,0x86,0x20,0x20,0x04,0x93,0x58,0x00,0x00,0x02,0x70,0x0a,0xff,0xb8,0x20,0x40,
+0x50,0xa5,0x6f,0xe4,0x00,0x32,0x1f,0xe3,0x7e,0x00,0xe7,0xe4,0x00,0x0a,0x20,0x20,
+0x67,0xb9,0x6f,0xe4,0x46,0x52,0x79,0x20,0x7e,0x02,0x67,0xe4,0x46,0x52,0x58,0x00,
+0x00,0x02,0x70,0x0a,0xff,0xb7,0x20,0x40,0x50,0xa5,0x68,0x44,0x42,0x20,0xe0,0x44,
+0x00,0x0a,0x20,0x20,0x67,0xb9,0x20,0x40,0x4d,0xd7,0x6f,0xe4,0x00,0x32,0x1f,0xe3,
+0x7e,0x00,0x68,0x44,0x41,0xe4,0x98,0x46,0x7c,0x00,0x20,0x20,0x4d,0x91,0x6f,0xe2,
+0x46,0x79,0xc3,0x82,0x80,0x00,0x6f,0xe4,0x4f,0xfc,0x68,0x44,0x4f,0xfe,0x98,0x46,
+0x7c,0x00,0x24,0x42,0xd0,0xda,0x20,0x20,0x4d,0x87,0x20,0x60,0x00,0x00,0x20,0x40,
+0x02,0xce,0x20,0x40,0x04,0xc3,0x20,0x40,0x04,0xcb,0x20,0x20,0x04,0xce,0x20,0x40,
+0x04,0x78,0x20,0x74,0x00,0x00,0x1a,0x22,0x7e,0x00,0x67,0xe4,0x46,0x71,0x1a,0x42,
+0x7e,0x00,0x67,0xe2,0x46,0x70,0x6f,0xe4,0x04,0x74,0x20,0x20,0x50,0xbb,0x20,0x20,
+0x4d,0xbd,0x20,0x20,0x01,0x48,0x6f,0xe2,0x4b,0xd5,0x20,0x7a,0x00,0x00,0x20,0x20,
+0x4d,0xc8,0x6f,0xe2,0x0a,0xff,0xc0,0x08,0x81,0xc7,0xc0,0x0a,0x81,0xcf,0xc0,0x13,
+0x81,0xdd,0xc0,0x06,0x01,0xd4,0xc0,0x58,0x01,0xdf,0xc0,0x59,0x01,0xef,0xc0,0x04,
+0x84,0x74,0xc0,0x50,0x81,0x62,0xc0,0x51,0x01,0x5c,0xc0,0x58,0x84,0xde,0xc0,0x50,
+0x01,0xc2,0xc0,0x3b,0x01,0x7d,0xc0,0x3b,0x81,0x83,0xc0,0x3c,0x01,0x88,0xc0,0x38,
+0x01,0x65,0x20,0x20,0x4e,0x5c,0xef,0xe2,0x00,0x03,0x67,0xe2,0x4b,0xd5,0x20,0x3a,
+0x50,0x1f,0xef,0xe4,0x00,0x03,0x67,0xe4,0x41,0xe4,0x20,0x20,0x50,0x1f,0xef,0xf0,
+0x00,0x03,0x67,0xf0,0x40,0x98,0x20,0x20,0x50,0x1f,0xef,0xe4,0x00,0x03,0xd8,0x40,
+0x00,0xa0,0x98,0x46,0xfc,0x00,0x20,0x40,0x7d,0x61,0x18,0x07,0xfe,0x00,0x67,0xe4,
+0x4b,0xd3,0xef,0xec,0x00,0x03,0x67,0xec,0x41,0xd1,0xef,0xe8,0x00,0x03,0x67,0xe8,
+0x4b,0xca,0xe8,0x48,0x00,0x03,0x5f,0xff,0xff,0xff,0x98,0x42,0xfe,0x00,0x67,0xe8,
+0x4b,0xc1,0xef,0xe8,0x00,0x03,0x67,0xe8,0x4b,0xc5,0xd8,0xa0,0x41,0xbf,0xdf,0x20,
+0x00,0x10,0x20,0x40,0x67,0xed,0x70,0x4b,0xb6,0x01,0x58,0x00,0x00,0x3c,0x67,0xe4,
+0x4b,0xb7,0x20,0x40,0x02,0xdb,0x20,0x20,0x50,0x1f,0xd8,0x40,0x00,0x0c,0x20,0x40,
+0x5b,0x4d,0x18,0xc0,0x8b,0xfe,0x58,0x00,0x00,0x00,0xe7,0xe4,0x00,0x05,0x20,0x20,
+0x50,0x1f,0x20,0x40,0x01,0x8c,0x20,0x40,0x01,0xa9,0x58,0x00,0x00,0x00,0xe7,0xe4,
+0x00,0x05,0x20,0x20,0x01,0xbb,0xef,0xe2,0x00,0x03,0x20,0x40,0x01,0x90,0x20,0x40,
+0x01,0x97,0x20,0x20,0x01,0xbb,0x20,0x40,0x01,0xad,0x58,0x28,0x00,0x02,0xe7,0xe6,
+0x00,0x05,0x20,0x60,0x00,0x00,0x67,0xe2,0x0a,0x96,0x20,0x40,0x01,0xad,0x59,0x28,
+0x03,0x02,0xe7,0xe8,0x00,0x05,0x6f,0xe2,0x0a,0x96,0xe7,0xe6,0x00,0x05,0x20,0x60,
+0x00,0x00,0x20,0x40,0x01,0xad,0x20,0x40,0x01,0xa9,0x20,0x40,0x01,0xa9,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,0x01,0xa4,0xc2,0x82,0x81,0xa4,0x18,0x40,
+0x84,0x01,0x20,0x60,0x00,0x00,0x20,0x40,0x01,0xad,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,0x01,0xb0,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,
+0x01,0xb2,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,0x6f,0xe4,
+0x4b,0xb4,0x1f,0xe2,0x72,0x00,0xd8,0xa0,0x46,0x83,0x20,0x40,0x67,0xed,0x20,0x20,
+0x50,0x1f,0x6f,0xe4,0x46,0x52,0xc3,0x00,0x50,0x1c,0x20,0x40,0x50,0x1f,0x20,0x40,
+0x4d,0x64,0x6f,0xe4,0x46,0x52,0xc4,0x01,0x00,0x00,0x70,0x0a,0xff,0xb6,0x20,0x20,
+0x50,0x4e,0x6f,0xe2,0x0b,0x00,0xc0,0x81,0xd0,0x1f,0xef,0xe6,0x00,0x03,0x67,0xe6,
+0x40,0xaa,0x20,0x20,0x50,0x1f,0x1a,0x22,0x06,0x00,0xef,0xe2,0x00,0x03,0xc0,0x00,
+0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,0x81,0xdb,0x20,0x20,
+0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,0x20,0x40,0x50,0x1f,0x20,0x20,
+0x4d,0x85,0x6f,0xe4,0x46,0x52,0xc2,0x81,0x01,0xe4,0x20,0x20,0x50,0x1c,0x70,0x0b,
+0x01,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x56,0x4b,0x24,0x3a,0x01,0xe2,0x6f,0xe2,
+0x0b,0x00,0x1f,0xe2,0x22,0x00,0x20,0x40,0x51,0x3d,0x6f,0xe4,0x42,0x20,0xe7,0xe4,
+0x00,0x05,0x6f,0xe2,0x0b,0x00,0x1f,0xe2,0x72,0x00,0x20,0x40,0x67,0xda,0x20,0x20,
+0x50,0x1f,0x6f,0xe4,0x46,0x52,0xc2,0x81,0x01,0xf2,0x20,0x20,0x50,0x1c,0x20,0x40,
+0x56,0x4b,0x24,0x3a,0x01,0xe2,0x6f,0xe2,0x0b,0x00,0x1f,0xe2,0x22,0x00,0x20,0x40,
+0x51,0x3d,0x6f,0xe4,0x42,0x1e,0xe7,0xe4,0x00,0x05,0x6f,0xe2,0x0b,0x00,0x1f,0xe2,
+0x72,0x00,0x20,0x40,0x67,0xda,0x20,0x20,0x50,0x1f,0x18,0x40,0xff,0xfd,0xd8,0x40,
+0x00,0xc8,0x20,0x40,0x7d,0xb5,0x68,0x42,0x46,0x7a,0x20,0x40,0x7d,0xb5,0x1f,0xe2,
+0x22,0x00,0x18,0x42,0x7e,0x00,0x9a,0x26,0x7e,0x00,0x67,0xe2,0x46,0x7a,0x68,0x44,
+0x46,0x7b,0x18,0x40,0x85,0xff,0x20,0x40,0x5b,0x4d,0x20,0x3a,0x02,0x11,0xe8,0x48,
+0x00,0x06,0x59,0x28,0x03,0x02,0x98,0x46,0x7c,0x00,0x24,0x22,0x82,0x11,0xef,0xe2,
+0x00,0x06,0xc2,0x82,0x4f,0x01,0x20,0x20,0x02,0x11,0x70,0x46,0x7a,0x00,0x70,0x0b,
+0x01,0x01,0x20,0x40,0x50,0xe0,0x20,0x20,0x50,0x1c,0x6f,0xe2,0x05,0x4e,0x67,0xe2,
+0x04,0xc5,0xc0,0x19,0x82,0x19,0x20,0x20,0x61,0x94,0x6f,0xe2,0x04,0xcd,0x79,0x20,
+0x7e,0x00,0x67,0xe2,0x04,0xcd,0x70,0x0a,0x95,0x01,0x20,0x40,0x7b,0xab,0x6f,0xe2,
+0x4b,0xd6,0x20,0x3a,0x61,0xbf,0x70,0x01,0x6b,0x03,0x70,0x00,0x55,0x06,0x70,0x41,
+0xbe,0x01,0x70,0x46,0x51,0x01,0x20,0x60,0x00,0x00,0x6f,0xe2,0x00,0x7d,0xc0,0x08,
+0x02,0x2c,0xc0,0x0b,0x82,0x32,0x20,0x20,0x60,0xfe,0x70,0x00,0x7d,0x2a,0x70,0x00,
+0x7c,0x03,0x20,0x60,0x00,0x00,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,
+0x02,0x30,0x20,0x20,0x62,0x06,0x70,0x00,0x7e,0x24,0x20,0x20,0x61,0x34,0x6f,0xe4,
+0x05,0x53,0x20,0x3a,0x62,0xd2,0x20,0x20,0x62,0xbc,0x6f,0xe2,0x05,0x4e,0x67,0xe2,
+0x04,0xc5,0xc0,0x05,0x82,0x39,0x20,0x20,0x61,0xa6,0x20,0x40,0x61,0xdf,0x6f,0xe2,
+0x00,0x55,0xc1,0x8c,0x80,0x00,0x70,0x0a,0xff,0xb1,0x58,0x00,0x00,0x01,0x20,0x40,
+0x50,0xa5,0x58,0x00,0x00,0x01,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x67,0xb9,0x6f,0xe2,
+0x00,0x49,0xc0,0x0b,0x82,0x45,0x20,0x20,0x64,0x33,0x70,0x0a,0x95,0x43,0x20,0x40,
+0x7b,0xab,0x20,0x20,0x46,0xc2,0x78,0x54,0x7c,0x00,0x20,0x40,0x66,0xa3,0x6f,0xe2,
+0x00,0x48,0x20,0x7a,0x00,0x00,0xc2,0x83,0x82,0x4f,0xc0,0x21,0x03,0x7f,0x20,0x20,
+0x63,0xf2,0xc0,0x42,0x02,0x52,0xc0,0x41,0x82,0x55,0x20,0x20,0x64,0x21,0x20,0x40,
+0x02,0x58,0x6f,0xe2,0x00,0x48,0x20,0x20,0x64,0x7b,0x20,0x40,0x02,0x58,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,0x44,0x90,0x20,0x3a,
+0x5e,0xd0,0x20,0x40,0x74,0x38,0x20,0x20,0x79,0x32,0x20,0x40,0x66,0x9e,0x24,0x3a,
+0x7b,0xfd,0x6f,0xe2,0x0a,0x95,0xc5,0x84,0xfb,0xf8,0xc0,0x02,0x82,0x6b,0x20,0x20,
+0x7b,0xec,0x6f,0xe2,0x4b,0xd5,0x20,0x3a,0x50,0xea,0x20,0x20,0x50,0xfd,0x6f,0xe2,
+0x46,0x6c,0x79,0x20,0x7e,0x07,0x67,0xe2,0x46,0x6c,0xda,0xc0,0x00,0x00,0xd8,0xc0,
+0x89,0x73,0xef,0xe2,0x00,0x06,0x79,0x20,0x7e,0x06,0xd8,0xa0,0x89,0x73,0xe7,0xe2,
+0x00,0x05,0xda,0xc0,0x00,0x0f,0xdf,0x20,0x00,0x06,0xda,0x40,0x00,0x02,0xda,0x20,
+0x4b,0x97,0x20,0x40,0x02,0x90,0xdf,0x20,0x00,0x14,0xda,0x40,0x01,0x2c,0xda,0x20,
+0x4b,0x9d,0x20,0x40,0x02,0x90,0xdf,0x20,0x00,0x02,0xda,0x40,0x1f,0xfe,0xda,0x20,
+0x4b,0xb1,0x20,0x40,0x02,0x90,0x20,0x40,0x02,0xac,0xda,0xc0,0x00,0x00,0xd8,0xc0,
+0x89,0x73,0xef,0xe2,0x00,0x06,0x79,0x3f,0xfe,0x06,0xd8,0xa0,0x89,0x73,0xe7,0xe2,
+0x00,0x05,0xda,0xc0,0x00,0x00,0x6f,0xe2,0x46,0x6c,0x79,0x3f,0xfe,0x07,0x67,0xe2,
+0x46,0x6c,0x20,0x60,0x00,0x00,0x1a,0x49,0xa4,0x00,0x20,0x40,0x02,0x9a,0x20,0x40,
+0x02,0xa7,0x20,0x40,0x02,0xa9,0x6f,0xe3,0x85,0x0c,0xe7,0xe2,0x00,0x11,0x1a,0x40,
+0xa4,0x08,0x1a,0x20,0xa2,0x01,0xc2,0x00,0x02,0x93,0x20,0x60,0x00,0x00,0x58,0x00,
+0x02,0x0c,0x20,0x40,0x02,0xa2,0x58,0x00,0x02,0x08,0x20,0x40,0x02,0xa2,0x58,0x00,
+0x02,0x00,0x20,0x40,0x02,0xa2,0x58,0x00,0x02,0x08,0x20,0x20,0x02,0xa2,0xd8,0xa1,
+0x85,0x0a,0xe7,0xe2,0x00,0x05,0x1f,0xec,0xfe,0x00,0xe7,0xe2,0x00,0x05,0x20,0x60,
+0x00,0x00,0x58,0x00,0x02,0x88,0x20,0x20,0x02,0xa2,0x1a,0x42,0x7e,0x00,0xd8,0xa1,
+0x85,0x08,0x20,0x20,0x02,0xa3,0x58,0x00,0x02,0x0c,0x20,0x20,0x02,0xa2,0xdf,0x20,
+0x00,0x0d,0xd8,0x40,0x55,0xaa,0xd8,0xc0,0x4b,0x97,0xef,0xe4,0x00,0x06,0x98,0x40,
+0xfe,0x00,0x1f,0xe2,0x04,0x00,0xc2,0x00,0x02,0xb1,0x20,0x60,0x00,0x00,0xdf,0x20,
+0x00,0x0d,0xd8,0xc0,0x4b,0x97,0xef,0xe4,0x00,0x06,0x98,0x42,0xfe,0x00,0x1f,0xe2,
+0x04,0x00,0xc2,0x00,0x02,0xb8,0x20,0x60,0x00,0x00,0x70,0x4b,0xb3,0x00,0xd8,0x40,
+0xff,0xff,0x98,0x41,0x7e,0x00,0xd8,0xc0,0x4b,0xb1,0xe8,0x44,0x00,0x06,0x98,0x46,
+0x7c,0x00,0x24,0x62,0x80,0x00,0x70,0x4b,0xb3,0x01,0x20,0x60,0x00,0x00,0x20,0x40,
+0x02,0x6e,0x20,0x40,0x02,0xae,0x20,0x40,0x02,0xb6,0x20,0x40,0x02,0xbd,0x6f,0xe2,
+0x4b,0xb3,0x2f,0xe1,0xfe,0x01,0x20,0x60,0x80,0x00,0x20,0x20,0x4a,0x8b,0x6f,0xe2,
+0x4b,0xb6,0x20,0x7a,0x00,0x00,0xda,0x60,0x4b,0xd3,0xda,0x40,0x02,0xd3,0x20,0x20,
+0x4d,0x0b,0x70,0x0a,0xff,0xba,0x20,0x20,0x50,0x4e,0x6f,0xe2,0x4b,0xb6,0x20,0x7a,
+0x00,0x00,0x20,0x20,0x02,0xde,0x70,0x4b,0xb6,0x01,0x58,0x00,0x00,0x3c,0x67,0xe4,
+0x4b,0xb7,0x58,0x00,0x00,0xa0,0x18,0x00,0x0e,0x0e,0x20,0x20,0x7c,0xe3,0x18,0x00,
+0x0e,0x0e,0x20,0x40,0x7c,0xf1,0x24,0x7a,0x00,0x00,0x20,0x40,0x48,0xd8,0x20,0x40,
+0x02,0xf6,0x20,0x40,0x02,0xdb,0x68,0x44,0x4b,0xb7,0x78,0x48,0x7c,0x00,0x18,0x42,
+0x36,0x00,0x20,0x21,0x83,0x21,0x20,0x40,0x49,0x15,0xd8,0x40,0x00,0x00,0x20,0x40,
+0x49,0x30,0x20,0x40,0x4a,0x50,0x20,0x40,0x03,0x0d,0x20,0x40,0x46,0x49,0x20,0x00,
+0x13,0x88,0x20,0x20,0x02,0xe7,0x6f,0xf2,0x4b,0xc1,0x1f,0xef,0x7e,0x00,0x1f,0xeb,
+0x7e,0x00,0x67,0xe6,0x07,0x42,0x6d,0x86,0x07,0x42,0x20,0x60,0x00,0x00,0x20,0x40,
+0x02,0xf0,0x6f,0xf2,0x4b,0xc1,0x68,0x50,0x4b,0xb9,0x98,0x42,0xfe,0x00,0x67,0xf0,
+0x07,0x42,0x6f,0xea,0x07,0x42,0x78,0x3b,0x7c,0x00,0x98,0x00,0x12,0x00,0x78,0x5b,
+0x7c,0x00,0x20,0x60,0x00,0x00,0x20,0x40,0x4a,0x63,0x78,0x43,0xfc,0x00,0x78,0x25,
+0x7c,0x00,0x78,0x2d,0xfc,0x00,0x6f,0xe4,0x0b,0x37,0x08,0x00,0x86,0x0a,0x78,0x24,
+0x7c,0x00,0x08,0x00,0x86,0x08,0x78,0x4d,0xfc,0x00,0x78,0x44,0x7c,0x00,0x78,0x45,
+0x7c,0x00,0x79,0x3f,0xaa,0x02,0x20,0x60,0x00,0x00,0x58,0x00,0x00,0x78,0x67,0xe4,
+0x0b,0x37,0x20,0x40,0x03,0x00,0x78,0x2e,0xfc,0x00,0x78,0x47,0x7c,0x00,0x78,0x24,
+0xfc,0x00,0x58,0x00,0x0a,0x98,0x08,0x00,0x86,0x10,0xdf,0x20,0x00,0x50,0x6f,0xe8,
+0x4b,0xca,0x08,0x00,0x86,0x20,0xc2,0x00,0x03,0x16,0xdf,0x20,0x00,0x13,0x58,0x00,
+0x00,0x00,0x08,0x00,0x86,0x08,0xc2,0x00,0x03,0x1a,0x78,0x24,0x7c,0x00,0x08,0x00,
+0x86,0x10,0x78,0x44,0x7c,0x00,0x20,0x60,0x00,0x00,0x68,0x44,0x4b,0xb7,0x78,0x48,
+0x7c,0x00,0x18,0x42,0x36,0x00,0x78,0x58,0x7c,0x00,0x78,0x57,0x7c,0x00,0xd8,0x40,
+0x00,0x00,0x20,0x40,0x49,0x1c,0x20,0x40,0x49,0xea,0x20,0x40,0x4a,0x13,0x24,0x2c,
+0x46,0x49,0x78,0x43,0xfc,0x00,0x78,0x25,0x7c,0x00,0x78,0x25,0xfc,0x00,0x09,0x80,
+0x00,0x0a,0x19,0x83,0x7e,0x00,0x67,0xe4,0x0b,0x39,0x09,0x80,0x00,0x08,0x78,0x45,
+0xfc,0x00,0x78,0x45,0x7c,0x00,0x20,0x23,0x46,0x49,0xdf,0x20,0x00,0x12,0xd8,0xa0,
+0x0b,0x1e,0x78,0x26,0x7c,0x00,0x78,0x24,0xfc,0x00,0x09,0x80,0x00,0x08,0x19,0x89,
+0x7e,0x00,0xe7,0xe2,0x00,0x05,0xc2,0x00,0x03,0x39,0x09,0x80,0x00,0x10,0x20,0x40,
+0x46,0x49,0x20,0x63,0x00,0x00,0x6f,0xec,0x0b,0x20,0x68,0x4c,0x41,0xd1,0x98,0x46,
+0x7c,0x00,0x24,0x62,0x80,0x00,0x6f,0xe8,0x0b,0x2c,0x1f,0xe3,0x7e,0x00,0x67,0xe8,
+0x01,0x63,0x6f,0xe2,0x0b,0x1f,0x67,0xe2,0x01,0x72,0x58,0x00,0x00,0x67,0x67,0xe2,
+0x0b,0x1e,0x6f,0xec,0x40,0xa0,0x67,0xec,0x0b,0x1f,0x58,0x00,0x00,0x00,0x67,0xf2,
+0x0b,0x25,0x20,0x40,0x4a,0x4c,0x20,0x40,0x49,0x15,0xd8,0x40,0x00,0x00,0x20,0x40,
+0x49,0x30,0x20,0x40,0x4a,0x50,0x20,0x40,0x4a,0x5e,0x6f,0xe4,0x0b,0x39,0x67,0xe4,
+0x0b,0x37,0x20,0x40,0x03,0x00,0x78,0x2e,0x7c,0x00,0x78,0x47,0x7c,0x00,0x78,0x24,
+0xfc,0x00,0xdf,0x20,0x00,0x0d,0xd8,0xc0,0x0b,0x1e,0xef,0xe2,0x00,0x06,0x08,0x00,
+0x86,0x08,0xc2,0x00,0x03,0x5d,0x78,0x24,0x7c,0x00,0x08,0x00,0x86,0x10,0x78,0x44,
+0x7c,0x00,0x20,0x40,0x46,0x49,0x70,0x4b,0xb6,0x00,0x58,0x00,0x00,0x00,0x67,0xe4,
+0x02,0xce,0x2d,0x00,0x06,0x03,0x20,0x20,0x83,0x6b,0x37,0xcb,0x82,0x00,0x20,0x20,
+0x03,0x67,0x6f,0xe8,0x01,0x63,0x1f,0xe1,0xfe,0x03,0x1f,0xe2,0x50,0x00,0x6f,0xec,
+0x41,0xd1,0x67,0xec,0x00,0x40,0x20,0x40,0x44,0x31,0x20,0x40,0x44,0x78,0x20,0x36,
+0x83,0x77,0x20,0x40,0x44,0x51,0x24,0x3a,0x03,0x71,0x70,0x0a,0xff,0xbb,0x20,0x20,
+0x50,0x4e,0x70,0x4b,0xd6,0x01,0x6f,0xe2,0x05,0x4d,0x20,0x40,0x03,0x7b,0x20,0x20,
+0x43,0xc4,0x6f,0xe6,0x05,0x4e,0x67,0xe6,0x4b,0xce,0x70,0x00,0x7c,0x42,0x20,0x60,
+0x00,0x00,0x58,0x00,0x00,0x00,0x67,0xe2,0x00,0x48,0x6f,0xe2,0x4b,0xce,0xc0,0x00,
+0x03,0x85,0xc0,0x02,0x03,0x8b,0x20,0x60,0x00,0x00,0x18,0x00,0x7e,0x0a,0x20,0x40,
+0x66,0x7a,0x58,0x1d,0x32,0x01,0xe7,0xf2,0x00,0x05,0x58,0x00,0x00,0x00,0x20,0x20,
+0x66,0x99,0x18,0x00,0x7e,0x04,0x20,0x40,0x66,0x7a,0x58,0x00,0x00,0x04,0xe7,0xe6,
+0x00,0x05,0x58,0x00,0x00,0x01,0x20,0x20,0x66,0x99,0x20,0x40,0x4c,0x24,0x20,0x40,
+0x6b,0x69,0x20,0x40,0x45,0x10,0x24,0x36,0xc3,0xde,0x20,0x40,0x4a,0x87,0x20,0x40,
+0x6b,0x81,0x20,0x40,0x44,0x85,0x20,0x40,0x47,0x53,0x20,0x40,0x47,0x24,0x20,0x40,
+0x60,0xe9,0x6f,0xe2,0x00,0x0b,0x1f,0xe0,0xfe,0x01,0x67,0xe2,0x00,0x0b,0x20,0x40,
+0x48,0x3d,0x20,0x20,0x43,0xde,0x18,0x42,0x7e,0x00,0x20,0x40,0x7d,0x2b,0x1c,0x30,
+0x7e,0x00,0x79,0x20,0x7e,0x2c,0x20,0x40,0x7d,0x14,0x79,0x3f,0xfe,0x2c,0x20,0x40,
+0x4a,0x76,0x20,0x40,0x7d,0x14,0x20,0x74,0x00,0x00,0x20,0x40,0x03,0xb7,0x20,0x20,
+0x4a,0x2f,0x1b,0x42,0x7e,0x00,0x20,0x40,0x03,0xb6,0x20,0x20,0x4a,0xe9,0x6f,0xe4,
+0x40,0x4e,0x1f,0xe3,0x7e,0x00,0x20,0x40,0x7d,0x2b,0x1e,0x02,0x7e,0x00,0x20,0x40,
+0x7d,0x14,0x1b,0x42,0x04,0x00,0x20,0x40,0x03,0xb6,0x20,0x20,0x4b,0x67,0x20,0x40,
+0x7d,0x14,0x98,0x00,0x0c,0x00,0x79,0x3f,0x8c,0x10,0x20,0x20,0x7d,0x1f,0x20,0x40,
+0x68,0xc4,0x20,0x40,0x60,0xd7,0x20,0x40,0x03,0xbe,0x20,0x20,0x40,0x0a,0x20,0x75,
+0x80,0x00,0x20,0x20,0x7b,0x9a,0x20,0x20,0x40,0x10,0x20,0x30,0x83,0xd1,0x70,0x89,
+0x55,0xd4,0x20,0x00,0x00,0x04,0x70,0x89,0x55,0xd2,0x20,0x00,0x00,0x04,0x70,0x89,
+0x55,0xd1,0x20,0x00,0x00,0x04,0x6f,0xe2,0x41,0xdf,0xc0,0x00,0x03,0xcf,0xc0,0x00,
+0x83,0xdf,0xc0,0x01,0x03,0xcf,0xc0,0x01,0x83,0xdf,0xc0,0x02,0x03,0xdf,0xc0,0x10,
+0x03,0xdf,0x70,0x89,0x55,0xd0,0x70,0x89,0x56,0xe0,0x18,0x00,0x2a,0x08,0x18,0x00,
+0x2a,0x00,0x78,0x50,0xfc,0x00,0x78,0x50,0x7c,0x00,0x78,0x2f,0x7c,0x00,0x70,0x89,
+0x02,0x00,0x70,0x89,0x01,0x00,0x70,0x89,0x00,0x00,0x70,0x89,0x03,0x00,0x70,0x89,
+0x04,0x70,0x6f,0xe2,0x89,0x06,0x79,0x20,0x7e,0x00,0x67,0xe2,0x89,0x06,0x20,0x60,
+0x00,0x00,0x70,0x89,0x55,0xd0,0x70,0x89,0x56,0xc0,0x20,0x20,0x03,0xd1,0x20,0x40,
+0x57,0xaf,0x20,0x40,0x03,0xe5,0x20,0x20,0x58,0xa7,0x20,0x36,0x83,0xec,0x20,0x20,
+0x57,0xbe,0x60,0x42,0x00,0x17,0x20,0x40,0x49,0x2a,0x20,0x40,0x49,0x80,0x58,0x00,
+0x05,0x00,0x20,0x40,0x4a,0x8e,0x6f,0xe2,0x89,0x06,0x79,0x20,0x7e,0x00,0x67,0xe2,
+0x89,0x06,0x20,0x20,0x49,0x37,0x70,0x89,0x06,0x7c,0x20,0x75,0x80,0x00,0x58,0x00,
+0x00,0x00,0x67,0xe4,0x41,0xdd,0x1c,0x43,0x7e,0x00,0x67,0xe8,0x40,0x94,0x20,0x60,
+0x00,0x00,0x20,0x20,0x4b,0x7f,0x58,0x00,0x00,0x25,0x67,0xe4,0x44,0xcc,0x20,0x40,
+0x5b,0xf0,0x20,0x40,0x5c,0x0c,0x20,0x40,0x5c,0x19,0x20,0x20,0x5b,0xf8,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,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,0xe2,0x72,0x00,0x20,0x3a,0x58,0x8b,0x20,0x20,
+0x58,0x87,0xc6,0x07,0x80,0x00,0x20,0x40,0x5c,0x70,0x24,0x7a,0x00,0x00,0x6f,0xe2,
+0x02,0xd5,0x1f,0xe1,0x7e,0x03,0x67,0xe2,0x44,0xde,0xef,0xe2,0x00,0x06,0x67,0xe2,
+0x44,0xdd,0x20,0x7a,0x00,0x00,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x44,0xdf,0x6f,0xe2,
+0x44,0xde,0xc0,0x01,0xe0,0x44,0x20,0x40,0x5a,0x76,0xd8,0xe0,0x00,0x03,0x24,0x34,
+0x4b,0xec,0x20,0x40,0x4b,0xf0,0x20,0x20,0x5a,0x6b,0xef,0xe4,0x00,0x06,0xc0,0x02,
+0x04,0x56,0xc0,0x03,0x5e,0xd4,0xc0,0x02,0xde,0x96,0x20,0x60,0x00,0x00,0x18,0x0a,
+0x7e,0x00,0xd8,0x40,0x00,0x0f,0x98,0x41,0x7e,0x00,0x1f,0xe0,0xfe,0x19,0x20,0x40,
+0x5a,0xef,0x6f,0xe2,0x0a,0xbe,0x68,0x42,0x44,0x5f,0x98,0x46,0x7c,0x00,0x24,0x22,
+0xda,0xce,0xd8,0xe0,0x00,0x00,0x6f,0xe4,0x44,0x54,0x20,0x20,0x7c,0xe3,0x20,0x40,
+0x5a,0xc9,0x20,0x40,0x59,0x9a,0x6f,0xe2,0x02,0xd5,0x2f,0xef,0xfe,0x04,0x79,0x20,
+0x80,0x2a,0x1f,0xe3,0x7e,0x00,0x98,0x42,0xfe,0x00,0x2f,0xef,0xfe,0x02,0x79,0x20,
+0x80,0x0f,0xc6,0x07,0x80,0x00,0x6f,0xe2,0x02,0xd6,0x20,0x3a,0x59,0x96,0x6f,0xe2,
+0x04,0x3b,0xc3,0x02,0x59,0x96,0x20,0x40,0x73,0x42,0x20,0x40,0x72,0xb2,0x7d,0x3a,
+0x00,0x0f,0x24,0x7a,0x00,0x00,0x20,0x20,0x59,0x96,0x70,0x0a,0xff,0xb3,0x20,0x20,
+0x50,0x4e,0x70,0x0a,0xff,0xb4,0x58,0x00,0x00,0x1c,0x20,0x40,0x50,0xa5,0x6f,0xec,
+0x44,0x72,0xe7,0xec,0x00,0x0a,0x6f,0xec,0x04,0x4b,0xe7,0xec,0x00,0x0a,0xd8,0xc0,
+0x43,0xeb,0xdf,0x20,0x00,0x10,0x20,0x40,0x67,0xd4,0x20,0x20,0x67,0xb9,0xef,0xe6,
+0x00,0x06,0x67,0xe6,0x04,0x73,0xc0,0x09,0x04,0x5b,0xc0,0x05,0x04,0x69,0x20,0x20,
+0x5c,0x8d,0x18,0xc2,0x22,0x00,0x6f,0xe4,0x44,0xce,0x1f,0xe0,0xa5,0xfd,0x20,0x40,
+0x5a,0xbe,0x6f,0xe2,0x44,0xbb,0xc3,0x02,0x5e,0x1d,0x68,0x44,0x04,0x74,0x6f,0xe4,
+0x44,0xcc,0x98,0x46,0x7c,0x00,0x24,0x22,0xde,0x1d,0x20,0x40,0x04,0x7b,0x24,0x34,
+0x5e,0x1d,0x70,0x04,0x76,0x05,0x20,0x20,0x5e,0x57,0x68,0x44,0x04,0x74,0x6f,0xe2,
+0x44,0xbb,0xc2,0x81,0x84,0x6d,0x20,0x20,0x5d,0x9f,0x6f,0xe4,0x44,0xcc,0x98,0x46,
+0x7c,0x00,0x24,0x22,0xdd,0x9f,0x20,0x40,0x04,0x7b,0x24,0x34,0x5d,0x9f,0x70,0x04,
+0x76,0x05,0x20,0x20,0x5e,0x57,0x6f,0xe4,0x46,0x52,0xc3,0x04,0xd0,0x1c,0x20,0x40,
+0x04,0x78,0x20,0x20,0x4e,0xda,0x6f,0xe2,0x46,0x79,0xc2,0x81,0x04,0x7b,0x20,0x20,
+0x7d,0xc1,0x20,0x40,0x7d,0xc1,0x6f,0xe2,0x44,0x98,0xc1,0x00,0x00,0x00,0x6f,0xe2,
+0x04,0x3b,0xc3,0x82,0x00,0x00,0x20,0x20,0x7d,0xbf,0x70,0x4b,0x7f,0x00,0x70,0x4b,
+0x7e,0x00,0x20,0x20,0x4d,0x6b,0x70,0x4b,0xd6,0x00,0x20,0x40,0x4e,0x2f,0x20,0x40,
+0x04,0x8c,0x6f,0xe4,0x46,0x52,0x79,0x3f,0xfe,0x0c,0x67,0xe4,0x46,0x52,0x70,0x0a,
+0xff,0xb6,0x20,0x20,0x50,0x4e,0x70,0x41,0xe3,0x00,0x70,0x46,0x50,0x00,0x70,0x42,
+0x04,0x00,0x70,0x4b,0x7e,0x00,0x70,0x4b,0x7f,0x00,0x20,0x60,0x00,0x00,0x20,0x40,
+0x4e,0x2f,0x70,0x0a,0xff,0xb1,0x58,0x00,0x00,0x01,0x20,0x40,0x50,0xa5,0x58,0x00,
+0x00,0x00,0xe7,0xe2,0x00,0x0a,0x20,0x40,0x67,0xb9,0x20,0x20,0x4d,0x34,0x20,0x60,
+0x00,0x00,0x58,0x00,0x00,0x02,0x67,0xe2,0x46,0x50,0x20,0x60,0x00,0x00,0x6f,0xe4,
+0x46,0x52,0x79,0x3f,0xfe,0x0c,0x67,0xe4,0x46,0x52,0x70,0x0a,0xff,0xb6,0x20,0x40,
+0x50,0x4e,0x70,0x4b,0x7e,0x00,0x58,0x00,0x00,0x01,0x67,0xe2,0x4b,0x7f,0x20,0x60,
+0x00,0x00,0x6f,0xe2,0x41,0xe3,0xc1,0x00,0x80,0x00,0x6f,0xe4,0x46,0x52,0x79,0x20,
+0x7e,0x0c,0x67,0xe4,0x46,0x52,0x70,0x0a,0xff,0xb0,0x20,0x40,0x50,0x4e,0x70,0x41,
+0xe3,0x01,0x20,0x40,0x4d,0x6b,0x20,0x20,0x4d,0x89,0x20,0x20,0x04,0x92,0x58,0x00,
+0x00,0x05,0x67,0xe2,0x4b,0x7e,0x20,0x60,0x00,0x00,0x20,0x20,0x4d,0x48,0x20,0x60,
+0x00,0x00,0x20,0x20,0x04,0xb8,0x70,0x0a,0xff,0xb5,0x58,0x00,0x00,0x1c,0x20,0x40,
+0x50,0xa5,0x6f,0xec,0x40,0xa0,0xe7,0xec,0x00,0x0a,0x6f,0xec,0x00,0x40,0xe7,0xec,
+0x00,0x0a,0xd8,0xc0,0x41,0xbf,0xdf,0x20,0x00,0x10,0x20,0x40,0x67,0xd4,0x20,0x20,
+0x67,0xb9,0xda,0x60,0x4b,0x7e,0xda,0x40,0x04,0xc6,0x20,0x20,0x4d,0x04,0x6f,0xe2,
+0x02,0x7b,0x79,0x20,0x7e,0x00,0x79,0x20,0x7e,0x07,0x67,0xe2,0x02,0x7b,0x20,0x60,
+0x00,0x00,0xda,0x60,0x46,0x50,0xda,0x40,0x04,0xa7,0x20,0x20,0x4d,0x04,0xda,0x60,
+0x4b,0x7f,0xda,0x40,0x4d,0x64,0x20,0x20,0x4d,0x04,0x20,0x40,0x56,0x4b,0x24,0x7a,
+0x00,0x00,0x6f,0xe2,0x0b,0x00,0x1f,0xe0,0xa2,0x01,0x20,0x40,0x51,0x3d,0x6f,0xe4,
+0x42,0x20,0xe7,0xe4,0x00,0x05,0x58,0x00,0x00,0xa1,0xe7,0xe2,0x00,0x05,0x6f,0xe2,
+0x0b,0x00,0x1f,0xe2,0x72,0x00,0x20,0x40,0x67,0xed,0x20,0x20,0x50,0x1f,0xef,0xec,
+0x00,0x03,0x67,0xec,0x41,0xd1,0xef,0xe4,0x00,0x03,0x67,0xe4,0x40,0xb9,0xd8,0xa0,
+0x41,0xbf,0xdf,0x20,0x00,0x10,0x20,0x40,0x67,0xed,0x20,0x40,0x68,0xbe,0x20,0x40,
+0x4d,0x6b,0x20,0x40,0x4d,0x5c,0x20,0x20,0x50,0x1f,0x6f,0xe4,0x02,0x60,0x1f,0xe2,
+0x0c,0x00,0xef,0xe2,0x00,0x06,0x1f,0xe1,0x04,0x0f,0x1f,0xf1,0xfe,0x00,0xc0,0x04,
+0xd1,0x2d,0xc0,0x03,0xd1,0x2d,0xc0,0x05,0x04,0xf5,0xc0,0x02,0x85,0x09,0xc0,0x00,
+0x85,0x0b,0xc0,0x02,0x51,0x2d,0x20,0x60,0x00,0x00,0x20,0x20,0x04,0xfa,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x0a,0x96,0xc0,0x00,0x85,0x03,0x20,0x60,0x00,0x00,0x70,0x0a,
+0xff,0xb2,0x6f,0xe4,0x02,0x62,0x1f,0xe0,0xff,0xff,0x1f,0xe2,0x72,0x00,0x20,0x40,
+0x50,0xa5,0x6f,0xe4,0x02,0x60,0x1f,0xe2,0x0c,0x00,0x20,0x40,0x67,0xc1,0x20,0x20,
+0x67,0xb9,0x70,0x0a,0xff,0xb2,0x58,0x00,0x00,0x02,0x20,0x40,0x50,0xa5,0x6f,0xe4,
+0x0a,0x96,0xe7,0xe4,0x00,0x0a,0x20,0x20,0x67,0xb9,0x20,0x40,0x04,0xf5,0x20,0x20,
+0x51,0x26,0x18,0x42,0x7e,0x00,0xc0,0x02,0xd1,0x1e,0x70,0x4b,0x80,0x01,0xc0,0x01,
+0xd1,0x2d,0x70,0x4b,0x80,0x00,0xc0,0x02,0x51,0x2d,0x20,0x60,0x00,0x00,0x45,0xe7,
+0xaa,0x55,0x40,0x00,0x00,0x40,0x22,0x00,0x00,0x00,0x00,0x40,0x10,0x20,0x00,0x00,
+0x00,0xe0,0x01,0x00,0x01,0x00,0x20,0x02,0x10,0x00,0x0c,0x12,0x00,0x59,0x00,0x01,
+0x00,0x08,0x00,0x00,0x00,0x00,0x68,0x00,0x08,0x80,0x22,0x00,0x01,0xf4,0x02,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x08,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x6e,0x46,0x05,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,0x02,0x00,0xcc,0x44,0x31,0x00,
+0xaa,0x55,0x01,0x00,0x78,0x44,0x17,0xaa,0x55,0x01,0x00,0x7a,0x44,0x17,0xaa,0x55,
+0x01,0x00,0x90,0x44,0x00,0xaa,0x55,0x01,0x00,0x5f,0x44,0x07,0xaa,0x55,0x01,0x00,
+0x98,0x44,0x00,0xaa,0x55,0x01,0x00,0x40,0x43,0x00,0xaa,0x55,0x02,0x00,0x54,0x44,
+0x40,0x00,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x2a,0x01,0x33,0x02,0x3a,0xaa,0x55,
+0x0f,0x00,0x81,0x43,0x0e,0x42,0x54,0x34,0x2e,0x32,0x20,0x4b,0x65,0x79,0x62,0x6f,
+0x61,0x72,0x64,0xaa,0x55,0x1c,0x00,0x41,0x43,0x03,0x02,0x01,0x05,0x03,0x19,0xc1,
+0x03,0x03,0x03,0x12,0x18,0x0f,0x09,0x42,0x54,0x34,0x2e,0x32,0x20,0x4b,0x65,0x79,
+0x62,0x6f,0x61,0x72,0x64,0xaa,0x55,0x11,0x00,0x61,0x43,0x1f,0x0f,0x09,0x42,0x54,
+0x34,0x2e,0x32,0x20,0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0xaa,0x55,0x02,0x00,
+0x8e,0x44,0x75,0x49,0xaa,0x55,0xca,0x00,0x75,0x49,0x01,0x00,0x02,0x00,0x28,0x02,
+0x01,0x18,0x02,0x00,0x02,0x03,0x28,0x01,0x20,0x03,0x00,0x02,0x05,0x2a,0x01,0x00,
+0x04,0x00,0x02,0x02,0x29,0x02,0x00,0x00,0x05,0x00,0x02,0x00,0x28,0x02,0x00,0x18,
+0x06,0x00,0x02,0x03,0x28,0x01,0x02,0x07,0x00,0x02,0x00,0x2a,0x1d,0x42,0x54,0x34,
+0x2e,0x32,0x20,0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x08,0x00,0x02,0x03,0x28,0x01,
+0x02,0x09,0x00,0x02,0x01,0x2a,0x02,0xc1,0x03,0x0a,0x00,0x02,0x03,0x28,0x01,0x02,
+0x0b,0x00,0x02,0x04,0x2a,0x08,0x06,0x00,0x06,0x00,0x64,0x00,0x2c,0x01,0x0c,0x00,
+0x02,0x00,0x28,0x02,0x0a,0x18,0x0d,0x00,0x02,0x03,0x28,0x01,0x02,0x0e,0x00,0x02,
+0x29,0x2a,0x06,0x59,0x69,0x43,0x68,0x69,0x70,0x0f,0x00,0x02,0x00,0x28,0x10,0x02,
+0xfb,0x34,0x9b,0x5f,0x80,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0x10,0xff,0x00,0x10,
+0x00,0x02,0x03,0x28,0x01,0x14,0x11,0x00,0x10,0xfb,0x34,0x9b,0x5f,0x80,0x00,0x00,
+0x80,0x00,0x10,0x00,0x00,0x13,0xff,0x00,0x01,0x00,0x12,0x00,0x02,0x02,0x29,0x02,
+0x00,0x00,0x00,0x00,0xaa,0x55,0x01,0x00,0x06,0x42,0x17,0xaa,0x55,0x01,0x00,0x93,
+0x40,0x00,0xaa,0x55,0x01,0x00,0x6d,0x46,0x28,0xaa,0x55,0x03,0x00,0x2d,0x46,0x02,
+0x00,0x04,0xaa,0x55,0x01,0x00,0x2c,0x46,0x01,0xaa,0x55,0x01,0x00,0x34,0x46,0x02,
+0xaa,0x55,0x01,0x00,0x54,0x46,0x01,0xaa,0x55,0x06,0x00,0xa0,0x40,0x1c,0x6a,0xa4,
+0xd8,0x17,0xe4,0xaa,0x55,0x0f,0x00,0xe7,0x44,0x0e,0x42,0x54,0x33,0x2e,0x30,0x20,
+0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0xaa,0x55,0x03,0x00,0xe4,0x41,0x0e,0x00,
+0x01,0xaa,0x55,0x01,0x00,0xe8,0x41,0x01,0xaa,0x55,0x01,0x00,0x2c,0x45,0x0a,0xaa,
+0x55,0x03,0x00,0xaa,0x40,0x40,0x25,0x00,0xaa,0x55,0x01,0x00,0x92,0x40,0x43,0xaa,
+0x55,0x01,0x00,0x5b,0x41,0x00,0xaa,0x55,0x08,0x00,0x98,0x40,0xff,0xff,0x8f,0xf8,
+0x83,0x9d,0x59,0x82,0xaa,0x55,0x01,0x00,0xd1,0x40,0x01,0xaa,0x55,0x0e,0x00,0x49,
+0x45,0x06,0x03,0x11,0x00,0x00,0x01,0x02,0x10,0x24,0x11,0x00,0x12,0x01,0x00,0xaa,
+0x55,0x01,0x00,0x5f,0x45,0x00,0xaa,0x55,0x02,0x00,0x47,0x45,0x83,0x46,0xaa,0x55,
+0x5a,0x02,0x83,0x46,0x04,0x00,0x11,0x01,0x00,0x10,0x02,0x11,0x24,0x00,0x01,0x00,
+0x00,0x36,0x01,0x9a,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x00,0x09,0x00,0x01,0x35,
+0x03,0x19,0x11,0x24,0x09,0x00,0x04,0x35,0x0d,0x35,0x06,0x19,0x01,0x00,0x09,0x00,
+0x11,0x35,0x03,0x19,0x00,0x11,0x09,0x00,0x05,0x35,0x03,0x19,0x10,0x02,0x09,0x00,
+0x06,0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,0x00,0x09,0x35,
+0x08,0x35,0x06,0x19,0x11,0x24,0x09,0x01,0x00,0x09,0x00,0x0d,0x35,0x0f,0x35,0x0d,
+0x35,0x06,0x19,0x01,0x00,0x09,0x00,0x13,0x35,0x03,0x19,0x00,0x11,0x09,0x01,0x00,
+0x25,0x3d,0x42,0x72,0x6f,0x61,0x64,0x63,0x6f,0x6d,0x20,0x42,0x6c,0x75,0x65,0x74,
+0x6f,0x6f,0x74,0x68,0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x20,0x4b,
+0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
+0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x09,
+0x01,0x01,0x25,0x08,0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x09,0x01,0x02,0x25,
+0x10,0x42,0x72,0x6f,0x61,0x64,0x63,0x6f,0x6d,0x20,0x43,0x6f,0x72,0x70,0x2e,0x20,
+0x20,0x09,0x02,0x00,0x09,0x01,0x00,0x09,0x02,0x01,0x09,0x01,0x11,0x09,0x02,0x02,
+0x08,0x40,0x09,0x02,0x03,0x08,0x21,0x09,0x02,0x04,0x28,0x01,0x09,0x02,0x05,0x28,
+0x01,0x09,0x02,0x06,0x35,0x89,0x35,0x87,0x08,0x22,0x25,0x83,0x05,0x01,0x09,0x06,
+0xa1,0x01,0x85,0x01,0x75,0x01,0x95,0x08,0x05,0x07,0x19,0xe0,0x29,0xe7,0x15,0x00,
+0x25,0x01,0x81,0x02,0x95,0x01,0x75,0x08,0x81,0x03,0x95,0x05,0x75,0x01,0x05,0x08,
+0x19,0x01,0x29,0x05,0x91,0x02,0x95,0x01,0x75,0x03,0x91,0x03,0x95,0x06,0x75,0x08,
+0x15,0x00,0x25,0xff,0x05,0x07,0x19,0x00,0x29,0xff,0x81,0x00,0xc0,0x05,0x0c,0x09,
+0x01,0xa1,0x01,0x85,0x02,0x19,0x00,0x2a,0xff,0x03,0x15,0x00,0x26,0xff,0x03,0x95,
+0x01,0x75,0x10,0x81,0x00,0xc0,0x05,0x01,0x09,0x06,0xa1,0x01,0x85,0x07,0x05,0x07,
+0x19,0xe0,0x29,0xe7,0x15,0x00,0x25,0x01,0x75,0x01,0x95,0x08,0x81,0x00,0x95,0xa8,
+0x75,0x01,0x15,0x00,0x25,0x01,0x05,0x07,0x19,0x00,0x29,0xa8,0x81,0x02,0xc0,0x09,
+0x02,0x07,0x35,0x08,0x35,0x06,0x09,0x04,0x09,0x09,0x01,0x00,0x09,0x02,0x0b,0x09,
+0x01,0x00,0x09,0x02,0x0c,0x09,0x0c,0x80,0x09,0x02,0x0d,0x28,0x00,0x09,0x02,0x0e,
+0x28,0x01,0x09,0x02,0x0f,0x09,0x03,0x18,0x09,0x02,0x10,0x09,0x00,0x00,0x03,0x10,
+0x02,0x12,0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x36,0x00,0xa1,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,
+0x06,0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,0x00,0x09,0x35,
+0x08,0x35,0x06,0x19,0x12,0x00,0x09,0x01,0x00,0x09,0x01,0x00,0x25,0x2f,0x42,0x72,
+0x6f,0x61,0x64,0x63,0x6f,0x6d,0x20,0x42,0x6c,0x75,0x65,0x74,0x6f,0x6f,0x74,0x68,
+0x20,0x57,0x69,0x72,0x65,0x6c,0x65,0x73,0x73,0x20,0x4b,0x65,0x79,0x62,0x6f,0x61,
+0x72,0x64,0x20,0x50,0x6e,0x50,0x20,0x53,0x65,0x72,0x76,0x65,0x72,0x09,0x01,0x01,
+0x25,0x08,0x4b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x09,0x02,0x00,0x09,0x01,0x03,
+0x09,0x02,0x01,0x09,0x04,0xe8,0x09,0x02,0x02,0x09,0x70,0x21,0x09,0x02,0x03,0x09,
+0x00,0x01,0x09,0x02,0x04,0x28,0x01,0x09,0x02,0x05,0x09,0x00,0x02,0x00,0xaa,0x55,
+0x01,0x00,0x92,0x40,0x0a,0xaa,0x55,0x03,0x00,0x14,0x42,0xc5,0x4a,0x05,0xaa,0x55,
+0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,0x1c,0x80,0x4c,0xe0,0x4f,
+0x80,0x4c,0x80,0x4c,0xaa,0x55,0x02,0x00,0x68,0x46,0x20,0x0b,0xaa,0x55,0x01,0x00,
+0x6c,0x46,0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,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,0x02,0x00,0xe4,0x41,0x0e,0x00,
+0xaa,0x55,0x10,0x00,0xb9,0x4b,0xfc,0x54,0xcc,0xbb,0x96,0x8d,0x84,0x83,0x70,0x39,
+0xeb,0x2e,0x66,0xe9,0x60,0x4e,0xaa,0x55,0x06,0x00,0xd1,0x41,0x59,0x3a,0x98,0xe9,
+0xb6,0x98,0xaa,0x55,0x04,0x00,0xca,0x4b,0x05,0x2e,0x67,0xdd,0xaa,0x55,0x10,0x00,
+0xbf,0x41,0xf0,0xc0,0x93,0xe2,0x91,0xfa,0x78,0x23,0xd0,0x48,0x17,0x4c,0x5d,0x13,
+0xeb,0x23,0xaa,0x55,0x01,0x00,0xdf,0x41,0x02,0xaa,0x55,0x07,0x00,0x76,0x41,0x0f,
+0x84,0xf0,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,0x03,0x00,0x10,0x00,0x03,0x00,
+0x30,0x00,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,0x10,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,0x6f,0x4b,0x4b,0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,0x58,0x6c,0x59,
+0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,0x6f,0x4b,0x1f,0x74
+};
Index: BlueTooth/BT_code_patch/shoubing/output/memmap.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/memmap.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/memmap.format	(working copy)
@@ -0,0 +1,975 @@
+0x0000 mem_le_adv_transmit
+0x0001 mem_le_adv_waitcnt
+0x0002 mem_le_adv_rcv
+0x0003 mem_le_req_rcv
+0x0004 mem_le_scanrsp_rcv
+0x0005 mem_le_conn_rcv
+0x0006 mem_inquiryscan_waitcnt
+0x0007 mem_inquiryscan_rcvcnt
+0x0008 mem_pagescan_waitcnt
+0x0009 mem_pagescan_rcvcnt
+0x000a mem_pagescan_rcvfhscnt
+0x000b mem_slave_rcvcnt
+0x000c mem_page_transmit
+0x000d mem_page_rcv
+0x000e mem_page_rcv_fhs
+0x000f mem_master_rcvcnt
+0x0010 mem_fhs_wait_counter
+0x0011 mem_newconnto_counter
+0x0012 mem_inquiry_transmit
+0x0013 mem_inquiry_rcv
+0x0014 mem_fw_ver
+0x0015 mem_current_context
+0x0016 mem_le_ch_mapped
+0x0017 mem_last_freq
+0x0018 mem_rssi
+0x0019 mem_rx_type
+0x001a mem_rx_hec_err
+0x001c mem_rx_crc_err
+0x001e mem_context_ptr
+0x0020 mem_display
+0x0028 mem_bcd
+0x0030 mem_state
+0x0031 mem_mode
+0x0032 mem_tsniff
+0x0034 mem_sniff_anchor
+0x0038 mem_clk_offset
+0x003e mem_rx_window
+0x0040 mem_plap
+0x0043 mem_puap
+0x0044 mem_pnap
+0x0046 mem_conn_handle
+0x0047 mem_arq
+0x0048 mem_lmp_to_send
+0x0049 mem_lmi_opcode
+0x004a mem_lmo_reason
+0x004b mem_op
+0x004c mem_state_map
+0x004d mem_supervision_timer
+0x0051 mem_supervision_to
+0x0053 mem_name_offset
+0x0054 mem_key_size
+0x0055 mem_conn_sm
+0x0056 mem_aco
+0x0062 mem_kc
+0x0072 mem_conn_timer
+0x0073 mem_sniff_attempt
+0x0074 mem_sniff_timeout
+0x0075 mem_dsniff
+0x0077 mem_amaddr
+0x0078 mem_lmo_opcode1
+0x0079 mem_lmi_opcode1
+0x007a mem_lmo_reason1
+0x007b mem_lmo_tid1
+0x007c mem_lmo_opcode2
+0x007d mem_lmi_opcode2
+0x007e mem_lmo_reason2
+0x007f mem_lmo_tid2
+0x0080 mem_hci_version
+0x0083 mem_acl_pktlen
+0x0085 mem_sco_pktlen
+0x0086 mem_acl_pktcnt
+0x0088 mem_sco_pktcnt
+0x008a mem_current_sniff_attempt
+0x008b mem_current_sniff_timeout
+0x008c mem_sniff_timeout_temp
+0x008d mem_nfreq_index_inq
+0x008e mem_nfreq_index_page
+0x008f mem_ninqy_index
+0x0090 mem_fhs_misc
+0x0091 mem_subsniff_instant
+0x0095 mem_subsniff_rate
+0x0096 mem_subsniff_tcmax
+0x0098 mem_subsniff_tsniff
+0x0099 mem_lpm_adjust
+0x009a mem_sync_clke
+0x00a0 mem_lpm_current_mult
+0x00a1 mem_gpio_wakeup
+0x00a7 mem_air_mode
+0x00a8 mem_sco_asso_handle
+0x00a9 mem_sco_handle
+0x00ab mem_esco_desco
+0x00ac mem_esco_type
+0x00ad mem_neogotiation_state
+0x00ae mem_saved_amaddr
+0x00af mem_esco_arq
+0x00b0 mem_esco_saved_arq
+0x00b1 mem_sco_obuf
+0x00cf mem_sco_ibuf
+0x00ed mem_sco_poll
+0x00ee mem_npage_index
+0x00ef mem_page_mode
+0x00f0 mem_page_clk
+0x00f4 mem_tst_pktcnt_sync
+0x00f6 mem_tst_pktcnt_hec
+0x00f8 mem_tst_pktcnt_crc
+0x00fa mem_tst_pktcnt_dmh
+0x00fc mem_tmp_buffer_head
+0x00ff mem_tmp_buffer
+0x014f mem_tester_emulate
+0x0150 mem_temp_payload
+0x0150 test_mode_scenario
+0x0151 test_mode_hopping_mode
+0x0152 test_mode_tx_freq
+0x0153 test_mode_rx_freq
+0x0154 test_mode_power_mode
+0x0155 test_mode_poll_period
+0x0156 test_mode_packet_type
+0x0157 test_mode_data_length
+0x0159 mem_test_mode_old_debug_config
+0x015a mem_tester_cnt
+0x015b mem_temp_am_addr
+0x015c mem_temp_arq
+0x015d mem_len
+0x015f mem_clkn_bt
+0x0163 mem_clke_bt
+0x0167 mem_dpll_clkn
+0x016b mem_connection_options
+0x016c mem_nameres_cnt
+0x016d mem_txptr
+0x016f mem_slot_offset
+0x0171 extm_fhs_misc
+0x0172 extm_newconn_am_addr
+0x0173 extm_class
+0x0176 extm_lap
+0x0179 extm_uap
+0x017a extm_nap
+0x017d mem_debug_config
+0x017e mem_lch_code
+0x017f mem_fhs_am_addr
+0x0180 mem_dpll_error
+0x0182 mem_select_list_item
+0x0183 mem_temp_reconn_record
+0x0183 mem_record_bt_mode
+0x0184 mem_temp_lap
+0x018a mem_list_item_ptr
+0x018c mem_eir
+0x01f0 mem_ucode_status
+0x01f1 mem_otp_ucode_flag
+0x01f3 mem_spid_tbuf/* spid buf: 03 addr[23:16] addr[15:8] addr[7:0] */
+0x01f4 mem_iicd_tbuf/* iicd buf: iic_adr addr[15:8] addr[7:0] iic_adr */
+0x01f4 mem_addr_hi
+0x01f5 mem_addr_mi
+0x01f6 mem_addr_lo
+0x01f7 mem_iicd_addr
+0x01f8 mem_spid_rbuf
+0x01fc mem_ucode_buf
+0x01fe mem_ucode_len
+0x0200 mem_sched_addr
+0x0202 mem_ucode_ptr
+0x0204 mem_ucode_keybuf
+0x0214 mem_check_plap_temp
+0x0226 mem_reconnect_flag
+0x0227 mem_switch_fail_master_count
+0x0228 mem_app_evt_timer_count
+0x0229 mem_h5rx_ackcnt
+0x022a mem_check_err_acl_cont
+0x022b mem_rp_packets
+0x022c mem_packet_type
+0x022e mem_hci_sniff_conn_handle
+0x0230 mem_hci_sniff_max_interval
+0x0232 mem_hci_sniff_min_interval
+0x0234 mem_hci_sniff_attempt
+0x0236 mem_hci_sniff_timeout
+0x0238 mem_voice_setting
+0x023a mem_retransmission_effort
+0x023b mem_sco_ptype
+0x023d mem_extm_uap_restore
+0x0240 mem_h5rx_rptr
+0x0242 mem_h5rx_ack
+0x0243 mem_h5tx_ack
+0x0244 mem_h5tx_rptr
+0x0246 mem_h5tx_wptr
+0x0248 mem_h5tx_free
+0x024a mem_h5rx_tmp
+0x024b mem_h5tx_seq
+0x024c mem_hci_acl_queue_wptr
+0x024e mem_hci_acl_queue_rptr
+0x0250 mem_hci_acl_queue_end
+0x0252 mem_hci_acl_queue_wcnt
+0x0253 mem_hci_acl_cnt
+0x0254 mem_hci_acl_tx_trigger_wptr//tx via uart
+0x0256 mem_hci_curr_len
+0x0257 mem_hci_curr_target
+0x0259 mem_l2cap_mem_start
+0x0259 mem_l2cap_rxbuff1_len
+0x025b mem_l2cap_rxbuff2_len
+0x025d mem_l2cap_rxbuff_new
+0x025f mem_l2cap_rxbuff_inuse
+0x0260 mem_l2cap_payload_ptr
+0x0262 mem_l2cap_rx_pkt_length
+0x0264 mem_l2cap_rx_cid
+0x0266 mem_l2cap_rx_done
+0x0267 mem_l2cap_signal_tx_buff_ptr
+0x0269 mem_l2cap_signal_tx_payload_ptr
+0x026b mem_l2cap_signal_tx_length
+0x026d mem_sdp_tx_buff_ptr
+0x026f mem_sdp_tx_payload_ptr
+0x0271 mem_sdp_tx_pkt_length
+0x0273 mem_rfcomm_tx_buff_ptr
+0x0275 mem_rfcomm_tx_payload_ptr
+0x0277 mem_rfcomm_tx_pkt_length
+0x0279 memL2CAP_T1
+0x027b mem_CONTROL_tasks
+0x027c mem_send_config_req
+0x027d mem_config_identifier
+0x027e mem_config_req_dest_CID
+0x0280 mem_rfcomm_malloc_fail_flag
+0x0281 mem_message_to_uppersm
+0x0282 mem_upper_sm_remote_page
+0x0283 mem_upper_sm_reconn
+0x0284 mem_upper_sm_ss
+0x0285 mem_tx_malloc_log
+0x02c5 mem_l2cap_mem_end
+0x02c5 mem_scid
+0x02c7 mem_cmd_length
+0x02c9 mem_tt2
+0x02cb mem_tt3
+0x02cd mem_id
+0x02cf mem_psm
+0x02d1 mem_l2cap_sdpres_delay_time
+0x02d5 mem_le_rxbuf
+0x030d mem_le_l2capbuf
+0x0413 mem_le_mic
+0x0417 mem_le_peer_mic
+0x041b mem_le_peer_ltk
+0x042b mem_le_mrand
+0x043b mem_le_state
+0x043c mem_le_mode
+0x043d mem_le_tsniff
+0x043f mem_le_anchor
+0x0443 mem_le_clk_offset
+0x0449 mem_le_receive_window
+0x044b mem_le_plap
+0x0451 mem_le_conn_handle
+0x0452 mem_le_arq
+0x0453 mem_le_ch
+0x0454 mem_le_hop
+0x0455 mem_le_event_count
+0x0457 mem_le_supervision_timer
+0x045b mem_le_instant
+0x045d mem_le_channels
+0x045e mem_le_op
+0x045f mem_le_access
+0x0463 mem_le_crcinit
+0x0466 mem_le_window_size
+0x0467 mem_le_slave_latency
+0x0469 mem_le_superto
+0x046b mem_le_channel_map
+0x0470 mem_le_no_using
+0x0472 mem_le_peer_sca
+0x0473 mem_le_att_opcode
+0x0474 mem_le_att_handle
+0x0476 mem_le_err_code
+0x0477 mem_le_ll_pairing_fail_reason
+0x0478 mem_le_sk
+0x0488 mem_le_testtype
+0x0489 mem_le_test_sync
+0x048b mem_le_test_pcnt
+0x048d mem_le_rxon_ts
+0x0493 mem_le_rx_ll_opcode
+0x0494 mem_le_notify_attr_start
+0x0496 mem_le_notify_len
+0x0497 mem_cmd_le_create_conn
+0x0498 mem_le_cur_attlist_start_ptr
+0x049a mem_le_cur_handle_start
+0x049c mem_le_cur_handle_end
+0x049e mem_le_cur_uuid_length
+0x049f mem_le_cur_uuid
+0x04af mem_le_curr_att_len
+0x04b0 mem_le_search_res
+0x04b1 mem_le_continue_type
+0x04b2 mem_lmo_header_length
+0x04b3 mem_lmo_header_opcode
+0x04b4 mem_lmo_payload
+0x04c5 mem_lmi_accepted_opcode
+0x04c6 mem_disconn_reason_send
+0x04c7 mem_tx_fixed_freq
+0x04c8 mem_rx_fixed_freq
+0x04c9 mem_ext_features_page
+0x04ca mem_lmpext_ssp_enable
+0x04cc mem_remote_sppcap
+0x04cd mem_lmp_conn_state
+0x04ce mem_soft_timer
+0x04d0 mem_pincode_state
+0x04d1 mem_sres_tid
+0x04d2 mem_accptsco_tid
+0x04d3 mem_auth_enable
+0x04d4 mem_wait_encryption
+0x04d5 mem_sniff_payload
+0x04e5 mem_aurand_send_delay_time
+0x04e9 memRemoteRPNBitRate
+0x04ea memRemotePRNDataBits
+0x04eb memRemotePRNStopBit
+0x04ec memRemotePRNParity
+0x04ed memRemotePRNFlowControl
+0x04ee memRemotePRNXon
+0x04ef memRemotePRNXoff
+0x04f0 mem_mod2div_temp
+0x04f3 mem_contw_temp
+0x04f5 mem_attrib_list
+0x04f7 mem_current_adss
+0x04f8 mem_current_channel
+0x04f9 mem_current_frame_type
+0x04fa mem_current_fcs
+0x04fb mem_current_length
+0x04fd mem_rfcomm_uih_payload_ptr
+0x04ff mem_uih_cmd_type
+0x0500 mem_uih_length
+0x0502 mem_param_payload_ptr
+0x0504 mem_ms_param
+0x0505 mem_pn_credit_flow_type_info
+0x0506 mem_pn_priority
+0x0507 mem_pn_acknowledg_timer
+0x0508 mem_pn_max_retrans
+0x0509 mem_rfcomm_send_adss
+0x050a mem_rfcomm_send_frame_type
+0x050b mem_rfcomm_send_fcs
+0x050c mem_rfcomm_send_offset
+0x050d mem_sdp_mem_start
+0x050d mem_sdp_uuid_search_ptr
+0x0515 mem_sdp_continue_byte
+0x0517 mem_sdp_pduid
+0x0518 mem_sdp_transactionid
+0x051a mem_sdp_transactionid_local
+0x051c mem_sdp_attribute_maxbyte
+0x051e mem_sdp_record_maxcnt
+0x0520 mem_sdp_record_handle
+0x0524 mem_sdp_LACAP_found
+0x0525 mem_sdp_RFCOMM_found
+0x0526 mem_sdp_handle_list
+0x0526 mem_sdp_attrib_list
+0x0546 mem_sdp_error_code
+0x0548 mem_sdp_all_length
+0x054a mem_handle_humber
+0x054b mem_search_uuid
+0x054d mem_sdp_mem_end
+0x054d mem_rxbuf
+0x055e mem_random_number
+0x056e mem_round_key
+0x057e mem_kinit
+0x058e mem_input_store
+0x059e mem_x
+0x05ae mem_y
+0x05bd mem_y15
+0x05be mem_key_store
+0x05cf mem_key_store_end
+0x05d0 memp_ar_key
+0x05d2 memp_ar_input
+0x05d4 mem_ar_hround
+0x05de mem_ec_infinite
+0x05df mem_ec_loopc
+0x05e1 mem_aes_cmac_data_length
+0x05e2 memdat
+0x05e2 mem_ax
+0x05fa mem_ay
+0x0612 mem_az
+0x062a mem_bx
+0x0642 mem_ax_256//32 bytes
+0x0642 mem_by
+0x065a mem_bz
+0x0662 mem_ay_256// 32 bytes
+0x0672 mem_cx
+0x0682 mem_az_256// 32 bytes
+0x068a mem_cy
+0x06a1 mem_cy5
+0x06a2 mem_bx_256// 32 bytes
+0x06a2 mem_cz
+0x06ba mem_k
+0x06c2 mem_by_256// 31 bytes
+0x06d2 mem_align
+0x06e2 mem_bz_256//32 bytes
+0x06e2 mem_tmp1
+0x06e2 memahbak
+0x06fa mem_tmp5
+0x0702 mem_cx_256//32 bytes
+0x0702 memahsave
+0x0712 mem_tmp2
+0x0722 mem_cy_256// 32 bytes
+0x0722 memahsave_end
+0x0722 mem_addr_padding
+0x0723 mem_addr_value/* 12 bytes     */ 
+0x072a mem_tmp3
+0x072a mem_t1
+0x072f mem_addr_value_end
+0x0732 mem_addr_iocap_end
+0x0741 mem_cy5_256// 1 byte
+0x0742 mem_cz_256// 32 bytes
+0x0742 mem_tmp0
+0x0742 mem_t0
+0x074a mem_tmp0a
+0x075a mem_t2
+0x0762 mem_k_256//32 bytes
+0x0772 mem_t3
+0x0782 mem_tmp1_256//32 bytes
+0x078a mem_t7
+0x07a2 mem_tmp5_256
+0x07c2 mem_tmp2_256
+0x07e2 mem_tmp3_256
+0x07e2 mem_t1_256
+0x0802 mem_tmp0_256
+0x0802 mem_t0_256
+0x0822 mem_t2_256
+0x0842 mem_t3_256
+0x0862 mem_t7_256
+0x0882 mem_p
+0x089a mem_a
+0x08b2 mem_b
+0x08ca mem_gx
+0x08e2 mem_gy
+0x08fa memh0
+0x091a mem_p_256
+0x093a mem_a_256
+0x095a mem_gx_256
+0x097a mem_gy_256
+0x099a mem_le_slat
+0x09aa mem_sp_state_start
+0x09aa mem_sp_state
+0x09ab mem_master_sp_state
+0x09ac mem_sp_flag
+0x09ad mem_master_sp_flag
+0x09ae mem_sp_calc
+0x09af mem_sp_dh_ready
+0x09b0 mem_sp_localsm
+0x09b1 mem_pairing_auth
+0x09b2 mem_sp_flag_start
+0x09b2 mem_sp_local_key_send_count
+0x09b3 mem_sp_remote_key_recv_count
+0x09b4 mem_sp_remote_key_invalid
+0x09b5 mem_sp_dhkey_invalid
+0x09b6 mem_gkey
+0x09ba mem_le_pubkey_remote_x_256
+0x09c2 mem_sp_pubkey_remote
+0x09c2 mem_sp_pubkey_remote_x
+0x09da mem_sp_pubkey_remote_x_end
+0x09da mem_le_pubkey_remote_y_256
+0x09e2 mem_sp_pubkey_remote_y
+0x09fa mem_le_dhkey_256
+0x0a02 mem_sp_dhkey
+0x0a1a mem_sp_dhkey_end
+0x0a1a mem_sp_random_local
+0x0a2a mem_sp_random_local_end
+0x0a2a mem_sp_random_remote
+0x0a3a mem_sp_random_remote_end
+0x0a3a memresult
+0x0a3a mem_sp_calc_result
+0x0a3a memh
+0x0a3e memg
+0x0a42 memf
+0x0a46 meme
+0x0a4a mem_sp_calc_result_high
+0x0a4a memd
+0x0a4e memc
+0x0a52 memb
+0x0a56 mema
+0x0a5a mem_sp_check_result
+0x0a6a mem_sp_confirm_remote
+0x0a7a mem_sp_prarm_stack
+0x0a8a mem_UI_data_txbuff_length
+0x0a8c mem_ipc_skip_continue_proc
+0x0a8d mem_ui_timer_temp//length 4
+0x0a8d mem_ipc_rega_temp
+0x0a91 mem_hold_contr
+0x0a93 mem_hold_contw
+0x0a95 mem_fifo_temp
+0x0a96 mem_pdatatemp
+0x0a9e mem_temp//8 bytes
+0x0aa6 mem_timeup// 4 bytes
+0x0aaa mem_rega//4 bytes
+0x0aae mem_regb//4 bytes
+0x0ab2 mem_regc//3 bytes
+0x0ab5 mem_contr//2 bytes
+0x0ab7 mem_contw//2 bytes
+0x0ab9 mem_wakup_from_power_flag
+0x0aba mem_saved_gpio_in
+0x0abe mem_shutter_random_mac_data_temp
+0x0abe mem_shutter_config_data_temp
+0x0abe mem_le_adv_channel_map_temp
+0x0abe mem_le_data_len_temp//1byte
+0x0abe mem_tx_fifo_map_temp
+0x0abe mem_rpn_dlci//1byte
+0x0abe mem_event_cmd_response_content//2byte
+0x0abe mem_le_prand//16byte
+0x0abe mem_AES_CMAC_k//16 bytes
+0x0abe mem_regext_index//1 bytes
+0x0abe mem_temp_block0
+0x0abf mem_le_data_temp//15bytes
+0x0abf mem_temp_block1
+0x0ace mem_le_aes_128//16byte
+0x0ace mem_regext//64 bytes
+0x0ace mem_AES_CMAC_k1//16 bytes
+0x0ace mem_temp_block2
+0x0ade mem_AES_CMAC_k2//16 bytes
+0x0ade mem_temp_block3
+0x0aee mem_AES_CMAC_temp// 16 bytes
+0x0aee mem_temp_block4
+0x0afe mem_AES_CMAC_M_last// 16 bytes
+0x0afe mem_module_uart_cmd
+0x0aff mem_module_uart_opcode
+0x0b00 mem_module_uart_len
+0x0b01 mem_module_temp_nl_discard_packet
+0x0b02 mem_temp_block5
+0x0b0e mem_le_mackey//16 bytes
+0x0b0e mem_app_receive_temp
+0x0b0e mem_key_value_temp
+0x0b10 mem_key_value
+0x0b12 mem_key_value_temp1
+0x0b13 mem_key_value_temp2
+0x0b14 mem_key_value_temp3
+0x0b15 mem_key_value_temp4
+0x0b16 mem_key_value_temp5
+0x0b17 mem_key_value_temp6
+0x0b18 mem_temp_block6
+0x4000 mem_patch00
+0x4001 mem_patch01
+0x4002 mem_patch02
+0x4003 mem_patch03
+0x4004 mem_patch04
+0x4005 mem_patch05
+0x4006 mem_patch06
+0x4007 mem_patch07
+0x4008 mem_patch08
+0x4009 mem_patch09
+0x400a mem_patch0a
+0x400b mem_patch0b
+0x400c mem_patch0c
+0x400d mem_patch0d
+0x400e mem_patch0e
+0x400f mem_patch0f
+0x4010 mem_patch10
+0x4011 mem_patch11
+0x4012 mem_patch12
+0x4013 mem_patch13
+0x4014 mem_patch14
+0x4015 mem_patch15
+0x4016 mem_patch16
+0x4017 mem_patch17
+0x4018 mem_patch18
+0x4019 mem_patch19
+0x401a mem_patch1a
+0x401b mem_patch1b
+0x401c mem_patch1c
+0x401d mem_patch1d
+0x401e mem_patch1e
+0x401f mem_patch1f
+0x4020 mem_patch20
+0x4021 mem_patch21
+0x4022 mem_patch22
+0x4023 mem_patch23
+0x4024 mem_patch24
+0x4025 mem_patch25
+0x4026 mem_patch26
+0x4027 mem_patch27
+0x4028 mem_patch28
+0x4029 mem_patch29
+0x402a mem_patch2a
+0x402b mem_patch2b
+0x402c mem_patch2c
+0x402d mem_patch2d
+0x402e mem_patch2e
+0x402f mem_patch2f
+0x4030 mem_patch30
+0x4031 mem_patch31
+0x4032 mem_patch32
+0x4033 mem_patch33
+0x4034 mem_patch34
+0x4035 mem_patch35
+0x4036 mem_patch36
+0x4037 mem_patch37
+0x4038 mem_patch38
+0x4039 mem_patch39
+0x403a mem_patch3a
+0x403b mem_patch3b
+0x403c mem_patch3c
+0x403d mem_patch3d
+0x403e mem_patch3e
+0x403f mem_patch3f
+0x4040 mem_context
+0x4090 mem_current_amaddr
+0x4091 mem_lpm_mode
+0x4092 mem_device_option
+0x4093 mem_scan_mode
+0x4094 mem_last_clkn
+0x4098 mem_features
+0x40a0 mem_lap
+0x40a3 mem_uap
+0x40a4 mem_nap
+0x40a6 mem_npage
+0x40a7 mem_glap
+0x40aa mem_class
+0x40ad mem_iscan_window
+0x40af mem_iscan_interval
+0x40b1 mem_pscan_window
+0x40b3 mem_pscan_interval
+0x40b5 mem_page_interval
+0x40b7 mem_page_window
+0x40b9 mem_page_to
+0x40bb mem_inq_window
+0x40bd mem_fcomp_mul
+0x40be mem_fcomp_div
+0x40bf mem_rx_window_init
+0x40c1 mem_rx_window_sniff
+0x40c3 mem_rf_init_ptr
+0x40c5 mem_last_type
+0x40c6 mem_last_type_esco
+0x40c7 mem_last_type_saved
+0x40c8 mem_retransmission_cnt
+0x40ca mem_next_btclk
+0x40ce mem_rf_rccal
+0x40cf mem_handle_num
+0x40d0 mem_max_slot
+0x40d1 mem_eir_enable
+0x40d2 mem_afh_instant
+0x40d6 mem_afh_error_total
+0x40d8 mem_afh_cfg
+0x40d9 mem_afh_new_mod
+0x40da mem_afh_map_lo
+0x40df mem_afh_map_hi
+0x40e4 mem_afh_used
+0x40e5 mem_afh_index
+0x40e7 mem_afh_map_new
+0x40f2 mem_afh_map
+0x4142 mem_afh_timer
+0x4146 mem_afh_classify_channel_map
+0x4150 mem_chip_functions
+0x4152 mem_lpm_wake_lock
+0x4154 mem_lpm_interval
+0x4156 mem_lpm_overhead
+0x4157 mem_lpm_hibernate_switch
+0x4158 mem_lpm_doze_switch
+0x4159 mem_esco_addr
+0x415a mem_sniff_unint_lost
+0x415b mem_ptt
+0x415c mem_sleep_counter//should be 0x41fc in REVC
+0x4160 mem_sleep_counter_all
+0x4164 mem_sleep_clkn
+0x416a mem_sniff_rcv
+0x416d mem_sniff_lost
+0x4170 mem_clks_per_lpo
+0x4173 mem_lpm_mult
+0x4174 mem_lpm_mult_timeout
+0x4175 mem_lpm_mult_cnt
+0x4176 mem_lpm_config
+0x4179 mem_lpm_xtalcnt
+0x417a mem_lpm_buckcnt
+0x417b mem_lpm_ldocnt
+0x417c mem_lpm_isogate
+0x417d mem_lpm_isogate_final
+0x417e mem_saved_gpio// should be 0x421e in REVC
+0x418e mem_saved_gsel
+0x4191 mem_saved_mark
+0x4199 mem_saved_spidctrl
+0x419a mem_patch_ptr
+0x419c mem_patch_len
+0x419e mem_timers
+0x41be mem_link_key_exists
+0x41bf mem_link_key
+0x41cf mem_hci_cmd
+0x41d0 mem_hci_conn_handle
+0x41d1 mem_hci_plap
+0x41d4 mem_hci_puap
+0x41d5 mem_hci_pnap
+0x41d7 mem_uartd_rxitems_got_data
+0x41d8 mem_uartd_rxitems_threshold
+0x41d9 mem_uartd_rx_timeout
+0x41db mem_loadcode_times
+0x41dc mem_tx_lch
+0x41dd mem_tx_len
+0x41df mem_tx_power
+0x41e0 mem_context_number
+0x41e1 mem_250k_freq_enable
+0x41e2 mem_rf_init_data
+0x41e3 mem_app_handshake_flag
+0x41e4 mem_sniff_param_interval
+0x41e6 mem_sniff_param_attempt
+0x41e8 mem_sniff_param_timeout
+0x41ea mem_cb_check_wakelock
+0x41ec mem_cb_before_hibernate
+0x41ee mem_cb_before_lpm
+0x41f0 mem_cb_le_process
+0x41f2 mem_cb_bt_process
+0x41f4 mem_cb_idle_process
+0x41f6 mem_cb_bb_event_process
+0x41f8 mem_cb_discovry_timeout
+0x41fa mem_cb_att_write
+0x41fc mem_cb_ble_transmit
+0x41fe mem_cb_event_timer
+0x4200 mem_cb_bt_set_mult
+0x4202 mem_eeprom_base
+0x4204 mem_unsniff2sniff_timer_count
+0x4205 mem_wake_up_delay_timer
+0x4206 mem_app_connection_options
+0x4207 mem_app_disconn_reason
+0x4209 mem_app_disconn_reason_flag
+0x420b mem_lpm_delay_after_sniff
+0x420f mem_xrecord_mode
+0x4210 mem_eeprom_block_size
+0x4211 mem_spi_init_clk
+0x4212 mem_spi_init_delay_time
+0x4213 mem_spi_ncs_gpio
+0x4214 mem_nv_data_ptr
+0x4216 mem_nv_data_number
+0x4217 mem_hci_lt_rx_state
+0x4218 mem_l2cap_xmem_start
+0x4218 mem_l2cap_tx_multi_offset//0 means single packet
+0x421a mem_sdp_remote_cid
+0x421c mem_rfcomm_remote_cid
+0x421e mem_hid_ctrl_remote_cid
+0x4220 mem_hid_int_remote_cid
+0x4222 mem_sdp_state
+0x4223 mem_rfcomm_state
+0x4224 mem_hid_control_state
+0x4225 mem_hid_interrupt_state
+0x4226 mem_spp_state
+0x4227 mem_ML2CAP_comm_id
+0x4228 mem_used_map
+0x4229 mem_tx_fifo0
+0x4229 mem_tx_fifo0_map
+0x422a mem_tx_fifo0_ptr
+0x422c mem_tx_fifo1
+0x422c mem_tx_fifo1_map
+0x422d mem_tx_fifo1_ptr
+0x422f mem_tx_fifo2
+0x422f mem_tx_fifo2_map
+0x4230 mem_tx_fifo2_ptr
+0x4232 mem_tx_fifo3
+0x4232 mem_tx_fifo3_map
+0x4233 mem_tx_fifo3_ptr
+0x4235 mem_tx_fifo_end
+0x4235 mem_l2cap_lpm_txbuf
+0x4335 mem_l2cap_flow_ctrl_flag
+0x4336 mem_l2cap_pending_item
+0x4337 mem_l2cap_xmem_end
+0x4337 mem_le_dsniff
+0x4339 mem_le_conn_interval
+0x433b mem_le_scan_enable
+0x433c mem_le_scan_interval
+0x433e mem_le_scan_window
+0x4340 mem_le_adv_enable
+0x4341 mem_le_adv_data_len
+0x4342 mem_le_adv_data
+0x4361 mem_le_scan_data_len
+0x4362 mem_le_scan_data
+0x4381 mem_le_name_len
+0x4382 mem_le_name
+0x43a0 mem_le_new_map
+0x43a5 mem_le_new_param
+0x43a5 mem_le_new_transmitwindowsize
+0x43a6 mem_le_new_transmitwindowoffset
+0x43a8 mem_le_new_conninterval
+0x43aa mem_le_new_connslavelatency
+0x43ac mem_le_new_connsupervisiontimeout
+0x43ae mem_le_txheader
+0x43af mem_le_txlen
+0x43b0 mem_le_txpayload
+0x43b2 mem_le_txcid
+0x43b4 mem_le_l2cap
+0x43b5 mem_le_l2cap_response
+0x43b6 mem_le_txbdy
+0x43d5 mem_le_pcnt_tx
+0x43da mem_le_pcnt_rx
+0x43df mem_le_last_mic
+0x43e3 mem_le_ivm
+0x43e7 mem_le_ivs
+0x43eb mem_le_ltk
+0x43fb mem_ltk_exists
+0x43fc mem_le_rconfirm
+0x440c mem_le_srand
+0x441c mem_le_iat
+0x441d mem_le_rat
+0x441e mem_le_preq
+0x441f mem_le_preq_iocap
+0x4420 mem_le_preq_oob
+0x4421 mem_le_preq_auth
+0x4422 mem_le_preq_max_keysize
+0x4423 mem_le_preq_init_key_distribution
+0x4424 mem_le_preq_resp_key_distribution
+0x4425 mem_le_pres
+0x4426 mem_le_pres_iocap
+0x4427 mem_le_pres_oob
+0x4428 mem_le_pres_auth
+0x4429 mem_le_pres_max_keysize
+0x442a mem_le_pres_init_key_distribution
+0x442b mem_le_pres_resp_key_distribution
+0x442c mem_le_search_handle_start
+0x442e mem_le_search_handle_end
+0x4430 mem_le_att_offset
+0x4430 mem_le_search_att_type_length
+0x4431 mem_le_search_att_type
+0x4441 mem_le_notify_handle
+0x4443 mem_le_search_uuid_length
+0x4444 mem_le_search_uuid
+0x4454 mem_le_adv_param
+0x4454 mem_le_adv_interval
+0x4456 mem_le_adv_type
+0x4457 mem_le_adv_own_addr_type
+0x4458 mem_le_adv_direct_addr_type
+0x4459 mem_le_adv_direct_addr
+0x445f mem_le_adv_channel_map
+0x4460 mem_le_conn_param
+0x4460 mem_le_conn_peer_addr_type
+0x4461 mem_le_conn_peer_addr
+0x4467 mem_le_conn_own_addr_type
+0x4468 mem_le_interval_min
+0x446a mem_le_interval_max
+0x446c mem_le_latency
+0x446e mem_le_timeout
+0x4470 mem_le_scan_params
+0x4470 mem_le_scan_type
+0x4471 mem_le_scan_own_addr_type
+0x4472 mem_le_lap
+0x4475 mem_le_uap
+0x4476 mem_le_nap
+0x4478 mem_le_local_mtu
+0x447a mem_le_remote_mtu
+0x447c mem_le_skdm
+0x4484 mem_le_skds
+0x448c mem_le_init_superto
+0x448e mem_ui_le_uuid_table
+0x4490 mem_le_secure_connect_enable
+0x4491 mem_le_secure_connect_flag
+0x4492 mem_le_sc_calc
+0x4493 mem_le_secure_connect_state
+0x4494 mem_le_sc_confirm_gkey_flag
+0x4495 mem_le_sc_local_key_invalid
+0x4496 mem_le_pairing_state
+0x4497 mem_le_enc_state
+0x4498 mem_le_pairing_mode
+0x4499 mem_le_tk
+0x449d mem_le_ediv
+0x449f mem_le_rand
+0x44a7 mem_le_irk
+0x44b7 mem_le_transmit_window
+0x44bb mem_le_configuration
+0x44bc mem_le_fixed_ltk
+0x44cc mem_le_pairing_handle
+0x44ce mem_le_l2cap_size
+0x44d0 mem_le_packet_len_recved
+0x44d1 mem_le_tx_buff_used
+0x44d2 mem_le_tx_ptr0
+0x44d4 mem_le_tx_ptr1
+0x44d6 mem_le_tx_ptr2
+0x44d8 mem_le_tx_ptr3
+0x44da mem_le_signaling_identifier
+0x44db mem_le_l2cap_signaling_conn_param_update_rsp_result
+0x44dd mem_le_packet_size
+0x44de mem_le_packet_llid
+0x44df mem_le_payload_ptr
+0x44e1 mem_le_md_count
+0x44e2 mem_lmp_version
+0x44e5 mem_lmp_subversion
+0x44e7 mem_local_name_length
+0x44e8 mem_local_name
+0x44eb mem_local_name2
+0x452b mem_local_name_end
+0x452c mem_unsniff2sniff_timer
+0x452d mem_switch_flag
+0x452e mem_classic_bt_flag
+0x452f mem_pn_dlci
+0x4530 mem_pn_max_frame_size
+0x4532 memFCStemp1
+0x4533 memFCStemp2
+0x4534 memFCStemp3
+0x4535 mem_rfcomm_initiator
+0x4536 mem_remote_spp_channel
+0x4537 mem_HIUfcs_SPP
+0x4538 mem_HIUfcs_SPP_WCredits
+0x4539 mem_rfcomm_send_more_pkt
+0x453a mem_remote_credits
+0x453b mem_credit_given
+0x453c mem_ms_channel
+0x453d mem_credit_flag
+0x453e mem_rfcomm_max_frame_size
+0x4540 mem_rfcomm_credit_init_data
+0x4541 mem_cb_receive_spp_data
+0x4543 mem_nl_rx_data_src
+0x4545 mem_nl_rx_len_all
+0x4547 mem_ui_uuid_table
+0x4549 mem_all_uuid_16bits
+0x455f mem_all_uuid_128bits
+0x4581 mem_sdp_l2capch_ptr
+0x4583 mem_sp_local_key_invalid
+0x4584 mem_le_private_key_256
+0x45a4 mem_le_pubkey_local_x_256
+0x45c4 mem_le_pubkey_local_y_256
+0x45e4 mem_sp_private_key
+0x45fc mem_sp_pubkey_local
+0x45fc mem_sp_pubkey_local_x
+0x4614 mem_sp_pubkey_local_x_end
+0x4614 mem_sp_pubkey_local_y
+0x462c mem_ssp_enable
+0x462d mem_sp_iocap_local
+0x4630 mem_sp_iocap_remote
+0x4633 mem_flag_mode_ssp_pin
+0x4634 mem_ssp_mode_flag
+0x4635 mem_authentication_passkey_times
+0x4636 mem_passkey_1bit
+0x4637 mem_flag_pairing_state
+0x4638 mem_ipc_lock_bt
+0x4639 mem_ipc_lock_c51
+0x463a mem_ipc_fifo_bt2c51
+0x4642 mem_ipc_fifo_c512bt
+0x464a mem_ui_timer_last_btclk
+0x464e mem_discovery_timeout_timer_count
+0x4650 mem_hid_handshake_timer_count
+0x4651 memui_reconnect_mode
+0x4652 mem_ui_state_map
+0x4654 mem_ui_profile_supported
+0x4655 mem_discovery_timeout
+0x4657 mem_pin_length
+0x4658 mem_pin
+0x4668 mem_soft_version_num
+0x466a mem_current_packet_length
+0x466c mem_module_state
+0x466d mem_module_spp_lpm_mult
+0x466e mem_module_le_lpm_mult
+0x466f mem_module_bluetooth_stauts_by_command
+0x4670 mem_module_le_rx_data_len
+0x4671 mem_module_le_rx_data_address
+0x4673 mem_module_le_rx_data_handle
+0x4675 mem_module_data_write_handle
+0x4677 mem_module_data_write_handle2
+0x4679 mem_module_flag
+0x467a mem_module_hci_notify_len
+0x467b mem_module_hci_notify_handle
+0x467d mem_module_hci_nofiy_addr
+0x467f mem_last_transmite_clock
+0x4683 mem_module_uuid_list
+0x4975 mem_module_uuid_list_end
+0x4975 mem_module_le_att_list
+0x4ac5 mem_module_le_att_list_end
+0x4ac5 mem_module_nv_data
+0x4ac5 mem_module_nv_data0
+0x4ae7 mem_module_nv_data1
+0x4b09 mem_module_nv_data2
+0x4b2b mem_module_nv_data3
+0x4b4d mem_module_nv_data4
+0x4b6f mem_rf_init
+0x4b7e mem_classic_shutter_cable_unplug_conut
+0x4b7f mem_classic_shutter_hid_disconn_count
+0x4b80 mem_suspend_flag
+0x4b81 mem_power_ctrl_pac_succ_cnt
+0x4b82 mem_power_ctrl_level
+0x4b83 mem_rssi_avg_received
+0x4b84 mem_rssi_hex_received
+0x4b85 mem_rssi_signal_buf
+0x4b8d mem_rssi_noise_buf
+0x4b95 mem_rssi_noise_index
+0x4b96 mem_rssi_signal_index
+0x4b97 mem_read_otp_data
+0x4bb3 mem_en_24g_flag
+0x4bb4 mem_module_uart_len_new
+0x4bb6 mem_m_process_enable
+0x4bb7 mem_m_wake_send_window
+0x4bb9 mem_m_p_sequence
+0x4bc1 mem_m_access_code
+0x4bca mem_m_wake_data
+0x4bce mem_m_save_lmp_Ye
+0x4bd3 mem_m_wakeup_timer
+0x4bd5 mem_btsniff
+0x4bd6 mem_ns_wake_up_flag
+0x4bd7 mem_context_new
+0x4c77 mem_module_end
+0x0b1e mem_m_process_sync_buffer
+0x0b37 mem_m_snd_op
+0x0b39 mem_m_rcv_op
Index: BlueTooth/BT_code_patch/shoubing/output/otp.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/otp.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/otp.dat	(working copy)
@@ -0,0 +1,8 @@
+00
+02
+aa
+55
+00
+00
+b3
+23
Index: BlueTooth/BT_code_patch/shoubing/output/romcode.rom
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/romcode.rom	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/output/romcode.rom	(working copy)
@@ -0,0 +1,16384 @@
+20404abb
+44804000
+20800000
+2040496a
+20404a95
+20405144
+4480c000
+204068c4
+204060d7
+20407b81
+20404c77
+44814000
+2055cc7c
+2040741f
+2055cb1d
+4481c000
+20407591
+20407964
+20407422
+20405736
+44824000
+20404034
+20404c86
+2040408b
+204042f4
+20404366
+2040401d
+20404b3f
+2020400f
+20404022
+c6848000
+793f8009
+2040421f
+202057a8
+4482c000
+2040425a
+2422c02b
+20404206
+1a208c01
+efe20006
+c280573a
+c280c162
+202043cb
+20404227
+1f227c00
+20628000
+20404206
+6fe20030
+c281c0cf
+6fe20031
+c280c162
+202043cb
+6fe241cf
+207a0000
+c000c044
+c0014049
+c001c04c
+c002c051
+c00dc041
+20404253
+20628000
+20404256
+20628000
+7041cf00
+20600000
+7004971b
+7041cf00
+20600000
+7920001c
+793f801e
+70008fff
+70008d1f
+2020403f
+793f801c
+18003600
+2020403f
+20404256
+20628000
+18000401
+70016c05
+20204058
+44834000
+6fec41d1
+203a403f
+70465101
+70005503
+20204057
+18000425
+4483c000
+6fe200ef
+203a405e
+1fe9fe00
+1ff27e00
+1fe0ffff
+67e240a6
+67e200ee
+70008e1f
+793f800c
+20404237
+2422c07f
+20404a6e
+67e20077
+6042007c
+6fec41d1
+67ec0040
+44844001
+20407cf0
+18007e00
+2841fe01
+7d20fe05
+79207e03
+67e20030
+700a9503
+20407bab
+18007e00
+7920fe04
+67e2004c
+58000000
+79207e01
+67e20031
+7834fc00
+2040421f
+7854fc00
+18000e03
+6fe440b9
+20407ce3
+2020403f
+4484c001
+6fec41d1
+67ec0040
+2841fe01
+2020c085
+2020403f
+d8a000ff
+df200008
+20407ca1
+700a9504
+20407bab
+2020403f
+c68e0000
+18000e01
+20407cf1
+7d3a001c
+243a4091
+20600000
+44854001
+684440bb
+18000e04
+20404718
+20740000
+204048a0
+18004800
+20618000
+793f800b
+793f8000
+1c40c201
+280ffe1e
+7920c802
+2c200400
+2420c0ba
+4485c001
+6fe20012
+1fe0fe01
+67e20012
+204048d4
+204048ce
+204048ee
+20404a50
+20404a55
+20404a63
+20404649
+204040ad
+20204098
+44864001
+6fe2008d
+1fe0ffff
+67e2008d
+20610000
+70008d1f
+6fe2008f
+1fe0ffff
+67e2008f
+20610000
+7940001e
+70008fff
+20600000
+4486c001
+204048d4
+204048c8
+204048ee
+20404a5a
+204049ea
+20404a0c
+202c40c4
+204040ad
+2020409b
+44874001
+204049ba
+20404a6a
+2040451a
+793f8001
+c6858000
+4487c001
+6fe20013
+1fe0fe01
+67e20013
+20600000
+44884002
+7834fc00
+78387c00
+6fe440b5
+203a40d7
+18000e08
+20407cf1
+247a0000
+4488c002
+684440b7
+18000e28
+20404718
+20344110
+18000e03
+20407cf1
+243a40ec
+6fe2004c
+c28240e2
+202040e5
+d8a000ff
+df200008
+20407ca1
+44894002
+70003000
+204060d8
+70465100
+700a9513
+20407bab
+20204110
+4489c002
+18001600
+34730200
+6fe200f0
+1fe0ffff
+9c42fe00
+2fe00600
+2420c0ec
+18827e00
+67e2017f
+18004c00
+18004800
+448a4002
+2021c110
+204048d8
+d9600600
+34730200
+448ac002
+6fe800f0
+98004200
+1fe0fe01
+67e800f0
+280ffe0c
+7920c802
+2c200400
+2420c124
+6fe2000c
+1fe0fe01
+67e2000c
+204048ce
+20404a50
+20404a55
+20404a63
+20404649
+20404116
+202040f8
+448b4002
+7854fc00
+6fe440b5
+207a0000
+18000e08
+20207ce3
+448bc002
+6fe2008e
+1fe0ffff
+67e2008e
+20610000
+70008e1f
+6fe200ee
+1fe0ffff
+67e200ee
+20610000
+7940000c
+6fe240a6
+67e200ee
+20600000
+448c4003
+204048c8
+20404a5a
+204049ea
+20404a0c
+202c412c
+20404116
+202040fd
+20404649
+6fe2000d
+1fe0fe01
+67e2000d
+18003600
+6fe800f0
+448cc003
+20404a4e
+204048d8
+1cc0cc01
+1c2143fd
+1c8149fc
+204048ce
+20404a50
+20404a55
+20404a63
+1c427e00
+67e8015f
+18000800
+18000202
+20404a6a
+20404762
+448d4003
+20404a4c
+1c21c202
+1c8149fc
+204048c8
+20404a5a
+204049ea
+20404a0c
+204c4649
+202c4151
+6fe20010
+203a40f8
+1fe0ffff
+67e20010
+20204132
+448dc003
+6fe2000e
+1fe0fe01
+67e2000e
+20404431
+204042ee
+202c415b
+20404451
+243a4156
+202040f8
+448e4003
+6fe20030
+793ffe03
+67e20030
+2040443c
+7854fc00
+20600000
+448ec003
+7834fc00
+78387c00
+204041dd
+20740000
+20404c24
+20404a4e
+1c40c201
+204048de
+18004803
+20406b81
+20404485
+204048ce
+20404a50
+20404a55
+20404a63
+2040475e
+448f4003
+204060e9
+204042e0
+2436c17c
+20404a87
+20404724
+6fe2000f
+1fe0fe01
+67e2000f
+448fc003
+20406b69
+20404187
+24748000
+204046ef
+243a4184
+7854fc00
+20600000
+20404485
+204042d6
+20204173
+2036c18a
+20404a7e
+20214198
+204041a3
+24344198
+6fe2004c
+c4020000
+c3818000
+6fe2004b
+c3818000
+204041aa
+247a0000
+6fe2016c
+1fe0ffff
+67e2016c
+247a0000
+202063e8
+44904004
+20404459
+7854fc00
+6fe2004c
+c282419e
+20600000
+6fe2004c
+c3818000
+d8a000ff
+df200008
+20207ca1
+4490c004
+78347c00
+6fe2004b
+c4018000
+204041aa
+247a0000
+20207dc1
+6fe20072
+1fe0ffff
+67e20072
+20600000
+44914004
+6fe20030
+c283c1b7
+6fe209b1
+203a41b7
+7009b100
+700a9518
+20407bab
+202041b7
+4491c004
+20404250
+6fe20030
+79207e07
+67e20030
+7041be01
+6fe20055
+c08b41bf
+20600000
+7009b101
+6fe20030
+793ffe07
+67e20030
+20600000
+44924004
+78547c00
+6fe40032
+d840ffff
+98467c00
+24628000
+6fe80034
+203841cf
+9d067e00
+202041d0
+9c467e00
+1fe67c04
+24610000
+18007e00
+67e40032
+20207dbf
+1fe20400
+4492c004
+60480034
+70452d01
+5800ffff
+67e40032
+70007301
+20600000
+44934004
+204041c5
+24740000
+78547c00
+70001120
+793f800b
+20404a4e
+204042e2
+c505c1f0
+20404451
+243a41e3
+4493c004
+78547c00
+1c427e00
+67e840ca
+78387c00
+7834fc00
+700a952a
+20207bab
+44944005
+20404a4c
+d8200010
+204042d8
+78587c00
+7854fc00
+20404814
+20404431
+4494c005
+20404478
+2036c1fe
+20404451
+243a41f8
+202041e8
+6fe20031
+793ffe01
+67e20031
+20404a87
+2040483d
+78347c00
+700a952b
+20207bab
+44954005
+79200009
+1a227e00
+67e4001e
+18007250
+d8a0043b
+1a208c01
+efe20006
+1a220c00
+c2807cdc
+d8a00030
+20407cdc
+78577c00
+6fe20077
+98000800
+70008a01
+2034c218
+70008a01
+6fe20030
+c4008000
+6fe20073
+67e2008a
+6fe20074
+67e2008b
+20600000
+4495c005
+6fe4001e
+98000a00
+18007250
+d8c0043b
+203b7cdc
+d8c00030
+20207cdc
+df200001
+68420015
+18408401
+2841fe01
+2420c22d
+d8400000
+60420015
+184ffe50
+da204040
+9a20a200
+efe20011
+c280c235
+c3800000
+c3818000
+c2004229
+20600000
+44964005
+da604266
+2040425d
+24628000
+1a227e00
+67e4001e
+18007c00
+20600000
+20404721
+2020c247
+6fe4001e
+1fe08a17
+6fe20047
+e7e20005
+da6042a6
+2020425d
+6fe20047
+2feffe03
+2020c24c
+18007c01
+20600000
+18007c00
+20600000
+da6042a3
+2020425d
+6844001e
+da6042cb
+2020425d
+684241d0
+da604271
+2020425d
+4496c005
+684c41d1
+da60426a
+2020425d
+da604277
+2020425d
+da6042c2
+44974005
+da204040
+df200001
+efe20011
+1a627a00
+1a20a250
+c2004260
+18007c01
+20600000
+c2804262
+c281c262
+18007c00
+20600000
+c281c26c
+c3004262
+1a208c10
+efec0006
+98467c00
+20628000
+20204262
+c3004262
+1a208c16
+efe20006
+98467c00
+20628000
+20204262
+c300c262
+204042af
+20404293
+98467e00
+1fe0fe01
+2021428d
+18c22400
+67f20a9e
+6fe24492
+243a4285
+6ff20a9e
+1a420c00
+1fe0fe05
+20204288
+6ff20a9e
+1a420c00
+1fe0fe14
+24214262
+18424200
+204042bb
+18007c00
+20600000
+98002400
+1a208c02
+efe40006
+203a4289
+204042bb
+20204278
+1ff11600
+196c9600
+2022c29d
+29601e0f
+24608000
+18511600
+196c9600
+24628000
+7920041c
+20600000
+18511600
+196c9600
+29601e0f
+24608000
+79207e1c
+20600000
+c3004262
+18007c00
+20600000
+c3004262
+1a208c01
+efe20006
+c2804262
+1a208c17
+efe20006
+c301c262
+18007c00
+20600000
+1a208c01
+e8420006
+1c427e00
+284ffe01
+1a208c04
+e8480006
+20608000
+1a208c08
+efec0006
+20404850
+1d027e00
+20600000
+1a208c02
+1a208a04
+efe40006
+98409600
+19627e00
+e7e80005
+20205823
+c300c262
+204042af
+9b60fe00
+9b60fe00
+98e0fe00
+98467c00
+24214262
+18007c00
+20600000
+c3004262
+18427e00
+9a267c00
+203f4262
+1a208c01
+efe20006
+c2804262
+efe20011
+793ffe07
+e7e20011
+20204262
+4497c005
+20404a4e
+1c40c201
+204048de
+18004803
+204048ce
+20404a50
+20404a55
+20404a63
+2020475e
+44984006
+20404a4c
+1c40c201
+204048de
+18004803
+204048c8
+20404426
+204049f0
+20404a5a
+204049ea
+20404a0c
+246c0000
+204049ba
+20204518
+4498c006
+6fe2017f
+98000800
+18000201
+204042d6
+202042e0
+6fe24093
+c4000000
+18000e04
+20407cf1
+247a0000
+684440ad
+18000e04
+20404718
+20740000
+20404304
+18000e04
+6fe440af
+242c7ce3
+180a7e00
+9ea17e00
+20207ce3
+44994006
+70017f00
+78587c00
+78577c00
+204048a0
+1c4143fc
+18004801
+204048d4
+204048c8
+7940001d
+6fe20006
+1fe0fe01
+67e20006
+204048ee
+204049ea
+20404a13
+246c0000
+4499c006
+18003600
+204048f5
+6fe20007
+1fe0fe01
+67e20007
+204048d4
+20404a4c
+1c21c202
+18004801
+204048ce
+204048ee
+20404a50
+20404a5e
+1c427e00
+67e8015f
+20404a63
+18000202
+18000800
+20404a6a
+20404762
+2040432e
+1c2143fd
+1cc0cc01
+20600000
+449a4006
+6fe240d1
+207a0000
+d8a0018c
+6fe244e7
+1fe27200
+1fe0fe01
+e7e20005
+18a20400
+1fe0fe01
+67e441dd
+18420a00
+58000009
+e7e20005
+d8c044e8
+20407cdc
+da60455f
+df200004
+20404350
+da604549
+df200001
+20404350
+1800020a
+7041dc02
+5800018c
+67e4016d
+20404a4c
+204048ce
+20404a50
+20404a5e
+20404a63
+20404a6a
+20404762
+20600000
+18a20400
+1a620c00
+efe20006
+207a0000
+1fe3fe00
+c2004354
+1fe22200
+1fe0fe02
+1fe20e00
+6fe441dd
+98e0fe00
+67e441dd
+18420a00
+1a227e00
+1fe0fe01
+e7e20005
+1a620c00
+efe20006
+efe20006
+e7e20005
+1a227200
+20207cdc
+6fe24093
+c4008000
+18000e05
+20407cf1
+247a0000
+684440b1
+18000e28
+20404718
+20740000
+18000800
+70001008
+793f800b
+20404376
+18000e05
+6fe440b3
+20207ce3
+449ac006
+78587c00
+204048a0
+6fe20008
+1fe0fe01
+67e20008
+18004c00
+204048de
+1c40c201
+18004802
+449b4006
+204048c8
+204049ea
+20404a13
+246c0000
+204048f5
+6fe20009
+1fe0fe01
+67e20009
+18003600
+20404a4c
+1c21c202
+18004801
+204048ce
+20404a50
+20404a5e
+20404a63
+20404649
+18000800
+d9600600
+35330200
+1d01d003
+1c2143fd
+449bc006
+1cc0cc01
+204048c8
+204049ea
+20404a06
+242c43a0
+20404a6a
+2040451a
+c505c3a7
+449c4007
+6fe20010
+207a0000
+1fe0ffff
+67e20010
+20404a4e
+20204397
+449cc007
+793fd001
+79205000
+6fe2000a
+1fe0fe01
+67e2000a
+20404a4c
+1c21c202
+204048ce
+20404a50
+20404a5e
+20404a63
+20404649
+2d000603
+2020c3b8
+37cb8200
+202043b4
+6fe80163
+1fe1fe03
+1fe25000
+449d4007
+6fec0176
+67ec0040
+20404431
+20404478
+2036c3c4
+20404451
+243a43bf
+20600000
+449dc007
+2040443c
+20404237
+24628000
+70003100
+2040483d
+2020421f
+449e4007
+2040484c
+204043ef
+20740000
+449ec007
+20404c24
+20406b69
+20404510
+2436c3de
+20404a87
+20406b81
+20404485
+20404753
+20404724
+204060e9
+6fe2000b
+1fe0fe01
+67e2000b
+2040483d
+449f4007
+20404b86
+20404a7e
+202143e7
+204041a3
+243443e7
+204046ef
+243a43cf
+20600000
+449fc007
+70014f00
+70017d00
+20404459
+793f8011
+20407d8c
+6fe20030
+20600000
+44a04008
+204041c5
+24740000
+18820400
+20404a6e
+67e2017f
+18420800
+70001120
+44a0c008
+20404a4e
+18000202
+2040474b
+1c427e00
+67e8015f
+2040475e
+20404a4c
+7837fc00
+204044f2
+202c4409
+204048f5
+20404451
+243a43f7
+c6820000
+70007c34
+79200003
+20600000
+78387c00
+20404431
+204048a0
+44a14008
+204042ee
+202c4415
+20404451
+243a440c
+78587c00
+1d027e00
+67e840ca
+20600000
+7834fc00
+c582441b
+793f8004
+70007c03
+70007d33
+204066da
+18827e00
+67e20077
+18007e00
+67ec0038
+6fe20031
+79207e01
+67e20031
+20404a87
+7854fc00
+78347c00
+20600000
+44a1c008
+7856fc00
+793f8005
+793f800a
+793f8010
+793f800f
+6fe20047
+793ffe05
+79207e04
+67e20047
+20600000
+44a24008
+70001120
+70004750
+6fe440bf
+67e4003e
+1c427e00
+67e840ca
+20780000
+1d027e00
+67e840ca
+20600000
+44a2c008
+204060e5
+20404455
+67e20046
+58000000
+67e40259
+58001c80
+67e40051
+6fe20030
+79207e00
+67e20030
+70004b00
+70004c00
+7000a000
+20204a87
+44a34008
+18007e00
+67f041bf
+e7f00005
+204041c1
+20204250
+6fe20011
+1fe0ffff
+67e20011
+20600000
+6fe240cf
+1fe0fe01
+67e240cf
+20600000
+44a3c008
+6fe241cf
+c001c45e
+6fe20048
+c080c462
+204050ec
+2422c462
+204041a0
+7041cf00
+44a44009
+20404d3a
+204046e5
+700a9502
+20407bab
+204060d8
+20405145
+20407432
+6fe20030
+793ffe00
+67e20030
+70465100
+6fe2004c
+2fe18000
+2020c472
+793f8001
+6fe20047
+c301c474
+6fe2004b
+c4030000
+793f8002
+20600000
+44a4c009
+6fe20172
+207a0000
+1fe20800
+20404510
+24768000
+18000200
+20404753
+18827e00
+67e20077
+18007e00
+67e20172
+20600000
+44a54009
+6fe20030
+c3014492
+18000207
+c583c491
+20404721
+2420c492
+20374492
+204044bd
+58000002
+67e440c8
+20600000
+24770000
+44a5c009
+2040423f
+2422c4a3
+6fe20047
+c301c4ac
+c502c4b0
+6fe2017d
+c28344b6
+6fe440c8
+1fe0ffff
+67e440c8
+203a44a1
+6fe240c5
+98000200
+20600000
+44a64009
+20404683
+20404721
+2020c4ac
+204063ec
+203444ba
+6fe2004b
+c28344bc
+c502c4b0
+6fe2017d
+c28344b6
+18000201
+20748000
+18000200
+20600000
+44a6c009
+6fe20019
+98000200
+c1808000
+18000200
+20600000
+6fe20156
+1fe1020f
+79200005
+20600000
+18000213
+202044bd
+204044c6
+44a74009
+68420047
+79200403
+60420047
+18227e00
+67e240c5
+5800ffff
+67e440c8
+20600000
+44a7c009
+6fe2004c
+2feffe05
+6fe441dd
+2020c4dc
+18000203
+1fe67c11
+20610000
+18000204
+1fe67c1b
+20610000
+1800020a
+1fe67c79
+20610000
+1800020b
+1fe67cb7
+20610000
+1800020e
+1fe67ce0
+20610000
+1800020f
+20600000
+18000203
+1fe67c11
+20610000
+18000204
+1fe67c36
+20610000
+1800020a
+d840016f
+98467c00
+24610000
+1800020e
+d84002a7
+98467c00
+24610000
+1800020f
+20600000
+6fe20030
+c300c4f1
+6fe40032
+203a44f1
+243744f3
+20404a4e
+1d00c201
+78287c00
+6fe4003e
+1fe37e00
+d8400500
+9840fe00
+20404a23
+204048e6
+18004803
+204048c8
+20404426
+204049f0
+44a8400a
+6fe4003e
+1fe37e00
+20404a23
+204049ea
+7826fc00
+6fe4003e
+d84003bb
+9840b600
+37c18400
+1b420400
+604c009a
+7846fc00
+246c0000
+dd2003bb
+1c225000
+2035cae6
+20600000
+44a8c00a
+204044ec
+242c48f5
+204049ba
+c588c518
+6fe400f4
+1fe0fe01
+67e400f4
+1c230400
+18419c40
+44a9400a
+7823fc00
+78257c00
+7825fc00
+09800003
+198cfe00
+67e2015b
+09800004
+08008007
+19827e00
+67e20019
+09800003
+198cfe00
+67e2015c
+6fe20019
+1fe67c03
+2021452f
+c003c52f
+6fe2004c
+2feffe05
+7920aa01
+44a9c00a
+09800008
+7845fc00
+78457c00
+2023462d
+c588c538
+6fe400f6
+1fe0fe01
+67e400f6
+44aa400a
+6fe2015b
+2fe00e00
+7920800a
+2020c548
+a8800e00
+2020c547
+c583c649
+684200ae
+a8400e00
+2420c649
+6fe20047
+793ffe05
+79207e04
+67e20047
+7836fc00
+44aac00a
+6fe20019
+1fe20200
+c5054557
+6842015c
+6fe20047
+793ffe00
+284ffe00
+7920fe00
+284ffe01
+7920fe01
+67e20047
+284c0001
+2020c557
+20404683
+44ab400a
+d8400000
+20404a1b
+18217e0f
+c000c583
+c0004649
+c0014655
+6842015c
+6fe20047
+a8400800
+2420c565
+c5854564
+c303c565
+7920000f
+44abc00a
+18227e00
+c001c585
+c0024589
+c003c574
+c0044588
+d8400004
+20404a1b
+c0054584
+c005c587
+d8400008
+20404a1b
+c0074584
+c007c587
+20600000
+44ac400b
+7826fc00
+7824fc00
+78277c00
+d8a000cf
+1800721e
+09800008
+19897e00
+e7e20005
+c200457a
+c583c649
+09800010
+7d230008
+20234639
+2020461c
+20204649
+79200010
+78267c00
+2020458a
+79200010
+79202a02
+7826fc00
+44acc00b
+c500c649
+2aac0001
+2020c596
+7843fc00
+7826fc00
+78467c00
+1c409602
+34530400
+242c4639
+79200010
+7823fc00
+44ad400b
+78277c00
+7824fc00
+09800003
+198cfe00
+67e2017e
+09800005
+c50845a1
+19897200
+1f297200
+202045a4
+09800005
+19837200
+09800003
+44adc00b
+1f227e00
+67e4015d
+203a45e4
+9ea67c00
+20214639
+44ae400b
+793f8000
+6fe2017e
+1fe17e03
+d8a0054d
+c001c5b6
+c508c5e0
+6fe2017e
+1fe17e03
+c00145bb
+c000c5cf
+20204639
+6fe4015d
+1fe67c70
+24214639
+c507c61c
+202045e0
+44aec00b
+c507c61c
+6fe4015d
+d84002e0
+98467c00
+20214639
+6fe2025f
+c30045c5
+c300c5ca
+20204649
+70025d01
+6fe40259
+c0804649
+d8a01000
+202045e0
+70025d02
+6fe4025b
+c0804649
+d8a01400
+202045e0
+44af400b
+c507c61c
+6fe4015d
+d84002e0
+98467c00
+20214639
+6fe2025d
+c000c5d9
+c00145dd
+20204649
+d8a01000
+6fe40259
+98a08a00
+202045e0
+d8a01400
+6fe4025b
+98a08a00
+09800008
+19897e00
+e7e20005
+c20045e0
+44afc00b
+09800010
+20234633
+6fe24335
+c000c649
+c508c609
+c507c646
+6fe2017e
+2fe00603
+2020c609
+6fe4015d
+203a4609
+44b0400c
+6fe2025d
+c000c5f5
+c00145ff
+20204a8b
+6fe40259
+6844015d
+9840fe00
+67e40259
+c0004a8b
+68441000
+18408404
+98467c00
+2042c743
+20204609
+6fe4025b
+6844015d
+9840fe00
+67e4025b
+c0004a8b
+68441400
+18408404
+98467c00
+2042c747
+20204609
+44b0c00c
+6842004c
+6fe2017e
+2fe00603
+79208406
+7d208407
+6042004c
+2420c612
+79200001
+c588c61c
+284ffe06
+2020c61c
+6fe400f8
+1fe0fe01
+67e400f8
+79200005
+793f8407
+793f8001
+6042004c
+44b1400c
+6842015c
+6fe20047
+79207e05
+284ffe02
+7920fe02
+280ffe0a
+7920fe07
+67e20047
+6fe4015d
+243a4649
+6fe2004c
+793ffe07
+67e2004c
+6fe2017e
+2fe00e01
+20204649
+44b1c00c
+7856fc00
+6fe4001a
+1fe0fe01
+67e4001a
+20204649
+6fe4001c
+1fe0fe01
+67e4001c
+2040463a
+c588c639
+79200005
+20204649
+44b2400c
+6fe2017e
+2fe00603
+2420c642
+6842004c
+793f8406
+6042004c
+20600000
+6842004c
+793f8407
+6042004c
+20600000
+6fe20047
+79207e05
+67e20047
+44b2c00c
+784efc00
+784e7c00
+7846fc00
+78467c00
+7844fc00
+78477c00
+7843fc00
+2030c8f5
+37d38200
+20000064
+202048f5
+44b3400c
+7824fc00
+78267c00
+09800048
+2feffe3a
+79208000
+1c020400
+57e04000
+57e03c00
+782afc00
+380bffff
+380cffff
+20000020
+29a80000
+1d827e00
+67e60176
+1da27e00
+67e20179
+18424000
+2020c66a
+20204639
+44b3c00c
+09800048
+57e03e00
+57e00800
+57e05c00
+57e02400
+18007e00
+09800010
+20234639
+5ffffffc
+9a417e00
+67e80163
+1ba27e00
+67e60173
+1b827e00
+67e20171
+18827e00
+67e20172
+1dc27e00
+67e4017a
+1c227e00
+08008220
+28201e02
+7920800b
+20204649
+44b4400d
+6fe20047
+c4018000
+793ffe03
+79407e06
+67e20047
+6fe240c5
+c009c698
+c1038000
+6fe2004b
+c4030000
+793ffe06
+79207e07
+67e2004b
+793f8002
+6fe44218
+247a0000
+6fe2004b
+793ffe07
+67e2004b
+20205637
+44b4c00d
+6fe204b3
+1fe37e00
+c008c6b4
+c00946bc
+c00c46e5
+c03fc6a4
+c1818000
+6fe204b4
+c015c6ac
+c008c6a7
+20600000
+6fe204b4
+79207e07
+20600000
+20748000
+6fe20030
+c3820000
+70007c31
+20600000
+20748000
+6fe20031
+2feffe04
+2020c6b1
+20600000
+793ffe04
+67e20031
+20600000
+44b5400d
+6fe2004c
+79207e02
+67e2004c
+70801101
+6fe20030
+2feffe04
+20600000
+44b5c00d
+6fe2004c
+793ffe02
+67e2004c
+70801100
+20600000
+44b6400d
+1c427e00
+67e8420b
+1c40a203
+2034c6c8
+1d00a203
+68440032
+1a227e00
+793ffe1b
+9846fc00
+6fe40075
+20407d61
+18072600
+9a667e00
+202146d2
+9840fe00
+9a20fe00
+67e80034
+70452d00
+6fe20030
+79207e01
+67e20030
+6fe20073
+67e2008a
+58000000
+67e6416a
+67e6416d
+67e2415a
+700a950b
+20407bab
+6fe440c1
+67e4003e
+24748000
+18808fff
+20600000
+44b6c00d
+6fe20030
+c4008000
+793ffe01
+67e20030
+6fe440bf
+67e4003e
+7855fc00
+700a950c
+20207bab
+44b7400d
+78377c00
+6fe20030
+c280c6fc
+c6088000
+6fe20047
+c3818000
+6fe20048
+247a0000
+6fe2004b
+c3830000
+18007e00
+20600000
+c301470b
+6fe2008a
+c0014702
+6fe20047
+c281c714
+c5844714
+2434c714
+6fe20048
+243a4714
+6fe200ed
+1fe0ffff
+67e200ed
+243a46fa
+7000ed10
+20204714
+6fe2008a
+c080c714
+6fe2008b
+203a4714
+1fe0ffff
+67e2008b
+6fe20047
+c3818000
+24768000
+6fe2008a
+1fe0ffff
+67e2008a
+20600000
+44b7c00d
+78487c00
+18423600
+2040425c
+78547c00
+24628000
+18003600
+78347c00
+20600000
+6fe24159
+a881fe00
+20600000
+44b8400e
+793f8001
+70026600
+6fe2025f
+207a0000
+2feffe00
+d8c01000
+2040d153
+44b8c00e
+6fe20266
+c000c737
+70026600
+6fe2025f
+c4008000
+d8c01400
+20405153
+6fe20266
+c000c73d
+20600000
+6fe2025f
+793ffe00
+67e2025f
+58000000
+67e40259
+20600000
+6fe2025f
+793ffe01
+67e2025f
+58000000
+67e4025b
+20600000
+6fe2025f
+79207e00
+67e2025f
+20600000
+6fe2025f
+79207e01
+67e2025f
+20600000
+44b9400e
+1d00c201
+204048e6
+18004803
+204048ce
+20404a50
+20404a5e
+20204a63
+44b9c00e
+20404a4c
+1d027e00
+684840ca
+98467e00
+c1808000
+28203e00
+2420c75d
+6fe20019
+207a0000
+2040474b
+28203e10
+2020c649
+1c230400
+18419c40
+44ba400e
+7823fc00
+78257c00
+782dfc00
+793f8010
+18827e00
+08008603
+18227e00
+08008604
+6fe20047
+08008004
+08008603
+78247c00
+08008608
+784dfc00
+78447c00
+78457c00
+793faa02
+d8400000
+20404a1b
+44bac00e
+18217e1f
+c009c7b0
+c0004649
+c000c649
+c0014793
+c001c7c1
+c00247c7
+c003c788
+c00447c6
+d8400004
+20404a1b
+c00547c3
+c005c7c9
+d8400008
+20404a1b
+c007c7c9
+202047c3
+44bb400e
+782efc00
+7824fc00
+78277c00
+1800721e
+d8c000b1
+efe20006
+08008608
+c200478e
+c503c7f3
+20204649
+44bbc00e
+6fe2017f
+1fe20800
+6fe20090
+1fe23800
+6fe640aa
+1fe23a00
+6fe440a4
+1fe25c00
+7824fc00
+782e7c00
+1c022200
+204048de
+782afc00
+20000020
+1c221600
+6fe8015f
+1fe24200
+53c07e00
+79207e3a
+08008648
+53e07e00
+08008648
+19624200
+1a224000
+78247c00
+08008610
+78447c00
+20204649
+44bc400f
+78277c00
+7824fc00
+782e7c00
+6fe204b2
+1fe105f8
+d8c004b2
+18408408
+1840a7b8
+242147be
+eff20006
+08008648
+1a620400
+202047b8
+eff20006
+08418600
+202047f3
+782e7c00
+202047cc
+782e7c00
+79200010
+202047cc
+79202a02
+782efc00
+202047cc
+79202a02
+782efc00
+79200010
+44bcc00f
+6fe2004c
+c302c7e1
+18267c03
+202147e1
+78477c00
+784e7c00
+782efc00
+7843fc00
+79202a01
+2aaffe02
+2020c7db
+580abeee
+08008614
+202047df
+585faeba
+08008618
+58000012
+08008606
+7823fc00
+79200010
+78277c00
+7824fc00
+c502c7fc
+6fe241dc
+08008603
+6fe441dd
+98007200
+c50847eb
+08008605
+202047ec
+0800860d
+1f227e00
+203a47f3
+6fe4016d
+98000c00
+efe20006
+08008608
+c20047f0
+78247c00
+08008610
+78447c00
+204044bd
+6fe2004c
+c302c649
+18007e00
+08008606
+20204649
+44bd400f
+c5084804
+6fe2017e
+08008603
+6fe2015d
+98002600
+08008605
+20204809
+6fe2017e
+08008603
+6fe4015d
+98002600
+0800860d
+d8c0054d
+1a627c00
+2022c810
+efe20006
+08008608
+1a60a7ff
+2020480a
+6fe400fa
+1fe0fe01
+67e400fa
+202047f3
+6fe80163
+1fe0a207
+6fe4016f
+243a481a
+1a20a3fd
+20204822
+1feffe0c
+68448040
+18408401
+98467e00
+24214821
+1a20a3ff
+2020481d
+1fe67e00
+37d18200
+2c400600
+2420c822
+98005200
+1a225000
+98005200
+20600000
+44bdc00f
+37d10200
+1b427e00
+98000c00
+1ff17e00
+9c467200
+1f217203
+2422c833
+18007e00
+20204837
+d8400ea6
+18007e00
+9840fe00
+c2004835
+98c0fe00
+1fe6fc0c
+20407d61
+1807fe00
+67e4016f
+20600000
+44be400f
+1b427e00
+1b220400
+98467c00
+7d217e2c
+98460400
+58000ea6
+284c000f
+2020c848
+5fff0ea6
+98408400
+604c0443
+207b0000
+604c0038
+20600000
+78587c00
+6fec0443
+203b4850
+6fec0038
+9b20e000
+1e00e00a
+58000ea6
+9e067e00
+2fec000f
+2020c85a
+5800f15a
+9e00e000
+1e023400
+20600000
+18007c00
+20204858
+44bec00f
+20404915
+1c227e00
+1fe17f80
+2c800e03
+2420c865
+1fe97e00
+9ae0fe00
+20204866
+1ae27e00
+1fe6fc4f
+782afc00
+20407d61
+18072200
+1a2085d8
+2021486e
+1a238400
+20204870
+18438400
+18408401
+44bf400f
+6fe20031
+c301c881
+6fe840d2
+9c267c00
+20214881
+204048a0
+6fe240d9
+207a0000
+6fe20031
+79207e02
+67e20031
+6fea40e7
+67ea40da
+efea0006
+67ea40df
+204048a5
+6fe20031
+c4010000
+2c2ffe01
+2020c89d
+18492200
+18410e07
+580040da
+9a20a200
+efe20011
+afec0000
+2020c88e
+18427e00
+2020489a
+6fe240e4
+98002400
+1c227e00
+1fe17f80
+1fe97e00
+9ae0fe00
+9a46fc00
+580040f2
+20407d61
+18072200
+9a208c00
+efe20006
+67e240e5
+98000400
+20600000
+6fe240e5
+98000400
+20600000
+6fe20031
+793ffe02
+793ffe03
+67e20031
+20600000
+44bfc00f
+d8a040f2
+1800720a
+20407ca1
+d8a040f2
+18002600
+18000e02
+6fea40da
+98000400
+28e1fe02
+2020c8b1
+18430400
+284c0000
+2020c8b5
+1a627e00
+e7e20005
+184b0400
+1a60a602
+2a61fc28
+2420c8be
+6fea40df
+98000400
+28e1fe02
+2020c8be
+18430400
+1a667c4e
+202148b1
+18002601
+18e08fff
+2422c8ac
+da2040f2
+18a27e00
+9a267e00
+67e240e4
+20600000
+44c04010
+2040485c
+6fe2017d
+c302c8cd
+684204c8
+2020491c
+44c0c010
+2040485c
+6fe2017d
+c30248d3
+684204c7
+20204930
+18005a00
+6fe640a7
+98005800
+20600000
+44c14010
+6fe241d4
+1fe25a00
+6fe641d1
+1fe25800
+20600000
+44c1c010
+6fe440a4
+1fe25c00
+6fe240a3
+1fe25a00
+6fe640a0
+1fe25800
+20600000
+44c24010
+6fe40044
+1fe25c00
+6fe20043
+1fe25a00
+6fe60040
+1fe25800
+20600000
+c51048f1
+c68e8000
+c68f8000
+1d815900
+782afc00
+20000020
+20600000
+44c2c010
+2030c906
+708955d4
+20000004
+708955d2
+20000004
+708955d1
+20000004
+6fe241df
+c0004904
+c000c912
+c0014904
+c001c912
+c0024912
+c0104912
+708955d0
+708956e0
+18002a08
+18002a00
+7850fc00
+78507c00
+782f7c00
+70890200
+70890100
+70890000
+70890300
+70890470
+70890600
+20600000
+708955d0
+708956c0
+20204906
+44c34010
+70890200
+70890100
+70890018
+708903a7
+7089047f
+20600000
+44c3c010
+60420017
+1840a204
+70896d07
+20204980
+44c44011
+708901cf
+2000000a
+708900ff
+708903af
+708904ff
+2000000a
+708902a0
+20600000
+6fe241e1
+203a492e
+1840a202
+20600000
+1840a200
+20600000
+44c4c011
+60420017
+2040492a
+20404980
+58000500
+20404a8e
+70890601
+7089003c
+708901e0
+70896d12
+2000000a
+70890201
+7089023d
+2000000a
+708903b7
+2000000a
+7089027f
+6fe241df
+c0004948
+c000c94c
+c0014950
+c001c954
+c0024958
+c010495c
+708956f0
+20404962
+708955d8
+20600000
+708956df
+20404962
+708955df
+20600000
+708956ff
+20404962
+708955df
+20600000
+708956ce
+20404962
+708955d8
+20600000
+708956cb
+20404962
+708955d8
+20600000
+708955d0
+708956c0
+7089574c
+7089586c
+70895950
+20600000
+20000004
+708955d1
+20000004
+708955d2
+20000004
+708955d4
+20000004
+20600000
+70804206
+2455e7bc
+6fe440c3
+c307496c
+98000c00
+d8408900
+efe20006
+c07fc976
+98418a00
+efe20006
+e7e20005
+20204970
+44c54011
+20404bba
+204049c8
+580007d0
+9c40fe00
+67e80167
+79202a03
+18002a00
+2455c997
+202049aa
+44c5c011
+58000960
+9a208400
+6fe240bd
+70895f04
+984ffe00
+684240be
+9846fc00
+20407d61
+1807a200
+18077e00
+1ff07e00
+1ff27e00
+9846fc00
+20407d61
+1807fe00
+1fed7e00
+1fe3fe00
+9a21fe00
+67e88960
+70895f44
+70895fc4
+20600000
+44c64011
+70890602
+5803d090
+20404a8e
+7089007f
+20000082
+70895230
+708901d0
+70895270
+708952f0
+18007232
+6fe28990
+c282c9a5
+c20049a2
+67e240ce
+70890100
+70890000
+70890600
+20600000
+44c6c011
+6fe240ce
+79207e05
+67e28952
+68428950
+18410407
+1fe9fe00
+9841fe00
+67e28950
+6fe28951
+793ffe00
+67e28951
+6fe28952
+793ffe05
+67e28952
+20600000
+44c74011
+6fe48991
+1ff1fe00
+1fe97e00
+1fe67e00
+1fe17eff
+1fe6fc0a
+20407d61
+1807fe00
+1ff27e00
+18070400
+9841fe00
+67e20018
+20600000
+70804206
+6fe2896b
+793ffe04
+793ffe05
+67e2896b
+70890500
+70890400
+70890470
+708905ff
+6fe2896b
+79207e04
+79207e05
+67e2896b
+204049e8
+6fe28968
+79207e07
+67e28968
+793ffe07
+67e28968
+79207e07
+67e28968
+70804205
+20000001
+70804204
+6fe2896b
+1fe17ecf
+67e2896b
+1fe1fe30
+67e2896b
+20600000
+58000f0f
+20204bd2
+5800080f
+20204bd2
+44c7c011
+20404921
+78507c00
+7830fc00
+782b7c00
+20600000
+44c84012
+6fe2004c
+2feffe02
+7920fe00
+67e28011
+d8c00062
+eff20006
+98006400
+efee0006
+98006600
+6fe20054
+1fe0e9ff
+782d7c00
+20600000
+1b427e00
+67ec009a
+7846fc00
+242c48f5
+dd2003bb
+1d00d001
+1d0151fc
+20600000
+7826fc00
+37cb8400
+202c49fe
+2d000402
+2420ca07
+202049fe
+44c8c012
+d9600600
+7826fc00
+34730400
+7846fc00
+242c48f5
+20600000
+44c94012
+7826fc00
+37c18400
+7846fc00
+242c48f5
+dd2003bb
+1d0151fc
+20600000
+44c9c012
+98002200
+1c227e00
+98409600
+19627e00
+67e840ca
+1a227e00
+20600000
+1fe20400
+44ca4012
+18427e00
+20407d2b
+1c307e00
+79207e2c
+20407d14
+793ffe2c
+20404a76
+20407d14
+20740000
+20407d1e
+98003600
+37c18200
+20600000
+44cac012
+20384a37
+35330200
+1d020400
+20204a3a
+20374a39
+34730200
+1c420400
+20344a46
+28400601
+2420ca32
+44cb4012
+6fe20030
+c4000000
+6fe840ca
+98467e00
+24610000
+1fe67cff
+20214a32
+20600000
+28400603
+2420ca32
+20204a3d
+44cbc012
+d9600600
+20204a32
+78547c00
+20204a49
+78347c00
+20204a49
+44cc4013
+204049f0
+7850fc00
+78307c00
+20600000
+44ccc013
+d9600e43
+34730200
+782b7c00
+20600000
+44cd4013
+d9600d00
+34730200
+20600000
+44cdc013
+d9600e43
+35330200
+782b7c00
+20600000
+44ce4013
+51207e00
+782efc00
+79202a00
+08008648
+784efc00
+20600000
+1ca20400
+18418460
+18421c00
+20600000
+44cec013
+6fe24090
+1fe0fe01
+c083ca73
+18007e01
+67e24090
+98000800
+20600000
+1b220400
+20748000
+1b420400
+20600000
+1c427e00
+20748000
+1d027e00
+20600000
+44cf4013
+6848004d
+20404a7a
+98461600
+19627e00
+68440051
+18438400
+98467e00
+20600000
+44cfc013
+20404a7a
+67e8004d
+20600000
+44d04014
+20204a8b
+20204a8d
+207a0000
+1fe37e00
+1fe0fffd
+1fe0ffff
+2422ca91
+18007e00
+20600000
+df200010
+d8a00000
+20407ca1
+d8a0043b
+df20000a
+20407ca1
+7009ae00
+700a9500
+70048800
+70017d00
+7004cd00
+44d0c014
+70016b00
+70014f00
+70015a00
+589e8b33
+67e640a7
+58000153
+67e40083
+7000851e
+70008601
+70008807
+5812e904
+67e60080
+70009060
+7040d005
+70001402
+6fe2462c
+245a7376
+6fe24490
+245a73cd
+44d14014
+20758000
+58000000
+67e441dd
+1c437e00
+67e84094
+20600000
+6fe88124
+2feffe13
+c30bcac2
+2420fd74
+d85fffff
+1ce27e00
+203a4b18
+79207e17
+79207e14
+79207e15
+67e8804c
+37d98200
+37d98200
+20404bdd
+6fe2804e
+79207e06
+67e2804e
+20404bdd
+2020fd74
+7835fc00
+70804301
+6ff04191
+98000000
+6fec8130
+67ec00a1
+20600000
+18027e00
+67f04191
+20204be3
+68428042
+18417ef0
+243a4ae1
+6fe64170
+247a0000
+18417e0f
+1fe1fec0
+67e28042
+70800a80
+6fe28108
+c4000000
+6fe6810a
+67e64170
+20600000
+44d1c014
+1b427e00
+20407d12
+68484160
+18467cff
+20610000
+1fed7e00
+1ff27e00
+9846fc00
+20407d61
+1807fe00
+d84000c8
+20407d6c
+67e20099
+24344af6
+1fe67e00
+68464170
+9840fe00
+67e64170
+58000000
+67e84160
+20600000
+6fe24158
+20204aff
+6fe24157
+67e2417c
+44d24014
+20404be3
+d85fffff
+6fe24177
+793ffe07
+67e24177
+44d2c014
+204049e6
+6fe84160
+9840fe00
+67e84160
+20404ad5
+6fe64179
+67e6804c
+ea220006
+6fe28127
+e7e20005
+37d98200
+632c4164
+70800502
+37d98200
+37d98200
+6222804e
+70800502
+37d98200
+37d98200
+6048804c
+70800510
+37df8200
+44d34014
+58000000
+1ce27c00
+2022cb28
+6fe28124
+68428125
+98467c00
+20214b26
+18427e00
+9ce67e00
+1fe0fe01
+1fe0fe08
+37d98200
+9e20fe00
+6848415c
+9840fe00
+68464170
+984ffe00
+1fecfe00
+1ff1fe00
+1fe0fe6e
+d8400ea6
+9846fc00
+20407d61
+1807fe00
+1ff07e00
+18070400
+9841fe00
+684c4164
+20407d07
+18423200
+6fec4048
+20404850
+20600000
+44d3c014
+20404ad8
+6fe64170
+207a0000
+6fe24091
+207a0000
+6fe2462c
+203a4b49
+6fe24583
+207a0000
+6fe24492
+247a0000
+20404bf4
+247a0000
+6fe24040
+2fe00e03
+2420cb72
+6fe44042
+207a0000
+20758000
+44d44015
+684200a0
+6fe44042
+984ffe00
+18518400
+184b0400
+98467e00
+68484044
+9840fe00
+68424156
+98467e00
+1ff06000
+44d4c015
+6fe4404e
+1fe37e00
+20407d2b
+1e027e00
+20407d14
+1b420400
+20407d12
+20740000
+20407d24
+44d54015
+6fe24179
+98467c00
+20214af9
+6048415c
+20404cc1
+204056d5
+6848415c
+20204b06
+44d5c015
+6fe24040
+c3800000
+c3818000
+6fe2462c
+203a4b7a
+6fe24583
+207a0000
+44d64015
+6fe24340
+243a4b7f
+6fe24093
+207a0000
+6fe44154
+207a0000
+68424156
+98467e00
+d8401d4c
+984ffe00
+20204b68
+44d6c015
+7855fc00
+6fe20030
+c4008000
+2436cba5
+20404ba0
+6fe440c1
+67e4003e
+6fe20047
+c281cbb3
+c586cbb3
+2040564e
+243a4bb3
+6fe2452e
+c280cbb3
+7000a000
+c586cbb3
+6fe24175
+203a4bb7
+1fe0ffff
+67e24175
+20600000
+d8e00001
+202064af
+d8e00001
+202064b3
+70415a00
+6fe6416a
+1fe0fe01
+67e6416a
+20600000
+44d74015
+684440c1
+18430400
+6fe4003e
+9840fe00
+67e4003e
+7000a000
+6fe6416d
+1fe0fe01
+67e6416d
+6fe2415a
+1fe0fe01
+67e2415a
+20600000
+7000a000
+6fe24174
+67e24175
+20600000
+68424173
+604200a0
+20600000
+44d7c015
+6fe24179
+247a0000
+70804206
+58000f0c
+20404bd2
+58030d40
+20404a8e
+37d98200
+1e226000
+204049e6
+70804204
+2000000a
+37d98200
+1e227e00
+9e067e00
+1fe0fe30
+d84000ff
+20407d6c
+67e24179
+20007530
+20007530
+20007530
+20600000
+d8a00fff
+98a10a00
+6fe24176
+1fe17ef0
+1fed7e00
+98a1fe00
+67e4804c
+efe40006
+e7e40005
+58000001
+20204bde
+58000002
+67e28005
+37d98200
+37d98200
+37d98200
+20600000
+44d84016
+6fe800a1
+67e8804c
+58000004
+20404bde
+efe40006
+67e8804c
+58000008
+20204bde
+6fe44152
+f9207e00
+67e44152
+20600000
+6fe44152
+f93ffe00
+67e44152
+20600000
+44d8c016
+20404cbf
+6fe44152
+1fe22200
+6fe2004c
+2feffe06
+7920a20b
+6fe20078
+6842007c
+9840fe00
+68420048
+9840fe00
+7d3a220a
+6fe244d1
+7d3a2201
+6fe40259
+6844025b
+9840fe00
+7d3a220d
+6ff0463a
+7d3a220f
+6ff04642
+7d3a220e
+6fe44ff4
+68444ff6
+98467c00
+7d22a205
+6fe44ffc
+68444ffe
+98467c00
+7d22a206
+6fe28043
+2feffe07
+7920a202
+6fe241cf
+7d3a2208
+1a227e00
+67e44152
+20600000
+6fe8811c
+793ffe1b
+67e8804c
+20404bdb
+20204a8b
+6fe88124
+793ffe14
+67e8804c
+20204bdd
+6fe44150
+c2804a8b
+20600000
+6fe44150
+c280ca8b
+20600000
+6fe44150
+c2814a8b
+20600000
+58004c35
+67e441f2
+58004c64
+67e441f6
+58004c35
+67e441f4
+20758000
+20600000
+6fe20030
+c300cc3b
+7920000d
+6fec416a
+67ec44e8
+20600000
+6fe2014f
+c4010000
+6fe2015a
+1fe0fe01
+67e2015a
+c1828000
+70015a00
+6fe2014f
+793ffe02
+67e2014f
+c281cc5c
+2feffe07
+2040fd88
+2440fd8c
+6fe20156
+2fe06020
+6fe2004c
+7920fe05
+67e2004c
+6fe2014f
+6842017d
+2feffe04
+79208406
+2feffe06
+79208404
+79208405
+6042017d
+6fe20152
+67e204c7
+6fe20153
+67e204c8
+79200011
+20600000
+793f8011
+70014f00
+6fe20159
+67e2017d
+6fe28043
+1fe17efb
+67e28043
+20600000
+1a627e00
+c1880000
+20600000
+c000cc66
+20204afe
+18000402
+184085fe
+20404915
+20404930
+7843fc00
+782efc00
+79202a00
+20404a50
+6fe20000
+08008608
+20204c71
+6fe28108
+c3014c74
+20600000
+44d94016
+6fe24092
+203a4c77
+c0054d95
+20600000
+44d9c016
+70014f00
+70017d00
+70017e00
+58000000
+67ea09aa
+6fe24092
+203a4c7c
+c0054dba
+20600000
+20407b84
+20407bc1
+20404c8f
+6fe441f4
+20207d77
+6fe441f2
+20207d77
+6fe441f0
+20207d77
+44da4016
+da20463a
+20407d9c
+207a0000
+1fe22600
+20404c98
+20204cbd
+da600000
+20600000
+c000ccaa
+c0084cf0
+c002ccce
+c0094cd5
+c0034cec
+c0024d1f
+c0014d24
+c009cd1f
+c00a4ce4
+c00acce8
+c001ccc7
+c005ccd9
+c0064ce0
+c00b4cf4
+c00c4cc3
+c0154cb3
+c015ccb1
+20600000
+6fe44652
+79207e00
+67e44652
+6fe44209
+793ffe00
+67e44209
+20600000
+70022700
+20600000
+6fe20227
+1fe0fe01
+67e20227
+1fe67c01
+20214d5a
+70022700
+6fe44209
+79207e09
+67e44209
+20204d64
+6fe441f6
+20207d77
+6fe441ea
+20207d77
+6fe441ee
+20207d77
+6fe44209
+79207e01
+67e44209
+20204d8d
+6fe44652
+79207e07
+67e44652
+6fe44209
+79207e02
+67e44209
+20600000
+6fe44652
+79207e01
+67e44652
+6fe44209
+79207e04
+67e44209
+20600000
+6fe44652
+79207e03
+67e44652
+20600000
+6fe44652
+79207e05
+67e44652
+6fe44209
+79207e03
+67e44209
+20600000
+6fe44652
+793ffe05
+67e44652
+20600000
+6fe44652
+79207e09
+67e44652
+20600000
+6fe44652
+793ffe09
+67e44652
+20204d93
+6fe44652
+79207e02
+67e44652
+20600000
+6fe44209
+79207e00
+67e44209
+20600000
+6fe44209
+79207e08
+67e44209
+20204d64
+44dac016
+67e20228
+6fe20228
+207a0000
+1fe0ffff
+67e20228
+20404d51
+20404d12
+20404d18
+6fe441fe
+20407d77
+20204cfa
+efe20013
+207a0000
+1fe0ffff
+e7e20013
+247a0000
+1a427e00
+20207d77
+efe40013
+207a0000
+1fe0ffff
+e7e40013
+247a0000
+1a427e00
+20207d77
+da604204
+da404d15
+20204d04
+2040424e
+2022cd89
+20600000
+da60464e
+da404d1b
+20204d0b
+20404d6b
+20404d83
+6fe441f8
+20207d77
+20404d37
+6fe44652
+793ffe07
+67e44652
+20600000
+70420400
+6fe44652
+c283cd29
+2fec0001
+2040cc96
+44db4016
+6fe44652
+793ffe00
+793ffe01
+793ffe02
+793ffe03
+793ffe07
+67e44652
+20204d93
+20404d34
+20204d85
+58000000
+67e44207
+20600000
+58000000
+67e44209
+20600000
+6fe44209
+67e44207
+58000000
+67e44209
+20600000
+6fe44209
+79207e07
+67e44207
+58000000
+67e44209
+20600000
+6fe24652
+2feffe05
+20600000
+6fe2452c
+67e24204
+20600000
+d8e00009
+20204bec
+d8e00009
+20204bf0
+70420505
+20204d4b
+da604205
+da404d4d
+20204d04
+70433501
+20600000
+70433500
+20600000
+700a950a
+20207bb4
+700a951d
+20207bb4
+44dbc016
+6fe24206
+67e2016b
+70022601
+700a9503
+20207bb4
+700a951e
+20207bb4
+700a9504
+20207bb4
+6fe44655
+67e4464e
+20404d7f
+700a9501
+20207bb4
+58000000
+67e4464e
+700a9502
+20207bb4
+700a950f
+20207bb4
+700a9510
+20207bb4
+700a950e
+20207bb4
+700a950d
+20207bb4
+700a9517
+20207bb4
+700a9518
+20207bb4
+700a9516
+20207bb4
+700a9511
+20207bb4
+700a9515
+20207bb4
+700a9514
+20207bb4
+700a9513
+20207bb4
+700a9519
+20207bb4
+700a9506
+20207bb4
+700a9505
+20207bb4
+700a951f
+20207bb4
+700a9520
+20207bb4
+700a9525
+20207bb4
+7920000d
+20600000
+793f800d
+20600000
+20758000
+20405b83
+58004dda
+67e441f4
+58004dc5
+67e441f2
+58004dde
+67e441f6
+58004dc4
+67e441f0
+58004dbd
+67e441ea
+58004ef4
+67e441fc
+58005037
+67e44541
+580050ae
+67e441fa
+580050c3
+67e441fe
+20404dd7
+44dc4017
+20404daf
+20404dbc
+20404c2a
+2020504d
+6fe44ffa
+67e48046
+6fe44ff8
+67e48044
+1fe20600
+6fe44ff2
+67e4804a
+6fe44ff0
+67e48048
+1fe21400
+20600000
+20404daf
+20204dd7
+20600000
+6fe24fef
+c000cd4b
+6fe24496
+c0804dc2
+20204d4d
+c07fcd4d
+20204d4b
+20600000
+20404dc7
+202050d3
+20600000
+6fe24652
+c3024dd7
+44dcc017
+58003eff
+6848467f
+98408400
+1c427e00
+98467c00
+24610000
+6fe44652
+c282cdd7
+6fe24679
+c3830000
+204050d6
+20404d89
+1c427e00
+67e8467f
+20600000
+204050d3
+20405648
+247a0000
+20204e3d
+1a627e00
+c000ce2c
+c0014dfb
+c0024e2f
+c002ce1d
+c0044e02
+c004ce08
+c0054e22
+c005ce0d
+c0064e1b
+c009ce2f
+c00a4e28
+c00ace1f
+c010ce23
+c011ce24
+c0124e27
+c0185088
+c018d08a
+c0195098
+c019d096
+c01a5082
+c01ad078
+c01b5080
+c01bd08c
+c01c508e
+c01dd09f
+c01ed06f
+c020ce30
+20600000
+20404dd7
+6fe24637
+245a508c
+20404e2f
+6fe44652
+c4020000
+20204e08
+6fe44652
+79207e04
+67e44652
+6fe2466d
+67e24173
+20205022
+6fe44652
+c4020000
+793ffe04
+67e44652
+20205026
+20404dd7
+6fe44042
+1fe37e00
+684441e4
+98467c00
+2422ce14
+20204d91
+6fe24679
+c3828000
+6fe44ffc
+68444ffe
+98467c00
+2442d0da
+20204d87
+204050d8
+20204d93
+20404dd7
+20204e32
+20405bf6
+20404e2f
+20205028
+20204d58
+202050d8
+6fe24679
+c302cd89
+202050dc
+202050dc
+20404e32
+6fe2466e
+67e24173
+20205024
+70463300
+204050d8
+202050dc
+20204e8f
+204060aa
+20205ee2
+20204e33
+6fe2466c
+2feffe00
+2040cd6b
+6fe2466c
+2feffe01
+2040cd73
+20600000
+6fe2453d
+c1000000
+20206ae9
+6fe44ffc
+68444ffe
+98467c00
+2022ce3a
+204067f7
+efe20003
+c080ce4e
+efe20003
+67e20aff
+e8420003
+18622200
+60420b00
+700b0101
+20404e5a
+6fe20b01
+c1000000
+20204e55
+20407c9c
+2040507e
+20204e51
+44dd4017
+6fe44ffe
+67e44ffc
+20600000
+204067f7
+18608602
+efe20003
+98608600
+202067f3
+44ddc017
+6fe20aff
+c0004e7c
+c000ce81
+c0014e86
+c001ce9c
+c0024ea8
+c002ceb2
+c004ced7
+c005cf14
+c0064f15
+c006cf29
+c0084f31
+c008cf39
+c0094f3d
+c0134f41
+c0144f48
+c014cf58
+c0154f61
+c0184f94
+c019cf9a
+c01a4fbd
+c01acfc6
+c01b4fcf
+c01bcfd9
+c01c4fdc
+c0214fe4
+c0244fe9
+c024cff4
+c028cffa
+c030cffd
+c07fd00c
+c077500f
+2020501c
+6fe20b00
+c083501c
+efec0003
+67ec40a0
+2020501f
+6fe20b00
+c083501c
+efec0003
+67ec4472
+2020501f
+6fe20b00
+c080d01c
+1a220600
+2040501f
+e8420003
+6042466f
+6fe44652
+c3848000
+c3800000
+6fe2466c
+2feffe00
+2420ce95
+6842466f
+18417e03
+67e24093
+6fe2466c
+2feffe01
+24608000
+6842466f
+284ffe02
+2020cd75
+20204d73
+6fe20b00
+1fe67c43
+2421501c
+67e244e7
+df200008
+20407ca1
+6fe20b00
+1fe27200
+1a220600
+d8a044e8
+204067da
+2020501f
+6fe20b00
+1fe67c1d
+2421501c
+67e24381
+1fe27200
+1a220600
+d8a04382
+204067da
+20405b83
+2020501f
+6fe24652
+c302501c
+20404d45
+2020cec3
+700b0100
+20404dd7
+6fe2453a
+207a0000
+6fe44545
+c0804ec1
+6fe20b00
+67e44545
+1a220600
+18627e00
+67e44543
+20404ec5
+20206b0c
+700b0100
+202050bd
+20404ecb
+6fe44545
+6844466a
+98467e00
+67e44545
+20600000
+6fe44545
+d84000e6
+20407db5
+6844453e
+20407db5
+68444530
+20407db5
+67e4466a
+20600000
+700b0101
+700aff05
+2020501f
+6fe44652
+c304d01c
+20404f11
+2034501c
+700b0100
+6fe24679
+c2824ef1
+6fe2467a
+247a0000
+700b0101
+efe40003
+67e4467b
+18627e00
+67e4467d
+6fe20b00
+1fe0fffe
+2421501c
+2022d01c
+67e2467a
+700b0100
+20405bf4
+20404ef4
+20404ef4
+20404ef4
+6fe24679
+c4020000
+700b0101
+204050e0
+2020501f
+6fe2467a
+207a0000
+20405c72
+247a0000
+20404f0c
+44de4017
+1840fffd
+6842467a
+20407db5
+1fe22200
+18427e00
+9a267e00
+67e2467a
+6844467b
+20405e44
+6fe4467d
+1fe20600
+1a227200
+204067da
+18627e00
+67e4467d
+6fe2467a
+247a0000
+202050de
+d8400017
+6fe24679
+c3808000
+6844447a
+20600000
+6fe24679
+c2815e22
+20207dc1
+20205051
+1a220600
+efe20003
+c0004f1c
+c000cf1f
+c0014f25
+c001cf27
+2020501c
+2040650d
+70462c00
+2020501f
+58040003
+67e6462d
+67e24634
+20406506
+70462c01
+2020501f
+58040002
+20204f20
+58040001
+20204f20
+6fe20b00
+1fe67c10
+2421501c
+67e24657
+1fe27200
+d8a04658
+204067ed
+2020501f
+da200002
+da404668
+d8400000
+2020502a
+67e40abe
+da400abe
+d8400000
+2020502a
+6fe44652
+c300501c
+2040501f
+20204d64
+6fe44652
+c304d01c
+2040501f
+20204d7d
+6fe20b00
+1fe27200
+1a220600
+6fe44214
+1fe20a00
+204067da
+2020501f
+6fe24652
+c300501c
+efe20003
+68424633
+793a0400
+79200407
+60424633
+2040501f
+6fe24633
+c2834f56
+20600000
+70463300
+700a9521
+20207bb4
+c2806377
+20204f53
+6fe24652
+c4020000
+6fe2453d
+c1000000
+efe20003
+6842453b
+98408400
+6042453b
+20600000
+df200040
+d8a04341
+20407caf
+58000000
+67e20aae
+1a220600
+18627e00
+67e40ab2
+20404f8f
+6fe20aae
+68420a9e
+18408401
+9840fe00
+67e20aae
+1fe67c1f
+24214f7b
+68424341
+58004342
+9840fe00
+67e40ab7
+68420a9e
+18408401
+6fe24341
+9840fe00
+67e24341
+20204f84
+68424361
+58004362
+9840fe00
+67e40ab7
+68420a9e
+18408401
+6fe24361
+9840fe00
+67e24361
+6fe40ab7
+1fe20a00
+6fe40ab2
+1fe20600
+18427200
+204067da
+6fe20b00
+68420aae
+98467c00
+2422cf67
+2020501f
+efe20003
+67e20a9e
+efe20003
+67e20aaa
+20600000
+efe80003
+67e84658
+70465704
+70463500
+2040501f
+20206313
+1a220600
+efe20003
+1fe20400
+c040cfa5
+c0414faa
+c041cfb0
+67e24498
+c0004fb5
+c000cfb8
+c0014fba
+2020501c
+6fe24490
+203a501c
+60424498
+7044280d
+20204fb6
+6fe24490
+203a501c
+60424498
+7044280d
+70442601
+2020501f
+6fe24490
+203a501c
+60424498
+7044280d
+20204fbb
+70442800
+70442603
+2020501f
+70442805
+20204fb6
+70442805
+70442600
+2020501f
+6fe20b00
+1fe67c1f
+2421501c
+67e24341
+1fe27200
+1a220600
+d8a04342
+204067da
+2020501f
+6fe20b00
+1fe67c1f
+2421501c
+67e24361
+1fe27200
+1a220600
+d8a04362
+204067da
+2020501f
+6fe44652
+c304d01c
+6fe20b00
+c084501c
+1a220600
+eff00003
+67f04468
+700a9512
+20407bb4
+2020501f
+efe40003
+67e44454
+2020501f
+6fe24498
+203a501c
+6fe24496
+c080501c
+6fe24497
+c080501c
+20407c3d
+2020501f
+6fe20b00
+c080d01c
+efe20003
+67e241df
+2020501f
+efe20003
+c000cff2
+6fe24493
+c001cff0
+c0034ff0
+c003cff0
+2020501c
+70449401
+2020501f
+20405f33
+2020501f
+6fe20b00
+c080d01c
+2040501f
+efe20003
+203a64ad
+202064ab
+2040501f
+70801001
+20204a8d
+6fe20b00
+c000501c
+efe20003
+203a500a
+6fe20b00
+c082d01c
+efe80003
+d84f4240
+98467c00
+2021501c
+67e84499
+20405bec
+2020501f
+20405bee
+2020501f
+efe20003
+67e24091
+2020501f
+6fe20b00
+204050a5
+6fe20b00
+1fe27200
+1a220600
+20405016
+202067b9
+1f227e00
+207a0000
+efe20003
+e7e2000a
+c2005018
+20600000
+d8400001
+da200000
+2020502a
+d8400000
+da200000
+2020502a
+700aff00
+2020504e
+700aff02
+2020504e
+700aff03
+2020504e
+700aff05
+2020504e
+6fe20aff
+1fe22600
+700aff06
+58000002
+9a20fe00
+204050a5
+1a627e00
+e7e2000a
+e042000a
+1a227200
+1a420c00
+204067d4
+202067b9
+20404dd7
+700aff07
+6fe204fb
+207a0000
+204050a5
+6fe204fb
+1fe27200
+6fe404fd
+1fe20c00
+204067c1
+202067b9
+700aff08
+6fe24670
+1fe27200
+1fe0fe02
+204050a5
+6fe44673
+e7e4000a
+6fe44671
+1fe20c00
+204067c1
+202067b9
+700aff09
+58000000
+204050a5
+202067b9
+700aff0a
+58000001
+204050a5
+20405062
+6fe44652
+d8e00002
+afefffff
+79208403
+d8e00009
+afefffff
+79208405
+6fe24652
+d8e00004
+afefffff
+79208404
+e042000a
+202067b9
+d8400000
+6fe24093
+d8e00000
+afefffff
+79208400
+d8e00001
+afefffff
+79208401
+6fe24340
+d8e00000
+afefffff
+79208402
+20600000
+700aff0d
+6fe24216
+1feffe22
+1fe27200
+204050a5
+6fe44214
+1fe20c00
+204067c1
+202067b9
+700aff0e
+58000004
+204050a5
+6fe809b6
+e7e8000a
+202067b9
+700aff0f
+2020504e
+700aff10
+2020504e
+700aff11
+58000004
+204050a5
+6fe84499
+e7e8000a
+202067b9
+da200180
+2020508f
+da200080
+2020508f
+da200101
+2020508f
+da200001
+70463300
+700aff14
+58000002
+204050a5
+1a227e00
+e7e4000a
+202067b9
+da600000
+20205099
+da600001
+700aff15
+58000001
+204050a5
+1a627e00
+e7e2000a
+202067b9
+700aff1d
+58000004
+204050a5
+6fe809b6
+e7e8000a
+202067b9
+700afe02
+67e20b00
+60500a9e
+44dec017
+68500a9e
+204067b5
+6fe60afe
+e7e6000a
+20600000
+20404f11
+20740000
+1a227e00
+67e44671
+1a427e00
+67e24670
+6fe40474
+68444675
+98467c00
+2022d0bb
+68444677
+98467c00
+24628000
+67e44673
+20205042
+6fe24679
+c3828000
+204050da
+20204d87
+70417302
+20600000
+20600000
+204050cb
+d8400200
+98467c00
+20600000
+9a267e00
+1fe67e00
+20600000
+68444ff0
+6fe44ff2
+98462200
+68444ff4
+6fe44ff6
+98467e00
+244150c8
+20600000
+204050c4
+20214d54
+20204d56
+d8e00006
+202050e6
+d8e00006
+202050e2
+d8e00005
+202050e6
+d8e00005
+202050e2
+d8e00004
+202050e6
+d8e00004
+202050e2
+6fe24679
+f93ffe00
+67e24679
+20600000
+6fe24679
+f9207e00
+67e24679
+20600000
+7041cf00
+20600000
+6fec41d1
+684c0040
+98467c00
+20600000
+6fe2004b
+c28150f5
+204066d1
+70007c08
+202050ea
+793ffe02
+67e2004b
+204063e3
+58000000
+7934fe01
+67e2007f
+202050ea
+20600000
+70007c17
+d8a004d5
+58000000
+2d0ffe1b
+7920fe01
+e7e20005
+58000000
+e7e40005
+6fe441e4
+e7e40005
+6fe241e6
+e7e40005
+6fe241e8
+e7e40005
+202050ea
+70007c18
+202050ea
+44df4017
+6fe40260
+1fe20c00
+efe20006
+1fe1040f
+1ff1fe00
+c004d12d
+c003d12d
+c0055139
+c002d125
+c000d11a
+20600000
+18427e00
+c002d11e
+c001d124
+20600000
+700a9527
+20407bab
+6fe24092
+c4030000
+18427e00
+20600000
+20600000
+20405139
+da200001
+2040513d
+6fe4421e
+e7e40005
+58000000
+e7e20005
+20600000
+da200001
+2040513d
+6fe4421e
+e7e40005
+58000000
+e7e20005
+700a8a01
+6fe24224
+79207e06
+67e24224
+700a9512
+20207bab
+efe20006
+c000d13c
+20600000
+20600000
+2040561a
+1a220400
+60420a8a
+1fe20a00
+1a227e00
+e7e40005
+20600000
+2035d149
+58004337
+d8a04218
+98a67200
+20407caf
+44dfc017
+5800054d
+d8a0050d
+98a67200
+20407caf
+580002c5
+d8a00259
+98a67200
+20407caf
+202056f2
+44e04018
+18c20400
+18420c00
+efe40006
+67e40262
+efe40006
+67e40264
+18c27e00
+67e40260
+6fe24651
+c000515f
+202054c9
+6fe40262
+203a51d6
+44e0c018
+6fe20264
+c000d177
+c02851ba
+c028d1cf
+c02951cd
+c029d1cd
+202051d6
+44e14018
+20405658
+6fe24228
+c0005175
+c000d175
+c0015175
+c001d175
+c040d175
+c0605175
+c0405175
+c0205175
+20600000
+58000000
+20600000
+20405169
+247a0000
+20405692
+204051db
+6844026b
+203a51d5
+2040569b
+6fe4026b
+e7e40005
+18007e01
+e7e40005
+202051d6
+6fe24336
+207a0000
+1fe22200
+44e1c018
+6fe802d1
+d8400100
+98408400
+1c427e00
+98467c00
+24610000
+70433600
+1a227e00
+c0285191
+20204a8b
+d9000000
+20405692
+20405254
+2040569d
+20407c83
+20405287
+2040569b
+5800000c
+e7e40005
+18007e01
+e7e40005
+202051d6
+44e24018
+6fe40271
+1fe0fe04
+1ff1fe00
+1fe97e00
+1fe08401
+d8c04232
+efe60006
+207a0000
+67e60abe
+6fe20abe
+1fe22200
+204051ad
+1a427e00
+67e24232
+20600000
+d8e00000
+da400000
+18e67c07
+24610000
+aa2fffff
+2020d1b4
+202051b8
+18427e00
+203a51b8
+f9202400
+184085ff
+18e08e01
+202051af
+2040564e
+247a0000
+20405169
+247a0000
+2040569f
+20406cd0
+2040519d
+202051c6
+2040564e
+247a0000
+2040569f
+20406cd0
+204056a8
+6fe40271
+203a51d5
+e7e40005
+6fe4421a
+e7e40005
+202051d6
+2040510e
+202051d6
+44e2c018
+70028000
+2040694b
+6fe20280
+c1008000
+202051d6
+2040563e
+58000000
+67e40262
+67e40264
+70026601
+20600000
+44e34018
+2040569d
+18002400
+6fe40262
+1fe22600
+6fe40260
+98000c00
+204051ea
+1a627e00
+1a60a7fc
+1fe0fffc
+243a51e2
+1a427e00
+67e4026b
+20600000
+44e3c018
+efe20006
+c000d223
+c001522b
+c001d2af
+c00252df
+c002d37c
+c00353a5
+c003d3f5
+c004542a
+c004d43a
+c00551f9
+c005d43b
+2040543c
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+5800000b
+e7e20005
+18e27e00
+e7e20005
+efe40006
+c0015207
+c001d20d
+20600000
+58020008
+e7ec0005
+58000280
+e7e80005
+18007e0c
+20205212
+5803000c
+e7ec0005
+58000006
+e7f00005
+18007e10
+9a40a400
+202051f8
+efe20006
+1fe20e00
+efe40006
+1fe22200
+efe40006
+67e40a9e
+1a627e00
+9a262600
+2040569d
+5800000b
+e7e20005
+18e27e00
+e7e20005
+6fe40a9e
+20205204
+efe20006
+1fe20e00
+efe40006
+1fe22200
+98c08c00
+1a627e00
+9a262600
+202051f8
+20407c83
+20407c88
+d9000000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+efe40006
+1fe20400
+efe40006
+1fe21600
+44e44019
+18427e00
+c000d23e
+c001d260
+c008d26c
+c009d277
+2040543c
+202052ae
+20407c83
+d8400050
+6fe4421a
+243a52a8
+19627e00
+67e4421a
+1c427e00
+67e802d1
+20405248
+20205283
+604402cf
+19627e00
+67e402c5
+1a227e00
+67e402c7
+1a427e00
+67e402c9
+1a627e00
+67e402cb
+18e27e00
+67e402cd
+20600000
+684402cf
+6fe402c5
+1fe21600
+6fe402c7
+1fe22200
+6fe402c9
+1fe22400
+6fe402cb
+1fe22600
+6fe402cd
+1fe20e00
+20600000
+20407c83
+58000051
+d8400051
+6fe4421c
+243a52a8
+19627e00
+67e4421c
+6fe24223
+79207e00
+79207e01
+67e24223
+2020528b
+20407c83
+d8400052
+6fe4421e
+243a52a8
+19627e00
+67e4421e
+6fe24224
+79207e00
+79207e01
+67e24224
+2020528b
+20407c83
+1b427e00
+d8400053
+6fe44220
+243a52a8
+19627e00
+67e44220
+6fe24225
+79207e00
+79207e01
+67e24225
+2020528b
+58000001
+67e40279
+70433650
+2020528d
+6fe24222
+79207e00
+79207e01
+67e24222
+58000000
+67e40279
+44e4c019
+20407c88
+58000003
+e7e20005
+18e27e00
+e7e20005
+58000008
+e7e40005
+18427e00
+e7e40005
+19627e00
+e7e40005
+6fe40279
+c000d2a3
+290c0000
+2020d29e
+58000004
+e7e40005
+18007e00
+e7e40005
+5800000c
+202052aa
+e7e40005
+18007e02
+e7e40005
+5800000c
+202052aa
+79201000
+2020528b
+9a40a400
+1a627e00
+9a262600
+202052ae
+202051f8
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe21600
+efe40006
+1fe20400
+44e54019
+58000050
+98467c00
+2022d2c7
+58000051
+98467c00
+2022d2cd
+58000052
+98467c00
+2022d2d9
+58000053
+98467c00
+2022d2d3
+20600000
+19627e00
+67e4421a
+6fe24222
+79207e01
+67e24222
+202051f8
+19627e00
+67e4421c
+6fe24223
+79207e01
+67e24223
+20600000
+19627e00
+67e4421e
+6fe24225
+79207e01
+67e24225
+20600000
+19627e00
+67e44220
+6fe24224
+79207e01
+67e24224
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe20400
+18422200
+44e5c019
+58000050
+98467c00
+2022d2f6
+58000051
+98467c00
+2022d314
+58000052
+98467c00
+2022d300
+58000053
+98467c00
+2022d30a
+2020543c
+18a21600
+6fe24222
+79207e04
+79207e03
+67e24222
+19620a00
+d9600050
+6fe4421a
+1fe20400
+2020531d
+18a21600
+6fe24224
+79207e04
+79207e03
+67e24224
+19620a00
+d9600052
+6fe4421e
+1fe20400
+2020531d
+18a21600
+6fe24225
+79207e04
+79207e03
+67e24225
+19620a00
+d9600053
+6fe44220
+1fe20400
+2020531d
+18a21600
+6fe24223
+79207e04
+79207e03
+67e24223
+19620a00
+d9600051
+6fe4421c
+1fe20400
+44e64019
+58000005
+e7e20005
+18e27e00
+e7e20005
+58000006
+e7e40005
+18427e00
+e7e40005
+18007e00
+e7e40005
+18007e00
+e7e40005
+18007e0a
+9a40a400
+6044027e
+18e27e00
+67e2027d
+18007e50
+a961fe00
+2020d333
+1fe0fe01
+20600000
+78547c00
+c3810000
+c4000000
+c4008000
+79207e02
+18c20a00
+18a08bff
+e7e20005
+78347c00
+20600000
+6fe24222
+20405334
+24345345
+70027c50
+6fe4421a
+67e4027e
+20205359
+6fe24223
+20405334
+2434534c
+70027c51
+6fe4421c
+67e4027e
+20205359
+6fe24224
+20405334
+24345353
+70027c52
+6fe4421e
+67e4027e
+20205359
+6fe24225
+20405334
+24740000
+70027c53
+6fe44220
+67e4027e
+44e6c019
+20405614
+20405692
+18002400
+2040569d
+18007e04
+e7e20005
+6fe24227
+e7e20005
+58000008
+e7e40005
+6fe4027e
+e7e40005
+58000000
+e7e40005
+18007e01
+e7e20005
+18007e02
+e7e20005
+6fe2027c
+c028d371
+58000030
+e7e40005
+20205373
+580003e3
+e7e40005
+d840000c
+6044026b
+2040569b
+6fe4026b
+e7e40005
+18007e01
+e7e40005
+70027c00
+202051f8
+18c08c01
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe22200
+44e74019
+58000050
+9a267c00
+2022d394
+58000051
+9a267c00
+2022d398
+58000052
+9a267c00
+2022d39c
+58000053
+9a267c00
+2022d3a0
+18c08c02
+efe40006
+98007c00
+202051f8
+6fe24222
+79207e05
+67e24222
+202051f8
+6fe24223
+79207e05
+67e24223
+202051f8
+6fe24224
+79207e05
+67e24224
+202051f8
+6fe24225
+79207e05
+67e24225
+700a9506
+20207bab
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe22200
+efe40006
+1fe21600
+1a220400
+20407c83
+44e7c019
+58000050
+98467c00
+2022d3cc
+58000051
+98467c00
+2022d3dc
+58000052
+98467c00
+2022d3c0
+58000053
+98467c00
+2022d3c6
+2040543c
+202053f1
+19620400
+6fe4421e
+98467c00
+2022d3d2
+2040543c
+202053f1
+19620400
+6fe44220
+98467c00
+2022d3d4
+2040543c
+202053f1
+19620400
+6fe4421a
+98467c00
+2022d3d8
+2040543c
+202053f1
+20405453
+202053e4
+20405459
+6fe4421e
+203a53e4
+202053e4
+2040544e
+6fe20284
+243a53e4
+202053e4
+19620400
+6fe4421c
+98467c00
+2022d3e2
+2040543c
+202053f1
+20405449
+202053e4
+20407c88
+58000007
+e7e20005
+18e27e00
+e7e20005
+58000004
+e7e40005
+1a227e00
+e7e40005
+19627e00
+e7e40005
+18007e08
+202053f3
+20407c88
+202053f3
+9a40a400
+202051f8
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe21600
+efe40006
+1fe20400
+20407c83
+44e8401a
+58000050
+98467c00
+2022d40f
+58000051
+98467c00
+2022d415
+58000052
+98467c00
+2022d41b
+58000053
+98467c00
+2022d421
+2040543c
+20205429
+18422200
+19620400
+6fe4421a
+98467c00
+2042d44e
+20205427
+18422200
+19620400
+6fe4421c
+98467c00
+2042d449
+20205427
+18422200
+19620400
+6fe4421e
+98467c00
+2042d453
+20205427
+18422200
+19620400
+6fe44220
+98467c00
+2042d459
+20205427
+20407c88
+202051f8
+202051f8
+efe20006
+1fe20e00
+efe40006
+1fe22200
+98c08c00
+58000009
+e7e20005
+18e27e00
+e7e20005
+18007e00
+e7e40005
+18007e04
+9a40a400
+1a627e00
+9a262600
+202051f8
+202051f8
+202051f8
+18002400
+2040569d
+58000001
+e7e20005
+18e27e00
+e7e20005
+58000002
+e7e40005
+58000000
+e7e40005
+1a40a406
+da600004
+202051f8
+58000000
+67e40277
+67e4421c
+70422300
+20600000
+58000000
+67e40271
+67e4421a
+70422200
+20600000
+58000000
+67e4421e
+70422400
+6fe24225
+c000545f
+20600000
+58000000
+67e44220
+70422500
+6fe24224
+c000545f
+20600000
+700a9507
+20207bab
+6fe2027b
+793ffe00
+67e2027b
+6fe44220
+207a0000
+20405692
+6fe44220
+1fe22200
+18002453
+20205474
+6fe2027b
+793ffe07
+67e2027b
+6fe4421e
+207a0000
+20405692
+6fe4421e
+1fe22200
+18002452
+20405614
+2040569d
+18007e06
+e7e20005
+6fe24227
+e7e20005
+58000004
+e7e40005
+1a227e00
+e7e40005
+1a427e00
+e7e40005
+18000408
+202054b8
+44e8c01a
+20405614
+2040569d
+58000002
+e7e20005
+6fe24227
+e7e20005
+58000004
+e7e40005
+18427e00
+e7e40005
+19627e00
+e7e40005
+d8400008
+202054b8
+44e9401a
+20405614
+2040569d
+58000004
+e7e20005
+6fe24227
+e7e20005
+58000008
+e7e40005
+18427e00
+e7e40005
+58000000
+e7e40005
+58000001
+e7e20005
+58000002
+e7e20005
+580003e3
+e7e40005
+d840000c
+202054b8
+44e9c01a
+20405614
+2040569d
+58000006
+e7e20005
+6fe24227
+1fe0fe01
+18a22200
+67e24227
+1a220a00
+e7e20005
+58000004
+e7e40005
+18427e00
+e7e40005
+19627e00
+e7e40005
+d8400008
+6044026b
+18427e00
+203a563e
+2040569b
+6fe4026b
+e7e40005
+18007e01
+e7e40005
+20600000
+6fe40271
+203a4a8b
+204056a8
+6fe40271
+e7e40005
+6fe4421a
+e7e40005
+20600000
+6fe40262
+203a51d6
+44ea401a
+6fe20264
+c000d4d3
+c02851c2
+c028d1cf
+c02951cd
+c029d1cd
+202051d6
+44eac01a
+20405692
+18002400
+2040569d
+1fe20a00
+6fe40262
+1fe22600
+6fe40260
+98000c00
+204054e2
+1a60a7fc
+2422d4dc
+1a420400
+204054b8
+202051d6
+efe20006
+c00154ed
+c000d4f0
+c001d4fa
+c002d536
+c0025568
+c003d5ed
+c00355bb
+c004542a
+c0055214
+20205608
+20407c83
+20407c88
+2020522b
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe20006
+1a20a3ff
+2422d4f6
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+efe40006
+1fe21600
+efe40006
+1fe20400
+efe40006
+1fe67c00
+2022d50c
+c0015508
+c0025508
+2020550a
+700a9516
+20407bab
+efe40006
+20205533
+20407c83
+44eb401a
+58000050
+98467c00
+2022d51b
+58000051
+98467c00
+2022d521
+58000053
+98467c00
+2022d52d
+58000052
+98467c00
+2022d527
+20205533
+19627e00
+67e4421a
+6fe24222
+79207e01
+67e24222
+20205532
+19627e00
+67e4421c
+6fe24223
+79207e01
+67e24223
+20205532
+19627e00
+67e4421e
+6fe24224
+79207e01
+67e24224
+20205532
+19627e00
+67e44220
+6fe24225
+79207e01
+67e24225
+20407c88
+1a627e00
+9a262600
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe21600
+efe40006
+efe40006
+243a5562
+20407c83
+19620400
+44ebc01a
+58000050
+98467c00
+2022d550
+58000051
+98467c00
+2022d554
+58000052
+98467c00
+2022d558
+58000053
+98467c00
+2022d55c
+6fe24222
+79207e05
+67e24222
+20600000
+6fe24223
+79207e05
+67e24223
+20600000
+6fe24224
+79207e05
+67e24224
+20600000
+6fe24225
+79207e05
+67e24225
+700a9506
+20207bab
+20407c88
+1a20a3fa
+2022d567
+18c08c01
+1a20a3ff
+20205563
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+18c08c02
+1fe20400
+58000005
+e7e20005
+18e27e00
+e7e20005
+1a20a202
+1a227e00
+e7e40005
+20407c83
+44ec401b
+58000050
+98467c00
+2022d587
+58000051
+98467c00
+2022d598
+58000052
+98467c00
+2022d59e
+58000053
+98467c00
+2022d5a4
+202055a9
+6fe24222
+79207e04
+79207e03
+67e24222
+c2815595
+6842027b
+79200406
+6042027b
+18e27e00
+1fe0fe01
+67e2027d
+6fe24222
+79207e02
+67e24222
+6fe4421a
+67e4027e
+202055a9
+6fe24223
+79207e04
+79207e03
+67e24223
+6fe4421c
+202055a9
+6fe24224
+79207e04
+79207e03
+67e24224
+6fe4421e
+202055a9
+6fe24225
+79207e04
+79207e03
+67e24225
+6fe44220
+1fe21600
+20407c88
+19627e00
+e7e40005
+18007e00
+e7e40005
+18007e00
+e7e40005
+18007e0a
+9a40a400
+1a20a3fa
+2022d5ba
+efe20006
+e7e20005
+1a40a401
+1a20a3ff
+202055b4
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+1a627e00
+9a262600
+efe40006
+1fe22200
+efe40006
+1fe21600
+20407c83
+44ecc01b
+58000050
+1a220400
+98467c00
+2022d5d4
+58000052
+1a220400
+98467c00
+2022d5d9
+58000053
+1a220400
+98467c00
+2022d5db
+202055dd
+58000000
+67e40271
+67e4421a
+67e24222
+202055df
+20405453
+202055df
+20405459
+202055df
+58000000
+67e40277
+20407c88
+58000007
+e7e20005
+18e27e00
+e7e20005
+58000004
+e7e40005
+1a227e00
+e7e40005
+19627e00
+e7e40005
+18007e08
+9a40a400
+20600000
+efe20006
+1fe20e00
+efe40006
+1fe22200
+efe40006
+1fe21600
+efe40006
+1fe20400
+20407c83
+44ed401b
+6fe24227
+a8e1fe00
+2420d604
+58000050
+98467c00
+2022d601
+58000051
+98467c00
+2022d604
+20205604
+70421a00
+70422200
+20205604
+20407c88
+1a627e00
+9a262600
+20600000
+58000001
+e7e20005
+efe20006
+e7e20005
+58000002
+e7e40005
+58000000
+e7e40005
+58000006
+9a40a400
+18002604
+20600000
+6fe24227
+1fe0fe01
+c0805618
+1fe0fe01
+67e24227
+20600000
+44edc01b
+da400000
+20405648
+243a4a8b
+20405658
+da401800
+d8e00000
+68424228
+a84fffff
+2020d629
+2040567a
+19667c00
+20215629
+20405662
+2020562f
+1a40a480
+18e08e01
+58000008
+98e67c00
+20215621
+da400000
+1a427e00
+203a4a8b
+20600000
+44ee401b
+20405651
+18c08c01
+efe40006
+20600000
+44eec01b
+20405651
+18c20a00
+18c20400
+58000000
+e7e60005
+20600000
+44ef401b
+2040564e
+203a4a8b
+6fe6422f
+67e64232
+6fe6422c
+67e6422f
+6fe64229
+67e6422c
+20600000
+44efc01b
+6fe64229
+20600000
+44f0401c
+6fe6422c
+20600000
+44f0c01c
+6fe64232
+20600000
+2040564e
+203a4a8b
+d8c04229
+efe60006
+203a5654
+18c08dfd
+20600000
+44f1401c
+df200004
+d8c04229
+d8400000
+efe60006
+1fe17eff
+98418400
+c200565c
+60424228
+20600000
+44f1c01c
+20405648
+243a4a8b
+2040564e
+203a566f
+6fe6422c
+67e64229
+efe60006
+e7e60005
+efe60006
+e7e60005
+58000000
+e7e60005
+d8400000
+19627e00
+98e0fe00
+f9200400
+18e08e01
+98e67c00
+2422d672
+1a4d7e00
+9841fe00
+67e64232
+20600000
+44f2401c
+20405658
+18e22600
+d8400000
+d9600000
+18e27e00
+c004568a
+6fe24228
+afefffff
+2020d68a
+18408480
+18e08e01
+1a227e00
+98467c00
+2022d68a
+2021567f
+18427e00
+9a267c00
+24215690
+18e27e00
+1a620400
+98461600
+1a620e00
+20600000
+44f2c01c
+da20007f
+2040561a
+67e40267
+1fe0fe04
+67e40269
+58000000
+67e4026b
+20600000
+6fe40267
+202056bc
+6fe40269
+202056bc
+44f3401c
+da2000fa
+2040561a
+67e4026d
+1fe0fe04
+67e4026f
+58000000
+67e40271
+20600000
+6fe4026d
+202056bc
+6fe4026f
+202056bc
+44f3c01c
+20407c57
+70028001
+20405648
+247a0000
+da20007f
+2040561a
+67e40273
+1fe0fe04
+67e40275
+58000000
+67e40277
+70028000
+20207c67
+6fe40273
+202056bc
+203a4a8b
+1fe20a00
+20600000
+44f4401d
+da400000
+da204229
+1a20a3fe
+1a20a202
+58004235
+9a267c00
+2022d6cf
+efe20011
+1a20a201
+203a56c3
+e8440011
+efe40002
+9a40a400
+1a40a404
+202056c3
+1a427e00
+20600000
+d8e0000c
+20204bec
+d8e0000c
+20204bf0
+44f4c01d
+20405658
+6fe24228
+207a0000
+204056bf
+d8400100
+98467c00
+202156d1
+204056d3
+d8a04235
+da204229
+58004235
+9a267c00
+20628000
+efe20011
+1a20a201
+243a56e9
+e7e40005
+1a20a202
+202056e0
+efe40011
+1a20a202
+1fe20c00
+efe40006
+e7e40005
+1fe27200
+1f20f202
+20407cdc
+202056e0
+44f5401d
+20405658
+6fe24228
+207a0000
+da20422a
+1a20a3fd
+d8c04235
+1a20a203
+58004236
+9a267c00
+20628000
+efe40006
+203a56f9
+1fe0fe04
+1fe27200
+18c22400
+efe40011
+1fe20a00
+1a420c00
+18c08dfe
+20407cdc
+202056f9
+44f5c01d
+7855fc00
+70045101
+70043b03
+70045201
+5fffffff
+67e40455
+18007e00
+67e20453
+67e2045e
+67e6416a
+67e6416d
+67ea43d5
+79207e27
+67ea43da
+7043ae01
+7043af00
+20205ac9
+44f6401d
+7834fc00
+70043c03
+70047401
+70442c01
+5800ffff
+67e4442e
+18007e00
+67ea43da
+79207e27
+67ea43d5
+20205708
+44f6c01d
+7854fc00
+58000017
+67e4447a
+70043c01
+70434000
+7000a000
+70449600
+70449700
+6fe40469
+67e4448c
+6fe4043d
+1feffe05
+1ff1fe00
+67e40469
+20205708
+2040579e
+204059c2
+20405acc
+202057a8
+44f7401d
+2040579e
+20404c8d
+6fe2043c
+c001d740
+20205754
+44f7c01d
+7834fc00
+20405ac0
+20215751
+20404c27
+204057ed
+204059f8
+7856fc00
+20405899
+24768000
+44f8401e
+6fe20005
+1fe0fe01
+67e20005
+20405984
+7854fc00
+20600000
+20405783
+7854fc00
+20600000
+44f8c01e
+7044e100
+20407964
+20405ff8
+78577c00
+20405ac0
+20215783
+20404c27
+204057ed
+20405863
+242c5775
+20405791
+2036d762
+2020576f
+44f9401e
+6fe244e1
+1fe0fe01
+67e244e1
+c006576f
+20405984
+204059f8
+204058a1
+20405a58
+6fe441fc
+20407d77
+2040577a
+2034577e
+44f9c01e
+20405fc4
+20405fbb
+20407bc1
+6fe2045e
+c281d783
+44fa401e
+20405bd4
+20405977
+2040594f
+2020483d
+78547c00
+c5157dbf
+c514fdbf
+20600000
+44fac01e
+78377c00
+2040589b
+2036d762
+2020576f
+44fb401e
+20405789
+20404d3f
+2040792c
+700a9515
+20207bab
+58000000
+67f244d1
+70045100
+70043c00
+70043b00
+70449700
+70449600
+20600000
+44fbc01e
+6fe20005
+1fe0fe01
+67e20005
+6fe2043b
+c3818000
+79207e03
+67e2043b
+6fe4448c
+67e40469
+58000000
+67e844b7
+20600000
+44fc401f
+70890f36
+70890b5f
+783b7c00
+70891407
+20404c27
+6fe241e1
+207a0000
+70890ab8
+20600000
+44fcc01f
+70890f2e
+70890bff
+785b7c00
+70891403
+db600000
+20600000
+7844fc00
+7843fc00
+6fe60463
+98001e00
+6fe20016
+1fed8400
+79200401
+18431c00
+20600000
+204057c0
+2040491c
+58000500
+20404a8e
+20204921
+2036c936
+204057c0
+20204930
+44fd401f
+20404915
+6fe20488
+243a57d3
+6fe20016
+1fe67c24
+202157cd
+18000400
+c1128000
+18000418
+c1130000
+1800044e
+20600000
+1fe67c0a
+202157d0
+1fe0fe01
+1fe3fe00
+1fe08402
+20600000
+6fe20016
+1fe38400
+20600000
+d84001f4
+207a0000
+d84000fa
+c1008000
+d8400096
+c1010000
+d8400064
+c1018000
+d840004b
+c1020000
+d8400032
+c1028000
+d8400028
+c1030000
+d8400014
+20600000
+588e89be
+1fed7e00
+1fe1fed6
+98001200
+58555555
+67e60463
+20600000
+44fdc01f
+78287c00
+6fe8045f
+98001200
+20405840
+58000200
+2034d7f6
+6fe40449
+1fe37e00
+d8400500
+9840fe00
+20404a23
+1b427e00
+67ec048d
+20600000
+44fe401f
+6fe20016
+c012d802
+c0135808
+c013d80e
+2020580e
+6842445f
+284ffe01
+2020d819
+284ffe02
+2020d81e
+20205814
+6842445f
+284ffe02
+2020d81e
+284ffe00
+2020d814
+20205819
+6842445f
+284ffe00
+2020d814
+284ffe01
+2020d819
+2020581e
+70001625
+6fe20abe
+79207e00
+67e20abe
+20600000
+70001626
+6fe20abe
+79207e01
+67e20abe
+20600000
+70001627
+6fe20abe
+79207e02
+67e20abe
+20600000
+44fec01f
+1a208c01
+efe20006
+c4000000
+1a208a1a
+efe40005
+1fe0fe01
+e7e40005
+1a208c19
+efe20006
+1a208a18
+e8420005
+9840fe00
+1fe67c24
+20215833
+1fe0ffdb
+e7e20005
+20600000
+44ff401f
+6fea046b
+18000400
+18007225
+c300583b
+18408401
+1fe37e00
+c2005839
+1840ffff
+67e2045d
+20600000
+44ffc01f
+6fe20453
+98000e00
+684a046b
+a84fffff
+2020d856
+47004020
+6fe2045d
+98e67e00
+2021584c
+1fe60fff
+20205846
+18e27200
+18000e00
+a84fffff
+2020d851
+1f20f201
+1f227e00
+203a5856
+18e08e01
+1f20f3ff
+2020584e
+18e27e00
+67e20016
+20600000
+2034d85c
+37c18200
+20600000
+d9600ea0
+34730200
+20600000
+78487c00
+6fe4433e
+1fe21600
+20205868
+4700c020
+78287c00
+6fe40449
+684844b7
+98409600
+204057b8
+47014020
+204057af
+7856fc00
+7826fc00
+7830fc00
+78507c00
+19623600
+37c18400
+20375874
+1b420400
+604c009a
+242c4649
+2037587b
+dd2001e0
+1c225000
+6fe2043b
+c301d87b
+2055cae6
+4701c020
+204049ba
+7823fc00
+7824fc00
+09800008
+19897e00
+67e202d5
+09800008
+19897e00
+e7e20005
+1fe1723f
+2022d88b
+09800008
+19897e00
+e7e20005
+c2005887
+47024020
+09800018
+78287c00
+db600664
+1fef7e00
+1ff17e00
+e7e60005
+20234649
+7836fc00
+6fe20017
+1fe0a200
+20404980
+7846fc00
+20204915
+4702c020
+204058a3
+68420017
+2040491c
+20404921
+78287c00
+d960157c
+20205869
+204058a3
+20204649
+47034020
+204057af
+204057bd
+202058a7
+79202a00
+782efc00
+78307c00
+7850fc00
+20405859
+19317e00
+1fecfe00
+1ff1fe00
+08008628
+7823fc00
+7824fc00
+4703c020
+6fe243ae
+08008608
+efe20006
+1fe1723f
+08008608
+2022d8bc
+efe20006
+08008608
+c20058b9
+78247c00
+08008618
+78447c00
+37d38200
+20000064
+784efc00
+20600000
+47044021
+6fe24456
+c000d8d3
+6fe24457
+1ff27e00
+1febfe00
+67e243ae
+68424341
+1840fe06
+67e243af
+6fec4472
+67ec43b0
+18427200
+d8c04342
+20407ccf
+202058de
+6fe24458
+1ff27e00
+1febfe00
+1fe0fe01
+67e243ae
+5800000c
+67e243af
+6fec4472
+67ec43b0
+6fec41d1
+e7ec0005
+4704c021
+6fe20000
+1fe0fe01
+67e20000
+db600708
+7856fc00
+20205899
+47054021
+6fe24470
+c1808000
+6fe20000
+1fe0fe01
+67e20000
+d8400c03
+6fe24471
+7d3a0406
+1a227e00
+7d3a0407
+604443ae
+6fec4472
+e7ec0005
+6fec044b
+e7ec0005
+20205899
+4705c021
+d8400004
+6fe24457
+7d3a0406
+604243ae
+68424361
+1840fe06
+67e243af
+6fec4472
+67ec43b0
+d8c04362
+18427200
+20407ccf
+204058a1
+20205ae2
+47064021
+18007fff
+38080001
+67ea046b
+20405835
+18007204
+d8a0045f
+204066ef
+6fe4446e
+67e40469
+180a7e00
+1fe17e0f
+1fe67c04
+2021590f
+67e20454
+67e206e2
+4706c021
+68444339
+6044043d
+18422600
+1c40fe07
+9a66fc00
+20407d61
+18072200
+9a267e00
+9a60fe00
+68444337
+9840fe00
+67e8043f
+9c462200
+1a20a3fa
+da402205
+6fe24467
+7d3a2406
+6fe24460
+7d3a2407
+1a427e00
+67e443ae
+6fec4472
+e7ec0005
+6fec044b
+e7ec0005
+6fe8045f
+e7e80005
+180a7e00
+e7e40005
+180a7e00
+e7e20005
+18007e02
+e7e20005
+1a2b7e00
+e7e40005
+1a6b7e00
+e7e40005
+47074021
+58000000
+e7e40005
+6fe4446e
+e7e40005
+6fea046b
+e7ea0005
+6fe20454
+d84000a0
+9841fe00
+e7e20005
+204058a1
+580043ae
+1fe08c12
+efe60006
+67e60463
+20600000
+4707c021
+7854fc00
+202057e6
+6fe2043b
+c4028000
+6fe40455
+6844045b
+98467e00
+24610000
+67e40a96
+47084022
+6fe2043b
+793ffe05
+793ffe03
+67e2043b
+6fe8043f
+6844043d
+60440a9e
+98462200
+4708c022
+6fe243a5
+67e20466
+e8440006
+efe40006
+1febfe00
+67e4043d
+184b8400
+9840fe00
+e8480006
+60480467
+9a20fe00
+1fe22800
+6fe4043d
+68440a9e
+98467e00
+68440a96
+984ffe00
+9a80fe00
+67e8043f
+20405af3
+6fe40469
+67e4448c
+20600000
+47094022
+6fe2043b
+c4030000
+6fe40455
+6844045b
+98467e00
+24610000
+6fe2043b
+793ffe06
+67e2043b
+6fea43a0
+67ea046b
+20205835
+4709c022
+20405ac9
+2040599a
+6fe202d5
+2feffe04
+7920802a
+1fe37e00
+9842fe00
+2feffe02
+7920800f
+c6078000
+6fe202d6
+203a5996
+6fe2043b
+c3025996
+20407342
+204072b2
+247a0000
+68420452
+79400402
+60420452
+20600000
+470a4022
+68420452
+284c0005
+20608000
+6fe202d5
+1fe3fe00
+9842fe00
+c4018000
+793f8405
+79400403
+60420452
+28400603
+24608000
+6fe243b0
+c002d9ac
+6fe24497
+c00159b0
+20600000
+6fe2043b
+79207e04
+67e2043b
+20600000
+470ac022
+70449700
+dfe00000
+67e843df
+67ea43d5
+79207e27
+67ea43da
+6fe2043b
+793ffe04
+67e2043b
+20600000
+470b4022
+204057fc
+2040585f
+6fe20001
+1fe0fe01
+67e20001
+20600000
+470bc022
+6fe2433b
+c1808000
+d8e00002
+20407cf1
+247a0000
+6fe4433c
+6844433e
+98467e00
+d8e00002
+20407ce3
+7854fc00
+2040594c
+204059bb
+24768000
+470c4023
+6fec02d7
+67ec044b
+6fe20002
+1fe0fe01
+67e20002
+204059e2
+20748000
+204058e5
+24768000
+470cc023
+6fe20004
+1fe0fe01
+67e20004
+6ff202dd
+67f200ff
+20600000
+470d4023
+6fe20497
+c18d8000
+6fec044b
+684c4461
+98467c00
+24628000
+20404237
+24628000
+20405905
+2040571a
+470dc023
+7041cf00
+70047200
+70433b00
+70049700
+2020421f
+da200001
+6fe202d5
+c3830000
+da200000
+20600000
+470e4023
+6fe20452
+c3828000
+20405a1c
+20405c53
+203a5a3e
+efe20006
+e8420006
+18422200
+9a267e00
+d840001b
+20407db5
+1fe20400
+efe20006
+1fe20200
+1a227e00
+98c08c00
+d8a043b0
+18427200
+20407cdc
+20405a2e
+20405a40
+20405c53
+efe20006
+1fe22200
+18c22600
+e8420006
+18422400
+9a467e00
+d840001b
+20407db5
+9a40fe00
+e7e20013
+9a267c00
+24628000
+20205c76
+20405a23
+c6148000
+6fe244bb
+c3015a2c
+20405c56
+203a5a2c
+20205a2a
+20405c53
+203a5a2c
+efe20006
+e8420006
+98467e00
+1fe67c1b
+20215a2c
+79200029
+20600000
+793f8029
+20600000
+1a227e00
+207a0000
+d8200001
+20600000
+470ec023
+18408401
+20405b4a
+18c08dfe
+efe40006
+d8402902
+98467c00
+24628000
+18c08c01
+18c22200
+efe20006
+20600000
+18000400
+18000201
+470f4023
+604243af
+68420452
+79200405
+18417efc
+9821fe00
+67e20452
+1fe17e1f
+280ffe29
+7920fe04
+67e243ae
+6fe243ae
+28200601
+2420da50
+6fe243af
+207a0000
+6fe2043b
+c4020000
+20407342
+20207299
+d8e00000
+20204bec
+d8e00000
+20204bf0
+470fc023
+c6078000
+20405c70
+247a0000
+6fe202d5
+1fe17e03
+67e244de
+efe20006
+1fe17e1f
+67e244dd
+207a0000
+18c27e00
+67e444df
+47104024
+6fe244de
+c001e044
+4710c024
+20405a76
+24345a54
+20405a56
+6fe444df
+1fe20c00
+efe40006
+67e444ce
+47114024
+efe40006
+c0025c8b
+c0035ed4
+c002de96
+20600000
+6fe244de
+c0015a85
+c000da9d
+20600000
+20407dbf
+d8400004
+9fe67c00
+20628000
+d8400005
+9fe67c00
+20628000
+d8400006
+9fe67c00
+20628000
+20207dc1
+6fe444df
+1fe20c00
+efe40006
+67e444ce
+efe40006
+20405a7a
+24740000
+684244dd
+604244d0
+6fe444ce
+1fe0fe04
+98467c00
+2022fdbf
+6fe244dd
+1fe27200
+d8a0030d
+6fe444df
+1fe20c00
+20407cdc
+20207dc1
+20407dbf
+6fe244d0
+247a0000
+20207dc1
+20405a99
+24740000
+6fe244d0
+d8a0030d
+98a0a200
+684244dd
+9840fe00
+67e244d0
+6fe244dd
+1fe27200
+1a220a00
+6fe444df
+1fe20c00
+20407ccf
+5800030d
+67e444df
+6fe444ce
+1fe0fe04
+684244d0
+98467c00
+2022fdbf
+20207dc1
+20407c80
+d8a04430
+6fe444ce
+1fe0fffb
+e7e20005
+1fe27200
+20407c7a
+20207ccf
+20407c80
+d8a04443
+20205ab5
+6fe441fa
+20207d77
+68480457
+20404a7a
+98461600
+19627e00
+68440469
+18520400
+18438400
+98467e00
+20600000
+20404a7a
+67e80457
+20600000
+70001624
+700abe00
+4711c024
+6fe24340
+207a0000
+d8e00000
+20407cf1
+247a0000
+47124024
+7854fc00
+78287c00
+2040594c
+204057fc
+204058c3
+2436dae2
+6fe20003
+1fe0fe01
+67e20003
+6fe202d5
+1fe17e0f
+c001d8f6
+c002db08
+4712c024
+180a7e00
+d84001ff
+98417e00
+1fe0fefa
+20405aef
+6fe20abe
+6842445f
+98467c00
+2422dace
+d8e00000
+6fe44454
+20207ce3
+1fe0ffff
+20000026
+243a5aef
+20600000
+47134024
+6fe20472
+204057d6
+6fe4043d
+984ffe00
+d8400177
+984ffe00
+d84186a0
+9846fc00
+6fe20466
+d8404e20
+984ffe00
+9840fe00
+67e844b7
+4713c024
+6fe440c1
+20407d61
+18078400
+9840fe00
+67e40449
+20600000
+47144025
+6fec02dd
+684c4472
+98467c00
+24628000
+204059f3
+1a227e00
+67e24460
+6fee02ea
+67ee00ff
+eff00006
+e7f00005
+6fec02d7
+67ec044b
+18c08c06
+eff00006
+67f0045f
+e8440006
+4714c025
+184b8400
+efe40006
+1febfe00
+67e4043d
+67e8043f
+98467e00
+1fe0d1fe
+eff20006
+67f20467
+47154025
+efe20006
+1ff18400
+18430400
+60420472
+1fe17e1f
+67e20454
+20405af3
+20405835
+20405726
+20404237
+24628000
+4715c025
+2040483d
+20405eb3
+700a9514
+20407bab
+2020421f
+47164025
+6fe4442c
+98002400
+6fe4442e
+98002600
+6fe4448e
+98000c00
+78347c00
+20600000
+efe40006
+207a0000
+9a467c00
+24610000
+9a667c00
+20628000
+20215b48
+18007c01
+20600000
+18007e00
+20600000
+20405b4d
+2022db59
+20600000
+4716c025
+6fe4448e
+98000c00
+efe40006
+207a0000
+98467c00
+20628000
+efe20006
+98c08c00
+efe20006
+98c08c00
+20205b50
+efe20006
+98c08c00
+20600000
+47174025
+6fe4448e
+98000c00
+efe40006
+207a0000
+efe20006
+98c08c00
+18c08dfe
+efe40006
+98467c00
+20628000
+efe20006
+98c08c00
+20205b5f
+6fe40498
+20205b6e
+4717c025
+6fe4448e
+98000c00
+18422200
+efe40006
+203a5b79
+9a267c00
+2022db7a
+efe20006
+98c08c00
+efe20006
+98c08c00
+20205b70
+20207dc7
+efe20006
+67e2049e
+1fe27200
+d8a0049f
+20407ccf
+efe20006
+67e204af
+20407c80
+20207dc9
+47184026
+20405b86
+20205b98
+d8402a00
+20405b5c
+207a0000
+efe20006
+18c20a00
+68424381
+18427200
+98467c00
+24215b95
+98460400
+d8c04382
+20407cdc
+18427200
+2442dbd0
+20600000
+1fe27200
+d8c04382
+20207ccf
+da604361
+da204342
+20405ba5
+58000000
+79347e00
+67e20a96
+da604381
+da204362
+20405ba5
+20740000
+6fe20a96
+203a4a8b
+20600000
+4718c026
+20407dbf
+20407cb5
+da400000
+d8a00abf
+20405bbf
+6fe24381
+1fe08401
+9a40a200
+1a20a202
+1a267c1f
+24215bbd
+e0420005
+d8400009
+e0420005
+98007200
+20407ccf
+1a222400
+1a427e00
+67e20abe
+d8c00abe
+5fffffe0
+9a608a00
+20207c98
+20407dc1
+20205bb7
+efe20011
+207a0000
+1fe0fe01
+e8420006
+18467c09
+2022dbce
+9a40a400
+1a220c00
+98007200
+20407ccf
+18c22200
+1a227e00
+9a667c00
+20610000
+20205bbf
+9a20a200
+20205bca
+58000020
+e7e20005
+c2005bd0
+20600000
+47194026
+7855fc00
+20375bd8
+2436dbe6
+20404ba0
+6fe440c1
+67e40449
+2436cbb3
+c507cbb3
+6fe244dd
+243a4bb3
+6fe243af
+243a4bb3
+6fe244bb
+c282cbb3
+6fe2043b
+c282cbb3
+20204b95
+684440c1
+18430400
+6fe40449
+9840fe00
+67e40449
+20204bab
+d8e00000
+20205c04
+d8e00000
+20205c08
+d8e00001
+20205c04
+d8e00001
+20205c08
+d8e00002
+20205c04
+d8e00002
+20205c08
+d8e00003
+20205c04
+d8e00003
+20205c08
+d8e00004
+20205c04
+d8e00004
+20205c08
+d8e00005
+20205c04
+d8e00005
+20205c08
+6fe244bb
+f9207e00
+67e244bb
+20600000
+6fe244bb
+f93ffe00
+67e244bb
+20600000
+58112233
+67e644bc
+58445566
+e7e60005
+58778899
+e7e60005
+58001122
+e7e60005
+58334455
+e7e60005
+58000066
+e7e20005
+20600000
+59000302
+67e84425
+58010010
+67e64429
+70449801
+20600000
+da200000
+d8200001
+20205c30
+d8200003
+20405c30
+1a427e00
+e7e20005
+20600000
+18000202
+1a20a204
+20405c30
+1a20a3fc
+1a227e00
+e7e40005
+1a427e00
+e7e40005
+20600000
+1a267cf0
+24214a8b
+6fe244d1
+d8400001
+df200004
+98417c00
+2022dc3a
+18438400
+c2005c35
+20204a8b
+9842fe00
+67e244d1
+1f267e04
+1ff27e00
+1ff27e00
+d8401800
+98408400
+df200000
+d8c044d2
+efe40006
+203a5c49
+1f227e00
+1f20f201
+c0825c43
+20204a8b
+18c08dfe
+e0440006
+18420a00
+1a227e00
+e7e20005
+58000000
+e7e20005
+18227e00
+e7e20005
+20600000
+6fe444d2
+1fe20c00
+20600000
+6fe444d4
+1fe20c00
+20600000
+20405c5c
+1fe20c00
+20600000
+6fe444d8
+247a0000
+6fe444d6
+247a0000
+6fe444d4
+247a0000
+6fe444d2
+20600000
+20405c53
+18c08c03
+20600000
+20405c53
+18c08c07
+20600000
+20405c59
+18c08c07
+20600000
+20405c59
+18c08c03
+20600000
+6fe444d8
+20600000
+6fe444d6
+20600000
+6fe444d2
+20600000
+6fe444d2
+d8401800
+98467e00
+1ff1fe00
+1ff18e00
+6fe244d1
+f93ffe00
+67e244d1
+df200000
+1f23fe00
+d84044d4
+98408400
+efe40002
+184085fe
+e7e40002
+1f227e00
+1f20f201
+c081dc7f
+58000000
+e7e40002
+20600000
+efe60006
+67e60473
+c0015ca1
+c001dca9
+c0025cac
+c0035cd2
+c0045d1f
+c0055d9c
+c0065dc4
+c0085dda
+c0095e0f
+c00b5e28
+c00c5e3b
+c0295e40
+20600000
+18002203
+20405e62
+58000002
+e7e20005
+6fe44478
+e7e40005
+20600000
+20405ca9
+18002203
+20405e62
+58000003
+e7e20005
+6fe44478
+e7e40005
+20600000
+1fecfe00
+67e4447a
+20600000
+20405e91
+20407dbf
+20205caf
+d9600003
+20405b36
+20405b3f
+203a5cd0
+24215ccd
+18c08dfe
+20407c80
+20407c77
+24345cc1
+20407c60
+20407dc1
+18002214
+20405e62
+20407c70
+58000005
+e7e20005
+58000001
+e7e20005
+20407c7a
+efe40006
+e7e40005
+efe20006
+1fe27200
+20407cdc
+20407c7d
+196097ff
+2022dcd0
+efe20006
+98c08c00
+20205cb1
+efe20006
+98c08c00
+20205cca
+20345e56
+20205e85
+20405e91
+efe40006
+67e44444
+20407c80
+d8a04430
+6fe444ce
+1fe0fff9
+20405ab7
+20205ce5
+78547c00
+6844442c
+6fe4442e
+98467c00
+24215ce2
+18427e00
+c1800000
+78347c00
+70047601
+20205e57
+20405cdb
+20740000
+68444444
+58002800
+98467c00
+2022dcec
+20205e56
+7004b000
+6844442c
+60440a9e
+20405b6c
+243a5e56
+68440a9e
+20405b6c
+243a5d05
+18c22200
+6fe204af
+1fe27200
+68424430
+98467c00
+2422dd01
+da404431
+20407d63
+2022dd08
+6fe4049f
+68444444
+98467c00
+2022dd10
+6fe40a9e
+1fe0fe01
+67e40a9e
+20205cf1
+6fe204b0
+c000dd10
+20205e56
+6fe4049f
+68444444
+98467c00
+2422dd01
+7004b001
+68440a9e
+6044049a
+20205d01
+6fe204b0
+c0005d01
+7004b002
+68440a9e
+184085ff
+6044049c
+da200005
+20405e62
+58000007
+e7e20005
+6fe4049a
+e7e40005
+6fe4049c
+e7e40005
+20600000
+20405e91
+20405abb
+20205d22
+6844442c
+60440a9e
+20405b36
+20405b4d
+18c08dfe
+18c27e00
+67e40498
+68444444
+58002a00
+98467c00
+2022dd88
+58002803
+98467c00
+2422dd70
+d9600002
+20405e68
+24215d4d
+68440a9e
+20405b6a
+c000dd4d
+20405e74
+2422dd4b
+24345d4f
+78547c00
+da200014
+20405e62
+58000009
+e7e20005
+18a26000
+18a08a01
+20405d5d
+20405e64
+20405b6a
+20405d64
+6fe2049e
+1fe0fe05
+e7e20030
+6fe2049e
+c0085d4d
+196097ff
+2022dd4d
+20405e64
+20205d31
+20345e56
+20205e85
+20405e77
+20405e64
+20405b6a
+6fe2049e
+c0085d4d
+20407c77
+6fe40a9e
+1fe0ffff
+e7e40005
+20405e81
+20405d64
+196097ff
+2022dd4d
+20205d4b
+6fe40a9e
+e7e40005
+6fe204af
+1fe27200
+20407c7a
+20407ccf
+20207c7d
+20407c77
+6fe40a9e
+e7e40005
+20407c7d
+6fe2049e
+1fe27200
+20407c77
+20407c7a
+9f260c00
+18c08dff
+20407ccf
+20207c7d
+6844442c
+60440a9e
+20405e68
+24215e56
+20405b6a
+c000de56
+20405e74
+2422dd86
+da200014
+20405e62
+58000009
+e7e20005
+6fe204af
+1fe27200
+1fe0fe02
+e7e20005
+6fe40a9e
+e7e40005
+20407c7a
+20407ccf
+20407c7d
+20205e85
+20405e64
+20205d72
+d8402a00
+20405b5c
+207a0000
+18c08dfb
+efe40006
+67e40a9e
+da200014
+20405e62
+58000009
+e7e20005
+6fe24381
+1fe27200
+1fe0fe02
+e7e20005
+6fe40a9e
+e7e40005
+d8c04382
+20407ccf
+20407c7d
+20205e85
+68440474
+6fe244bb
+c281ddbd
+20405b4a
+203a5e56
+18c08dfe
+efe40006
+d8402a00
+98467c00
+2022ddb3
+efe20006
+1fe67c16
+20215daa
+18007e16
+1fe22600
+20407c80
+1a60a201
+20405e62
+5800000b
+e7e20005
+1a627200
+20407c7a
+20207cdc
+20407c80
+6fe24381
+1fe0a201
+20405e62
+5800000b
+e7e20005
+6fe24381
+1fe27200
+d8c04382
+20207cdc
+6fe444cc
+98467c00
+2422dd9f
+20405e22
+24345d9f
+70047605
+20205e57
+efe40006
+67e44430
+da200014
+20405e62
+5800000d
+e7e20005
+6fe44430
+98002200
+68440474
+20405b4a
+203a5e56
+efe20006
+9a267200
+24215e56
+1f267c16
+20215dd5
+18007216
+1a227e00
+98c08c00
+20407ccf
+20407c7d
+20205e85
+20405e91
+20405ab3
+20205ddd
+d9600002
+6844442c
+60440a9e
+20405b36
+20405b4d
+18c08dfe
+18c27e00
+67e40498
+20405e68
+24215e05
+68440a9e
+20405b6a
+c000de08
+20405e6c
+2422de03
+19627e00
+c0005e08
+24345df9
+78547c00
+da200014
+20405e62
+58000011
+e7e20005
+6fe204af
+1fe0fe04
+e7e20005
+20407c7d
+20205dff
+6fe204af
+c0085e08
+6fe40a9e
+1fe0ffff
+67e4049c
+20405e7c
+6fe40a9e
+67e4049a
+20405e77
+196097ff
+20405e64
+20205de5
+6fe40a9e
+67e4049c
+20205e0c
+6fe40a9e
+1fe0ffff
+67e4049c
+20205e0c
+20345e56
+20405e7c
+20205e85
+18c22200
+6fe444ce
+1fe0a5fd
+20405abe
+6fe244bb
+c3025e1d
+68440474
+6fe444cc
+98467c00
+2422de1d
+20405e22
+24345e1d
+70047605
+20205e57
+18002201
+20405e62
+58000013
+e7e20005
+20600000
+20407dc1
+6fe24498
+c1000000
+6fe24040
+c3820000
+20207dbf
+18c0a202
+6fe444ce
+1fe0a5fb
+20405abe
+20205e2d
+6fe444ce
+1fe22200
+20405e62
+58000017
+e7e20005
+6fe40474
+e7e40005
+6fe444ce
+1fe0f3fb
+6fe444df
+1fe08c07
+efe40006
+e7e40005
+20207ccf
+18002201
+20405e62
+58000019
+e7e20005
+20600000
+18c22200
+6fe444ce
+1fe0a5fd
+20205abe
+18422600
+1a20a203
+20405e62
+1a20a3fd
+5800001b
+e7e20005
+1a620400
+e0440005
+20600000
+18422600
+1a20a203
+20405e62
+1a20a3fd
+5800001d
+e7e20005
+1a620400
+e0440005
+20600000
+7004760a
+18002205
+20405e62
+58000001
+e7e20005
+6fe20473
+e7e20005
+6fe40474
+e7e40005
+6fe20476
+e7e20005
+20600000
+18002404
+20205c27
+68440a9e
+18408401
+60440a9e
+20600000
+68440a9e
+6fe4442e
+98467c00
+20600000
+68424430
+da204431
+6fe2049e
+1fe27200
+98467c00
+24628000
+da40049f
+20207d63
+68424443
+da204444
+20205e6e
+6fe204af
+67e200ff
+1fe27200
+20407c7a
+20207ccf
+20407c77
+6fe4049a
+e7e40005
+6fe4049c
+e7e40005
+6fe200ff
+1fe27200
+20407ccf
+20207c7d
+20407c77
+20405c6a
+18a27e00
+98c62200
+20405c6d
+1a227e00
+e7e40006
+1a20a204
+20405c59
+1a227e00
+e7e20006
+20600000
+1fecfe00
+67e4442c
+efe40006
+67e4442e
+20600000
+efe20006
+e8420006
+e8440006
+c009de9b
+20600000
+efe40006
+67e444db
+700a9540
+20207bab
+da20000c
+da600012
+20405ea7
+58000008
+e7e40005
+6ff04468
+e7f00005
+20600000
+20405eaf
+da400005
+20405c27
+1a627e00
+e7e20005
+6fe244da
+e7e20005
+20600000
+6fe244da
+1fe0fe01
+67e244da
+c1800000
+7044da01
+20600000
+6fe24498
+c0005ec4
+c000dec7
+c0015ec9
+c040debd
+c0415ebf
+c041dec2
+20600000
+7044280d
+20205ec5
+7044280d
+70442601
+20600000
+7044280d
+20205eca
+70442800
+70442603
+20600000
+70442805
+20205ec5
+70442805
+70442600
+20600000
+6fe24428
+79207e03
+67e24428
+20600000
+6fe24428
+793ffe03
+67e24428
+20600000
+efe20006
+c000dee9
+c001df10
+c0025f2d
+c002df3a
+c0035f60
+c003dfa4
+c0045f8f
+c004dfa0
+c0055fa4
+c005dfa4
+c0065fa5
+c006dfaa
+20600000
+18002202
+20406042
+5800000b
+e7e20005
+6fe24428
+e7e20005
+20600000
+67e2441e
+efec0006
+e7ec0005
+6fe24498
+c0005f3f
+20405f0b
+20405f06
+70449603
+6fe2441f
+c0005ef8
+c000def8
+c001def8
+6fe24498
+c0015efb
+c1418000
+dfe00000
+67e84499
+20600000
+6fe244bb
+c2805f04
+da204499
+1a220a00
+df200003
+204066ef
+6fe4449b
+1fe17e07
+67e4449b
+700a9534
+20207bab
+6fe24421
+c3818000
+6fe24498
+c4038000
+20204d7d
+18002207
+20406042
+6fee4425
+e7ee0005
+20600000
+18c22200
+6fe24498
+c041df17
+1a220c00
+d8a043fc
+20407c9a
+20205f1d
+1a220c00
+d8a043fc
+20407c9a
+70449102
+70449308
+20600000
+6fe24498
+c283df25
+20407252
+18002211
+20406042
+58000003
+e7e20005
+2020734c
+d8a0440c
+204066ee
+20407084
+18002211
+20406042
+58000003
+e7e20005
+202070c0
+18c22200
+6fe24498
+c283df41
+1a220c00
+2040724a
+2022df55
+70047704
+18002202
+20406042
+58000005
+e7e20005
+6fe20477
+e7e20005
+18000e0a
+20407ce2
+70449600
+700a9530
+20207bab
+70047705
+20205f34
+d8a0042b
+1a220c00
+20407c9a
+6fe24498
+c041df4c
+2040700e
+20405f5a
+6fe24498
+c1c10000
+700a953b
+20207bab
+20407079
+d8a00aee
+204070c0
+da200aee
+da4043fc
+df200010
+20407d63
+2422df33
+20205f5a
+20407246
+700a9531
+20407bab
+7043fb01
+70449605
+18002211
+20406042
+58000004
+e7e20005
+d8c0440c
+20207c9a
+d8a0041b
+20207c9a
+18002211
+20406042
+58000006
+e7e20005
+6fe244bb
+c280df6a
+d8c043eb
+20207c9a
+d8c044bc
+20207c9a
+d8a0449d
+1800720a
+204066ef
+1800220b
+20406042
+58000007
+e7e20005
+6fe4449d
+e7e40005
+6ff0449f
+e7f00005
+20600000
+18002211
+20406042
+58000008
+e7e20005
+58000000
+e7f00005
+e7f00005
+20600000
+18002208
+20406042
+58000009
+e7e20005
+6fe24467
+e7e20005
+6fec4472
+e7ec0005
+20600000
+70047708
+20205f34
+6fe2442a
+6842442a
+98417e00
+20600000
+d8a044a7
+20407c9a
+20405f8b
+2fec0001
+2020df89
+6fe24092
+c1850000
+20405f99
+24740000
+20204d8b
+20407dc1
+6fe24460
+c1000000
+6fe20450
+2fe180c0
+20608000
+20207dbf
+20405f8b
+2fec0001
+2020df89
+20600000
+20600000
+d8a009ba
+20407c8e
+70449102
+70449301
+20600000
+d8a00a6a
+20407c9a
+70449306
+70449102
+20600000
+18002241
+20406042
+5800000c
+e7e20005
+d8c045a4
+20207c8e
+20407025
+18002211
+20406042
+5800000d
+e7e20005
+202070c0
+6fe24496
+c17f8000
+d8400003
+98467c00
+24610000
+d8e0000a
+20407cf1
+247a0000
+20205f89
+4719c026
+6fe24496
+c0005fcf
+c000dfd5
+c0015fcf
+c001dfd7
+c002dfdb
+c003dfe7
+c0045fe9
+c004dff0
+20600000
+6fe24497
+c1820000
+704497ff
+704496ff
+700a953f
+20207bab
+70449602
+20205ee2
+70449604
+58017700
+d8e0000a
+20207ce3
+6fe24497
+c0025fde
+20600000
+70449607
+700a9529
+20407bab
+20405f62
+6fe24092
+c1850000
+20405f99
+20740000
+20204d8b
+70449608
+20205f6c
+6fe24424
+6842442b
+98417e00
+2fec0001
+2020dff2
+70449609
+20205f78
+20405f80
+20205ff2
+18000e0a
+20407ce2
+704497ff
+704496ff
+700a953e
+20207bab
+471a4026
+6fe24498
+c4038000
+6fe24491
+c1810000
+70449100
+6fe24493
+c000e038
+c001603f
+c001e032
+c0036019
+c003e010
+c0046006
+20600000
+6fe24635
+1fe20e00
+1fe0fe01
+67e24635
+6fe84499
+afefffff
+58000080
+7920fe00
+67e24636
+20206035
+6fe24494
+70449400
+c000e015
+70449102
+20600000
+700a9531
+20407bab
+70449605
+20205fb5
+6fe209b5
+c001e01d
+70449102
+20600000
+2040704c
+6fe24498
+c041e021
+20405ef8
+20407039
+da200aee
+da400a6a
+df200010
+20407d63
+2022e029
+7004770b
+20205f34
+2040744a
+2422e027
+7043fb01
+6fe24498
+c040e015
+c041e015
+70449102
+70449307
+20600000
+6fe24498
+c041e036
+70463600
+20205f1d
+70463500
+20205efb
+70449102
+6fe24495
+c001e03c
+20600000
+70449302
+7009b500
+2020794e
+70449102
+70449303
+20205faf
+18002406
+20205c27
+471ac026
+6fe202d7
+c000605c
+c000e064
+c001606f
+c001e08b
+c00260c2
+c002e0c7
+c00360cb
+c003e0d6
+c004607a
+c004e0d6
+c00560d0
+c005e0d6
+c0066080
+c006e0d6
+c0096087
+c009e0d6
+da200002
+da400007
+20405c22
+6fe202d7
+e7e20005
+20600000
+eff20006
+67f243a5
+efe40006
+67e4045b
+6fe2043b
+79207e05
+67e2043b
+20600000
+efea0006
+67ea43a0
+efe40006
+67e4045b
+68440455
+98467c00
+2421606f
+6fe2043b
+79207e06
+67e2043b
+20600000
+58000014
+67e40469
+67e4448c
+20600000
+da600013
+da200002
+da400002
+20405c22
+1a627e00
+e7e20005
+20600000
+da200009
+da400009
+20405c22
+58000001
+e7f00005
+20600000
+20748000
+da200006
+da40000c
+20405c22
+6fea44e2
+e7ea0005
+20600000
+da400013
+20206089
+da200001
+20205c22
+eff00006
+67f0449f
+efe40006
+67e4449d
+eff00006
+67f0447c
+efe80006
+67e843e3
+204060b0
+471b4026
+6fe24496
+c002e09d
+6fe244bb
+c280e0a0
+6fe24216
+245a68b0
+6fe243fb
+c00060a5
+70449701
+204060be
+20207258
+7043fb01
+d8c044bc
+d8a043eb
+20407c9a
+2020609d
+471bc026
+70449700
+70449600
+700a9541
+20207bab
+da200002
+da40000d
+20405c22
+58000006
+e7e20005
+20600000
+d8a04484
+18007208
+204066ef
+d8a043e7
+18007204
+204066ef
+da20000d
+da400004
+20405c22
+6ff04484
+e7f00005
+6fe843e7
+e7e80005
+20600000
+da400005
+20206089
+da400006
+20206089
+eff00006
+67f04484
+efe80006
+67e843e7
+20207258
+6fe2043b
+79207e04
+67e2043b
+20600000
+20748000
+700a9532
+20407bab
+70449704
+202060c0
+70449702
+204060d4
+700a9533
+20207bab
+da40000b
+20206089
+20600000
+20758000
+471c4027
+58000000
+67e20048
+67e20055
+67e20078
+67e2007c
+67e24159
+67e204d3
+67e2016b
+67e209b1
+70452d00
+70022700
+7004d400
+7009b100
+7009b000
+7004cd00
+20600000
+471cc027
+2054e6e1
+2454e6e5
+2040669e
+247a0000
+6fe2004c
+c4030000
+793ffe06
+793f8001
+67e2004c
+6fe2054d
+6842004c
+2feffe00
+79208401
+6042004c
+18410402
+6042007f
+6842004c
+1fe37e00
+67e2007d
+471d4027
+6fe2007d
+c03fe147
+c001e192
+c00261a3
+c01e613a
+c002e136
+c007e38a
+c0086205
+c011e223
+c01ce3a3
+c01c639e
+c018e208
+c01be291
+c013e28d
+c019e28a
+c012e28f
+c013621f
+c003e217
+c016e20e
+c017620f
+c000e286
+c0016271
+c0146395
+c004e267
+c005e240
+c0046224
+c006624b
+c00fe21b
+c010621d
+c010e2ab
+c01162ab
+c01ae2ac
+c01b62ad
+c01262ab
+c01a62ae
+c00be2b7
+c008e2d4
+c00962d8
+c009e2da
+c006e2ec
+c00762ec
+c017e28b
+c01862ec
+c00562ec
+c00c62ed
+c01962ec
+c01ee2f2
+c01f6333
+c01fe32d
+c020635a
+c020e36c
+c0036389
+c01d6138
+70007e19
+70007c04
+20600000
+70007c06
+20600000
+70007c3b
+20600000
+6fe8054e
+1fe3fe00
+67e840d2
+6fe20552
+67e240d9
+6fea0553
+67ea40e7
+6fea0558
+e7ea0005
+6fe20031
+79207e03
+67e20031
+20600000
+471dc027
+6fe2054e
+79207e07
+67e2007d
+c040e169
+c041616e
+c04ae292
+c04b62ab
+c045e2a0
+c041e186
+c0426188
+c048615b
+c04be17f
+c04c6184
+c04ce15e
+c04d6161
+c1420000
+70007c82
+70007e19
+20600000
+70007c82
+70007e2e
+20600000
+20406163
+70007c9a
+20600000
+20406163
+20206167
+d8a04630
+6fe6054f
+e7e60005
+20600000
+2020f58d
+20600000
+6fe20550
+79207e07
+67e204c5
+c045e173
+20600000
+6fe20550
+79207e07
+67e204c5
+c045e177
+20600000
+6fe2415b
+6842004c
+7d3a0405
+6042004c
+6fe20030
+c4028000
+793ffe05
+67e20030
+6fe204d3
+247a0000
+70007c31
+20600000
+2434e182
+70007c12
+202066cd
+70007c97
+20600000
+204066cd
+202063e0
+70007c84
+20600000
+68420551
+18410401
+604204cc
+6fe241cf
+c0a8e18e
+7041cf00
+6fe20055
+c18a8000
+70005504
+202066fd
+471e4027
+6fe2054e
+67e204c5
+c019e1b9
+c00461c8
+c007e1cf
+c00861d5
+c008e1d6
+c00961de
+c00c61f4
+c00be1f7
+c009e1b0
+c01ee300
+c01f634c
+c0206302
+c020e31f
+20600000
+471ec027
+6fe2054e
+67e204c5
+c000e1eb
+c019e1c3
+c005e1df
+c00461e2
+c009e1b3
+c02061ec
+c020e1ef
+c00c61f2
+c00be203
+20600000
+700a9520
+20407bab
+202041d8
+700a9519
+20407bab
+70452d02
+58000050
+d8e00006
+20207ce3
+6fe204cd
+79207e00
+67e204cd
+700a9501
+20407bab
+70007c8b
+6fe20055
+c082e0e8
+70005506
+20600000
+7004c60b
+70007c07
+70005500
+2020e0e8
+20600000
+6fe241be
+247a0000
+2040444b
+204063de
+20748000
+79200021
+20600000
+24748000
+70007c10
+6fe2004c
+c4010000
+70007c12
+20600000
+202063e0
+2040643b
+6fe20030
+c3820000
+70007c31
+6fe20055
+c1850000
+7000550b
+20600000
+20600000
+70007c07
+7004c613
+20600000
+6fe2054f
+c00361e8
+c18c0000
+7004c618
+70007c07
+20600000
+7004c606
+70007c07
+20600000
+20600000
+7009aa00
+70007c07
+202060e8
+7009aa00
+70007c07
+202060e8
+700a9524
+20207bab
+700a9523
+20407bab
+202046e5
+700a9522
+20407bab
+58000000
+67e40075
+6fe441e4
+1fe3fe00
+67e40032
+6fe241e6
+67e20073
+6fe241e8
+67e20074
+202046c2
+700a9521
+20207bab
+6842054e
+60420054
+20206219
+6fe204cd
+79207e02
+67e204cd
+c3818000
+70007c31
+202060e8
+20600000
+6fe240d0
+6842054e
+98467c00
+20216219
+70007c04
+70007e1f
+70007d2e
+20600000
+20406539
+20206219
+70007c03
+20600000
+70007c21
+20600000
+70007c22
+20600000
+6fe20055
+c1098000
+70005502
+20600000
+20600000
+204063db
+7004d001
+700a950a
+20407bab
+204066d5
+2420e3e3
+2434e22f
+70007c04
+70007d08
+70007e23
+20600000
+6fe2004b
+79207e02
+67e2004b
+20600000
+6842004c
+7d3a0401
+6042004c
+20600000
+6fe2007f
+1fe37e00
+1fe17e01
+20600000
+6fe24216
+207a0000
+6fe209b1
+205a68a4
+20600000
+2040623b
+20406237
+67e204d1
+204063db
+70007c0c
+6fe241be
+247a0000
+6fe20030
+c3830000
+70007e06
+20206134
+da200040
+20407147
+6fe8054e
+6848058e
+98467c00
+2022e254
+70007c07
+7004c605
+20600000
+20406258
+6fe2462c
+203a6320
+20600000
+2040723c
+204041ae
+6fe2004b
+2feffe01
+793ffe01
+67e2004b
+6fe20055
+c00ce262
+c00c6262
+20600000
+6fe209b1
+c1800000
+6fe2004c
+c3810000
+20206793
+da20054e
+da40057e
+d8a0055e
+20407208
+da200040
+204066f3
+70007c0b
+6fe20030
+c30363de
+20600000
+6fe4015d
+1fe0f3fd
+6842054e
+580000ff
+98408a00
+d8c00550
+20407cdc
+68420053
+6fe2054f
+98467e00
+1fe67c0e
+20216281
+1840fe0e
+67e20053
+70007c01
+20600000
+6fe2004c
+79207e03
+67e2004c
+c28263e8
+20600000
+6fe2054e
+67e2007d
+70007c02
+20600000
+20206219
+70007c30
+20600000
+70007c28
+20600000
+70007c26
+20600000
+20600000
+6fe40032
+98000400
+6fe2054f
+67e20095
+984f8400
+6fe40550
+1fe3fe00
+67e40096
+6fe80552
+1fe3fe00
+67e80091
+18427e00
+67e40098
+20600000
+6842415b
+6fe2054f
+9842fc00
+2422e158
+2feffe00
+6fe2004c
+7920fe05
+67e2004c
+70007c81
+70007d8b
+20600000
+20600000
+20206219
+20206219
+6fe4054e
+67e4016f
+20600000
+6fe40551
+68424173
+984ffe00
+d8400640
+98467c00
+20600000
+202062d2
+6fe40553
+203a62d2
+204062b1
+202162d2
+6fe24092
+1fe67c0a
+2042d0c1
+6fe20030
+c280e2d2
+6fe4054f
+1fe3fe00
+67e40075
+6fe40551
+1fe3fe00
+67e40032
+6fe40553
+67e20073
+98000400
+6fe40555
+67e20074
+98467c00
+242162cf
+67e20073
+70007c03
+70007d17
+20600000
+70007e24
+20206134
+20406219
+204063db
+2040714a
+202046b4
+20406219
+202046bc
+6fe8054e
+1fe3fe00
+2034e2e6
+684241be
+243a62e3
+70007c04
+70007d13
+70007e24
+20600000
+70007c34
+70005500
+202041d5
+204041d5
+79200022
+6fe2016b
+793ffe02
+67e2016b
+20206219
+20600000
+70007c03
+70007d18
+700a952e
+20407bab
+202046e5
+6fe2054e
+c080e2fe
+6fe2054f
+c080e2fe
+6fe20550
+c09862fe
+204066de
+2020e2fb
+7009aa01
+70007c03
+70007d3d
+202060e8
+70007e24
+20206134
+70007c3e
+20600000
+6fe24634
+c000e309
+c001630d
+204066de
+20608000
+7009aa08
+20600000
+20407817
+700a9535
+20407bab
+20206305
+204066de
+20608000
+6fe24635
+c009e31d
+1fe0fe01
+67e24635
+7009ac01
+7009aa04
+6fe24635
+1fe20e00
+6fec4658
+afefffff
+58000080
+7920fe00
+67e24636
+20600000
+7009aa08
+20600000
+20406325
+6fe24637
+207a0000
+70463700
+700a9538
+20207bab
+204066de
+2440f81a
+2040f82a
+204066de
+20608000
+7009aa0c
+7009ac01
+20600000
+d8a00a6a
+d8c0054e
+20407c9a
+6fe24634
+c1010000
+2020758d
+6fe209ab
+c003e337
+6fe209aa
+c080e34a
+6fe209b3
+1fe60a20
+2421634a
+d8a009c2
+98a08a00
+6ff0054e
+e7f00005
+6ff00556
+e7f00005
+6fe209b3
+1fe0fe10
+67e209b3
+c0986219
+204066de
+2020e219
+7009b401
+7009aa02
+7009ac01
+20206219
+70007e24
+20206134
+6fe209b2
+c0186350
+70007c3e
+202060e8
+204066de
+2020e359
+6fe24634
+c0016357
+7009ac01
+7009aa04
+202060e8
+700a9536
+20207bab
+202060e8
+6fe209ab
+c003e35e
+6fe209aa
+c083636a
+d8a00a2a
+6ff0054e
+e7f00005
+6ff00556
+e7f00005
+204066de
+2020e368
+7009aa07
+7009ac01
+20206219
+7009ab04
+2020758d
+70007e24
+20206134
+6fe209ab
+c005e370
+6fe209aa
+c084637f
+d8a00a5a
+d8c0054e
+20407c9a
+204066de
+2020e37c
+6fe24634
+c000e381
+70463300
+7009aa09
+7009ac01
+70007d41
+202060e8
+7009ab09
+7009ad01
+202060e8
+70007e24
+20206134
+6fe24633
+c283e386
+79207e06
+67e24633
+20600000
+c2806377
+70463300
+2020637f
+202060e8
+6fe2016b
+793ffe01
+67e2016b
+20406219
+24748000
+6fe2054e
+6842004b
+793a0404
+7d3a0405
+6042004b
+20600000
+6850054e
+6fe20055
+c1818000
+6fe2016b
+c302639c
+70005514
+20600000
+70005504
+20600000
+6fe2017d
+67e20159
+70007c03
+70007d38
+20600000
+70007c03
+70007d39
+18007209
+d8c0054e
+d8a00150
+efe20006
+1fe2fe55
+e7e20005
+c20063a8
+6fe20150
+6842014f
+793f8407
+793f8404
+c07fe3bc
+c00063d5
+c002e3c9
+c003e3c8
+c00363c9
+c00463c8
+c000e3c1
+c00163c1
+c001e3c1
+c004e3c1
+c00263c1
+20600000
+6fe2014f
+79207e03
+79207e02
+67e2014f
+20600000
+79200404
+70017e05
+6fe40157
+98007200
+67e4015d
+d8a0054d
+20407d4e
+79200407
+79200402
+18007e00
+67e2000b
+67e400f8
+67e400fa
+67e400f6
+67e400f4
+6fe20151
+2fe1fe00
+79208406
+6042014f
+20600000
+793f8011
+70014f00
+6fe2017d
+793ffe06
+67e2017d
+20600000
+d8c0054e
+d8a0055e
+20207c9a
+70007c09
+20600000
+24748000
+70007c11
+20600000
+da2040a0
+20407114
+70007c03
+70007d08
+20600000
+7000720a
+70007c07
+7004c616
+20600000
+471f4027
+78547c00
+204066a3
+6fe20048
+207a0000
+c283e421
+c000e551
+c00164c6
+c001e42c
+c0026442
+c013e5bd
+c01464ea
+c01864d6
+c012e5b8
+c01364e5
+c018e5a5
+c01be54c
+c019e53e
+c004663b
+c004e631
+c005e646
+c006664f
+c007e544
+c0086674
+c008e66a
+c003e534
+c0156560
+c0056561
+c00fe59e
+c00364db
+c010e541
+c016e594
+c0176599
+c0116541
+c01a6562
+c009e577
+c00be586
+c0096671
+c017e58c
+c00c6591
+c01ee5e1
+c01f65ed
+c01fe5ff
+c0206609
+c020e61e
+c011e62d
+c01de628
+c002e62e
+c014e62f
+c01c6630
+c01ce557
+20204a8b
+20600000
+c040e44f
+c042647b
+c0416458
+c041e4ef
+c045e4fa
+c04be530
+c04ce4b7
+c04d6486
+c04ae4bc
+c04b64bd
+20204a8b
+18007e02
+2040667a
+6fe20049
+e7e20005
+20406689
+471fc027
+6fe20049
+c0046462
+c007e466
+c0086471
+c00be441
+c019e474
+c020e47a
+c008e43b
+20600000
+6fe20055
+207a0000
+7000551b
+5800000c
+d8e00007
+20207ce3
+202046c2
+18007e03
+2040667a
+6fe20049
+c005e44a
+e7e20005
+6fe2004a
+e7e20005
+20206689
+e7e20005
+6fe2004a
+e7e20005
+d84004d1
+202066c4
+18000e04
+20406682
+5800007f
+e7e20005
+6fe20049
+793ffe07
+e7e20005
+6fe20049
+20206689
+18000e05
+20406682
+5800007f
+e7e20005
+6fe20049
+793ffe07
+e7e20005
+6fe2004a
+e7e20005
+20206689
+2040444b
+204066d5
+20608000
+202063de
+6fe2004b
+c282e46d
+c4020000
+70007c12
+793ffe04
+204066cd
+2020646f
+70007c10
+793ffe05
+67e2004b
+20600000
+204066de
+2020e3e0
+20600000
+70007c8b
+6fe204cd
+79207e00
+67e204cd
+700a9501
+20207bab
+20600000
+18000e0c
+20406682
+58000001
+e7e20005
+6fe404ca
+e7e40005
+58000000
+e7e60005
+58000000
+e7e80005
+20206692
+18000e05
+20406682
+6fe6462d
+e7e60005
+20406692
+70463701
+6fe2462d
+c000e497
+c0016491
+c001e49d
+20600000
+6fe24630
+c00064a9
+c000e4a9
+c00164a9
+c001e4a3
+20600000
+6fe24630
+c00064a3
+c000e4a7
+c00164a9
+c001e4a3
+20600000
+6fe24630
+c00064a3
+c000e4a3
+c00164a3
+c001e4a3
+20600000
+70463403
+6fe2452e
+c2804d64
+20600000
+70463401
+20600000
+70463402
+20600000
+d8e00000
+202064af
+d8e00000
+202064b3
+6fe2452e
+f9207e00
+67e2452e
+20600000
+6fe2452e
+f93ffe00
+67e2452e
+20600000
+18000e05
+20406682
+6fe6462d
+e7e60005
+20206694
+20600000
+18000e09
+20406682
+6fe20095
+e7e20005
+6fe40096
+e7e40005
+6fe80091
+e7e80005
+20206692
+18007e11
+2040667a
+6fe20049
+1fe20400
+c00064ce
+c00764ce
+c00e64ce
+20600000
+e7e20005
+6fe244e7
+e7e20005
+df20000e
+580044e8
+98408c00
+20407cdc
+20206692
+18007e03
+2040667a
+58000114
+e7e40005
+20206692
+18007e03
+2040667a
+6fe80163
+9c467e00
+2034e4e1
+1fe67e00
+1feb7e00
+793ffe0f
+e7e40005
+20206692
+18007e06
+2040667a
+6fea44e2
+e7ea0005
+20206692
+18007e09
+2040667a
+6ff04098
+e7f00005
+20206692
+18000e0c
+20406682
+58000001
+e7e20005
+6fe404ca
+e7e40005
+58000000
+e7e60005
+58000000
+e7e80005
+20206694
+18000e03
+20406682
+6fe2415b
+e7e20005
+78547c00
+20406694
+24740000
+24748000
+6fe240d8
+c4000000
+20406514
+2020651e
+47204028
+6fe2409e
+79207e03
+67e2409e
+58000101
+67e404ca
+20600000
+4720c028
+6fe2409e
+793ffe03
+67e2409e
+58000000
+67e404ca
+20600000
+7040d803
+58000000
+67e84142
+d8a040da
+20406522
+d8a040e7
+20406522
+d8a04146
+20406522
+20206529
+d8a040e7
+20406522
+20406529
+2020652c
+58ffffff
+e7e60005
+e7e60005
+e7e60005
+5800007f
+e7e20005
+20600000
+58000000
+67e440d6
+20600000
+6fe240d8
+79207e02
+67e240d8
+20600000
+18000e02
+20406682
+2434e692
+20206694
+18007e02
+2040667a
+6fe204c6
+e7e20005
+20406694
+6fe2004b
+79207e03
+67e2004b
+70007232
+20600000
+18007e01
+2040667a
+20206694
+18007e01
+2040667a
+20206692
+18007e02
+2040667a
+6fe2004c
+2fec0002
+7920fe00
+1fe17e01
+e7e20005
+20206694
+18007e03
+2040667a
+6fe40051
+e7e40005
+20206694
+700072fa
+18007e02
+2040667a
+6fe20053
+e7e20005
+20206694
+18007e0a
+2040667a
+d8c00150
+18007209
+efe20006
+1fe2fe55
+e7e20005
+c200655b
+20206694
+20206694
+20206694
+20748000
+20404829
+18007e09
+2040667a
+6fe4016f
+e7e40005
+6fe640a0
+e7e60005
+6fe240a3
+e7e20005
+6fe440a4
+e7e40005
+c581e573
+793f8003
+20406694
+70007c13
+20600000
+20406692
+70007c03
+70007d13
+20600000
+d8400200
+2034e57b
+1d027e00
+2020657c
+1c427e00
+1c227e00
+9840fe00
+1fe17ffc
+67e80034
+18007e05
+2040667a
+6fe80034
+1fe37e00
+e7e80005
+20206694
+18007e0a
+2040667a
+d8c004d5
+eff20006
+e7f20005
+20206694
+18007e03
+2040667a
+58000114
+e7e40005
+20206694
+18007e01
+2040667a
+20206694
+18007e02
+2040667a
+6fe240d0
+e7e20005
+20206694
+18007e02
+2040667a
+58000005
+e7e20005
+20206694
+18007e02
+2040667a
+58000000
+e7e20005
+20206694
+70007c2e
+20600000
+6fe24092
+1fe67c0a
+2042e5a3
+6fe20030
+79207e04
+67e20030
+1c427e00
+67e804e5
+6fe204cd
+c281e5b6
+79207e03
+67e204cd
+700a9505
+20407bab
+18007e01
+2040667a
+20206694
+70004800
+20600000
+18007e06
+2040667a
+6fea44e2
+e7ea0005
+20206694
+18007e09
+2040667a
+6ff04098
+e7f00005
+20206694
+7009ad01
+6fe24583
+c1808000
+7009ab13
+20600000
+204066d1
+70007c99
+7009ab03
+20600000
+204066d1
+70007c3d
+7009ab07
+20600000
+da200a4a
+da400a6a
+df200010
+20407d63
+2022e5d9
+7009ab00
+2040758f
+70007e24
+70007d40
+20206134
+7009ab0a
+2040758d
+70007d40
+20206219
+70007c40
+20600000
+70007c3d
+20600000
+7009b200
+18007e04
+2040667a
+18007e01
+e7e20005
+18007e01
+e7e20005
+18007e30
+e7e20005
+204066de
+2020e694
+20206692
+18007e11
+2040667a
+6fe209b2
+d8c045fc
+98c08c00
+eff00006
+e7f00005
+eff00006
+e7f00005
+6fe209b2
+1fe0fe10
+67e209b2
+204066de
+2020e694
+20206692
+7009aa06
+70007c3f
+20600000
+18007e11
+2040667a
+d8c00a4a
+eff00006
+e7f00005
+eff00006
+e7f00005
+20206692
+70007c40
+20600000
+204066de
+2040f4c7
+18007e11
+2040667a
+d8c00a1a
+eff00006
+e7f00005
+eff00006
+e7f00005
+204066de
+2420e692
+2020e694
+7009ab0f
+204066d1
+70007c0b
+204066e9
+2020f503
+2020750d
+204066cd
+70007c41
+20600000
+18007e11
+2040667a
+d8c00a4a
+eff00006
+e7f00005
+eff00006
+e7f00005
+204066de
+2420e692
+2020e694
+18007e03
+2040667a
+5800fffe
+e7e40005
+20206692
+20206694
+20206694
+20206694
+20206694
+204066ed
+da2040a0
+204066f3
+18007e11
+2040667a
+da20057e
+da40055e
+20407208
+2434e689
+2020668f
+204066ed
+da200040
+20407114
+18007e11
+2040667a
+d8c0055e
+20407c9a
+6fe20055
+c00ce694
+c00c6694
+2020668f
+6fe209b1
+203a664c
+204066de
+2040e6d1
+2440e6cd
+2020664d
+204066d1
+204066ed
+2020663e
+da2040a0
+20407147
+18007e05
+2040667a
+6fe8058e
+e7e80005
+d84004d1
+204066c4
+2040723c
+204066de
+2020e65e
+7004d401
+6fe209b1
+207a0000
+70007c0b
+6fe241be
+207a0000
+204066de
+2420e666
+6fe204d3
+207a0000
+70007c0f
+20600000
+c6908000
+793f8021
+70007c0f
+20600000
+204066ed
+2040714a
+18007e11
+2040667a
+d8c0055e
+20407c9a
+2020668f
+18007e01
+2040667a
+2020668f
+18007e02
+2040667a
+18007e10
+e7e20005
+67e20054
+2020668f
+1fe9fe00
+1fe1fe07
+67e204b2
+df200011
+d8a004b4
+20407caf
+d8a004b4
+20600000
+1fe1227f
+7000487f
+18e27e00
+2040667a
+1a227e00
+e7e20005
+20600000
+6fe20048
+1fe3fe00
+6842004c
+284ffe01
+7920fe00
+20206699
+6842004c
+18410401
+20206695
+18000400
+20206695
+18000401
+6fe20048
+1fe3fe00
+7934fe00
+9842fe00
+67e204b3
+70004800
+204066a9
+78347c00
+20600000
+6fe2007c
+207a0000
+204066a3
+6fe2007c
+20600000
+47214028
+6fe20048
+203a66a9
+6fe20078
+247a0000
+202066b3
+6fe20078
+203a66b9
+6fe60078
+67e60048
+6842007b
+6fe2004c
+793ffe01
+9841fe00
+67e2004c
+70007800
+6fe2007c
+207a0000
+6fe8007c
+67e80078
+70007c00
+20600000
+6fe2007c
+207a0000
+6fe6007c
+67e60048
+6842007f
+6fe2004c
+793ffe01
+9841fe00
+67e2004c
+70007c00
+20600000
+4721c028
+6fe2004c
+1fe22600
+efe20002
+20406233
+20406689
+1a627e00
+67e2004c
+20600000
+6842004c
+793f8400
+6042004c
+20600000
+6842004c
+79200400
+6042004c
+20600000
+7d34fe01
+6842004c
+9842fe00
+2feffe01
+20600000
+6fe2004c
+7934fe01
+67e2004c
+20600000
+6fe209b0
+2fe0fe01
+20600000
+6fe209b0
+79207e07
+67e209b0
+20600000
+6fe209b0
+793ffe07
+67e209b0
+20600000
+6fe209b0
+2feffe07
+67e209b0
+20600000
+d8a0055e
+18007210
+180a7e00
+e7e20005
+c20066ef
+20600000
+20407118
+da2041bf
+da40058e
+eff00011
+68420030
+7d3a0406
+60420030
+1a220a00
+20407208
+202041c0
+47224028
+2040669e
+247a0000
+6fe20055
+207a0000
+c0026751
+c002e756
+c0016748
+c001e75e
+c007674b
+c003677a
+c003e792
+c004e793
+c005679c
+c005e7a0
+c0066768
+c006e76b
+c007e771
+c009673b
+c009e75e
+c008673e
+c00a6738
+c00ae75e
+c00b6732
+c00c6737
+c00be72b
+c00ce731
+c00d671c
+c00de726
+70005500
+20600000
+6fe204cd
+c4010000
+c4018000
+70005500
+20406722
+20206bae
+6fe2016b
+c4008000
+7000550a
+20600000
+d8e00007
+20407cf1
+247a0000
+7000551a
+20600000
+6fe2016b
+793ffe00
+67e2016b
+70005519
+70007c0b
+20600000
+20600000
+6fe204d0
+c1810000
+204067a2
+70005518
+20600000
+20600000
+70005515
+70007c83
+20600000
+70005513
+70007c25
+20600000
+6fe2452d
+c1000000
+c000e746
+d8e00006
+20407cf1
+247a0000
+70452d00
+2020675f
+20748000
+2020677a
+70005503
+70007c27
+20600000
+70007c13
+79200003
+70005505
+580001ff
+67e404ce
+20600000
+70005505
+7004ceff
+793f8022
+70007c33
+202060e5
+c6110000
+6fe404ce
+1fe67e01
+2022e75c
+67e404ce
+20600000
+7000550e
+20600000
+20600000
+6fe204cd
+c4018000
+c4010000
+6fe2016b
+793ffe02
+67e2016b
+70007c13
+70005510
+20600000
+7000550d
+70007c31
+20600000
+6fe204cd
+c4010000
+70005500
+20600000
+70005506
+20600000
+6fe204ce
+1fe0ffff
+203a6776
+67e204ce
+20600000
+70007c07
+7004c616
+70005500
+20600000
+6fe2016b
+c281675f
+c280677f
+7000551a
+20600000
+6fe241be
+203a678b
+6fe204cd
+c4018000
+c4010000
+6fe804e5
+d8400064
+98408400
+1c427e00
+98467c00
+24610000
+2020672b
+70005516
+70465704
+58003030
+67e44658
+e7e40005
+7004d002
+20206732
+20600000
+6fe2016b
+c280e797
+7000551a
+20600000
+6fe2016b
+793ffe01
+67e2016b
+70007c0f
+20600000
+6fe204d4
+207a0000
+70005500
+20206797
+7000550c
+20600000
+6fe2004b
+c28167a7
+204066d1
+70007c08
+202050ea
+6fe2004b
+793ffe02
+67e2004b
+204063e3
+204066da
+202050ea
+58000004
+67e24657
+58003030
+e7e40005
+e7e40005
+20600000
+70801001
+20600000
+47244029
+6fe44ff6
+1fe21400
+20600000
+4724c029
+19427e00
+67e44ff6
+6fe28043
+c3838000
+79207e07
+67e28043
+20600000
+1f227e00
+207a0000
+1f20f3f8
+204167ce
+20628000
+202167c3
+1f20f208
+1f20f3fc
+204167d1
+20628000
+202167c8
+1f20f204
+202067d4
+eff00006
+e7f0000a
+20600000
+efe80006
+e7e8000a
+20600000
+1f227e00
+207a0000
+efe20006
+e7e2000a
+c20067d6
+20600000
+1f227e00
+207a0000
+1f20f3f8
+204167e7
+20628000
+202167dc
+1f20f208
+1f20f3fc
+204167ea
+20628000
+202167e1
+1f20f204
+202067ed
+eff00003
+e7f00005
+20600000
+efe80003
+e7e80005
+20600000
+1f227e00
+207a0000
+efe20003
+e7e20005
+c20067ef
+20600000
+47254029
+18627e00
+67e44ffc
+20600000
+4725c029
+6fe44ffc
+1fe20600
+20600000
+700a953d
+20207bab
+47264029
+6fe24216
+207a0000
+20406895
+2042e89b
+20406830
+6fe24216
+1fe22600
+68444214
+6044018a
+1a627e00
+203a67fb
+1a60a7ff
+18422200
+efe20011
+68420182
+98467c00
+2042e817
+20216813
+efe20011
+1fe0fe01
+e7e20011
+6844018a
+18408422
+6044018a
+20206807
+58000000
+e7e20011
+6fe20183
+e7e20005
+c099e825
+da4041bf
+efec0006
+e7f00005
+58000000
+e7f00005
+1a420c00
+20407c9a
+18007c01
+20600000
+c01b6829
+c01be82d
+da4043eb
+2020681d
+d8c044a7
+20407c9a
+d8c043eb
+20206822
+d8c0449f
+20407c9a
+2020682b
+20407dc1
+6fe24216
+207a0000
+6fe44652
+c2806846
+4726c029
+6fe24460
+c000683f
+6fe20450
+2fe180c0
+2020e83f
+2fe18040
+2020e844
+2fe18000
+2020e842
+70018335
+6fec044b
+20206849
+70018337
+20206849
+70018336
+20206849
+47274029
+70018333
+6fec0040
+67ec0184
+6fe44214
+e842003f
+1fe0fe01
+67e4018a
+60420182
+6fe24216
+1fe22600
+6fe4018a
+1fe22200
+20406861
+20740000
+6844018a
+18408422
+6044018a
+184085ff
+efe20002
+67e20182
+1a60a7ff
+2422e851
+6fe24216
+1fe0ffff
+67e20182
+20600000
+6fe20183
+c099e868
+da400183
+df200007
+20407d63
+2022fdbf
+20600000
+c01b686b
+c01be886
+20206863
+e8420011
+98467c00
+24628000
+d8a00abe
+df200010
+20407caf
+6fe6044e
+67e60abe
+2040687d
+6fe40adb
+1ff0fe00
+1fed0400
+efe20006
+9840fe00
+6846044b
+98467c00
+2022fdbf
+20600000
+d8c00abe
+2040733b
+efe20011
+20407338
+18006c50
+18006c00
+204072d1
+d8a00ace
+2020734c
+e8420011
+98467c00
+24628000
+18c22200
+18c0a608
+da40449f
+df200008
+20407d63
+2022fdbf
+1a622200
+da4044a7
+df200008
+20407d63
+2022fdbf
+20600000
+6fe44214
+e842003f
+1fe0fe22
+efe2003f
+98467c00
+20600000
+6fe24216
+1fe27200
+68444214
+58000000
+e7e20002
+18408422
+1fe0fe01
+c200689f
+20600000
+4727c029
+20406830
+6fe20030
+79347e06
+67e20030
+243468ae
+1a208c0a
+d8a041bf
+20407c9a
+202068be
+7041be00
+20600000
+6ff2449d
+203a68bc
+20406830
+243468bc
+6fe4018a
+1fe08c01
+d8a044a7
+20407c9a
+d8a043eb
+20407c9a
+7043fb01
+20600000
+7043fb00
+20600000
+6ff041bf
+685041c7
+9841fe00
+207a0000
+7041be01
+20600000
+20758000
+70453900
+7004e903
+7004ea03
+7004ee11
+7004ef13
+58000000
+67e604eb
+67e24226
+70465100
+4728402a
+58000000
+67e24226
+67e24536
+67e2452f
+6fe2453d
+c000e8d7
+70453b50
+20600000
+70453b00
+20600000
+18418402
+20600000
+18427e00
+1fedfe00
+67e24534
+18007e3f
+1fedfe00
+67e24533
+18007e01
+1fedfe00
+67e24532
+20406911
+18427e00
+20600000
+1fedfe00
+67e24534
+18007e73
+1fedfe00
+67e24533
+18007e01
+1fedfe00
+67e24532
+20206911
+6fe24535
+203a68f4
+58000070
+20600000
+580000aa
+20600000
+1fedfe00
+67e24534
+18007eef
+20406905
+684404f3
+18420a00
+e7e20005
+18a20400
+604404f3
+18007eff
+20406905
+684404f3
+18420a00
+e7e20005
+20600000
+1fedfe00
+67e24533
+6fe44533
+1fed7e00
+67e604f0
+da200107
+da40000f
+2040691e
+1fe2fed7
+1fe47e00
+1fedfe00
+20600000
+6fe64532
+67e604f0
+da200107
+da40000f
+2040691e
+1fed7e00
+da400007
+2040691e
+1fe2fe2b
+1fe47e00
+1fedfe00
+1fe20400
+20600000
+da600000
+1a427200
+20407c4c
+1fe20400
+18427e00
+1a63a600
+c3046927
+9a228400
+1a60a601
+18438400
+6fe604f0
+1a40a5ff
+2a41feff
+2020e931
+1a427200
+20407c4c
+2feffe00
+79208400
+20206922
+18437e00
+20600000
+6842452f
+184b8400
+79200400
+6fe24535
+245a68d9
+60420509
+20600000
+18438400
+6fe24535
+793a0400
+20600000
+684204f8
+7004fad7
+20406a77
+6fe24223
+79207e06
+79207e07
+67e24223
+70453500
+20206a58
+6fe24223
+79207e07
+67e24223
+20206a58
+4728c02a
+6fe24651
+c000694f
+20206a0d
+6fe40260
+1fe20c00
+20406979
+6fe204f8
+c0006955
+202069d9
+4729402a
+6fe204f9
+c01fe93e
+c039e947
+c077e95c
+c029ea05
+20600000
+6fe404fd
+1fe20c00
+20406984
+6fe204ff
+c020e966
+c020696e
+c038e9a7
+c03869b3
+c024e9be
+20206a58
+20406970
+20206968
+6fe24226
+79207e00
+79207e01
+67e24226
+20406aa1
+20206a58
+20406970
+20206a58
+2040698c
+20206998
+2040698c
+efe20006
+1fe97e00
+67e2453c
+efe20006
+67e20504
+20600000
+efe20006
+67e204f7
+1fe97e00
+67e204f8
+efe20006
+67e204f9
+2040698f
+604404fb
+18c27e00
+67e404fd
+20600000
+efe20006
+1fe37e00
+67e204ff
+2040698f
+60440500
+18c27e00
+67e40502
+20600000
+6fe40502
+1fe20c00
+20600000
+efe20006
+1fe20400
+18430400
+c3800000
+efe20006
+1fe9fe00
+1ff27e00
+98408400
+20600000
+efe20006
+67e2452f
+efe20006
+67e20505
+efe20006
+67e20506
+efe20006
+67e20507
+efe40006
+67e44530
+efe20006
+67e20508
+efe20006
+67e2453a
+20600000
+20406972
+202069a9
+6fe24226
+79207e05
+79207e06
+67e24226
+6842452f
+184b8400
+18418403
+20406ad2
+70453903
+20206a58
+700a9508
+20407bab
+20406972
+6fe2453c
+1fe67c01
+2022e9ba
+20204a8b
+6fe24226
+79207e07
+67e24226
+20206a58
+2040698c
+efe20006
+67e20abe
+204056ac
+204056ba
+5800000e
+e7e40005
+6fe4421c
+e7e40005
+6fe24535
+1fe3fe00
+79207e00
+e7e20005
+4729c02a
+580015ef
+e7e40005
+58001191
+e7e40005
+6fe20abe
+e7e20005
+58000007
+e7ea0005
+58000001
+e7e40005
+204068f0
+e7e20005
+20600000
+202069da
+472a402a
+6fe204f9
+c039e9e2
+c01fe9e6
+c077ea00
+c07fe9f8
+c029ea07
+20600000
+6fe24226
+79207e03
+67e24226
+20206a58
+6fe24226
+79207e03
+79207e02
+67e24226
+6fe204f7
+204068e7
+67e204fa
+20406a77
+6fe204f7
+1feb7e00
+67e2452f
+1febfe00
+793ffe01
+79207e00
+d8404537
+604404f3
+204068f6
+20206a58
+6fe404fd
+1fe20c00
+1fe0fe01
+67e404fd
+efe20006
+6842453a
+9840fe00
+67e2453a
+20406b01
+20406933
+20406ae9
+20406b0a
+20206a58
+700a9509
+20407bab
+204068ce
+6fe204f7
+204068e7
+67e204fa
+20406a77
+20206a58
+6fe40260
+1fe20c00
+20406979
+6fe204f8
+c0006a13
+20206a47
+472ac02a
+6fe204f9
+c01fe93e
+c039e947
+c077ea19
+20206a58
+6fe404fd
+1fe20c00
+20406984
+6fe204ff
+c020ea22
+c0206a22
+c038ea2d
+c0386a3d
+20206a58
+20406970
+6fe2452f
+1fe37e00
+68424536
+98467c00
+2022ea29
+20204a8b
+6fe24226
+79207e01
+67e24226
+20206a58
+20406972
+6fe2453c
+68424536
+98467c00
+2022ea34
+20204a8b
+20206a58
+6fe24226
+79207e05
+79207e06
+67e24226
+6842452f
+184b8400
+18418403
+20406ad2
+20206a58
+20406972
+6fe2453c
+68424536
+98467c00
+2022ea43
+20204a8b
+6fe24226
+79207e07
+67e24226
+20206a58
+6fe204f8
+68424536
+98467c00
+2022ea4d
+20204a8b
+20206a58
+6fe204f9
+c039ea52
+c077ea00
+c07fe9f8
+c029ea57
+6fe24226
+79207e03
+67e24226
+20206a58
+20206a56
+20206a07
+20600000
+6fe24539
+207a0000
+c001ea5d
+20204a8b
+70453900
+204056ac
+d8400001
+6842452f
+184b8400
+18418403
+da2000aa
+20406abd
+204056ba
+18a20c00
+efe40006
+203a4a8b
+20600000
+204056ba
+58000004
+e7e40005
+6fe4421c
+e7e40005
+6fe204f7
+e7e20005
+472b402a
+5800013f
+e7e40005
+6fe204fa
+e7e20005
+20600000
+204056ac
+204056ba
+58000004
+e7e40005
+6fe4421c
+e7e40005
+6fe204f7
+e7e20005
+472bc02a
+58000173
+e7e40005
+6fe204fa
+e7e20005
+20600000
+204056ba
+5800000e
+e7e40005
+6fe4421c
+e7e40005
+6fe24535
+1fe3fe00
+79207e00
+e7e20005
+472c402b
+580015ef
+e7e40005
+58001183
+e7e40005
+18427e00
+e7e20005
+580000f0
+e7e60005
+5800007f
+e7e40005
+58000000
+e7e20005
+58000001
+e7e20005
+204068f0
+e7e20005
+70453b10
+20600000
+204056ac
+204056ba
+5800000e
+e7e40005
+6fe4421c
+e7e40005
+6fe24535
+1fe3fe00
+79207e00
+e7e20005
+472cc02b
+580015ef
+e7e40005
+58001181
+e7e40005
+6fe2452f
+e7e20005
+580000e0
+e7e60005
+6fe4453e
+e7e40005
+58000000
+e7e20005
+6fe24540
+e7e20005
+204068f0
+e7e20005
+20600000
+204056ba
+58000008
+e7e40005
+6fe4421c
+e7e40005
+6fe24535
+1fe3fe00
+79207e00
+e7e20005
+472d402b
+580009ef
+e7e40005
+580005e3
+e7e40005
+18427e00
+e7e20005
+5800008d
+e7e20005
+204068f0
+e7e20005
+20600000
+204056ac
+204056ba
+58000008
+e7e40005
+6fe4421c
+e7e40005
+18421600
+6fe24535
+1fe3fe00
+79207e00
+e7e20005
+472dc02b
+580009ef
+e7e40005
+580005e1
+e7e40005
+19627e00
+e7e20005
+5800008d
+e7e20005
+204068f0
+e7e20005
+20600000
+472e402b
+6fe2453b
+207a0000
+1a227e00
+67e20a97
+60420a96
+20405648
+247a0000
+204056ac
+204056ba
+58000005
+e7e40005
+6fe4421c
+e7e40005
+6fe20509
+e7e20005
+580001ff
+e7e40005
+6fe2453b
+e7e20005
+6fe24538
+e7e20005
+70453b00
+20600000
+472ec02b
+6fe2453d
+c1008000
+6fe404fb
+207a0000
+6fe2453b
+1fe0fe01
+67e2453b
+20600000
+6fe44541
+20207d77
+472f402b
+6fe2453a
+207a0000
+1fe0ffff
+67e2453a
+6fe44530
+6844466a
+98467c00
+20216b16
+67e4466a
+6fe2453b
+203a6b1e
+70050c01
+6fe24538
+67e2050b
+580000ff
+67e2050a
+20206b23
+70050c00
+6fe24537
+67e2050b
+580000ef
+67e2050a
+472fc02b
+6fe4466a
+1fe67c7f
+20216b2a
+6fe2050c
+1fe0fe01
+67e2050c
+20406933
+6fe4466a
+1fe0fe08
+6842050c
+9840a200
+2040561a
+67e40273
+1fe0fe04
+67e40275
+1fe20a00
+6fe20509
+e7e20005
+6fe2050a
+e7e20005
+20406b54
+20406b65
+4730402c
+6fe44543
+1fe20600
+6fe4466a
+1fe27200
+204067da
+18a20400
+18627e00
+67e44543
+18420a00
+6fe2050b
+e7e20005
+6fe40273
+1fe20a00
+6fe4466a
+6842050c
+9840fe00
+1fe0fe04
+e7e40005
+6fe4421c
+e7e40005
+70453b00
+6fe44545
+c0004ed4
+700b0100
+20600000
+4730c02c
+6fe4466a
+1fe67c7f
+24216b5c
+1fe3fe00
+79207e00
+e7e20005
+20600000
+6fe4466a
+1fe97e00
+1ff18400
+1fe17e7f
+1fe3fe00
+793ffe00
+e7e20005
+e0420005
+20600000
+6fe2453b
+207a0000
+e7e20005
+20600000
+4731402c
+20407bc1
+20404c8f
+204066fd
+4731c02c
+20407591
+2040756a
+2040757b
+20405648
+247a0000
+20405183
+20405648
+247a0000
+4732402c
+20406bb4
+2040533e
+20406a59
+20406b7d
+4732c02c
+20204c8b
+6fe2027b
+c2805461
+c283d46b
+20600000
+4733402c
+2040564e
+207a0000
+6fe2004b
+c3830000
+20405632
+67e4016d
+1fe20c00
+efe40006
+1fe0fe04
+67e441dd
+7041dc06
+4733c02c
+6fe44218
+203a6b9c
+6fe2004b
+c4038000
+793ffe07
+67e2004b
+7041dc05
+68444218
+6fe4016d
+9840fe00
+67e4016d
+6fe441dd
+98467e00
+67e441dd
+4734402d
+6fe441dd
+203a4a8b
+d8400104
+98467e00
+24216ba8
+4734c02d
+604441dd
+6fe44218
+9840fe00
+67e44218
+20206baa
+58000000
+67e44218
+6fe2004b
+79207e06
+67e2004b
+20600000
+6fe24654
+c2806bb2
+70028301
+20600000
+7002830f
+20600000
+6fe24651
+243a6bba
+6fe20282
+207a0000
+70028200
+20600000
+4735402d
+6fe20283
+207a0000
+c000ebda
+c0016c33
+c001ebe0
+c0026c37
+c01debea
+c01e6c3a
+c006ebef
+c0076c3f
+c007ebf2
+c0086c45
+c008ebf8
+c0096c49
+c009ebfe
+c00a6c4d
+c00aec04
+c00b6c51
+c00bec0a
+c00c6c56
+c00cec10
+c00d6c5a
+c00dec16
+c00e6c5e
+c00eec1c
+c00f6c63
+c00fec22
+c0106c67
+c010ec2d
+c0116c6b
+20600000
+20406c76
+70028302
+6fe24222
+79207e00
+67e24222
+20600000
+70028304
+6fe24222
+c3810000
+70028303
+20406c7d
+70028304
+6fe24222
+79207e02
+67e24222
+20600000
+2040564e
+247a0000
+20406c8c
+7002833c
+20600000
+20406c82
+7002830e
+20600000
+20406c9c
+70028310
+6fe24224
+79207e00
+67e24224
+20600000
+20406ca3
+70028312
+6fe24224
+79207e02
+67e24224
+20600000
+20406ca8
+70028314
+6fe24225
+79207e00
+67e24225
+20600000
+20406caf
+70028316
+6fe24225
+79207e02
+67e24225
+20600000
+20406c90
+70028318
+6fe24223
+79207e00
+67e24223
+20600000
+20406c97
+7002831a
+6fe24223
+79207e02
+67e24223
+20600000
+20406cb4
+7002831c
+6fe24223
+79207e06
+67e24223
+20600000
+20406cbb
+6fe24226
+79207e00
+67e24226
+7002831e
+20600000
+20406cc1
+6fe24226
+79207e02
+67e24226
+70028320
+6fe24536
+1fe9fe00
+1fe1fe03
+d8404537
+604404f3
+202068f6
+20406ccb
+6fe24226
+79207e04
+67e24226
+70028322
+20600000
+6fe24222
+c4008000
+70028303
+20206bba
+6fe24222
+c19f8000
+7002833b
+6fe20281
+c18b8000
+70028100
+7002830d
+20206bba
+6fe24222
+247a0000
+6fe24654
+c2806c6e
+c2836c70
+20206c74
+6fe24224
+c4008000
+70028311
+20206bba
+6fe24224
+c19f8000
+70028313
+20206bba
+6fe24225
+c4008000
+70028315
+20206bba
+6fe24225
+c19f8000
+6fe24654
+c2836c70
+20206c74
+6fe24223
+c4008000
+70028319
+20206bba
+6fe24223
+c19f8000
+7002831b
+20206bba
+6fe24223
+c1ff8000
+6fe24654
+c2836c72
+20206c74
+6fe24226
+c4008000
+7002831f
+20206bba
+6fe24226
+c4018000
+70028321
+20206bba
+6fe24226
+c1ff8000
+20206c74
+7002830f
+20206bba
+70028317
+20206bba
+7002831d
+20206bba
+70028300
+20600000
+4735c02d
+20405692
+58000001
+1fe20400
+58000050
+1fe21600
+20205482
+4736402d
+20405692
+6fe4421a
+1fe20400
+20205491
+4736c02d
+20405692
+6fe4421a
+1fe20400
+d9600050
+204054a6
+6fe24222
+793ffe05
+67e24222
+20600000
+4737402d
+2040569f
+20406ff7
+202054c1
+4737c02d
+20405692
+58000003
+1fe20400
+58000051
+1fe21600
+20205482
+4738402e
+20405692
+6fe4421c
+1fe20400
+20205491
+4738c02e
+20405692
+58000011
+1fe20400
+58000052
+1fe21600
+20205482
+4739402e
+20405692
+6fe4421e
+1fe20400
+20205491
+4739c02e
+20405692
+58000013
+1fe20400
+58000053
+1fe21600
+20205482
+473a402e
+20405692
+6fe44220
+1fe20400
+20205491
+473ac02e
+204056ac
+7004f703
+7004fa1c
+20406a6a
+70453501
+20600000
+473b402e
+204056ac
+68424536
+2040693a
+6042452f
+20206a85
+473bc02e
+204056ac
+6842452f
+20406934
+204068db
+67e204fa
+6842452f
+20406934
+604204f7
+20206a6a
+473c402f
+204056ac
+6842452f
+20406934
+20206abd
+473cc02f
+6fe40260
+98000c00
+efe20006
+1fe22400
+67e20517
+efe40006
+67e40518
+efe20006
+1fed1600
+efe20006
+99609600
+473d402f
+18c20400
+df200004
+d8a00526
+20407ca1
+18420c00
+1a427e00
+c000ee79
+c0016ceb
+c001ee79
+c0026d13
+c002ee79
+c0036dc1
+c003ee79
+20206e80
+473dc02f
+20406e8f
+2841fe01
+2020eeff
+2841feff
+2020ee83
+efe40006
+67e4051e
+196097fe
+196097ff
+2422ee7d
+d960050d
+efe4000b
+207a0000
+20406f41
+204056aa
+18007e03
+e7e20005
+6fe40518
+e7e40005
+18ebfe00
+1fe0fe05
+1fe0a605
+1ff0fe00
+e7e40005
+18e27e00
+1ff0fe00
+e7e40005
+e7e40005
+d8c00526
+18e27200
+2022ed0e
+efe80006
+e7e80005
+c2006d0b
+18007e00
+e7e20005
+1a627e00
+67e40271
+20600000
+473e402f
+efe80006
+67e80520
+196097fc
+20406ded
+67e4051c
+196097fe
+20406ee7
+2022ee83
+2a21fe05
+2020ed21
+d8a00526
+18000e00
+20206d30
+efe20006
+c0856e83
+efe40006
+243a6d2e
+efe20006
+c0ffed2c
+efe20006
+c0ffed2a
+20206d77
+18c08dfb
+20206d1e
+18c08dfc
+20206d1e
+18c08dfd
+20206d1e
+efe20006
+c004ed45
+c0056d33
+efe40006
+e7e40005
+18e08e01
+1ff0a400
+efe40006
+1ff0fe00
+1a40a401
+9a467c00
+24216d42
+1fe22600
+1a50fe00
+e7e40005
+18e08e01
+1a627e00
+20206d39
+196097fb
+1a20a3fb
+20206d4a
+efe40006
+e7e40005
+18e08e01
+196097fd
+1a20a3fd
+24216e83
+2422ed30
+196097ff
+2422ee83
+204056aa
+18a08a0a
+da200526
+18e27e00
+203a6d64
+efe40011
+203a6d64
+98002400
+6fe80520
+98000400
+20406fa6
+18c27e00
+203a6d61
+18c08dfd
+efe60006
+e7e60005
+20406f1a
+98007200
+20407cdc
+1a20a202
+18e08fff
+20206d51
+da200005
+20406e43
+6fe40271
+c005ef02
+20206e59
+efe20006
+c0006d6d
+c000ed6f
+c0016d72
+196097ff
+20206d75
+efe20006
+196097fe
+20206d75
+efe40006
+1ff0fe00
+196097fd
+67e40515
+20600000
+196097fb
+20406d69
+2422ee7d
+68480520
+20406f70
+2422ee7a
+18c22200
+204056aa
+1a220c00
+18a08a03
+18c21600
+20406f21
+1fe22200
+6fe40515
+1fe22400
+1a227e00
+9a462400
+6fe4051c
+9a467c00
+24216da6
+78547c00
+6fe40515
+203a6d99
+99608c00
+1a40a403
+1a427200
+1f227e00
+1fe0fe03
+1ff0fe00
+e7e40005
+1f227e00
+1ff0fe00
+e7e40005
+20206db4
+1a20f206
+20346d9d
+1f30fe00
+20206da0
+1f227e00
+1fe0fe02
+1ff0fe00
+e7e40005
+1f20f3fd
+1f30fe00
+e7e40005
+19620c00
+20206db4
+78347c00
+6fe4051c
+1fe22200
+1a227200
+6fe40515
+203a6d99
+99608c00
+1a227e00
+1fe0fe05
+1ff0fe00
+e7e40005
+1a227e00
+1ff0fe00
+e7e40005
+20407cdc
+24346dbd
+18007e02
+e7e20005
+18c27e00
+99667e00
+1ff0fe00
+e7e40005
+20206dbf
+18007e00
+e7e20005
+da200005
+20206e6f
+473ec02f
+20406e8f
+2841feff
+2020ee83
+20406ded
+67e4051c
+196097fe
+20406ee7
+d8a00526
+18000e00
+efe20006
+c0056df5
+efe40006
+e7e40005
+18e08e01
+196097fd
+1a20a3fd
+24216e83
+2422edcb
+196097ff
+2422ee83
+204056aa
+18a08a0d
+6fe4050d
+98002600
+da200526
+efe40011
+203a6de8
+98002400
+20406f85
+203a6de6
+18c08dfd
+efe60006
+e7e60005
+20406f1a
+98007200
+20407cdc
+1a20a202
+20206ddb
+20406e42
+6fe40271
+c0076f05
+20406e59
+20206e59
+efe40006
+1ff0fe00
+1fe0fffd
+d84000c8
+98467c00
+24610000
+580000c8
+20600000
+18c08c04
+196097fb
+1a20a3fb
+2422ee83
+20406d69
+2422ee7d
+d960050d
+20406f41
+18e27e00
+203a6f05
+67e2054a
+1a427e00
+67e40548
+d8e00000
+da200000
+204056aa
+18a08a0a
+20406e2b
+24344a8b
+18c21600
+1fe22600
+9a20a200
+6fe40515
+1fe22400
+203a6e34
+1a227e00
+9a462400
+2022ee26
+24216e26
+6fe4051c
+9a467c00
+2022ee1d
+24216e1d
+1a427200
+20406e20
+6fe2054a
+18e08e01
+98e67c00
+2022ee42
+20206e5f
+1fe27200
+20406e20
+20206e5f
+18a08bfd
+1f220400
+1a627e00
+9a467e00
+99608c00
+20207cdc
+6fe2054a
+18e08e01
+98e67c00
+20628000
+20206e06
+20407dc1
+d8c00526
+18ebfe00
+98c08c00
+e8480006
+20406f70
+24628000
+20406f1a
+20207dbf
+6fe4051c
+9a267c00
+24216e4e
+1a227200
+1f220400
+19620c00
+20407cdc
+6fe40548
+9a267c00
+2022ee40
+20406e5f
+20206e53
+20406e42
+20206e53
+da200007
+18007e00
+e7e20005
+20406e6f
+68440271
+184085fb
+1850fe00
+e7e40005
+184085fd
+1850fe00
+e7e40005
+20600000
+1fe27200
+1f220400
+19620c00
+20407cdc
+20406e5f
+58000036
+e7e20005
+6fe40548
+1ff0fe00
+e7e40005
+20600000
+58000036
+e7e20005
+184085fd
+1850fe00
+e7e40005
+20600000
+da200007
+58000002
+e7e20005
+6fe40515
+98408400
+1850fe00
+e7e40005
+20406e6f
+68440271
+184085fb
+1850fe00
+e7e40005
+184085fb
+1850fe00
+e7e40005
+20600000
+6fe4026f
+98a67e00
+1fe67e00
+67e40271
+204056aa
+1a227e00
+e7e20005
+6fe40518
+e7e40005
+20600000
+20600000
+58000200
+67e40546
+20206e85
+58000400
+67e40546
+20206e85
+58000600
+67e40546
+20206e85
+58000300
+67e40546
+204056aa
+e7e20005
+6fe40518
+e7e40005
+58000200
+e7e40005
+6fe40546
+e7e40005
+70027107
+20600000
+da400000
+18000400
+d8a0050d
+20406ee7
+2022eee5
+1a40a401
+efe20006
+1a20a3ff
+196097ff
+2fe1f018
+2420eee5
+2fe00e04
+2420eeb2
+18000401
+efe20006
+1a20a3ff
+196097ff
+c0806ea6
+efe20006
+1a20a3ff
+196097ff
+c0006eb7
+20206ea9
+18c08c01
+1a20a3ff
+196097ff
+18c08c02
+1a20a3fe
+196097fe
+2841fe00
+2020eedf
+18c08c0c
+1a20a3f4
+196097f4
+20206edf
+2fe00e02
+2420eeb5
+20206e9d
+2fe00e01
+2420eee5
+1a20a3fe
+196097fe
+efe40006
+1a467c04
+2022eebd
+e7e40005
+2841fe00
+2020eedf
+18c20400
+efe20006
+c0806ed8
+efe20006
+c0806ed8
+efe20006
+c0886ed8
+efe20006
+c0806ed8
+efe20006
+c0c06ed8
+efe20006
+c0806ed8
+efe20006
+c0806ed8
+efe20006
+c0c06ed8
+efe20006
+c0afeed8
+efe20006
+c0cdeed8
+efe20006
+c09a6ed8
+efe20006
+c07deedd
+18420c00
+18c08c0c
+18000e00
+18000400
+20206edd
+196097f4
+1a20a3f4
+18000400
+2a21fe00
+2420ee94
+18007e00
+e7e40005
+20600000
+d84000ff
+20600000
+47404030
+efe20006
+196097ff
+2fe1f030
+2420eefd
+2fe00e07
+2020eef6
+2fe00e06
+2020eef8
+2fe00e05
+2420eefd
+efe20006
+1fe22200
+196097ff
+20206efb
+18c08c02
+196097fe
+efe40006
+1ff0a200
+196097fe
+18007e01
+20600000
+18007e00
+20600000
+58000003
+67e20517
+20206f07
+58000005
+67e20517
+20206f07
+58000007
+67e20517
+204056aa
+6fe20517
+1fe22400
+e7e20005
+6fe40518
+e7e40005
+58000500
+e7e40005
+2a41fe05
+2020ef16
+2a41fe07
+2020ef16
+58000000
+e7ea0005
+20206f18
+58350200
+e7ea0005
+7002710a
+20600000
+20407c7d
+20407c80
+20406f21
+20407c77
+20407c7a
+18427e00
+20600000
+efe20006
+1fe17207
+1fe97e00
+c0806f2b
+18007e01
+18000401
+20600000
+20407c51
+1fe08401
+20600000
+1f227e00
+1fe67c04
+20216f28
+c002ef32
+c0036f35
+c003ef39
+20600000
+efe20006
+1fe08402
+20600000
+efe40006
+1ff0fe00
+1fe08403
+20600000
+efe40006
+1ff0fe00
+e8440006
+18508400
+18500400
+9840fe00
+1fe08405
+20600000
+4740c030
+18000e00
+da400000
+d8a00526
+efe4000b
+207a0000
+20406f4c
+18e27e00
+c1038000
+19609602
+20206f45
+98002600
+6fe44547
+98000c00
+18e27e00
+c1038000
+78547c00
+efe20006
+207a0000
+98007200
+efe40006
+9a667c00
+2422ef59
+78347c00
+c2006f55
+e8480006
+18c22200
+24346f6c
+d8c00526
+df200007
+efe80006
+203a6f65
+98467c00
+2022ef6c
+c2006f5f
+20600000
+e0480005
+18e08e01
+1a220c00
+20406f1a
+9a40a400
+98c08c00
+20206f4f
+1a220c00
+20406f21
+98c08c00
+20206f4f
+47414030
+6fe44547
+98000c00
+efe20006
+203a7dbb
+1fe3fe00
+98c08c00
+efe80006
+98467c00
+20628000
+18a27e00
+67e40ab7
+60500a9e
+20406f21
+98c08c00
+18c27e00
+68440ab7
+18420a00
+68500a9e
+1fe20c00
+20206f73
+4741c030
+6fe44547
+98000c00
+efe20006
+203a6fa3
+98007200
+efe40006
+9a667c00
+2022ef93
+c2006f8b
+18c08c04
+20406f21
+98c08c00
+20206f88
+1f20f3ff
+1f23fe00
+98c08c00
+18c08c04
+20406f21
+98c09600
+18c08c01
+efe40006
+9a467c00
+2022fdc7
+20406f1a
+98c08c00
+19627e00
+98c67c00
+2022efa3
+20206f99
+18000c00
+18007e00
+20600000
+47424030
+6fe44547
+98000c00
+efe20006
+203a6fbf
+1fe3fe00
+98c08c00
+efe80006
+98467c00
+2022efb3
+20406f21
+98c08c00
+20206fa9
+20406f21
+98c09600
+18c08c01
+efe40006
+9a467c00
+20628000
+20406f1a
+98c08c00
+19627e00
+98c67c00
+2022efbf
+20206fb5
+18000c00
+20600000
+da400400
+20406fb3
+da400300
+20406fcc
+24740000
+1a267c03
+20217dc1
+efe20006
+c0847dc1
+efe20006
+20600000
+4742c030
+20406f21
+1fe22200
+efe20006
+1fe17207
+1fe97e00
+1fe67c03
+2022efe8
+1f227e00
+c002efdf
+c0036fe2
+c003efe5
+18c08dff
+20406f21
+98c08c00
+1a227e00
+98462200
+2022fdc1
+20206fcf
+1a20a3fe
+18c08c01
+20206fcf
+1a20a3fd
+18c08c02
+20206fcf
+1a20a3fb
+18c08c04
+20206fcf
+1a20a3ff
+1f227e00
+c000eff1
+c0016fef
+c0026fee
+20207dc1
+1a20a3f4
+efe40006
+1a20a3fe
+efe40006
+9a467c00
+2022fdbf
+1a20a3fe
+2022fdc1
+20206fcf
+204056aa
+1fe20a00
+58000006
+e7e20005
+5800006e
+e7e40005
+58000f00
+e7e40005
+581a0535
+e7e60005
+58000111
+1ff07e00
+e7e80005
+58002600
+e7e40005
+58000335
+e7e40005
+58000009
+e7e40005
+58000004
+e7e40005
+70027114
+20600000
+47434030
+7005e150
+d8a005e2
+d8c0440c
+20407c9a
+d8c045a4
+20407c98
+d8c009ba
+20407c98
+204070c9
+d8c0042b
+204070c4
+2040708f
+d8a00aee
+204070c0
+580f4240
+1fe22200
+6fe80aee
+9a26fc00
+20407d61
+18077e00
+67e809b6
+20600000
+7005e141
+d8a005e2
+20407074
+2040706f
+6fe64426
+e7e60005
+20407035
+d8c0042b
+20407c9a
+d8c0440c
+20407c9a
+204070c9
+d8c00b0e
+d8a00abe
+20407c9a
+2020708f
+6fe84499
+e7e80005
+20407ca8
+20207ca5
+4743c030
+7005e141
+d8a005e2
+2040706f
+20407074
+6fe6441f
+e7e60005
+20407035
+d8c0440c
+20407c9a
+d8c0042b
+20407c9a
+204070c9
+d8c00b0e
+d8a00abe
+20407c9a
+2040708f
+d8a00aee
+202070c0
+7005e120
+d8c009fa
+d8a005e2
+20407c98
+204070c9
+d8c0099a
+204070c4
+2040708f
+d8a00abe
+2040734c
+d8400001
+2040705e
+d8a043eb
+204070c0
+d8400000
+2040705e
+d8a00b0e
+2020734c
+47444031
+7005e135
+58000100
+67e405e2
+2040706f
+20407074
+d8c0440c
+20407c9a
+d8c0042b
+20407c9a
+58006c65
+e7e40005
+58006274
+e7e40005
+e0420005
+204070c9
+2020708f
+6fec4472
+e7ec0005
+6fe24467
+e7e20005
+20600000
+6fec044b
+e7ec0005
+6fe24460
+e7e20005
+20600000
+7005e141
+6fe24636
+67e205e2
+d8c045a4
+20407c98
+d8c009ba
+20407c98
+204070c9
+d8c0042b
+204070c4
+2020708f
+7005e141
+6fe24636
+67e205e2
+d8c009ba
+20407c98
+d8c045a4
+20407c98
+204070c9
+d8c0440c
+204070c4
+2020708f
+4744c031
+204070de
+6fe205e1
+1fe20400
+1fe0fe0f
+1ff1fe00
+1fe22400
+203a70a1
+18417e0f
+243a70a4
+da600ace
+dfe005e2
+1fe0fff0
+9840a200
+d8a00afe
+df200004
+20407cb8
+202070af
+da400001
+da200000
+202070a5
+1841220f
+dfe005e2
+9840fe00
+9a260c00
+d8a00aee
+20407104
+da600ade
+da200aee
+d8a00afe
+df200004
+20407cb8
+20407346
+204072e8
+d8c005e2
+1a40a5ff
+1a427e00
+203a70b8
+2040733b
+204072dc
+202070b2
+d8a00aee
+2040734c
+d8c00afe
+2040733b
+204072e8
+d8c00aee
+2040733b
+202072dc
+18a22200
+2040734c
+df200010
+20207cc0
+d8a00abe
+20407c9a
+df200010
+da200abe
+20207cc0
+6fe205e1
+1fe27200
+da2005e2
+20207cc0
+efe20011
+1fe3fe00
+2a6ffe00
+7920fe00
+2feffe08
+7920a600
+e7e20011
+1a20a3ff
+c20070cd
+20600000
+da200ace
+1a20a20f
+18007210
+18002600
+202070cd
+da200ade
+202070d8
+d8c00abe
+20407338
+18007008
+20407347
+20407346
+204072d9
+d8a00ace
+2040734c
+47454031
+6fe20ace
+2feffe07
+2420f0ef
+204070d7
+da600ace
+d8a00ace
+204070f9
+202070f0
+204070d7
+d8c00ace
+d8a00ade
+20407c9a
+6fe20ade
+2feffe07
+2420f0dc
+204070dc
+da600ade
+d8a00ade
+df200003
+d8400000
+20407100
+1a60a604
+c20070fa
+d8408700
+18500400
+efe80013
+9842fe00
+e7e80005
+20600000
+4745c031
+df200010
+dfe00000
+9a267c00
+2022f10f
+20217112
+e8420006
+e0420005
+1fe0fe01
+c2007107
+20600000
+d8400080
+e0420005
+2020710c
+d8400000
+20207110
+20407127
+d8c0058e
+d8a0057e
+20207c9a
+78547c00
+20407215
+d8c0055e
+d8a0059e
+1800720f
+20407cdc
+efe20006
+1fe2fe06
+e7e20005
+580005ae
+67e405d2
+5800059e
+67e405d0
+79200012
+20207167
+68424657
+18002410
+1840a606
+1a667c10
+2021712d
+18002610
+d8a0059e
+d8c04658
+18427200
+78547c00
+efe20006
+e7e20005
+1a40a5ff
+2022f13b
+c2007131
+2034712e
+78347c00
+18007206
+1a220c00
+20207131
+d8c0055e
+d8a005ae
+20407c9a
+6fe205bd
+9a62fe00
+67e205bd
+580005ae
+67e405d2
+5800059e
+67e405d0
+79200012
+20207167
+78547c00
+20407215
+20207151
+da200056
+78347c00
+20407215
+20407151
+d8c0058e
+d8a00062
+20207c9a
+5800055e
+67e405d2
+580041bf
+67e405d0
+793f8012
+20407167
+da20058e
+da40055e
+d8a0059e
+20407208
+da20059e
+da4005ae
+1a420a00
+78347c00
+20407206
+20407220
+580005ae
+67e405d2
+5800059e
+67e405d0
+79200012
+20207167
+7005d400
+6fe405d0
+98000c00
+d8a005be
+20407c9a
+6fe405d2
+98000c00
+d8a0058e
+20407c9a
+2040718d
+78547c00
+c5897177
+6fe205d4
+c0827177
+6a4405d2
+204071bf
+204071be
+204071d0
+6fe205d4
+1fe0fe01
+67e205d4
+2040718d
+78347c00
+204071be
+204071df
+204071ec
+204071df
+204071ec
+204071df
+204071ec
+204071df
+6fe205d4
+1fe0fe01
+67e205d4
+c0887170
+2040718d
+78547c00
+202071be
+6fe205d4
+d8c005be
+203a71b4
+98002400
+18007211
+18c20a00
+efe20006
+1fe98400
+1feb7e00
+1fe97e00
+9841fe00
+e7e20005
+c2007193
+580005be
+9a408c00
+18007210
+d8a0056e
+efe20006
+e7e20005
+28c1ffcf
+2420f1a3
+18c08def
+c200719e
+18002200
+1a40a7ff
+1a6ba600
+1a6ba600
+2040736e
+58008400
+9a60a600
+d8a0056e
+18007210
+e8420013
+efe20005
+9840fe00
+e7e20005
+1a60a601
+c20071ad
+20207372
+18007210
+18000400
+efe20006
+98428400
+c20071b6
+18427e00
+e7e20006
+d8c005be
+d8a0056e
+20207c9a
+da40056e
+18007210
+da20058e
+1a220a00
+e8420011
+efe20012
+9842e000
+1f212603
+243471c8
+1a62a603
+1a662601
+202171cb
+9840e000
+e6020005
+1a20a201
+1a40a401
+c20071c2
+20600000
+2040736e
+18007210
+da20058e
+efe20011
+d8c08500
+1f212603
+1a667c01
+202171d9
+d8c08600
+98c08c00
+efe20006
+e7e20011
+1a20a201
+c20071d3
+20207372
+18007208
+d8c0058e
+18c20a00
+ea220006
+ea420006
+1a23fe00
+9a40fe00
+e7e20005
+1a227e00
+9a40fe00
+e7e20005
+c20071e2
+20600000
+588ae42c
+98000400
+18007207
+204071f9
+580d751b
+98000400
+18007205
+204071f9
+6a22059d
+6fe20591
+67e2059d
+62220591
+20600000
+1841240f
+18417e0f
+d8a0058e
+98a08a00
+ea620005
+e2220005
+1a622200
+18518400
+c20071fa
+5800058e
+9a408a00
+e2220005
+20600000
+78347c00
+20207209
+78547c00
+18007210
+e8420011
+efe20012
+2034720f
+9842fe00
+20207210
+9840fe00
+e7e20005
+1a20a201
+1a40a401
+c200720a
+20600000
+d8a005ae
+efec0011
+e7ec0005
+2034721b
+efec0011
+2020721c
+efec0006
+e7ec0005
+efe80011
+e7e80005
+20600000
+d8c041bf
+d8a0059e
+d8400000
+588395a7
+20407241
+58b3c1df
+20407241
+5800e5e9
+20407242
+18422800
+78547c00
+2040722f
+1a820400
+78347c00
+2020722f
+18007208
+efe20006
+2f200201
+20347236
+2020f237
+9840fe00
+20207238
+2020f234
+9842fe00
+e7e20005
+184c8400
+c2007230
+20600000
+6fec0592
+67ec0056
+efec0006
+e7ec0005
+20600000
+184d0400
+18500400
+98418400
+20600000
+20207245
+47464031
+204072eb
+d8a043eb
+2020734c
+d8a0440c
+2034f24d
+d8a0042b
+18c22200
+20407c9a
+204072fd
+d8c043fc
+20207365
+da20042b
+2034f255
+da20440c
+1a220a00
+204066ee
+202072fd
+d8c0447c
+2040733b
+d8c043eb
+20407338
+18006c50
+18006c00
+204072d1
+d8a00478
+2020734c
+18007e49
+20207264
+18007e01
+18007000
+184d5e00
+9de1de00
+1f00f001
+184cde00
+1df15e00
+6fe443e3
+1ff07e00
+9de1de00
+1f00f001
+efe80006
+98005e00
+1f00f001
+efe40006
+1a30de00
+1df05e00
+9de1de00
+1f00f001
+20600000
+1a608c01
+ea220006
+20407261
+204072d9
+18007000
+efe20013
+1fe17e03
+1ff05e00
+79205e08
+20407344
+204072dc
+1a227200
+1a608c02
+20407320
+2040732a
+204072dc
+1f227e00
+203a728a
+20207285
+1800700c
+1de22400
+62480413
+20600000
+1a20a201
+20407263
+204072e8
+1a620c00
+2040733b
+204072df
+20407353
+1a60a610
+1a40a5f0
+2021728e
+20600000
+4746c031
+da6043ae
+684a43d5
+20407277
+18002200
+20407263
+204072e8
+18007000
+1a425e00
+204072df
+da6043b0
+6fe243af
+1fe0a5ff
+9a608a00
+1800700c
+e5e80005
+18002200
+2040728e
+6fe243af
+1fe0fe04
+67e243af
+684a43d5
+18408401
+604a43d5
+20600000
+684a43da
+18002200
+20407263
+204072e8
+6fe202d6
+da6002d7
+1fe0a5ff
+1fe0fffc
+67e202d6
+9a608c00
+18007000
+ede80006
+204072df
+1800700c
+65e80417
+18002200
+2040728e
+da6002d5
+20407277
+6fe80417
+9a467e00
+247a0000
+6fe843df
+9a467e00
+207a0000
+604843df
+6fea43da
+1fe0fe01
+67ea43da
+18007e00
+20600000
+243bf2d1
+20600000
+18006c48
+18006c08
+202072d1
+18006c44
+18006c04
+202072d1
+18006c40
+18006c00
+202072d1
+18006c41
+18006c00
+202072d1
+18006c42
+18006c02
+202072d1
+18006c50
+18006c10
+202072d1
+18006c51
+18006c10
+202072d1
+18006c20
+18006c00
+20600000
+18007000
+6fe8042b
+98005e00
+1f00f001
+efe80006
+98005e00
+1f00f001
+6fe8440c
+98005e00
+1f00f001
+efe80006
+98005e00
+1f00f001
+20407347
+1f00f1fc
+6fe84499
+1fe25e00
+202072e2
+1a220c00
+2040733b
+18006c30
+18006c00
+6fe24460
+68424457
+2434f306
+6fe24467
+68424460
+67e2441c
+6042441d
+d8c0441c
+2040733b
+20407347
+1f00f1fc
+6fe84499
+1fe25e00
+18006c51
+18006c10
+6fec4472
+684c044b
+2034f315
+6fec044b
+684c4472
+18007000
+18425e00
+1f00f001
+184f5e00
+1ff07e00
+9de1de00
+1f00f001
+1fef5e00
+1f00f001
+18005e00
+202072e5
+2f200600
+20608000
+18c27e00
+9f208a00
+18007e00
+e7e20005
+1f20f201
+2f200600
+20608000
+20207325
+18007000
+1f227e00
+203a732f
+efe80006
+1f20f3fc
+98005e00
+1f00f001
+2f001e04
+20608000
+2020732b
+18007208
+20207339
+18007206
+20207339
+18007204
+18007004
+2020733d
+18007000
+18007204
+efe80006
+1fe25e00
+1f00f001
+c200733d
+20600000
+d8c00478
+20207338
+18007204
+20207349
+18007000
+18007204
+18005e00
+1f00f001
+c2007348
+20600000
+1800700c
+18007204
+1de27e00
+e7e80005
+1f00f001
+c200734e
+20600000
+1800700c
+1a620a00
+1a40f201
+1f267c0f
+20217359
+18007210
+1de27e00
+1f267c03
+20217361
+e7e80005
+1f20f3fc
+20628000
+1f00f001
+20207359
+e7e20005
+1fecfe00
+c2007361
+20600000
+1800700c
+18007204
+efe80006
+9de67c00
+24628000
+1f00f001
+c2007367
+18007c00
+20600000
+6fe28043
+79207e03
+67e28043
+20600000
+6fe28043
+793ffe03
+67e28043
+20600000
+d8a00882
+3803ffff
+3807ffff
+380bffff
+380ffbff
+e7f20005
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7f20005
+3803ffff
+3807ffff
+380bcfff
+380fffff
+e7f20005
+3803ffff
+3807ffff
+380bffef
+380fffff
+e7f20005
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7f20005
+3803ffff
+38066c7f
+3808146b
+380f7bb3
+e7f20005
+3801feb8
+38050c12
+380ab722
+380e9fa6
+e7f20005
+3800e70f
+38056720
+3808519e
+380d9084
+e7f20005
+38031012
+380760bf
+380bf0af
+380c03d3
+e7f20005
+3803a188
+38043ad0
+380bcbf2
+380e43d9
+e7f20005
+3802b030
+38076a03
+38091188
+380de520
+e7f20005
+3803a11e
+3804fe5d
+3808dd57
+380dac93
+e7f20005
+380011ed
+380618c4
+38088da7
+380e57ff
+e7f20005
+3803192b
+38074641
+3809be0c
+380f66ad
+e7f20005
+38001f83
+38055a23
+380bf9b0
+380c3949
+e7f20005
+38013a51
+380553fd
+380b372a
+380cf1bb
+e7f20005
+3803ae85
+3805eed9
+38089e66
+380c01a8
+e7f00005
+20600000
+d8a0091a
+3803ffff
+3807ffff
+380bffff
+380fffff
+e7f20005
+3803ffff
+3804003f
+38080000
+380c0000
+e7f20005
+38000000
+38040000
+38081000
+380c0000
+e7f20005
+3803ff00
+3807ffff
+380bffcf
+380fffff
+e7f20005
+3803ffff
+3807ffff
+380bffff
+380c03ff
+e7f20005
+38000000
+38040000
+38080000
+380c0000
+e7f20005
+38010000
+38040000
+380bf000
+380fffff
+e7f20005
+380296ff
+38062630
+380b945d
+380fd284
+e7f20005
+380333a0
+38044b7a
+380837d8
+380fc9dc
+e7f20005
+3803a440
+3805b958
+380b8bce
+380d091f
+e7f20005
+3802e12c
+3805f47c
+380b56b1
+380efd47
+e7f20005
+38006837
+3806ed90
+3809ecec
+380dacc5
+e7f20005
+38023357
+38058af3
+3808f9e1
+380d29f0
+e7f20005
+3802e7eb
+3807e6e3
+380be1a7
+380d0b8b
+e7f20005
+38024fe3
+380420ef
+3809b5a6
+380cdc2f
+e7f20005
+38013860
+3806bd69
+3808391a
+380db222
+e7f20005
+20600000
+6fe2462c
+243a7432
+2020792c
+47474031
+6fe2462c
+207a0000
+6fe24583
+c1808000
+6fe24490
+207a0000
+6fe24495
+c1018000
+6fe44652
+c2807430
+6fe24492
+c000792c
+20600000
+70449200
+20600000
+4747c031
+6fe2462c
+203a650d
+20406506
+20407438
+20207522
+58000000
+67f009aa
+67e809b2
+67ee4630
+20600000
+7009ac01
+20207442
+6fe24583
+c000f53f
+20204a8b
+6fe24583
+c000f445
+20207522
+2040753f
+6fe209ab
+247a0000
+7009aa03
+20600000
+20407465
+da2009da
+d8a00862
+20407b2e
+da2009ba
+d8a00822
+20407b2e
+da200822
+da4009ba
+d8a00822
+20407a96
+da20093a
+da4009ba
+d8a00842
+20407a96
+da200842
+da400822
+d8a00822
+20407b32
+da200802
+da400822
+d8a00802
+20407b32
+df200020
+da200862
+da400802
+20207d63
+da20097a
+d8a00802
+20407b2e
+da20095a
+d8a00822
+20407b2e
+da200822
+da40095a
+d8a00822
+20407a96
+da20093a
+da40095a
+d8a00842
+20407a96
+da200842
+da400822
+d8a00822
+20407b32
+da200802
+da400822
+d8a00802
+20207b4b
+20407496
+da2009e2
+d8a00862
+2040765d
+da2009c2
+d8a00822
+2040765d
+da200822
+da4009c2
+d8a00822
+2040763b
+da20089a
+da4009c2
+d8a00842
+2040763b
+da200842
+da400822
+d8a00822
+2040760a
+da200802
+da400822
+d8a00802
+2040760a
+df200018
+da200862
+da400802
+20207d63
+da2008e2
+d8a00802
+2040765d
+da2008ca
+d8a00822
+2040765d
+da200822
+da4008ca
+d8a00822
+2040763b
+da20089a
+da4008ca
+d8a00842
+2040763b
+da200842
+da400822
+d8a00822
+2040760a
+da200802
+da400822
+d8a00802
+2020760d
+6fe209ae
+c08074ca
+204074c7
+d8a00a7a
+58000a2a
+e7e40005
+58004614
+e7e40005
+580009da
+e7e40005
+202074be
+d8a00a7a
+58000a3a
+e7e40005
+580009da
+e7e40005
+58004614
+e7e40005
+20407855
+6fe209ab
+c00274c4
+7009ac01
+7009aa05
+20600000
+7009ab14
+2040743f
+2020758d
+d8a00a1a
+18000e08
+20207557
+7009ac01
+20600000
+47484032
+d8a00723
+6fec40a0
+e7ec0005
+6fec0040
+e7ec0005
+6fe64630
+e7e60005
+204078c2
+da200a4a
+da400a5a
+18000e04
+2040755c
+2420f4e6
+204074dd
+70007d41
+202066da
+6fe209ab
+c004f4e3
+7009aa0a
+7009ac01
+70007c03
+20600000
+70007c03
+7009ab15
+2020758d
+6fe209ab
+c004f4ec
+7009aa00
+70007c04
+70007e05
+20600000
+70007c04
+7009ab00
+20600000
+6fe209af
+c000f4f3
+7009ab0a
+2020758d
+d8a00723
+6fec0040
+e7ec0005
+6fec40a0
+e7ec0005
+6fe6462d
+e7e60005
+204078d9
+6fe209ab
+c0057500
+7009aa0b
+7009ac01
+20600000
+7009ab0b
+7009ad01
+20600000
+d8a00a7a
+6fec0040
+e7ec0005
+6fec40a0
+e7ec0005
+58000a2a
+e7e40005
+58000a3a
+e7e40005
+20207517
+7009aa0f
+d8a00a7a
+6fec40a0
+e7ec0005
+6fec0040
+e7ec0005
+58000a3a
+e7e40005
+58000a2a
+e7e40005
+d8a00723
+6fec0a7a
+e7ec0005
+6fec0a80
+e7ec0005
+2040788c
+7041be01
+d8a041bf
+d8c00a4a
+20407c9a
+202041c0
+4748c032
+6fe24583
+c1800000
+6fe209ae
+c1800000
+d8a045e4
+18000e0b
+20407557
+180a7e00
+1fe37e00
+e7e40005
+d8a006ba
+d8c045e4
+20407c99
+d8a005e2
+d8c008ca
+20407c97
+d8a00612
+20407ca0
+70061201
+20407912
+7009ae01
+20600000
+d8a045fc
+d8c0062a
+20407c97
+70458301
+7009ae00
+20600000
+47494032
+6fe209b5
+c1800000
+6fe209ae
+c1800000
+d8a006ba
+d8c045e4
+20407c99
+d8a005e2
+d8c009c2
+20407c97
+d8a00612
+20407ca0
+70061201
+20407912
+7009ae02
+20600000
+7009af01
+d8a00a02
+d8c0062a
+20407c99
+7009b501
+7009ae00
+20600000
+18e08fff
+24610000
+180a7e00
+e7e40005
+20207557
+18e08fff
+24217568
+efe80011
+1fe20400
+efe80012
+9842fe00
+2422f566
+1a20a204
+1a40a404
+2020755c
+7840fc00
+20600000
+7820fc00
+20600000
+4749c032
+6fe209ac
+207a0000
+2040669e
+247a0000
+7009ac00
+6fe209aa
+c001e5df
+c002e5fc
+c003e607
+c005e61c
+c001743d
+c00274ac
+c004f4cc
+c00574ef
+c006750d
+20600000
+474a4032
+6fe209ad
+207a0000
+2040669e
+247a0000
+7009ad00
+6fe209ab
+c00965c2
+c009e5c7
+c001e5cb
+c00274b7
+c00a65cf
+c003e5dd
+c00574ef
+c005e61b
+c004f4cc
+c00ae615
+20600000
+7009ad01
+20600000
+7009ad00
+20600000
+474ac032
+6fe2462c
+207a0000
+6fe209ae
+207a0000
+1fe0fe80
+67e209ae
+c3838000
+6fe205df
+203a759c
+2020791d
+20407788
+6fe209ae
+c000f539
+c0017550
+20600000
+1fe10e07
+1fe97e00
+98c08c00
+efe20006
+afec0000
+20600000
+20407c99
+20407c99
+20207c99
+eff00006
+247a0000
+eff00006
+247a0000
+eff00006
+20600000
+efe80011
+98000400
+efe80012
+98467c00
+24628000
+1a20a204
+1a40a404
+c20075b0
+20600000
+18007206
+1a20a214
+1a40a414
+efe80012
+98000400
+efe80011
+98467e00
+24610000
+247a0000
+1a20a3fc
+1a40a5fc
+c20075bc
+20600000
+18007206
+18002600
+efe80011
+98000400
+efe80012
+9840fe00
+9a60fe00
+e7e80005
+2feffe20
+7920a600
+1a20a204
+1a40a404
+c20075c8
+20600000
+18007206
+18002600
+efe80012
+98000400
+efe80011
+98467e00
+9a667e00
+e7e80005
+2feffe20
+7920a600
+1a20a204
+1a40a404
+c20075d6
+20600000
+18007206
+1a20a214
+18002600
+efe80011
+2feffe00
+7920a601
+1fe37e00
+2a6ffe00
+7920fe1f
+e7e80011
+1a20a3fc
+1a632600
+c20075e5
+20600000
+18007206
+18002600
+efe80011
+2feffe1f
+7920a601
+1fe3fe00
+2a6ffe00
+7920fe00
+e7e80011
+1a20a204
+1a632600
+c20075f2
+20600000
+204075f0
+2a6ffe00
+2020f606
+da400882
+1a222600
+1a20a3e8
+204075b9
+24610000
+1a622200
+1a20a3e8
+da400882
+1a220a00
+202075d4
+204075c6
+18a22200
+202075fe
+204075d4
+2a6c0000
+20608000
+da400882
+18a0a3e8
+1a220a00
+202075c6
+18a21600
+1a226000
+da400712
+1a420a00
+1a208c18
+eff00006
+e7f00005
+e7f00005
+18007e00
+e7f00005
+19620a00
+2040760a
+da400712
+1a420a00
+18007e00
+e7f00005
+1e008c20
+eff00006
+e7f00005
+e7f00005
+19622200
+1a220a00
+2040760a
+da400712
+1a420a00
+1e008c28
+eff00006
+e7f00005
+e7f00005
+e7f00005
+19622200
+1a220a00
+2020760a
+18007206
+efe80006
+98005e00
+1f00f001
+c2007636
+20600000
+18a21600
+d8a006e2
+20407ca0
+d8a006e2
+1a220c00
+18007000
+20407635
+1a420c00
+20407635
+18002400
+18000400
+18002606
+efe80005
+98002200
+1a427000
+1de27e00
+1a627000
+9deffe00
+9a20fe00
+9840fe00
+e7e80005
+1fef0400
+1a60a601
+2a61fe0c
+2420f647
+18427e00
+e7e80005
+18a08be8
+1a40a401
+2a41fe06
+2420f645
+da2006e2
+19620a00
+20207614
+1a222400
+2020763b
+1a226000
+1e022200
+efe20011
+2feffe00
+20608000
+204075e2
+efe20012
+2fec0000
+2020f66f
+da200882
+1a420a00
+204075c6
+efe20012
+9a60fe00
+e7e20012
+1a40a5e8
+1a40a218
+18007207
+204075e4
+20207660
+18a21600
+d8a00742
+20407ca0
+18007e00
+67e806fa
+67e8075a
+70074201
+d8a006e2
+20407ca0
+d8c00882
+d8a00712
+20407c99
+1a220c00
+d8a0072a
+20407c99
+d8c0072a
+204075aa
+203a76ab
+da20072a
+da400742
+2040765f
+da200712
+da4006e2
+2040765f
+da20072a
+da400712
+204075b9
+2021769d
+da200712
+da40072a
+1a220a00
+204075d4
+da200742
+da4006e2
+1a420a00
+204075c6
+efe20011
+9a60a600
+efe20012
+9a60fe00
+e7e20012
+20207682
+da20072a
+da400712
+1a220a00
+204075d4
+da2006e2
+da400742
+1a420a00
+204075c6
+efe20011
+9a60a600
+efe20012
+9a60fe00
+e7e20012
+20207682
+d8a00742
+20407ca0
+6fe206fa
+67e20742
+67e2074a
+da200742
+da4006e2
+1a420a00
+2040760a
+da200882
+da4006e2
+19620a00
+2020760d
+da2006a2
+d8a0075a
+2040765d
+da20075a
+d8a00772
+2040765d
+da20089a
+da400772
+d8a00772
+2040763b
+da200672
+d8a0075a
+2040765d
+d8c0075a
+d8a0072a
+20407c99
+da20072a
+204075fd
+da20075a
+da40072a
+d8a0075a
+2040760a
+da20075a
+da400772
+d8a0075a
+2040760a
+d8c00672
+d8a0072a
+20407c99
+da20068a
+d8a00772
+2040765d
+da20072a
+204075fd
+da20072a
+204075fd
+da20072a
+da400772
+d8a0072a
+2040763b
+da200772
+d8a00742
+2040765d
+da200742
+204075fd
+da200742
+204075fd
+da200742
+204075fd
+d8c0068a
+d8a00772
+20407c99
+da200772
+204075fd
+da200772
+da4006a2
+d8a006a2
+2040763b
+da20075a
+d8a00772
+2040765d
+da200772
+da40072a
+d8a00772
+2040760d
+da200772
+da40072a
+d8a00672
+2040760d
+da20072a
+da400672
+d8a00772
+2040760d
+da200772
+da40075a
+d8a00772
+2040763b
+da200772
+da400742
+d8a0068a
+2020760d
+da200612
+d8a0078a
+2040765d
+da200672
+da40078a
+d8a00742
+2040763b
+da200612
+da40078a
+d8a0078a
+2040763b
+da20068a
+da40078a
+d8a0072a
+2040763b
+da2006a2
+d8a0078a
+2040765d
+da2005e2
+da40078a
+d8a0075a
+2040763b
+da2006a2
+da40078a
+d8a0078a
+2040763b
+da2005fa
+da40078a
+d8a00772
+2040763b
+da200742
+da40075a
+d8a0078a
+2040760d
+da200742
+da40075a
+d8a00742
+2040760a
+da20072a
+da400772
+d8a0075a
+2040760d
+da20072a
+da400772
+d8a0072a
+2040760a
+da20072a
+da40078a
+d8a0072a
+2040763b
+da2006a2
+da400612
+d8a00772
+2040763b
+da200772
+da40078a
+d8a006a2
+2040763b
+da20078a
+d8a0078a
+2040765d
+da20078a
+da400742
+d8a00772
+2040763b
+da20078a
+da40072a
+d8a0072a
+2040763b
+da20075a
+d8a00672
+2040765d
+da200672
+da400772
+d8a00672
+2040760d
+d8c00672
+d8a0078a
+20407c99
+da20078a
+204075fd
+da200772
+da40078a
+d8a00772
+2040760d
+da200772
+da40075a
+d8a0075a
+2040763b
+da20075a
+da40072a
+d8a0068a
+2040760d
+da20068a
+da400882
+d8a0068a
+18002600
+6fe2068a
+2feffe00
+2040f5c6
+1a626000
+da20068a
+204075e2
+6fe206a1
+2e0ffe00
+7920fe07
+67e206a1
+20600000
+6fe205df
+1fe0ffff
+24610000
+67e205df
+6fe205de
+205a76b8
+6fe205df
+d8c006ba
+204075a1
+2020f775
+6fe205de
+243a7783
+20407709
+20207775
+7005de00
+d8c005e2
+d8a00672
+204075a7
+20207775
+da2006a2
+d8a00772
+20407673
+da200772
+d8a0072a
+2040765d
+da200672
+da40072a
+d8a0062a
+2040763b
+da200772
+da40072a
+d8a0075a
+2040763b
+da20068a
+da40075a
+d8a00642
+2020763b
+efe80006
+18002204
+18a08a03
+e7e20005
+1fecfe00
+18a08bfe
+1a20a3ff
+2422f79d
+18a08a05
+c200779a
+20600000
+18ebfe00
+99608c00
+efe80006
+20600000
+18006010
+d96005e2
+1e008ff9
+204077a5
+98000400
+1e008ff0
+204077a5
+98408400
+1e008ffe
+204077a5
+1fee7e01
+98408400
+1e008ff1
+204077a5
+1fee7e00
+98408400
+1e0bfe00
+99608a00
+e0480005
+1e00e001
+2e01fe40
+2420f7ab
+20600000
+d8c008fa
+18007007
+efe80006
+98005e00
+1f00f1ff
+202177c2
+20600000
+474b4032
+204077a9
+d8a006e2
+18007000
+1de27e00
+e7e80005
+1f00f001
+2f01fe08
+2420f7cb
+2040736e
+d9608700
+de0005e2
+18007240
+e8480030
+efe8000b
+19609604
+1e00e004
+9840fe00
+18007007
+9de08400
+18007004
+1dee7e03
+98408400
+18007005
+1de27e00
+18007006
+9de2fe00
+18007004
+9de17e00
+18007006
+9de2fe00
+98408400
+18007007
+18425e00
+18007003
+1de27e00
+9840de00
+18007000
+1de27e00
+18007001
+9de10400
+9de1fe00
+18007002
+9de17e00
+98418400
+18007000
+1dee7e02
+9840fe00
+18007007
+9de0de00
+980efc00
+c20077d4
+d8c006e2
+18007000
+efe80006
+9de0de00
+1f00f001
+2f01fe08
+2420f7fd
+20207372
+d8a00a3a
+18007007
+1de27e00
+e7e80005
+1f00f1ff
+20217805
+20600000
+d8a005e2
+18c08dfc
+1f262210
+efe80006
+9842fe00
+e7e80005
+18c08df8
+c200780d
+1a227200
+18427e00
+e7e80005
+c2007814
+20600000
+2040781c
+20407803
+20207842
+2040781c
+20207842
+d8c009da
+d8a005e2
+18007206
+20407926
+d8c04614
+18007206
+20407926
+d8c00a3a
+20407925
+204077c0
+204077c7
+d8c00a2a
+d8a005e2
+20207839
+d8c04614
+d8a005e2
+18007206
+20407926
+d8c009da
+18007206
+20407926
+d8c00a2a
+20407925
+204077c0
+204077c7
+d8c00a3a
+d8a005e2
+20407839
+20207842
+20407925
+58800000
+1fed7e00
+e7e80005
+18007205
+20407ca1
+58000280
+e7e80005
+202077c7
+6fe80a3a
+da2003e8
+9a26fc00
+20407d61
+18077e00
+67e809b6
+1807fe00
+da2003e8
+9a26fc00
+20407d61
+18077e00
+da2003e8
+9a2ffe00
+684809b6
+9840fe00
+67e809b6
+20600000
+70463600
+20207857
+6fe24634
+c0817853
+474bc032
+58363636
+1fed0400
+18418436
+6fe40a7a
+1fe20c00
+18007204
+2040780a
+204077c0
+204077c7
+6fe40a7c
+1fe20c00
+d8a005e2
+18007206
+20407926
+6fe40a7e
+1fe20c00
+18007206
+20407926
+58800000
+e7e60005
+6fe24636
+e7e20005
+18007e00
+e7f00005
+58000388
+e7e80005
+204077c7
+20407803
+d8c00a3a
+d8a00702
+20407c98
+585c5c5c
+1fed0400
+1841845c
+6fe40a7a
+1fe20c00
+18007204
+2040780a
+204077c0
+204077c7
+d8c00722
+d8a005e2
+18007208
+20407926
+58800000
+1fed7e00
+e7e80005
+20407ca0
+58000300
+e7e80005
+204077c7
+20207803
+58363636
+1fed0400
+18418436
+d8c00a1a
+18007206
+2040780a
+204077c0
+204077c7
+6fe40a86
+1fe20c00
+d8a005e2
+20407925
+6fe40a88
+1fe20c00
+20407925
+5862746c
+1fed7e00
+1fe1fe6b
+e7e80005
+d8c0072f
+18007203
+20407926
+58800000
+1fed7e00
+e7e80005
+18007e00
+e7f00005
+58000380
+e7e80005
+204077c7
+20407803
+d8c00a3a
+d8a00702
+20407c98
+585c5c5c
+1fed0400
+1841845c
+d8c00a1a
+18007206
+2040780a
+204077c0
+204077c7
+d8c00722
+d8a005e2
+18007208
+20407926
+58800000
+1fed7e00
+e7e80005
+20407ca0
+58000300
+e7e80005
+204077c7
+20207803
+6fe24634
+c08178d3
+474c4033
+58363636
+1fed0400
+18418436
+d8c00a1a
+18007206
+2040780a
+204077c0
+204077c7
+d8c00a3a
+d8a005e2
+20407925
+d8c00a2a
+20407925
+202078e8
+58000000
+67e84658
+202078c4
+58000000
+67e84658
+202078db
+6fe24634
+c08178d6
+58363636
+1fed0400
+18418436
+d8c00a1a
+18007206
+2040780a
+204077c0
+204077c7
+d8c00a2a
+d8a005e2
+20407925
+d8c00a3a
+20407925
+58000000
+e7f00005
+e7e80005
+6fe84658
+e7e80005
+18a20400
+70072280
+18420a00
+d8c00732
+20407925
+204077c7
+d8a005e2
+18007207
+20407ca1
+e7e80005
+580003f8
+e7e80005
+204077c7
+20407803
+d8c00a3a
+d8a00702
+20407c98
+585c5c5c
+1fed0400
+1841845c
+d8c00a1a
+18007206
+2040780a
+204077c0
+204077c7
+d8c00722
+d8a005e2
+18007208
+20407926
+58800000
+1fed7e00
+e7e80005
+20407ca0
+58000300
+e7e80005
+204077c7
+20207803
+7005dfc0
+6fe205df
+207a0000
+1fe0ffff
+67e205df
+d8c006ba
+204075a1
+2020f913
+d8c005e2
+d8a00672
+202075a7
+204076b8
+6fe205df
+1fe0ffff
+67e205df
+d8c006ba
+204075a1
+20608000
+20207709
+18007204
+18c08dfc
+efe80006
+e7e80005
+18c08df8
+c2007927
+20600000
+474cc033
+6fe24490
+203a5ed0
+20405ecc
+20407438
+20207932
+6fe24495
+c1800000
+6fe24492
+c1800000
+d8a04584
+18000e0f
+20407557
+180a7e00
+1fe37e00
+e7e40005
+d8a00762
+d8c04584
+20407c98
+d8a00642
+d8c0095a
+20407c8e
+d8a00682
+20407cab
+70068201
+2040797c
+70449203
+20600000
+d8a045a4
+d8c006a2
+20407c8e
+70449503
+70449200
+20600000
+6fe209b5
+c1800000
+6fe24492
+c1800000
+d8a00762
+d8c04584
+20407c98
+d8a00642
+d8c009ba
+20407c8e
+d8a00682
+20407cab
+70068201
+2040797c
+70449204
+20600000
+d8a009fa
+d8c006a2
+20407c98
+7009b503
+70449200
+20600000
+6fe24490
+207a0000
+6fe24492
+207a0000
+1fe0fe80
+67e24492
+c3838000
+6fe405df
+203a796e
+20207974
+474d4033
+20407989
+6fe24492
+c001f948
+c002795e
+20600000
+2040799b
+6fe405df
+1fe0ffff
+67e405df
+d8c00762
+204075a1
+20608000
+202079ec
+474dc033
+58000100
+67e405df
+6fe405df
+207a0000
+1fe0ffff
+67e405df
+d8c00762
+204075a1
+2020f97f
+d8c00642
+d8a00702
+20207c8d
+da200742
+d8a00842
+20407a58
+da200842
+d8a007e2
+20407b2e
+da200702
+da4007e2
+d8a006a2
+20407a96
+da200842
+da4007e2
+d8a00822
+20407a96
+da200722
+da400822
+d8a006c2
+20207a96
+da200742
+d8a00822
+20407b2e
+da200822
+d8a00842
+20407b2e
+da20093a
+da400842
+d8a00842
+20407a96
+da200702
+d8a00822
+20407b2e
+d8c00822
+d8a007e2
+20407c98
+da2007e2
+20407b35
+da200822
+da4007e2
+d8a00822
+20407b32
+da200822
+da400842
+d8a00822
+20407b32
+d8c00702
+d8a007e2
+20407c98
+da200722
+d8a00842
+20407b2e
+da2007e2
+20407b35
+da2007e2
+20407b35
+da2007e2
+da400842
+d8a007e2
+20407a96
+da200842
+d8a00802
+20407b2e
+da200802
+20407b35
+da200802
+20407b35
+da200802
+20407b35
+d8c00722
+d8a00842
+20407c98
+da200842
+20407b35
+da200842
+da400742
+d8a00742
+20407a96
+da200822
+d8a00842
+20407b2e
+da200842
+da4007e2
+d8a00842
+20407b4b
+da200842
+da4007e2
+d8a00702
+20407b4b
+da2007e2
+da400702
+d8a00842
+20407b4b
+da200842
+da400822
+d8a00842
+20407a96
+da200842
+da400802
+d8a00722
+20207b4b
+da200682
+d8a00862
+20407b2e
+da200702
+da400862
+d8a00802
+20407a96
+da200682
+da400862
+d8a00862
+20407a96
+da200722
+da400862
+d8a007e2
+20407a96
+da200742
+d8a00862
+20407b2e
+da200642
+da400862
+d8a00822
+20407a96
+da200742
+da400862
+d8a00862
+20407a96
+da200662
+da400862
+d8a00842
+20407a96
+da400802
+da200822
+d8a00862
+20407b4b
+da200802
+da400822
+d8a00802
+20407b32
+da4007e2
+da200842
+d8a00822
+20407b4b
+da2007e2
+da400842
+d8a007e2
+20407b32
+da2007e2
+da400862
+d8a007e2
+20407a96
+da200742
+da400682
+d8a00842
+20407a96
+da200842
+da400862
+d8a00742
+20407a96
+da200862
+d8a00862
+20407b2e
+da200862
+da400802
+d8a00842
+20407a96
+da200862
+da4007e2
+d8a007e2
+20407a96
+da200822
+d8a00702
+20407b2e
+da200702
+da400842
+d8a00702
+20407b4b
+d8c00702
+d8a00862
+20407c98
+da200862
+20407b35
+da200842
+da400862
+d8a00842
+20407b4b
+da200842
+da400822
+d8a00822
+20407a96
+da200822
+da4007e2
+d8a00722
+20407b4b
+da200722
+da40091a
+d8a00722
+18002600
+6fe20722
+2feffe00
+2040fb30
+1a626000
+da200722
+20407b60
+6fe20741
+2e0ffe00
+7920fe07
+67e20741
+20600000
+18a21600
+d8a00802
+20407cab
+18007e00
+67e80822
+70080201
+d8a00782
+20407cad
+d8c0091a
+d8a007c2
+20407c98
+1a220c00
+d8a007e2
+20407c98
+d8c007e2
+20407b6a
+203a7a8f
+da2007e2
+da400802
+20407b6d
+da2007c2
+da400782
+20407b6d
+da2007e2
+da4007c2
+20407b66
+20217a81
+da2007c2
+da4007e2
+1a220a00
+20407b5e
+da200802
+da400782
+1a420a00
+20407b30
+efe20011
+9a60a600
+efe20012
+9a60fe00
+e7e20012
+20207a66
+da2007e2
+da4007c2
+1a220a00
+20407b5e
+da200782
+da400802
+1a420a00
+20407b30
+efe20011
+9a60a600
+efe20012
+9a60fe00
+e7e20012
+20207a66
+da200782
+19620a00
+20407abf
+da20091a
+19622400
+19620a00
+20207b4b
+18a21600
+18007000
+d8a00782
+20407cad
+d8a00ace
+20407cad
+1a220c00
+700ace00
+58000000
+20407b28
+1a420c00
+20407b2c
+18000e00
+d8a00782
+d8400ace
+18e22400
+1a4bfe00
+9840a400
+18000400
+18002600
+efe80005
+98002200
+efe80012
+1a627000
+9deffe00
+9a20fe00
+9840fe00
+e7e80005
+1fef0400
+1a60a601
+2a61fe08
+2420faaa
+18427e00
+e7e80005
+18a08be0
+18e08e01
+28e1fe08
+2420faa4
+da200782
+19620a00
+20207abf
+474e4033
+18a21600
+1a226000
+da4007c2
+1a420a00
+20407ca8
+e7f00005
+1a208c2c
+20407c94
+20407c90
+1a422200
+20407b35
+da4007c2
+1e022200
+19620a00
+20407b32
+da4007c2
+1a420a00
+20407ca8
+e7f00005
+1e008c30
+20407c9a
+20407ca8
+1a422200
+20407b35
+da4007c2
+19622200
+1a220a00
+20407b32
+da4007c2
+1a420a00
+1e008c20
+20407c90
+20407ca8
+e7f00005
+1e008c38
+20407c94
+19622200
+1a220a00
+20407b32
+da4007c2
+1a420a00
+1e008c24
+20407c90
+1e008c34
+20407c90
+1e008c34
+20407c91
+1e008c20
+20407c91
+19622200
+1a220a00
+20407b32
+da4007c2
+1a420a00
+1e008c2c
+20407c90
+20407ca8
+e7f00005
+1e008c20
+20407c91
+1e008c28
+20407c91
+19622200
+1a220a00
+20407b4b
+da4007c2
+1a420a00
+1e008c30
+20407c94
+20407c94
+18007e00
+e7f00005
+1e008c24
+20407c91
+1e008c2c
+20407c91
+19622200
+1a220a00
+20407b4b
+da4007c2
+1a420a00
+1e008c34
+20407c90
+1e008c20
+20407c90
+20407ca8
+1e008c30
+20407c91
+19622200
+1a220a00
+20407b4b
+da4007c2
+1a420a00
+1e008c38
+20407c94
+20407ca8
+1e008c24
+20407c90
+20407ca8
+1e008c34
+20407c91
+19622200
+1a220a00
+20207b4b
+18007220
+d8a00ace
+98a08a00
+20207cdc
+18007208
+20207636
+1a222400
+20207a96
+18007208
+202075c7
+20407b30
+18a22200
+20207b36
+20407b63
+2a6ffe00
+2020fb3f
+da40091a
+1a222600
+1a20a3e0
+20407b66
+24610000
+1a622200
+20207b47
+20407b47
+1a222600
+1a20a3e0
+da40091a
+20407b66
+24610000
+1a622200
+20207b47
+1a20a3e0
+da40091a
+1a220a00
+20207b5e
+20407b5e
+2020fb55
+18a0a3e0
+da40091a
+20407b66
+24610000
+da40091a
+18a0a3e0
+1a220a00
+20207b5e
+18a0a3e0
+da40091a
+1a220a00
+20407b30
+20608000
+18a0a3e0
+da40091a
+1a220a00
+20207b30
+18007208
+202075d5
+18007208
+1a20a21c
+202075e4
+18007208
+18002600
+202075f2
+18007208
+1a20a21c
+1a40a41c
+202075bc
+eff00006
+247a0000
+202075aa
+1a226000
+1e022200
+efe20011
+2feffe00
+20608000
+20407b60
+efe20012
+2fec0000
+2020fb7d
+da20091a
+1a420a00
+20407b30
+efe20012
+9a60fe00
+e7e20012
+1a40a5e0
+1a40a220
+18007209
+204075e4
+20207b6e
+20404c20
+20758000
+20207b9a
+20207b89
+58001000
+1ff07e00
+9a40a400
+20600000
+474ec033
+da200000
+6848464a
+1c422400
+1a427e00
+98467c00
+24417b85
+1a427e00
+184084a0
+184084a0
+98467c00
+24217b9d
+1a20a201
+1a217e0f
+243a7b90
+da200000
+20407ba4
+1c427e00
+67e8464a
+20600000
+474f4033
+1a227e00
+207a0000
+18408560
+18408560
+793f841c
+6048464a
+20204cf8
+70463801
+6fe24639
+243a7ba6
+20600000
+70463800
+20600000
+474fc033
+20407ba5
+1a227e00
+67e80a8d
+da20463a
+20407d90
+6fe80a8d
+1fe22200
+20207ba9
+47504034
+20407ba5
+1a227e00
+67e80a8d
+da204642
+20407d90
+6fe80a8d
+1fe22200
+20207ba9
+58000000
+67f04642
+67f0463a
+20600000
+4750c034
+6fe241cf
+247a0000
+da204642
+20407da8
+207a0000
+700a8c00
+20407bcc
+6fe20a8c
+203a7bc1
+20600000
+20407ba5
+da204642
+20407d9c
+1fe20400
+20407ba9
+47514034
+18427e00
+207a0000
+c000fbff
+c0017c04
+c001fc0a
+c003fc0f
+c0047c10
+c004fc11
+c005fc14
+c0067c15
+c006fc16
+c0077c1c
+c007fc21
+c0087c27
+c00b7c31
+c00bfc34
+c00c7c36
+c00cfc39
+c00dfc3d
+c00f7c47
+67e20a95
+4751c034
+2040669e
+243a7bfd
+6fe20a95
+c584fbf8
+c0027c0c
+c002d0fd
+c003510c
+c0057c12
+c008fc2c
+c0097c30
+c00efc3e
+c00fe7fd
+c01067fd
+c010fc49
+c012e7fd
+20600000
+67e20a95
+2040424e
+2022fbfd
+20404256
+24628000
+700a8c01
+20207bb4
+6fe44652
+79207e06
+67e44652
+70409303
+20600000
+70465000
+70409300
+6fe44652
+793ffe06
+67e44652
+20600000
+7041cf05
+20600000
+70007c07
+7004c613
+20600000
+20600000
+20600000
+20600000
+7004d002
+202050f0
+20600000
+20600000
+70434001
+70445600
+6fe44652
+79207e0b
+67e44652
+20600000
+6fe44652
+793ffe0b
+67e44652
+70434000
+20600000
+70434001
+70445601
+6fe44652
+79207e0b
+67e44652
+20600000
+6fe44652
+793ffe0b
+67e44652
+70434000
+20600000
+58000014
+67e40469
+67e4448c
+20206073
+20205e9f
+70433b01
+7041cf1b
+20600000
+70433b01
+20600000
+70433b00
+7041cf00
+20600000
+6fe441ec
+20407d77
+20407bbd
+20204afe
+20205ee2
+70007c34
+79200003
+24748000
+70452d00
+70007c13
+6fe2016b
+793ffe02
+67e2016b
+20600000
+18000e03
+20207ce2
+204066da
+70007d41
+2020637f
+1f267c00
+20628000
+1fe37e00
+c2007c4e
+20600000
+18007e01
+1f267c00
+20628000
+1fe3fe00
+c2007c54
+20600000
+18a27e00
+67e40ab7
+60500a9e
+19627e00
+67e80aa6
+20407c60
+18c27e00
+67e40ab5
+20600000
+1a227e00
+67e80aaa
+1a427e00
+67e80aae
+1a627e00
+67e60ab2
+20600000
+68500a9e
+6fe80aa6
+98001600
+20407c70
+6fe40ab7
+98000a00
+6fe40ab5
+98000c00
+20600000
+6fe80aaa
+98002200
+6fe80aae
+98002400
+6fe60ab2
+98002600
+20600000
+6fe40ab7
+1fe20a00
+20600000
+6fe40ab5
+1fe20c00
+20600000
+18a27e00
+67e40ab7
+20600000
+18c27e00
+67e40ab5
+20600000
+18a27e00
+67e40a93
+18c27e00
+67e40a91
+20600000
+6fe40a93
+1fe20a00
+6fe40a91
+1fe20c00
+20600000
+20407c98
+20407c98
+20207c98
+20407c94
+efe80006
+e7e80005
+20600000
+eff00006
+e7f00005
+20600000
+20407c9a
+20407c94
+20407c94
+20407c94
+20207c94
+df20000a
+20002ee0
+c2007c9d
+20600000
+18007203
+18007e00
+e7f00005
+c2007ca2
+20600000
+18007e00
+e7f00005
+20600000
+18007e00
+e7e80005
+20600000
+18007204
+20207ca1
+18007208
+20207ca1
+1f227e00
+207a0000
+58000000
+e7e20005
+c2007cb2
+20600000
+df200020
+d8a00abe
+20207caf
+efe80013
+e8480011
+9842fe00
+e7e80005
+1a20a204
+1a60a604
+c2007cb8
+20600000
+47524034
+1f227e00
+1fe67c01
+20610000
+9a20a400
+1a40a5ff
+1f237200
+e8420011
+efe20012
+e7e20011
+e0420012
+1a40a5ff
+1a20a201
+c2007cc7
+20600000
+1f227e00
+207a0000
+1f20f3f8
+20417c94
+20628000
+20217cd1
+1f20f208
+1f20f3fc
+20417c91
+20628000
+20217cd6
+1f20f204
+20207cdc
+1f227e00
+207a0000
+efe20006
+e7e20005
+c2007cde
+20600000
+58000000
+1c430400
+60484094
+d8a0419e
+98000400
+18e3fe00
+98a08a00
+e0440005
+4752c034
+20600000
+d9600800
+19701600
+9960fe00
+20600000
+d8e00000
+47534034
+68484094
+1c437e00
+67e84094
+98467c00
+24417cec
+98461600
+19620400
+d8c0419e
+18c20a00
+df200010
+efe40006
+98467e00
+20217d00
+18007e00
+e7e40005
+c2007cfc
+d8c0419e
+18e3fe00
+98c08c00
+efe40006
+20600000
+98408400
+18427200
+58000ea6
+9f267e00
+20610000
+1fe67e00
+18510400
+18408401
+18500400
+98418400
+20600000
+20407d14
+20207d1e
+78547c00
+98467e00
+20217d19
+78347c00
+1fe67e00
+c4078000
+d85f0ea6
+9840fe00
+793ffe40
+20600000
+98000c00
+1ff17e00
+d8400ea6
+984ffe00
+98c0fe00
+20600000
+1fed7e00
+1ff27e00
+68464170
+9846fc00
+20407d61
+18078400
+20600000
+d8400ea6
+9846fc00
+20407d61
+1807fe00
+1ff07e00
+18070400
+98418400
+20600000
+d8400000
+18422600
+efe20003
+20407d3f
+1a620400
+20407d70
+da40000a
+9a4ffe00
+9840fe00
+1fe20400
+c2007d34
+20600000
+d840003a
+98467c00
+24217d48
+d8400061
+98467c00
+20217d4b
+d8400037
+98467e00
+20600000
+d8400030
+98467e00
+20600000
+d8400057
+98467e00
+20600000
+18426000
+580001ff
+18002400
+1fe92200
+1a232200
+9a22a200
+2a2ffe00
+7920fe09
+18430400
+2feffe00
+79208407
+1fe37e00
+1a40a401
+2a400e00
+2420fd51
+e0420005
+c2007d51
+1e020400
+20600000
+207a8000
+20207d61
+efe20011
+e8420012
+98467c00
+24628000
+1a20a201
+1a40a401
+c2007d63
+18007c00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+9840fe00
+98460400
+98467e00
+20600000
+df200200
+d8a04000
+20207ca1
+207a0000
+1fe27a00
+70820301
+20600000
+67e48205
+6fe28203
+79207e04
+67e28203
+20600000
+67e48207
+6fe28203
+79207e06
+67e28203
+20600000
+67e48205
+70820330
+20600000
+6fe28043
+79207e04
+67e28043
+20600000
+6fe28043
+793ffe04
+67e28043
+20600000
+4753c034
+e8500011
+18417eff
+243a7d96
+184cfe00
+e7f00011
+1a20a207
+efe20011
+243a4a8b
+6fe20a95
+e7e20011
+20600000
+47544035
+df200008
+eff00011
+207a0000
+efe20011
+243a7da5
+1a20a201
+c2007da0
+20204a8b
+d8400000
+e0420011
+20600000
+eff00011
+20600000
+efe20011
+20600000
+efe40011
+20600000
+d8400000
+6fe20006
+c2007daf
+18408401
+c2007daf
+18427e00
+20600000
+98467c00
+24610000
+18427e00
+20600000
+18007dff
+20600000
+18007c01
+20600000
+18007c00
+20600000
+78347c00
+20600000
+78547c00
+20600000
+78367c00
+20600000
+78567c00
+20600000
+58000001
+20600000
+58000000
+20600000
+1f227e00
+207a0000
+18c27e00
+9f20fe00
+1fe0ffff
+1fe20c00
+efe20006
+18c08dfe
+e7e20005
+c2007dd1
+20600000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+00000000
+0000f1b1
Index: BlueTooth/BT_code_patch/shoubing/patch/patch.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/patch/patch.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/patch/patch.prog	(working copy)
@@ -0,0 +1,2057 @@
+
+define TX_POWER_MAX
+
+/******************************************/
+/**************   Start   *****************/
+/******************************************/
+
+p_start:
+	bbit1 8,pf_patch_ext
+	//LPM exen bugfix
+	beq patch00_1,p_soft_reset
+//	beq patch00_3,p_main_loop
+
+	beq patch00_5,p_connection_incontext
+	beq patch05_6,p_context_search
+	beq patch06_4,p_send_eir
+	
+	beq patch0b_7,p_process_dmh_data_end1
+	beq patch0c_0,p_process_dmh_data_end
+	beq patch0b_5,p_process_dmh_data_l2cap_start_pkt
+	beq patch0b_6,p_process_dmh_data_l2cap_continue_pkt
+	beq patch0e_0,p_parse_l2cap
+	
+	beq patch07_5,p_slave_loop
+	beq patch10_5,p_shutdown_radio
+	beq patch11_1,p_set_freq_tx
+	//LMP bugfix
+	beq patch12_4,p_ahead_window
+	beq patch14_2,p_init_param
+	//LMP bugfix	
+	beq patch14_3,p_lpm_adjust_clk
+	beq patch15_1,p_lpm_dispatch_next
+	beq patch15_4,p_lpm_unconn_nossp
+	
+//	beq patch16_1,p_lpm_check_wake_lock
+	beq patch17_0,p_module_init
+	beq patch17_3,p_module_hci_cmd_control
+	beq patch17_4,p_module_hci_cmd_transmit_le_notify
+	beq patch17_6,p_hid_rx_process
+	beq patch19_0,p_l2cap_proc_signal_connect_req
+	beq patch1b_3,p_l2cap_malloc
+	branch assert
+	
+pf_patch_ext:
+	beq patch20_3,p_le_receive_skip
+	beq patch20_5,p_le_transmit_receive_sifs
+	beq patch20_6,p_le_transmit
+	beq patch22_3,p_le_acknowledge
+	beq patch23_7,p_le_parse
+	beq patch24_1,p_le_parse_l2cap
+	beq patch24_5,p_le_adv_not_match
+	beq patch26_0,p_le_modified_name
+	beq patch27_4,p_parse_lmp_accepted
+	beq patch27_2,p_parse_lmp
+	beq patch27_5,p_parse_lmp_not_accepted
+	beq patch27_7,p_send_lmp_accepted
+	beq patch27_6,p_send_lmp
+	beq patch28_1,p_ssp_disable
+	beq patch33_1,p_sp_initialize_256
+	beq patch34_3,p_check_51cmd_once_continue
+	branch assert
+	
+
+p_send_eir:
+//	bpatch patch06_4,mem_patch06
+	fetch 1,mem_state_map
+	set0 smap_encryption,pdata
+	store 1,mem_state_map
+	branch send_eir+1
+	
+p_context_search:
+	arg mem_context_new,rega
+	arg context_num_new,loopcnt
+	branch context_search_loop
+
+p_connection_incontext:
+//	bpatch patch00_5,mem_patch00
+	call context_search_insniff
+	nbranch p_connection_nosniff,zero
+	call context_load
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,le_conn_dispatch
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+p_connection_nosniff:
+	call p_context_get_next
+	branch connection_nosniff+1
+
+
+	
+p_context_get_next:
+	arg context_num_new,loopcnt
+	fetcht 1,mem_current_context
+p_context_get_next_loop:
+	increase 1,temp
+	compare context_num_new,temp,0xff
+	nbranch p_context_get_next_cont,true
+	arg 0,temp
+p_context_get_next_cont:
+	storet 1,mem_current_context
+	mul32 temp,context_size,pdata
+	arg mem_context_new,rega
+	iadd rega,rega
+	ifetch 1,rega
+	bbit1 state_insniff,p_context_get_next_sniff
+	rtnbit1 state_inconn
+	rtnbit1 state_inpage
+p_context_get_next_sniff:
+	loop p_context_get_next_loop
+	rtn	
+
+
+p_parse_l2cap:
+	set0 mark_rxbuf_inuse,mark 
+p_parse_l2cap_cont:
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtn blank
+	isolate1 L2CAP_INUSE_BUFF1,pdata
+	arg mem_l2cap_rxbuff1,contr
+	call process_rx_l2cap_pkt,true
+//	bpatch patch0e_1,mem_patch0e
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff1
+	
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtnbit0 L2CAP_INUSE_BUFF2
+	arg mem_l2cap_rxbuff2_new,contr	
+	call process_rx_l2cap_pkt
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff2
+	rtn
+
+
+p_process_dmh_data_l2cap_start_pkt:
+//	bpatch patch0b_5,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x1e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_inuse
+	bbit1 L2CAP_INUSE_BUFF2,end_of_packet
+	bbit0 L2CAP_INUSE_BUFF1,process_dmh_data_into_buff1
+	bbit0 L2CAP_INUSE_BUFF2,p_process_dmh_data_into_buff2
+	branch end_of_packet
+
+p_process_dmh_data_into_buff2:
+	jam 2,mem_l2cap_rxbuff_new //new data in buff 2
+	fetch 2,mem_l2cap_rxbuff2_len
+	bne 0,end_of_packet
+	arg mem_l2cap_rxbuff2_new,contw
+	branch process_dmh_data
+
+p_process_dmh_data_l2cap_continue_pkt:
+//	bpatch patch0b_6,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x1e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_dmh_data_l2cap_continue_pkt1
+	beq 2,p_process_dmh_data_l2cap_continue_pkt2
+	branch end_of_packet
+
+p_process_dmh_data_l2cap_continue_pkt2:
+	arg mem_l2cap_rxbuff2_new,contw
+	branch process_dmh_data_l2cap_continue_pkt2+1
+	
+p_process_dmh_data_end1:	
+//	bpatch patch0b_7,mem_patch0b
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload_crc,crc_failed
+	fetch 1,mem_l2cap_flow_ctrl_flag
+	beq L2CAP_FLOW_CTRL_ENABLE,error_payload_crc
+	branch process_dmh_data_end+5
+ 
+p_process_dmh_data_end:
+//	bpatch patch0c_0,mem_patch0c
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,p_process_l2cap_pass_crc_buff1
+	beq 2,p_process_l2cap_pass_crc_buff2
+	branch assert
+	
+p_process_l2cap_pass_crc_buff1:
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff1_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff1// l2cap payload length
+	increase 4,temp
+	isub temp,null
+	call l2cap_buff1_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+
+
+	 
+p_process_l2cap_pass_crc_buff2:
+	fetch 2,mem_l2cap_rxbuff2_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff2_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff2_new // l2cap payload length 
+	add temp,4,temp
+	isub temp,null
+	call l2cap_buff2_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+
+
+p_l2cap_malloc:
+//	bpatch patch1b_3,mem_patch1b
+	arg 0,regb
+	call l2cap_malloc_is_fifo_full+1
+//	branch l2cap_malloc+3
+	nbranch assert,blank//assert when fifo full
+	call l2cap_malloc_get_full_map
+	arg mem_tx_buff0_new,regB//pbuff = buff0;
+	arg 0,queue // i = 0;
+	branch l2cap_malloc_loop
+
+
+
+p_le_modified_name:
+	call le_modified_name_att_list
+	branch p_le_modified_name_adv
+
+p_le_modified_name_adv:
+	arg mem_le_scan_data_len+32,regc
+	arg mem_le_scan_data,rega
+	branch le_modified_name_adv_and_scan
+	
+p_l2cap_proc_signal_connect_req:
+	copy temp,pdata
+	beq PSM_SDP,l2cap_proc_signal_connect_req_sdp
+	beq PSM_RFCOMM,l2cap_proc_signal_connect_req_rfcomm
+	beq PSM_HID_control,p_l2cap_proc_signal_connect_req_hid_ctrl
+	beq PSM_HID_interrupt,p_l2cap_proc_signal_connect_req_hid_int
+	call l2cap_reject_command
+	branch l2cap_proc_signal_connect_req_rtn	
+
+p_l2cap_proc_signal_connect_req_hid_ctrl:
+
+	call save_cont_pointers
+	arg L2CAP_HID_Control_channel,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	call send_connection_res	
+	jam BT_EVT_HID_INT_CONNECT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+p_l2cap_proc_signal_connect_req_hid_int:
+	call save_cont_pointers
+	deposit clke
+	arg L2CAP_HID_Interrupt_channel,temp
+	fetch 2,mem_hid_int_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	call send_connection_res	
+	jam BT_EVT_HID_INT_CONNECT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+p_module_init:
+	setarg p_module_process_bb_event
+	store 2,mem_cb_bb_event_process
+
+	setarg p_module_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	setarg p_module_process_idle
+	store 2,mem_cb_idle_process
+
+	setarg p_module_le_receive_data
+	store 2,mem_cb_att_write
+
+	setarg p_module_lpm_lock
+	store 2,mem_cb_check_wakelock
+
+	setarg p_module_bt_conn_process
+	store 2,mem_cb_bt_process
+
+	call p_keyboard_ble_init
+
+	call module_lpm_uart_init
+	call module_gpio_init
+	call check_module_disabled
+	//call p_check_otp_shaomaqiang_app
+	branch module_hci_event_enter_standby_mode
+
+	
+p_module_process_idle:
+	call p_m_private_dispatch
+	call module_control_air_flow
+	call p_module_process_idle2
+p_module_process_idle2:
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	branch p_module_process
+	
+p_module_process:
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	branch module_process_with_credit,zero
+	call uartd_prepare_rx
+//	call ice_break
+	ifetch 1,contru
+	bne 0x01,module_hci_in_excp
+	ifetch 1,contru
+	beq HCI_CMD_RESET_SDP_SERVICE,p_module_process_sdp
+	store 1,mem_module_uart_opcode
+	ifetcht 1,contru
+	copy contru,rega
+	storet 1,mem_module_uart_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch module_hci_dicard_packet //discard this packet
+
+p_module_process_sdp:
+	store 1,mem_module_uart_opcode
+	ifetcht 2,contru
+	copy contru,rega
+	storet 2,mem_module_uart_len_new
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch p_module_hci_dicard_packet //discard this packet	
+
+p_module_hci_dicard_packet:
+	call uartd_prepare_rx
+	increase 2,contru
+	ifetch 2,contru
+	iadd contru,contru
+	branch module_hci_dicard_bytes
+	
+	
+p_module_process_bb_event:
+	copy regc,pdata
+/***************classic shutter event****************/
+	beq BT_EVT_BB_CONNECTED,p_classic_shutter_process_baseband_connect
+	beq BT_EVT_BB_DISCONNECTED,p_evt_bb_disconnected
+	beq BT_EVT_RECONN_FAILED,p_evt_page_timeout
+	beq BT_EVT_SETUP_COMPLETE,classic_shutter_process_setup_complete
+	beq BT_EVT_HID_CONNECTED,classic_shutter_process_hid_connect
+	beq BT_EVT_HID_DISCONNECTED,classic_shutter_process_hid_disconnect
+	beq BT_EVT_HID_HANDSHAKE,classic_shutter_process_hid_handshake
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,p_evt_page_timeout
+	beq BT_EVT_VIRTUAL_CABLE_UNPLUG,classic_shutter_process_virtual_cable_unplug
+	beq BT_EVT_REMOTE_UNSNIFF,classic_shutter_process_remote_unsniff
+//	beq BT_EVT_STORE_NVRAM,classic_shutter_process_store_reconnect_information
+	beq BT_EVT_LINKKEY_GENERATE,classic_shutter_process_linkkey_generate
+/***************classic shutter event****************/
+
+/***************ble shutter event****************/
+	beq BT_EVT_LE_START_ENC,p_module_hci_event_start_enc
+	beq BT_EVT_LE_ENC_INFO,p_module_hci_event_enc_info
+
+/***************24g event***********************/
+//	beq BT_EVT_24G_PAIRING_COMPLETE,p_module_hci_event_24g_pairing_complete
+//	beq BT_EVT_24G_ATTEMPT_FAIL,p_module_hci_event_24g_attempt_fail
+//	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_module_hci_event_24g_attempt_success
+
+	//
+	beq BT_EVT_ENTER_SNIFF,p_module_process_enter_sniff
+
+	beq BT_EVT_SNIFF_ACCEPT,p_module_process_sniff_report
+	beq BT_EVT_SNIFF_REPORT,p_module_process_sniff_report
+	beq BT_EVT_HID_INT_CONNECT,p_module_process_hid_int_connect
+	beq BT_EVT_LE_CONNECTED,module_process_le_conn+1
+	beq BT_EVT_LE_DISCONNECTED,p_evt_le_disconnected
+	branch module_process_bb_event + 1
+
+p_classic_shutter_process_baseband_connect:
+	jam 0,mem_classic_shutter_hid_disconn_count
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	jam HCI_EVNET_BB_CONN,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x00
+	istore 1,contwu
+	branch uartd_send
+	
+
+p_evt_le_disconnected:
+	call le_clr_config_more_data
+	call app_ble_start_adv
+	branch module_hci_event_le_disconnect
+
+p_evt_bb_disconnected:
+	jam 0,mem_ns_wake_up_flag
+	call app_bt_start_discovery
+	branch classic_shutter_process_baseband_disconnect+2
+
+p_evt_page_timeout:
+//	call app_bt_start_discovery
+	branch classic_shutter_process_reconnect_failed+1
+	
+p_module_process_sniff_report:
+	setarg 0x02
+	jam HCI_EVENT_HID_SNIFF_REPORT,mem_module_uart_opcode
+	call module_hci_prepare_tx
+	fetch 2,mem_tsniff
+	rshift pdata,pdata
+	
+	istore 2,contwu
+	branch uartd_send	
+
+	
+p_module_process_hid_int_connect:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONN,pdata
+	store 2,mem_ui_state_map
+	setarg 0x02
+	jam HCI_EVENT_HID_INT_CONNECT,mem_module_uart_opcode
+	call module_hci_prepare_tx
+	fetcht 2,mem_hid_int_remote_cid
+	istoret 2,contwu
+	branch uartd_send
+
+p_module_process_enter_sniff:
+
+p_module_sniff_param_check:
+	call module_spp_clear_last_transmite_clock
+	fetch 2,mem_state+coffset_tsniff
+	rshift pdata,pdata
+	fetcht 2,mem_sniff_param_interval
+	isub temp,null
+//	nbranch module_sniff_param_check_unsniff,zero
+	branch app_lpm_mult_enable
+
+	
+p_module_sniff_param_check_unsniff:
+	fetch 1,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+//	fethc 2,core_uart_rxitems    //*
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	ncall module_set_unsniff_task_flag,zero    //*加这两句话
+	branch app_bt_sniff_exit
+
+
+
+keyboard_start_bluetooth_discovery:
+	rtn
+
+
+p_module_bb_event_timer:
+/**************classic shutter timer**********************/
+	call p_m_wakeup_timer
+	call classic_shutter_check_unplug_timer
+	call classic_shutter_hid_handshake_timer
+	branch classic_shutter_hid_disconn_timer
+/************************************/
+
+p_module_le_receive_data:
+	call p_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
+	fetch 2,mem_le_att_handle	
+	branch module_le_receive_data_ok
+
+	
+p_module_lpm_lock:
+	branch module_lpm_lock
+
+p_module_bt_conn_process:
+	branch p_module_spp_enter_sniff
+
+p_module_spp_enter_sniff:
+	fetch 1,mem_btsniff
+	rtn blank
+	branch module_spp_enter_sniff+1
+
+p_module_hci_cmd_control:
+	fetch 1,mem_module_uart_opcode
+	beq HCI_CMD_BT_DISCONNECT,p_module_hci_cmd_bt_disconnect
+	beq HCI_CMD_SET_COD,p_module_hci_cmd_set_cod
+	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_SEND_HID_DATA,p_module_hci_cmd_send_hid_data
+	beq HCI_CMD_SEND_HID_CONTROL_DATA,p_module_hci_cmd_send_hid_control_data
+	beq HCI_CMD_LE_DATA_REQ,p_module_hci_cmd_receive_le_data
+
+	
+	beq HCI_CMD_SET_FEATURE,p_module_hci_cmd_reset_features
+	beq HCI_CMD_SET_SNIFF,p_module_set_bt_sniff
+	beq HCI_CMD_CREAT_BT_RECONNECT,p_moudle_hci_cmd_creat_bt_reconnect
+
+//	beq HCI_CMD_START_24G,p_module_hci_cmd_start_24g
+//	beq HCI_CMD_STOP_24G,p_module_hci_cmd_stop_24g
+//	beq HCI_CMD_PAIR_24G,p_module_hci_cmd_pair_24g
+//	beq HCI_CMD_DISCONNECTED_24G,p_module_hci_cmd_disconnected_24g
+//	beq HCI_CMD_SEND_24G_DATA,p_module_hci_cmd_send_24g_data
+
+	beq HCI_CMD_RESET_SDP_SERVICE,p_module_hci_cmd_set_sdp_service
+
+
+	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_SWITCH_WAKEUP,module_hci_cmd_switch_wakeup
+	branch module_hci_cmd_control + 2
+	
+p_module_set_bt_sniff:
+
+	ifetch 1,contru
+	store 1,mem_btsniff
+	branch module_hci_event_receive_valid_cmd,blank
+	ifetch 2,contru
+	store 2,mem_sniff_param_interval
+	branch module_hci_event_receive_valid_cmd
+	
+//function : modify feature----mem_features
+p_module_hci_cmd_reset_features:		
+	ifetch 8,contru
+	store 8,mem_features
+	branch module_hci_event_receive_valid_cmd
+
+
+
+module_hci_cmd_switch_wakeup:
+	ifetch 2,contru
+	arg 160,temp
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	store 2,mem_m_wakeup_timer
+	
+	ifetch 6,contru 
+	store 6,mem_hci_plap
+
+	// 4 bytes wake data
+	ifetch 4,contru 
+	store 4,mem_m_wake_data
+	
+	ifetcht 4,contru
+	setarg -1
+	ixor temp,pdata
+	store 4,mem_m_access_code
+	
+	ifetch 4,contru
+	store 4,mem_m_access_code+4
+	
+	arg mem_link_key,contw
+	arg 16,loopcnt
+	call uart_copy_rx_bytes
+	// set conn status
+//	jam 1,mem_conn_status
+
+	jam 1,mem_m_process_enable
+
+	// Unit is 625us. 60*625 = 37.5ms
+	setarg 60
+	store 2,mem_m_wake_send_window
+
+	call p_m_send_wake_data_timer_init
+	branch module_hci_event_receive_valid_cmd
+	
+
+module_hci_cmd_delete_customize_service:
+	arg 0x000c,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
+
+
+
+	
+
+p_module_hci_cmd_set_sdp_service:
+	fetch 2,mem_module_uart_len_new
+	copy pdata,loopcnt
+	arg mem_module_uuid_list,contw
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+	
+
+
+p_module_hci_cmd_bt_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd
+	call app_bt_disconnect
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_HID_CONN
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+p_module_hci_cmd_set_cod:
+	fetch 1,mem_module_uart_len
+	bne 3,module_hci_event_receive_valid_cmd
+	ifetch 3,contru
+	store 3,mem_class
+	branch module_hci_event_receive_valid_cmd
+
+p_module_hci_cmd_set_pairing_mode:
+	copy rega,contru
+	ifetch 1,contru
+	beq PAIRING_PINCODE,module_hci_pairing_pincode_mode
+	beq PAIRING_JUSTWORK,module_hci_pairing_just_work_mode
+	beq PAIRING_PASSKEY,module_hci_pairing_passkey
+	beq PAIRING_CONFIRM,p_module_hci_pairing_numeric_comparison
+	branch module_hci_event_receive_invalid_cmd
+p_module_hci_pairing_numeric_comparison:
+	setarg 0x000001
+	branch module_hci_sspairing_mode
+
+
+p_module_hci_cmd_enter_sleep:
+	call module_hci_event_receive_valid_cmd
+	branch app_enter_hibernate
+
+
+p_module_hci_cmd_send_hid_data:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_HID_CONN,bt_keyboard_send_hid_int_data
+	branch module_hci_event_receive_invalid_cmd
+
+p_module_hci_cmd_not_discard:
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	rtn
+	
+bt_keyboard_send_hid_int_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nbranch p_module_hci_cmd_not_discard, blank
+	fetch 1,mem_module_uart_len
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+	
+p_module_hci_cmd_send_hid_control_data:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_HID_CONN,bt_keyboard_send_hid_control_data
+
+	branch module_hci_event_receive_invalid_cmd
+bt_keyboard_send_hid_control_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nbranch p_module_hci_cmd_not_discard, blank
+	fetch 1,mem_module_uart_len
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+
+
+	
+p_module_hci_cmd_transmit_le_notify:
+	add temp,-3,pdata		//sub handle and opcode
+	arg 200,temp	
+	call not_greater_than
+	fetcht 1,mem_module_hci_notify_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_module_hci_notify_len
+	fetcht 2,mem_module_hci_notify_handle
+	increase -1,temp
+	call le_att_get_handle_ptr2
+	branch p_module_hci_cmd_transmit_handle_error,blank
+	ifetcht 4,contr		//flag
+	setarg 0x01280302
+	isub temp,null
+	nbranch p_module_hci_cmd_transmit_handle_error,zero
+	ifetch 1,contr			//Characteristic
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,module_hci_cmd_transmit_le_notify + 13
+	branch p_module_hci_cmd_transmit_handle_error
+
+p_module_hci_cmd_transmit_handle_error:
+	jam 0,mem_module_hci_notify_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_invalid_cmd
+
+p_parse_lmp_accepted:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_HOST_CONNECTION_REQ,p_parse_lmp_accepted_hostconn//ok
+	branch parse_lmp_accepted+2
+
+p_parse_lmp_accepted_hostconn:
+	//fetch 1,mem_state
+	//rtnbit0 state_init_seq
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+//	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//nbranch parse_lmp_accepted_hostconn_ctn,master
+	fetch 1,mem_ns_wake_up_flag
+	branch parse_lmp_accepted_hostconn_ctn,blank
+
+//call ice_break
+	jam 3,mem_connection_options
+	jam CONN_SM_AUTH_PAIR,mem_conn_sm
+	jam 1,mem_link_key_exists
+	jam RECONNECT_HID,memui_reconnect_mode
+	rtn
+	
+
+
+p_parse_lmp:
+	fetch 1,mem_lmi_opcode2
+ 	beq LMP_ENCRYPTION_KEY_SIZE_REQ,p_parse_lmp_crypt_key
+	beq LMP_SNIFF_REQ, p_parse_lmp_sniff_req
+//	beq LMP_QUALITY_OF_SERVICE_REQ,parse_lmp_quality_of_service_req
+ 	branch parse_lmp + 21
+ 	
+/*	jam 0xfe,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	fetch 1,mem_lmi_opcode2
+	istore 1,contwu
+	fetch 1,mem_rxbuf+1
+	istore 1,contwu	
+	branch uartd_send 	
+	*/
+
+parse_lmp_quality_of_service_req: 
+ 	jam LMP_QUALITY_OF_SERVICE_REQ,mem_lmi_opcode2  
+ 	jam LMP_ACCEPTED,mem_lmo_opcode2  
+ 	rtn
+
+p_parse_lmp_crypt_key:
+	fetcht 1,mem_rxbuf+1
+	sub temp,6,null
+	branch reject_lmp_packet_pdu_not_allowed,positive
+	branch parse_lmp_crypt_key + 1
+	
+reject_lmp_packet_pdu_not_allowed:
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+p_parse_lmp_sniff_req:
+	fetch 2,mem_rxbuf+6
+	branch lmp_reject_sniff,blank
+	//call parse_lmp_sniff_req_check_sniff_para
+	//branch lmp_reject_sniff,positive
+	branch parse_lmp_sniff_req+5
+
+
+p_parse_lmp_not_accepted:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_AU_RAND,p_parse_lmp_not_accepted_aurand//ok
+	branch parse_lmp_not_accepted+3
+
+p_parse_lmp_not_accepted_aurand:
+	call parse_lmp_not_accepted_aurand
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_AUTH_WAIT
+	jam HCI_EVENT_BT_RECONNECT_FAIL,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x01
+	istore 1,contwu
+	branch uartd_send
+	
+//function : send lmp_accepted packet
+//		add sniff_request report
+p_send_lmp_accepted:
+	fetch 1,mem_lmi_opcode
+	beq LMP_SNIFF_REQ,p_send_lmp_accept_sniff_req
+	branch send_lmp_accepted+7
+	
+p_send_lmp_accept_sniff_req:
+	jam BT_EVT_SNIFF_REPORT,mem_fifo_temp
+	call ui_ipc_send_event	
+	branch sniff_init
+	
+p_send_lmp:
+	disable user
+	call lmo_fifo_process
+	fetch 1,mem_lmp_to_send
+	rtn blank
+	bbit1 7,p_send_lmp_escape
+//	beq LMP_SNIFF_REQ, p_send_lmp_sniff_req
+	beq LMP_M_TEST_REQ,p_send_lmp_opcode_00
+	branch send_lmp0
+
+	
+p_send_lmp_escape:
+	beq LMP_EXT_FEATURES_RES,p_send_lmpext_features_res
+	beq LMP_EXT_FEATURES_REQ,p_send_lmpext_features_req	
+	branch send_lmp_escape
+
+p_send_lmpext_features_res:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_res
+p_send_lmpext_features_req:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_req
+
+p_check_ssp_enable:
+	fetch 1,mem_ssp_enable 
+	branch ssp_disable, blank
+	branch  ssp_enable
+
+p_ssp_disable:
+	fetch 1,mem_features+6
+	set0 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg 0x1
+	store 2,mem_lmpext_ssp_enable
+	rtn
+
+
+p_sp_initialize_256:	
+	fetch 1,mem_le_secure_connect_enable
+	branch  le_secure_connection_disable,blank
+//	call le_secure_connection_enable
+	call sp_clear_flags
+	branch sp_pubkey_calc_256
+
+p_check_51cmd_once_continue:
+	//bpatchx patch34_3,mem_patch34
+	call lmo_fifo_check
+	nbranch check_51cmd_restore,blank  //process this cmd next time while lmo fifo is full
+	fetch 1,mem_fifo_temp
+	bmark0 mark_context,check_51cmd_check_idle
+  	beq BT_CMD_ENTER_SNIFF,p_cmd_in_sniff
+	branch check_51cmd_once_continue+2
+
+p_cmd_in_sniff:
+	fetch 1,mem_btsniff
+	branch cmd_exit,blank
+	branch cmd_in_sniff
+
+eut_read_otp_data:
+	fetch 1,mem_module_state
+	set1 MODULE_READ_OTP_BIT,pdata
+	store 1,mem_module_state
+	
+	arg 0x00,addhi
+	arg 0x8973,contr
+	ifetch 1,contr
+	set1 6,pdata			//enable chgpump
+	arg 0x8973,contw
+	istore 1,contw
+	
+	arg 0x0f,addhi
+
+	arg 6, loopcnt              //len
+	arg 2,regb                     //addr
+	arg mem_read_otp_data,rega                   //data
+	
+	call eut_read_otp
+
+	//
+	arg 20, loopcnt
+	arg 0x12c,regb
+	arg mem_read_otp_data+6,rega
+	call eut_read_otp
+
+	arg 2, loopcnt
+	arg 0x1ffe,regb
+	arg mem_read_otp_data+26,rega
+	call eut_read_otp
+
+	call eut_otp_deselect
+
+	arg 0x00,addhi
+	arg 0x8973,contr
+	ifetch 1,contr
+	set0 6,pdata			//disable chgpump
+	arg 0x8973,contw
+	istore 1,contw
+	
+	arg 0x00,addhi
+
+	fetch 1,mem_module_state
+	set0 MODULE_READ_OTP_BIT,pdata
+	store 1,mem_module_state
+	rtn
+
+// rega pointers to buffer, regb is otp address, loopcnt is length
+eut_read_otp:
+	lshift3 regb,regb
+	call eut_otp_ce
+	call eut_otp_readen
+eut_read_otp_loop:
+	call eut_write_otpaddr
+	fetch 1,sec_otp_data
+	istore 1,rega
+	increase 8,regb
+	increase 1,rega
+	loop eut_read_otp_loop
+	rtn
+
+eut_otp_ce:
+	setarg 0x20c
+	call eut_write_otpctrl
+	setarg 0x208
+	call eut_write_otpctrl
+	setarg 0x200
+	call eut_write_otpctrl
+	setarg 0x208
+	branch eut_write_otpctrl
+
+eut_write_otpctrl:
+	arg sec_otp_ctrl,contw
+eut_write_word:	
+	istore 1,contw
+	rshift8 pdata,pdata
+	istore 1,contw
+	rtn
+
+eut_otp_readen:
+	setarg 0x288
+	branch eut_write_otpctrl
+
+// regb is otp address
+eut_write_otpaddr:
+	deposit regb
+	arg sec_otp_addr,contw
+	branch eut_write_word
+
+eut_otp_deselect:
+	setarg 0x20c
+	branch eut_write_otpctrl
+
+p_otp_custom_encryption_data_add_loop:
+	arg 13,loopcnt
+	arg OTP_INIT_VAL,temp
+	arg mem_read_otp_data,contr
+p_otp_custom_add:	
+	ifetch 2,contr
+	iadd temp,pdata
+	copy pdata,temp
+	loop p_otp_custom_add
+	rtn
+
+p_otp_custom_encryption_data_xor_loop:
+	arg 13,loopcnt
+	arg mem_read_otp_data,contr
+p_otp_custom_xor:	
+	ifetch 2,contr
+	ixor temp,pdata
+	copy pdata,temp
+	loop p_otp_custom_xor
+	rtn
+
+p_otp_judge_set_flag:
+	jam 0,mem_en_24g_flag
+	arg 0xffff,temp
+	iand temp,pdata
+	arg mem_read_otp_data+26,contr
+	ifetcht 2,contr
+	isub temp,null
+	nrtn zero
+	jam 1,mem_en_24g_flag
+	rtn
+
+p_check_otp_shaomaqiang_app:
+	call eut_read_otp_data
+	call p_otp_custom_encryption_data_add_loop
+	call p_otp_custom_encryption_data_xor_loop
+	call p_otp_judge_set_flag
+	fetch 1,mem_en_24g_flag
+	compare 1,pdata,0xff
+	rtn true
+	branch assert
+
+
+p_m_wakeup_timer:
+	fetch 1,mem_m_process_enable
+	rtn blank
+	arg mem_m_wakeup_timer ,regc
+	arg p_m_wakeup_timeup,regb
+	branch timer_single_step_2B
+	
+p_m_wakeup_timeup:
+	jam  HCI_EVENT_WAKEUP_TIMEOUT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+	
+	
+p_m_private_dispatch:
+	fetch 1,mem_m_process_enable
+	rtn blank
+	branch p_m_send_wake_data_process
+	
+
+p_m_send_wake_data_init:
+	jam 1,mem_m_process_enable
+
+	// Unit is 625us. 60*625 = 37.5ms
+	setarg 60
+	store 2,mem_m_wake_send_window
+
+p_m_send_wake_data_timer_init:
+	// Unit is 625us. 160*625 = 100ms
+	setarg 160
+	force m_wake_timer,queue//change adv interval to diffault to iphone frame
+	branch timer_init
+
+
+p_m_send_wake_data_process:
+	force m_wake_timer,queue
+	call timer_check
+	nrtn blank
+
+	call fetch_page_bt_adr
+
+	// Calc the access code.	
+	call p_m_access_code_generate
+
+	call p_m_send_wake_data_timer_init
+p_m_send_wake_data_start:
+	fetcht 2,mem_m_wake_send_window
+	disable swfine
+	copy temp,stop_watch
+
+p_m_send_wake_data_restart:
+	branch p_m_wait_remote_signal_packet,timeout
+	// send wake data process.
+//fetch 2,0x4fe0
+//increase 1,pdata
+//store 2,0x4fe0
+
+	call set_sync_on
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_tx
+	call start_transmitter
+	call p_m_transmit_packet
+	call end_of_packet
+	// wait a while.
+	nop 5000
+	branch p_m_send_wake_data_restart
+
+
+p_m_lap_generate:
+	fetch 9,mem_m_access_code
+	// remove trailer
+//	rshift4 pdata,pdata
+	// remove 34bit bch
+	rshift32 pdata,pdata
+	rshift2 pdata,pdata
+	store 3,mem_tmp0
+	fetchr lap,3,mem_tmp0
+	rtn
+
+
+p_m_access_code_generate:
+	call p_m_lap_generate
+	fetch 9,mem_m_access_code
+	// remove trailer
+//	rshift4 pdata,pdata
+	fetcht 8,mem_m_p_sequence
+	ixor temp,pdata
+	// get the sync word p xor result.
+	// 6bit + 24bit + 34bit
+	// |fix| |lap| |bch|  
+	store 8,mem_tmp0
+	fetch 5,mem_tmp0
+	// use ulp mode.
+	enable le
+	iforce access
+	disable le
+	// lap and ulp will generate the access cod.
+	rtn
+
+
+
+p_m_transmit_packet_access_and_header:
+	call send_access_word
+	//call scan_mode_whiten
+p_m_transmit_packet_header:
+	//rshift bt_clk,temp
+	//or temp,0x40,white_init
+	//enable enable_white
+	disable enable_white
+	enable enable_hec
+	enable encode_fec1
+	fetch 2,mem_m_snd_op
+	inject mod,10
+	enable enable_parity
+	inject mod,8   /* transmit parity */
+	disable encode_fec1
+	disable enable_parity
+	disable enable_hec
+	set0 PSK3M,radio_ctrl
+	rtn
+
+
+p_m_transmit_packet:
+	setarg 0x078
+	store 2,mem_m_snd_op
+	call p_m_transmit_packet_access_and_header
+
+p_m_transmit_wake_packet_payload:
+	//enable encode_fec2
+	enable encode_fec0
+	disable encrypt
+	enable enable_crc
+
+	// send l2cap header. LLID:0x00, Flow:0x00, Length: 0x153, Reserve: 0x00
+	setarg 0x0A98
+	inject mod, 16
+
+	// Total: 80*4 = 320Bytes
+	arg 80,loopcnt
+p_m_transmit_wake_packet_payload_data_loop0:
+	fetch 4,mem_m_wake_data
+	inject mod,32
+	loop p_m_transmit_wake_packet_payload_data_loop0
+
+	// Total: 19Bytes
+	arg 19,loopcnt
+p_m_transmit_wake_packet_payload_data_loop1:
+	setarg 0x00
+	inject mod,8
+	loop p_m_transmit_wake_packet_payload_data_loop1
+
+p_m_transmit_wake_packet_payload_data_end:
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	rtn
+
+
+p_m_wait_remote_signal_packet:
+	fetcht 2,mem_m_wake_send_window
+	disable swfine
+	copy temp,stop_watch
+
+
+	disable clknt
+	disable attempt
+	
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_rx
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_forever	/* until there is timeout, or matched (true) */
+	nbranch end_of_packet,sync
+//	call rf_debug_active_sync_line,sync
+
+p_m_receive_packet_header:
+	disable enable_white
+	enable enable_hec
+	enable decode_fec1
+	parse demod,bucket,10
+	rshift pwindow,pdata
+	store 2,mem_m_rcv_op
+	parse demod,bucket,8 
+	disable decode_fec1
+	disable enable_hec
+	
+p_m_receive_packet_payload:
+//	call rf_debug_active_crc_error_line,crc_failed
+	branch end_of_packet,crc_failed
+
+	arg 18,loopcnt
+	arg mem_m_process_sync_buffer,contw //lmp_data or test packet
+	//branch tws_receive_packet_payload
+
+// input loopcnt -- packet length
+// input contw    -- packet buffer ptr
+p_m_receive_packet_payload_raw:
+	enable decode_fec2
+	//enable encrypt
+	enable enable_crc
+p_m_process_payload_data:	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop p_m_process_payload_data
+p_m_process_payload_data_end:
+	parse demod,bucket,16  /* cycle through the crc */
+//	call rf_debug_active_crc_error_line,crc_failed
+	call end_of_packet	/* must have heard */
+	rtn crc_failed
+	fetch 6 ,mem_m_process_sync_buffer+2
+	fetcht 6,mem_hci_plap
+	isub temp,null
+	nrtn zero
+//fetch 2,mem_m_process_sync_buffer
+//store 2,0x4fe0
+	// remote clock unit is 312.5us/2 = 156.25us
+	fetch 4,mem_m_process_sync_buffer+14
+	rshift pdata,pdata
+	store 4,mem_clke_bt
+	fetch 1,mem_m_process_sync_buffer+1
+	store 1,extm_newconn_am_addr
+//	jam 0x04,extm_newconn_am_addr
+p_m_send_signal_packet:
+	//flag
+	setarg 0x67
+	store 1,mem_m_process_sync_buffer
+	fetch 6,mem_lap
+	store 6,mem_m_process_sync_buffer+1
+	setarg 0
+	store 9,mem_m_process_sync_buffer+7
+	//Clk Offset
+//	setarg 0
+//	store 3,mem_process_sync_buffer+13
+	
+//	setarg 0xea00
+//	store 2,mem_process_sync_buffer+16
+
+	// align the clock.
+	call rf_setup_time_slave_slot
+	call set_sync_on
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_tx
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+p_m_transmit_signal_packet:
+	fetch 2,mem_m_rcv_op
+	store 2,mem_m_snd_op
+	call p_m_transmit_packet_access_and_header
+
+p_m_transmit_signal_packet_payload:
+	enable encode_fec2
+	disable encrypt
+	enable enable_crc
+
+	arg 13,loopcnt
+	arg mem_m_process_sync_buffer,contr
+p_m_transmit_signal_packet_payload_data_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop p_m_transmit_signal_packet_payload_data_loop
+
+p_m_transmit_signal_packet_payload_data_end:
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	call end_of_packet	/* must have heard */
+
+	jam 0,mem_m_process_enable
+	setarg 0
+	store 2,p_m_wakeup_timer
+p_slave_apply_clke_bt:
+	compare 0x03,clke_bt,0x03
+	branch p_slave_apply_clke_bt_now,true
+	until null,mhalfbnd
+	branch p_slave_apply_clke_bt
+	
+p_slave_apply_clke_bt_now:
+	fetch 4,mem_clke_bt
+	or_into 0x03,pdata
+	icopy clke_bt
+
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	call prepare_newconn
+//	jam 10,mem_newconnto_counter
+p_slave_newconn_loop:
+	call slave_newconn_once
+//call ice_break,match
+	branch p_m_slave_connection_success,match     
+	call new_conn_timeout
+	nbranch p_slave_newconn_loop,blank
+p_m_wakeup_fail:
+	jam  HCI_EVENT_WAKEUP_FAIL,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+p_m_slave_connection_success:
+	jam 1,mem_ns_wake_up_flag
+	fetch 1,mem_rxbuf
+	call p_parse_lmp_opcode_00
+	branch sconn_successful
+	//branch p_hci_send_connection_complete
+
+
+p_parse_lmp_opcode_00:
+	fetch 3,mem_rxbuf+1
+	store 3,mem_m_save_lmp_Ye
+	jam LMP_M_TEST_REQ,mem_lmo_opcode2
+	rtn
+
+
+p_send_lmp_opcode_00:
+	setarg 0x00
+	store 1,mem_lmp_to_send
+	fetch 1,mem_m_save_lmp_Ye
+	beq 0x00, p_send_lmp_rxbuf_00
+	beq 0x04, p_send_lmp_rxbuf_04
+	rtn
+
+p_send_lmp_rxbuf_00:
+	force 10,pdata
+	call msg_send_lmp
+	setarg 0x1d3201
+	istore 9,contw
+	setarg 0
+	branch send_lmp_exit
+
+p_send_lmp_rxbuf_04:
+	force 4,pdata
+	call msg_send_lmp
+	setarg 0x000004
+	istore 3,contw
+	setarg 1
+	branch send_lmp_exit
+
+/*
+p_send_lmp_rxbuf_00:
+	force 4,pdata
+	call msg_send_lmp
+	setarg 0x1f0004
+	istore 3,contw
+	branch send_lmp_request
+
+p_send_lmp_rxbuf_04:
+	force 10,pdata
+	call msg_send_lmp
+	setarg 0
+	istore 2,contw
+	setarg 0x1532
+	istore 8,contw
+	branch send_lmp_request
+*/
+
+	
+
+p_slave_loop:
+//	bpatch patch07_5,mem_patch07
+	call check_bt_disabled
+	call scheduler_process
+	call slave_conn_recv_packet	/* go listen for a packet */
+	nbranch slave_notmatch,match
+//fetch 1, mem_rx_type
+//sub pdata,1,null
+//ncall ice_break,zero
+	call supervision_flush
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call slave_conn_send_packet
+	call parse_l2cap
+	call parse_lmp
+	fetch 1,mem_slave_rcvcnt
+	increase 1,pdata
+	store 1,mem_slave_rcvcnt
+	call calc_clke_offset
+	branch slave_notmatch
+
+
+
+
+/*
+	芯片公共bugfix
+*/
+
+/*
+	YC 3121 LPM  bugfix
+*/
+p_ahead_window:
+	copy temp,pdata
+	call clk2bt
+	lshift16 bt_clk,pdata
+	set1 44,pdata
+	call clk_diff
+	set0 44,pdata
+	call get_clk
+	call clk_diff
+	rtn user
+	call p_clk2rt
+	branch ahead_window+12
+
+p_lpm_adjust_clk:
+	deposit clke
+	call p_clk_diff_rt
+	branch lpm_adjust_clk+3
+
+p_lpm_dispatch_next:
+	fetch 2,mem_context + coffset_rx_window
+	rshift pdata,pdata
+	call clk2bt
+	deposit alarm
+	call clk_diff
+	copy clke,temp
+	call p_clk_diff_rt
+	branch lpm_dispatch_next+30
+
+p_clk_diff_rt:
+	call clk_diff
+p_clk2rt:
+	iforce contr
+	set0 16,contr
+	branch clk2rt+1
+
+/*
+	YC3121 没有exen GPIO
+	跳过disable exen
+*/
+p_soft_reset:
+	call rfcomm_init
+	call init_lmp
+	call p_ui_init
+	branch soft_reset + 9
+
+p_ui_init:
+	rtn wake
+	branch ui_timer_init
+
+p_main_loop:
+	//call p_g24_dispatch
+	branch main_loop+1
+
+/*
+	YC3121 shutdown radio bugfix
+	rfen_adc bug 陶其文添加
+*/
+p_shutdown_radio:
+	branch p_shutdown_radio0,is_rx
+	hjam 0xd4, 0x955
+	nop 4
+	hjam 0xd2, 0x955
+	nop 4
+	hjam 0xd1, 0x955
+	nop 4	
+	fetch 1,mem_tx_power
+	beq TX_POWER_0DB,p_shutdown_radio_0db
+	beq TX_POWER_3DB,p_shutdown_radio_3db
+	beq TX_POWER_5DB,p_shutdown_radio_5db
+	beq TX_POWER_f3DB,p_shutdown_radio_f3db
+	beq TX_POWER_f5DB,p_shutdown_radio_f5db
+	beq TX_POWER_PAIR,p_shutdown_radio_pair
+p_shutdown_radio_5db:	
+p_shutdown_radio_0db:
+	hjam 0xd0, 0x955
+	hjam 0xe0, 0x956
+p_shutdown_radio0:
+	force 0x08,radio_ctrl
+	force 0,radio_ctrl
+	disable is_rx
+	disable is_tx
+	pulse packet_end
+	hjam 0x0,rfen_mdm
+	hjam 0x0,rfen_tx
+	hjam 0x0,rfen_rx
+	hjam 0,rfen_sn
+	hjam 0x70,rfen_msc
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	rtn
+p_shutdown_radio_pair:
+p_shutdown_radio_f5db:
+p_shutdown_radio_f3db:
+p_shutdown_radio_3db:
+	hjam 0xd0,0x955
+	hjam 0xc0,0x956
+	branch p_shutdown_radio0
+
+
+p_le_transmit:
+	call le_prep
+	call p_letx_setfreq
+	branch le_transmit0
+
+p_letx_setfreq:
+	branch p_txon,match
+	branch letx_setfreq+1
+
+p_set_freq_tx:
+	storet 1,mem_last_freq
+	call set_freq_tx_offset
+	call rf_write_freq
+	setarg param_pll_setup
+	call sleep
+p_txon:	
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	branch txon+1
+
+
+p_init_param:
+	hjam 0x7c,rfen_adc
+	rtn wake
+	setarg 0
+	store 2,mem_tx_len
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+
+
+
+/*
+	YC3121 芯片功能bugfix
+*/
+
+/*
+	关闭广播不能休眠的问题
+*/
+p_lpm_unconn_nossp:
+	branch lpm_unconn_cont				//BT/BLE discover don't infect lpm
+
+
+
+
+
+p_keyboard_ble_init:
+	setarg 0x25
+ 	store 2,mem_le_pairing_handle
+
+ 	call le_set_config_fixed_ltk
+	call le_set_fixed_ltk
+	call le_set_justwork
+	branch le_set_config_read_authentication
+
+
+/*
+	ble 层bugfix
+*/
+
+/*
+	广播层收发等待100us左右
+*/
+p_le_transmit_receive_sifs:
+	call le_transmit
+	call set_sync_on
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	nop 1500
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup 
+	branch le_receive_rxon
+
+
+p_le_receive_skip:
+	call save_rssi
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	copy pdata,loopcnt
+	branch lerx_nopayload,blank
+	branch lerx_loop
+
+
+/*
+	l2cap 组包的问题
+*/
+p_le_parse:
+	rtnmark1 mark_old_packet
+	call le_fifo_check_full
+	nrtn blank
+	fetch 1,mem_le_rxbuf
+	and pdata,0x3,pdata
+	store 1,mem_le_packet_llid
+	ifetch 1,contr
+	store 1,mem_le_packet_size
+	rtn blank							//empty rtn
+	copy contr,pdata
+	store 2,mem_le_payload_ptr
+	fetch 1,mem_le_packet_llid
+	beq LLID_LE_LL,le_parse_ll
+	call le_check_l2cap_complete
+	arg wake_lock_ble_rx_patch,queue
+	nbranch lpm_get_wake_lock,user
+	call lpm_put_wake_lock
+	branch le_parse_l2cap + 3
+
+
+p_le_parse_l2cap:
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,p_le_parse_att
+	beq LE_L2CAP_CID_SMP,le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+
+
+p_le_adv_not_match:
+//	bpatchx patch24_5,mem_patch24
+	random pdata 
+	arg 0xf,temp
+	iand temp,pdata
+	add pdata,25,pdata
+	call delay
+	fetch 1,mem_le_adv_channel_map_temp
+	fetcht 1,mem_le_adv_channel_map
+	isub temp,null
+	nbranch le_adv_loop,zero
+	arg le_adv_interval_timer,queue
+	fetch 2,mem_le_adv_interval
+	branch timer_init
+	
+/*
+	解密错误不解析的问题
+*/
+p_le_acknowledge:
+	call le_supervision_flush
+	call le_check_wak
+	fetch 1,mem_le_rxbuf
+	isolate1 md,pdata
+	setflag true,mark_ble_rx_md,mark
+	rshift pdata,pdata
+	ixor temp,pdata
+	isolate1 nesn,pdata
+	setflag true,mark_old_packet,mark	/* retransmit */
+	rtnmark1 mark_old_packet
+	fetch 1,mem_le_rxbuf+1			
+	branch le_ack_unenc,blank		/* empty packet, no decryption */
+	fetch 1,mem_le_state
+	bbit0 lestate_encryption,le_ack_unenc
+	call load_sk
+	call le_decrypt
+	nsetflag blank,mark_old_packet,mark
+	nrtn blank
+	branch le_ack_unenc
+
+
+
+/*
+ble keyboard event deal
+*/
+
+p_module_hci_event_start_enc:
+	jam HCI_EVENT_BLE_HID_CONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+p_module_hci_event_enc_info:
+	jam HCI_EVENT_BLE_ENC_INFO,mem_module_uart_opcode
+	setarg 28
+	call module_hci_prepare_tx
+	fetch 6,mem_le_lap
+	istore 6,contwu
+	fetch 6,mem_le_plap
+	istore 6,contwu
+	arg mem_le_ltk,contr
+	arg 16,loopcnt
+	call uart_copy_tx_bytes
+	branch uartd_send
+
+
+
+p_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request
+	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
+	branch le_parse_att+2
+
+	
+p_le_parse_att_write_request:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	call le_writeatt_cb
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_WRITE_AUTH,le_send_att_write_response
+	
+	fetcht 2,mem_le_att_handle
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_write_response,zero
+	call p_le_check_encrypt_state
+	nbranch le_send_att_write_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+
+p_le_parse_att_read_request:
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
+	branch le_send_att_read_response
+
+p_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+//le_send_att_read_response_error_insufficient_auth:
+	call p_le_check_encrypt_state
+	nbranch le_send_att_read_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+p_module_hci_cmd_receive_le_data:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	call p_module_check_ble_encrypt_state
+	branch module_hci_cmd_receive_le_data+3
+
+
+p_module_check_ble_encrypt_state:
+	fetch 1,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_ENCRYPT,p_le_check_encrypt_state
+	branch disable_user
+
+p_le_check_encrypt_state:
+	call disable_user
+	fetch 1,mem_le_pairing_mode
+	rtneq LE_PAIRING_MODE_NONE
+	fetch 1,mem_le_state
+	rtnbit1 lestate_encryption
+	branch enable_user
+
+	
+
+
+
+/*
+	经典蓝牙事件处理函数
+*/
+//清除timer
+classic_shutter_process_baseband_connect:
+	jam 0,mem_classic_shutter_hid_disconn_count
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	branch app_bt_stop_discovery
+
+classic_shutter_process_baseband_disconnect:
+	jam 0,mem_ns_wake_up_flag
+	call module_disconn_start
+	call classic_shutter_disconnect_clear_flag
+	fetch 2,mem_ui_state_map
+//	rtnbit0 UI_STATE_BT_HID_CONNECT
+	set0 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+classic_shutter_disconnect_clear_flag:
+	jam APP_HANDSHAKE_NULL,mem_app_handshake_flag
+	jam 0,mem_hid_handshake_timer_count
+	jam 0,mem_unsniff2sniff_timer_count
+	jam 0,mem_classic_shutter_cable_unplug_conut
+	jam 0,mem_classic_shutter_hid_disconn_count
+	rtn
+
+classic_shutter_process_reconnect_failed:
+	call module_disconn_start
+	jam HCI_EVENT_BT_RECONNECT_FAIL,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x00
+	istore 1,contwu
+	call uartd_send
+	branch app_disconn_reason_clear
+
+classic_shutter_process_setup_complete:
+	rtn
+
+classic_shutter_process_hid_connect:
+	setarg HID_HANDSHAKE_TIMEOUT
+	store 1,mem_hid_handshake_timer_count
+	rtn
+
+classic_shutter_process_hid_disconnect:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	call module_hci_event_enter_standby_mode_len0
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	setarg FLAG_SHUTTER_HID_DISCONN_TIMEOUT
+	store 1,mem_classic_shutter_hid_disconn_count
+	rtn
+
+classic_shutter_process_hid_handshake:
+	fetch 1,mem_app_handshake_flag
+	rtneq APP_HANDSHAKE_DONE
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_CONNECT,mem_module_uart_opcode
+	call module_hci_event_enter_standby_mode_len0
+	jam APP_HANDSHAKE_DONE,mem_app_handshake_flag
+//	call app_lpm_mult_enable
+	call app_bt_stop_discovery
+	branch app_bt_enter_sniff
+
+classic_shutter_process_reconnect_page_timeout:
+	branch classic_shutter_process_reconnect_failed
+
+classic_shutter_process_virtual_cable_unplug:
+	setarg FLAG_SHUTTER_CABLE_UNPLUG_TIMEOUT
+	store 1,mem_classic_shutter_cable_unplug_conut
+	rtn
+
+classic_shutter_process_remote_unsniff:
+	branch app_start_auto_sniff
+
+classic_shutter_process_store_reconnect_information:
+	rtn
+
+classic_shutter_process_linkkey_generate:
+	branch p_module_hci_event_bt_enc_info
+p_module_hci_event_bt_enc_info:
+	jam HCI_EVENT_BT_ENC_INFO,mem_module_uart_opcode
+	setarg 28
+	call module_hci_prepare_tx
+	fetch 6,mem_lap
+	istore 6,contwu
+	fetch 6,mem_plap
+	istore 6,contwu
+	arg mem_link_key,contr
+	arg 16,loopcnt
+	call uart_copy_tx_bytes
+	branch uartd_send
+
+
+/*
+	bt keyboard timer
+*/
+classic_shutter_check_unplug_timer:
+	arg mem_classic_shutter_cable_unplug_conut,regc
+	arg classic_shutter_unplug_timeout,regb
+	branch timer_single_step
+	
+classic_shutter_unplug_timeout:
+	fetch 1,mem_CONTROL_tasks
+	set1  L2CAP_DISCONNECT_INTERRUPT, pdata
+	set1  L2CAP_DISCONNECT_CONTROL, pdata
+	store 1,mem_CONTROL_tasks	
+	rtn
+
+classic_shutter_hid_handshake_timer:
+	arg mem_hid_handshake_timer_count,regc
+	arg classic_shutter_process_hid_handshake,regb
+	branch timer_single_step
+
+classic_shutter_hid_disconn_timer:
+	arg mem_classic_shutter_hid_disconn_count,regc
+	arg app_bt_disconnect,regb
+	branch timer_single_step
+
+
+/*
+	bt keyboard send hid data
+*/
+
+
+bt_keyboard_send_hid_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nrtn blank
+	fetch 1,mem_module_uart_len
+	add pdata,1,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0xa1
+	istore 1,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+p_moudle_hci_cmd_creat_bt_reconnect:
+	ifetch 6,contru
+	store 6,mem_hci_plap
+	ifetch 2,contru
+	store 2,mem_page_to
+	arg mem_link_key,contw
+	arg 16,loopcnt
+	call uart_copy_rx_bytes
+	call check_link_key_load
+	call app_bt_stop_discovery
+	call app_bt_start_reconnect
+	branch module_hci_event_receive_valid_cmd
+
+
+/*
+	bt hid patch bugfix
+*/
+p_hid_rx_process:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	ifetch 1,contr
+	and pdata,0x0f,temp
+	rshift4 pdata,pdata //hidtype
+	beq hid_type_set_idle,hid_rx_process_handshake
+	beq hid_type_set_protocol,hid_rx_process_handshake
+	beq hid_type_data,p_hid_rx_process_data
+	beq HID_TYPE_SET_REPORT,p_hid_rx_process_set_report
+	beq HID_TYPE_CONTROL,p_hid_rx_process_hid_control
+	beq HID_TYPE_GET_REPORT,hid_rx_process_handshake
+	rtn
+
+p_hid_rx_process_data:
+	
+	branch p_hid_rx_process_out_data
+	ifetch 2,contr
+	store 2,mem_pdatatemp
+	beq HID_REPORT_ID_KB,p_hid_rx_process_data_hid_kb	
+	rtn
+p_hid_rx_process_out_data:
+
+	jam HCI_EVENT_RECEIVE_BT_HID_DATA,mem_module_uart_opcode
+	fetch 2,mem_l2cap_rx_pkt_length
+	pincrease -1
+	icopy loopcnt
+	
+	call module_hci_prepare_tx
+	fetch 2,mem_l2cap_payload_ptr
+	
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+
+	
+p_hid_rx_process_data_hid_kb:
+	jam HCI_EVENT_RECEIVE_BT_HID_DATA,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx	
+	fetch 2,mem_pdatatemp
+	istore 2,contwu
+	branch uartd_send
+
+p_hid_rx_process_set_report:
+	call p_hid_rx_process_data
+	branch hid_rx_process_set_report+1
+
+p_hid_rx_process_hid_control:
+	copy temp,pdata
+	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,hid_rx_process_virtual_cable_unplug
+	jam 1,mem_suspend_flag
+	beq HID_CONTROL_P_SUSPEND,hid_rx_process_handshake
+	jam 0,mem_suspend_flag
+	beq HID_CONTROL_P_EXITSUSPEND,hid_rx_process_handshake
+	rtn
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_24g_spec_code/patch_24g.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_24g_spec_code/patch_24g.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_24g_spec_code/patch_24g.prog	(working copy)
@@ -0,0 +1,664 @@
+
+
+p_module_hci_cmd_start_24g:
+	call module_hci_event_receive_valid_cmd
+	ifetch 4,contru
+	store 4,mem_24g_addr
+	jam STATE_24G_PAIRING_SUCCESS,mem_24g_pairing_sm
+	branch p_g24_start_24g_mode
+
+p_module_hci_cmd_stop_24g:
+	call module_hci_event_receive_valid_cmd
+	set0 mark_24g,mark
+	jam STATE_24G_PAIRING_SUCCESS,mem_24g_pairing_sm
+	branch p_g24_stop_g24_mode
+
+p_module_hci_cmd_pair_24g:
+	call module_hci_event_receive_valid_cmd
+	branch p_g24_start_pairing_sm1
+
+p_module_hci_cmd_disconnected_24g:
+	bmark0 mark_24g,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd
+	branch p_g24_stop_g24_mode
+
+p_module_hci_cmd_send_24g_data:
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	arg mem_24g_txbuf_new,contw
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+p_module_hci_event_24g_pairing_complete:
+	jam HCI_EVENT_24G_PAIRING_COMPLETE,mem_module_uart_opcode
+	setarg 4
+	call module_hci_prepare_tx
+	fetch 4,mem_24g_addr
+	istore 4,contwu
+	branch uartd_send
+	
+p_module_hci_event_24g_attempt_fail:
+	jam HCI_EVENT_24G_ATTEMPT_FAIL,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+p_module_hci_event_24g_attempt_success:
+	jam HCI_EVENT_24G_ATTEMPT_SUCCESS,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+p_g24_dispatch:
+	rtnmark0 mark_24g
+	fetch 4,mem_24g_enter_hibernate
+	store 4,mem_24g_enter_hibernate_setup
+	call p_g24_txdata_prep
+	nbranch p_g24_long_sleep,user
+	jam 10,mem_24g_enter_lpm_timer
+	call p_g24_transmit_packet
+	fetch 1,mem_24g_pairing_sm
+	rtnne STATE_24G_PAIRING_SUCCESS
+ifdef TX_POWER_MAX
+	jam TX_POWER_5DB,mem_tx_power
+else
+	call power_ctrl_start
+endif	
+p_g24_short_sleep:
+	rtn
+	fetch 1,mem_mouse_retry_flag
+	nrtn blank
+//	call p_check_IPC_for_LPM
+//	nrtn user
+//	fetch 1,mem_c51_lpm_lock
+//	nrtn blank
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+p_g24_short_sleep_1:	
+	setarg 58000
+p_g24_short_sleep_2:	
+	call clk2lpo
+ 	storet 4,mem_sleep_counter
+ 	branch lpm_sleep
+
+p_g24_long_sleep:
+	rtn
+//	call p_check_IPC_for_LPM
+//	nrtn user
+//	fetch 1,mem_c51_lpm_lock
+//	nrtn blank
+	call lpo_calibration
+	fetch 3,mem_clks_per_lpo
+	rtn blank
+	fetch 1,mem_lpm_mode
+	rtn blank
+	fetch 1,mem_24g_enter_lpm_timer
+	nbranch p_g24_short_sleep_1,blank	
+	fetch 4,mem_24g_enter_hibernate_setup
+  	branch p_g24_short_sleep_2
+
+p_g24_txdata_prep:
+	fetch 1,mem_24g_pairing_sm
+	bne STATE_24G_PAIRING_SUCCESS,p_g24_pairing_sm	
+ifdef OTA_ENABLE
+	fetch 1,mem_24g_ota_enable
+	beq 1,p_g24_txdata_skip_short_lpm
+endif	
+	call p_g24_package_data
+	call p_g24_get_package_data,user
+	call p_g24_transmit_prep,user
+p_g24_txdata_enable_tx:
+	jam ENSURE_ON_24G,mem_24g_ensure
+	rtn
+
+p_g24_package_data:
+	disable user
+	jam 2,mem_24g_data_type
+	fetch 1,mem_24g_txbuf_new
+	beq 0x01,p_g24_dataready			
+	beq 0x02,p_g24_dataready_mk	
+	beq 0x03,p_g24_dataready_ms
+	beq 0x06,p_g24_dataready_sys
+	beq 0x07,p_g24_dataready_game 
+	fetch 1,mem_mouse_retry_flag
+	ncall enable_user,blank
+	rtn
+p_g24_dataready:				
+	jam 0x00,mem_24g_txbuf_new				//standard key 0x00
+	jam 10,mem_24g_datalen		// 02 + 00 + 8 payload
+	branch p_g24_package_data_rtn
+
+p_g24_dataready_game:  //game key
+	jam 0x08,mem_24g_txbuf_new				
+	jam 24,mem_24g_datalen		// 02 + 08 + 13
+	branch p_g24_package_data_rtn
+	
+p_g24_dataready_mk:			
+	jam 0x03,mem_24g_txbuf_new				//multi key 0x03
+	jam 4,mem_24g_datalen		// 02 + 03 + 2 payload
+	branch p_g24_package_data_rtn
+p_g24_dataready_sys:
+	jam 0x02,mem_24g_txbuf_new				//system key 0x02
+	jam 3,mem_24g_datalen		// 02 + 02 + 1 payload
+	branch p_g24_package_data_rtn
+p_g24_dataready_ms:
+	jam 1,mem_24g_data_type		// mouse
+	jam 8,mem_24g_datalen		// 01 + 7 payload
+p_g24_package_data_rtn:	
+	jam 0,mem_24g_get_ack_fail
+	branch enable_user
+
+
+p_g24_get_package_data:
+	arg mem_24g_txbuf,contw
+	arg mem_24g_txbuf_new,contr
+	arg 32,loopcnt
+	branch memcpy
+
+
+p_g24_transmit_packet:
+	jam 0,mem_24g_retry
+p_g24_transmit_loop:
+	arg param_rx_setup,timeup
+	until clkn_rt,meet
+	call p_g24_transmit_receive_ack
+	nbranch p_g24_retransmit,user3
+	call p_g24_ackpayload_parse
+ifndef TX_POWER_MAX	
+	call power_ctrl_pac_succ_incrs
+endif	
+	fetch 1,mem_24g_pid
+	increase 1,pdata
+	store 1,mem_24g_pid
+	jam 0,mem_mouse_retry_flag
+	fetch 1,mem_24g_pairing_sm
+	bne STATE_24G_PAIRING_SUCCESS,p_g24_paring_mode_start
+p_g24_transmit_abandon:
+	call p_g24_clear_txbuf
+	jam 0,mem_24g_get_ack_fail
+	jam ENSURE_OFF_24G,mem_24g_ensure
+	rtn
+
+
+p_g24_retransmit:
+	jam 1,mem_mouse_retry_flag
+	fetch 1,mem_24g_get_ack_fail
+	increase 1,pdata
+	store 1,mem_24g_get_ack_fail
+	fetch 1,mem_24g_pairing_sm
+	bne STATE_24G_PAIRING_SUCCESS,p_g24_tx_paring_retry
+	fetch 1,mem_24g_get_ack_fail
+	beq  0xff,p_g24_long_sleep_setup
+	fetch 1,mem_24g_get_ack_fail
+	arg 16,temp
+	isub temp,null
+	branch p_g24_ch,positive
+	fetch 1,mem_24g_retry
+	increase 1,pdata
+	store 1,mem_24g_retry
+	nop 10
+	bne retry_24g,p_g24_transmit_loop
+	branch p_g24_ch
+	
+
+p_g24_clear_txbuf:
+	setarg 0
+	store 32,mem_24g_txbuf
+	store 32,mem_24g_txbuf_new
+	rtn
+
+p_g24_long_sleep_setup:
+	call p_g24_stop_g24_mode
+	jam 0,mem_mouse_retry_flag
+	call p_g24_clear_txbuf
+	jam 0,mem_24g_get_ack_fail
+	fetch 4,mem_24g_enter_hibernate_max
+	store 4,mem_24g_enter_hibernate_setup
+	rtn
+
+p_g24_paring_mode_start:
+ifndef TX_POWER_MAX
+	call power_ctrl_pac_succ_cnt_init
+endif	
+	branch p_g24_paring_mode
+
+p_g24_transmit_receive_ack:
+	disable user3
+	call p_g24_transmit
+//	fetch 1,mem_24g_no_ack
+//	beq no_ack_24g,p_g24_transmit_no_ack	//tx no ack
+	force 0,radio_ctrl
+	fetch 4,mem_24g_addr
+	iforce access
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	call rf_rx_enable
+	call p_g24_receive_rxon
+	call p_g24_end_of_packet,user3
+	rtn
+//p_g24_transmit_no_ack:
+//	jam 0,mem_24g_rxbuf+1
+//	enable user3
+//	branch p_g24_end_of_packet
+
+
+p_g24_tx_paring_retry:
+	rtn
+//	fetch 1,mem_24g_get_ack_fail
+//	rtnne 0xff
+//	jam 0,mem_24g_get_ack_fail
+p_g24_stop_g24_mode:
+	jam 0,mem_mouse_retry_flag
+	jam BT_EVT_24G_ATTEMPT_FAIL,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+p_g24_ackpayload_parse:
+	call p_g24_read_len_pid_crc
+	fetch 1,mem_24g_rxdata_length	//ack payload length 
+	rtn blank
+	iforce loopcnt
+	call p_24g_kb_led
+	arg mem_24g_rxbuf+2,contr
+	arg mem_24g_rxpayload,contw	//ack payload buffer 
+	branch memcpy
+
+p_24g_kb_led:
+	fetch 1,mem_24g_rxbuf+1
+	compare 0x08,pdata,0xf8
+	nrtn true
+	fetch 1,mem_24g_rxbuf+2
+	beq 0xff,p_pc_sleep_opcode
+	jam HCI_EVENT_24G_RECEIVE_LOCK,mem_module_uart_opcode
+	branch p_pre_send_num
+p_pc_sleep_opcode:
+	jam HCI_EVENT_24G_PC_SLEEP,mem_module_uart_opcode
+p_pre_send_num:
+	setarg 1
+	call module_hci_prepare_tx
+	fetcht 1,mem_24g_rxbuf+2
+	istoret 1,contwu
+	call uartd_send
+	// test
+//	storet 1,mem_caps_num_lock
+	jam 0,mem_24g_led_flag
+	rtn	
+
+p_g24_start_pairing_sm1:
+	set1 mark_24g,mark
+	call p_g24_pair_init
+	call p_g24_transmit_abandon
+	jam STATE_24G_PAIRING_1,mem_24g_pairing_sm
+	rtn
+
+p_g24_pair_init:
+	jam 0,mem_24g_pid
+	jam G24_PAIR_CH,mem_24g_ch
+	fetch 4,mem_24g_paring_addr
+	branch p_g24_update_addr_and_synccrc8
+
+p_g24_pairing_sm:
+	call p_g24_pair_init
+	fetch 1,mem_24g_ensure
+	beq ENSURE_ON_24G,enable_user
+	fetch 1,mem_24g_pairing_sm
+	beq STATE_24G_PAIRING_1,p_g24_pairing_sm_1
+	beq STATE_24G_PAIRING_2,p_g24_pairing_sm_2
+	beq STATE_24G_PAIRING_3,p_g24_pairing_sm_3
+	branch assert
+
+p_g24_pairing_sm_1:
+	jam STATE_24G_PAIRING_1_WAITING_ACK,mem_24g_pairing_sm
+	jam 0xaa,mem_24g_common_temp
+	branch p_g24_pairing_sm_common
+p_g24_pairing_sm_2:
+	jam STATE_24G_PAIRING_2_WAITING_ACK,mem_24g_pairing_sm
+	jam 0x55,mem_24g_common_temp
+	branch p_g24_pairing_sm_common
+p_g24_pairing_sm_3:
+	jam STATE_24G_PAIRING_3_WAITING_ACK,mem_24g_pairing_sm
+	jam 0x22,mem_24g_common_temp
+p_g24_pairing_sm_common:
+	//fetch 1,mem_24g_data_type
+	//and_into bits_data,pdata
+	//store 1,mem_24g_common_temp+1
+	jam 0x02,mem_24g_common_temp+1	// mem_24g_data_type: 02 keyboard
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_common_temp+2
+	jam 0,mem_24g_common_temp+6
+	arg mem_24g_common_temp,rega
+	arg 7,temp
+	call p_g24_put_data_in_buff
+	call p_g24_transmit_prep
+	call p_g24_txdata_enable_tx
+	branch enable_user
+
+p_g24_paring_mode:
+	fetch 1,mem_24g_pairing_sm
+	rtneq STATE_24G_PAIRING_SUCCESS
+	beq STATE_24G_PAIRING_1_WAITING_ACK,p_g24_pairing_sm_1_waiting_ack
+	beq STATE_24G_PAIRING_2_WAITING_ACK,p_g24_pairing_sm_2_waiting_ack
+	beq STATE_24G_PAIRING_3_WAITING_ACK,p_g24_pairing_sm_3_waiting_ack
+	rtn
+
+
+p_g24_pairing_sm_1_waiting_ack:
+	jam STATE_24G_PAIRING_2,mem_24g_pairing_sm
+	branch p_g24_transmit_abandon
+p_g24_pairing_sm_2_waiting_ack:
+	jam STATE_24G_PAIRING_3,mem_24g_pairing_sm
+	branch p_g24_transmit_abandon
+p_g24_pairing_sm_3_waiting_ack:
+	jam STATE_24G_PAIRING_SUCCESS,mem_24g_pairing_sm
+	jam BT_EVT_24G_PAIRING_COMPLETE,mem_fifo_temp
+	call ui_ipc_send_event	
+	fetch 4,mem_24g_rxpayload+2
+	call p_g24_update_addr_and_synccrc8
+	branch p_g24_transmit_abandon
+
+p_g24_start_24g_mode:
+	rtnmark1 mark_24g
+	call p_g24_syncword_crc8
+	call p_g24_ch
+	fetch 1,mem_24g_pairing_sm
+	rtnne STATE_24G_PAIRING_SUCCESS
+	call p_g24_tx_attemp_data_prep
+	setarg 0
+	store 2,mem_24g_check_dongle_times
+p_g24_tx_attemp_dongle_loop:
+	call lpo_calibration
+	nop 2000
+	fetch 1,mem_24g_check_dongle_times
+	beq 0xff,p_g24_stop_g24_mode	//
+	call p_g24_transmit_receive_ack
+	nbranch p_g24_attemp_txdata_retry,user3
+p_g24_tx_attemp_dongle_succ:
+	call p_g24_clear_txbuf
+	set1 mark_24g,mark
+	jam BT_EVT_24G_ATTEMPT_SUCCESS,mem_fifo_temp
+	branch ui_ipc_send_event
+
+
+p_g24_tx_attemp_data_prep:
+	jam 0xff,mem_24g_common_temp
+	fetch 1,mem_24g_data_type
+	store 1,mem_24g_common_temp+1
+	fetch 4,mem_24g_device_addr
+	store 4,mem_24g_common_temp+2
+	arg 6,temp
+	arg mem_24g_common_temp,rega
+	call p_g24_put_data_in_buff
+	branch p_g24_transmit_prep
+	
+p_g24_attemp_txdata_retry:
+	fetch 2,mem_24g_check_dongle_times
+	increase 1,pdata
+	store 2,mem_24g_check_dongle_times
+	call p_g24_ch
+	branch p_g24_tx_attemp_dongle_loop
+
+
+p_g24_put_data_in_buff:
+	storet 1,mem_24g_datalen
+	copy temp,loopcnt
+	arg mem_24g_txbuf,contw
+	copy rega,contr
+	branch memcpy
+
+p_g24_read_len_pid_crc:
+//read control
+	fetch 1,mem_24g_rxbuf+1
+	rshift3 pdata,pdata
+	store 1,mem_24g_rxdata_length
+//get crc
+	increase 1,pdata
+	arg mem_24g_rxbuf+1,contr
+	iadd contr,contr
+	ifetch 3,contr
+	store 3,mem_24g_sta_crc
+	rtn
+
+p_rssi_signal:
+	fetcht 1,mem_rssi_signal_index
+	setarg mem_rssi_signal_buf
+	iadd temp,contw
+	copy rega,pdata
+	istore 1,contw
+	increase 1,temp
+	and_into RSSI_BUF_LEN_SIGNAL,temp
+	storet 1,mem_rssi_signal_index
+	rtn
+
+//p_rssi_noise:
+//	call save_rssi
+//	rtn blank
+//	fetcht 1,mem_rssi_noise_index
+//	arg mem_rssi_noise_buf,rega
+//	call p_rssi_store
+//	storet 1,mem_rssi_noise_index
+//	rtn
+//	
+//p_rssi_store:
+//	copy rega,pdata
+//	iadd temp,contw
+//	fetch 1,mem_rssi
+//	istore 1,contw
+//	increase 1,temp
+//	and_into RSSI_BUF_LEN_SIGNAL,temp
+//	rtn
+
+p_g24_update_addr_and_synccrc8:	
+	store 4,mem_24g_addr
+
+//output: 1BYTE crc8
+p_g24_syncword_crc8:
+	arg 0,rega
+	arg 4,loopcnt
+	arg mem_24g_addr,contr
+p_g24_syncword_crc8_loop:
+	ifetch 1,contr
+	iadd rega,rega
+	loop p_g24_syncword_crc8_loop
+	copy rega,pdata
+	store 2,mem_24g_syncword
+	fetch 1,mem_24g_syncword
+	fetcht 1,mem_24g_syncword+1
+	iadd temp,pdata
+	store 1,mem_24g_syncword_crc8
+	rtn
+
+
+p_g24_transmit_prep:
+// total length
+	fetch 1,mem_24g_datalen
+	increase 2,pdata
+	store 1,mem_24g_txlen
+// data type
+	fetch 1,mem_24g_data_type
+	store 1,mem_24g_txpayload
+//prepare 5bit payload length, 2bit PID, 1bit NO_ACK
+	fetch 1,mem_24g_datalen
+	lshift3 pdata,pdata
+	fetcht 1,mem_24g_pid
+	and temp,0x03,temp
+	lshift temp,temp
+	ior temp,pdata
+	fetcht 1,mem_24g_no_ack
+	iadd temp,pdata
+	istore 1,contw
+//prepare payload data
+	fetch 1,mem_24g_pairing_sm
+	bne STATE_24G_PAIRING_SUCCESS,p_g24_transmit_prep_pair
+	fetch 1,mem_24g_data_type
+	istore 1,contw
+p_g24_transmit_prep_pair:	
+	fetch 1,mem_24g_datalen
+	iforce loopcnt
+	fetch 1,mem_24g_data_type
+	beq 1,p_g24_transmit_prep_mouse
+	arg mem_24g_txbuf,contr
+	call memcpy
+// type == 2 && mem_24g_txbuf[0] == 0x03  : multi	
+// type == 1 && mem_24g_txbuf[0] == 0x03  : mouse
+// if transmit fail,next package will send mouse data
+	fetch 1,mem_24g_txbuf	
+	beq 0x03,p_g24_multi_key_setup
+	rtn
+p_g24_multi_key_setup:
+	jam 0x02,mem_24g_txbuf
+	rtn
+
+
+p_g24_transmit_prep_mouse:
+	arg mem_24g_txbuf+1,contr
+	branch memcpy
+
+p_g24_ch:
+	fetcht 1,mem_24g_current_ch_number
+	call p_g24_ch_calc
+	increase 1,temp
+	and_into 3,temp //map size =4
+	storet 1,mem_24g_current_ch_number
+	rtn
+
+p_g24_ch_calc:
+	fetch 1,mem_24g_addr	
+	and_into 0x03,pdata
+	mul32 pdata,4,rega			//24addr low bit0 bit1 ,00-map1,01-map2,10-map3,11-map4
+	setarg mem_24g_ch_map1
+	iadd rega,pdata
+	iadd temp,contr
+	ifetch 1,contr
+	store 1,mem_24g_ch
+	rtn
+
+p_g24_prep:
+	disable enable_crc
+	disable enable_white
+	setarg 0x555555
+	iforce crc24_init
+	fetch 1,mem_24g_ch
+	reverse pdata,temp
+	set1 1,temp
+	rshift temp,white_init
+	rtn
+
+p_g24_receive_rxon:
+	call p_g24_prep
+	enable decode_fec0	
+	enable is_rx
+	disable is_tx
+	enable swfine
+	fetch 2,mem_24g_rx_window
+	iforce stop_watch
+	correlate null,timeout
+	nbranch p_g24_sync_timeout,sync
+	disable decode_fec0
+	enable decode_fec1
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_24g_get_syncword_crc8
+	fetcht 1,mem_24g_syncword_crc8
+	isub temp,null
+	nbranch p_g24_end_of_packet,zero
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_24g_rxbuf	//device id
+//	fetch 1,mem_24g_mode
+//	sub pdata,rx_24g,null
+//	branch p_g24_receive_skip,zero
+	fetch 1,mem_24g_rxbuf
+	fetcht 1,mem_24g_data_type
+	icompare bits_data,temp
+	nbranch p_g24_end_of_packet,true
+p_g24_receive_skip:
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	rshift3 pdata,pdata
+	and pdata,0x1f,loopcnt	//max payload: 32bytes
+	branch p_g24rx_nopayload,zero
+p_g24rx_loop:
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop p_g24rx_loop
+p_g24rx_nopayload:
+	//receive rssi hex
+	copy contw,rega
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_rssi_hex_received
+	copy rega,contw
+	parse demod,bucket,24
+	enable swfine
+	arg param_sifs,stop_watch	
+	rshift32 pdata,pdata
+	rshift16 pdata,pdata
+	istore 3,contw
+	disable decode_fec1
+	branch p_g24_end_of_packet,crc_failed
+	enable user3
+	fetch 1,mem_last_freq
+	add pdata,0,rega
+	call rf_write_freq
+	disable decode_fec0
+	call set_sync_on
+	fetch 1,mem_rssi_hex_received
+	copy pdata,rega
+	call p_rssi_signal
+	rtn
+
+p_g24_sync_timeout:
+//	call p_rssi_noise
+//	branch p_g24_end_of_packet
+p_g24_end_of_packet:
+	disable encode_fec1
+	disable decode_fec1
+	branch end_of_packet
+
+p_g24_set_freq_tx:
+	call set_sync_on
+	fetcht 1,mem_24g_ch
+	branch set_freq_tx
+
+p_g24_transmit:
+	call le_enable
+	fetch 4,mem_24g_addr
+	iforce access
+	call p_g24_prep
+	call p_g24_set_freq_tx
+	set1 TXGFSK,radio_ctrl
+	enable encode_fec0
+	enable is_tx
+	disable is_rx
+	rshift16 access,pdata
+	rshift8 pdata,pdata
+	rshift4 pdata,pdata
+	inject mod,40
+	disable encode_fec0
+	enable encode_fec1
+	enable enable_white
+	enable enable_crc
+	fetch 1,mem_24g_syncword_crc8
+	inject mod,8
+	fetch 1,mem_24g_txlen
+	iforce loopcnt
+	arg mem_24g_txpayload,contr
+p_g24tr_loop:
+	ifetch 1,contr
+	inject mod,8 //发送一个字节的数据
+	loop p_g24tr_loop
+	enable enable_parity
+	inject mod,24	//crc
+	disable enable_parity
+	until null,tx_clear
+	nop 100
+	disable encode_fec0
+	disable encode_fec1
+	rtn
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble.prog	(working copy)
@@ -0,0 +1,118 @@
+
+
+p_keyboard_ble_init:
+	setarg 0x25
+ 	store 2,mem_le_pairing_handle
+
+ 	call le_set_config_fixed_ltk
+	call le_set_fixed_ltk
+	call le_set_justwork
+	branch le_set_config_read_authentication
+
+
+/*
+	ble 层bugfix
+*/
+
+/*
+	广播层收发等待100us左右
+*/
+p_le_transmit_receive_sifs:
+	call le_transmit
+	call set_sync_on
+	fetcht 1,mem_last_freq
+	call set_freq_rx
+	nop 1500
+	call rf_rx_enable
+	enable swfine
+	arg 5500,timeup 
+	branch le_receive_rxon
+
+
+p_le_receive_skip:
+	call save_rssi
+	enable enable_white
+	enable enable_crc
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	store 1,mem_le_rxbuf
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	copy pdata,loopcnt
+	branch lerx_nopayload,blank
+	branch lerx_loop
+
+
+/*
+	l2cap 组包的问题
+*/
+p_le_parse:
+	rtnmark1 mark_old_packet
+	call le_fifo_check_full
+	nrtn blank
+	fetch 1,mem_le_rxbuf
+	and pdata,0x3,pdata
+	store 1,mem_le_packet_llid
+	ifetch 1,contr
+	store 1,mem_le_packet_size
+	rtn blank							//empty rtn
+	copy contr,pdata
+	store 2,mem_le_payload_ptr
+	fetch 1,mem_le_packet_llid
+	beq LLID_LE_LL,le_parse_ll
+	call le_check_l2cap_complete
+	arg wake_lock_ble_rx_patch,queue
+	nbranch lpm_get_wake_lock,user
+	call lpm_put_wake_lock
+	branch le_parse_l2cap + 3
+
+
+p_le_parse_l2cap:
+	ifetch 2,contr
+	beq LE_L2CAP_CID_ATT,p_le_parse_att
+	beq LE_L2CAP_CID_SMP,le_parse_smp
+	beq LE_L2CAP_CID_SIGNAL,le_parse_signaling
+	rtn
+
+
+p_le_adv_not_match:
+//	bpatchx patch24_5,mem_patch24
+	random pdata 
+	arg 0xf,temp
+	iand temp,pdata
+	add pdata,25,pdata
+	call delay
+	fetch 1,mem_le_adv_channel_map_temp
+	fetcht 1,mem_le_adv_channel_map
+	isub temp,null
+	nbranch le_adv_loop,zero
+	arg le_adv_interval_timer,queue
+	fetch 2,mem_le_adv_interval
+	branch timer_init
+	
+/*
+	解密错误不解析的问题
+*/
+p_le_acknowledge:
+	call le_supervision_flush
+	call le_check_wak
+	fetch 1,mem_le_rxbuf
+	isolate1 md,pdata
+	setflag true,mark_ble_rx_md,mark
+	rshift pdata,pdata
+	ixor temp,pdata
+	isolate1 nesn,pdata
+	setflag true,mark_old_packet,mark	/* retransmit */
+	rtnmark1 mark_old_packet
+	fetch 1,mem_le_rxbuf+1			
+	branch le_ack_unenc,blank		/* empty packet, no decryption */
+	fetch 1,mem_le_state
+	bbit0 lestate_encryption,le_ack_unenc
+	call load_sk
+	call le_decrypt
+	nsetflag blank,mark_old_packet,mark
+	nrtn blank
+	branch le_ack_unenc
+
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_event_deal.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_event_deal.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_event_deal.prog	(working copy)
@@ -0,0 +1,22 @@
+
+/*
+ble keyboard event deal
+*/
+
+p_module_hci_event_start_enc:
+	jam HCI_EVENT_BLE_HID_CONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+p_module_hci_event_enc_info:
+	jam HCI_EVENT_BLE_ENC_INFO,mem_module_uart_opcode
+	setarg 28
+	call module_hci_prepare_tx
+	fetch 6,mem_le_lap
+	istore 6,contwu
+	fetch 6,mem_le_plap
+	istore 6,contwu
+	arg mem_le_ltk,contr
+	arg 16,loopcnt
+	call uart_copy_tx_bytes
+	branch uartd_send
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_att.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_att.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_att.prog	(working copy)
@@ -0,0 +1,66 @@
+
+
+p_le_parse_att:
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request
+	beq ATTOP_READ_REQUEST,p_le_parse_att_read_request
+	branch le_parse_att+2
+
+	
+p_le_parse_att_write_request:
+	copy contr,rega
+	fetch 2,mem_le_l2cap_size
+	add pdata,-3,regb
+	call le_writeatt_cb
+	fetch 1,mem_le_configuration
+	bbit0 BIT_BLE_WRITE_AUTH,le_send_att_write_response
+	
+	fetcht 2,mem_le_att_handle
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_write_response,zero
+	call p_le_check_encrypt_state
+	nbranch le_send_att_write_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+
+p_le_parse_att_read_request:
+	fetcht 2,mem_le_att_handle
+	fetch 1,mem_le_configuration
+	bbit1 BIT_BLE_READ_AUTH,p_le_send_att_read_response_check_auth
+	branch le_send_att_read_response
+
+p_le_send_att_read_response_check_auth:
+	fetch 2,mem_le_pairing_handle
+	isub temp,null
+	nbranch le_send_att_read_response,zero
+//le_send_att_read_response_error_insufficient_auth:
+	call p_le_check_encrypt_state
+	nbranch le_send_att_read_response,user
+	jam ATT_ERR_INSUFFICIENT_AUTHENTICATION,mem_le_err_code
+	branch le_send_att_error_response
+
+p_module_hci_cmd_receive_le_data:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BLE_CONNECTED,module_hci_event_receive_invalid_cmd
+	call p_module_check_ble_encrypt_state
+	branch module_hci_cmd_receive_le_data+3
+
+
+p_module_check_ble_encrypt_state:
+	fetch 1,mem_module_flag
+	bbit1 MODULE_FLAG_BLE_DATA_ENCRYPT,p_le_check_encrypt_state
+	branch disable_user
+
+p_le_check_encrypt_state:
+	call disable_user
+	fetch 1,mem_le_pairing_mode
+	rtneq LE_PAIRING_MODE_NONE
+	fetch 1,mem_le_state
+	rtnbit1 lestate_encryption
+	branch enable_user
+
+	
+
Index: /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_signalling.prog	(added)
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_signalling.prog	(revision 0)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_signalling.prog	(revision 0)
Index: /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_smp.prog	(added)
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_smp.prog	(revision 0)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_l2cap_smp.prog	(revision 0)
Index: /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_ll.prog	(added)
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_ll.prog	(revision 0)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_ble_spec_code/patch_ble_ll.prog	(revision 0)
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_event_deal.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_event_deal.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_event_deal.prog	(working copy)
@@ -0,0 +1,163 @@
+
+
+/*
+	经典蓝牙事件处理函数
+*/
+//清除timer
+classic_shutter_process_baseband_connect:
+	jam 0,mem_classic_shutter_hid_disconn_count
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	branch app_bt_stop_discovery
+
+classic_shutter_process_baseband_disconnect:
+	jam 0,mem_ns_wake_up_flag
+	call module_disconn_start
+	call classic_shutter_disconnect_clear_flag
+	fetch 2,mem_ui_state_map
+//	rtnbit0 UI_STATE_BT_HID_CONNECT
+	set0 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+classic_shutter_disconnect_clear_flag:
+	jam APP_HANDSHAKE_NULL,mem_app_handshake_flag
+	jam 0,mem_hid_handshake_timer_count
+	jam 0,mem_unsniff2sniff_timer_count
+	jam 0,mem_classic_shutter_cable_unplug_conut
+	jam 0,mem_classic_shutter_hid_disconn_count
+	rtn
+
+classic_shutter_process_reconnect_failed:
+	call module_disconn_start
+	jam HCI_EVENT_BT_RECONNECT_FAIL,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x00
+	istore 1,contwu
+	call uartd_send
+	branch app_disconn_reason_clear
+
+classic_shutter_process_setup_complete:
+	rtn
+
+classic_shutter_process_hid_connect:
+	setarg HID_HANDSHAKE_TIMEOUT
+	store 1,mem_hid_handshake_timer_count
+	rtn
+
+classic_shutter_process_hid_disconnect:
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	call module_hci_event_enter_standby_mode_len0
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	setarg FLAG_SHUTTER_HID_DISCONN_TIMEOUT
+	store 1,mem_classic_shutter_hid_disconn_count
+	rtn
+
+classic_shutter_process_hid_handshake:
+	fetch 1,mem_app_handshake_flag
+	rtneq APP_HANDSHAKE_DONE
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONNECT,pdata
+	store 2,mem_ui_state_map
+	jam HCI_EVENT_BT_HID_CONNECT,mem_module_uart_opcode
+	call module_hci_event_enter_standby_mode_len0
+	jam APP_HANDSHAKE_DONE,mem_app_handshake_flag
+//	call app_lpm_mult_enable
+	call app_bt_stop_discovery
+	branch app_bt_enter_sniff
+
+classic_shutter_process_reconnect_page_timeout:
+	branch classic_shutter_process_reconnect_failed
+
+classic_shutter_process_virtual_cable_unplug:
+	setarg FLAG_SHUTTER_CABLE_UNPLUG_TIMEOUT
+	store 1,mem_classic_shutter_cable_unplug_conut
+	rtn
+
+classic_shutter_process_remote_unsniff:
+	branch app_start_auto_sniff
+
+classic_shutter_process_store_reconnect_information:
+	rtn
+
+classic_shutter_process_linkkey_generate:
+	branch p_module_hci_event_bt_enc_info
+p_module_hci_event_bt_enc_info:
+	jam HCI_EVENT_BT_ENC_INFO,mem_module_uart_opcode
+	setarg 28
+	call module_hci_prepare_tx
+	fetch 6,mem_lap
+	istore 6,contwu
+	fetch 6,mem_plap
+	istore 6,contwu
+	arg mem_link_key,contr
+	arg 16,loopcnt
+	call uart_copy_tx_bytes
+	branch uartd_send
+
+
+/*
+	bt keyboard timer
+*/
+classic_shutter_check_unplug_timer:
+	arg mem_classic_shutter_cable_unplug_conut,regc
+	arg classic_shutter_unplug_timeout,regb
+	branch timer_single_step
+	
+classic_shutter_unplug_timeout:
+	fetch 1,mem_CONTROL_tasks
+	set1  L2CAP_DISCONNECT_INTERRUPT, pdata
+	set1  L2CAP_DISCONNECT_CONTROL, pdata
+	store 1,mem_CONTROL_tasks	
+	rtn
+
+classic_shutter_hid_handshake_timer:
+	arg mem_hid_handshake_timer_count,regc
+	arg classic_shutter_process_hid_handshake,regb
+	branch timer_single_step
+
+classic_shutter_hid_disconn_timer:
+	arg mem_classic_shutter_hid_disconn_count,regc
+	arg app_bt_disconnect,regb
+	branch timer_single_step
+
+
+/*
+	bt keyboard send hid data
+*/
+
+
+bt_keyboard_send_hid_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nrtn blank
+	fetch 1,mem_module_uart_len
+	add pdata,1,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	setarg 0xa1
+	istore 1,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+p_moudle_hci_cmd_creat_bt_reconnect:
+	ifetch 6,contru
+	store 6,mem_hci_plap
+	ifetch 2,contru
+	store 2,mem_page_to
+	arg mem_link_key,contw
+	arg 16,loopcnt
+	call uart_copy_rx_bytes
+	call check_link_key_load
+	call app_bt_stop_discovery
+	call app_bt_start_reconnect
+	branch module_hci_event_receive_valid_cmd
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_hid.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_hid.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/keyboard_bt_spec_code/patch_bt_hid.prog	(working copy)
@@ -0,0 +1,61 @@
+
+/*
+	bt hid patch bugfix
+*/
+p_hid_rx_process:
+	fetch 2,mem_l2cap_payload_ptr
+	copy pdata,contr
+	ifetch 1,contr
+	and pdata,0x0f,temp
+	rshift4 pdata,pdata //hidtype
+	beq hid_type_set_idle,hid_rx_process_handshake
+	beq hid_type_set_protocol,hid_rx_process_handshake
+	beq hid_type_data,p_hid_rx_process_data
+	beq HID_TYPE_SET_REPORT,p_hid_rx_process_set_report
+	beq HID_TYPE_CONTROL,p_hid_rx_process_hid_control
+	beq HID_TYPE_GET_REPORT,hid_rx_process_handshake
+	rtn
+
+p_hid_rx_process_data:
+	
+	branch p_hid_rx_process_out_data
+	ifetch 2,contr
+	store 2,mem_pdatatemp
+	beq HID_REPORT_ID_KB,p_hid_rx_process_data_hid_kb	
+	rtn
+p_hid_rx_process_out_data:
+
+	jam HCI_EVENT_RECEIVE_BT_HID_DATA,mem_module_uart_opcode
+	fetch 2,mem_l2cap_rx_pkt_length
+	pincrease -1
+	icopy loopcnt
+	
+	call module_hci_prepare_tx
+	fetch 2,mem_l2cap_payload_ptr
+	
+	icopy contr
+	call uart_copy_tx_bytes_fast
+	branch uartd_send
+
+	
+p_hid_rx_process_data_hid_kb:
+	jam HCI_EVENT_RECEIVE_BT_HID_DATA,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx	
+	fetch 2,mem_pdatatemp
+	istore 2,contwu
+	branch uartd_send
+
+p_hid_rx_process_set_report:
+	call p_hid_rx_process_data
+	branch hid_rx_process_set_report+1
+
+p_hid_rx_process_hid_control:
+	copy temp,pdata
+	beq HID_CONTROL_P_VIRTUALCABLEUNPLUG,hid_rx_process_virtual_cable_unplug
+	jam 1,mem_suspend_flag
+	beq HID_CONTROL_P_SUSPEND,hid_rx_process_handshake
+	jam 0,mem_suspend_flag
+	beq HID_CONTROL_P_EXITSUSPEND,hid_rx_process_handshake
+	rtn
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/main_patch.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/main_patch.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/main_patch.prog	(working copy)
@@ -0,0 +1,1474 @@
+
+define TX_POWER_MAX
+
+/******************************************/
+/**************   Start   *****************/
+/******************************************/
+
+p_start:
+	bbit1 8,pf_patch_ext
+	//LPM exen bugfix
+	beq patch00_1,p_soft_reset
+//	beq patch00_3,p_main_loop
+
+	beq patch00_5,p_connection_incontext
+	beq patch05_6,p_context_search
+	beq patch06_4,p_send_eir
+	
+	beq patch0b_7,p_process_dmh_data_end1
+	beq patch0c_0,p_process_dmh_data_end
+	beq patch0b_5,p_process_dmh_data_l2cap_start_pkt
+	beq patch0b_6,p_process_dmh_data_l2cap_continue_pkt
+	beq patch0e_0,p_parse_l2cap
+	
+	beq patch07_5,p_slave_loop
+	beq patch10_5,p_shutdown_radio
+	beq patch11_1,p_set_freq_tx
+	//LMP bugfix
+	beq patch12_4,p_ahead_window
+	beq patch14_2,p_init_param
+	//LMP bugfix	
+	beq patch14_3,p_lpm_adjust_clk
+	beq patch15_1,p_lpm_dispatch_next
+	beq patch15_4,p_lpm_unconn_nossp
+	
+//	beq patch16_1,p_lpm_check_wake_lock
+	beq patch17_0,p_module_init
+	beq patch17_3,p_module_hci_cmd_control
+	beq patch17_4,p_module_hci_cmd_transmit_le_notify
+	beq patch17_6,p_hid_rx_process
+	beq patch19_0,p_l2cap_proc_signal_connect_req
+	beq patch1b_3,p_l2cap_malloc
+	branch assert
+	
+pf_patch_ext:
+	beq patch20_3,p_le_receive_skip
+	beq patch20_5,p_le_transmit_receive_sifs
+	beq patch20_6,p_le_transmit
+	beq patch22_3,p_le_acknowledge
+	beq patch23_7,p_le_parse
+	beq patch24_1,p_le_parse_l2cap
+	beq patch24_5,p_le_adv_not_match
+	beq patch26_0,p_le_modified_name
+	beq patch27_4,p_parse_lmp_accepted
+	beq patch27_2,p_parse_lmp
+	beq patch27_5,p_parse_lmp_not_accepted
+	beq patch27_7,p_send_lmp_accepted
+	beq patch27_6,p_send_lmp
+	beq patch28_1,p_ssp_disable
+	beq patch33_1,p_sp_initialize_256
+	beq patch34_3,p_check_51cmd_once_continue
+	branch assert
+	
+
+p_send_eir:
+//	bpatch patch06_4,mem_patch06
+	fetch 1,mem_state_map
+	set0 smap_encryption,pdata
+	store 1,mem_state_map
+	branch send_eir+1
+	
+p_context_search:
+	arg mem_context_new,rega
+	arg context_num_new,loopcnt
+	branch context_search_loop
+
+p_connection_incontext:
+//	bpatch patch00_5,mem_patch00
+	call context_search_insniff
+	nbranch p_connection_nosniff,zero
+	call context_load
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	bbit1 mode_le,le_conn_dispatch
+	bbit1 mode_master, master_dispatch
+	branch slave_dispatch
+p_connection_nosniff:
+	call p_context_get_next
+	branch connection_nosniff+1
+
+
+	
+p_context_get_next:
+	arg context_num_new,loopcnt
+	fetcht 1,mem_current_context
+p_context_get_next_loop:
+	increase 1,temp
+	compare context_num_new,temp,0xff
+	nbranch p_context_get_next_cont,true
+	arg 0,temp
+p_context_get_next_cont:
+	storet 1,mem_current_context
+	mul32 temp,context_size,pdata
+	arg mem_context_new,rega
+	iadd rega,rega
+	ifetch 1,rega
+	bbit1 state_insniff,p_context_get_next_sniff
+	rtnbit1 state_inconn
+	rtnbit1 state_inpage
+p_context_get_next_sniff:
+	loop p_context_get_next_loop
+	rtn	
+
+
+p_parse_l2cap:
+	set0 mark_rxbuf_inuse,mark 
+p_parse_l2cap_cont:
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtn blank
+	isolate1 L2CAP_INUSE_BUFF1,pdata
+	arg mem_l2cap_rxbuff1,contr
+	call process_rx_l2cap_pkt,true
+//	bpatch patch0e_1,mem_patch0e
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff1
+	
+	jam L2CAP_RX_CLEAR,mem_l2cap_rx_done
+	fetch 1,mem_l2cap_rxbuff_inuse
+	rtnbit0 L2CAP_INUSE_BUFF2
+	arg mem_l2cap_rxbuff2_new,contr	
+	call process_rx_l2cap_pkt
+	fetch 1,mem_l2cap_rx_done
+	beq L2CAP_RX_DONE,parse_l2cap_release_buff2
+	rtn
+
+
+p_process_dmh_data_l2cap_start_pkt:
+//	bpatch patch0b_5,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x1e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_inuse
+	bbit1 L2CAP_INUSE_BUFF2,end_of_packet
+	bbit0 L2CAP_INUSE_BUFF1,process_dmh_data_into_buff1
+	bbit0 L2CAP_INUSE_BUFF2,p_process_dmh_data_into_buff2
+	branch end_of_packet
+
+p_process_dmh_data_into_buff2:
+	jam 2,mem_l2cap_rxbuff_new //new data in buff 2
+	fetch 2,mem_l2cap_rxbuff2_len
+	bne 0,end_of_packet
+	arg mem_l2cap_rxbuff2_new,contw
+	branch process_dmh_data
+
+p_process_dmh_data_l2cap_continue_pkt:
+//	bpatch patch0b_6,mem_patch0b
+	bmark1 mark_old_packet,ack_payload
+	fetch 2,mem_len
+	arg 0x1e0,temp //l2cap buffer size
+	isub temp,null
+	branch error_payload,positive
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,process_dmh_data_l2cap_continue_pkt1
+	beq 2,p_process_dmh_data_l2cap_continue_pkt2
+	branch end_of_packet
+
+p_process_dmh_data_l2cap_continue_pkt2:
+	arg mem_l2cap_rxbuff2_new,contw
+	branch process_dmh_data_l2cap_continue_pkt2+1
+	
+p_process_dmh_data_end1:	
+//	bpatch patch0b_7,mem_patch0b
+	parse demod,bucket,16  /* cycle through the crc */
+	branch error_payload_crc,crc_failed
+	fetch 1,mem_l2cap_flow_ctrl_flag
+	beq L2CAP_FLOW_CTRL_ENABLE,error_payload_crc
+	branch process_dmh_data_end+5
+ 
+p_process_dmh_data_end:
+//	bpatch patch0c_0,mem_patch0c
+	fetch 1,mem_l2cap_rxbuff_new
+	beq 1,p_process_l2cap_pass_crc_buff1
+	beq 2,p_process_l2cap_pass_crc_buff2
+	branch assert
+	
+p_process_l2cap_pass_crc_buff1:
+	fetch 2,mem_l2cap_rxbuff1_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff1_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff1// l2cap payload length
+	increase 4,temp
+	isub temp,null
+	call l2cap_buff1_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+
+
+	 
+p_process_l2cap_pass_crc_buff2:
+	fetch 2,mem_l2cap_rxbuff2_len
+	fetcht 2,mem_len
+	iadd temp,pdata
+	store 2,mem_l2cap_rxbuff2_len
+	beq 0,assert
+	fetcht 2,mem_l2cap_rxbuff2_new // l2cap payload length 
+	add temp,4,temp
+	isub temp,null
+	call l2cap_buff2_inuse,zero //l2cap pkts not ended
+	branch process_dmh_cont
+
+
+p_l2cap_malloc:
+//	bpatch patch1b_3,mem_patch1b
+	arg 0,regb
+	call l2cap_malloc_is_fifo_full+1
+//	branch l2cap_malloc+3
+	nbranch assert,blank//assert when fifo full
+	call l2cap_malloc_get_full_map
+	arg mem_tx_buff0_new,regB//pbuff = buff0;
+	arg 0,queue // i = 0;
+	branch l2cap_malloc_loop
+
+
+
+p_le_modified_name:
+	call le_modified_name_att_list
+	branch p_le_modified_name_adv
+
+p_le_modified_name_adv:
+	arg mem_le_scan_data_len+32,regc
+	arg mem_le_scan_data,rega
+	branch le_modified_name_adv_and_scan
+	
+p_l2cap_proc_signal_connect_req:
+	copy temp,pdata
+	beq PSM_SDP,l2cap_proc_signal_connect_req_sdp
+	beq PSM_RFCOMM,l2cap_proc_signal_connect_req_rfcomm
+	beq PSM_HID_control,p_l2cap_proc_signal_connect_req_hid_ctrl
+	beq PSM_HID_interrupt,p_l2cap_proc_signal_connect_req_hid_int
+	call l2cap_reject_command
+	branch l2cap_proc_signal_connect_req_rtn	
+
+p_l2cap_proc_signal_connect_req_hid_ctrl:
+
+	call save_cont_pointers
+	arg L2CAP_HID_Control_channel,temp
+	fetch 2,mem_hid_ctrl_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_ctrl_remote_cid
+	fetch 1,mem_hid_control_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_control_state
+	call send_connection_res	
+	jam BT_EVT_HID_INT_CONNECT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+p_l2cap_proc_signal_connect_req_hid_int:
+	call save_cont_pointers
+	deposit clke
+	arg L2CAP_HID_Interrupt_channel,temp
+	fetch 2,mem_hid_int_remote_cid
+	nbranch already_connected,blank
+	copy timeup,pdata
+	store 2,mem_hid_int_remote_cid
+	fetch 1,mem_hid_interrupt_state
+	set1 L2CAP_CHANNEL_STATE_CONN_REQ,pdata
+	set1 L2CAP_CHANNEL_STATE_CONN_RES,pdata
+	store 1,mem_hid_interrupt_state
+	call send_connection_res	
+	jam BT_EVT_HID_INT_CONNECT,mem_fifo_temp
+	branch ui_ipc_send_event
+	
+p_module_init:
+	setarg p_module_process_bb_event
+	store 2,mem_cb_bb_event_process
+
+	setarg p_module_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	setarg p_module_process_idle
+	store 2,mem_cb_idle_process
+
+	setarg p_module_le_receive_data
+	store 2,mem_cb_att_write
+
+	setarg p_module_lpm_lock
+	store 2,mem_cb_check_wakelock
+
+	setarg p_module_bt_conn_process
+	store 2,mem_cb_bt_process
+
+	call p_keyboard_ble_init
+
+	call module_lpm_uart_init
+	call module_gpio_init
+	call check_module_disabled
+	//call p_check_otp_shaomaqiang_app
+	branch module_hci_event_enter_standby_mode
+
+	
+p_module_process_idle:
+	call p_m_private_dispatch
+	call module_control_air_flow
+	call p_module_process_idle2
+p_module_process_idle2:
+	call l2cap_malloc_is_fifo_full
+	nrtn blank
+	branch p_module_process
+	
+p_module_process:
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	branch module_process_with_credit,zero
+	call uartd_prepare_rx
+//	call ice_break
+	ifetch 1,contru
+	bne 0x01,module_hci_in_excp
+	ifetch 1,contru
+	beq HCI_CMD_RESET_SDP_SERVICE,p_module_process_sdp
+	store 1,mem_module_uart_opcode
+	ifetcht 1,contru
+	copy contru,rega
+	storet 1,mem_module_uart_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch module_hci_dicard_packet //discard this packet
+
+p_module_process_sdp:
+	store 1,mem_module_uart_opcode
+	ifetcht 2,contru
+	copy contru,rega
+	storet 2,mem_module_uart_len_new
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	call module_hci_cmd_control
+	fetch 1,mem_module_temp_nl_discard_packet
+	rtneq HCI_NOT_DISCARD_PACKET
+	branch p_module_hci_dicard_packet //discard this packet	
+
+p_module_hci_dicard_packet:
+	call uartd_prepare_rx
+	increase 2,contru
+	ifetch 2,contru
+	iadd contru,contru
+	branch module_hci_dicard_bytes
+	
+	
+p_module_process_bb_event:
+	copy regc,pdata
+/***************classic shutter event****************/
+	beq BT_EVT_BB_CONNECTED,p_classic_shutter_process_baseband_connect
+	beq BT_EVT_BB_DISCONNECTED,p_evt_bb_disconnected
+	beq BT_EVT_RECONN_FAILED,p_evt_page_timeout
+	beq BT_EVT_SETUP_COMPLETE,classic_shutter_process_setup_complete
+	beq BT_EVT_HID_CONNECTED,classic_shutter_process_hid_connect
+	beq BT_EVT_HID_DISCONNECTED,classic_shutter_process_hid_disconnect
+	beq BT_EVT_HID_HANDSHAKE,classic_shutter_process_hid_handshake
+	beq BT_EVT_RECONN_PAGE_TIMEOUT,p_evt_page_timeout
+	beq BT_EVT_VIRTUAL_CABLE_UNPLUG,classic_shutter_process_virtual_cable_unplug
+	beq BT_EVT_REMOTE_UNSNIFF,classic_shutter_process_remote_unsniff
+//	beq BT_EVT_STORE_NVRAM,classic_shutter_process_store_reconnect_information
+	beq BT_EVT_LINKKEY_GENERATE,classic_shutter_process_linkkey_generate
+/***************classic shutter event****************/
+
+/***************ble shutter event****************/
+	beq BT_EVT_LE_START_ENC,p_module_hci_event_start_enc
+	beq BT_EVT_LE_ENC_INFO,p_module_hci_event_enc_info
+
+/***************24g event***********************/
+//	beq BT_EVT_24G_PAIRING_COMPLETE,p_module_hci_event_24g_pairing_complete
+//	beq BT_EVT_24G_ATTEMPT_FAIL,p_module_hci_event_24g_attempt_fail
+//	beq BT_EVT_24G_ATTEMPT_SUCCESS,p_module_hci_event_24g_attempt_success
+
+	//
+	beq BT_EVT_ENTER_SNIFF,p_module_process_enter_sniff
+
+	beq BT_EVT_SNIFF_ACCEPT,p_module_process_sniff_report
+	beq BT_EVT_SNIFF_REPORT,p_module_process_sniff_report
+	beq BT_EVT_HID_INT_CONNECT,p_module_process_hid_int_connect
+	beq BT_EVT_LE_CONNECTED,module_process_le_conn+1
+	beq BT_EVT_LE_DISCONNECTED,p_evt_le_disconnected
+	branch module_process_bb_event + 1
+
+p_classic_shutter_process_baseband_connect:
+	jam 0,mem_classic_shutter_hid_disconn_count
+	jam 0,mem_classic_shutter_cable_unplug_conut	
+	jam HCI_EVNET_BB_CONN,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x00
+	istore 1,contwu
+	branch uartd_send
+	
+
+p_evt_le_disconnected:
+	call le_clr_config_more_data
+	call app_ble_start_adv
+	branch module_hci_event_le_disconnect
+
+p_evt_bb_disconnected:
+	jam 0,mem_ns_wake_up_flag
+	call app_bt_start_discovery
+	branch classic_shutter_process_baseband_disconnect+2
+
+p_evt_page_timeout:
+//	call app_bt_start_discovery
+	branch classic_shutter_process_reconnect_failed+1
+	
+p_module_process_sniff_report:
+	setarg 0x02
+	jam HCI_EVENT_HID_SNIFF_REPORT,mem_module_uart_opcode
+	call module_hci_prepare_tx
+	fetch 2,mem_tsniff
+	rshift pdata,pdata
+	
+	istore 2,contwu
+	branch uartd_send	
+
+	
+p_module_process_hid_int_connect:
+	fetch 2,mem_ui_state_map
+	set1 UI_STATE_BT_HID_CONN,pdata
+	store 2,mem_ui_state_map
+	setarg 0x02
+	jam HCI_EVENT_HID_INT_CONNECT,mem_module_uart_opcode
+	call module_hci_prepare_tx
+	fetcht 2,mem_hid_int_remote_cid
+	istoret 2,contwu
+	branch uartd_send
+
+p_module_process_enter_sniff:
+
+p_module_sniff_param_check:
+	call module_spp_clear_last_transmite_clock
+	fetch 2,mem_state+coffset_tsniff
+	rshift pdata,pdata
+	fetcht 2,mem_sniff_param_interval
+	isub temp,null
+//	nbranch module_sniff_param_check_unsniff,zero
+	branch app_lpm_mult_enable
+
+	
+p_module_sniff_param_check_unsniff:
+	fetch 1,mem_module_flag
+	rtnbit1 MOUDLE_TASK_UNSNIFF
+//	fethc 2,core_uart_rxitems    //*
+	fetch 2,IPC_M02BT_READ_PTR
+	fetcht 2,IPC_M02BT_WRITE_PTR
+	isub temp,null
+	ncall module_set_unsniff_task_flag,zero    //*加这两句话
+	branch app_bt_sniff_exit
+
+
+
+keyboard_start_bluetooth_discovery:
+	rtn
+
+
+p_module_bb_event_timer:
+/**************classic shutter timer**********************/
+	call p_m_wakeup_timer
+	call classic_shutter_check_unplug_timer
+	call classic_shutter_hid_handshake_timer
+	branch classic_shutter_hid_disconn_timer
+/************************************/
+
+p_module_le_receive_data:
+	call p_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
+	fetch 2,mem_le_att_handle	
+	branch module_le_receive_data_ok
+
+	
+p_module_lpm_lock:
+	branch module_lpm_lock
+
+p_module_bt_conn_process:
+	branch p_module_spp_enter_sniff
+
+p_module_spp_enter_sniff:
+	fetch 1,mem_btsniff
+	rtn blank
+	branch module_spp_enter_sniff+1
+
+p_module_hci_cmd_control:
+	fetch 1,mem_module_uart_opcode
+	beq HCI_CMD_BT_DISCONNECT,p_module_hci_cmd_bt_disconnect
+	beq HCI_CMD_SET_COD,p_module_hci_cmd_set_cod
+	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_SEND_HID_DATA,p_module_hci_cmd_send_hid_data
+	beq HCI_CMD_SEND_HID_CONTROL_DATA,p_module_hci_cmd_send_hid_control_data
+	beq HCI_CMD_LE_DATA_REQ,p_module_hci_cmd_receive_le_data
+
+	
+	beq HCI_CMD_SET_FEATURE,p_module_hci_cmd_reset_features
+	beq HCI_CMD_SET_SNIFF,p_module_set_bt_sniff
+	beq HCI_CMD_CREAT_BT_RECONNECT,p_moudle_hci_cmd_creat_bt_reconnect
+
+//	beq HCI_CMD_START_24G,p_module_hci_cmd_start_24g
+//	beq HCI_CMD_STOP_24G,p_module_hci_cmd_stop_24g
+//	beq HCI_CMD_PAIR_24G,p_module_hci_cmd_pair_24g
+//	beq HCI_CMD_DISCONNECTED_24G,p_module_hci_cmd_disconnected_24g
+//	beq HCI_CMD_SEND_24G_DATA,p_module_hci_cmd_send_24g_data
+
+	beq HCI_CMD_RESET_SDP_SERVICE,p_module_hci_cmd_set_sdp_service
+
+
+	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_SWITCH_WAKEUP,module_hci_cmd_switch_wakeup
+	branch module_hci_cmd_control + 2
+	
+p_module_set_bt_sniff:
+
+	ifetch 1,contru
+	store 1,mem_btsniff
+	branch module_hci_event_receive_valid_cmd,blank
+	ifetch 2,contru
+	store 2,mem_sniff_param_interval
+	branch module_hci_event_receive_valid_cmd
+	
+//function : modify feature----mem_features
+p_module_hci_cmd_reset_features:		
+	ifetch 8,contru
+	store 8,mem_features
+	branch module_hci_event_receive_valid_cmd
+
+
+
+module_hci_cmd_switch_wakeup:
+	ifetch 2,contru
+	arg 160,temp
+	idiv temp
+	call wait_div_end
+	quotient pdata
+	store 2,mem_m_wakeup_timer
+	
+	ifetch 6,contru 
+	store 6,mem_hci_plap
+
+	// 4 bytes wake data
+	ifetch 4,contru 
+	store 4,mem_m_wake_data
+	
+	ifetcht 4,contru
+	setarg -1
+	ixor temp,pdata
+	store 4,mem_m_access_code
+	
+	ifetch 4,contru
+	store 4,mem_m_access_code+4
+	
+	arg mem_link_key,contw
+	arg 16,loopcnt
+	call uart_copy_rx_bytes
+	// set conn status
+//	jam 1,mem_conn_status
+
+	jam 1,mem_m_process_enable
+
+	// Unit is 625us. 60*625 = 37.5ms
+	setarg 60
+	store 2,mem_m_wake_send_window
+
+	call p_m_send_wake_data_timer_init
+	branch module_hci_event_receive_valid_cmd
+	
+
+module_hci_cmd_delete_customize_service:
+	arg 0x000c,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
+
+
+
+	
+
+p_module_hci_cmd_set_sdp_service:
+	fetch 2,mem_module_uart_len_new
+	copy pdata,loopcnt
+	arg mem_module_uuid_list,contw
+	call uart_copy_rx_bytes
+	branch module_hci_event_receive_valid_cmd
+
+
+	
+
+
+p_module_hci_cmd_bt_disconnect:
+	fetch 2,mem_ui_state_map
+	bbit0 UI_STATE_BT_CONNECTED,module_hci_event_receive_invalid_cmd
+	call module_hci_event_receive_valid_cmd
+	call app_bt_disconnect
+	fetch 2,mem_ui_state_map
+	rtnbit0 UI_STATE_BT_HID_CONN
+	jam HCI_EVENT_BT_HID_DISCONNECT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+p_module_hci_cmd_set_cod:
+	fetch 1,mem_module_uart_len
+	bne 3,module_hci_event_receive_valid_cmd
+	ifetch 3,contru
+	store 3,mem_class
+	branch module_hci_event_receive_valid_cmd
+
+p_module_hci_cmd_set_pairing_mode:
+	copy rega,contru
+	ifetch 1,contru
+	beq PAIRING_PINCODE,module_hci_pairing_pincode_mode
+	beq PAIRING_JUSTWORK,module_hci_pairing_just_work_mode
+	beq PAIRING_PASSKEY,module_hci_pairing_passkey
+	beq PAIRING_CONFIRM,p_module_hci_pairing_numeric_comparison
+	branch module_hci_event_receive_invalid_cmd
+p_module_hci_pairing_numeric_comparison:
+	setarg 0x000001
+	branch module_hci_sspairing_mode
+
+
+p_module_hci_cmd_enter_sleep:
+	call module_hci_event_receive_valid_cmd
+	branch app_enter_hibernate
+
+
+p_module_hci_cmd_send_hid_data:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_HID_CONN,bt_keyboard_send_hid_int_data
+	branch module_hci_event_receive_invalid_cmd
+
+p_module_hci_cmd_not_discard:
+	jam HCI_NOT_DISCARD_PACKET,mem_module_temp_nl_discard_packet
+	rtn
+	
+bt_keyboard_send_hid_int_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nbranch p_module_hci_cmd_not_discard, blank
+	fetch 1,mem_module_uart_len
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_int_remote_cid
+	istore 2,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+	
+p_module_hci_cmd_send_hid_control_data:
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_HID_CONN,bt_keyboard_send_hid_control_data
+
+	branch module_hci_event_receive_invalid_cmd
+bt_keyboard_send_hid_control_data:
+	call l2cap_malloc_is_fifo_nearly_full
+	nbranch p_module_hci_cmd_not_discard, blank
+	fetch 1,mem_module_uart_len
+	copy pdata,rega
+	call hid_malloc_tx_buff
+	fetch 2,mem_hid_ctrl_remote_cid
+	istore 2,contw
+	fetch 1,mem_module_uart_len
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+
+
+
+	
+p_module_hci_cmd_transmit_le_notify:
+	add temp,-3,pdata		//sub handle and opcode
+	arg 200,temp	
+	call not_greater_than
+	fetcht 1,mem_module_hci_notify_len
+	call not_greater_than
+	copy pdata,rega
+	copy temp,pdata
+	isub rega,pdata
+	store 1,mem_module_hci_notify_len
+	fetcht 2,mem_module_hci_notify_handle
+	increase -1,temp
+	call le_att_get_handle_ptr2
+	branch p_module_hci_cmd_transmit_handle_error,blank
+	ifetcht 4,contr		//flag
+	setarg 0x01280302
+	isub temp,null
+	nbranch p_module_hci_cmd_transmit_handle_error,zero
+	ifetch 1,contr			//Characteristic
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,module_hci_cmd_transmit_le_notify + 13
+	branch p_module_hci_cmd_transmit_handle_error
+
+p_module_hci_cmd_transmit_handle_error:
+	jam 0,mem_module_hci_notify_len
+	jam HCI_DISCARD_PACKET,mem_module_temp_nl_discard_packet 
+	call module_clear_le_tx_data_flag
+	branch module_hci_event_receive_invalid_cmd
+
+p_parse_lmp_accepted:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_HOST_CONNECTION_REQ,p_parse_lmp_accepted_hostconn//ok
+	branch parse_lmp_accepted+2
+
+p_parse_lmp_accepted_hostconn:
+	//fetch 1,mem_state
+	//rtnbit0 state_init_seq
+	fetch 1,mem_lmp_conn_state
+	set1 RECEIVED_CONN_REQ,pdata
+	store 1,mem_lmp_conn_state
+	jam BT_EVT_BB_CONNECTED,mem_fifo_temp
+	call ui_ipc_send_event
+//	jam LMP_PACKET_TYPE_TABLE_REQ,mem_lmo_opcode2
+	//nbranch parse_lmp_accepted_hostconn_ctn,master
+	fetch 1,mem_ns_wake_up_flag
+	branch parse_lmp_accepted_hostconn_ctn,blank
+
+//call ice_break
+	jam 3,mem_connection_options
+	jam CONN_SM_AUTH_PAIR,mem_conn_sm
+	jam 1,mem_link_key_exists
+	jam RECONNECT_HID,memui_reconnect_mode
+	rtn
+	
+
+
+p_parse_lmp:
+	fetch 1,mem_lmi_opcode2
+ 	beq LMP_ENCRYPTION_KEY_SIZE_REQ,p_parse_lmp_crypt_key
+	beq LMP_SNIFF_REQ, p_parse_lmp_sniff_req
+//	beq LMP_QUALITY_OF_SERVICE_REQ,parse_lmp_quality_of_service_req
+ 	branch parse_lmp + 21
+ 	
+/*	jam 0xfe,mem_module_uart_opcode
+	setarg 2
+	call module_hci_prepare_tx
+	fetch 1,mem_lmi_opcode2
+	istore 1,contwu
+	fetch 1,mem_rxbuf+1
+	istore 1,contwu	
+	branch uartd_send 	
+	*/
+
+parse_lmp_quality_of_service_req: 
+ 	jam LMP_QUALITY_OF_SERVICE_REQ,mem_lmi_opcode2  
+ 	jam LMP_ACCEPTED,mem_lmo_opcode2  
+ 	rtn
+
+p_parse_lmp_crypt_key:
+	fetcht 1,mem_rxbuf+1
+	sub temp,6,null
+	branch reject_lmp_packet_pdu_not_allowed,positive
+	branch parse_lmp_crypt_key + 1
+	
+reject_lmp_packet_pdu_not_allowed:
+	jam PDU_NOT_ALLOWED,mem_lmo_reason2
+	branch reject_lmp_packet
+
+p_parse_lmp_sniff_req:
+	fetch 2,mem_rxbuf+6
+	branch lmp_reject_sniff,blank
+	//call parse_lmp_sniff_req_check_sniff_para
+	//branch lmp_reject_sniff,positive
+	branch parse_lmp_sniff_req+5
+
+
+p_parse_lmp_not_accepted:
+	fetch 1,mem_rxbuf+1
+	store 1,mem_lmi_accepted_opcode
+	beq LMP_AU_RAND,p_parse_lmp_not_accepted_aurand//ok
+	branch parse_lmp_not_accepted+3
+
+p_parse_lmp_not_accepted_aurand:
+	call parse_lmp_not_accepted_aurand
+	fetch 1,mem_conn_sm
+	rtnne CONN_SM_AUTH_WAIT
+	jam HCI_EVENT_BT_RECONNECT_FAIL,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	setarg 0x01
+	istore 1,contwu
+	branch uartd_send
+	
+//function : send lmp_accepted packet
+//		add sniff_request report
+p_send_lmp_accepted:
+	fetch 1,mem_lmi_opcode
+	beq LMP_SNIFF_REQ,p_send_lmp_accept_sniff_req
+	branch send_lmp_accepted+7
+	
+p_send_lmp_accept_sniff_req:
+	jam BT_EVT_SNIFF_REPORT,mem_fifo_temp
+	call ui_ipc_send_event	
+	branch sniff_init
+	
+p_send_lmp:
+	disable user
+	call lmo_fifo_process
+	fetch 1,mem_lmp_to_send
+	rtn blank
+	bbit1 7,p_send_lmp_escape
+//	beq LMP_SNIFF_REQ, p_send_lmp_sniff_req
+	beq LMP_M_TEST_REQ,p_send_lmp_opcode_00
+	branch send_lmp0
+
+	
+p_send_lmp_escape:
+	beq LMP_EXT_FEATURES_RES,p_send_lmpext_features_res
+	beq LMP_EXT_FEATURES_REQ,p_send_lmpext_features_req	
+	branch send_lmp_escape
+
+p_send_lmpext_features_res:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_res
+p_send_lmpext_features_req:
+	call p_check_ssp_enable
+	fetch 1,mem_lmp_to_send
+	branch send_lmpext_features_req
+
+p_check_ssp_enable:
+	fetch 1,mem_ssp_enable 
+	branch ssp_disable, blank
+	branch  ssp_enable
+
+p_ssp_disable:
+	fetch 1,mem_features+6
+	set0 param_featrue_ssp,pdata
+	store 1,mem_features+6
+	setarg 0x1
+	store 2,mem_lmpext_ssp_enable
+	rtn
+
+
+p_sp_initialize_256:	
+	fetch 1,mem_le_secure_connect_enable
+	branch  le_secure_connection_disable,blank
+//	call le_secure_connection_enable
+	call sp_clear_flags
+	branch sp_pubkey_calc_256
+
+p_check_51cmd_once_continue:
+	//bpatchx patch34_3,mem_patch34
+	call lmo_fifo_check
+	nbranch check_51cmd_restore,blank  //process this cmd next time while lmo fifo is full
+	fetch 1,mem_fifo_temp
+	bmark0 mark_context,check_51cmd_check_idle
+  	beq BT_CMD_ENTER_SNIFF,p_cmd_in_sniff
+	branch check_51cmd_once_continue+2
+
+p_cmd_in_sniff:
+	fetch 1,mem_btsniff
+	branch cmd_exit,blank
+	branch cmd_in_sniff
+
+eut_read_otp_data:
+	fetch 1,mem_module_state
+	set1 MODULE_READ_OTP_BIT,pdata
+	store 1,mem_module_state
+	
+	arg 0x00,addhi
+	arg 0x8973,contr
+	ifetch 1,contr
+	set1 6,pdata			//enable chgpump
+	arg 0x8973,contw
+	istore 1,contw
+	
+	arg 0x0f,addhi
+
+	arg 6, loopcnt              //len
+	arg 2,regb                     //addr
+	arg mem_read_otp_data,rega                   //data
+	
+	call eut_read_otp
+
+	//
+	arg 20, loopcnt
+	arg 0x12c,regb
+	arg mem_read_otp_data+6,rega
+	call eut_read_otp
+
+	arg 2, loopcnt
+	arg 0x1ffe,regb
+	arg mem_read_otp_data+26,rega
+	call eut_read_otp
+
+	call eut_otp_deselect
+
+	arg 0x00,addhi
+	arg 0x8973,contr
+	ifetch 1,contr
+	set0 6,pdata			//disable chgpump
+	arg 0x8973,contw
+	istore 1,contw
+	
+	arg 0x00,addhi
+
+	fetch 1,mem_module_state
+	set0 MODULE_READ_OTP_BIT,pdata
+	store 1,mem_module_state
+	rtn
+
+// rega pointers to buffer, regb is otp address, loopcnt is length
+eut_read_otp:
+	lshift3 regb,regb
+	call eut_otp_ce
+	call eut_otp_readen
+eut_read_otp_loop:
+	call eut_write_otpaddr
+	fetch 1,sec_otp_data
+	istore 1,rega
+	increase 8,regb
+	increase 1,rega
+	loop eut_read_otp_loop
+	rtn
+
+eut_otp_ce:
+	setarg 0x20c
+	call eut_write_otpctrl
+	setarg 0x208
+	call eut_write_otpctrl
+	setarg 0x200
+	call eut_write_otpctrl
+	setarg 0x208
+	branch eut_write_otpctrl
+
+eut_write_otpctrl:
+	arg sec_otp_ctrl,contw
+eut_write_word:	
+	istore 1,contw
+	rshift8 pdata,pdata
+	istore 1,contw
+	rtn
+
+eut_otp_readen:
+	setarg 0x288
+	branch eut_write_otpctrl
+
+// regb is otp address
+eut_write_otpaddr:
+	deposit regb
+	arg sec_otp_addr,contw
+	branch eut_write_word
+
+eut_otp_deselect:
+	setarg 0x20c
+	branch eut_write_otpctrl
+
+p_otp_custom_encryption_data_add_loop:
+	arg 13,loopcnt
+	arg OTP_INIT_VAL,temp
+	arg mem_read_otp_data,contr
+p_otp_custom_add:	
+	ifetch 2,contr
+	iadd temp,pdata
+	copy pdata,temp
+	loop p_otp_custom_add
+	rtn
+
+p_otp_custom_encryption_data_xor_loop:
+	arg 13,loopcnt
+	arg mem_read_otp_data,contr
+p_otp_custom_xor:	
+	ifetch 2,contr
+	ixor temp,pdata
+	copy pdata,temp
+	loop p_otp_custom_xor
+	rtn
+
+p_otp_judge_set_flag:
+	jam 0,mem_en_24g_flag
+	arg 0xffff,temp
+	iand temp,pdata
+	arg mem_read_otp_data+26,contr
+	ifetcht 2,contr
+	isub temp,null
+	nrtn zero
+	jam 1,mem_en_24g_flag
+	rtn
+
+p_check_otp_shaomaqiang_app:
+	call eut_read_otp_data
+	call p_otp_custom_encryption_data_add_loop
+	call p_otp_custom_encryption_data_xor_loop
+	call p_otp_judge_set_flag
+	fetch 1,mem_en_24g_flag
+	compare 1,pdata,0xff
+	rtn true
+	branch assert
+
+
+p_m_wakeup_timer:
+	fetch 1,mem_m_process_enable
+	rtn blank
+	arg mem_m_wakeup_timer ,regc
+	arg p_m_wakeup_timeup,regb
+	branch timer_single_step_2B
+	
+p_m_wakeup_timeup:
+	jam  HCI_EVENT_WAKEUP_TIMEOUT,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+	
+	
+p_m_private_dispatch:
+	fetch 1,mem_m_process_enable
+	rtn blank
+	branch p_m_send_wake_data_process
+	
+
+p_m_send_wake_data_init:
+	jam 1,mem_m_process_enable
+
+	// Unit is 625us. 60*625 = 37.5ms
+	setarg 60
+	store 2,mem_m_wake_send_window
+
+p_m_send_wake_data_timer_init:
+	// Unit is 625us. 160*625 = 100ms
+	setarg 160
+	force m_wake_timer,queue//change adv interval to diffault to iphone frame
+	branch timer_init
+
+
+p_m_send_wake_data_process:
+	force m_wake_timer,queue
+	call timer_check
+	nrtn blank
+
+	call fetch_page_bt_adr
+
+	// Calc the access code.	
+	call p_m_access_code_generate
+
+	call p_m_send_wake_data_timer_init
+p_m_send_wake_data_start:
+	fetcht 2,mem_m_wake_send_window
+	disable swfine
+	copy temp,stop_watch
+
+p_m_send_wake_data_restart:
+	branch p_m_wait_remote_signal_packet,timeout
+	// send wake data process.
+//fetch 2,0x4fe0
+//increase 1,pdata
+//store 2,0x4fe0
+
+	call set_sync_on
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_tx
+	call start_transmitter
+	call p_m_transmit_packet
+	call end_of_packet
+	// wait a while.
+	nop 5000
+	branch p_m_send_wake_data_restart
+
+
+p_m_lap_generate:
+	fetch 9,mem_m_access_code
+	// remove trailer
+//	rshift4 pdata,pdata
+	// remove 34bit bch
+	rshift32 pdata,pdata
+	rshift2 pdata,pdata
+	store 3,mem_tmp0
+	fetchr lap,3,mem_tmp0
+	rtn
+
+
+p_m_access_code_generate:
+	call p_m_lap_generate
+	fetch 9,mem_m_access_code
+	// remove trailer
+//	rshift4 pdata,pdata
+	fetcht 8,mem_m_p_sequence
+	ixor temp,pdata
+	// get the sync word p xor result.
+	// 6bit + 24bit + 34bit
+	// |fix| |lap| |bch|  
+	store 8,mem_tmp0
+	fetch 5,mem_tmp0
+	// use ulp mode.
+	enable le
+	iforce access
+	disable le
+	// lap and ulp will generate the access cod.
+	rtn
+
+
+
+p_m_transmit_packet_access_and_header:
+	call send_access_word
+	//call scan_mode_whiten
+p_m_transmit_packet_header:
+	//rshift bt_clk,temp
+	//or temp,0x40,white_init
+	//enable enable_white
+	disable enable_white
+	enable enable_hec
+	enable encode_fec1
+	fetch 2,mem_m_snd_op
+	inject mod,10
+	enable enable_parity
+	inject mod,8   /* transmit parity */
+	disable encode_fec1
+	disable enable_parity
+	disable enable_hec
+	set0 PSK3M,radio_ctrl
+	rtn
+
+
+p_m_transmit_packet:
+	setarg 0x078
+	store 2,mem_m_snd_op
+	call p_m_transmit_packet_access_and_header
+
+p_m_transmit_wake_packet_payload:
+	//enable encode_fec2
+	enable encode_fec0
+	disable encrypt
+	enable enable_crc
+
+	// send l2cap header. LLID:0x00, Flow:0x00, Length: 0x153, Reserve: 0x00
+	setarg 0x0A98
+	inject mod, 16
+
+	// Total: 80*4 = 320Bytes
+	arg 80,loopcnt
+p_m_transmit_wake_packet_payload_data_loop0:
+	fetch 4,mem_m_wake_data
+	inject mod,32
+	loop p_m_transmit_wake_packet_payload_data_loop0
+
+	// Total: 19Bytes
+	arg 19,loopcnt
+p_m_transmit_wake_packet_payload_data_loop1:
+	setarg 0x00
+	inject mod,8
+	loop p_m_transmit_wake_packet_payload_data_loop1
+
+p_m_transmit_wake_packet_payload_data_end:
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	rtn
+
+
+p_m_wait_remote_signal_packet:
+	fetcht 2,mem_m_wake_send_window
+	disable swfine
+	copy temp,stop_watch
+
+
+	disable clknt
+	disable attempt
+	
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_rx
+	call start_receiver	/* get ready for that id packet */
+	call wait_access_forever	/* until there is timeout, or matched (true) */
+	nbranch end_of_packet,sync
+//	call rf_debug_active_sync_line,sync
+
+p_m_receive_packet_header:
+	disable enable_white
+	enable enable_hec
+	enable decode_fec1
+	parse demod,bucket,10
+	rshift pwindow,pdata
+	store 2,mem_m_rcv_op
+	parse demod,bucket,8 
+	disable decode_fec1
+	disable enable_hec
+	
+p_m_receive_packet_payload:
+//	call rf_debug_active_crc_error_line,crc_failed
+	branch end_of_packet,crc_failed
+
+	arg 18,loopcnt
+	arg mem_m_process_sync_buffer,contw //lmp_data or test packet
+	//branch tws_receive_packet_payload
+
+// input loopcnt -- packet length
+// input contw    -- packet buffer ptr
+p_m_receive_packet_payload_raw:
+	enable decode_fec2
+	//enable encrypt
+	enable enable_crc
+p_m_process_payload_data:	
+	parse demod,bucket,8
+	rshift3 pwindow,pdata
+	istore 1,contw
+	loop p_m_process_payload_data
+p_m_process_payload_data_end:
+	parse demod,bucket,16  /* cycle through the crc */
+//	call rf_debug_active_crc_error_line,crc_failed
+	call end_of_packet	/* must have heard */
+	rtn crc_failed
+	fetch 6 ,mem_m_process_sync_buffer+2
+	fetcht 6,mem_hci_plap
+	isub temp,null
+	nrtn zero
+//fetch 2,mem_m_process_sync_buffer
+//store 2,0x4fe0
+	// remote clock unit is 312.5us/2 = 156.25us
+	fetch 4,mem_m_process_sync_buffer+14
+	rshift pdata,pdata
+	store 4,mem_clke_bt
+	fetch 1,mem_m_process_sync_buffer+1
+	store 1,extm_newconn_am_addr
+//	jam 0x04,extm_newconn_am_addr
+p_m_send_signal_packet:
+	//flag
+	setarg 0x67
+	store 1,mem_m_process_sync_buffer
+	fetch 6,mem_lap
+	store 6,mem_m_process_sync_buffer+1
+	setarg 0
+	store 9,mem_m_process_sync_buffer+7
+	//Clk Offset
+//	setarg 0
+//	store 3,mem_process_sync_buffer+13
+	
+//	setarg 0xea00
+//	store 2,mem_process_sync_buffer+16
+
+	// align the clock.
+	call rf_setup_time_slave_slot
+	call set_sync_on
+	// Use 2402MHz Freq
+	arg 0,temp
+	call set_freq_tx
+	call start_transmitter	/* get ready for that id packet */
+	call start_tx_external
+p_m_transmit_signal_packet:
+	fetch 2,mem_m_rcv_op
+	store 2,mem_m_snd_op
+	call p_m_transmit_packet_access_and_header
+
+p_m_transmit_signal_packet_payload:
+	enable encode_fec2
+	disable encrypt
+	enable enable_crc
+
+	arg 13,loopcnt
+	arg mem_m_process_sync_buffer,contr
+p_m_transmit_signal_packet_payload_data_loop:
+	ifetch 1,contr
+	inject mod,8
+	loop p_m_transmit_signal_packet_payload_data_loop
+
+p_m_transmit_signal_packet_payload_data_end:
+	enable enable_parity
+	inject mod,16
+	disable enable_parity
+	call end_of_packet	/* must have heard */
+
+	jam 0,mem_m_process_enable
+	setarg 0
+	store 2,p_m_wakeup_timer
+p_slave_apply_clke_bt:
+	compare 0x03,clke_bt,0x03
+	branch p_slave_apply_clke_bt_now,true
+	until null,mhalfbnd
+	branch p_slave_apply_clke_bt
+	
+p_slave_apply_clke_bt_now:
+	fetch 4,mem_clke_bt
+	or_into 0x03,pdata
+	icopy clke_bt
+
+	fetch 6,mem_hci_plap
+	store 6,mem_plap
+	call prepare_newconn
+//	jam 10,mem_newconnto_counter
+p_slave_newconn_loop:
+	call slave_newconn_once
+//call ice_break,match
+	branch p_m_slave_connection_success,match     
+	call new_conn_timeout
+	nbranch p_slave_newconn_loop,blank
+p_m_wakeup_fail:
+	jam  HCI_EVENT_WAKEUP_FAIL,mem_module_uart_opcode
+	branch module_hci_event_enter_standby_mode_len0
+
+
+p_m_slave_connection_success:
+	jam 1,mem_ns_wake_up_flag
+	fetch 1,mem_rxbuf
+	call p_parse_lmp_opcode_00
+	branch sconn_successful
+	//branch p_hci_send_connection_complete
+
+
+p_parse_lmp_opcode_00:
+	fetch 3,mem_rxbuf+1
+	store 3,mem_m_save_lmp_Ye
+	jam LMP_M_TEST_REQ,mem_lmo_opcode2
+	rtn
+
+
+p_send_lmp_opcode_00:
+	setarg 0x00
+	store 1,mem_lmp_to_send
+	fetch 1,mem_m_save_lmp_Ye
+	beq 0x00, p_send_lmp_rxbuf_00
+	beq 0x04, p_send_lmp_rxbuf_04
+	rtn
+
+p_send_lmp_rxbuf_00:
+	force 10,pdata
+	call msg_send_lmp
+	setarg 0x1d3201
+	istore 9,contw
+	setarg 0
+	branch send_lmp_exit
+
+p_send_lmp_rxbuf_04:
+	force 4,pdata
+	call msg_send_lmp
+	setarg 0x000004
+	istore 3,contw
+	setarg 1
+	branch send_lmp_exit
+
+/*
+p_send_lmp_rxbuf_00:
+	force 4,pdata
+	call msg_send_lmp
+	setarg 0x1f0004
+	istore 3,contw
+	branch send_lmp_request
+
+p_send_lmp_rxbuf_04:
+	force 10,pdata
+	call msg_send_lmp
+	setarg 0
+	istore 2,contw
+	setarg 0x1532
+	istore 8,contw
+	branch send_lmp_request
+*/
+
+	
+
+p_slave_loop:
+//	bpatch patch07_5,mem_patch07
+	call check_bt_disabled
+	call scheduler_process
+	call slave_conn_recv_packet	/* go listen for a packet */
+	nbranch slave_notmatch,match
+//fetch 1, mem_rx_type
+//sub pdata,1,null
+//ncall ice_break,zero
+	call supervision_flush
+	call scheduler_tx_l2cap_pkt
+	call prepare_tx
+	call slave_conn_send_packet
+	call parse_l2cap
+	call parse_lmp
+	fetch 1,mem_slave_rcvcnt
+	increase 1,pdata
+	store 1,mem_slave_rcvcnt
+	call calc_clke_offset
+	branch slave_notmatch
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_common_bugfix.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_common_bugfix.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_common_bugfix.prog	(working copy)
@@ -0,0 +1,140 @@
+
+/*
+	芯片公共bugfix
+*/
+
+/*
+	YC 3121 LPM  bugfix
+*/
+p_ahead_window:
+	copy temp,pdata
+	call clk2bt
+	lshift16 bt_clk,pdata
+	set1 44,pdata
+	call clk_diff
+	set0 44,pdata
+	call get_clk
+	call clk_diff
+	rtn user
+	call p_clk2rt
+	branch ahead_window+12
+
+p_lpm_adjust_clk:
+	deposit clke
+	call p_clk_diff_rt
+	branch lpm_adjust_clk+3
+
+p_lpm_dispatch_next:
+	fetch 2,mem_context + coffset_rx_window
+	rshift pdata,pdata
+	call clk2bt
+	deposit alarm
+	call clk_diff
+	copy clke,temp
+	call p_clk_diff_rt
+	branch lpm_dispatch_next+30
+
+p_clk_diff_rt:
+	call clk_diff
+p_clk2rt:
+	iforce contr
+	set0 16,contr
+	branch clk2rt+1
+
+/*
+	YC3121 没有exen GPIO
+	跳过disable exen
+*/
+p_soft_reset:
+	call rfcomm_init
+	call init_lmp
+	call p_ui_init
+	branch soft_reset + 9
+
+p_ui_init:
+	rtn wake
+	branch ui_timer_init
+
+p_main_loop:
+	//call p_g24_dispatch
+	branch main_loop+1
+
+/*
+	YC3121 shutdown radio bugfix
+	rfen_adc bug 陶其文添加
+*/
+p_shutdown_radio:
+	branch p_shutdown_radio0,is_rx
+	hjam 0xd4, 0x955
+	nop 4
+	hjam 0xd2, 0x955
+	nop 4
+	hjam 0xd1, 0x955
+	nop 4	
+	fetch 1,mem_tx_power
+	beq TX_POWER_0DB,p_shutdown_radio_0db
+	beq TX_POWER_3DB,p_shutdown_radio_3db
+	beq TX_POWER_5DB,p_shutdown_radio_5db
+	beq TX_POWER_f3DB,p_shutdown_radio_f3db
+	beq TX_POWER_f5DB,p_shutdown_radio_f5db
+	beq TX_POWER_PAIR,p_shutdown_radio_pair
+p_shutdown_radio_5db:	
+p_shutdown_radio_0db:
+	hjam 0xd0, 0x955
+	hjam 0xe0, 0x956
+p_shutdown_radio0:
+	force 0x08,radio_ctrl
+	force 0,radio_ctrl
+	disable is_rx
+	disable is_tx
+	pulse packet_end
+	hjam 0x0,rfen_mdm
+	hjam 0x0,rfen_tx
+	hjam 0x0,rfen_rx
+	hjam 0,rfen_sn
+	hjam 0x70,rfen_msc
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	rtn
+p_shutdown_radio_pair:
+p_shutdown_radio_f5db:
+p_shutdown_radio_f3db:
+p_shutdown_radio_3db:
+	hjam 0xd0,0x955
+	hjam 0xc0,0x956
+	branch p_shutdown_radio0
+
+
+p_le_transmit:
+	call le_prep
+	call p_letx_setfreq
+	branch le_transmit0
+
+p_letx_setfreq:
+	branch p_txon,match
+	branch letx_setfreq+1
+
+p_set_freq_tx:
+	storet 1,mem_last_freq
+	call set_freq_tx_offset
+	call rf_write_freq
+	setarg param_pll_setup
+	call sleep
+p_txon:	
+	fetch 1,rfen_adc
+	set1 0,pdata
+	store 1,rfen_adc
+	branch txon+1
+
+
+p_init_param:
+	hjam 0x7c,rfen_adc
+	rtn wake
+	setarg 0
+	store 2,mem_tx_len
+	rshift clkn_bt,pdata
+	store 4,mem_last_clkn
+	rtn
+
+
Index: BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_function_bugfix.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_function_bugfix.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/program_patch/patch_chip_function_bugfix.prog	(working copy)
@@ -0,0 +1,13 @@
+
+/*
+	YC3121 芯片功能bugfix
+*/
+
+/*
+	关闭广播不能休眠的问题
+*/
+p_lpm_unconn_nossp:
+	branch lpm_unconn_cont				//BT/BLE discover don't infect lpm
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/sched/109x.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/109x.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/109x.dat	(working copy)
@@ -0,0 +1,52 @@
+mem_patch00:02
+mem_patch10:20
+mem_patch11:02
+mem_patch14:04
+mem_patch17:09
+mem_patch20:68
+mem_patch27:44
+mem_patch28:02
+mem_patch2a:04
+mem_patch33:02
+
+#mem_lpm_config:0f 84 30
+mem_lpm_config:0f 84 f0
+mem_lpm_xtalcnt:0a 0b b2 32
+mem_lpm_hibernate_switch:8b
+mem_lpm_doze_switch:0b
+mem_gpio_wakeup:00 00 00 00 00 00 00 00
+
+mem_fcomp_mul:02
+mem_fcomp_div:24
+mem_iscan_window:03 00
+mem_iscan_interval:10 00
+mem_pscan_window:03 00
+mem_pscan_interval:30 00  
+
+mem_inq_window:20 00
+mem_page_window:20 00
+mem_page_to:00 20
+mem_rx_window_init:80 04
+mem_rx_window_sniff:00 10
+
+
+
+mem_lmp_version:08 0e 05 04 00
+
+mem_eeprom_base:30 1f
+mem_eeprom_block_size:20
+mem_context_number:01
+
+mem_rf_init:
+4b ba
+55 d0
+56 e0
+57 88
+58 6c
+59 10
+07 ff
+ff
+mem_rf_init_ptr:mem_rf_init
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/sched/24g_keyboard.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/24g_keyboard.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/24g_keyboard.dat	(working copy)
@@ -0,0 +1,20 @@
+
+
+#24g init
+mem_24g_mode:01#tx
+mem_24g_data_type:02        #mouse 1,kb 2
+mem_24g_max_retry:4#max tx retry
+mem_24g_no_ack:00#with ack
+mem_24g_rx_window:c0 12     #400us 
+mem_24g_ch_map1:00 13 2c 42
+mem_24g_ch_map2:06 15 36 48
+mem_24g_ch_map3:0f 1a 3a 4c
+mem_24g_ch_map4:11 23 31 4d
+mem_24g_pairing_sm:ff
+mem_24g_paring_addr:20 15 10 05
+mem_24g_common_temp:00 00 00 00 00 00 00 00 00 00
+mem_24g_enter_hibernate:00 48 5d 00 00 00 00 00#10 min
+mem_24g_enter_hibernate_max:ff ff ff ff
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/sched/DM_module.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/DM_module.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/DM_module.dat	(working copy)
@@ -0,0 +1,65 @@
+
+mem_device_option:0a
+
+##############NVRAM CONFIG##############
+mem_nv_data_ptr:mem_module_nv_data
+mem_nv_data_number:05
+#####################################
+
+
+
+
+################IPC BUFFER INIT#####################
+4FF0:00 1C
+4FF2:FF 1F
+4FF4:00 1C
+4FF6:00 1C
+4FF8:80 4C
+4FFA:E0 4F
+4FFC:80 4C
+4FFE:80 4C
+
+##############BLUETOOTH CONFIG##############
+###commom###
+mem_soft_version_num:20 0b
+mem_module_state:03
+mem_module_bluetooth_stauts_by_command:07
+
+mem_module_flag:00
+#bit0 MODULE_FLAG_UART_FLOW_CONTROL
+#bit1 MODULE_FLAG_BLE_SEND_MTU23
+#bit2 MODULE_FLAG_BLE_DATA_ENCRYPT
+mem_lpm_mode:00
+mem_lpm_interval:00 01
+mem_lpm_overhead:08
+mem_lpm_mult_timeout:02
+
+mem_sniff_param_interval:0e 00
+
+###ble###
+
+#####################################
+
+#mem_m_access_code:0A 97 B3 EE 62 96 0E E6 54
+
+mem_m_p_sequence:FC 54 CC BB 96 8D 84 83
+
+mem_m_access_code:70 39 eb 2e 66 e9 60 4e
+
+mem_hci_plap:
+59 3a 98 e9 b6 98 
+#98 b6 e9 98 3a 59
+
+mem_m_wake_data:
+05 2e 67 dd 
+#2e eb 39 70
+
+#mem_m_access_code:8f c6 14 d1 66 e9 60 4e 
+#d114c68f 4e60e966
+
+
+
+mem_link_key:
+F0 C0 93 E2 91 FA 78 23 D0 48 17 4C 5D 13 EB 23 
+mem_tx_power:02
+
Index: BlueTooth/BT_code_patch/shoubing/sched/ble_keyboard.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/ble_keyboard.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/ble_keyboard.dat	(working copy)
@@ -0,0 +1,88 @@
+
+mem_module_le_lpm_mult:05
+
+
+mem_le_pres:02 03 00 05 10 02 03
+
+mem_le_interval_min:
+08 00 #min interval
+10 00 #max interval
+00 00 #latency
+2c 01 #timeout
+
+
+
+
+mem_le_pairing_handle:31 00
+
+
+
+mem_le_local_mtu:17
+mem_le_remote_mtu:17
+
+mem_le_secure_connect_enable:00
+mem_le_adv_channel_map:07
+mem_le_pairing_mode:00
+
+mem_le_adv_enable:00
+mem_le_adv_interval:40 00
+
+mem_le_lap:21 2a 01 33 02 3a
+mem_le_name_len:
+'BT4.2 Keyboard
+
+mem_le_adv_data_len:03
+mem_le_adv_data:
+02 01 05
+03 19 c1 03
+03 03 12 18
+'\09BT4.2 Keyboard
+
+mem_le_scan_data_len:1f
+mem_le_scan_data:
+'\09BT4.2 Keyboard
+
+
+mem_ui_le_uuid_table:mem_module_le_att_list
+
+#attribute list: handle 2bytes, uuid 2bytes, length 1bytes, attribute Nbytes
+mem_module_le_att_list:
+#Primary service: GATT
+01 00 02 00 28 02 01 18
+#Characteristic: Service changed
+02 00 02 03 28 01 20
+03 00 02 05 2a 01 00
+#Client Characteristic Configuration
+04 00 02 02 29 02 00 00
+
+#Primary Service: GAP
+05 00 02 00 28 02 00 18 
+#Characteristic: Device Name
+06 00 02 03 28 01 02 
+07 00 02 00 2a 
+1d 42 54 34 2e 32 20 4b 65 79 62 6f 61 72 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20#'BT4.2 Keyboard
+
+#Characteristic: Appearance
+08 00 02 03 28 01 02 
+09 00 02 01 2a 02 c1 03 
+#Characteristic: Peripheral Preferred Connection Parameters
+0a 00 02 03 28 01 02
+0b 00 02 04 2a 08 06 00 06 00 64 00 2c 01 # interval 6ms, latency 100, timeout 300
+
+#Primary Service: Device Information
+0c 00 02 00 28 02 0a 18
+#Manufacturer Name
+0d 00 02 03 28 01 02
+0e 00 02 29 2a 06 59 69 43 68 69 70		
+
+# custom serivce
+0f 00 02 00 28 10 02 fb 34 9b 5f 80 00 00 80 00 10 00 00 10 ff 00 
+10 00 02 03 28 01 14
+11 00 10 fb 34 9b 5f 80 00 00 80 00 10 00 00 13 ff 00  01 00
+12 00 02 02 29 02 00 00
+
+00 00
+
+
+
+
Index: BlueTooth/BT_code_patch/shoubing/sched/bt_keyboard.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/bt_keyboard.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/shoubing/sched/bt_keyboard.dat	(working copy)
@@ -0,0 +1,219 @@
+
+
+mem_app_connection_options:17
+
+###3.0###
+mem_scan_mode:00
+mem_module_spp_lpm_mult:28
+
+##############passkey CONFIG##############
+mem_sp_iocap_local:02 00 04
+mem_ssp_enable:01
+mem_ssp_mode_flag:02
+#####################################
+
+mem_ui_profile_supported:01
+
+mem_lap:1c  6a a4 d8 17 e4
+mem_local_name_length:
+'BT3.0 Keyboard
+
+###3.0 sinff param###
+mem_sniff_param_interval:0e 00
+mem_sniff_param_attempt:01
+mem_sniff_param_timeout:01
+mem_unsniff2sniff_timer:0a
+
+mem_class: 40 25 00
+
+mem_device_option:43
+mem_ptt:0
+mem_features:
+ff
+ff
+8f
+f8	#fe--EDR  F8--BR
+83	#AFHclose 83
+9d
+59
+82
+
+
+
+mem_eir_enable:01
+
+mem_all_uuid_16bits:
+06
+03#Type: Complete list of 16-bit UUIDs
+1100 0001 0210 2411  0012  0100
+
+mem_all_uuid_128bits:00
+
+
+mem_ui_uuid_table:mem_module_uuid_list
+
+mem_module_uuid_list:
+#uuids
+04 0011 0100 1002 1124
+
+#handle
+00010000
+
+#total length
+36019a #01b6+19-43-2=1cf-43-2=18c-2=18a
+
+#attribute start, first 4 digit is attribute ID
+090000 0a 00010000
+090001 3503 191124
+090004 350d 3506 190100 090011 3503 190011
+090005 3503 191002
+090006 3509 09656e 09006a 090100
+090009 3508 3506 191124 090100
+09000d 350f 350d 3506 190100 090013 3503 190011
+
+#Service Name
+#090100 2517
+#'Apple Wireless Keyboard
+#41 70 70 6c 65 20 57 69 72 65 6c 65 73 73 20 4b 65 79 62 6f 61 72 64
+#Service Name
+090100 253d
+#'Broadcom Bluetooth Wireless  Keyboard                        
+4272 6f61 6463 6f6d 2042 6c75 6574 6f6f 7468 2057 6972 656c 6573 7320 204b 6579 626f 6172 6420 
+2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 2020 20
+
+#Service Description
+090101 2508
+#'Keyboard
+4b6579626f617264
+
+#Provider Name
+#090102 250a
+#'Apple Inc.
+#41 70 70 6c 65 20 49 6e 63 2e
+#Provider Name
+090102 2510
+#'Broadcom Corp.  
+4272 6f61 6463 6f6d 2043 6f72 702e 2020
+
+090200 090100
+090201 090111
+090202 0840
+090203 0821
+090204 2801
+090205 2801
+090206 3589 3587 0822 2583  #9f+19-43-2 = 73
+
+# hid descriptor
+0501 # Usage Page(Generic Desktop)
+0906 # Usage(Keyboard)
+a101 # Collection(Application)
+8501 # Report ID(1)
+7501 # Report Size(1)
+9508 # Report Count(8)
+0507 # Usage Page(Keyboard/Keypad)
+19e0 # Usage Minimum(224)
+29e7 # Usage Maximum(231)
+1500 # Logical Minimum(0)
+2501 # Logical Maximum(1)
+8102 # Input(Data Variable Absolute) ; Modifier byte
+9501 # Report Count(1)
+7508 # Report Size(8)
+8103 # Input(Constant Variable Absolute) ; 
+9505 # Report Count(5)
+7501 # Report Size(1)
+0508 # Usage Page(LEDs)
+1901 # Usage Minimum(1)
+2905 # Usage Maximum(5)
+9102 # Output(Data Variable Absolute) ; LED report
+9501 # Report Count(1)
+7503 # Report Size(3)
+9103 # Output(Constant Variable Absolute) ; 
+9506 # Report Count(6)
+7508 # Report Size(8)
+1500 # Logical Minimum(0)
+25ff # Logical Maximum(255)
+0507 # Usage Page(Keyboard/Keypad)
+1900 # Usage Minimum(0)
+29ff # Usage Maximum(255)
+8100 # Input(Data Array) ; Key arrarys 6 bytes
+c0 # End Collection
+
+
+05 0c #Usage Page (Consumer)
+09 01 #Usage (Consumer Control)	09 01
+a1 01 #Collection (Application)	A1 01
+85 02#    Report Id (2)	85 02			
+19 00 #    Usage Minimum (Unassigned)	19 00
+2a ff 03 #    Usage Maximum (Reserved (0x03FF))	2A FF 03
+15 00 #    Logical minimum (0)	15 00
+26 ff 03 #    Logical maximum (1'023)	26 FF 03
+95 01 #    Report Count (1)	95 01
+75 10 #    Report Size (16)	75 10
+81 00 #    Input (Data,Array,Absolute,Bit Field)	81 00
+c0 #End Collection	C0 
+
+#×??¨ò?
+0501 # Usage Page(Generic Desktop)
+0906 # Usage(Keyboard)
+a101 # Collection(Application)
+8507# Report ID(7)    
+0507# Usage Page(Keyboard/Keypad)
+19e0 #    Usage Minimum (Keyboard Left Control)	19 E0
+29e7 #    Usage Maximum (Keyboard Right GUI)	29 E7
+1500 # Logical Minimum(0)
+2501 # Logical Maximum(1)
+7501 #    Report Size (1)	75 01
+9508 # Report Count(8)
+8100 #     Input (Data,Array,Absolute,Bit Field)	81 00
+95a8 #    Report Count (168)	95 A8
+7501 # Report Size(1)
+1500 # Logical Minimum(0)
+2501 # Logical Maximum(1)
+0507 # Usage Page(Keyboard/Keypad)
+1900 #     Usage Minimum (No event indicated)	19 00
+29a8 #     Usage Maximum (Reserved (0x00A8))	29 A8
+8102 # Input(Data Variable Absolute) ; Modifier byte
+c0 # End Collection
+
+
+090207 3508 3506 090409 090100
+09020b 090100
+09020c 090c80
+09020d 2800
+09020e 2801
+09020f 090318
+090210 0900       00
+#attribute end
+
+#uuids for pnpInformation	
+03 1002 1200 0001
+
+#handle
+00010001
+
+#total length 90 bytes
+3600a1
+
+#attribute list
+090000 0a00010001
+090001 3503 191200
+090004 350d 3506 190100 090001 3503 190001
+090006 3509 09656e 09006a 090100
+090009 3508 3506 191200 090100
+090100 252f42726f6164636f6d20426c7565746f6f746820576972656c657373204b6579626f61726420506e5020536572766572
+090101 25084b6579626f617264
+090200 090103
+090201# VendorID
+0904e8
+090202#ProductID
+097021
+090203 090001
+090204 2801
+090205 090002
+
+#attribute end
+00
+
+#Auto reconnection after power on
+
+
