Ignore:
Timestamp:
Jul 23, 2015, 3:21:02 PM (9 years ago)
Author:
coas-nagasima
Message:

ECHONET Lite規格に準拠していない動作を修正。
WebSocketの接続先URLを/webapi.ashxから/webapiに変更。
DHCPのリトライ処理が行われていなかったのを修正。
DHCPの有効/無効設定を追加し、固定IPアドレスを設定できるよう変更。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uKadecot/trunk/uip/task/uip_task.c

    r108 r125  
    8282int uip_out_wpos = 0;
    8383int uip_out_rpos = 0;
    84 const u8_t my_ip[4] = { IPV4_ADDR_LOCAL };
    85 const u8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK };
    86 const u8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW };
     84u8_t my_ip[4] = { IPV4_ADDR_LOCAL };
     85u8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK };
     86u8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW };
    8787int ws_out_req;
    8888int ws_out_res;
    8989#ifdef __DHCPC_H__
    9090struct dhcpc_state *dhcpc;
     91extern bool_t dhcp_enable;
    9192#endif
    9293
     
    113114        uip_init();
    114115#ifdef __DHCPC_H__
    115         dhcpc = dhcpc_init(uip_ethaddr.addr, sizeof(uip_ethaddr.addr));
     116        if(dhcp_enable){
     117                dhcpc = dhcpc_init(uip_ethaddr.addr, sizeof(uip_ethaddr.addr));
     118        }
    116119#endif
    117120        uip_task_init((intptr_t)uiptsk);
     
    132135                                ic->link_pre = ic->link_now;
    133136                                if(cng && ic->link_pre){
    134                                         sil_wrb_mem((uint8_t *)0x0008C02A, sil_reb_mem((uint8_t *)0x0008C02A) | 0x04);
    135137#ifdef __DHCPC_H__
    136                                         uip_buf = uiptsk->uip_buf;
    137                                         uip_len = 0;
    138                                         dhcpc_request(dhcpc);
    139                                         /* If the above function invocation resulted in data that
    140                                                 should be sent out on the network, the global variable
    141                                                 uip_len is set to a value > 0. */
    142                                         if (uip_len > 0) {
    143                                                 uip_arp_out();
    144                                                 IF_ETHER_NIC_START(ic, uip_buf, uip_len);
     138                                        if(dhcp_enable){
     139                                                sil_wrb_mem((uint8_t *)0x0008C02A, sil_reb_mem((uint8_t *)0x0008C02A) | 0x04);
     140                                                uip_buf = uiptsk->uip_buf;
     141                                                uip_len = 0;
     142                                                dhcpc_request(dhcpc);
     143                                                /* If the above function invocation resulted in data that
     144                                                        should be sent out on the network, the global variable
     145                                                        uip_len is set to a value > 0. */
     146                                                if (uip_len > 0) {
     147                                                        uip_arp_out();
     148                                                        IF_ETHER_NIC_START(ic, uip_buf, uip_len);
     149                                                }
     150                                        }
     151                                        else{
     152                                                DHCP4_CLI_SET_ADDR_CALLBACK();
    145153                                        }
    146154#else
Note: See TracChangeset for help on using the changeset viewer.