Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/echonet_main.c	(revision 364)
@@ -318,6 +318,4 @@
 }
 
-bool_t started = false;
-
 void echonet_change_netif_link(uint8_t link_up, uint8_t up)
 {
@@ -327,14 +325,10 @@
 		return;
 
-	if (up && !started) {
-		started = true;
-
-		/* ECHONETミドルウェアを起動 */
-		ret = ecn_sta_svc();
-		if (ret != E_OK)
-			return;
-
-		/* ECHONETミドルウェアを起動するのを待つ */
-		dly_tsk(100);
+	if (up) {
+		/* インスタンスリスト通知の送信 */
+		ret = ecn_ntf_inl();
+		if (ret != E_OK) {
+			syslog(LOG_ERROR, "ecn_ntf_inl");
+		}
 	}
 
@@ -342,5 +336,4 @@
 	uint8_t data[2];
 	data[0] = 0x01;
-	data[1] = up ? 0x01 : 0x02;
 	ret = ecn_brk_wai(data, sizeof(data));
 	if (ret != E_OK) {
@@ -351,4 +344,5 @@
 
 enum main_state_t{
+	main_state_start,
 	main_state_idle,
 	main_state_search,
@@ -357,5 +351,5 @@
 
 int main_timer = TMO_FEVR;
-enum main_state_t main_state = main_state_idle;
+enum main_state_t main_state = main_state_start;
 int main_retry;
 
@@ -377,6 +371,6 @@
 	sil_wrb_mem((uint8_t *)0x0008C02A, 0x7F);
 
-	/* １秒後にブザーを検索 */
-	main_state = main_state_search;
+	/* ECHONETミドルウェアを起動するのを待つ */
+	main_state = main_state_start;
 	main_timer = 1000 * 1000;
 
@@ -390,4 +384,5 @@
 	main_btn2_state = (btn2 & 0x80) != 0;
 
+	/* メインタスクを起動 */
 	ER ret = act_tsk(MAIN_TASK);
 	if (ret != E_OK) {
@@ -557,4 +552,15 @@
 
 	switch(main_state){
+	case main_state_start:
+		/* ECHONETミドルウェアを起動 */
+		ret = ecn_sta_svc();
+		if (ret != E_OK) {
+			syslog(LOG_ERROR, "ecn_sta_svc");
+		}
+
+		/* １秒後にブザーを検索 */
+		main_state = main_state_search;
+		main_timer = 1000 * 1000;
+		break;
 	case main_state_idle:
 		syslog(LOG_ERROR, "timeout faild on main_state_idle");
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.c	(revision 364)
@@ -79,5 +79,7 @@
 
 ID ws_api_mailboxid = MAIN_DATAQUEUE;
+#ifndef NOUSE_MPF_NET_BUF
 ID ws_mempoolid = MPF_NET_BUF_256;
+#endif
 
 #ifdef IF_ETHER_BTUSB
@@ -111,7 +113,42 @@
 static void main_timeout();
 
+extern int ntshell_exit;
+
 int uart_read(char *buf, int cnt, void *extobj)
 {
-	return serial_rea_dat(SIO_PORTID, (char *)buf, cnt);
+	struct main_t *obj = (struct main_t *)extobj;
+	int result;
+	ER ret;
+	int timer;
+
+	obj->prev = obj->now;
+
+	/* タイマー取得 */
+	timer = main_get_timer();
+
+	/* 待ち */
+	ret = serial_trea_dat(SIO_PORTID, buf, cnt, timer);
+	if ((ret < 0) && (ret != E_OK) && (ret != E_TMOUT)) {
+		syslog(LOG_NOTICE, "tslp_tsk ret: %s %d", itron_strerror(ret), timer);
+		ntshell_exit = 1;
+		return -1;
+	}
+	result = (int)ret;
+
+	ret = get_tim(&obj->now);
+	if (ret != E_OK) {
+		syslog(LOG_NOTICE, "get_tim ret: %s", itron_strerror(ret));
+		ntshell_exit = 1;
+		return -1;
+	}
+
+			/* 時間経過 */
+	int elapse = obj->now - obj->prev;
+	main_progress(elapse);
+
+	/* タイムアウト処理 */
+	main_timeout();
+
+	return result;
 }
 
@@ -119,19 +156,4 @@
 {
 	return serial_wri_dat(SIO_PORTID, buf, cnt);
-}
-
-unsigned char ntstdio_xi(struct ntstdio_t *handle)
-{
-	char buf[1];
-	if(serial_rea_dat(SIO_PORTID, buf, 1) != 1)
-		return -EIO;
-	return buf[0];
-}
-
-void ntstdio_xo(struct ntstdio_t *handle, unsigned char c)
-{
-	char buf[1];
-	buf[0] = c;
-	serial_wri_dat(SIO_PORTID, buf, 1);
 }
 
@@ -150,5 +172,5 @@
 	main_initialize();
 
-	ntshell_init(&ntshell, uart_read, uart_write, cmd_execute, NULL);
+	ntshell_init(&ntshell, uart_read, uart_write, cmd_execute, &main_obj);
 	ntshell_set_prompt(&ntshell, "NTShell>");
 	ntshell_execute(&ntshell);
@@ -168,5 +190,10 @@
 	ER ret;
 
-	ntshell_task_init();
+#ifdef TOPPERS_OMIT_TECS
+	serial_opn_por(SIO_PORTID);
+#endif
+	serial_ctl_por(SIO_PORTID, IOCTL_FCSND | IOCTL_FCRCV);
+
+	ntshell_task_init(uart_read, uart_write, &main_obj);
 
 	main_obj.timer = TMO_FEVR;
Index: asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg	(revision 359)
+++ asp3_tinet_ecnl_rx/trunk/app6_hot_water_pot/src/main.cfg	(revision 364)
@@ -54,5 +54,4 @@
 INCLUDE("tinet/tinet_asp.cfg");
 INCLUDE("tinet_main.cfg");
-INCLUDE("netinet/ip_igmp.cfg");
 
 /* DHCP クライアント */
@@ -77,4 +76,7 @@
 INCLUDE("ffarch.cfg");
 
+/* mbed */
+INCLUDE("mbed_api.cfg");
+
 #ifdef IF_ETHER_BTUSB
 INCLUDE("usb_hbth.cfg");
