; generated by Component: ARM Compiler 5.05 update 2 (build 169) Tool: ArmCC [4d0f38]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\mico_mdns.o --asm_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --list_dir=..\..\..\..\Build\demo\MICO-Fire_F429\list_RVMDK\ --depend=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\mico_mdns.d --cpu=Cortex-M4.fp --apcs=interwork -O0 --diag_suppress=9931,1,1293 -I..\..\..\..\Board\fire_F429 -I..\..\..\..\Demos\fire\ov2640 -I..\..\..\..\include -I..\..\..\..\libraries\utilities -I..\..\..\..\libraries\utilities\json_c -I..\..\..\..\MICO\core -I..\..\..\..\MICO\security -I..\..\..\..\MICO\system -I..\..\..\..\MICO\system\command_console -I..\..\..\..\Platform\include -I..\..\..\..\Platform\Cortex-M4 -I..\..\..\..\Platform\Cortex-M4\CMSIS -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\..\..\Platform\MCU\STM32F4xx\peripherals\Libraries -I..\..\..\..\Platform\MCU\STM32F4xx\wlan_bus_driver -I..\..\..\..\Platform\Drivers\spi_flash -I..\..\..\..\Platform\Drivers -I..\..\..\..\libraries\daemons\homekit_server -I..\..\..\..\libraries\daemons\http_server -I..\..\..\..\Platform\Drivers\malloc -I..\..\..\..\Platform\Drivers\SDRAM -I..\..\..\..\Platform\Drivers\ov5640 -IG:\GIT_OSC\STM32_develop\F429-V2\develop\6-WIFI\STM32-WiFi\3.wifi_ov5640\Projects\STM32F429\demo\RVMDK\RTE -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0 -D__UVISION_VERSION=515 -DSTM32F429xx -DUSE_STDPERIPH_DRIVER -DDEBUG -DHSE_VALUE=25000000 -DOV5640 --omf_browse=..\..\..\..\build\demo\mico-fire_f429\obj_rvmdk\mico_mdns.crf ..\..\..\..\MICO\system\mdns\mico_mdns.c]
                          THUMB

                          AREA ||i.BonjourNotify_SYSWillPoerOffHandler||, CODE, READONLY, ALIGN=1

                  BonjourNotify_SYSWillPoerOffHandler PROC
;;;758    
;;;759    void BonjourNotify_SYSWillPoerOffHandler( void *arg )
000000  b510              PUSH     {r4,lr}
;;;760    {
000002  4604              MOV      r4,r0
;;;761        UNUSED_PARAMETER(arg);  
;;;762        mdns_suspend_record( NULL, Station, true );
000004  2201              MOVS     r2,#1
000006  4611              MOV      r1,r2
000008  2000              MOVS     r0,#0
00000a  f7fffffe          BL       mdns_suspend_record
;;;763        mdns_suspend_record( NULL, Soft_AP, true );
00000e  2201              MOVS     r2,#1
000010  2100              MOVS     r1,#0
000012  4608              MOV      r0,r1
000014  f7fffffe          BL       mdns_suspend_record
;;;764    }
000018  bd10              POP      {r4,pc}
;;;765    
                          ENDP


                          AREA ||i.BonjourNotify_WifiStatusHandler||, CODE, READONLY, ALIGN=1

                  BonjourNotify_WifiStatusHandler PROC
;;;736    
;;;737    void BonjourNotify_WifiStatusHandler( WiFiEvent event, void *arg )
000000  b570              PUSH     {r4-r6,lr}
;;;738    {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
;;;739      UNUSED_PARAMETER(arg);  
;;;740      switch (event) {
000006  2c01              CMP      r4,#1
000008  d006              BEQ      |L2.24|
00000a  2c02              CMP      r4,#2
00000c  d009              BEQ      |L2.34|
00000e  2c03              CMP      r4,#3
000010  d00d              BEQ      |L2.46|
000012  2c04              CMP      r4,#4
000014  d116              BNE      |L2.68|
000016  e00f              B        |L2.56|
                  |L2.24|
;;;741      case NOTIFY_STATION_UP:
;;;742        mdns_resume_record( NULL, Station );
000018  2101              MOVS     r1,#1
00001a  2000              MOVS     r0,#0
00001c  f7fffffe          BL       mdns_resume_record
;;;743        break;
000020  e011              B        |L2.70|
                  |L2.34|
;;;744      case NOTIFY_STATION_DOWN:
;;;745        mdns_suspend_record( NULL, Station, false );
000022  2200              MOVS     r2,#0
000024  2101              MOVS     r1,#1
000026  4610              MOV      r0,r2
000028  f7fffffe          BL       mdns_suspend_record
;;;746        break;
00002c  e00b              B        |L2.70|
                  |L2.46|
;;;747      case NOTIFY_AP_UP:
;;;748        mdns_resume_record( NULL, Soft_AP );
00002e  2100              MOVS     r1,#0
000030  4608              MOV      r0,r1
000032  f7fffffe          BL       mdns_resume_record
;;;749        break;
000036  e006              B        |L2.70|
                  |L2.56|
;;;750      case NOTIFY_AP_DOWN:
;;;751        mdns_suspend_record( NULL, Soft_AP, false );
000038  2200              MOVS     r2,#0
00003a  4611              MOV      r1,r2
00003c  4610              MOV      r0,r2
00003e  f7fffffe          BL       mdns_suspend_record
;;;752        break;
000042  e000              B        |L2.70|
                  |L2.68|
;;;753      default:
;;;754        break;
000044  bf00              NOP      
                  |L2.70|
000046  bf00              NOP                            ;743
;;;755      }
;;;756      return;
;;;757    }
000048  bd70              POP      {r4-r6,pc}
;;;758    
                          ENDP


                          AREA ||i._bonjour_send_anounce_thread||, CODE, READONLY, ALIGN=2

                  _bonjour_send_anounce_thread PROC
;;;496    
;;;497    void _bonjour_send_anounce_thread(void *arg)
000000  b570              PUSH     {r4-r6,lr}
;;;498    {
000002  4605              MOV      r5,r0
;;;499      uint32_t insert_index = 0xFF;
000004  24ff              MOVS     r4,#0xff
;;;500      UNUSED_PARAMETER( arg );
;;;501    
;;;502      while(1){
000006  e01d              B        |L3.68|
                  |L3.8|
;;;503        insert_index = 0xFF;
000008  24ff              MOVS     r4,#0xff
;;;504        for ( int i = 0; i < available_service_count; i++ ){
00000a  2000              MOVS     r0,#0
00000c  e00c              B        |L3.40|
                  |L3.14|
;;;505          if( available_services[i].state != RECORD_REMOVED && available_services[i].count_down != 0 ){
00000e  4911              LDR      r1,|L3.84|
000010  eb011140          ADD      r1,r1,r0,LSL #5
000014  7fc9              LDRB     r1,[r1,#0x1f]
000016  b131              CBZ      r1,|L3.38|
000018  490e              LDR      r1,|L3.84|
00001a  eb011140          ADD      r1,r1,r0,LSL #5
00001e  7f89              LDRB     r1,[r1,#0x1e]
000020  b109              CBZ      r1,|L3.38|
;;;506            insert_index = i;
000022  4604              MOV      r4,r0
;;;507            break;
000024  e004              B        |L3.48|
                  |L3.38|
000026  1c40              ADDS     r0,r0,#1              ;504
                  |L3.40|
000028  490b              LDR      r1,|L3.88|
00002a  7809              LDRB     r1,[r1,#0]            ;504  ; available_service_count
00002c  4288              CMP      r0,r1                 ;504
00002e  dbee              BLT      |L3.14|
                  |L3.48|
000030  bf00              NOP      
;;;508          }
;;;509        }  
;;;510    
;;;511        if( insert_index == 0xFF )
000032  2cff              CMP      r4,#0xff
000034  d100              BNE      |L3.56|
;;;512          goto exit;
000036  e006              B        |L3.70|
                  |L3.56|
;;;513        
;;;514        mdns_utils_log( "sem trigger" );
;;;515        mico_rtos_set_semaphore( &update_state_sem );
000038  4808              LDR      r0,|L3.92|
00003a  f7fffffe          BL       mico_rtos_set_semaphore
;;;516        mico_thread_msleep(200);
00003e  20c8              MOVS     r0,#0xc8
000040  f7fffffe          BL       msleep
                  |L3.68|
000044  e7e0              B        |L3.8|
                  |L3.70|
;;;517      }
;;;518      
;;;519    exit:
;;;520      _bonjour_announce_handler = NULL;
000046  2000              MOVS     r0,#0
000048  4905              LDR      r1,|L3.96|
00004a  6008              STR      r0,[r1,#0]  ; _bonjour_announce_handler
;;;521      mico_rtos_delete_thread( NULL );
00004c  f7fffffe          BL       mico_rtos_delete_thread
;;;522      return;
;;;523    }
000050  bd70              POP      {r4-r6,pc}
;;;524    
                          ENDP

000052  0000              DCW      0x0000
                  |L3.84|
                          DCD      available_services
                  |L3.88|
                          DCD      available_service_count
                  |L3.92|
                          DCD      update_state_sem
                  |L3.96|
                          DCD      _bonjour_announce_handler

                          AREA ||i._bonjour_thread||, CODE, READONLY, ALIGN=2

                  _bonjour_thread PROC
;;;810    
;;;811    void _bonjour_thread(void *arg)
000000  b08c              SUB      sp,sp,#0x30
;;;812    {
;;;813      int i, con = -1;
000002  f04f35ff          MOV      r5,#0xffffffff
;;;814      struct timeval_t t;
;;;815      fd_set readfds;
;;;816      struct sockaddr_t addr;
;;;817      socklen_t addrLen;
;;;818      //OSStatus err = kNoErr;
;;;819      UNUSED_PARAMETER( arg );
;;;820    
;;;821      t.tv_sec = 1;
000006  2001              MOVS     r0,#1
000008  900a              STR      r0,[sp,#0x28]
;;;822      t.tv_usec = 0;
00000a  2000              MOVS     r0,#0
00000c  900b              STR      r0,[sp,#0x2c]
;;;823      
;;;824      while(1) {
00000e  e0d1              B        |L4.436|
                  |L4.16|
;;;825        /*Check status on erery sockets on bonjour query */
;;;826        FD_ZERO(&readfds);
000010  2000              MOVS     r0,#0
000012  9009              STR      r0,[sp,#0x24]
;;;827        FD_SET(mDNS_fd, &readfds);
000014  4868              LDR      r0,|L4.440|
000016  6800              LDR      r0,[r0,#0]  ; mDNS_fd
000018  0940              LSRS     r0,r0,#5
00001a  a909              ADD      r1,sp,#0x24
00001c  f8510020          LDR      r0,[r1,r0,LSL #2]
000020  4965              LDR      r1,|L4.440|
000022  7809              LDRB     r1,[r1,#0]  ; mDNS_fd
000024  f001021f          AND      r2,r1,#0x1f
000028  2101              MOVS     r1,#1
00002a  4091              LSLS     r1,r1,r2
00002c  4308              ORRS     r0,r0,r1
00002e  4962              LDR      r1,|L4.440|
000030  6809              LDR      r1,[r1,#0]  ; mDNS_fd
000032  0949              LSRS     r1,r1,#5
000034  aa09              ADD      r2,sp,#0x24
000036  f8420021          STR      r0,[r2,r1,LSL #2]
;;;828        FD_SET(update_state_fd, &readfds);
00003a  4860              LDR      r0,|L4.444|
00003c  6800              LDR      r0,[r0,#0]  ; update_state_fd
00003e  0940              LSRS     r0,r0,#5
000040  a909              ADD      r1,sp,#0x24
000042  f8510020          LDR      r0,[r1,r0,LSL #2]
000046  495d              LDR      r1,|L4.444|
000048  7809              LDRB     r1,[r1,#0]  ; update_state_fd
00004a  f001021f          AND      r2,r1,#0x1f
00004e  2101              MOVS     r1,#1
000050  4091              LSLS     r1,r1,r2
000052  4308              ORRS     r0,r0,r1
000054  4959              LDR      r1,|L4.444|
000056  6809              LDR      r1,[r1,#0]  ; update_state_fd
000058  0949              LSRS     r1,r1,#5
00005a  aa09              ADD      r2,sp,#0x24
00005c  f8420021          STR      r0,[r2,r1,LSL #2]
;;;829        select(mDNS_fd + 1, &readfds, NULL, NULL, &t);
000060  a80a              ADD      r0,sp,#0x28
000062  2300              MOVS     r3,#0
000064  461a              MOV      r2,r3
000066  a909              ADD      r1,sp,#0x24
000068  9000              STR      r0,[sp,#0]
00006a  4853              LDR      r0,|L4.440|
00006c  6800              LDR      r0,[r0,#0]  ; mDNS_fd
00006e  1c40              ADDS     r0,r0,#1
000070  f7fffffe          BL       select
;;;830    
;;;831        if ( FD_ISSET( update_state_fd, &readfds ) ){ 
000074  4851              LDR      r0,|L4.444|
000076  6800              LDR      r0,[r0,#0]  ; update_state_fd
000078  0940              LSRS     r0,r0,#5
00007a  a909              ADD      r1,sp,#0x24
00007c  f8510020          LDR      r0,[r1,r0,LSL #2]
000080  494e              LDR      r1,|L4.444|
000082  7809              LDRB     r1,[r1,#0]  ; update_state_fd
000084  f001021f          AND      r2,r1,#0x1f
000088  2101              MOVS     r1,#1
00008a  4091              LSLS     r1,r1,r2
00008c  4008              ANDS     r0,r0,r1
00008e  2800              CMP      r0,#0
000090  d067              BEQ      |L4.354|
;;;832          mdns_utils_log( "sem recved" );
;;;833          mico_rtos_get_semaphore( &update_state_sem, 0 );
000092  2100              MOVS     r1,#0
000094  484a              LDR      r0,|L4.448|
000096  f7fffffe          BL       mico_rtos_get_semaphore
;;;834          mico_rtos_lock_mutex( &bonjour_mutex );
00009a  484a              LDR      r0,|L4.452|
00009c  f7fffffe          BL       mico_rtos_lock_mutex
;;;835          for ( i = 0; i < available_service_count; i++ ){
0000a0  2400              MOVS     r4,#0
0000a2  e057              B        |L4.340|
                  |L4.164|
;;;836            switch ( available_services[i].state ){
0000a4  4848              LDR      r0,|L4.456|
0000a6  eb001044          ADD      r0,r0,r4,LSL #5
0000aa  7fc0              LDRB     r0,[r0,#0x1f]
0000ac  2801              CMP      r0,#1
0000ae  d037              BEQ      |L4.288|
0000b0  2802              CMP      r0,#2
0000b2  d002              BEQ      |L4.186|
0000b4  2803              CMP      r0,#3
0000b6  d14a              BNE      |L4.334|
0000b8  e01b              B        |L4.242|
                  |L4.186|
;;;837              case RECORD_REMOVE: 
;;;838                mdns_utils_log( "Remove record %d", i );
;;;839                bonjour_send_record( i );
0000ba  4620              MOV      r0,r4
0000bc  f7fffffe          BL       bonjour_send_record
;;;840                available_services[i].count_down--;
0000c0  4841              LDR      r0,|L4.456|
0000c2  eb001044          ADD      r0,r0,r4,LSL #5
0000c6  7f80              LDRB     r0,[r0,#0x1e]
0000c8  1e40              SUBS     r0,r0,#1
0000ca  493f              LDR      r1,|L4.456|
0000cc  eb011144          ADD      r1,r1,r4,LSL #5
0000d0  7788              STRB     r0,[r1,#0x1e]
;;;841                if( available_services[i].count_down == 0){
0000d2  483d              LDR      r0,|L4.456|
0000d4  eb001044          ADD      r0,r0,r4,LSL #5
0000d8  7f80              LDRB     r0,[r0,#0x1e]
0000da  b948              CBNZ     r0,|L4.240|
;;;842                  _clean_record_resource( &available_services[i] );
0000dc  493a              LDR      r1,|L4.456|
0000de  eb011044          ADD      r0,r1,r4,LSL #5
0000e2  f7fffffe          BL       _clean_record_resource
;;;843                  available_services[i].state = RECORD_REMOVED;
0000e6  2000              MOVS     r0,#0
0000e8  4937              LDR      r1,|L4.456|
0000ea  eb011144          ADD      r1,r1,r4,LSL #5
0000ee  77c8              STRB     r0,[r1,#0x1f]
                  |L4.240|
;;;844                }
;;;845                break;
0000f0  e02e              B        |L4.336|
                  |L4.242|
;;;846              case RECORD_SUSPEND:
;;;847                if( available_services[i].count_down ){
0000f2  4835              LDR      r0,|L4.456|
0000f4  eb001044          ADD      r0,r0,r4,LSL #5
0000f8  7f80              LDRB     r0,[r0,#0x1e]
0000fa  b180              CBZ      r0,|L4.286|
;;;848                  mdns_utils_log( "Suspend record %d", i );
;;;849                  bonjour_send_record( i );
0000fc  4620              MOV      r0,r4
0000fe  f7fffffe          BL       bonjour_send_record
;;;850                  if( available_services[i].count_down )
000102  4831              LDR      r0,|L4.456|
000104  eb001044          ADD      r0,r0,r4,LSL #5
000108  7f80              LDRB     r0,[r0,#0x1e]
00010a  b140              CBZ      r0,|L4.286|
;;;851                    available_services[i].count_down--;       
00010c  482e              LDR      r0,|L4.456|
00010e  eb001044          ADD      r0,r0,r4,LSL #5
000112  7f80              LDRB     r0,[r0,#0x1e]
000114  1e40              SUBS     r0,r0,#1
000116  492c              LDR      r1,|L4.456|
000118  eb011144          ADD      r1,r1,r4,LSL #5
00011c  7788              STRB     r0,[r1,#0x1e]
                  |L4.286|
;;;852                }
;;;853                break;
00011e  e017              B        |L4.336|
                  |L4.288|
;;;854              case RECORD_UPDATE:
;;;855                mdns_utils_log( "Update record %d, cd: %d", i, available_services[i].count_down );
;;;856                bonjour_send_record( i );
000120  4620              MOV      r0,r4
000122  f7fffffe          BL       bonjour_send_record
;;;857                available_services[i].count_down--;
000126  4828              LDR      r0,|L4.456|
000128  eb001044          ADD      r0,r0,r4,LSL #5
00012c  7f80              LDRB     r0,[r0,#0x1e]
00012e  1e40              SUBS     r0,r0,#1
000130  4925              LDR      r1,|L4.456|
000132  eb011144          ADD      r1,r1,r4,LSL #5
000136  7788              STRB     r0,[r1,#0x1e]
;;;858                if( available_services[i].count_down == 0)
000138  4823              LDR      r0,|L4.456|
00013a  eb001044          ADD      r0,r0,r4,LSL #5
00013e  7f80              LDRB     r0,[r0,#0x1e]
000140  b920              CBNZ     r0,|L4.332|
;;;859                  available_services[i].state = RECORD_NORMAL;
000142  2004              MOVS     r0,#4
000144  4920              LDR      r1,|L4.456|
000146  eb011144          ADD      r1,r1,r4,LSL #5
00014a  77c8              STRB     r0,[r1,#0x1f]
                  |L4.332|
;;;860                break;
00014c  e000              B        |L4.336|
                  |L4.334|
;;;861              default:
;;;862                break;
00014e  bf00              NOP      
                  |L4.336|
000150  bf00              NOP                            ;845
000152  1c64              ADDS     r4,r4,#1              ;835
                  |L4.340|
000154  481d              LDR      r0,|L4.460|
000156  7800              LDRB     r0,[r0,#0]            ;835  ; available_service_count
000158  4284              CMP      r4,r0                 ;835
00015a  dba3              BLT      |L4.164|
;;;863            }
;;;864          }
;;;865          mico_rtos_unlock_mutex( &bonjour_mutex );
00015c  4819              LDR      r0,|L4.452|
00015e  f7fffffe          BL       mico_rtos_unlock_mutex
                  |L4.354|
;;;866        }
;;;867        
;;;868        /*Read data from udp and send data back */ 
;;;869        if (FD_ISSET(mDNS_fd, &readfds)) {
000162  4815              LDR      r0,|L4.440|
000164  6800              LDR      r0,[r0,#0]  ; mDNS_fd
000166  0940              LSRS     r0,r0,#5
000168  a909              ADD      r1,sp,#0x24
00016a  f8510020          LDR      r0,[r1,r0,LSL #2]
00016e  4912              LDR      r1,|L4.440|
000170  7809              LDRB     r1,[r1,#0]  ; mDNS_fd
000172  f001021f          AND      r2,r1,#0x1f
000176  2101              MOVS     r1,#1
000178  4091              LSLS     r1,r1,r2
00017a  4008              ANDS     r0,r0,r1
00017c  b1d0              CBZ      r0,|L4.436|
;;;870          con = recvfrom(mDNS_fd, buf, 1500, 0, &addr, &addrLen); 
00017e  a803              ADD      r0,sp,#0xc
000180  a904              ADD      r1,sp,#0x10
000182  2300              MOVS     r3,#0
000184  f24052dc          MOV      r2,#0x5dc
000188  e9cd1000          STRD     r1,r0,[sp,#0]
00018c  4810              LDR      r0,|L4.464|
00018e  6801              LDR      r1,[r0,#0]  ; buf
000190  4809              LDR      r0,|L4.440|
000192  6800              LDR      r0,[r0,#0]  ; mDNS_fd
000194  f7fffffe          BL       recvfrom
000198  4605              MOV      r5,r0
;;;871          mico_rtos_lock_mutex( &bonjour_mutex );
00019a  480a              LDR      r0,|L4.452|
00019c  f7fffffe          BL       mico_rtos_lock_mutex
;;;872          mdns_handler(mDNS_fd, (uint8_t *)buf, con);
0001a0  462a              MOV      r2,r5
0001a2  480b              LDR      r0,|L4.464|
0001a4  6801              LDR      r1,[r0,#0]  ; buf
0001a6  4804              LDR      r0,|L4.440|
0001a8  6800              LDR      r0,[r0,#0]  ; mDNS_fd
0001aa  f7fffffe          BL       mdns_handler
;;;873          mico_rtos_unlock_mutex( &bonjour_mutex );
0001ae  4805              LDR      r0,|L4.452|
0001b0  f7fffffe          BL       mico_rtos_unlock_mutex
                  |L4.436|
0001b4  e72c              B        |L4.16|
;;;874        }
;;;875      }
;;;876      
;;;877      //mdns_utils_log("Exit: mDNS thread exit with err = %d", err);
;;;878      //SocketClose( &mDNS_fd );
;;;879      //if(buf) free(buf);
;;;880      //mico_rtos_delete_thread(NULL);
;;;881    }
;;;882    
                          ENDP

0001b6  0000              DCW      0x0000
                  |L4.440|
                          DCD      mDNS_fd
                  |L4.444|
                          DCD      update_state_fd
                  |L4.448|
                          DCD      update_state_sem
                  |L4.452|
                          DCD      bonjour_mutex
                  |L4.456|
                          DCD      available_services
                  |L4.460|
                          DCD      available_service_count
                  |L4.464|
                          DCD      buf

                          AREA ||i._clean_record_resource||, CODE, READONLY, ALIGN=1

                  _clean_record_resource PROC
;;;524    
;;;525    static void _clean_record_resource( dns_sd_service_record_t *record )
000000  b510              PUSH     {r4,lr}
;;;526    {
000002  4604              MOV      r4,r0
;;;527      if(record->service_name)  {
000004  68a0              LDR      r0,[r4,#8]
000006  b120              CBZ      r0,|L5.18|
;;;528        free(record->service_name);
000008  68a0              LDR      r0,[r4,#8]
00000a  f7fffffe          BL       free
;;;529        record->service_name = NULL;
00000e  2000              MOVS     r0,#0
000010  60a0              STR      r0,[r4,#8]
                  |L5.18|
;;;530      }
;;;531      if(record->hostname){
000012  6820              LDR      r0,[r4,#0]
000014  b120              CBZ      r0,|L5.32|
;;;532        free(record->hostname);
000016  6820              LDR      r0,[r4,#0]
000018  f7fffffe          BL       free
;;;533        record->hostname = NULL;
00001c  2000              MOVS     r0,#0
00001e  6020              STR      r0,[r4,#0]
                  |L5.32|
;;;534        }
;;;535      if(record->instance_name){
000020  6860              LDR      r0,[r4,#4]
000022  b120              CBZ      r0,|L5.46|
;;;536          free(record->instance_name);
000024  6860              LDR      r0,[r4,#4]
000026  f7fffffe          BL       free
;;;537          record->instance_name = NULL;
00002a  2000              MOVS     r0,#0
00002c  6060              STR      r0,[r4,#4]
                  |L5.46|
;;;538        }
;;;539      if(record->txt_att){
00002e  68e0              LDR      r0,[r4,#0xc]
000030  b120              CBZ      r0,|L5.60|
;;;540        free(record->txt_att);
000032  68e0              LDR      r0,[r4,#0xc]
000034  f7fffffe          BL       free
;;;541        record->txt_att = NULL;
000038  2000              MOVS     r0,#0
00003a  60e0              STR      r0,[r4,#0xc]
                  |L5.60|
;;;542      }
;;;543    
;;;544    }
00003c  bd10              POP      {r4,pc}
;;;545    
                          ENDP


                          AREA ||i.bonjour_send_record||, CODE, READONLY, ALIGN=2

                  bonjour_send_record PROC
;;;700    
;;;701    void bonjour_send_record(int record_index)
000000  b570              PUSH     {r4-r6,lr}
;;;702    {
000002  b0a0              SUB      sp,sp,#0x80
000004  4604              MOV      r4,r0
;;;703      dns_message_iterator_t response;
;;;704      uint32_t myip;
;;;705      IPStatusTypedef para;
;;;706      int ttl  = 0;
000006  2500              MOVS     r5,#0
;;;707    
;;;708      /* Send service and a ttl > 0 for a working record*/
;;;709      if( available_services[record_index].state == RECORD_NORMAL || available_services[record_index].state == RECORD_UPDATE ){
000008  4862              LDR      r0,|L6.404|
00000a  eb001044          ADD      r0,r0,r4,LSL #5
00000e  7fc0              LDRB     r0,[r0,#0x1f]
000010  2804              CMP      r0,#4
000012  d005              BEQ      |L6.32|
000014  485f              LDR      r0,|L6.404|
000016  eb001044          ADD      r0,r0,r4,LSL #5
00001a  7fc0              LDRB     r0,[r0,#0x1f]
00001c  2801              CMP      r0,#1
00001e  d12b              BNE      |L6.120|
                  |L6.32|
;;;710        ttl = available_services[record_index].ttl;
000020  485c              LDR      r0,|L6.404|
000022  eb001044          ADD      r0,r0,r4,LSL #5
000026  6985              LDR      r5,[r0,#0x18]
;;;711        
;;;712        if(dns_create_message( &response, 512 )) {
000028  f44f7100          MOV      r1,#0x200
00002c  a81d              ADD      r0,sp,#0x74
00002e  f7fffffe          BL       dns_create_message
000032  b308              CBZ      r0,|L6.120|
;;;713          dns_write_header(&response, 0x0, 0x8400, 0, available_service_count, 0 );          
000034  2000              MOVS     r0,#0
000036  4958              LDR      r1,|L6.408|
000038  7809              LDRB     r1,[r1,#0]  ; available_service_count
00003a  4603              MOV      r3,r0
00003c  f44f4204          MOV      r2,#0x8400
000040  e9cd1000          STRD     r1,r0,[sp,#0]
000044  4601              MOV      r1,r0
000046  a81d              ADD      r0,sp,#0x74
000048  f7fffffe          BL       dns_write_header
;;;714          dns_write_record( &response, SERVICE_QUERY_NAME, RR_CLASS_IN, RR_TYPE_PTR, 1500, (uint8_t*) available_services[record_index].service_name );
00004c  4851              LDR      r0,|L6.404|
00004e  eb001044          ADD      r0,r0,r4,LSL #5
000052  6880              LDR      r0,[r0,#8]
000054  f24051dc          MOV      r1,#0x5dc
000058  230c              MOVS     r3,#0xc
00005a  2201              MOVS     r2,#1
00005c  e9cd1000          STRD     r1,r0,[sp,#0]
000060  a14e              ADR      r1,|L6.412|
000062  a81d              ADD      r0,sp,#0x74
000064  f7fffffe          BL       dns_write_record
;;;715          mdns_send_message(mDNS_fd, &response );
000068  a91d              ADD      r1,sp,#0x74
00006a  4854              LDR      r0,|L6.444|
00006c  6800              LDR      r0,[r0,#0]  ; mDNS_fd
00006e  f7fffffe          BL       mdns_send_message
;;;716          dns_free_message( &response );
000072  a81d              ADD      r0,sp,#0x74
000074  f7fffffe          BL       dns_free_message
                  |L6.120|
;;;717        }
;;;718      }
;;;719      micoWlanGetIPStatus(&para, available_services[record_index].interface);
000078  4846              LDR      r0,|L6.404|
00007a  eb001044          ADD      r0,r0,r4,LSL #5
00007e  7d01              LDRB     r1,[r0,#0x14]
000080  a803              ADD      r0,sp,#0xc
000082  f7fffffe          BL       getNetPara
;;;720      myip = htonl(inet_addr(para.ip));
000086  f10d000d          ADD      r0,sp,#0xd
00008a  f7fffffe          BL       inet_addr
00008e  f04f417f          MOV      r1,#0xff000000
000092  ea016600          AND      r6,r1,r0,LSL #24
000096  f10d000d          ADD      r0,sp,#0xd
00009a  f7fffffe          BL       inet_addr
00009e  f44f017f          MOV      r1,#0xff0000
0000a2  ea012000          AND      r0,r1,r0,LSL #8
0000a6  4306              ORRS     r6,r6,r0
0000a8  f10d000d          ADD      r0,sp,#0xd
0000ac  f7fffffe          BL       inet_addr
0000b0  f44f417f          MOV      r1,#0xff00
0000b4  ea012010          AND      r0,r1,r0,LSR #8
0000b8  4306              ORRS     r6,r6,r0
0000ba  f10d000d          ADD      r0,sp,#0xd
0000be  f7fffffe          BL       inet_addr
0000c2  ea466610          ORR      r6,r6,r0,LSR #24
0000c6  961c              STR      r6,[sp,#0x70]
;;;721      if( myip == 0 || myip == 0xFFFFFFFF) return;
0000c8  981c              LDR      r0,[sp,#0x70]
0000ca  b110              CBZ      r0,|L6.210|
0000cc  981c              LDR      r0,[sp,#0x70]
0000ce  1c40              ADDS     r0,r0,#1
0000d0  b908              CBNZ     r0,|L6.214|
                  |L6.210|
;;;722    
;;;723    
;;;724      if(dns_create_message( &response, 512 )){
;;;725        mdns_utils_log( "TTL = %d",  ttl);
;;;726        micoWlanGetIPStatus(&para, available_services[record_index].interface);
;;;727        dns_write_header( &response, 0x0, 0x8400, 0, 4, 0 );
;;;728        dns_write_record( &response, available_services[record_index].service_name, RR_CLASS_IN, RR_TYPE_PTR, ttl, (uint8_t*) available_services[record_index].instance_name );
;;;729        dns_write_record( &response, available_services[record_index].instance_name, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_TXT, ttl, (uint8_t*) available_services[record_index].txt_att );
;;;730        dns_write_record( &response, available_services[record_index].instance_name, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_SRV, ttl, (uint8_t*) &available_services[record_index]);
;;;731        dns_write_record( &response, available_services[record_index].hostname, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_A, ttl, (uint8_t*) &myip);
;;;732        mdns_send_message(mDNS_fd, &response );
;;;733        dns_free_message( &response );
;;;734      }
;;;735    }
0000d2  b020              ADD      sp,sp,#0x80
0000d4  bd70              POP      {r4-r6,pc}
                  |L6.214|
0000d6  f44f7100          MOV      r1,#0x200             ;724
0000da  a81d              ADD      r0,sp,#0x74           ;724
0000dc  f7fffffe          BL       dns_create_message
0000e0  2800              CMP      r0,#0                 ;724
0000e2  d054              BEQ      |L6.398|
0000e4  482b              LDR      r0,|L6.404|
0000e6  eb001044          ADD      r0,r0,r4,LSL #5       ;726
0000ea  7d01              LDRB     r1,[r0,#0x14]         ;726
0000ec  a803              ADD      r0,sp,#0xc            ;726
0000ee  f7fffffe          BL       getNetPara
0000f2  2000              MOVS     r0,#0                 ;727
0000f4  2104              MOVS     r1,#4                 ;727
0000f6  4603              MOV      r3,r0                 ;727
0000f8  f44f4204          MOV      r2,#0x8400            ;727
0000fc  e9cd1000          STRD     r1,r0,[sp,#0]         ;727
000100  4601              MOV      r1,r0                 ;727
000102  a81d              ADD      r0,sp,#0x74           ;727
000104  f7fffffe          BL       dns_write_header
000108  4822              LDR      r0,|L6.404|
00010a  eb001044          ADD      r0,r0,r4,LSL #5       ;728
00010e  6840              LDR      r0,[r0,#4]            ;728
000110  e9cd5000          STRD     r5,r0,[sp,#0]         ;728
000114  481f              LDR      r0,|L6.404|
000116  eb001044          ADD      r0,r0,r4,LSL #5       ;728
00011a  230c              MOVS     r3,#0xc               ;728
00011c  2201              MOVS     r2,#1                 ;728
00011e  6881              LDR      r1,[r0,#8]            ;728
000120  a81d              ADD      r0,sp,#0x74           ;728
000122  f7fffffe          BL       dns_write_record
000126  481b              LDR      r0,|L6.404|
000128  eb001044          ADD      r0,r0,r4,LSL #5       ;729
00012c  68c0              LDR      r0,[r0,#0xc]          ;729
00012e  e9cd5000          STRD     r5,r0,[sp,#0]         ;729
000132  4818              LDR      r0,|L6.404|
000134  eb001044          ADD      r0,r0,r4,LSL #5       ;729
000138  2310              MOVS     r3,#0x10              ;729
00013a  f2480201          MOV      r2,#0x8001            ;729
00013e  6841              LDR      r1,[r0,#4]            ;729
000140  a81d              ADD      r0,sp,#0x74           ;729
000142  f7fffffe          BL       dns_write_record
000146  4813              LDR      r0,|L6.404|
000148  eb001044          ADD      r0,r0,r4,LSL #5       ;730
00014c  e9cd5000          STRD     r5,r0,[sp,#0]         ;730
000150  4810              LDR      r0,|L6.404|
000152  eb001044          ADD      r0,r0,r4,LSL #5       ;730
000156  2321              MOVS     r3,#0x21              ;730
000158  f2480201          MOV      r2,#0x8001            ;730
00015c  6841              LDR      r1,[r0,#4]            ;730
00015e  a81d              ADD      r0,sp,#0x74           ;730
000160  f7fffffe          BL       dns_write_record
000164  a81c              ADD      r0,sp,#0x70           ;731
000166  e9cd5000          STRD     r5,r0,[sp,#0]         ;731
00016a  480a              LDR      r0,|L6.404|
00016c  eb001044          ADD      r0,r0,r4,LSL #5       ;731
000170  2301              MOVS     r3,#1                 ;731
000172  f2480201          MOV      r2,#0x8001            ;731
000176  6801              LDR      r1,[r0,#0]            ;731
000178  a81d              ADD      r0,sp,#0x74           ;731
00017a  f7fffffe          BL       dns_write_record
00017e  a91d              ADD      r1,sp,#0x74           ;732
000180  480e              LDR      r0,|L6.444|
000182  6800              LDR      r0,[r0,#0]            ;732  ; mDNS_fd
000184  f7fffffe          BL       mdns_send_message
000188  a81d              ADD      r0,sp,#0x74           ;733
00018a  f7fffffe          BL       dns_free_message
                  |L6.398|
00018e  bf00              NOP      
000190  e79f              B        |L6.210|
;;;736    
                          ENDP

000192  0000              DCW      0x0000
                  |L6.404|
                          DCD      available_services
                  |L6.408|
                          DCD      available_service_count
                  |L6.412|
00019c  5f736572          DCB      "_services._dns-sd._udp.local.",0
0001a0  76696365
0001a4  732e5f64
0001a8  6e732d73
0001ac  642e5f75
0001b0  64702e6c
0001b4  6f63616c
0001b8  2e00    
0001ba  00                DCB      0
0001bb  00                DCB      0
                  |L6.444|
                          DCD      mDNS_fd

                          AREA ||i.dns_compare_name_to_string||, CODE, READONLY, ALIGN=1

                  dns_compare_name_to_string PROC
;;;217    
;;;218    static int dns_compare_name_to_string( dns_name_t* name, const char* string )
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;219    {
000004  4607              MOV      r7,r0
000006  460e              MOV      r6,r1
;;;220      uint8_t section_length;
;;;221      int finished = 0;
000008  f04f0900          MOV      r9,#0
;;;222      int result   = 1;
00000c  f04f0a01          MOV      r10,#1
;;;223      uint8_t* buffer 	  = name->start_of_name;
000010  683c              LDR      r4,[r7,#0]
;;;224      char *temp;
;;;225      
;;;226      while ( !finished )
000012  e03a              B        |L7.138|
                  |L7.20|
;;;227      {
;;;228        // Check if the name is compressed. If so, find the uncompressed version
;;;229        while ( *buffer & 0xC0 )
000014  e00a              B        |L7.44|
                  |L7.22|
;;;230        {
;;;231          uint16_t offset = ( *buffer++ ) << 8;
000016  f8142b01          LDRB     r2,[r4],#1
00001a  0210              LSLS     r0,r2,#8
;;;232          offset += *buffer;
00001c  7821              LDRB     r1,[r4,#0]
00001e  4401              ADD      r1,r1,r0
000020  b288              UXTH     r0,r1
;;;233          offset &= 0x3FFF;
000022  f3c0000d          UBFX     r0,r0,#0,#14
;;;234          buffer = name->start_of_packet + offset;
000026  6879              LDR      r1,[r7,#4]
000028  180c              ADDS     r4,r1,r0
;;;235        }
00002a  bf00              NOP      
                  |L7.44|
00002c  7820              LDRB     r0,[r4,#0]            ;229
00002e  f00000c0          AND      r0,r0,#0xc0           ;229
000032  2800              CMP      r0,#0                 ;229
000034  d1ef              BNE      |L7.22|
;;;236        
;;;237        // Compare section
;;;238        section_length = *( buffer++ );
000036  f8145b01          LDRB     r5,[r4],#1
;;;239        temp = malloc(section_length+1);
00003a  1c68              ADDS     r0,r5,#1
00003c  f7fffffe          BL       malloc
000040  4680              MOV      r8,r0
;;;240        temp[section_length] = 0;
000042  2000              MOVS     r0,#0
000044  f8080005          STRB     r0,[r8,r5]
;;;241        memcpy(temp, buffer, section_length );
000048  462a              MOV      r2,r5
00004a  4621              MOV      r1,r4
00004c  4640              MOV      r0,r8
00004e  f7fffffe          BL       __aeabi_memcpy
;;;242        free(temp);
000052  4640              MOV      r0,r8
000054  f7fffffe          BL       free
;;;243        if ( strncmp( (char*) buffer, string, section_length ) )
000058  462a              MOV      r2,r5
00005a  4631              MOV      r1,r6
00005c  4620              MOV      r0,r4
00005e  f7fffffe          BL       strncmp
000062  b118              CBZ      r0,|L7.108|
;;;244        {
;;;245          result	 = 0;
000064  f04f0a00          MOV      r10,#0
;;;246          finished = 1;
000068  f04f0901          MOV      r9,#1
                  |L7.108|
;;;247        }
;;;248        string += section_length + 1;
00006c  1c68              ADDS     r0,r5,#1
00006e  4406              ADD      r6,r6,r0
;;;249        buffer += section_length;
000070  442c              ADD      r4,r4,r5
;;;250        
;;;251        // Check if we've finished comparing
;;;252        if ( *buffer == 0 || *string == 0 )
000072  7820              LDRB     r0,[r4,#0]
000074  b108              CBZ      r0,|L7.122|
000076  7830              LDRB     r0,[r6,#0]
000078  b938              CBNZ     r0,|L7.138|
                  |L7.122|
;;;253        {
;;;254          finished = 1;
00007a  f04f0901          MOV      r9,#1
;;;255          // Check if one of the strings has more data
;;;256          if ( *buffer != 0 || *string != 0 )
00007e  7820              LDRB     r0,[r4,#0]
000080  b908              CBNZ     r0,|L7.134|
000082  7830              LDRB     r0,[r6,#0]
000084  b108              CBZ      r0,|L7.138|
                  |L7.134|
;;;257          {
;;;258            result = 0;
000086  f04f0a00          MOV      r10,#0
                  |L7.138|
00008a  f1b90f00          CMP      r9,#0                 ;226
00008e  d0c1              BEQ      |L7.20|
;;;259          }
;;;260        }
;;;261      }
;;;262      
;;;263      return result;
000090  4650              MOV      r0,r10
;;;264    }
000092  e8bd87f0          POP      {r4-r10,pc}
;;;265    
                          ENDP


                          AREA ||i.dns_create_message||, CODE, READONLY, ALIGN=1

                  dns_create_message PROC
;;;265    
;;;266    static int dns_create_message( dns_message_iterator_t* message, uint16_t size )
000000  b570              PUSH     {r4-r6,lr}
;;;267    {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
;;;268      message->header = (dns_message_header_t*) malloc( size );
000006  4628              MOV      r0,r5
000008  f7fffffe          BL       malloc
00000c  6020              STR      r0,[r4,#0]
;;;269      if ( message->header == NULL )
00000e  6820              LDR      r0,[r4,#0]
000010  b908              CBNZ     r0,|L8.22|
;;;270      {
;;;271        return 0;
000012  2000              MOVS     r0,#0
                  |L8.20|
;;;272      }
;;;273      
;;;274      message->iter = (uint8_t *) message->header + sizeof(dns_message_header_t);
;;;275      return 1;
;;;276    }
000014  bd70              POP      {r4-r6,pc}
                  |L8.22|
000016  6820              LDR      r0,[r4,#0]            ;274
000018  300c              ADDS     r0,r0,#0xc            ;274
00001a  6060              STR      r0,[r4,#4]            ;274
00001c  2001              MOVS     r0,#1                 ;275
00001e  e7f9              B        |L8.20|
;;;277    
                          ENDP


                          AREA ||i.dns_free_message||, CODE, READONLY, ALIGN=1

                  dns_free_message PROC
;;;277    
;;;278    static void dns_free_message( dns_message_iterator_t* message )
000000  b510              PUSH     {r4,lr}
;;;279    {
000002  4604              MOV      r4,r0
;;;280      free(message->header);
000004  6820              LDR      r0,[r4,#0]
000006  f7fffffe          BL       free
;;;281      message->header = NULL;
00000a  2000              MOVS     r0,#0
00000c  6020              STR      r0,[r4,#0]
;;;282    }
00000e  bd10              POP      {r4,pc}
;;;283    
                          ENDP


                          AREA ||i.dns_get_next_question||, CODE, READONLY, ALIGN=1

                  dns_get_next_question PROC
;;;202    
;;;203    static int dns_get_next_question( dns_message_iterator_t* iter, dns_question_t* q, dns_name_t* name )
000000  b570              PUSH     {r4-r6,lr}
;;;204    {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
000006  4616              MOV      r6,r2
;;;205      // Set the name pointers and then skip it
;;;206      name->start_of_name   = (uint8_t*) iter->iter;
000008  6860              LDR      r0,[r4,#4]
00000a  6030              STR      r0,[r6,#0]
;;;207      name->start_of_packet = (uint8_t*) iter->header;
00000c  6820              LDR      r0,[r4,#0]
00000e  6070              STR      r0,[r6,#4]
;;;208      dns_skip_name( iter );
000010  4620              MOV      r0,r4
000012  f7fffffe          BL       dns_skip_name
;;;209      if (iter->iter > iter->end)
000016  e9d40101          LDRD     r0,r1,[r4,#4]
00001a  4288              CMP      r0,r1
00001c  d901              BLS      |L10.34|
;;;210        return 0;
00001e  2000              MOVS     r0,#0
                  |L10.32|
;;;211      
;;;212      // Read the type and class
;;;213      q->question_type  = dns_read_uint16( iter );
;;;214      q->question_class = dns_read_uint16( iter );
;;;215      return 1;
;;;216    }
000020  bd70              POP      {r4-r6,pc}
                  |L10.34|
000022  4620              MOV      r0,r4                 ;213
000024  f7fffffe          BL       dns_read_uint16
000028  8028              STRH     r0,[r5,#0]            ;213
00002a  4620              MOV      r0,r4                 ;214
00002c  f7fffffe          BL       dns_read_uint16
000030  8068              STRH     r0,[r5,#2]            ;214
000032  2001              MOVS     r0,#1                 ;215
000034  e7f4              B        |L10.32|
;;;217    
                          ENDP


                          AREA ||i.dns_read_uint16||, CODE, READONLY, ALIGN=1

                  dns_read_uint16 PROC
;;;422    
;;;423    static uint16_t dns_read_uint16( dns_message_iterator_t* iter )
000000  4601              MOV      r1,r0
;;;424    {
;;;425      uint16_t temp = (uint16_t) ( *iter->iter++ ) << 8;
000002  684b              LDR      r3,[r1,#4]
000004  1c5a              ADDS     r2,r3,#1
000006  604a              STR      r2,[r1,#4]
000008  781a              LDRB     r2,[r3,#0]
00000a  0210              LSLS     r0,r2,#8
;;;426      temp += (uint16_t) ( *iter->iter++ );
00000c  684b              LDR      r3,[r1,#4]
00000e  1c5a              ADDS     r2,r3,#1
000010  604a              STR      r2,[r1,#4]
000012  781a              LDRB     r2,[r3,#0]
000014  4402              ADD      r2,r2,r0
000016  b290              UXTH     r0,r2
;;;427      return temp;
;;;428    }
000018  4770              BX       lr
;;;429    
                          ENDP


                          AREA ||i.dns_skip_name||, CODE, READONLY, ALIGN=1

                  dns_skip_name PROC
;;;429    
;;;430    static void dns_skip_name( dns_message_iterator_t* iter )
000000  e012              B        |L12.40|
                  |L12.2|
;;;431    {
;;;432      while ( *iter->iter != 0 )
;;;433      {
;;;434        // Check if the name is compressed
;;;435        if ( *iter->iter & 0xC0 )
000002  6841              LDR      r1,[r0,#4]
000004  7809              LDRB     r1,[r1,#0]
000006  f00101c0          AND      r1,r1,#0xc0
00000a  b119              CBZ      r1,|L12.20|
;;;436        {
;;;437          iter->iter += 1; // Normally this should be 2, but we have a ++ outside the while loop
00000c  6841              LDR      r1,[r0,#4]
00000e  1c49              ADDS     r1,r1,#1
000010  6041              STR      r1,[r0,#4]
;;;438          break;
000012  e00d              B        |L12.48|
                  |L12.20|
;;;439        }
;;;440        else
;;;441        {
;;;442          iter->iter += (uint32_t) *iter->iter + 1;
000014  6842              LDR      r2,[r0,#4]
000016  7811              LDRB     r1,[r2,#0]
000018  1c49              ADDS     r1,r1,#1
00001a  4411              ADD      r1,r1,r2
00001c  6041              STR      r1,[r0,#4]
;;;443        }
;;;444        if (iter->iter > iter->end)
00001e  e9d01201          LDRD     r1,r2,[r0,#4]
000022  4291              CMP      r1,r2
000024  d900              BLS      |L12.40|
;;;445          break;
000026  e003              B        |L12.48|
                  |L12.40|
000028  6841              LDR      r1,[r0,#4]            ;432
00002a  7809              LDRB     r1,[r1,#0]            ;432
00002c  2900              CMP      r1,#0                 ;432
00002e  d1e8              BNE      |L12.2|
                  |L12.48|
000030  bf00              NOP                            ;438
;;;446      }
;;;447      // Skip the null u8
;;;448      ++iter->iter;
000032  6841              LDR      r1,[r0,#4]
000034  1c49              ADDS     r1,r1,#1
000036  6041              STR      r1,[r0,#4]
;;;449    }
000038  4770              BX       lr
;;;450    
                          ENDP


                          AREA ||i.dns_write_bytes||, CODE, READONLY, ALIGN=1

                  dns_write_bytes PROC
;;;411    
;;;412    static void dns_write_bytes( dns_message_iterator_t* iter, uint8_t* data, uint16_t length )
000000  b530              PUSH     {r4,r5,lr}
;;;413    {
000002  460b              MOV      r3,r1
;;;414      int a = 0;
000004  2100              MOVS     r1,#0
;;;415      
;;;416      for ( a = 0; a < length; ++a )
000006  bf00              NOP      
000008  e003              B        |L13.18|
                  |L13.10|
;;;417      {
;;;418        iter->iter[a] = data[a];
00000a  5c5c              LDRB     r4,[r3,r1]
00000c  6845              LDR      r5,[r0,#4]
00000e  546c              STRB     r4,[r5,r1]
000010  1c49              ADDS     r1,r1,#1              ;416
                  |L13.18|
000012  4291              CMP      r1,r2                 ;416
000014  dbf9              BLT      |L13.10|
;;;419      }
;;;420      iter->iter += length;
000016  6844              LDR      r4,[r0,#4]
000018  4414              ADD      r4,r4,r2
00001a  6044              STR      r4,[r0,#4]
;;;421    }
00001c  bd30              POP      {r4,r5,pc}
;;;422    
                          ENDP


                          AREA ||i.dns_write_header||, CODE, READONLY, ALIGN=1

                  dns_write_header PROC
;;;325    
;;;326    static void dns_write_header( dns_message_iterator_t* iter, uint16_t id, uint16_t flags, uint16_t question_count, uint16_t answer_count, uint16_t authorative_count )
000000  b5f0              PUSH     {r4-r7,lr}
;;;327    {
000002  e9dd4505          LDRD     r4,r5,[sp,#0x14]
;;;328      memset( iter->header, 0, sizeof(dns_message_header_t) );
000006  2700              MOVS     r7,#0
000008  6806              LDR      r6,[r0,#0]
00000a  6037              STR      r7,[r6,#0]
00000c  6077              STR      r7,[r6,#4]
00000e  60b7              STR      r7,[r6,#8]
;;;329      iter->header->id				= htons(id);
000010  f44f467f          MOV      r6,#0xff00
000014  ea062601          AND      r6,r6,r1,LSL #8
000018  ea462611          ORR      r6,r6,r1,LSR #8
00001c  6807              LDR      r7,[r0,#0]
00001e  803e              STRH     r6,[r7,#0]
;;;330      iter->header->flags 			= htons(flags);
000020  f44f467f          MOV      r6,#0xff00
000024  ea062602          AND      r6,r6,r2,LSL #8
000028  ea462612          ORR      r6,r6,r2,LSR #8
00002c  6807              LDR      r7,[r0,#0]
00002e  807e              STRH     r6,[r7,#2]
;;;331      iter->header->question_count	= htons(question_count);
000030  f44f467f          MOV      r6,#0xff00
000034  ea062603          AND      r6,r6,r3,LSL #8
000038  ea462613          ORR      r6,r6,r3,LSR #8
00003c  6807              LDR      r7,[r0,#0]
00003e  80be              STRH     r6,[r7,#4]
;;;332      iter->header->name_server_count = htons(authorative_count);
000040  f44f467f          MOV      r6,#0xff00
000044  ea062605          AND      r6,r6,r5,LSL #8
000048  ea462615          ORR      r6,r6,r5,LSR #8
00004c  6807              LDR      r7,[r0,#0]
00004e  813e              STRH     r6,[r7,#8]
;;;333      iter->header->answer_count		= htons(answer_count);
000050  f44f467f          MOV      r6,#0xff00
000054  ea062604          AND      r6,r6,r4,LSL #8
000058  ea462614          ORR      r6,r6,r4,LSR #8
00005c  6807              LDR      r7,[r0,#0]
00005e  80fe              STRH     r6,[r7,#6]
;;;334    }
000060  bdf0              POP      {r4-r7,pc}
;;;335    
                          ENDP


                          AREA ||i.dns_write_name||, CODE, READONLY, ALIGN=1

                  dns_write_name PROC
;;;450    
;;;451    static void dns_write_name( dns_message_iterator_t* iter, const char* src )
000000  b570              PUSH     {r4-r6,lr}
;;;452    {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
;;;453      dns_write_string( iter, src );
000006  4629              MOV      r1,r5
000008  4620              MOV      r0,r4
00000a  f7fffffe          BL       dns_write_string
;;;454    }
00000e  bd70              POP      {r4-r6,pc}
;;;455    
                          ENDP


                          AREA ||i.dns_write_record||, CODE, READONLY, ALIGN=1

                  dns_write_record PROC
;;;336    
;;;337    static void dns_write_record( dns_message_iterator_t* iter, const char* name, uint16_t record_class, uint16_t record_type, uint32_t ttl, uint8_t* rdata )
000000  e92d5ff0          PUSH     {r4-r12,lr}
;;;338    {
000004  4604              MOV      r4,r0
000006  468a              MOV      r10,r1
000008  4617              MOV      r7,r2
00000a  461d              MOV      r5,r3
00000c  e9ddb60a          LDRD     r11,r6,[sp,#0x28]
;;;339      uint8_t* rd_length;
;;;340      uint8_t* temp_ptr;
;;;341      
;;;342      /* Write the name, type, class, TTL*/
;;;343      dns_write_name	( iter, name );
000010  4651              MOV      r1,r10
000012  4620              MOV      r0,r4
000014  f7fffffe          BL       dns_write_name
;;;344      dns_write_uint16( iter, record_type );
000018  4629              MOV      r1,r5
00001a  4620              MOV      r0,r4
00001c  f7fffffe          BL       dns_write_uint16
;;;345      dns_write_uint16( iter, record_class );
000020  4639              MOV      r1,r7
000022  4620              MOV      r0,r4
000024  f7fffffe          BL       dns_write_uint16
;;;346      dns_write_uint32( iter, ttl );
000028  4659              MOV      r1,r11
00002a  4620              MOV      r0,r4
00002c  f7fffffe          BL       dns_write_uint32
;;;347      
;;;348      /* Keep track of where we store the rdata length*/
;;;349      rd_length	= iter->iter;
000030  f8d48004          LDR      r8,[r4,#4]
;;;350      iter->iter += 2;
000034  6860              LDR      r0,[r4,#4]
000036  1c80              ADDS     r0,r0,#2
000038  6060              STR      r0,[r4,#4]
;;;351      temp_ptr	= iter->iter;
00003a  f8d49004          LDR      r9,[r4,#4]
;;;352      
;;;353      switch ( record_type )
00003e  2d01              CMP      r5,#1
000040  d006              BEQ      |L16.80|
000042  2d0c              CMP      r5,#0xc
000044  d00a              BEQ      |L16.92|
000046  2d10              CMP      r5,#0x10
000048  d009              BEQ      |L16.94|
00004a  2d21              CMP      r5,#0x21
00004c  d11d              BNE      |L16.138|
00004e  e00b              B        |L16.104|
                  |L16.80|
;;;354      {
;;;355      case RR_TYPE_A:
;;;356        dns_write_bytes( iter, rdata, 4 );
000050  2204              MOVS     r2,#4
000052  4631              MOV      r1,r6
000054  4620              MOV      r0,r4
000056  f7fffffe          BL       dns_write_bytes
;;;357        break;
00005a  e017              B        |L16.140|
                  |L16.92|
;;;358        
;;;359      case RR_TYPE_PTR:
;;;360      case RR_TYPE_TXT:
00005c  bf00              NOP      
                  |L16.94|
;;;361        dns_write_name( iter, (const char*) rdata );
00005e  4631              MOV      r1,r6
000060  4620              MOV      r0,r4
000062  f7fffffe          BL       dns_write_name
;;;362        break;
000066  e011              B        |L16.140|
                  |L16.104|
;;;363        
;;;364      case RR_TYPE_SRV:
;;;365        /* Set priority and weight to 0*/
;;;366        dns_write_uint16( iter, 0 );
000068  2100              MOVS     r1,#0
00006a  4620              MOV      r0,r4
00006c  f7fffffe          BL       dns_write_uint16
;;;367        dns_write_uint16( iter, 0 );
000070  2100              MOVS     r1,#0
000072  4620              MOV      r0,r4
000074  f7fffffe          BL       dns_write_uint16
;;;368        
;;;369        /* Write the port*/
;;;370        dns_write_uint16( iter, ( (dns_sd_service_record_t*) rdata )->port );
000078  8bb1              LDRH     r1,[r6,#0x1c]
00007a  4620              MOV      r0,r4
00007c  f7fffffe          BL       dns_write_uint16
;;;371        
;;;372        /* Write the hostname*/
;;;373        dns_write_string( iter, ( (dns_sd_service_record_t*) rdata )->hostname );
000080  4620              MOV      r0,r4
000082  6831              LDR      r1,[r6,#0]
000084  f7fffffe          BL       dns_write_string
;;;374        break;
000088  e000              B        |L16.140|
                  |L16.138|
;;;375      default:
;;;376        break;
00008a  bf00              NOP      
                  |L16.140|
00008c  bf00              NOP                            ;357
;;;377      }
;;;378      // Write the rdata length
;;;379      rd_length[0] = ( iter->iter - temp_ptr ) >> 8;
00008e  88a0              LDRH     r0,[r4,#4]
000090  eba00009          SUB      r0,r0,r9
000094  0a00              LSRS     r0,r0,#8
000096  f8880000          STRB     r0,[r8,#0]
;;;380      rd_length[1] = ( iter->iter - temp_ptr ) & 0xFF;
00009a  7920              LDRB     r0,[r4,#4]
00009c  eba00009          SUB      r0,r0,r9
0000a0  f8880001          STRB     r0,[r8,#1]
;;;381    }
0000a4  e8bd9ff0          POP      {r4-r12,pc}
;;;382    
                          ENDP


                          AREA ||i.dns_write_string||, CODE, READONLY, ALIGN=1

                  dns_write_string PROC
;;;283    
;;;284    static void dns_write_string( dns_message_iterator_t* iter, const char* src )
000000  b570              PUSH     {r4-r6,lr}
;;;285    {
;;;286      uint8_t* segment_length_pointer;
;;;287      uint8_t  segment_length;
;;;288      
;;;289      while ( *src != 0 && *src != 0xC0)
000002  e01d              B        |L17.64|
                  |L17.4|
;;;290      {
;;;291        /* Remember where we need to store the segment length and reset the counter*/
;;;292        segment_length_pointer = iter->iter++;
000004  6842              LDR      r2,[r0,#4]
000006  1c54              ADDS     r4,r2,#1
000008  6044              STR      r4,[r0,#4]
;;;293        segment_length = 0;
00000a  2300              MOVS     r3,#0
;;;294        
;;;295        /* Copy bytes until '.' or end of string*/
;;;296        while ( *src != '.' && *src != 0 && *src != 0xC0)
00000c  e00b              B        |L17.38|
                  |L17.14|
;;;297        {
;;;298          if (*src == '/')
00000e  780c              LDRB     r4,[r1,#0]
000010  2c2f              CMP      r4,#0x2f
000012  d100              BNE      |L17.22|
;;;299            src++; // skip '/'
000014  1c49              ADDS     r1,r1,#1
                  |L17.22|
;;;300          
;;;301          *iter->iter++ = *src++;
000016  f8115b01          LDRB     r5,[r1],#1
00001a  6846              LDR      r6,[r0,#4]
00001c  1c74              ADDS     r4,r6,#1
00001e  6044              STR      r4,[r0,#4]
000020  7035              STRB     r5,[r6,#0]
;;;302          ++segment_length;
000022  1c5c              ADDS     r4,r3,#1
000024  b2e3              UXTB     r3,r4
                  |L17.38|
000026  780c              LDRB     r4,[r1,#0]            ;296
000028  2c2e              CMP      r4,#0x2e              ;296
00002a  d004              BEQ      |L17.54|
00002c  780c              LDRB     r4,[r1,#0]            ;296
00002e  b114              CBZ      r4,|L17.54|
000030  780c              LDRB     r4,[r1,#0]            ;296
000032  2cc0              CMP      r4,#0xc0              ;296
000034  d1eb              BNE      |L17.14|
                  |L17.54|
;;;303        }
;;;304        
;;;305        /* Store the length of the segment*/
;;;306        *segment_length_pointer = segment_length;
000036  7013              STRB     r3,[r2,#0]
;;;307        
;;;308        /* Check if we stopped because of a '.', if so, skip it*/
;;;309        if ( *src == '.' )
000038  780c              LDRB     r4,[r1,#0]
00003a  2c2e              CMP      r4,#0x2e
00003c  d100              BNE      |L17.64|
;;;310        {
;;;311          ++src;
00003e  1c49              ADDS     r1,r1,#1
                  |L17.64|
000040  780c              LDRB     r4,[r1,#0]            ;289
000042  b114              CBZ      r4,|L17.74|
000044  780c              LDRB     r4,[r1,#0]            ;289
000046  2cc0              CMP      r4,#0xc0              ;289
000048  d1dc              BNE      |L17.4|
                  |L17.74|
;;;312        }
;;;313        
;;;314      }
;;;315      
;;;316      if (*src == 0xC0) { // compress name
00004a  780c              LDRB     r4,[r1,#0]
00004c  2cc0              CMP      r4,#0xc0
00004e  d10c              BNE      |L17.106|
;;;317        *iter->iter++ = *src++;
000050  f8115b01          LDRB     r5,[r1],#1
000054  6846              LDR      r6,[r0,#4]
000056  1c74              ADDS     r4,r6,#1
000058  6044              STR      r4,[r0,#4]
00005a  7035              STRB     r5,[r6,#0]
;;;318        *iter->iter++ = *src++;
00005c  f8115b01          LDRB     r5,[r1],#1
000060  6846              LDR      r6,[r0,#4]
000062  1c74              ADDS     r4,r6,#1
000064  6044              STR      r4,[r0,#4]
000066  7035              STRB     r5,[r6,#0]
000068  e004              B        |L17.116|
                  |L17.106|
;;;319      } else {
;;;320        /* Add the ending null */
;;;321        *iter->iter++ = 0;
00006a  2500              MOVS     r5,#0
00006c  6846              LDR      r6,[r0,#4]
00006e  1c74              ADDS     r4,r6,#1
000070  6044              STR      r4,[r0,#4]
000072  7035              STRB     r5,[r6,#0]
                  |L17.116|
;;;322      }
;;;323    }
000074  bd70              POP      {r4-r6,pc}
;;;324    
                          ENDP


                          AREA ||i.dns_write_uint16||, CODE, READONLY, ALIGN=1

                  dns_write_uint16 PROC
;;;394    
;;;395    static void dns_write_uint16( dns_message_iterator_t* iter, uint16_t data )
000000  120a              ASRS     r2,r1,#8
;;;396    {
;;;397      // We cannot assume the u8 alignment of iter->iter so we can't just typecast and assign
;;;398      iter->iter[0] = data >> 8;
000002  6843              LDR      r3,[r0,#4]
000004  701a              STRB     r2,[r3,#0]
;;;399      iter->iter[1] = data & 0xFF;
000006  6843              LDR      r3,[r0,#4]
000008  7059              STRB     r1,[r3,#1]
;;;400      iter->iter += 2;
00000a  6842              LDR      r2,[r0,#4]
00000c  1c92              ADDS     r2,r2,#2
00000e  6042              STR      r2,[r0,#4]
;;;401    }
000010  4770              BX       lr
;;;402    
                          ENDP


                          AREA ||i.dns_write_uint32||, CODE, READONLY, ALIGN=1

                  dns_write_uint32 PROC
;;;402    
;;;403    static void dns_write_uint32( dns_message_iterator_t* iter, uint32_t data )
000000  0e0a              LSRS     r2,r1,#24
;;;404    {
;;;405      iter->iter[0] = data >> 24;
000002  6843              LDR      r3,[r0,#4]
000004  701a              STRB     r2,[r3,#0]
;;;406      iter->iter[1] = data >> 16;
000006  0c0a              LSRS     r2,r1,#16
000008  6843              LDR      r3,[r0,#4]
00000a  705a              STRB     r2,[r3,#1]
;;;407      iter->iter[2] = data >> 8;
00000c  0a0a              LSRS     r2,r1,#8
00000e  6843              LDR      r3,[r0,#4]
000010  709a              STRB     r2,[r3,#2]
;;;408      iter->iter[3] = data & 0xFF;
000012  6843              LDR      r3,[r0,#4]
000014  70d9              STRB     r1,[r3,#3]
;;;409      iter->iter += 4;
000016  6842              LDR      r2,[r0,#4]
000018  1d12              ADDS     r2,r2,#4
00001a  6042              STR      r2,[r0,#4]
;;;410    }
00001c  4770              BX       lr
;;;411    
                          ENDP


                          AREA ||i.find_empty_record||, CODE, READONLY, ALIGN=2

                  find_empty_record PROC
;;;480    
;;;481    static int find_empty_record ( void )
000000  20ff              MOVS     r0,#0xff
;;;482    {
;;;483      int i;
;;;484      uint32_t insert_index = 0xFF;
;;;485    
;;;486      for ( i = 0; i < available_service_count; i++ ){
000002  2100              MOVS     r1,#0
000004  e007              B        |L20.22|
                  |L20.6|
;;;487        if( available_services[i].state == RECORD_REMOVED ){
000006  4a07              LDR      r2,|L20.36|
000008  eb021241          ADD      r2,r2,r1,LSL #5
00000c  7fd2              LDRB     r2,[r2,#0x1f]
00000e  b90a              CBNZ     r2,|L20.20|
;;;488          insert_index = i;
000010  4608              MOV      r0,r1
;;;489          break;
000012  e004              B        |L20.30|
                  |L20.20|
000014  1c49              ADDS     r1,r1,#1              ;486
                  |L20.22|
000016  4a04              LDR      r2,|L20.40|
000018  7812              LDRB     r2,[r2,#0]            ;486  ; available_service_count
00001a  4291              CMP      r1,r2                 ;486
00001c  dbf3              BLT      |L20.6|
                  |L20.30|
00001e  bf00              NOP      
;;;490        }
;;;491      }
;;;492      return insert_index;
;;;493    }
000020  4770              BX       lr
;;;494    
                          ENDP

000022  0000              DCW      0x0000
                  |L20.36|
                          DCD      available_services
                  |L20.40|
                          DCD      available_service_count

                          AREA ||i.find_record_by_service||, CODE, READONLY, ALIGN=2

                  find_record_by_service PROC
;;;466    
;;;467    static int find_record_by_service ( char *service_name, WiFi_Interface interface )
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;468    {
000004  4605              MOV      r5,r0
000006  460e              MOV      r6,r1
;;;469      int i;
;;;470      uint32_t insert_index = 0xFF;
000008  27ff              MOVS     r7,#0xff
;;;471    
;;;472      for ( i = 0; i < available_service_count; i++ ){
00000a  2400              MOVS     r4,#0
00000c  e00a              B        |L21.36|
                  |L21.14|
;;;473        if( is_service_match ( &available_services[i], service_name, interface ) ){
00000e  4909              LDR      r1,|L21.52|
000010  eb011044          ADD      r0,r1,r4,LSL #5
000014  4632              MOV      r2,r6
000016  4629              MOV      r1,r5
000018  f7fffffe          BL       is_service_match
00001c  b108              CBZ      r0,|L21.34|
;;;474          insert_index = i;
00001e  4627              MOV      r7,r4
;;;475          break;
000020  e004              B        |L21.44|
                  |L21.34|
000022  1c64              ADDS     r4,r4,#1              ;472
                  |L21.36|
000024  4804              LDR      r0,|L21.56|
000026  7800              LDRB     r0,[r0,#0]            ;472  ; available_service_count
000028  4284              CMP      r4,r0                 ;472
00002a  dbf0              BLT      |L21.14|
                  |L21.44|
00002c  bf00              NOP      
;;;476        }
;;;477      }  
;;;478      return insert_index;
00002e  4638              MOV      r0,r7
;;;479    }
000030  e8bd81f0          POP      {r4-r8,pc}
;;;480    
                          ENDP

                  |L21.52|
                          DCD      available_services
                  |L21.56|
                          DCD      available_service_count

                          AREA ||i.is_service_match||, CODE, READONLY, ALIGN=1

                  is_service_match PROC
;;;455    
;;;456    static bool is_service_match ( dns_sd_service_record_t *record, char *service_name, WiFi_Interface interface )
000000  b570              PUSH     {r4-r6,lr}
;;;457    {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
000006  4616              MOV      r6,r2
;;;458      if( record->state == RECORD_REMOVED || record->state == RECORD_REMOVE )
000008  7fe0              LDRB     r0,[r4,#0x1f]
00000a  b110              CBZ      r0,|L22.18|
00000c  7fe0              LDRB     r0,[r4,#0x1f]
00000e  2802              CMP      r0,#2
000010  d101              BNE      |L22.22|
                  |L22.18|
;;;459        return false;
000012  2000              MOVS     r0,#0
                  |L22.20|
;;;460    
;;;461      if( ( service_name == NULL || strcmp( record->service_name, service_name ) == 0 ) && record->interface == interface )
;;;462        return true;
;;;463    
;;;464      return false;
;;;465    }
000014  bd70              POP      {r4-r6,pc}
                  |L22.22|
000016  b125              CBZ      r5,|L22.34|
000018  4629              MOV      r1,r5                 ;461
00001a  68a0              LDR      r0,[r4,#8]            ;461
00001c  f7fffffe          BL       strcmp
000020  b920              CBNZ     r0,|L22.44|
                  |L22.34|
000022  7d20              LDRB     r0,[r4,#0x14]         ;461
000024  42b0              CMP      r0,r6                 ;461
000026  d101              BNE      |L22.44|
000028  2001              MOVS     r0,#1                 ;462
00002a  e7f3              B        |L22.20|
                  |L22.44|
00002c  2000              MOVS     r0,#0                 ;464
00002e  e7f1              B        |L22.20|
;;;466    
                          ENDP


                          AREA ||i.mdns_add_record||, CODE, READONLY, ALIGN=2

                          REQUIRE _printf_pre_padding
                          REQUIRE _printf_percent
                          REQUIRE _printf_widthprec
                          REQUIRE _printf_d
                          REQUIRE _printf_s
                          REQUIRE _printf_int_dec
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                  mdns_add_record PROC
;;;546    
;;;547    OSStatus mdns_add_record( mdns_init_t init, WiFi_Interface interface, uint32_t time_to_live )
000000  b40f              PUSH     {r0-r3}
;;;548    {
000002  e92d5ffc          PUSH     {r2-r12,lr}
000006  e9dd7811          LDRD     r7,r8,[sp,#0x44]
;;;549      int len;
;;;550      OSStatus err = kNoErr;
00000a  2600              MOVS     r6,#0
;;;551      uint32_t insert_index = 0xFF;
00000c  24ff              MOVS     r4,#0xff
;;;552    
;;;553      if( bonjour_instance == false ){
00000e  4872              LDR      r0,|L23.472|
000010  7800              LDRB     r0,[r0,#0]  ; bonjour_instance
000012  2800              CMP      r0,#0
000014  d131              BNE      |L23.122|
;;;554        err = start_bonjour_service( );
000016  f7fffffe          BL       start_bonjour_service
00001a  4606              MOV      r6,r0
;;;555        require_noerr(err, exit);
00001c  bf00              NOP      
00001e  46b1              MOV      r9,r6
000020  f1b90f00          CMP      r9,#0
000024  d028              BEQ      |L23.120|
000026  bf00              NOP      
000028  486c              LDR      r0,|L23.476|
00002a  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
00002c  b900              CBNZ     r0,|L23.48|
00002e  e021              B        |L23.116|
                  |L23.48|
000030  486b              LDR      r0,|L23.480|
000032  f7fffffe          BL       mico_rtos_lock_mutex
000036  215c              MOVS     r1,#0x5c
000038  a06a              ADR      r0,|L23.484|
00003a  f7fffffe          BL       strrchr
00003e  b128              CBZ      r0,|L23.76|
000040  215c              MOVS     r1,#0x5c
000042  a068              ADR      r0,|L23.484|
000044  f7fffffe          BL       strrchr
000048  1c40              ADDS     r0,r0,#1
00004a  e000              B        |L23.78|
                  |L23.76|
00004c  a065              ADR      r0,|L23.484|
                  |L23.78|
00004e  4682              MOV      r10,r0
000050  f7fffffe          BL       mico_get_time
000054  4683              MOV      r11,r0
000056  a06d              ADR      r0,|L23.524|
000058  f240212b          MOV      r1,#0x22b
00005c  4b6c              LDR      r3,|L23.528|
00005e  4652              MOV      r2,r10
000060  e9cd1000          STRD     r1,r0,[sp,#0]
000064  4659              MOV      r1,r11
000066  a06b              ADR      r0,|L23.532|
000068  f7fffffe          BL       __2printf
00006c  485c              LDR      r0,|L23.480|
00006e  f7fffffe          BL       mico_rtos_unlock_mutex
000072  bf00              NOP      
                  |L23.116|
000074  bf00              NOP      
000076  e0a9              B        |L23.460|
                  |L23.120|
000078  bf00              NOP      
                  |L23.122|
;;;556      }
;;;557      
;;;558      insert_index = find_record_by_service ( init.service_name, interface );
00007a  4639              MOV      r1,r7
00007c  980c              LDR      r0,[sp,#0x30]
00007e  f7fffffe          BL       find_record_by_service
000082  4604              MOV      r4,r0
;;;559      if( insert_index == 0xFF)
000084  2cff              CMP      r4,#0xff
000086  d102              BNE      |L23.142|
;;;560        insert_index = find_empty_record ( );
000088  f7fffffe          BL       find_empty_record
00008c  4604              MOV      r4,r0
                  |L23.142|
;;;561    
;;;562      require_action( insert_index < available_service_count, exit, err = kNoResourcesErr);
00008e  bf00              NOP      
000090  486a              LDR      r0,|L23.572|
000092  7800              LDRB     r0,[r0,#0]  ; available_service_count
000094  4284              CMP      r4,r0
000096  d329              BCC      |L23.236|
000098  bf00              NOP      
00009a  4850              LDR      r0,|L23.476|
00009c  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
00009e  b900              CBNZ     r0,|L23.162|
0000a0  e021              B        |L23.230|
                  |L23.162|
0000a2  484f              LDR      r0,|L23.480|
0000a4  f7fffffe          BL       mico_rtos_lock_mutex
0000a8  215c              MOVS     r1,#0x5c
0000aa  a04e              ADR      r0,|L23.484|
0000ac  f7fffffe          BL       strrchr
0000b0  b128              CBZ      r0,|L23.190|
0000b2  215c              MOVS     r1,#0x5c
0000b4  a04b              ADR      r0,|L23.484|
0000b6  f7fffffe          BL       strrchr
0000ba  1c40              ADDS     r0,r0,#1
0000bc  e000              B        |L23.192|
                  |L23.190|
0000be  a049              ADR      r0,|L23.484|
                  |L23.192|
0000c0  4681              MOV      r9,r0
0000c2  f7fffffe          BL       mico_get_time
0000c6  4682              MOV      r10,r0
0000c8  a050              ADR      r0,|L23.524|
0000ca  f2402132          MOV      r1,#0x232
0000ce  4b50              LDR      r3,|L23.528|
0000d0  464a              MOV      r2,r9
0000d2  e9cd1000          STRD     r1,r0,[sp,#0]
0000d6  4651              MOV      r1,r10
0000d8  a04e              ADR      r0,|L23.532|
0000da  f7fffffe          BL       __2printf
0000de  4840              LDR      r0,|L23.480|
0000e0  f7fffffe          BL       mico_rtos_unlock_mutex
0000e4  bf00              NOP      
                  |L23.230|
0000e6  bf00              NOP      
0000e8  4e55              LDR      r6,|L23.576|
0000ea  e06f              B        |L23.460|
                  |L23.236|
0000ec  bf00              NOP      
;;;563      
;;;564      mico_rtos_lock_mutex( &bonjour_mutex );
0000ee  4855              LDR      r0,|L23.580|
0000f0  f7fffffe          BL       mico_rtos_lock_mutex
;;;565    
;;;566      _clean_record_resource( &available_services[insert_index] );
0000f4  4954              LDR      r1,|L23.584|
0000f6  eb011044          ADD      r0,r1,r4,LSL #5
0000fa  f7fffffe          BL       _clean_record_resource
;;;567    
;;;568      available_services[insert_index].interface = interface;
0000fe  4852              LDR      r0,|L23.584|
000100  eb001044          ADD      r0,r0,r4,LSL #5
000104  7507              STRB     r7,[r0,#0x14]
;;;569      available_services[insert_index].service_name = (char*)__strdup(init.service_name);
000106  980c              LDR      r0,[sp,#0x30]
000108  f7fffffe          BL       __strdup
00010c  494e              LDR      r1,|L23.584|
00010e  eb011144          ADD      r1,r1,r4,LSL #5
000112  6088              STR      r0,[r1,#8]
;;;570      available_services[insert_index].hostname = (char*)__strdup(init.host_name);
000114  980d              LDR      r0,[sp,#0x34]
000116  f7fffffe          BL       __strdup
00011a  494b              LDR      r1,|L23.584|
00011c  eb011144          ADD      r1,r1,r4,LSL #5
000120  6008              STR      r0,[r1,#0]
;;;571    
;;;572      len = strlen(init.instance_name);
000122  980e              LDR      r0,[sp,#0x38]
000124  f7fffffe          BL       strlen
000128  4605              MOV      r5,r0
;;;573      available_services[insert_index].instance_name = (char*)malloc(len+3);//// 0xc00c+\0
00012a  1ce8              ADDS     r0,r5,#3
00012c  f7fffffe          BL       malloc
000130  4945              LDR      r1,|L23.584|
000132  eb011144          ADD      r1,r1,r4,LSL #5
000136  6048              STR      r0,[r1,#4]
;;;574      memcpy(available_services[insert_index].instance_name, init.instance_name, len);
000138  4a43              LDR      r2,|L23.584|
00013a  eb021244          ADD      r2,r2,r4,LSL #5
00013e  990e              LDR      r1,[sp,#0x38]
000140  6850              LDR      r0,[r2,#4]
000142  462a              MOV      r2,r5
000144  f7fffffe          BL       __aeabi_memcpy
;;;575      available_services[insert_index].instance_name[len]= 0xc0;
000148  20c0              MOVS     r0,#0xc0
00014a  493f              LDR      r1,|L23.584|
00014c  eb011144          ADD      r1,r1,r4,LSL #5
000150  6849              LDR      r1,[r1,#4]
000152  5548              STRB     r0,[r1,r5]
;;;576      available_services[insert_index].instance_name[len+1]= 0x0c;
000154  210c              MOVS     r1,#0xc
000156  483c              LDR      r0,|L23.584|
000158  eb001044          ADD      r0,r0,r4,LSL #5
00015c  6842              LDR      r2,[r0,#4]
00015e  1c68              ADDS     r0,r5,#1
000160  5411              STRB     r1,[r2,r0]
;;;577      available_services[insert_index].instance_name[len+2]= 0;
000162  2100              MOVS     r1,#0
000164  4838              LDR      r0,|L23.584|
000166  eb001044          ADD      r0,r0,r4,LSL #5
00016a  6842              LDR      r2,[r0,#4]
00016c  1ca8              ADDS     r0,r5,#2
00016e  5411              STRB     r1,[r2,r0]
;;;578      
;;;579      available_services[insert_index].txt_att = (char*)__strdup(init.txt_record);
000170  980f              LDR      r0,[sp,#0x3c]
000172  f7fffffe          BL       __strdup
000176  4934              LDR      r1,|L23.584|
000178  eb011144          ADD      r1,r1,r4,LSL #5
00017c  60c8              STR      r0,[r1,#0xc]
;;;580    
;;;581      available_services[insert_index].port = init.service_port;
00017e  f8bd0040          LDRH     r0,[sp,#0x40]
000182  4931              LDR      r1,|L23.584|
000184  eb011144          ADD      r1,r1,r4,LSL #5
000188  8388              STRH     r0,[r1,#0x1c]
;;;582      available_services[insert_index].state = RECORD_UPDATE;
00018a  2001              MOVS     r0,#1
00018c  492e              LDR      r1,|L23.584|
00018e  eb011144          ADD      r1,r1,r4,LSL #5
000192  77c8              STRB     r0,[r1,#0x1f]
;;;583      available_services[insert_index].count_down = 5;
000194  2005              MOVS     r0,#5
000196  492c              LDR      r1,|L23.584|
000198  eb011144          ADD      r1,r1,r4,LSL #5
00019c  7788              STRB     r0,[r1,#0x1e]
;;;584      available_services[insert_index].ttl = time_to_live;
00019e  482a              LDR      r0,|L23.584|
0001a0  eb001044          ADD      r0,r0,r4,LSL #5
0001a4  f8c08018          STR      r8,[r0,#0x18]
;;;585      
;;;586      if( _bonjour_announce_handler == NULL)
0001a8  4828              LDR      r0,|L23.588|
0001aa  6800              LDR      r0,[r0,#0]  ; _bonjour_announce_handler
0001ac  b950              CBNZ     r0,|L23.452|
;;;587        mico_rtos_create_thread( &_bonjour_announce_handler, MICO_APPLICATION_PRIORITY, "Bonjour Announce", _bonjour_send_anounce_thread, 0x200, NULL );
0001ae  2000              MOVS     r0,#0
0001b0  f44f7100          MOV      r1,#0x200
0001b4  4b26              LDR      r3,|L23.592|
0001b6  a227              ADR      r2,|L23.596|
0001b8  e9cd1000          STRD     r1,r0,[sp,#0]
0001bc  2107              MOVS     r1,#7
0001be  4823              LDR      r0,|L23.588|
0001c0  f7fffffe          BL       mico_rtos_create_thread
                  |L23.452|
;;;588    
;;;589      mico_rtos_unlock_mutex( &bonjour_mutex );
0001c4  481f              LDR      r0,|L23.580|
0001c6  f7fffffe          BL       mico_rtos_unlock_mutex
;;;590    
;;;591    exit:
0001ca  bf00              NOP      
                  |L23.460|
;;;592      return err;
0001cc  4630              MOV      r0,r6
;;;593    }
0001ce  e8bd1ffc          POP      {r2-r12}
0001d2  f85dfb14          LDR      pc,[sp],#0x14
;;;594    
                          ENDP

0001d6  0000              DCW      0x0000
                  |L23.472|
                          DCD      bonjour_instance
                  |L23.476|
                          DCD      mico_debug_enabled
                  |L23.480|
                          DCD      stdio_tx_mutex
                  |L23.484|
0001e4  2e2e5c2e          DCB      "..\\..\\..\\..\\MICO\\system\\mdns\\mico_mdns.c"
0001e8  2e5c2e2e
0001ec  5c2e2e5c
0001f0  4d49434f
0001f4  5c737973
0001f8  74656d5c
0001fc  6d646e73
000200  5c6d6963
000204  6f5f6d64
000208  6e732e63
                  |L23.524|
00020c  00                DCB      0
00020d  00                DCB      0
00020e  00                DCB      0
00020f  00                DCB      0
                  |L23.528|
                          DCD      __PRETTY_FUNCTION__
                  |L23.532|
000214  5b25645d          DCB      "[%d][MICO:%s:%s:%4d] **ASSERT** %s\r\n",0
000218  5b4d4943
00021c  4f3a2573
000220  3a25733a
000224  2534645d
000228  202a2a41
00022c  53534552
000230  542a2a20
000234  25730d0a
000238  00      
000239  00                DCB      0
00023a  00                DCB      0
00023b  00                DCB      0
                  |L23.572|
                          DCD      available_service_count
                  |L23.576|
                          DCD      0xffffe5b7
                  |L23.580|
                          DCD      bonjour_mutex
                  |L23.584|
                          DCD      available_services
                  |L23.588|
                          DCD      _bonjour_announce_handler
                  |L23.592|
                          DCD      _bonjour_send_anounce_thread
                  |L23.596|
000254  426f6e6a          DCB      "Bonjour Announce",0
000258  6f757220
00025c  416e6e6f
000260  756e6365
000264  00      
000265  00                DCB      0
000266  00                DCB      0
000267  00                DCB      0

                          AREA ||i.mdns_handler||, CODE, READONLY, ALIGN=1

                  mdns_handler PROC
;;;682    
;;;683    void mdns_handler(int fd, uint8_t* pkt, int pkt_len)
000000  b5fe              PUSH     {r1-r7,lr}
;;;684    {
000002  4606              MOV      r6,r0
000004  460c              MOV      r4,r1
000006  4615              MOV      r5,r2
;;;685      dns_message_iterator_t iter;
;;;686      
;;;687      iter.header = (dns_message_header_t*) pkt;
000008  9400              STR      r4,[sp,#0]
;;;688      iter.iter   = (uint8_t*) iter.header + sizeof(dns_message_header_t);
00000a  9800              LDR      r0,[sp,#0]
00000c  300c              ADDS     r0,r0,#0xc
00000e  9001              STR      r0,[sp,#4]
;;;689      iter.end = pkt+pkt_len;
000010  1960              ADDS     r0,r4,r5
000012  9002              STR      r0,[sp,#8]
;;;690      
;;;691      // Check if the message is a response (otherwise its a query)
;;;692      if ( ntohs(iter.header->flags) & DNS_MESSAGE_IS_A_RESPONSE )
000014  9800              LDR      r0,[sp,#0]
000016  7880              LDRB     r0,[r0,#2]
000018  f44f417f          MOV      r1,#0xff00
00001c  ea012000          AND      r0,r1,r0,LSL #8
000020  9900              LDR      r1,[sp,#0]
000022  8849              LDRH     r1,[r1,#2]
000024  ea402011          ORR      r0,r0,r1,LSR #8
000028  f4004000          AND      r0,r0,#0x8000
00002c  b918              CBNZ     r0,|L24.54|
;;;693      {
;;;694      }
;;;695      else
;;;696      {
;;;697        process_dns_questions(fd, &iter );
00002e  4669              MOV      r1,sp
000030  4630              MOV      r0,r6
000032  f7fffffe          BL       process_dns_questions
                  |L24.54|
;;;698      }
;;;699    }
000036  bdfe              POP      {r1-r7,pc}
;;;700    
                          ENDP


                          AREA ||i.mdns_process_query||, CODE, READONLY, ALIGN=2

                  mdns_process_query PROC
;;;166    
;;;167    static void mdns_process_query(int fd, dns_name_t* name, 
000000  e92d43f0          PUSH     {r4-r9,lr}
;;;168                                   dns_question_t* question, dns_message_iterator_t* source )
;;;169    {
000004  b09f              SUB      sp,sp,#0x7c
000006  4680              MOV      r8,r0
000008  460d              MOV      r5,r1
00000a  4616              MOV      r6,r2
00000c  461f              MOV      r7,r3
;;;170      dns_message_iterator_t response;
;;;171      IPStatusTypedef para;
;;;172      uint32_t myip;
;;;173      int b = 0;
00000e  2400              MOVS     r4,#0
;;;174      
;;;175      memset( &response, 0, sizeof(dns_message_iterator_t) );
000010  2000              MOVS     r0,#0
000012  901c              STR      r0,[sp,#0x70]
000014  901d              STR      r0,[sp,#0x74]
000016  901e              STR      r0,[sp,#0x78]
;;;176      
;;;177      switch ( question->question_type )
000018  8830              LDRH     r0,[r6,#0]
00001a  2801              CMP      r0,#1
00001c  d002              BEQ      |L25.36|
00001e  28ff              CMP      r0,#0xff
000020  d170              BNE      |L25.260|
;;;178      {
;;;179      case RR_QTYPE_ANY:
;;;180      case RR_TYPE_A:
000022  bf00              NOP      
                  |L25.36|
;;;181        for ( b = 0; b < available_service_count; ++b ){
000024  2400              MOVS     r4,#0
000026  e068              B        |L25.250|
                  |L25.40|
;;;182          if ( dns_compare_name_to_string( name, available_services[b].hostname ) ){				
000028  4838              LDR      r0,|L25.268|
00002a  eb001044          ADD      r0,r0,r4,LSL #5
00002e  6801              LDR      r1,[r0,#0]
000030  4628              MOV      r0,r5
000032  f7fffffe          BL       dns_compare_name_to_string
000036  2800              CMP      r0,#0
000038  d05d              BEQ      |L25.246|
;;;183    
;;;184            micoWlanGetIPStatus(&para, available_services[b].interface);
00003a  4834              LDR      r0,|L25.268|
00003c  eb001044          ADD      r0,r0,r4,LSL #5
000040  7d01              LDRB     r1,[r0,#0x14]
000042  a803              ADD      r0,sp,#0xc
000044  f7fffffe          BL       getNetPara
;;;185            myip = htonl(inet_addr(para.ip));
000048  f10d000d          ADD      r0,sp,#0xd
00004c  f7fffffe          BL       inet_addr
000050  f04f417f          MOV      r1,#0xff000000
000054  ea016900          AND      r9,r1,r0,LSL #24
000058  f10d000d          ADD      r0,sp,#0xd
00005c  f7fffffe          BL       inet_addr
000060  f44f017f          MOV      r1,#0xff0000
000064  ea012000          AND      r0,r1,r0,LSL #8
000068  ea490900          ORR      r9,r9,r0
00006c  f10d000d          ADD      r0,sp,#0xd
000070  f7fffffe          BL       inet_addr
000074  f44f417f          MOV      r1,#0xff00
000078  ea012010          AND      r0,r1,r0,LSR #8
00007c  ea490900          ORR      r9,r9,r0
000080  f10d000d          ADD      r0,sp,#0xd
000084  f7fffffe          BL       inet_addr
000088  ea496910          ORR      r9,r9,r0,LSR #24
00008c  f8cd9008          STR      r9,[sp,#8]
;;;186            if( myip == 0 || myip == 0xFFFFFFFF) continue;
000090  9802              LDR      r0,[sp,#8]
000092  b110              CBZ      r0,|L25.154|
000094  9802              LDR      r0,[sp,#8]
000096  1c40              ADDS     r0,r0,#1
000098  b900              CBNZ     r0,|L25.156|
                  |L25.154|
00009a  e02d              B        |L25.248|
                  |L25.156|
;;;187    
;;;188            if(dns_create_message( &response, 256 )){
00009c  f44f7180          MOV      r1,#0x100
0000a0  a81c              ADD      r0,sp,#0x70
0000a2  f7fffffe          BL       dns_create_message
0000a6  b330              CBZ      r0,|L25.246|
;;;189              dns_write_header( &response, source->header->id, 0x8400, 0, 1, 0 );
0000a8  2000              MOVS     r0,#0
0000aa  2101              MOVS     r1,#1
0000ac  e9cd1000          STRD     r1,r0,[sp,#0]
0000b0  6838              LDR      r0,[r7,#0]
0000b2  8801              LDRH     r1,[r0,#0]
0000b4  2300              MOVS     r3,#0
0000b6  f44f4204          MOV      r2,#0x8400
0000ba  a81c              ADD      r0,sp,#0x70
0000bc  f7fffffe          BL       dns_write_header
;;;190              dns_write_record( &response, available_services[b].hostname, RR_CLASS_IN | RR_CACHE_FLUSH, RR_TYPE_A, available_services[b].ttl, (uint8_t *)&myip);
0000c0  a902              ADD      r1,sp,#8
0000c2  4812              LDR      r0,|L25.268|
0000c4  eb001044          ADD      r0,r0,r4,LSL #5
0000c8  6980              LDR      r0,[r0,#0x18]
0000ca  e9cd0100          STRD     r0,r1,[sp,#0]
0000ce  480f              LDR      r0,|L25.268|
0000d0  eb001044          ADD      r0,r0,r4,LSL #5
0000d4  2301              MOVS     r3,#1
0000d6  f2480201          MOV      r2,#0x8001
0000da  6801              LDR      r1,[r0,#0]
0000dc  a81c              ADD      r0,sp,#0x70
0000de  f7fffffe          BL       dns_write_record
;;;191              mdns_send_message(fd, &response );
0000e2  a91c              ADD      r1,sp,#0x70
0000e4  4640              MOV      r0,r8
0000e6  f7fffffe          BL       mdns_send_message
;;;192              dns_free_message( &response );
0000ea  a81c              ADD      r0,sp,#0x70
0000ec  f7fffffe          BL       dns_free_message
                  |L25.240|
;;;193              return;
;;;194            }
;;;195          }
;;;196        }    
;;;197      default:
;;;198       break;;
;;;199      }
;;;200    }
0000f0  b01f              ADD      sp,sp,#0x7c
0000f2  e8bd83f0          POP      {r4-r9,pc}
                  |L25.246|
0000f6  bf00              NOP                            ;186
                  |L25.248|
0000f8  1c64              ADDS     r4,r4,#1              ;181
                  |L25.250|
0000fa  4805              LDR      r0,|L25.272|
0000fc  7800              LDRB     r0,[r0,#0]            ;181  ; available_service_count
0000fe  4284              CMP      r4,r0                 ;181
000100  db92              BLT      |L25.40|
000102  bf00              NOP                            ;197
                  |L25.260|
000104  bf00              NOP                            ;198
000106  bf00              NOP                            ;198
000108  bf00              NOP      
00010a  e7f1              B        |L25.240|
;;;201    
                          ENDP

                  |L25.268|
                          DCD      available_services
                  |L25.272|
                          DCD      available_service_count

                          AREA ||i.mdns_resume_record||, CODE, READONLY, ALIGN=2

                  mdns_resume_record PROC
;;;656    
;;;657    void mdns_resume_record( char *service_name, WiFi_Interface interface )
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;658    {
000004  4605              MOV      r5,r0
000006  460e              MOV      r6,r1
;;;659      int i;
;;;660      uint32_t insert_index = 0xFF;
000008  27ff              MOVS     r7,#0xff
;;;661    
;;;662      if( bonjour_instance == false ) return;
00000a  481d              LDR      r0,|L26.128|
00000c  7800              LDRB     r0,[r0,#0]  ; bonjour_instance
00000e  b908              CBNZ     r0,|L26.20|
                  |L26.16|
;;;663    
;;;664      mico_rtos_lock_mutex( &bonjour_mutex );
;;;665    
;;;666      for ( i = 0; i < available_service_count && is_service_match( &available_services[i], service_name, interface ); i++ ){
;;;667        available_services[i].state = RECORD_UPDATE;
;;;668        available_services[i].count_down = 5; 
;;;669        insert_index = i;
;;;670      }
;;;671    
;;;672      if( insert_index == 0xFF )
;;;673        goto exit;
;;;674    
;;;675      if( _bonjour_announce_handler == NULL)
;;;676        mico_rtos_create_thread( &_bonjour_announce_handler, MICO_APPLICATION_PRIORITY, "Bonjour Announce", _bonjour_send_anounce_thread, 0x200, NULL );
;;;677    
;;;678    exit:
;;;679      mico_rtos_unlock_mutex( &bonjour_mutex );
;;;680      return;
;;;681    }
000010  e8bd81fc          POP      {r2-r8,pc}
                  |L26.20|
000014  481b              LDR      r0,|L26.132|
000016  f7fffffe          BL       mico_rtos_lock_mutex
00001a  2400              MOVS     r4,#0                 ;666
00001c  e00b              B        |L26.54|
                  |L26.30|
00001e  2001              MOVS     r0,#1                 ;667
000020  4919              LDR      r1,|L26.136|
000022  eb011144          ADD      r1,r1,r4,LSL #5       ;667
000026  77c8              STRB     r0,[r1,#0x1f]         ;667
000028  2005              MOVS     r0,#5                 ;668
00002a  4917              LDR      r1,|L26.136|
00002c  eb011144          ADD      r1,r1,r4,LSL #5       ;668
000030  7788              STRB     r0,[r1,#0x1e]         ;668
000032  4627              MOV      r7,r4                 ;669
000034  1c64              ADDS     r4,r4,#1              ;666
                  |L26.54|
000036  4815              LDR      r0,|L26.140|
000038  7800              LDRB     r0,[r0,#0]            ;666  ; available_service_count
00003a  4284              CMP      r4,r0                 ;666
00003c  da08              BGE      |L26.80|
00003e  4912              LDR      r1,|L26.136|
000040  eb011044          ADD      r0,r1,r4,LSL #5       ;666
000044  4632              MOV      r2,r6                 ;666
000046  4629              MOV      r1,r5                 ;666
000048  f7fffffe          BL       is_service_match
00004c  2800              CMP      r0,#0                 ;666
00004e  d1e6              BNE      |L26.30|
                  |L26.80|
000050  2fff              CMP      r7,#0xff              ;672
000052  d100              BNE      |L26.86|
000054  e00e              B        |L26.116|
                  |L26.86|
000056  480e              LDR      r0,|L26.144|
000058  6800              LDR      r0,[r0,#0]            ;675  ; _bonjour_announce_handler
00005a  b950              CBNZ     r0,|L26.114|
00005c  2000              MOVS     r0,#0                 ;676
00005e  f44f7100          MOV      r1,#0x200             ;676
000062  4b0c              LDR      r3,|L26.148|
000064  a20c              ADR      r2,|L26.152|
000066  e9cd1000          STRD     r1,r0,[sp,#0]         ;676
00006a  2107              MOVS     r1,#7                 ;676
00006c  4808              LDR      r0,|L26.144|
00006e  f7fffffe          BL       mico_rtos_create_thread
                  |L26.114|
000072  bf00              NOP                            ;678
                  |L26.116|
000074  4803              LDR      r0,|L26.132|
000076  f7fffffe          BL       mico_rtos_unlock_mutex
00007a  bf00              NOP                            ;680
00007c  e7c8              B        |L26.16|
;;;682    
                          ENDP

00007e  0000              DCW      0x0000
                  |L26.128|
                          DCD      bonjour_instance
                  |L26.132|
                          DCD      bonjour_mutex
                  |L26.136|
                          DCD      available_services
                  |L26.140|
                          DCD      available_service_count
                  |L26.144|
                          DCD      _bonjour_announce_handler
                  |L26.148|
                          DCD      _bonjour_send_anounce_thread
                  |L26.152|
000098  426f6e6a          DCB      "Bonjour Announce",0
00009c  6f757220
0000a0  416e6e6f
0000a4  756e6365
0000a8  00      
0000a9  00                DCB      0
0000aa  00                DCB      0
0000ab  00                DCB      0

                          AREA ||i.mdns_send_message||, CODE, READONLY, ALIGN=2

                  mdns_send_message PROC
;;;382    
;;;383    static void mdns_send_message(int fd, dns_message_iterator_t* message )
000000  b530              PUSH     {r4,r5,lr}
;;;384    {
000002  b087              SUB      sp,sp,#0x1c
000004  4605              MOV      r5,r0
000006  460c              MOV      r4,r1
;;;385      struct sockaddr_t addr;
;;;386      
;;;387      addr.s_ip = inet_addr("224.0.0.251");
000008  a014              ADR      r0,|L27.92|
00000a  f7fffffe          BL       inet_addr
00000e  9003              STR      r0,[sp,#0xc]
;;;388      addr.s_port = 5353;
000010  f24140e9          MOV      r0,#0x14e9
000014  f8ad000a          STRH     r0,[sp,#0xa]
;;;389      sendto(fd, message->header, message->iter - (uint8_t*)message->header, 0, &addr, sizeof(addr));
000018  2014              MOVS     r0,#0x14
00001a  a902              ADD      r1,sp,#8
00001c  e9cd1000          STRD     r1,r0,[sp,#0]
000020  e9d43000          LDRD     r3,r0,[r4,#0]
000024  1ac2              SUBS     r2,r0,r3
000026  4619              MOV      r1,r3
000028  2300              MOVS     r3,#0
00002a  4628              MOV      r0,r5
00002c  f7fffffe          BL       sendto
;;;390      addr.s_ip = inet_addr("255.255.255.255");
000030  a00d              ADR      r0,|L27.104|
000032  f7fffffe          BL       inet_addr
000036  9003              STR      r0,[sp,#0xc]
;;;391      addr.s_port = 5353;
000038  f24140e9          MOV      r0,#0x14e9
00003c  f8ad000a          STRH     r0,[sp,#0xa]
;;;392      sendto(fd, message->header, message->iter - (uint8_t*)message->header, 0, &addr, sizeof(addr));
000040  2014              MOVS     r0,#0x14
000042  a902              ADD      r1,sp,#8
000044  e9cd1000          STRD     r1,r0,[sp,#0]
000048  e9d43000          LDRD     r3,r0,[r4,#0]
00004c  1ac2              SUBS     r2,r0,r3
00004e  4619              MOV      r1,r3
000050  2300              MOVS     r3,#0
000052  4628              MOV      r0,r5
000054  f7fffffe          BL       sendto
;;;393    }
000058  b007              ADD      sp,sp,#0x1c
00005a  bd30              POP      {r4,r5,pc}
;;;394    
                          ENDP

                  |L27.92|
00005c  3232342e          DCB      "224.0.0.251",0
000060  302e302e
000064  32353100
                  |L27.104|
000068  3235352e          DCB      "255.255.255.255",0
00006c  3235352e
000070  3235352e
000074  32353500

                          AREA ||i.mdns_suspend_record||, CODE, READONLY, ALIGN=2

                  mdns_suspend_record PROC
;;;618    
;;;619    void mdns_suspend_record( char *service_name, WiFi_Interface interface, bool will_remove )
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;620    {
000004  4605              MOV      r5,r0
000006  460e              MOV      r6,r1
000008  4617              MOV      r7,r2
;;;621      int i;
;;;622      uint32_t insert_index = 0xFF;
00000a  f04f08ff          MOV      r8,#0xff
;;;623      
;;;624      mdns_utils_log( "Suspend %s@%d",  service_name, interface);
;;;625    
;;;626      if( bonjour_instance == false ) return;
00000e  4825              LDR      r0,|L28.164|
000010  7800              LDRB     r0,[r0,#0]  ; bonjour_instance
000012  b908              CBNZ     r0,|L28.24|
                  |L28.20|
;;;627    
;;;628      mico_rtos_lock_mutex( &bonjour_mutex );
;;;629    
;;;630      for ( i = 0; i < available_service_count; i++ ){
;;;631        if( is_service_match ( &available_services[i], service_name, interface ) == false) 
;;;632          continue;
;;;633        
;;;634        mdns_utils_log( "Find index %d to suspend", i);
;;;635        if( will_remove == true )
;;;636          available_services[i].state = RECORD_REMOVE;
;;;637        else{
;;;638          if( available_services[i].state != RECORD_REMOVE )
;;;639            available_services[i].state = RECORD_SUSPEND;
;;;640        }
;;;641      
;;;642        available_services[i].count_down = 5; 
;;;643        insert_index = i;
;;;644      }
;;;645    
;;;646      if( insert_index == 0xFF )
;;;647        goto exit;
;;;648    
;;;649      if( _bonjour_announce_handler == NULL)
;;;650        mico_rtos_create_thread( &_bonjour_announce_handler, MICO_APPLICATION_PRIORITY, "Bonjour Announce", _bonjour_send_anounce_thread, 0x200, NULL );
;;;651    
;;;652    exit:
;;;653      mico_rtos_unlock_mutex( &bonjour_mutex );
;;;654      return;
;;;655    }
000014  e8bd81fc          POP      {r2-r8,pc}
                  |L28.24|
000018  4823              LDR      r0,|L28.168|
00001a  f7fffffe          BL       mico_rtos_lock_mutex
00001e  2400              MOVS     r4,#0                 ;630
000020  e023              B        |L28.106|
                  |L28.34|
000022  4922              LDR      r1,|L28.172|
000024  eb011044          ADD      r0,r1,r4,LSL #5       ;631
000028  4632              MOV      r2,r6                 ;631
00002a  4629              MOV      r1,r5                 ;631
00002c  f7fffffe          BL       is_service_match
000030  b900              CBNZ     r0,|L28.52|
000032  e019              B        |L28.104|
                  |L28.52|
000034  2f01              CMP      r7,#1                 ;635
000036  d105              BNE      |L28.68|
000038  2002              MOVS     r0,#2                 ;636
00003a  491c              LDR      r1,|L28.172|
00003c  eb011144          ADD      r1,r1,r4,LSL #5       ;636
000040  77c8              STRB     r0,[r1,#0x1f]         ;636
000042  e00a              B        |L28.90|
                  |L28.68|
000044  4819              LDR      r0,|L28.172|
000046  eb001044          ADD      r0,r0,r4,LSL #5       ;638
00004a  7fc0              LDRB     r0,[r0,#0x1f]         ;638
00004c  2802              CMP      r0,#2                 ;638
00004e  d004              BEQ      |L28.90|
000050  2003              MOVS     r0,#3                 ;639
000052  4916              LDR      r1,|L28.172|
000054  eb011144          ADD      r1,r1,r4,LSL #5       ;639
000058  77c8              STRB     r0,[r1,#0x1f]         ;639
                  |L28.90|
00005a  2005              MOVS     r0,#5                 ;642
00005c  4913              LDR      r1,|L28.172|
00005e  eb011144          ADD      r1,r1,r4,LSL #5       ;642
000062  7788              STRB     r0,[r1,#0x1e]         ;642
000064  46a0              MOV      r8,r4                 ;643
000066  bf00              NOP                            ;632
                  |L28.104|
000068  1c64              ADDS     r4,r4,#1              ;630
                  |L28.106|
00006a  4811              LDR      r0,|L28.176|
00006c  7800              LDRB     r0,[r0,#0]            ;630  ; available_service_count
00006e  4284              CMP      r4,r0                 ;630
000070  dbd7              BLT      |L28.34|
000072  f1b80fff          CMP      r8,#0xff              ;646
000076  d100              BNE      |L28.122|
000078  e00e              B        |L28.152|
                  |L28.122|
00007a  480e              LDR      r0,|L28.180|
00007c  6800              LDR      r0,[r0,#0]            ;649  ; _bonjour_announce_handler
00007e  b950              CBNZ     r0,|L28.150|
000080  2000              MOVS     r0,#0                 ;650
000082  f44f7100          MOV      r1,#0x200             ;650
000086  4b0c              LDR      r3,|L28.184|
000088  a20c              ADR      r2,|L28.188|
00008a  e9cd1000          STRD     r1,r0,[sp,#0]         ;650
00008e  2107              MOVS     r1,#7                 ;650
000090  4808              LDR      r0,|L28.180|
000092  f7fffffe          BL       mico_rtos_create_thread
                  |L28.150|
000096  bf00              NOP                            ;652
                  |L28.152|
000098  4803              LDR      r0,|L28.168|
00009a  f7fffffe          BL       mico_rtos_unlock_mutex
00009e  bf00              NOP                            ;654
0000a0  e7b8              B        |L28.20|
;;;656    
                          ENDP

0000a2  0000              DCW      0x0000
                  |L28.164|
                          DCD      bonjour_instance
                  |L28.168|
                          DCD      bonjour_mutex
                  |L28.172|
                          DCD      available_services
                  |L28.176|
                          DCD      available_service_count
                  |L28.180|
                          DCD      _bonjour_announce_handler
                  |L28.184|
                          DCD      _bonjour_send_anounce_thread
                  |L28.188|
0000bc  426f6e6a          DCB      "Bonjour Announce",0
0000c0  6f757220
0000c4  416e6e6f
0000c8  756e6365
0000cc  00      
0000cd  00                DCB      0
0000ce  00                DCB      0
0000cf  00                DCB      0

                          AREA ||i.mdns_update_txt_record||, CODE, READONLY, ALIGN=2

                  mdns_update_txt_record PROC
;;;595    
;;;596    void mdns_update_txt_record( char *service_name, WiFi_Interface interface, char *txt_record )
000000  e92d41fc          PUSH     {r2-r8,lr}
;;;597    {
000004  4606              MOV      r6,r0
000006  460f              MOV      r7,r1
000008  4615              MOV      r5,r2
;;;598      uint32_t insert_index = 0xFF;
00000a  24ff              MOVS     r4,#0xff
;;;599    
;;;600      if( bonjour_instance == false ) return;
00000c  481f              LDR      r0,|L29.140|
00000e  7800              LDRB     r0,[r0,#0]  ; bonjour_instance
000010  b908              CBNZ     r0,|L29.22|
                  |L29.18|
;;;601    
;;;602      insert_index = find_record_by_service ( service_name, interface );
;;;603      if( insert_index == 0xFF ) return;
;;;604    
;;;605      mico_rtos_lock_mutex( &bonjour_mutex );
;;;606    
;;;607      if(available_services[insert_index].txt_att)  free(available_services[insert_index].txt_att);
;;;608      available_services[insert_index].txt_att = (char*)__strdup(txt_record);
;;;609      available_services[insert_index].state = RECORD_UPDATE;
;;;610      available_services[insert_index].count_down = 5;
;;;611    
;;;612      if( _bonjour_announce_handler == NULL)
;;;613        mico_rtos_create_thread( &_bonjour_announce_handler, MICO_APPLICATION_PRIORITY, "Bonjour Announce", _bonjour_send_anounce_thread, 0x200, NULL );
;;;614    
;;;615      mico_rtos_unlock_mutex( &bonjour_mutex );
;;;616    }
000012  e8bd81fc          POP      {r2-r8,pc}
                  |L29.22|
000016  4639              MOV      r1,r7                 ;602
000018  4630              MOV      r0,r6                 ;602
00001a  f7fffffe          BL       find_record_by_service
00001e  4604              MOV      r4,r0                 ;602
000020  2cff              CMP      r4,#0xff              ;603
000022  d100              BNE      |L29.38|
000024  e7f5              B        |L29.18|
                  |L29.38|
000026  481a              LDR      r0,|L29.144|
000028  f7fffffe          BL       mico_rtos_lock_mutex
00002c  4819              LDR      r0,|L29.148|
00002e  eb001044          ADD      r0,r0,r4,LSL #5       ;607
000032  68c0              LDR      r0,[r0,#0xc]          ;607
000034  b128              CBZ      r0,|L29.66|
000036  4917              LDR      r1,|L29.148|
000038  eb011144          ADD      r1,r1,r4,LSL #5       ;607
00003c  68c8              LDR      r0,[r1,#0xc]          ;607
00003e  f7fffffe          BL       free
                  |L29.66|
000042  4628              MOV      r0,r5                 ;608
000044  f7fffffe          BL       __strdup
000048  4912              LDR      r1,|L29.148|
00004a  eb011144          ADD      r1,r1,r4,LSL #5       ;608
00004e  60c8              STR      r0,[r1,#0xc]          ;608
000050  2001              MOVS     r0,#1                 ;609
000052  4910              LDR      r1,|L29.148|
000054  eb011144          ADD      r1,r1,r4,LSL #5       ;609
000058  77c8              STRB     r0,[r1,#0x1f]         ;609
00005a  2005              MOVS     r0,#5                 ;610
00005c  490d              LDR      r1,|L29.148|
00005e  eb011144          ADD      r1,r1,r4,LSL #5       ;610
000062  7788              STRB     r0,[r1,#0x1e]         ;610
000064  480c              LDR      r0,|L29.152|
000066  6800              LDR      r0,[r0,#0]            ;612  ; _bonjour_announce_handler
000068  b950              CBNZ     r0,|L29.128|
00006a  2000              MOVS     r0,#0                 ;613
00006c  f44f7100          MOV      r1,#0x200             ;613
000070  4b0a              LDR      r3,|L29.156|
000072  a20b              ADR      r2,|L29.160|
000074  e9cd1000          STRD     r1,r0,[sp,#0]         ;613
000078  2107              MOVS     r1,#7                 ;613
00007a  4807              LDR      r0,|L29.152|
00007c  f7fffffe          BL       mico_rtos_create_thread
                  |L29.128|
000080  4803              LDR      r0,|L29.144|
000082  f7fffffe          BL       mico_rtos_unlock_mutex
000086  bf00              NOP      
000088  e7c3              B        |L29.18|
;;;617      
                          ENDP

00008a  0000              DCW      0x0000
                  |L29.140|
                          DCD      bonjour_instance
                  |L29.144|
                          DCD      bonjour_mutex
                  |L29.148|
                          DCD      available_services
                  |L29.152|
                          DCD      _bonjour_announce_handler
                  |L29.156|
                          DCD      _bonjour_send_anounce_thread
                  |L29.160|
0000a0  426f6e6a          DCB      "Bonjour Announce",0
0000a4  6f757220
0000a8  416e6e6f
0000ac  756e6365
0000b0  00      
0000b1  00                DCB      0
0000b2  00                DCB      0
0000b3  00                DCB      0

                          AREA ||i.process_dns_questions||, CODE, READONLY, ALIGN=2

                  process_dns_questions PROC
;;;93     
;;;94     void process_dns_questions(int fd, dns_message_iterator_t* iter )
000000  e92d43f0          PUSH     {r4-r9,lr}
;;;95     {
000004  b0a3              SUB      sp,sp,#0x8c
000006  4607              MOV      r7,r0
000008  460d              MOV      r5,r1
;;;96       dns_name_t name;
;;;97       dns_question_t question;
;;;98       dns_message_iterator_t response;
;;;99       IPStatusTypedef para;
;;;100      int a = 0;
00000a  2600              MOVS     r6,#0
;;;101      int question_processed;
;;;102      uint32_t myip;
;;;103      
;;;104      memset( &response, 0, sizeof(dns_message_iterator_t) );
00000c  2000              MOVS     r0,#0
00000e  901d              STR      r0,[sp,#0x74]
000010  901e              STR      r0,[sp,#0x78]
000012  901f              STR      r0,[sp,#0x7c]
;;;105      
;;;106      for ( a = 0; a < htons(iter->header->question_count); ++a )
000014  bf00              NOP      
000016  e10c              B        |L30.562|
                  |L30.24|
;;;107      {
;;;108        if (iter->iter > iter->end)
000018  e9d50101          LDRD     r0,r1,[r5,#4]
00001c  4288              CMP      r0,r1
00001e  d900              BLS      |L30.34|
;;;109          break;
000020  e114              B        |L30.588|
                  |L30.34|
;;;110        if(dns_get_next_question( iter, &question, &name )==0)
000022  aa21              ADD      r2,sp,#0x84
000024  a920              ADD      r1,sp,#0x80
000026  4628              MOV      r0,r5
000028  f7fffffe          BL       dns_get_next_question
00002c  b900              CBNZ     r0,|L30.48|
;;;111          break;
00002e  e10d              B        |L30.588|
                  |L30.48|
;;;112        question_processed = 0;
000030  f04f0800          MOV      r8,#0
;;;113        switch ( question.question_type ){
000034  f8bd0080          LDRH     r0,[sp,#0x80]
000038  280c              CMP      r0,#0xc
00003a  d17c              BNE      |L30.310|
;;;114        case RR_TYPE_PTR:
;;;115          if ( available_services != NULL ){
;;;116            // Check if its a query for all available services  
;;;117            if ( dns_compare_name_to_string( &name, SERVICE_QUERY_NAME ) ){
00003c  a185              ADR      r1,|L30.596|
00003e  a821              ADD      r0,sp,#0x84
000040  f7fffffe          BL       dns_compare_name_to_string
000044  2800              CMP      r0,#0
000046  d032              BEQ      |L30.174|
;;;118              int b = 0;
000048  2400              MOVS     r4,#0
;;;119              if(dns_create_message( &response, 512 )) {
00004a  f44f7100          MOV      r1,#0x200
00004e  a81d              ADD      r0,sp,#0x74
000050  f7fffffe          BL       dns_create_message
000054  b350              CBZ      r0,|L30.172|
;;;120                dns_write_header(&response, iter->header->id, 0x8400, 0, available_service_count, 0 );          
000056  2000              MOVS     r0,#0
000058  4986              LDR      r1,|L30.628|
00005a  7809              LDRB     r1,[r1,#0]  ; available_service_count
00005c  e9cd1000          STRD     r1,r0,[sp,#0]
000060  6828              LDR      r0,[r5,#0]
000062  8801              LDRH     r1,[r0,#0]
000064  2300              MOVS     r3,#0
000066  f44f4204          MOV      r2,#0x8400
00006a  a81d              ADD      r0,sp,#0x74
00006c  f7fffffe          BL       dns_write_header
;;;121                for ( b = 0; b < available_service_count; ++b ){
000070  bf00              NOP      
000072  e00e              B        |L30.146|
                  |L30.116|
;;;122                  dns_write_record( &response, SERVICE_QUERY_NAME, RR_CLASS_IN, RR_TYPE_PTR, 1500, (uint8_t*) available_services[b].service_name );
000074  4880              LDR      r0,|L30.632|
000076  eb001044          ADD      r0,r0,r4,LSL #5
00007a  6880              LDR      r0,[r0,#8]
00007c  f24051dc          MOV      r1,#0x5dc
000080  230c              MOVS     r3,#0xc
000082  2201              MOVS     r2,#1
000084  e9cd1000          STRD     r1,r0,[sp,#0]
000088  a172              ADR      r1,|L30.596|
00008a  a81d              ADD      r0,sp,#0x74
00008c  f7fffffe          BL       dns_write_record
000090  1c64              ADDS     r4,r4,#1              ;121
                  |L30.146|
000092  4878              LDR      r0,|L30.628|
000094  7800              LDRB     r0,[r0,#0]            ;121  ; available_service_count
000096  4284              CMP      r4,r0                 ;121
000098  dbec              BLT      |L30.116|
;;;123                }
;;;124                mdns_send_message(fd, &response );
00009a  a91d              ADD      r1,sp,#0x74
00009c  4638              MOV      r0,r7
00009e  f7fffffe          BL       mdns_send_message
;;;125                dns_free_message( &response );
0000a2  a81d              ADD      r0,sp,#0x74
0000a4  f7fffffe          BL       dns_free_message
;;;126                question_processed = 1;
0000a8  f04f0801          MOV      r8,#1
                  |L30.172|
;;;127              }
;;;128            }
0000ac  e0b5              B        |L30.538|
                  |L30.174|
;;;129            // else check if its one of our records
;;;130            else {
;;;131              int b = 0;
0000ae  2400              MOVS     r4,#0
;;;132              for ( b = 0; b < available_service_count; ++b ){
0000b0  bf00              NOP      
0000b2  e0ac              B        |L30.526|
                  |L30.180|
;;;133                //printf("UDP multicast test: Recv a SERVICE Detail request: %s.\r\n", name);
;;;134                if ( dns_compare_name_to_string( &name, available_services[b].service_name )){
0000b4  4870              LDR      r0,|L30.632|
0000b6  eb001044          ADD      r0,r0,r4,LSL #5
0000ba  6881              LDR      r1,[r0,#8]
0000bc  a821              ADD      r0,sp,#0x84
0000be  f7fffffe          BL       dns_compare_name_to_string
0000c2  2800              CMP      r0,#0
0000c4  d07d              BEQ      |L30.450|
;;;135                  
;;;136                  if( available_services[b].state != RECORD_NORMAL )
0000c6  486c              LDR      r0,|L30.632|
0000c8  eb001044          ADD      r0,r0,r4,LSL #5
0000cc  7fc0              LDRB     r0,[r0,#0x1f]
0000ce  2804              CMP      r0,#4
0000d0  d000              BEQ      |L30.212|
;;;137                    continue;
0000d2  e09b              B        |L30.524|
                  |L30.212|
;;;138    
;;;139                  micoWlanGetIPStatus(&para, available_services[b].interface);
0000d4  4868              LDR      r0,|L30.632|
0000d6  eb001044          ADD      r0,r0,r4,LSL #5
0000da  7d01              LDRB     r1,[r0,#0x14]
0000dc  a804              ADD      r0,sp,#0x10
0000de  f7fffffe          BL       getNetPara
;;;140                  myip = htonl(inet_addr(para.ip));
0000e2  f10d0011          ADD      r0,sp,#0x11
0000e6  f7fffffe          BL       inet_addr
0000ea  f04f417f          MOV      r1,#0xff000000
0000ee  ea016900          AND      r9,r1,r0,LSL #24
0000f2  f10d0011          ADD      r0,sp,#0x11
0000f6  f7fffffe          BL       inet_addr
0000fa  f44f017f          MOV      r1,#0xff0000
0000fe  ea012000          AND      r0,r1,r0,LSL #8
000102  ea490900          ORR      r9,r9,r0
000106  f10d0011          ADD      r0,sp,#0x11
00010a  f7fffffe          BL       inet_addr
00010e  f44f417f          MOV      r1,#0xff00
000112  ea012010          AND      r0,r1,r0,LSR #8
000116  ea490900          ORR      r9,r9,r0
00011a  f10d0011          ADD      r0,sp,#0x11
00011e  f7fffffe          BL       inet_addr
000122  ea496910          ORR      r9,r9,r0,LSR #24
000126  f8cd900c          STR      r9,[sp,#0xc]
;;;141                  if( myip == 0 || myip == 0xFFFFFFFF) continue;
00012a  9803              LDR      r0,[sp,#0xc]
00012c  b110              CBZ      r0,|L30.308|
00012e  9803              LDR      r0,[sp,#0xc]
000130  1c40              ADDS     r0,r0,#1
000132  b908              CBNZ     r0,|L30.312|
                  |L30.308|
000134  e06a              B        |L30.524|
                  |L30.310|
000136  e071              B        |L30.540|
                  |L30.312|
;;;142                  
;;;143                  // Send the PTR, TXT, SRV and A records
;;;144                  if(dns_create_message( &response, 512 )){
000138  f44f7100          MOV      r1,#0x200
00013c  a81d              ADD      r0,sp,#0x74
00013e  f7fffffe          BL       dns_create_message
000142  2800              CMP      r0,#0
000144  d061              BEQ      |L30.522|
;;;145                    dns_write_header( &response, iter->header->id, 0x8400, 0, 4, 0 );
000146  2000              MOVS     r0,#0
000148  2104              MOVS     r1,#4
00014a  e9cd1000          STRD     r1,r0,[sp,#0]
00014e  6828              LDR      r0,[r5,#0]
000150  8801              LDRH     r1,[r0,#0]
000152  2300              MOVS     r3,#0
000154  f44f4204          MOV      r2,#0x8400
000158  a81d              ADD      r0,sp,#0x74
00015a  f7fffffe          BL       dns_write_header
;;;146                    //dns_write_record( &response, MFi_SERVICE_QUERY_NAME, RR_CLASS_IN, RR_TYPE_PTR, 1500, (u8*) available_services[b].service_name );
;;;147                    dns_write_record( &response, available_services[b].service_name, RR_CLASS_IN, RR_TYPE_PTR, available_services[b].ttl, (uint8_t*) available_services[b].instance_name );
00015e  4846              LDR      r0,|L30.632|
000160  eb001044          ADD      r0,r0,r4,LSL #5
000164  6840              LDR      r0,[r0,#4]
000166  4944              LDR      r1,|L30.632|
000168  eb011144          ADD      r1,r1,r4,LSL #5
00016c  6989              LDR      r1,[r1,#0x18]
00016e  e9cd1000          STRD     r1,r0,[sp,#0]
000172  4841              LDR      r0,|L30.632|
000174  eb001044          ADD      r0,r0,r4,LSL #5
000178  230c              MOVS     r3,#0xc
00017a  2201              MOVS     r2,#1
00017c  6881              LDR      r1,[r0,#8]
00017e  a81d              ADD      r0,sp,#0x74
000180  f7fffffe          BL       dns_write_record
;;;148                    dns_write_record( &response, available_services[b].instance_name, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_TXT, available_services[b].ttl, (uint8_t*) available_services[b].txt_att );
000184  483c              LDR      r0,|L30.632|
000186  eb001044          ADD      r0,r0,r4,LSL #5
00018a  68c0              LDR      r0,[r0,#0xc]
00018c  493a              LDR      r1,|L30.632|
00018e  eb011144          ADD      r1,r1,r4,LSL #5
000192  6989              LDR      r1,[r1,#0x18]
000194  e9cd1000          STRD     r1,r0,[sp,#0]
000198  4837              LDR      r0,|L30.632|
00019a  eb001044          ADD      r0,r0,r4,LSL #5
00019e  2310              MOVS     r3,#0x10
0001a0  f2480201          MOV      r2,#0x8001
0001a4  6841              LDR      r1,[r0,#4]
0001a6  a81d              ADD      r0,sp,#0x74
0001a8  f7fffffe          BL       dns_write_record
;;;149                    dns_write_record( &response, available_services[b].instance_name, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_SRV, available_services[b].ttl, (uint8_t*) &available_services[b]);
0001ac  4832              LDR      r0,|L30.632|
0001ae  eb001044          ADD      r0,r0,r4,LSL #5
0001b2  4931              LDR      r1,|L30.632|
0001b4  eb011144          ADD      r1,r1,r4,LSL #5
0001b8  6989              LDR      r1,[r1,#0x18]
0001ba  e9cd1000          STRD     r1,r0,[sp,#0]
0001be  482e              LDR      r0,|L30.632|
0001c0  e000              B        |L30.452|
                  |L30.450|
0001c2  e022              B        |L30.522|
                  |L30.452|
0001c4  eb001044          ADD      r0,r0,r4,LSL #5
0001c8  2321              MOVS     r3,#0x21
0001ca  f2480201          MOV      r2,#0x8001
0001ce  6841              LDR      r1,[r0,#4]
0001d0  a81d              ADD      r0,sp,#0x74
0001d2  f7fffffe          BL       dns_write_record
;;;150                    dns_write_record( &response, available_services[b].hostname, RR_CACHE_FLUSH|RR_CLASS_IN, RR_TYPE_A, available_services[b].ttl, (uint8_t*) &myip);
0001d6  a903              ADD      r1,sp,#0xc
0001d8  4827              LDR      r0,|L30.632|
0001da  eb001044          ADD      r0,r0,r4,LSL #5
0001de  6980              LDR      r0,[r0,#0x18]
0001e0  e9cd0100          STRD     r0,r1,[sp,#0]
0001e4  4824              LDR      r0,|L30.632|
0001e6  eb001044          ADD      r0,r0,r4,LSL #5
0001ea  2301              MOVS     r3,#1
0001ec  f2480201          MOV      r2,#0x8001
0001f0  6801              LDR      r1,[r0,#0]
0001f2  a81d              ADD      r0,sp,#0x74
0001f4  f7fffffe          BL       dns_write_record
;;;151                    mdns_send_message(fd, &response );
0001f8  a91d              ADD      r1,sp,#0x74
0001fa  4638              MOV      r0,r7
0001fc  f7fffffe          BL       mdns_send_message
;;;152                    dns_free_message( &response );
000200  a81d              ADD      r0,sp,#0x74
000202  f7fffffe          BL       dns_free_message
;;;153                    question_processed = 1;
000206  f04f0801          MOV      r8,#1
                  |L30.522|
00020a  bf00              NOP                            ;137
                  |L30.524|
00020c  1c64              ADDS     r4,r4,#1              ;132
                  |L30.526|
00020e  4819              LDR      r0,|L30.628|
000210  7800              LDRB     r0,[r0,#0]            ;132  ; available_service_count
000212  4284              CMP      r4,r0                 ;132
000214  f6ffaf4e          BLT      |L30.180|
;;;154                  }
;;;155                }
;;;156              }
;;;157            }
000218  bf00              NOP      
                  |L30.538|
;;;158          }
;;;159          break;
00021a  bf00              NOP      
                  |L30.540|
00021c  bf00              NOP      
;;;160        }
;;;161        if (!question_processed ){
00021e  f1b80f00          CMP      r8,#0
000222  d105              BNE      |L30.560|
;;;162          mdns_process_query(fd, &name, &question, iter);
000224  462b              MOV      r3,r5
000226  aa20              ADD      r2,sp,#0x80
000228  a921              ADD      r1,sp,#0x84
00022a  4638              MOV      r0,r7
00022c  f7fffffe          BL       mdns_process_query
                  |L30.560|
000230  1c76              ADDS     r6,r6,#1              ;106
                  |L30.562|
000232  6828              LDR      r0,[r5,#0]            ;106
000234  8880              LDRH     r0,[r0,#4]            ;106
000236  f44f417f          MOV      r1,#0xff00            ;106
00023a  ea012000          AND      r0,r1,r0,LSL #8       ;106
00023e  6829              LDR      r1,[r5,#0]            ;106
000240  8889              LDRH     r1,[r1,#4]            ;106
000242  ea402011          ORR      r0,r0,r1,LSR #8       ;106
000246  42b0              CMP      r0,r6                 ;106
000248  f73faee6          BGT      |L30.24|
                  |L30.588|
00024c  bf00              NOP                            ;109
;;;163        }
;;;164      }
;;;165    }
00024e  b023              ADD      sp,sp,#0x8c
000250  e8bd83f0          POP      {r4-r9,pc}
;;;166    
                          ENDP

                  |L30.596|
000254  5f736572          DCB      "_services._dns-sd._udp.local.",0
000258  76696365
00025c  732e5f64
000260  6e732d73
000264  642e5f75
000268  64702e6c
00026c  6f63616c
000270  2e00    
000272  00                DCB      0
000273  00                DCB      0
                  |L30.628|
                          DCD      available_service_count
                  |L30.632|
                          DCD      available_services

                          AREA ||i.start_bonjour_service||, CODE, READONLY, ALIGN=2

                          REQUIRE _printf_pre_padding
                          REQUIRE _printf_percent
                          REQUIRE _printf_widthprec
                          REQUIRE _printf_d
                          REQUIRE _printf_s
                          REQUIRE _printf_int_dec
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                          REQUIRE _printf_str
                  start_bonjour_service PROC
;;;767    
;;;768    static OSStatus start_bonjour_service(void)
000000  b5f0              PUSH     {r4-r7,lr}
;;;769    {
000002  b089              SUB      sp,sp,#0x24
;;;770      OSStatus err = kNoErr;
000004  2400              MOVS     r4,#0
;;;771      struct sockaddr_t addr;
;;;772      uint32_t opt;
;;;773    
;;;774      if(bonjour_mutex == NULL)
000006  48ba              LDR      r0,|L31.752|
000008  6800              LDR      r0,[r0,#0]  ; bonjour_mutex
00000a  b910              CBNZ     r0,|L31.18|
;;;775        mico_rtos_init_mutex( &bonjour_mutex );
00000c  48b8              LDR      r0,|L31.752|
00000e  f7fffffe          BL       mico_rtos_init_mutex
                  |L31.18|
;;;776    
;;;777      if(update_state_sem == NULL)
000012  48b8              LDR      r0,|L31.756|
000014  6800              LDR      r0,[r0,#0]  ; update_state_sem
000016  b918              CBNZ     r0,|L31.32|
;;;778        mico_rtos_init_semaphore( &update_state_sem, 1 );
000018  2101              MOVS     r1,#1
00001a  48b6              LDR      r0,|L31.756|
00001c  f7fffffe          BL       mico_rtos_init_semaphore
                  |L31.32|
;;;779    
;;;780      update_state_fd = mico_create_event_fd( update_state_sem );
000020  48b4              LDR      r0,|L31.756|
000022  6800              LDR      r0,[r0,#0]  ; update_state_sem
000024  f7fffffe          BL       mico_create_event_fd
000028  49b3              LDR      r1,|L31.760|
00002a  6008              STR      r0,[r1,#0]  ; update_state_fd
;;;781    
;;;782      memset( available_services, 0x0, sizeof( available_services ) );
00002c  2180              MOVS     r1,#0x80
00002e  48b3              LDR      r0,|L31.764|
000030  f7fffffe          BL       __aeabi_memclr4
;;;783    
;;;784      
;;;785      buf = malloc(1500);
000034  f24050dc          MOV      r0,#0x5dc
000038  f7fffffe          BL       malloc
00003c  49b0              LDR      r1,|L31.768|
00003e  6008              STR      r0,[r1,#0]  ; buf
;;;786      require_action(buf, exit, err =kNoMemoryErr);
000040  bf00              NOP      
000042  4608              MOV      r0,r1
000044  6800              LDR      r0,[r0,#0]  ; buf
000046  2800              CMP      r0,#0
000048  d129              BNE      |L31.158|
00004a  bf00              NOP      
00004c  48ad              LDR      r0,|L31.772|
00004e  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
000050  b900              CBNZ     r0,|L31.84|
000052  e021              B        |L31.152|
                  |L31.84|
000054  48ac              LDR      r0,|L31.776|
000056  f7fffffe          BL       mico_rtos_lock_mutex
00005a  215c              MOVS     r1,#0x5c
00005c  a0ab              ADR      r0,|L31.780|
00005e  f7fffffe          BL       strrchr
000062  b128              CBZ      r0,|L31.112|
000064  215c              MOVS     r1,#0x5c
000066  a0a9              ADR      r0,|L31.780|
000068  f7fffffe          BL       strrchr
00006c  1c40              ADDS     r0,r0,#1
00006e  e000              B        |L31.114|
                  |L31.112|
000070  a0a6              ADR      r0,|L31.780|
                  |L31.114|
000072  4605              MOV      r5,r0
000074  f7fffffe          BL       mico_get_time
000078  4606              MOV      r6,r0
00007a  a0ae              ADR      r0,|L31.820|
00007c  f2403112          MOV      r1,#0x312
000080  4bad              LDR      r3,|L31.824|
000082  462a              MOV      r2,r5
000084  e9cd1000          STRD     r1,r0,[sp,#0]
000088  4631              MOV      r1,r6
00008a  a0ac              ADR      r0,|L31.828|
00008c  f7fffffe          BL       __2printf
000090  489d              LDR      r0,|L31.776|
000092  f7fffffe          BL       mico_rtos_unlock_mutex
000096  bf00              NOP      
                  |L31.152|
000098  bf00              NOP      
00009a  4cb2              LDR      r4,|L31.868|
00009c  e124              B        |L31.744|
                  |L31.158|
00009e  bf00              NOP      
;;;787      
;;;788      mDNS_fd = socket(AF_INET, SOCK_DGRM, IPPROTO_UDP);
0000a0  2211              MOVS     r2,#0x11
0000a2  2102              MOVS     r1,#2
0000a4  4608              MOV      r0,r1
0000a6  f7fffffe          BL       socket
0000aa  49af              LDR      r1,|L31.872|
0000ac  6008              STR      r0,[r1,#0]  ; mDNS_fd
;;;789      require_action(IsValidSocket( mDNS_fd ), exit, err = kNoResourcesErr );
0000ae  bf00              NOP      
0000b0  4608              MOV      r0,r1
0000b2  6800              LDR      r0,[r0,#0]  ; mDNS_fd
0000b4  2800              CMP      r0,#0
0000b6  da2a              BGE      |L31.270|
0000b8  bf00              NOP      
0000ba  4892              LDR      r0,|L31.772|
0000bc  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
0000be  b900              CBNZ     r0,|L31.194|
0000c0  e021              B        |L31.262|
                  |L31.194|
0000c2  4891              LDR      r0,|L31.776|
0000c4  f7fffffe          BL       mico_rtos_lock_mutex
0000c8  215c              MOVS     r1,#0x5c
0000ca  a090              ADR      r0,|L31.780|
0000cc  f7fffffe          BL       strrchr
0000d0  b128              CBZ      r0,|L31.222|
0000d2  215c              MOVS     r1,#0x5c
0000d4  a08d              ADR      r0,|L31.780|
0000d6  f7fffffe          BL       strrchr
0000da  1c40              ADDS     r0,r0,#1
0000dc  e000              B        |L31.224|
                  |L31.222|
0000de  a08b              ADR      r0,|L31.780|
                  |L31.224|
0000e0  4605              MOV      r5,r0
0000e2  f7fffffe          BL       mico_get_time
0000e6  4606              MOV      r6,r0
0000e8  a092              ADR      r0,|L31.820|
0000ea  f2403115          MOV      r1,#0x315
0000ee  4b92              LDR      r3,|L31.824|
0000f0  462a              MOV      r2,r5
0000f2  e9cd1000          STRD     r1,r0,[sp,#0]
0000f6  4631              MOV      r1,r6
0000f8  a090              ADR      r0,|L31.828|
0000fa  f7fffffe          BL       __2printf
0000fe  4882              LDR      r0,|L31.776|
000100  f7fffffe          BL       mico_rtos_unlock_mutex
000104  bf00              NOP      
                  |L31.262|
000106  bf00              NOP      
000108  4c96              LDR      r4,|L31.868|
00010a  1e64              SUBS     r4,r4,#1
00010c  e0ec              B        |L31.744|
                  |L31.270|
00010e  bf00              NOP      
;;;790      opt = 0xE00000FB; //"224.0.0.251"
000110  4896              LDR      r0,|L31.876|
000112  9003              STR      r0,[sp,#0xc]
;;;791      setsockopt(mDNS_fd, SOL_SOCKET, IP_ADD_MEMBERSHIP, &opt, 4);
000114  2004              MOVS     r0,#4
000116  ab03              ADD      r3,sp,#0xc
000118  2203              MOVS     r2,#3
00011a  2101              MOVS     r1,#1
00011c  9000              STR      r0,[sp,#0]
00011e  4892              LDR      r0,|L31.872|
000120  6800              LDR      r0,[r0,#0]  ; mDNS_fd
000122  f7fffffe          BL       setsockopt
;;;792      addr.s_port = 5353;
000126  f24140e9          MOV      r0,#0x14e9
00012a  f8ad0012          STRH     r0,[sp,#0x12]
;;;793      addr.s_ip = INADDR_ANY;
00012e  2000              MOVS     r0,#0
000130  9005              STR      r0,[sp,#0x14]
;;;794      err = bind(mDNS_fd, &addr, sizeof(addr));
000132  2214              MOVS     r2,#0x14
000134  a904              ADD      r1,sp,#0x10
000136  488c              LDR      r0,|L31.872|
000138  6800              LDR      r0,[r0,#0]  ; mDNS_fd
00013a  f7fffffe          BL       bind
00013e  4604              MOV      r4,r0
;;;795      require_noerr(err, exit);
000140  bf00              NOP      
000142  4625              MOV      r5,r4
000144  2d00              CMP      r5,#0
000146  d028              BEQ      |L31.410|
000148  bf00              NOP      
00014a  486e              LDR      r0,|L31.772|
00014c  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
00014e  b900              CBNZ     r0,|L31.338|
000150  e021              B        |L31.406|
                  |L31.338|
000152  486d              LDR      r0,|L31.776|
000154  f7fffffe          BL       mico_rtos_lock_mutex
000158  215c              MOVS     r1,#0x5c
00015a  a06c              ADR      r0,|L31.780|
00015c  f7fffffe          BL       strrchr
000160  b128              CBZ      r0,|L31.366|
000162  215c              MOVS     r1,#0x5c
000164  a069              ADR      r0,|L31.780|
000166  f7fffffe          BL       strrchr
00016a  1c40              ADDS     r0,r0,#1
00016c  e000              B        |L31.368|
                  |L31.366|
00016e  a067              ADR      r0,|L31.780|
                  |L31.368|
000170  4606              MOV      r6,r0
000172  f7fffffe          BL       mico_get_time
000176  4607              MOV      r7,r0
000178  a06e              ADR      r0,|L31.820|
00017a  f240311b          MOV      r1,#0x31b
00017e  4b6e              LDR      r3,|L31.824|
000180  4632              MOV      r2,r6
000182  e9cd1000          STRD     r1,r0,[sp,#0]
000186  4639              MOV      r1,r7
000188  a06c              ADR      r0,|L31.828|
00018a  f7fffffe          BL       __2printf
00018e  485e              LDR      r0,|L31.776|
000190  f7fffffe          BL       mico_rtos_unlock_mutex
000194  bf00              NOP      
                  |L31.406|
000196  bf00              NOP      
000198  e0a6              B        |L31.744|
                  |L31.410|
00019a  bf00              NOP      
;;;796    
;;;797      err = mico_system_notify_register( mico_notify_WIFI_STATUS_CHANGED, (void *)BonjourNotify_WifiStatusHandler, NULL );
00019c  2200              MOVS     r2,#0
00019e  4974              LDR      r1,|L31.880|
0001a0  2001              MOVS     r0,#1
0001a2  f7fffffe          BL       mico_system_notify_register
0001a6  4604              MOV      r4,r0
;;;798      require_noerr( err, exit );
0001a8  bf00              NOP      
0001aa  4625              MOV      r5,r4
0001ac  2d00              CMP      r5,#0
0001ae  d028              BEQ      |L31.514|
0001b0  bf00              NOP      
0001b2  4854              LDR      r0,|L31.772|
0001b4  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
0001b6  b900              CBNZ     r0,|L31.442|
0001b8  e021              B        |L31.510|
                  |L31.442|
0001ba  4853              LDR      r0,|L31.776|
0001bc  f7fffffe          BL       mico_rtos_lock_mutex
0001c0  215c              MOVS     r1,#0x5c
0001c2  a052              ADR      r0,|L31.780|
0001c4  f7fffffe          BL       strrchr
0001c8  b128              CBZ      r0,|L31.470|
0001ca  215c              MOVS     r1,#0x5c
0001cc  a04f              ADR      r0,|L31.780|
0001ce  f7fffffe          BL       strrchr
0001d2  1c40              ADDS     r0,r0,#1
0001d4  e000              B        |L31.472|
                  |L31.470|
0001d6  a04d              ADR      r0,|L31.780|
                  |L31.472|
0001d8  4606              MOV      r6,r0
0001da  f7fffffe          BL       mico_get_time
0001de  4607              MOV      r7,r0
0001e0  a054              ADR      r0,|L31.820|
0001e2  f240311e          MOV      r1,#0x31e
0001e6  4b54              LDR      r3,|L31.824|
0001e8  4632              MOV      r2,r6
0001ea  e9cd1000          STRD     r1,r0,[sp,#0]
0001ee  4639              MOV      r1,r7
0001f0  a052              ADR      r0,|L31.828|
0001f2  f7fffffe          BL       __2printf
0001f6  4844              LDR      r0,|L31.776|
0001f8  f7fffffe          BL       mico_rtos_unlock_mutex
0001fc  bf00              NOP      
                  |L31.510|
0001fe  bf00              NOP      
000200  e072              B        |L31.744|
                  |L31.514|
000202  bf00              NOP      
;;;799      err = mico_system_notify_register( mico_notify_SYS_WILL_POWER_OFF, (void *)BonjourNotify_SYSWillPoerOffHandler, NULL );
000204  2200              MOVS     r2,#0
000206  495b              LDR      r1,|L31.884|
000208  2008              MOVS     r0,#8
00020a  f7fffffe          BL       mico_system_notify_register
00020e  4604              MOV      r4,r0
;;;800      require_noerr( err, exit );
000210  bf00              NOP      
000212  4625              MOV      r5,r4
000214  2d00              CMP      r5,#0
000216  d028              BEQ      |L31.618|
000218  bf00              NOP      
00021a  483a              LDR      r0,|L31.772|
00021c  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
00021e  b900              CBNZ     r0,|L31.546|
000220  e021              B        |L31.614|
                  |L31.546|
000222  4839              LDR      r0,|L31.776|
000224  f7fffffe          BL       mico_rtos_lock_mutex
000228  215c              MOVS     r1,#0x5c
00022a  a038              ADR      r0,|L31.780|
00022c  f7fffffe          BL       strrchr
000230  b128              CBZ      r0,|L31.574|
000232  215c              MOVS     r1,#0x5c
000234  a035              ADR      r0,|L31.780|
000236  f7fffffe          BL       strrchr
00023a  1c40              ADDS     r0,r0,#1
00023c  e000              B        |L31.576|
                  |L31.574|
00023e  a033              ADR      r0,|L31.780|
                  |L31.576|
000240  4606              MOV      r6,r0
000242  f7fffffe          BL       mico_get_time
000246  4607              MOV      r7,r0
000248  a03a              ADR      r0,|L31.820|
00024a  f44f7148          MOV      r1,#0x320
00024e  4b3a              LDR      r3,|L31.824|
000250  4632              MOV      r2,r6
000252  e9cd1000          STRD     r1,r0,[sp,#0]
000256  4639              MOV      r1,r7
000258  a038              ADR      r0,|L31.828|
00025a  f7fffffe          BL       __2printf
00025e  482a              LDR      r0,|L31.776|
000260  f7fffffe          BL       mico_rtos_unlock_mutex
000264  bf00              NOP      
                  |L31.614|
000266  bf00              NOP      
000268  e03e              B        |L31.744|
                  |L31.618|
00026a  bf00              NOP      
;;;801    
;;;802      err = mico_rtos_create_thread(&mfi_bonjour_thread_handler, MICO_APPLICATION_PRIORITY, "Bonjour", _bonjour_thread, 0x500, NULL );
00026c  2000              MOVS     r0,#0
00026e  f44f61a0          MOV      r1,#0x500
000272  4b41              LDR      r3,|L31.888|
000274  a241              ADR      r2,|L31.892|
000276  e9cd1000          STRD     r1,r0,[sp,#0]
00027a  2107              MOVS     r1,#7
00027c  4841              LDR      r0,|L31.900|
00027e  f7fffffe          BL       mico_rtos_create_thread
000282  4604              MOV      r4,r0
;;;803      require_noerr(err, exit);
000284  bf00              NOP      
000286  4625              MOV      r5,r4
000288  2d00              CMP      r5,#0
00028a  d028              BEQ      |L31.734|
00028c  bf00              NOP      
00028e  481d              LDR      r0,|L31.772|
000290  6800              LDR      r0,[r0,#0]  ; mico_debug_enabled
000292  b900              CBNZ     r0,|L31.662|
000294  e021              B        |L31.730|
                  |L31.662|
000296  481c              LDR      r0,|L31.776|
000298  f7fffffe          BL       mico_rtos_lock_mutex
00029c  215c              MOVS     r1,#0x5c
00029e  a01b              ADR      r0,|L31.780|
0002a0  f7fffffe          BL       strrchr
0002a4  b128              CBZ      r0,|L31.690|
0002a6  215c              MOVS     r1,#0x5c
0002a8  a018              ADR      r0,|L31.780|
0002aa  f7fffffe          BL       strrchr
0002ae  1c40              ADDS     r0,r0,#1
0002b0  e000              B        |L31.692|
                  |L31.690|
0002b2  a016              ADR      r0,|L31.780|
                  |L31.692|
0002b4  4606              MOV      r6,r0
0002b6  f7fffffe          BL       mico_get_time
0002ba  4607              MOV      r7,r0
0002bc  a01d              ADR      r0,|L31.820|
0002be  f2403123          MOV      r1,#0x323
0002c2  4b1d              LDR      r3,|L31.824|
0002c4  4632              MOV      r2,r6
0002c6  e9cd1000          STRD     r1,r0,[sp,#0]
0002ca  4639              MOV      r1,r7
0002cc  a01b              ADR      r0,|L31.828|
0002ce  f7fffffe          BL       __2printf
0002d2  480d              LDR      r0,|L31.776|
0002d4  f7fffffe          BL       mico_rtos_unlock_mutex
0002d8  bf00              NOP      
                  |L31.730|
0002da  bf00              NOP      
0002dc  e004              B        |L31.744|
                  |L31.734|
0002de  bf00              NOP      
;;;804    
;;;805      bonjour_instance = true;
0002e0  2001              MOVS     r0,#1
0002e2  4929              LDR      r1,|L31.904|
0002e4  7008              STRB     r0,[r1,#0]
;;;806    
;;;807    exit:
0002e6  bf00              NOP      
                  |L31.744|
;;;808      return err;
0002e8  4620              MOV      r0,r4
;;;809    }
0002ea  b009              ADD      sp,sp,#0x24
0002ec  bdf0              POP      {r4-r7,pc}
;;;810    
                          ENDP

0002ee  0000              DCW      0x0000
                  |L31.752|
                          DCD      bonjour_mutex
                  |L31.756|
                          DCD      update_state_sem
                  |L31.760|
                          DCD      update_state_fd
                  |L31.764|
                          DCD      available_services
                  |L31.768|
                          DCD      buf
                  |L31.772|
                          DCD      mico_debug_enabled
                  |L31.776|
                          DCD      stdio_tx_mutex
                  |L31.780|
00030c  2e2e5c2e          DCB      "..\\..\\..\\..\\MICO\\system\\mdns\\mico_mdns.c"
000310  2e5c2e2e
000314  5c2e2e5c
000318  4d49434f
00031c  5c737973
000320  74656d5c
000324  6d646e73
000328  5c6d6963
00032c  6f5f6d64
000330  6e732e63
                  |L31.820|
000334  00                DCB      0
000335  00                DCB      0
000336  00                DCB      0
000337  00                DCB      0
                  |L31.824|
                          DCD      |symbol_number.83|
                  |L31.828|
00033c  5b25645d          DCB      "[%d][MICO:%s:%s:%4d] **ASSERT** %s\r\n",0
000340  5b4d4943
000344  4f3a2573
000348  3a25733a
00034c  2534645d
000350  202a2a41
000354  53534552
000358  542a2a20
00035c  25730d0a
000360  00      
000361  00                DCB      0
000362  00                DCB      0
000363  00                DCB      0
                  |L31.868|
                          DCD      0xffffe5b8
                  |L31.872|
                          DCD      mDNS_fd
                  |L31.876|
                          DCD      0xe00000fb
                  |L31.880|
                          DCD      BonjourNotify_WifiStatusHandler
                  |L31.884|
                          DCD      BonjourNotify_SYSWillPoerOffHandler
                  |L31.888|
                          DCD      _bonjour_thread
                  |L31.892|
00037c  426f6e6a          DCB      "Bonjour",0
000380  6f757200
                  |L31.900|
                          DCD      mfi_bonjour_thread_handler
                  |L31.904|
                          DCD      bonjour_instance

                          AREA ||.bss||, DATA, NOINIT, ALIGN=2

                  available_services
                          %        128

                          AREA ||.constdata||, DATA, READONLY, ALIGN=0

                  __PRETTY_FUNCTION__
000000  7369676e          DCB      0x73,0x69,0x67,0x6e
000004  65642069          DCB      0x65,0x64,0x20,0x69
000008  6e74206d          DCB      0x6e,0x74,0x20,0x6d
00000c  646e735f          DCB      0x64,0x6e,0x73,0x5f
000010  6164645f          DCB      0x61,0x64,0x64,0x5f
000014  7265636f          DCB      0x72,0x65,0x63,0x6f
000018  72642873          DCB      0x72,0x64,0x28,0x73
00001c  74727563          DCB      0x74,0x72,0x75,0x63
000020  74205f6d          DCB      0x74,0x20,0x5f,0x6d
000024  646e735f          DCB      0x64,0x6e,0x73,0x5f
000028  696e6974          DCB      0x69,0x6e,0x69,0x74
00002c  5f742c20          DCB      0x5f,0x74,0x2c,0x20
000030  656e756d          DCB      0x65,0x6e,0x75,0x6d
000034  203c756e          DCB      0x20,0x3c,0x75,0x6e
000038  6e616d65          DCB      0x6e,0x61,0x6d,0x65
00003c  643e2c20          DCB      0x64,0x3e,0x2c,0x20
000040  756e7369          DCB      0x75,0x6e,0x73,0x69
000044  676e6564          DCB      0x67,0x6e,0x65,0x64
000048  20696e74          DCB      0x20,0x69,0x6e,0x74
00004c  2900              DCB      0x29,0x00
                  |symbol_number.83|
00004e  7369              DCB      0x73,0x69
000050  676e6564          DCB      0x67,0x6e,0x65,0x64
000054  20696e74          DCB      0x20,0x69,0x6e,0x74
000058  20737461          DCB      0x20,0x73,0x74,0x61
00005c  72745f62          DCB      0x72,0x74,0x5f,0x62
000060  6f6e6a6f          DCB      0x6f,0x6e,0x6a,0x6f
000064  75725f73          DCB      0x75,0x72,0x5f,0x73
000068  65727669          DCB      0x65,0x72,0x76,0x69
00006c  63652876          DCB      0x63,0x65,0x28,0x76
000070  6f696429          DCB      0x6f,0x69,0x64,0x29
000074  00                DCB      0x00

                          AREA ||.data||, DATA, ALIGN=2

                  mDNS_fd
                          DCD      0xffffffff
                  bonjour_instance
000004  00                DCB      0x00
                  available_service_count
000005  040000            DCB      0x04,0x00,0x00
                  bonjour_mutex
                          DCD      0x00000000
                  update_state_sem
                          DCD      0x00000000
                  update_state_fd
                          DCD      0x00000000
                  mfi_bonjour_thread_handler
                          DCD      0x00000000
                  _bonjour_announce_handler
                          DCD      0x00000000
                  buf
                          DCD      0x00000000

;*** Start embedded assembler ***

#line 1 "..\\..\\..\\..\\MICO\\system\\mdns\\mico_mdns.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___11_mico_mdns_c_12e35e7f____REV16|
#line 114 "..\\..\\..\\..\\Platform\\Cortex-M4\\CMSIS\\core_cmInstr.h"
|__asm___11_mico_mdns_c_12e35e7f____REV16| PROC
#line 115

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___11_mico_mdns_c_12e35e7f____REVSH|
#line 128
|__asm___11_mico_mdns_c_12e35e7f____REVSH| PROC
#line 129

 revsh r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***
