Changeset 125 for uKadecot/trunk/uip
- Timestamp:
- Jul 23, 2015, 3:21:02 PM (9 years ago)
- Location:
- uKadecot/trunk/uip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/uip/apps/dhcpc/dhcpc.c
r108 r125 41 41 42 42 #define STATE_INITIAL 0 43 #define STATE_SENDING 1 44 #define STATE_OFFER_RECEIVED 2 45 #define STATE_CONFIG_RECEIVED 3 43 #define STATE_REQUEST 1 44 #define STATE_SENDING 2 45 #define STATE_OFFER_RECEIVED 3 46 #define STATE_CONFIG_RECEIVED 4 46 47 47 48 #ifdef __RX … … 261 262 PT_BEGIN(&s->pt); 262 263 264 if(s->state != STATE_REQUEST) 265 PT_YIELD(&s->pt); 266 263 267 /* try_again:*/ 264 268 s->state = STATE_SENDING; 265 269 s->ticks = 5 * CLOCK_SECOND; 266 270 267 send_discover(s);268 timer_set(&s->timer, s->ticks);269 270 271 do { 272 printf("send_discover(%d)\n", s->timer); 273 send_discover(s); 274 timer_set(&s->timer, s->ticks); 275 271 276 PT_WAIT_UNTIL(&s->pt, (ret = uip_newdata() ? 1 : (timer_expired(&s->timer) ? 2 : 0)) != 0); 272 277 … … 288 293 PT_YIELD(&s->pt); 289 294 290 send_request(s);291 timer_set(&s->timer, s->ticks);292 293 295 do { 296 printf("send_request(%d)\n", s->timer); 297 send_request(s); 298 timer_set(&s->timer, s->ticks); 299 294 300 PT_WAIT_UNTIL(&s->pt, (ret = uip_newdata() ? 1 : (timer_expired(&s->timer) ? 2 : 0)) != 0); 295 301 … … 382 388 u16_t ipaddr[2]; 383 389 384 s->state = STATE_ INITIAL;390 s->state = STATE_REQUEST; 385 391 uip_ipaddr(ipaddr, 0,0,0,0); 386 392 uip_sethostaddr(ipaddr); -
uKadecot/trunk/uip/apps/webserver/httpd-fs/index.html
r101 r125 30 30 <h1 id="header_logo" style="margin: 0px; text-align: left; background-color: white;"> 31 31 <a target='_blank' href="http://www.toppers.jp/index.html"> 32 <img src="./imgs/logo. gif" width="353" height="74" border="0" alt="TOPPERS LOGO">32 <img src="./imgs/logo.png" width="353" height="74" border="0" alt="TOPPERS LOGO"> 33 33 </a> 34 34 </h1> … … 95 95 <label for="txt_mac_addr">MACアドレス</label> 96 96 <input name="txt_mac_addr" id="txt_mac_addr" value="12:34:56:78:9A:BC" type="text"> 97 <label for="cb_dhcp_enable">DHCP有効</label> 98 <input name="cb_dhcp_enable" id="cb_dhcp_enable" type="checkbox"> 99 <label for="txt_ip_addr">IPアドレス</label> 100 <input name="txt_ip_addr" id="txt_ip_addr" value="192.168.2.103" type="text"> 101 <label for="txt_netmask">サブネットマスク</label> 102 <input name="txt_netmask" id="txt_netmask" value="255.255.255.0" type="text"> 103 <label for="txt_gateway">デフォルトゲートウェイ</label> 104 <input name="txt_gateway" id="txt_gateway" value="192.168.2.1" type="text"> 97 105 <button id="bt_set_init_params" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-check ui-btn-c"> 98 106 設定 -
uKadecot/trunk/uip/task/uip_task.c
r108 r125 82 82 int uip_out_wpos = 0; 83 83 int uip_out_rpos = 0; 84 constu8_t my_ip[4] = { IPV4_ADDR_LOCAL };85 constu8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK };86 constu8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW };84 u8_t my_ip[4] = { IPV4_ADDR_LOCAL }; 85 u8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK }; 86 u8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW }; 87 87 int ws_out_req; 88 88 int ws_out_res; 89 89 #ifdef __DHCPC_H__ 90 90 struct dhcpc_state *dhcpc; 91 extern bool_t dhcp_enable; 91 92 #endif 92 93 … … 113 114 uip_init(); 114 115 #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 } 116 119 #endif 117 120 uip_task_init((intptr_t)uiptsk); … … 132 135 ic->link_pre = ic->link_now; 133 136 if(cng && ic->link_pre){ 134 sil_wrb_mem((uint8_t *)0x0008C02A, sil_reb_mem((uint8_t *)0x0008C02A) | 0x04);135 137 #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(); 145 153 } 146 154 #else
Note:
See TracChangeset
for help on using the changeset viewer.