Index: do.bat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/do.bat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/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%\app.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: format/app.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/app.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/app.format	(working copy)
@@ -0,0 +1,5 @@
+
+(
+0x39 HCI_CMD_SET_MULTI_PICONET
+)
+
Index: format/app_module.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/app_module.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/app_module.format	(working copy)
@@ -0,0 +1,130 @@
+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
+	600 mem_temp_prepare_write_request_Data
+	260 mem_le_l2capbuf_new
+	0 mem_le_l2capbuf_new_end
+	600 mem_ipc_rx_buf
+	0 mem_ipc_rx_buf_end
+)
+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	
+	300 mem_module_uuid_list
+	0 mem_module_uuid_list_end
+	630 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
+	1 mem_rfcomm_lmp_dis_flag
+	1 mem_module_rfcomm_disconnect_count
+
+	2 mem_le_buff_len
+	2 mem_le_buff_len_all
+	2 mem_module_prepare_write_request_contw
+	2 mem_module_prepare_write_request_contr
+
+	2 mem_module_master_rx_max
+	
+	1 mem_le_txheader_temp
+	1 mem_le_txlen_temp
+	2 mem_le_txpayload_temp
+	2 mem_le_txcid_temp
+	1 mem_le_l2cap_temp
+	1 mem_le_l2cap_response_temp
+	251 mem_le_txbdy_temp
+	15 mem_rf_init
+	1 mem_ble_dle_enable
+	1 mem_judge_clear_got_tx_falg
+	3 mem_2m0_tmier_address
+
+	1 mem_ipcbuf_bt2m0_flag
+	2 mem_ipcbuf_bt2m0_write
+	2 mem_ipcbuf_bt2m0_read
+
+	0 mem_module_end2
+	
+)
+ 
+
+(//mem_ble_dle_enable
+0x00 DLE_ENABLE
+0x01 DLE_DISABLE
+)
+(
+249 LE_BASEBAND_MAX_BUFFER
+)
+(//mem_module_flag
+//bit3~bit7 module states change
+3 MODULE_RECEIVE_COMPLETE_PREPARE_WRITE_REQ
+
+7 MODULE_RECV_CONFIRM
+)
+
+(
+	0x300 UART_AIR_CONTROL_THRESHOLD
+	0x100 UART_AIR_CONTROL_THRESHOLD_NEW
+)
+(//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
+)
+
+
+(
+0x80	SPP_COM_EXSIT
+0x1F	SPP_COM_CHANNEL
+7		SPP_COM_EXSITBIT
+)
+
+(
+5 SPP_CONTEXT_SIZE
+4 SPP_CONTEXT_NUMBER 
+
+2 SPP_CONTEXT_OFFSIT_CREDIT_GIVEN
+0 SPP_CONTEXT_OFFSIT_CREDIT_CHANNEL
+)
+
+(
+23 SPP_CONTEXT_ALL_SIZE
+)
+
Index: format/bt.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/bt.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/bt.format	(working copy)
@@ -0,0 +1,20 @@
+
+(
+
+44 mark_buf_full
+)
+
+(
+7 CONTEXT_NUM_NEW
+//80 context_size_new
+14 CONTEXT_SIZE_EXTEND
+)
+
+
+
+(
+0x1200 mem_l2cap_rxbuff2_new
+
+0x1400 mem_tx_buff0_new
+)
+
Index: format/le.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/le.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/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: format/utility.format
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/format/utility.format	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/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: output/bt_code.c
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/output/bt_code.c	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/output/bt_code.c	(working copy)
@@ -0,0 +1,323 @@
+const unsigned char bt_code[] = {
+0x00,0x02,0xaa,0x55,0xce,0x0e,0xc2,0x84,0x00,0x10,0xc0,0x00,0x80,0x5b,0xc0,0x42,
+0x80,0x61,0xc0,0x44,0x80,0x82,0xc0,0x4a,0x00,0x41,0xc0,0x51,0x00,0x8b,0xc0,0x51,
+0x80,0x4c,0xc0,0x54,0x80,0x4f,0xc0,0x56,0x00,0x92,0xc0,0x5c,0x00,0x93,0xc0,0x5d,
+0x80,0xf4,0xc0,0x5e,0x01,0x64,0xc0,0x75,0x81,0x85,0xc0,0x78,0x80,0x24,0xc0,0x7a,
+0x80,0x39,0x20,0x20,0x4a,0x8b,0xc0,0x01,0x81,0x8f,0xc0,0x02,0x81,0x9b,0xc0,0x03,
+0x01,0xa4,0xc0,0x03,0x81,0xaa,0xc0,0x04,0x01,0xb3,0xc0,0x05,0x81,0xc4,0xc0,0x09,
+0x81,0xd4,0xc0,0x0a,0x02,0x6f,0xc0,0x0e,0x02,0x84,0xc0,0x0f,0x02,0xad,0xc0,0x0f,
+0x82,0xdb,0xc0,0x11,0x03,0x3d,0xc0,0x19,0x03,0x65,0xc0,0x1d,0x03,0x78,0xc0,0x1f,
+0x03,0x83,0xc0,0x20,0x83,0x95,0xc0,0x29,0x03,0x9b,0xc0,0x46,0x82,0xc2,0xc0,0x4c,
+0x83,0xaf,0x20,0x20,0x4a,0x8b,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,0x82,0x5a,0x6f,0xe2,0x4b,0xf2,0x24,0x5a,0x00,0x36,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,0x82,0x5a,0x6f,0xe2,0x4b,0xf2,0x24,0x5a,0x00,0x36,0x20,0x36,
+0xd7,0x62,0xc5,0x16,0x57,0x62,0x20,0x20,0x57,0x6f,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,0x58,0x20,0x20,0x4a,0x2f,0x1b,0x42,0x7e,0x00,0x20,0x40,0x00,0x57,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,0x57,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,0x5f,0x20,0x20,
+0x40,0x0a,0x20,0x75,0x80,0x00,0x20,0x20,0x7b,0x9a,0x20,0x30,0x80,0x71,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,0x6f,0xc0,0x00,
+0x80,0x7f,0xc0,0x01,0x00,0x6f,0xc0,0x01,0x80,0x7f,0xc0,0x02,0x00,0x7f,0xc0,0x10,
+0x00,0x7f,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,0x71,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,0xa3,0x67,0xe4,0x41,0xf6,0x58,0x00,0x00,0xbf,0x67,0xe4,
+0x41,0xfe,0x58,0x00,0x00,0xc9,0x67,0xe4,0x41,0xfa,0x58,0x00,0x00,0xdb,0x67,0xe4,
+0x41,0xea,0x58,0x00,0x00,0xde,0x67,0xe4,0x41,0xf2,0x58,0x00,0x00,0xe1,0x67,0xe4,
+0x45,0x41,0x20,0x40,0x4d,0xaf,0x20,0x40,0x4d,0xbc,0x20,0x40,0x4c,0x2a,0x20,0x20,
+0x50,0x4d,0x1a,0x62,0x7e,0x00,0xc0,0x04,0x80,0xb7,0xc0,0x01,0x00,0xb5,0xc0,0x0a,
+0x00,0xbd,0xc0,0x04,0x00,0xa9,0x20,0x20,0x4d,0xdf,0x6f,0xe4,0x46,0x52,0x79,0x20,
+0x7e,0x04,0x67,0xe4,0x46,0x52,0x6f,0xe2,0x46,0x6d,0x67,0xe2,0x41,0x73,0x20,0x20,
+0x00,0xaf,0x70,0x0a,0xff,0x00,0x58,0x00,0x00,0x01,0x20,0x40,0x50,0xa5,0x6f,0xe2,
+0x45,0x3c,0xe7,0xe2,0x00,0x0a,0x20,0x20,0x67,0xb9,0x70,0x4a,0xd0,0x00,0x20,0x20,
+0x4d,0xfb,0x6f,0xe2,0x4a,0xcf,0x24,0x5a,0x00,0xbb,0x70,0x4a,0xd0,0x06,0x20,0x20,
+0x4e,0x08,0x70,0x4a,0xd0,0x06,0x20,0x60,0x00,0x00,0x20,0x40,0x03,0x47,0x20,0x20,
+0x4e,0x28,0x20,0x40,0x00,0xc1,0x20,0x20,0x50,0xc3,0x6f,0xe2,0x4a,0xd0,0x20,0x7a,
+0x00,0x00,0x1f,0xe0,0xff,0xff,0x67,0xe2,0x4a,0xd0,0x24,0x7a,0x00,0x00,0x6f,0xe4,
+0x46,0x52,0xc2,0x80,0x4d,0x64,0x20,0x60,0x00,0x00,0x20,0x40,0x4f,0x11,0x20,0x74,
+0x00,0x00,0x1a,0x22,0x7e,0x00,0x67,0xe4,0x46,0x71,0x20,0x40,0x00,0xd5,0x67,0xe2,
+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,0x4b,0xed,0x24,0x3a,
+0x00,0xd9,0x1f,0x22,0x7e,0x00,0x20,0x60,0x00,0x00,0x1a,0x42,0x7e,0x00,0x20,0x60,
+0x00,0x00,0x20,0x40,0x02,0x28,0x24,0x34,0x4d,0x4b,0x20,0x20,0x4d,0xbd,0x20,0x40,
+0x00,0xe0,0x20,0x20,0x50,0xd3,0x20,0x20,0x4d,0xc8,0x20,0x40,0x4d,0xd7,0x70,0x0a,
+0xff,0x07,0x6f,0xe4,0x04,0xfb,0x20,0x7a,0x00,0x00,0x68,0x44,0x45,0x3e,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,0xe2,0x6f,0xe2,0x0a,0xff,0xc0,0x13,0x81,0x62,0xc0,0x06,
+0x00,0xfd,0xc0,0x3b,0x01,0x06,0xc0,0x3b,0x81,0x0c,0xc0,0x3c,0x01,0x11,0xc0,0x0a,
+0x81,0x4b,0xc0,0x7f,0x01,0x4e,0x20,0x20,0x4e,0x5c,0x1a,0x22,0x06,0x00,0xef,0xe2,
+0x00,0x03,0xc0,0x00,0x4f,0x1c,0xc0,0x00,0xcf,0x1f,0xc0,0x01,0x4f,0x25,0xc0,0x01,
+0x81,0x04,0x20,0x20,0x50,0x1c,0x58,0x00,0x00,0x01,0x20,0x20,0x4f,0x20,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,0x15,0x20,0x40,0x01,0x32,0x58,0x00,
+0x00,0x00,0xe7,0xe4,0x00,0x05,0x20,0x20,0x01,0x44,0xef,0xe2,0x00,0x03,0x20,0x40,
+0x01,0x19,0x20,0x40,0x01,0x20,0x20,0x20,0x01,0x44,0x20,0x40,0x01,0x36,0x58,0x28,
+0x00,0x02,0xe7,0xe6,0x00,0x05,0x20,0x60,0x00,0x00,0x67,0xe2,0x0a,0x96,0x20,0x40,
+0x01,0x36,0x59,0x28,0x03,0x02,0xe7,0xe8,0x00,0x05,0x6f,0xe2,0x0a,0x96,0xe7,0xe6,
+0x00,0x05,0x20,0x60,0x00,0x00,0x20,0x40,0x01,0x36,0x20,0x40,0x01,0x32,0x20,0x40,
+0x01,0x32,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,0x2d,0xc2,0x82,
+0x81,0x2d,0x18,0x40,0x84,0x01,0x20,0x60,0x00,0x00,0x20,0x40,0x01,0x36,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,0x39,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,0x3b,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,0xef,0xe2,
+0x00,0x03,0xc0,0x00,0x01,0x59,0xc0,0x00,0x81,0x53,0xc0,0x01,0x01,0x5f,0x20,0x20,
+0x50,0x1c,0xef,0xe4,0x00,0x03,0x1f,0xe2,0x24,0x00,0xef,0xe2,0x00,0x03,0x1f,0xe2,
+0x22,0x00,0xd8,0x40,0x00,0x00,0x20,0x20,0x50,0x2a,0xef,0xe4,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,0x82,0x3a,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,0x01,0x81,0xe8,0x48,0x00,0x06,0x59,0x28,
+0x03,0x02,0x98,0x46,0x7c,0x00,0x24,0x22,0x81,0x81,0xef,0xe2,0x00,0x06,0xc2,0x82,
+0x81,0x7d,0xc2,0x82,0x4f,0x01,0x20,0x20,0x01,0x81,0x20,0x40,0x03,0x4d,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,0x6f,0xe2,0x4b,0xed,0x24,0x3a,
+0x57,0x09,0x20,0x40,0x57,0x09,0x70,0x4a,0xdb,0x01,0x70,0x4a,0xdc,0x00,0x58,0x00,
+0x00,0x00,0x67,0xf0,0x4a,0xd1,0x58,0x00,0x00,0x1b,0x67,0xe4,0x4a,0xd9,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,0x01,0xa7,0x20,0x20,
+0x58,0xa7,0x20,0x36,0x80,0x87,0xc5,0x16,0x00,0x87,0x20,0x20,0x57,0xbe,0x6f,0xe2,
+0x4b,0xed,0x24,0x3a,0x58,0xb3,0x6f,0xe2,0x4a,0xdb,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,0x4b,0xed,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,
+0x4a,0xdb,0x68,0x42,0x43,0x41,0x18,0x40,0xfe,0x06,0x67,0xe2,0x4a,0xdc,0x6f,0xec,
+0x44,0x72,0x67,0xec,0x4a,0xdd,0x18,0x42,0x72,0x00,0xd8,0xc0,0x43,0x42,0x20,0x40,
+0x7c,0xcf,0x20,0x20,0x58,0xde,0x6f,0xe2,0x4b,0xed,0x24,0x3a,0x58,0xf7,0xd8,0x40,
+0x00,0x04,0x6f,0xe2,0x44,0x57,0x7d,0x3a,0x04,0x06,0x60,0x42,0x4a,0xdb,0x68,0x42,
+0x43,0x61,0x18,0x40,0xfe,0x06,0x67,0xe2,0x4a,0xdc,0x6f,0xec,0x44,0x72,0x67,0xec,
+0x4a,0xdd,0xd8,0xc0,0x43,0x62,0x18,0x42,0x72,0x00,0x20,0x40,0x7c,0xcf,0x20,0x40,
+0x58,0xa1,0x20,0x20,0x5a,0xe2,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,0x01,0xe7,0x6f,0xe2,0x04,0x3b,0xc3,0x02,
+0x01,0xe7,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,
+0x4b,0xed,0x24,0x7a,0x00,0x00,0x20,0x20,0x01,0xed,0x6f,0xe2,0x02,0xd6,0x20,0x7a,
+0x00,0x00,0x6f,0xe2,0x02,0xd5,0x2f,0xe0,0x06,0x01,0x20,0x20,0x82,0x15,0x2f,0xe0,
+0x06,0x02,0x20,0x20,0x81,0xf5,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,
+0x02,0x09,0xc0,0x29,0x02,0x0b,0xc0,0x0b,0x02,0x02,0xc0,0x0c,0x5e,0x3b,0xc0,0x01,
+0x5c,0xa1,0xc0,0x0f,0x03,0x47,0x79,0x3f,0x80,0x0f,0x20,0x60,0x00,0x00,0x58,0x00,
+0x0b,0x1e,0x67,0xe4,0x4a,0xd5,0x20,0x40,0x02,0x0e,0x1f,0x20,0xf3,0xfe,0xda,0x20,
+0x02,0xe0,0x20,0x40,0x5a,0xbe,0x20,0x20,0x02,0x2e,0x20,0x40,0x02,0x0b,0x20,0x20,
+0x02,0x25,0x20,0x40,0x02,0x0e,0xda,0x20,0x02,0xde,0x20,0x20,0x5a,0xbe,0x6f,0xe2,
+0x02,0xd6,0x1f,0xe0,0xf3,0xf9,0x1f,0xe0,0xff,0xfc,0x67,0xe4,0x4a,0xd1,0xe8,0x44,
+0x00,0x06,0x60,0x44,0x4a,0xd3,0x20,0x60,0x00,0x00,0x79,0x20,0x00,0x0f,0x20,0x40,
+0x02,0x1d,0x6f,0xe2,0x04,0x73,0xc0,0x09,0x02,0x25,0xc0,0x0b,0x02,0x24,0xc1,0x29,
+0x00,0x00,0x79,0x3f,0x80,0x0f,0x20,0x60,0x00,0x00,0x6f,0xe2,0x02,0xd6,0x68,0x44,
+0x4a,0xd1,0x98,0x40,0x84,0x00,0x60,0x44,0x4a,0xd1,0x1f,0xe2,0x72,0x00,0xda,0x20,
+0x02,0xd7,0x20,0x20,0x5a,0xbe,0x20,0x20,0x02,0x2e,0x20,0x40,0x02,0x28,0x24,0x74,
+0x00,0x00,0x20,0x20,0x5e,0x13,0x20,0x40,0x7d,0xc1,0x6f,0xe4,0x4a,0xd3,0x68,0x44,
+0x4a,0xd1,0x98,0x46,0x7c,0x00,0x24,0x62,0x80,0x00,0x20,0x20,0x7d,0xbf,0x6f,0xe4,
+0x4a,0xd5,0x1f,0xe2,0x0a,0x00,0x6f,0xe2,0x02,0xd6,0x1f,0xe2,0x72,0x00,0x20,0x40,
+0x7c,0xdc,0x18,0xa2,0x7e,0x00,0x67,0xe4,0x4a,0xd5,0x20,0x40,0x02,0x28,0x24,0x74,
+0x00,0x00,0xd8,0xe0,0x00,0x03,0x20,0x40,0x50,0xe6,0x20,0x20,0x02,0x3a,0x20,0x40,
+0x5c,0x74,0x24,0x7a,0x00,0x00,0x70,0x0b,0x22,0x17,0x58,0x00,0x0b,0x1e,0x67,0xe4,
+0x4a,0xd7,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,0x4a,0xd7,0x1f,0xe2,0x0c,0x00,0x1a,0x22,0x72,0x00,0x20,0x40,
+0x7c,0xcf,0x18,0xc2,0x7e,0x00,0x67,0xe4,0x4a,0xd7,0x6f,0xe4,0x0b,0x1e,0x9a,0x46,
+0x7e,0x00,0x67,0xe4,0x0b,0x1e,0x20,0x3a,0x02,0x56,0xd8,0x40,0x00,0xf9,0x20,0x40,
+0x7d,0xb5,0x1f,0xe2,0x24,0x00,0x18,0x00,0x02,0x01,0x20,0x20,0x02,0x45,0x58,0x00,
+0x00,0x00,0x67,0xe4,0x4a,0xd5,0xd8,0xe0,0x00,0x03,0x20,0x20,0x50,0xe2,0x70,0x4b,
+0xf2,0x00,0x68,0x44,0x4f,0xf0,0x6f,0xe4,0x4f,0xf2,0x98,0x46,0x22,0x00,0x68,0x44,
+0x4f,0xf4,0x6f,0xe4,0x4f,0xf6,0x60,0x44,0x4b,0xf5,0x67,0xe4,0x4b,0xf3,0x98,0x46,
+0x7e,0x00,0x20,0x21,0x02,0x6a,0x20,0x22,0x82,0x6a,0x1a,0x22,0x04,0x00,0x6f,0xe4,
+0x4b,0xf3,0x98,0x40,0xfe,0x00,0x68,0x44,0x4b,0xf5,0x98,0x46,0x7e,0x00,0xd8,0x40,
+0x03,0x00,0x98,0x46,0x7c,0x00,0x24,0x61,0x00,0x00,0x70,0x4b,0xf2,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,0x4b,0xed,0x24,0x3a,0x02,0x7f,0x6f,0xe2,0x4a,0xdd,0x20,0x20,
+0x02,0x80,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,0x4b,0xed,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,0x02,0xa9,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,
+0x4a,0xdd,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,
+0x02,0xa9,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,
+0x4a,0xd9,0x18,0xa2,0x0c,0x00,0x20,0x60,0x00,0x00,0x6f,0xe2,0x4b,0xed,0x24,0x3a,
+0x5a,0x41,0x60,0x42,0x4a,0xdc,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,0x4a,0xdb,0x6f,0xe2,0x4a,0xdb,0x28,0x20,
+0x06,0x01,0x24,0x20,0x82,0xbe,0x6f,0xe2,0x4a,0xdc,0x20,0x7a,0x00,0x00,0x6f,0xe2,
+0x04,0x3b,0xc4,0x02,0x00,0x00,0x20,0x40,0x73,0x42,0x20,0x20,0x72,0x99,0x6f,0xe2,
+0x4b,0xed,0x24,0x3a,0x72,0x9a,0xda,0x60,0x4a,0xdb,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,0x4a,0xdd,0x6f,0xe2,0x4a,0xdc,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,0x4a,0xdc,0x1f,0xe0,0xfe,0x04,0x67,0xe2,
+0x4a,0xdc,0x68,0x4a,0x43,0xd5,0x18,0x40,0x84,0x01,0x60,0x4a,0x43,0xd5,0x20,0x60,
+0x00,0x00,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,0x83,0x1c,0x20,0x40,0x02,0xee,0xd8,0xe0,
+0x00,0x03,0x24,0x34,0x4b,0xec,0x20,0x40,0x4b,0xf0,0x20,0x20,0x5a,0x6b,0x6f,0xe2,
+0x44,0xde,0xc0,0x01,0x02,0xf2,0xc0,0x00,0x83,0x06,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,0x0d,0x7d,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,0x0d,0x7d,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,0x0d,0x7d,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,0x03,0x20,0xc0,0x0a,
+0x03,0x2e,0x20,0x20,0x60,0x45,0xda,0x20,0x00,0x09,0xda,0x40,0x00,0x09,0x20,0x40,
+0x5c,0x22,0x58,0x00,0x00,0x21,0xe7,0xf0,0x00,0x05,0x20,0x40,0x03,0x27,0x20,0x60,
+0x00,0x00,0x6f,0xe2,0x02,0xd8,0x1f,0xe1,0x7e,0x20,0x20,0x3a,0x03,0x2c,0x70,0x4b,
+0xed,0x00,0x20,0x60,0x00,0x00,0x70,0x4b,0xed,0x01,0x20,0x60,0x00,0x00,0xef,0xe4,
+0x00,0x06,0x67,0xe4,0x4a,0xd9,0x20,0x20,0x03,0x31,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,0xef,0xe4,0x00,0x06,0xc0,0x02,
+0x03,0x42,0xc0,0x03,0x5e,0xd4,0xc0,0x02,0xde,0x96,0x20,0x60,0x00,0x00,0xef,0xe6,
+0x00,0x06,0x67,0xe6,0x04,0x73,0xc0,0x08,0x03,0x49,0xc0,0x04,0x03,0x52,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,0x03,0x55,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,0x83,0x61,0x20,0x20,0x5d,0x2d,0xd8,0x40,0x2a,0x00,0x20,0x40,
+0x5b,0x5c,0x20,0x3a,0x5e,0x56,0x20,0x20,0x5d,0x8b,0x6f,0xe2,0x4b,0xed,0x24,0x3a,
+0x5b,0xd5,0x78,0x55,0xfc,0x00,0x20,0x37,0x03,0x6a,0x24,0x36,0xdb,0xe6,0x20,0x40,
+0x4b,0xa0,0x6f,0xe4,0x40,0xc1,0x67,0xe4,0x04,0x49,0x24,0x36,0xcb,0xb3,0xc5,0x07,
+0xcb,0xb3,0x6f,0xe2,0x44,0xdd,0x24,0x3a,0x4b,0xb3,0x6f,0xe2,0x4a,0xdc,0x24,0x3a,
+0x4b,0xb3,0x6f,0xe2,0x44,0xbb,0xc2,0x82,0xcb,0xb3,0x6f,0xe2,0x04,0x3b,0xc2,0x82,
+0xcb,0xb3,0x20,0x20,0x4b,0x95,0x6f,0xe2,0x00,0x7d,0xc0,0x08,0x03,0x7c,0xc0,0x0b,
+0x83,0x82,0x20,0x20,0x60,0xfe,0x68,0x42,0x05,0x4e,0x18,0x46,0x7c,0x06,0x20,0x21,
+0x03,0x80,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,0x83,0x89,0x20,0x20,0x63,0xf2,0xc0,0x42,0x03,0x8c,0xc0,0x41,
+0x83,0x8f,0x20,0x20,0x64,0x21,0x20,0x40,0x03,0x92,0x6f,0xe2,0x00,0x48,0x20,0x20,
+0x64,0x7b,0x20,0x40,0x03,0x92,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,
+0x83,0xa1,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,0x03,0xab,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,0x7c,0x91,0xaa,0x55,0x40,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x02,0x10,0x00,0x0c,0x12,
+0x00,0x19,0x00,0x00,0x00,0x00,0x00,0x08,0x22,0x00,0xe8,0x09,0x18,0xd0,0x04,0x00,
+0x04,0x44,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x02,0x00,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,0x25,0x4a,0x05,0xaa,0x55,0x04,
+0x00,0x3d,0x45,0x01,0x7f,0x00,0x03,0xaa,0x55,0x03,0x00,0x2d,0x46,0x03,0x00,0x04,
+0xaa,0x55,0x01,0x00,0x2c,0x46,0x01,0xaa,0x55,0x06,0x00,0x57,0x46,0x04,0x30,0x30,
+0x30,0x30,0x30,0xaa,0x55,0x10,0x00,0xf0,0x4f,0x00,0x1c,0xff,0x1f,0x00,0x1c,0x00,
+0x1c,0x00,0x4c,0xe0,0x4f,0x00,0x4c,0x00,0x4c,0xaa,0x55,0x03,0x00,0xef,0x4b,0x00,
+0x80,0x02,0xaa,0x55,0x02,0x00,0x68,0x46,0x10,0x0b,0xaa,0x55,0x01,0x00,0x6c,0x46,
+0x03,0xaa,0x55,0x01,0x00,0x6f,0x46,0x07,0xaa,0x55,0x03,0x00,0xaa,0x40,0x24,0x04,
+0x04,0xaa,0x55,0x01,0x00,0x79,0x46,0x00,0xaa,0x55,0x01,0x00,0xcf,0x4a,0x00,0xaa,
+0x55,0x01,0x00,0x91,0x40,0x00,0xaa,0x55,0x03,0x00,0x54,0x41,0x00,0x01,0x08,0xaa,
+0x55,0x01,0x00,0x74,0x41,0x02,0xaa,0x55,0x01,0x00,0x93,0x40,0x00,0xaa,0x55,0x01,
+0x00,0x6d,0x46,0x28,0xaa,0x55,0x06,0x00,0xa0,0x40,0xa7,0x2a,0x2a,0x21,0x10,0x55,
+0xaa,0x55,0x08,0x00,0xe7,0x44,0x07,0x59,0x43,0x33,0x78,0x78,0x78,0x20,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,0x40,0x00,0xaa,0x55,0x01,0x00,
+0x6e,0x46,0x05,0xaa,0x55,0x06,0x00,0x72,0x44,0x21,0x22,0x01,0x33,0x02,0x3a,0xaa,
+0x55,0x0d,0x00,0x81,0x43,0x0c,0x33,0x31,0x32,0x31,0x20,0x4d,0x6f,0x75,0x20,0x42,
+0x6c,0x65,0xaa,0x55,0x04,0x00,0x41,0x43,0x03,0x02,0x01,0x0e,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,
+0x12,0x00,0x5f,0x45,0x01,0x07,0x00,0x00,0x00,0x00,0xde,0xca,0xfa,0xde,0xde,0xca,
+0xde,0xaf,0xde,0xca,0xca,0xff,0xaa,0x55,0x02,0x00,0x47,0x45,0x83,0x46,0xaa,0x55,
+0x1c,0x01,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,0x02,0x01,0x00,0x00,0x01,0x00,0x01,0x00,0x0d,0x36,0x00,0x58,
+0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x0d,0x09,0x00,0x01,0x35,0x11,0x1c,0x00,0x00,
+0x00,0x00,0xde,0xca,0xfa,0xde,0xde,0xca,0xde,0xaf,0xde,0xca,0xca,0xff,0x09,0x00,
+0x04,0x35,0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,0x0f,0x09,
+0x00,0x05,0x35,0x03,0x19,0x10,0x02,0x09,0x00,0x08,0x08,0xff,0x09,0x00,0x09,0x35,
+0x08,0x35,0x06,0x19,0x11,0x01,0x09,0x01,0x00,0x09,0x01,0x00,0x25,0x0a,0x41,0x70,
+0x70,0x6c,0x65,0x20,0x49,0x6e,0x63,0x2e,0x03,0x11,0x01,0x00,0x03,0x01,0x00,0x00,
+0x01,0x00,0x03,0x36,0x00,0x46,0x09,0x00,0x00,0x0a,0x00,0x01,0x00,0x03,0x09,0x00,
+0x01,0x35,0x03,0x19,0x11,0x01,0x09,0x00,0x02,0x0a,0x00,0x00,0x00,0x00,0x09,0x00,
+0x04,0x35,0x0c,0x35,0x03,0x19,0x01,0x00,0x35,0x05,0x19,0x00,0x03,0x08,0x01,0x09,
+0x00,0x06,0x35,0x09,0x09,0x65,0x6e,0x09,0x00,0x6a,0x09,0x01,0x00,0x09,0x01,0x00,
+0x25,0x0a,0x53,0x50,0x50,0x20,0x73,0x6c,0x61,0x76,0x65,0x00,0x00,0x00,0x01,0x00,
+0xaa,0x55,0x02,0x00,0x8e,0x44,0xaf,0x47,0xaa,0x55,0x4e,0x01,0xaf,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,0x41,0x73,0x74,0x20,0x4c,0x45,0x20,0x4d,0x6f,0x75,0x73,0x65,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,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,0xde,0x4b,0x4b,0xba,0x55,0xd0,0x56,0xe0,0x57,0x88,
+0x58,0x6c,0x59,0x10,0x07,0xff,0xff,0xaa,0x55,0x02,0x00,0xc3,0x40,0xde,0x4b,0x55,
+0xaa,0xaa,0x55,0xe1,0xf8,0x99,0x02
+};
Index: patch/patch.prog
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/patch/patch.prog	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/patch/patch.prog	(working copy)
@@ -0,0 +1,1307 @@
+
+
+/******************************************/
+/**************   Start   *****************/
+/******************************************/
+
+p_start:
+	bbit1 8,pf_patch_ext
+	beq patch00_1,p_soft_reset
+	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_1,p_le_slave_dispatch
+	beq patch1e_5,p_le_slave_more_data
+	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 patch20_7,p_le_transmit0
+	beq patch21_0,p_le_send_adv_ind
+	beq patch21_3,p_le_send_scan_response
+	beq patch22_3,p_le_acknowledge
+	beq patch22_4,p_le_check_wak
+	beq patch23_4,p_le_prepare_tx
+	beq patch23_6,p_le_send_packet
+	beq patch23_7,p_le_parse
+	beq patch24_2,p_le_parse_l2cap	
+	beq patch26_2,p_le_lpm_set_mult
+	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 patch31_5,p_le_encrypt
+	beq patch33_1,p_sp_initialize_256
+	branch assert
+
+p_le_slave_dispatch:
+//	bpatch patch1e_1,mem_patch1e
+	set0 mark_buf_full,mark
+	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 p_check_ipcbuf_size,match
+	fetch 1,mem_ipcbuf_bt2m0_flag
+	ncall p_buf_full,blank
+	call le_got_first_packet
+	branch le_slave_match,match
+	bmark1 mark_buf_full,le_slave_match
+	branch le_slave_cont	
+p_buf_full:
+	set1 mark_buf_full,mark
+	disable match
+	rtn
+p_le_slave_more_data:
+//	bpatch patch1e_5,mem_patch1e
+	enable attempt
+	call le_transmit_receive_sifs_notx
+	call p_check_ipcbuf_size,match
+	fetch 1,mem_ipcbuf_bt2m0_flag
+	ncall p_buf_full,blank
+	branch le_slave_match,match
+	bmark1 mark_buf_full,le_slave_match
+	branch le_slave_cont
+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
+	store 2,mem_cb_bb_event_process
+
+	setarg p_module_bb_event_timer
+	store 2,mem_cb_event_timer
+
+	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
+
+	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_process_bb_event:
+	copy regc,pdata
+	beq BT_EVT_SPP_DISCONNECTED,p_module_process_spp_disconnected
+	beq BT_EVT_BB_DISCONNECTED,p_module_process_bb_event_disconned
+	beq BT_EVT_LE_CONNECTED,p_module_process_le_conn
+	beq BT_EVT_SPP_CONNECTED,p_module_process_spp_connected
+	branch module_process_bb_event + 1
+
+p_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 p_module_hci_event_spp_connect
+
+
+p_module_hci_event_spp_connect:
+	jam  HCI_EVENT_SPP_CONN_REP,mem_module_uart_opcode
+	setarg 1
+	call module_hci_prepare_tx
+	fetch 1,mem_ms_channel
+	istore 1,contwu
+	branch uartd_send
+
+p_module_process_bb_event_disconned:
+    	jam 0,mem_module_rfcomm_disconnect_count
+	branch module_process_bb_event_disconned
+
+p_module_process_spp_disconnected:
+	fetch 1,mem_rfcomm_lmp_dis_flag
+	ncall p_set_rfcomm_disconnect_count,blank
+	jam 6,mem_module_rfcomm_disconnect_count
+	branch module_process_spp_disconnected
+p_set_rfcomm_disconnect_count:
+	jam 6,mem_module_rfcomm_disconnect_count
+	rtn
+p_module_process_le_conn:
+	call module_clear_recv_confirm_flag
+	branch module_process_le_conn
+
+
+p_module_bb_event_timer:
+	call p_module_rfcomm_disconnect_timer
+	branch module_bb_event_timer
+	
+	
+
+p_module_rfcomm_disconnect_timer:
+	fetch 1,mem_module_rfcomm_disconnect_count
+	rtn blank
+	increase -1,pdata
+	store 1,mem_module_rfcomm_disconnect_count
+	nrtn blank
+	fetch 2,mem_ui_state_map
+	bbit1 UI_STATE_BT_CONNECTED,app_bt_disconnect
+	rtn
+
+p_module_le_receive_data:
+	call module_check_ble_encrypt_state
+	rtn user
+	copy rega,pdata
+	store 2,mem_module_le_rx_data_address
+	call p_check_ble_40_or_42
+//	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
+	branch module_hci_event_receive_le_data
+	
+p_check_ble_40_or_42:
+	fetch 1,mem_ble_dle_enable
+	nbranch p_check_ble_40,blank
+p_check_ble_42:
+	copy loopcnt,pdata
+	rtn	
+p_check_ble_40:
+	copy regb,pdata
+	rtn
+	
+
+p_module_lpm_lock:
+	call p_le_check_complete_packet
+	nbranch app_get_lpm_wake_lock,user
+	branch module_lpm_lock
+
+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
+	fetcht 2 ,mem_rfcomm_max_frame_size 
+	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_control:
+	fetch 1,mem_module_uart_opcode
+	beq HCI_CMD_SLEEP,p_module_hci_cmd_enter_sleep
+	beq HCI_CMD_SET_PAIRING_REQ,p_module_hci_cmd_set_pairing_mode
+	beq HCI_CMD_DELETE_CUSTOMIZE_SERVICE,module_hci_cmd_delete_customize_service
+	beq HCI_CMD_ADD_SERVICE_UUID,module_hci_cmd_add_service_uuid
+	beq HCI_CMD_ADD_CHARACTERISTIC_UUID,module_hci_cmd_add_characteristic_uuid
+	beq HCI_CMD_SET_COD,module_hci_cmd_le_set_adv_data_set_cod
+	beq HCI_CMD_ALL_ROUND,module_hci_cmd_all_round
+	branch module_hci_cmd_control + 2
+
+
+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
+
+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
+
+module_hci_cmd_le_set_adv_data_set_cod:
+	ifetch 3,contru
+	store 3,mem_class
+	branch module_hci_event_receive_valid_cmd
+	
+module_hci_cmd_all_round:
+	ifetch 1,contru
+	beq 0x00,module_hci_cmd_all_round_write
+	beq 0x01,module_hci_cmd_all_round_read
+	beq 0x02,module_hci_cmd_all_round_write_addhi
+	branch module_hci_event_receive_invalid_cmd
+	
+module_hci_cmd_all_round_read:
+	ifetch 2,contru
+	copy pdata,regb
+	ifetch 1,contru
+	copy pdata,rega
+	arg 0x00,temp
+	branch module_hci_event_set_cmd
+
+module_hci_cmd_all_round_write:
+	ifetch 2,contru
+	copy pdata,contw
+	ifetch 1,contru
+	copy pdata,loopcnt
+	call uart_copy_rx_bytes_fast
+	branch module_hci_event_receive_valid_cmd
+
+module_hci_cmd_all_round_write_addhi:
+	ifetch 1,contru
+	copy pdata,addhi
+	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_le_notify:
+	fetch 1,mem_module_flag
+	bbit1 MODULE_RECEIVE_COMPLETE_PREPARE_WRITE_REQ,p_le_send_att_prepare_write_response
+	fetch 1,mem_module_flag
+	rtnbit1 MODULE_RECV_CONFIRM
+	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_INDICATE,p_module_hci_cmd_transmit_le_indicate
+	bbit1 BIT_CHARACTERISTIC_NOTIFY,module_hci_cmd_transmit_le_notify + 13
+	branch p_module_hci_cmd_transmit_handle_error
+
+p_module_hci_cmd_transmit_le_indicate:
+	call module_set_recv_confirm_flag
+	fetcht 2,mem_module_hci_notify_handle
+	call le_att_malloc_tx_indication
+	branch module_hci_cmd_transmit_le_notify+15
+
+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_init_conn:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_init_conn+1,blank
+
+	call le_init_conn+1
+	jam 1,mem_le_txheader_temp
+	jam 0,mem_le_txlen_temp
+	setarg 0
+	store 8,mem_le_buff_len
+	setarg 27
+	store 2,mem_module_master_rx_max
+	rtn
+
+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_le_transmit:
+	call le_prep
+	call p_letx_setfreq
+	branch le_transmit0
+
+p_letx_setfreq:
+	branch p_txon,match
+	bmark1 mark_buf_full,p_txon
+	branch letx_setfreq+1
+
+p_le_transmit0:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_transmit0+12,blank
+	
+	fetch 1,mem_le_txheader_temp
+	inject mod,8
+	ifetch 1,contr
+	copy pdata,loopcnt
+	inject mod,8
+	branch letr_nopayload,zero
+	branch letr_loop
+
+p_le_send_adv_ind:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_send_adv_ind+1,blank
+
+	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_temp
+	fetcht 1,mem_le_adv_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen_temp
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload_temp
+	copy temp,loopcnt
+	arg mem_le_adv_data,contr
+	call memcpy_fast
+	branch le_send_adv_transmit
+
+
+p_le_send_scan_response:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_send_scan_response+1,blank
+
+	arg SCAN_RSP,temp
+	fetch 1,mem_le_adv_own_addr_type
+	nsetflag blank,LE_SENDER_ADDR_BIT,temp
+	storet 1,mem_le_txheader_temp
+	fetcht 1,mem_le_scan_data_len
+	add temp,6,pdata
+	store 1,mem_le_txlen_temp
+	fetch 6,mem_le_lap
+	store 6,mem_le_txpayload_temp
+	arg mem_le_scan_data,contr
+	copy temp,loopcnt
+	call memcpy_fast
+	call le_transmit_norx
+	branch le_adv_not_match
+
+p_le_acknowledge:
+	call le_supervision_flush
+	rtnmark1 mark_buf_full
+	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 p_le_ack_unenc,blank		/* empty packet, no decryption */
+	fetch 1,mem_le_state
+	bbit0 lestate_encryption,p_le_ack_unenc
+	call load_sk
+	call le_decrypt
+	nsetflag blank,mark_old_packet,mark
+	nrtn blank
+p_le_ack_unenc:
+	fetcht 1,mem_le_arq
+	setflip nesn,temp
+	storet 1,mem_le_arq
+
+	fetch 1,mem_ble_dle_enable
+	nrtn blank
+
+	branch p_le_parse_writing_attribute
+
+p_le_parse_writing_attribute:
+	fetch 1,mem_le_rxbuf+1
+	rtn blank		//empty packet
+	fetch 1,mem_le_rxbuf
+	compare 1,pdata,3
+	branch p_le_parse_writing_attribute_continue,true //ACL-U continue
+	compare 2,pdata,3
+	branch p_le_parse_writing_attribute_start,true
+	rtn
+
+p_le_parse_writing_attribute_start:
+	fetch 2,mem_le_rxbuf+4//CID
+	rtnne LE_L2CAP_CID_ATT
+	ifetch 3,contr
+	store 3,mem_le_att_opcode
+	set1 mark_old_packet,mark
+	beq ATTOP_WRITE_REQUEST,p_le_parse_att_write_request
+	beq ATTOP_WRITE_COMMAND,p_le_parse_att_write_command
+	beq ATTOP_PREPARE_WRITE_REQUEST,p_le_parse_att_prepare_write_request
+	beq ATTOP_EXECUTE_WRITE_REQUEST,le_parse_att_execute_write_request
+	beq ATTOP_EXCHANGE_MTU_REQUEST,le_parse_att_exchange_mtu_request
+	beq ATTOP_HANDLE_VALUE_CONFIRMATION,p_le_parse_handle_value_confirmation
+	set0 mark_old_packet,mark
+	rtn
+
+p_le_parse_att_prepare_write_request:
+	setarg mem_module_prepare_write_request_packet
+	store 2,mem_module_prepare_write_request_contw
+	call p_le_long_packet_patch
+	increase -2,loopcnt			//attribute value offset
+	arg mem_le_rxbuf+11,rega
+	call le_writeatt_cb
+	branch p_le_parse_att_prepare_write_request_finish
+
+	
+p_le_parse_att_write_request:
+	call p_le_parse_att_write_command
+	branch p_le_send_att_write_response_check_auth
+
+
+p_le_parse_att_write_command:
+	call p_le_long_packet_patch
+	arg mem_le_rxbuf+9,rega
+	branch le_writeatt_cb
+
+
+p_le_long_packet_patch:
+	fetch 1,mem_le_rxbuf+1
+	add pdata,-7,loopcnt
+	increase -4,pdata
+	store 2,mem_le_buff_len	//payload length
+	ifetcht 2,contr		//l2cap length
+	storet 2,mem_le_buff_len_all
+	rtn
+
+
+p_le_parse_writing_attribute_continue:
+	set1 mark_old_packet,mark
+	call p_parse_l2cap_continue_common
+	fetch 1,mem_le_att_opcode
+	beq ATTOP_WRITE_REQUEST,p_parse_l2cap_continue_write_request
+	beq ATTOP_PREPARE_WRITE_REQUEST,p_parse_l2cap_continue_prepare_write_request
+	rtneq ATTOP_WRITE_COMMAND
+	set0 mark_old_packet,mark
+	rtn
+
+p_parse_l2cap_continue_write_common:
+p_parse_l2cap_continue_common:
+	fetch 1,mem_le_rxbuf+1
+	fetcht 2,mem_le_buff_len
+	iadd temp,temp
+	storet 2,mem_le_buff_len
+	copy pdata,loopcnt
+	arg mem_le_rxbuf+2,rega
+	branch le_writeatt_cb
+
+p_parse_l2cap_continue_prepare_write_request:
+	branch p_le_parse_att_prepare_write_request_finish
+
+p_parse_l2cap_continue_write_request:
+p_le_send_att_write_response_check_auth:
+	call p_le_check_complete_packet
+	nrtn user
+	branch le_send_att_write_response_check_auth
+
+//enable user,recevie complete packet
+p_le_check_complete_packet:
+	call disable_user
+	fetch 2,mem_le_buff_len_all
+	fetcht 2,mem_le_buff_len
+	isub temp,null
+	nrtn zero
+	branch enable_user
+
+p_le_parse_att_prepare_write_request_finish:
+	fetch 2,mem_module_prepare_write_request_contw
+	copy pdata,contw
+
+	fetch 1,mem_le_rxbuf+1	//payload length
+	copy pdata,loopcnt
+	call memcpy
+	copy contw,pdata
+	store 2,mem_module_prepare_write_request_contw
+
+	call p_le_check_complete_packet
+	nrtn user
+	arg MODULE_RECEIVE_COMPLETE_PREPARE_WRITE_REQ,queue
+	call module_set_state
+	branch p_le_send_att_prepare_write_response
+
+
+p_le_send_att_prepare_write_response:
+	call le_fifo_check_empty
+	nrtn blank
+	jam ATTOP_PREPARE_WRITE_RESPONSE,mem_module_prepare_write_request_opcode
+	setarg mem_module_prepare_write_request_packet
+	store 2,mem_module_prepare_write_request_contr
+	fetcht 2,mem_module_prepare_write_request_PDU_length
+	increase 4,temp
+	setarg LE_BASEBAND_MAX_BUFFER
+	call not_greater_than
+	add pdata,-4,regb
+	force LLID_START,type
+p_le_send_att_prepare_write_response_continue:
+	copy pdata,rega
+	call le_fifo_malloc_tx + 2
+	fetch 2,mem_module_prepare_write_request_contr
+	copy pdata,contr
+	copy rega,loopcnt
+	call memcpy_fast
+	copy contr,pdata
+	store 2,mem_module_prepare_write_request_contr
+	fetch 2,mem_module_prepare_write_request_PDU_length
+	isub regb,pdata
+	store 2,mem_module_prepare_write_request_PDU_length
+	branch p_le_send_att_prepare_write_response_ending,blank
+	arg LE_BASEBAND_MAX_BUFFER,temp
+	call not_greater_than
+	copy pdata,regb
+	force LLID_CONTINUE,type
+	branch p_le_send_att_prepare_write_response_continue
+
+p_le_send_att_prepare_write_response_ending:
+	setarg 0
+	store 2,mem_module_prepare_write_request_contw
+	arg MODULE_RECEIVE_COMPLETE_PREPARE_WRITE_REQ,queue
+	branch module_clr_state
+
+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_check_wak:	
+//	call p_check_ipcbuf_size
+	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
+p_le_check_wak_1:
+	storet 1,mem_le_arq
+	compare 3,temp,3
+	nrtn true
+
+	fetch 1,mem_ble_dle_enable
+	nbranch  le_check_wak_2,blank
+	
+	fetch 1,mem_le_txpayload_temp
+	branch le_check_wak_3
+le_check_wak_2:
+	fetch 1,mem_le_txpayload
+le_check_wak_3:
+	beq LL_START_ENC_REQ,le_set_enc
+	fetch 1,mem_le_enc_state
+	beq FLAG_LE_ENC_PAUSE,le_clear_enc
+	rtn
+
+p_le_prepare_tx:
+	fetch 1,mem_le_arq
+	rtnbit1 wak
+	call le_check_tx_md
+
+
+	fetch 1,mem_ble_dle_enable
+	nbranch le_prepare_tx+4,blank
+	
+	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
+	call p_le_get_master_rx_max
+	call not_greater_than
+	copy pdata,temp
+	ifetch 1,contr
+	copy pdata,type
+	copy rega,pdata
+	iadd contr,contr
+	arg mem_le_txpayload_temp,contw
+	copy temp,loopcnt
+	call memcpy_fast
+	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
+	call p_le_get_master_rx_max
+	call not_greater_than
+	iadd regb,pdata
+	istore 1,regc
+	isub rega,null
+	nrtn zero
+	branch le_fifo_release_first_node
+
+
+p_le_get_master_rx_max:
+	copy contr,contw
+	fetcht 2,mem_module_master_rx_max
+	copy contw,contr
+	rtn
+
+p_le_send_packet:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_send_packet+1,blank
+
+	storet 1,mem_le_txlen_temp
+	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_temp
+
+	fetch 1,mem_le_txheader_temp
+	compare 1,type,3
+	nbranch p_le_send_no_txlen,true
+	fetch 1,mem_le_txlen_temp
+	rtn blank
+p_le_send_no_txlen:
+	fetch 1,mem_le_state
+	rtnbit0 lestate_encryption
+	call load_sk
+	branch le_encrypt
+
+p_le_encrypt:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_encrypt+1,blank
+
+	arg mem_le_txheader_temp,regc
+	fetcht 5,mem_le_pcnt_tx
+	call generate_mic
+	force regidx_xor,regext_index
+	iforce regext
+	force 0,rega					/* rega is block counter */
+	call first_block_data
+	call aes_init				// 1021s ->  do_aes_ctr
+	arg mem_le_txpayload_temp,regc
+	fetch 1,mem_le_txlen_temp
+	add pdata,-1,regb
+	iadd regc,contw
+	force regidx_result,regext_index
+	deposit regext
+	istore 4,contw	
+	call aes_crypt_data
+	fetch 1,mem_le_txlen_temp
+	increase 4,pdata
+	store 1,mem_le_txlen_temp
+	fetcht 5,mem_le_pcnt_tx
+	increase 1,temp
+	storet 5,mem_le_pcnt_tx
+	rtn
+
+p_le_parse:
+	rtnmark1 mark_old_packet
+	rtnmark1 mark_buf_full
+	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,p_le_parse_ll
+	call p_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_check_l2cap_complete:
+	fetch 1,mem_le_packet_llid
+	beq LLID_START,p_le_check_l2cap_llid_start
+	beq LLID_CONTINUE,p_le_check_l2cap_llid_continue
+	rtn
+	
+p_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_new,contw
+	fetch 2,mem_le_payload_ptr
+	copy pdata,contr
+	call memcpy
+	branch disable_user
+	
+p_le_check_l2cap_llid_continue:
+	call le_check_l2cap_continue_legal
+	nrtn user
+	fetch 1,mem_le_packet_len_recved
+	arg mem_le_l2capbuf_new,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_new
+	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
+
+
+p_le_parse_ll:
+//	fetch 1,mem_ble_dle_enable
+//	nbranch le_parse_ll,blank
+	fetch 1,mem_le_rxbuf+2
+	beq LL_FEATURE_REQ,p_le_parse_feature_req
+	beq LL_LENGTH_REQ,le_parse_length_request
+	branch le_parse_ll+1
+	
+p_le_parse_feature_req:
+p_le_send_feature_rsp:
+	arg 9,rega
+	arg LL_FEATURE_RSP,regb
+	call le_fifo_malloc_tx_ll
+	//bit0 LE encryption
+	//bit5 LE Data packet Length extension
+	setarg 0x21	
+	istore 8,contw
+	call p_check_ble_dle_enable
+	rtn
+p_check_ble_dle_enable:
+	fetch 1,mem_le_rxbuf+3
+	and pdata,0x20,pdata
+	branch p_set_ble_dle_disable,blank
+	jam DLE_ENABLE,mem_ble_dle_enable
+	rtn
+p_set_ble_dle_disable:
+	jam DLE_DISABLE,mem_ble_dle_enable
+	rtn
+
+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 251
+	istore 2,contw
+	//MaxRxTime >=328ms <=2120
+	setarg 2120
+	istore 2,contw
+	//MaxTxOctets >=27B
+	setarg 251
+	istore 2,contw
+	//MaxTxTime >=328ms
+	setarg 2120
+	istore 2,contw
+	rtn
+
+
+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_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
+	branch le_parse_att+2
+
+p_le_parse_handle_value_confirmation:
+module_clear_recv_confirm_flag:
+	arg MODULE_RECV_CONFIRM,queue
+	branch module_clr_state
+
+p_le_parse_att_read_by_group_type_request:
+	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_parse_att_exchange_mtu_response
+	store 2,mem_le_local_mtu
+	branch le_send_att_exchange_mtu_response
+
+p_le_parse_att_read_by_type_request:
+	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_lpm_set_mult:
+	fetch 1,mem_ble_dle_enable
+	nbranch le_lpm_set_mult+1,blank
+	
+	disable wake
+	branch p_le_lpm_set_mult_attempt,attempt
+	nbranch le_lpm_lost,match
+p_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_temp
+	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
+
+
+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
+
+
+
Index: sched/109x.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/sched/109x.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/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_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: sched/DM_module.dat
===================================================================
--- /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/sched/DM_module.dat	(nonexistent)
+++ /YC3121_demo/ModuleDemo/BlueTooth/BT_code_patch/print/branches/mfi/sched/DM_module.dat	(working copy)
@@ -0,0 +1,395 @@
+
+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:05
+#####################################
+
+##############SPP CONFIG##############
+mem_credit_flag:01
+mem_rfcomm_max_frame_size:7f 00 
+mem_rfcomm_credit_init_data:03
+#####################################
+
+##############SSP CONFIG##############
+mem_sp_iocap_local:03 00 04
+mem_ssp_enable:01
+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:00 4C
+4FFA:E0 4F
+4FFC:00 4C
+4FFE:00 4C
+#####################################
+mem_2m0_tmier_address: 00 80 02#0x28000
+
+##############BLUETOOTH CONFIG##############
+###commom###
+mem_soft_version_num:10 0b
+mem_module_state:03
+mem_module_bluetooth_stauts_by_command:07
+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_rfcomm_lmp_dis_flag:00
+# 1: tianyu    MPOS
+# 0: wobosi  printer
+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:a7 2a 2a 21 10 55
+mem_local_name_length:
+'YC3xxx 
+
+###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:01
+mem_le_adv_channel_map:07
+mem_le_pairing_mode:00
+
+mem_module_data_write_handle:2d 00
+mem_module_data_write_handle2:2f 00
+
+
+mem_le_adv_enable:00
+mem_le_adv_interval:40 00
+mem_module_le_lpm_mult:05
+mem_le_lap:21 22 01 33 02 3a
+mem_le_name_len:
+'3121 Mou Ble
+
+mem_le_adv_data_len:03
+mem_le_adv_data:
+02 01 0e
+
+mem_le_scan_data_len:0e
+
+mem_le_scan_data:# 1 byte length + 1 byte type + N bytes data
+02 01 02
+'\093121 Mou Ble
+
+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:f0
+mem_le_remote_mtu:17
+
+mem_le_pairing_handle:31 00
+
+#####################################
+
+
+mem_eir_enable:01
+mem_all_uuid_16bits: 
+05
+03#Type: Complete list of 16-bit UUIDs
+0012 0001 0100 0111 0300 
+
+mem_all_uuid_128bits:
+01
+07
+00000000decafadedecadeafdecacaff
+
+
+mem_ui_uuid_table:mem_module_uuid_list
+
+mem_module_uuid_list:
+03
+12
+00
+01
+00
+00
+01
+00
+01
+00
+01
+36
+00
+52
+09
+00
+00
+0a
+00
+01
+00
+01
+09
+00
+01
+35
+03
+19
+12
+00
+09
+00
+04
+35
+0d
+35
+06
+19
+01
+00
+09
+00
+01
+35
+03
+19
+00
+01
+09
+00
+09
+35
+08
+35
+06
+19
+12
+00
+09
+01
+00
+09
+02
+00
+09
+01
+03
+09
+02
+01
+09
+05
+ac
+09
+02
+02
+09
+02
+39
+09
+02
+03
+09
+06
+44
+09
+02
+04
+28
+01
+09
+02
+05
+09
+00
+02
+
+02
+0100 0001
+0001000d
+36 00 58 09 00 00 0A 00 
+01 00 0D 09 00 01 35 
+11 1C 00 00 00 00 DE 
+CA FA DE DE CA DE AF 
+DE CA CA FF 09 00 04 
+35 0C 35 03 19 01 00 
+35 05 19 00 03 08 0F 
+09 00 05 35 03 19 10 
+02 09 00 08 08 FF 09 
+00 09 35 08 35 06 19 
+11 01 09 01 00 09 01 
+00 25 0A 41 70 70 6C 
+65 20 49 6E 63 2E
+
+03
+11
+01
+00
+03
+01
+00
+00
+01
+00
+03
+36
+00
+46
+09
+00
+00
+0a
+00
+01
+00
+03
+09
+00
+01
+35
+03
+19
+11
+01
+09
+00
+02
+0a
+00
+00
+00
+00
+09
+00
+04
+35
+0c
+35
+03
+19
+01
+00
+35
+05
+19
+00
+03
+08
+01
+09
+00
+06
+35
+09
+09
+65
+6e
+09
+00
+6a
+09
+01
+00
+09
+01
+00
+25
+0a
+53
+50
+50
+20
+73
+6c
+61
+76
+65
+00
+00
+00
+01
+00
+
+
+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 4e
+07 00 02 00 2a 13 41 73 74 20 4c 45 20 4d 6f 75 73 65 20 20 20 20 20 20 20
+
+#Apperance
+08 00 02 03 28 01 4e
+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 20 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 12
+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
+
+
