Index: asp3_tinet_ecnl_arm/trunk/app4_aircon/.cproject
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/.cproject	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/.cproject	(revision 364)
@@ -22,5 +22,5 @@
 			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
 				<option id="toolchain.id" value="gcc-arm-embedded"/>
-				<option id="toolchain.version" value="5.4.1.20160919"/>
+				<option id="toolchain.version" value="6.3.1.20170620"/>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -59,5 +59,5 @@
 							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack.1501102219" name="Warn if stack size exceeds the limit (-Wstack-usage) (H')" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack" useByScannerDiscovery="false" value="100" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1085912920" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/app4_aircon}/Debug" id="com.renesas.cdt.managedbuild.gcc.rz.builder.1132488688" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="false" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
+							<builder buildPath="${workspace_loc:/app4_aircon}/Debug" id="com.renesas.cdt.managedbuild.gcc.rz.builder.1132488688" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
 							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler.1278248884" name="Cross ARM GNU Assembler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler">
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1219404387" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
@@ -127,5 +127,5 @@
 			<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
 				<option id="toolchain.id" value="gcc-arm-embedded"/>
-				<option id="toolchain.version" value="5.4.1.20160919"/>
+				<option id="toolchain.version" value="6.3.1.20170620"/>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
@@ -164,5 +164,5 @@
 							<option id="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack.956370110" name="Warn if stack size exceeds the limit (-Wstack-usage) (H')" superClass="com.renesas.cdt.managedbuild.gcc.rz.option.warnStack" useByScannerDiscovery="false" value="100" valueType="string"/>
 							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1652770796" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
-							<builder buildPath="${workspace_loc:/app4_aircon}/DebugEther" id="com.renesas.cdt.managedbuild.gcc.rz.builder.994484673" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="false" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
+							<builder buildPath="${workspace_loc:/app4_aircon}/DebugEther" id="com.renesas.cdt.managedbuild.gcc.rz.builder.994484673" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="GCC for Renesas Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.gcc.rz.builder"/>
 							<tool id="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler.1242790859" name="Cross ARM GNU Assembler" superClass="com.renesas.cdt.managedbuild.gcc.rz.tool.assembler">
 								<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.1960328126" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" useByScannerDiscovery="false" value="true" valueType="boolean"/>
Index: asp3_tinet_ecnl_arm/trunk/app4_aircon/Debug/Makefile
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/Debug/Makefile	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/Debug/Makefile	(revision 364)
@@ -179,5 +179,5 @@
 	CDEFS := -DTOPPERS_OMIT_TECS $(CDEFS)
 endif
-CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DECHONET_USE_MALLOC -DRamDisk=_binary_______ntshell_src_rom_fs_bin_start
+CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DNOUSE_MPF_NET_BUF -DECHONET_USE_MALLOC -DRamDisk=_binary_______ntshell_src_rom_fs_bin_start
 INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR) \
 	-I$(SRCDIR)/../btstack/include \
@@ -187,5 +187,5 @@
 	-I$(SRCDIR)/../usbhost/src \
 	$(INCLUDES)
-LDFLAGS := $(LDFLAGS) -Wl,-Map=$(OBJNAME).map,--cref -L.
+LDFLAGS := $(LDFLAGS) -L.
 LIBS := $(LIBS) $(CXXLIBS)
 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
@@ -198,5 +198,6 @@
 APPL_COBJS := $(APPL_COBJS) netcmd.o fdtable.o io_stub.o socket_stub.o ffarch.o diskio.o ff.o sdfs.o ccsbcs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o tlsf.o
 APPLDIRS := $(APPLDIRS) ../../ntshell/lcd
-APPL_COBJS := $(APPL_COBJS) draw_font.o misaki_font.o
+APPL_COBJS := $(APPL_COBJS) draw_font.o shnm12_font.o
+APPL_CFLAGS := $(APPL_CFLAGS) -DSHNM12_FONT
 
 #
@@ -223,34 +224,35 @@
 endif
 
-
-#
-#  ネットワークサービスの定義
-#
-NO_USE_TINET_LIBRARY = true
-
-#  ネットワークインタフェースの選択、何れか一つ選択する。
-NET_IF = ether
-
-#  イーサネット・ディバイスドライバの選択
-NET_DEV = if_btusb
-
-#  ネットワーク層の選択
-#SUPPORT_INET6 = true
-SUPPORT_INET4 = true
-
-#  API に組込む機能の選択
-#API_CFG_IP4MAPPED_ADDR = true
-
-#  トランスポート層の選択
-SUPPORT_TCP = true
-SUPPORT_UDP = true
-
-# IGMPを有効に設定
-SUPPORT_IGMP = true
-
-#
-#  ネットワークサービスの Makefile のインクルード
-#
-include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+ifdef TINETDIR
+	#
+	#  ネットワークサービスの定義
+	#
+	NO_USE_TINET_LIBRARY = true
+
+	#  ネットワークインタフェースの選択、何れか一つ選択する。
+	NET_IF = ether
+
+	#  イーサネット・ディバイスドライバの選択
+	NET_DEV = if_btusb
+
+	#  ネットワーク層の選択
+	#SUPPORT_INET6 = true
+	SUPPORT_INET4 = true
+
+	#  API に組込む機能の選択
+	#API_CFG_IP4MAPPED_ADDR = true
+
+	#  トランスポート層の選択
+	SUPPORT_TCP = true
+	SUPPORT_UDP = true
+
+	# IGMPを有効に設定
+	SUPPORT_IGMP = true
+
+	#
+	#  ネットワークサービスの Makefile のインクルード
+	#
+	include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+endif
 
 #
@@ -285,6 +287,11 @@
 #  コンフィギュレータに関する定義
 #
-CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
-CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
+ifndef TINETDIR
+  CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
+  CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+else
+  CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
+  CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table ../../ntshell/echonet/echonet_api.def:echonet \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
@@ -292,4 +299,5 @@
 			--symval-table ../../ntshell/echonet/echonet_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o echonet_cfg.o $(CFG_COBJS)
@@ -437,4 +445,11 @@
 
 #
+#  並列makeのための依存関係の定義
+#
+$(APPL_OBJS) $(filter-out $(CFG_DMY), $(SYSSVC_OBJS)): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(filter-out $(CFG_DMY), $(SYSSVC_ASMOBJS)) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  特別な依存関係の定義
 #
@@ -445,5 +460,5 @@
 #
 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
Index: asp3_tinet_ecnl_arm/trunk/app4_aircon/DebugEther/Makefile
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/DebugEther/Makefile	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/DebugEther/Makefile	(revision 364)
@@ -177,5 +177,5 @@
 	CDEFS := -DTOPPERS_OMIT_TECS $(CDEFS)
 endif
-CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DECHONET_USE_MALLOC -DRamDisk=_binary_______ntshell_src_rom_fs_bin_start
+CDEFS := $(CDEFS) -DDHCP4_CLI_CFG -DUSE_PING -DUSE_RESOLVER -DUSE_NETAPP_SUBR -DNOUSE_MPF_NET_BUF -DECHONET_USE_MALLOC -DRamDisk=_binary_______ntshell_src_rom_fs_bin_start
 INCLUDES := -I. -I$(SRCDIR)/include -I$(SRCDIR) \
 	-I$(SRCDIR)/../btstack/include \
@@ -185,5 +185,5 @@
 	-I$(SRCDIR)/../usbhost/src \
 	$(INCLUDES)
-LDFLAGS := $(LDFLAGS) -Wl,-Map=$(OBJNAME).map,--cref -L.
+LDFLAGS := $(LDFLAGS) -L.
 LIBS := $(LIBS) $(CXXLIBS)
 CFLAGS = $(COPTS) $(CDEFS) $(INCLUDES)
@@ -196,5 +196,6 @@
 APPL_COBJS := $(APPL_COBJS) netcmd.o fdtable.o io_stub.o socket_stub.o ffarch.o diskio.o ff.o sdfs.o ccsbcs.o ntshell.o text_editor.o text_history.o usrcmd.o vtrecv.o vtsend.o ntlibc.o ntstdio.o ntopt.o syscall.o tlsf.o
 APPLDIRS := $(APPLDIRS) ../../ntshell/lcd
-APPL_COBJS := $(APPL_COBJS) draw_font.o misaki_font.o
+APPL_COBJS := $(APPL_COBJS) draw_font.o shnm12_font.o
+APPL_CFLAGS := $(APPL_CFLAGS) -DSHNM12_FONT
 
 #
@@ -221,34 +222,35 @@
 endif
 
-
-#
-#  ネットワークサービスの定義
-#
-NO_USE_TINET_LIBRARY = true
-
-#  ネットワークインタフェースの選択、何れか一つ選択する。
-NET_IF = ether
-
-#  イーサネット・ディバイスドライバの選択
+ifdef TINETDIR
+	#
+	#  ネットワークサービスの定義
+	#
+	NO_USE_TINET_LIBRARY = true
+
+	#  ネットワークインタフェースの選択、何れか一つ選択する。
+	NET_IF = ether
+
+	#  イーサネット・ディバイスドライバの選択
 	NET_DEV = if_mbed
 
-#  ネットワーク層の選択
-#SUPPORT_INET6 = true
-SUPPORT_INET4 = true
-
-#  API に組込む機能の選択
-#API_CFG_IP4MAPPED_ADDR = true
-
-#  トランスポート層の選択
-SUPPORT_TCP = true
-SUPPORT_UDP = true
-
-# IGMPを有効に設定
-SUPPORT_IGMP = true
-
-#
-#  ネットワークサービスの Makefile のインクルード
-#
-include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+	#  ネットワーク層の選択
+	#SUPPORT_INET6 = true
+	SUPPORT_INET4 = true
+
+	#  API に組込む機能の選択
+	#API_CFG_IP4MAPPED_ADDR = true
+
+	#  トランスポート層の選択
+	SUPPORT_TCP = true
+	SUPPORT_UDP = true
+
+	# IGMPを有効に設定
+	SUPPORT_IGMP = true
+
+	#
+	#  ネットワークサービスの Makefile のインクルード
+	#
+	include $(SRCDIR)/$(TINETDIR)/Makefile.tinet
+endif
 
 #
@@ -283,6 +285,11 @@
 #  コンフィギュレータに関する定義
 #
-CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
-CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
+ifndef TINETDIR
+  CFG_TRB := -T $(TARGETDIR)/target_kernel.trb
+  CFG_TABS := --api-table $(SRCDIR)/kernel/kernel_api.def \
+			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+else
+  CFG_TRB := -T $(TINET_ROOT)/tinet.trb:tcpip -T ../../ntshell/echonet/echonet.trb:echonet -T $(TARGETDIR)/target_kernel.trb:kernel
+  CFG_TABS := --api-table $(TINET_ROOT)/tcpip_api.def:tcpip \
 			--api-table ../../ntshell/echonet/echonet_api.def:echonet \
 			--api-table $(SRCDIR)/kernel/kernel_api.def:kernel \
@@ -290,4 +297,5 @@
 			--symval-table ../../ntshell/echonet/echonet_sym.def \
 			--symval-table $(SRCDIR)/kernel/kernel_sym.def $(CFG_TABS)
+endif
 CFG_ASMOBJS := $(CFG_ASMOBJS)
 CFG_COBJS := kernel_cfg.o echonet_cfg.o $(CFG_COBJS)
@@ -435,4 +443,11 @@
 
 #
+#  並列makeのための依存関係の定義
+#
+$(APPL_OBJS) $(filter-out $(CFG_DMY), $(SYSSVC_OBJS)): | kernel_cfg.timestamp
+$(APPL_ASMOBJS) $(filter-out $(CFG_DMY), $(SYSSVC_ASMOBJS)) $(KERNEL_ASMOBJS) $(CFG_ASMOBJS): \
+														| offset.timestamp
+
+#
 #  特別な依存関係の定義
 #
@@ -443,5 +458,5 @@
 #
 $(OBJFILE): $(ALL_OBJS) $(LIBS_DEP)
-	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) \
+	$(LINK) $(CFLAGS) $(LDFLAGS) $(OBJ_LDFLAGS) -o $(OBJFILE) -Wl,-Map=$(OBJNAME).map,--cref \
 			$(START_OBJS) $(APPL_OBJS) $(SYSSVC_OBJS) $(CFG_OBJS) \
 			-Wl,--start-group $(ALL_LIBS) -Wl,--end-group $(END_OBJS)
Index: asp3_tinet_ecnl_arm/trunk/app4_aircon/src/echonet_main.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/src/echonet_main.c	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/src/echonet_main.c	(revision 364)
@@ -1,7 +1,7 @@
 /*
  *  TOPPERS ECHONET Lite Communication Middleware
- * 
+ *
  *  Copyright (C) 2014 Cores Co., Ltd. Japan
- * 
+ *
  *  上記著作権者は，以下の(1)～(4)の条件を満たす場合に限り，本ソフトウェ
  *  ア（本ソフトウェアを改変したものを含む．以下同じ）を使用・複製・改
@@ -26,5 +26,5 @@
  *      由に基づく請求からも，上記著作権者およびTOPPERSプロジェクトを
  *      免責すること．
- * 
+ *
  *  本ソフトウェアは，無保証で提供されているものである．上記著作権者お
  *  よびTOPPERSプロジェクトは，本ソフトウェアに関して，特定の使用目的
@@ -32,9 +32,9 @@
  *  アの利用により直接的または間接的に生じたいかなる損害に関しても，そ
  *  の責任を負わない．
- * 
+ *
  *  @(#) $Id$
  */
 
-/* 
+/*
  *  サンプルプログラム(1)の本体
  */
@@ -55,4 +55,12 @@
 #include "adafruit_st7735.h"
 #include "draw_font.h"
+#include <tinet_defs.h>
+#include <tinet_config.h>
+#include <netinet/in.h>
+#include <netinet/in_var.h>
+#include <net/ethernet.h>
+#include <net/if_var.h>
+
+extern uint8_t mac_addr[6];
 
 /* TODO: メーカーコードを設定 */
@@ -184,10 +192,10 @@
 
 	/* サイズが１以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	*anno = *((uint8_t *)item->exinf) != *((uint8_t *)src);
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* ONの場合 */
 	case 0x30:
@@ -198,5 +206,5 @@
 		data[0] = 0x80;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -217,10 +225,10 @@
 {
 	/* サイズが１以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	*anno = *((uint8_t *)item->exinf) != *((uint8_t *)src);
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* 異常発生ありの場合 */
 	case 0x41:
@@ -246,8 +254,8 @@
 
 	/* サイズが1以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
-	switch(*(uint8_t *)src){
+	switch (*(uint8_t *)src) {
 	/* 自動の場合 */
 	case 0x41:
@@ -266,5 +274,5 @@
 		data[0] = 0xB0;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -288,14 +296,14 @@
 
 	/* サイズが1以外は受け付けない */
-	if(size != 1)
+	if (size != 1)
 		return 0;
 
 	/* 0℃～50℃ */
-	if((*(uint8_t *)src >= 0x00) && (*(uint8_t *)src <= 0x32)){
+	if ((*(uint8_t *)src >= 0x00) && (*(uint8_t *)src <= 0x32)) {
 		*((uint8_t *)item->exinf) = *((uint8_t *)src);
 		/* メインタスクに通知 */
 		data[0] = 0xB3;
 		ret = ecn_brk_wai(data, sizeof(data));
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_brk_wai");
 			return 2;
@@ -303,5 +311,5 @@
 	}
 	/* 上記以外は受け付けない */
-	else{
+	else {
 		return 0;
 	}
@@ -333,10 +341,10 @@
 
 	ret2 = get_tim(&now);
-	if (ret2 != E_OK){
+	if (ret2 != E_OK) {
 		syslog(LOG_ERROR, "get_tim");
 		return;
 	}
 
-	for(;;){
+	for (;;) {
 		prev = now;
 
@@ -346,5 +354,5 @@
 		/* 応答電文待ち */
 		ret = ecn_trcv_esv(&esv, timer);
-		if ((ret != E_OK) && (ret != E_BRK) && (ret != E_TMOUT)){
+		if ((ret != E_OK) && (ret != E_BRK) && (ret != E_TMOUT)) {
 			syslog(LOG_ERROR, "ecn_trcv_esv");
 			break;
@@ -352,5 +360,5 @@
 
 		ret2 = get_tim(&now);
-		if (ret2 != E_OK){
+		if (ret2 != E_OK) {
 			syslog(LOG_ERROR, "get_tim");
 			break;
@@ -367,5 +375,5 @@
 			/* 領域解放 */
 			ret = ecn_rel_esv(esv);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_rel_esv");
 				break;
@@ -376,5 +384,5 @@
 			/* 応答電文待ちの割り込みデータ取得 */
 			ret = ecn_get_brk_dat(esv, brkdat, sizeof(brkdat), &len);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_get_brk_dat");
 				break;
@@ -386,5 +394,5 @@
 			/* 領域解放 */
 			ret = ecn_rel_esv(esv);
-			if (ret != E_OK){
+			if (ret != E_OK) {
 				syslog(LOG_ERROR, "ecn_rel_esv");
 				break;
@@ -397,6 +405,4 @@
 }
 
-bool_t started = false;
-
 void echonet_change_netif_link(uint8_t link_up, uint8_t up)
 {
@@ -406,14 +412,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");
+		}
 	}
 
@@ -421,5 +423,5 @@
 	uint8_t data[2];
 	data[0] = 0x01;
-	data[1] = up ? 0x01 : 0x02;
+	data[1] = (up ? 0x01 : 0x02) | (link_up ? 0x10 : 0x20);
 	ret = ecn_brk_wai(data, sizeof(data));
 	if (ret != E_OK) {
@@ -429,5 +431,6 @@
 }
 
-enum main_state_t{
+enum main_state_t {
+	main_state_start,
 	main_state_idle,
 	main_state_search,
@@ -440,5 +443,5 @@
 
 int main_timer = TMO_FEVR;
-enum main_state_t main_state = main_state_idle;
+enum main_state_t main_state = main_state_start;
 int16_t main_ave_templ;
 bool_t main_tmp_fan_on;
@@ -470,5 +473,5 @@
 LCD_DrawProp_t drawProp;
 
-enum main_rly_state_t{
+enum main_rly_state_t {
 	main_rly_state_off,
 	main_rly_state_on
@@ -486,5 +489,6 @@
 	uint8_t btn;
 
-	/* １秒後に温度センサーを探す */
+	/* ECHONETミドルウェアを起動するのを待つ */
+	main_state = main_state_start;
 	main_timer = 1000 * 1000;
 
@@ -505,5 +509,5 @@
 	spi_init(&lcd.hspi, P10_14, P10_15, P10_12, NC);
 	spi_format(&lcd.hspi, 8, 0, 0);
-	spi_frequency(&lcd.hspi, 1000000);
+	spi_frequency(&lcd.hspi, 4000000);
 
 	gpio_init_out(&lcd.cs_pin, P10_13);
@@ -524,4 +528,5 @@
 	main_lcd_timer = 1000 * 1000;
 
+	/* メインタスクを起動 */
 	ER ret = act_tsk(MAIN_TASK);
 	if (ret != E_OK) {
@@ -537,16 +542,16 @@
 	int result = main_timer;
 
-	if((result == TMO_FEVR)
-		|| ((main_btn_timer != TMO_FEVR) && (main_btn_timer < result))){
+	if ((result == TMO_FEVR)
+		|| ((main_btn_timer != TMO_FEVR) && (main_btn_timer < result))) {
 		result = main_btn_timer;
 	}
 
-	if((result == TMO_FEVR)
-		|| ((main_lcd_timer != TMO_FEVR) && (main_lcd_timer < result))){
+	if ((result == TMO_FEVR)
+		|| ((main_lcd_timer != TMO_FEVR) && (main_lcd_timer < result))) {
 		result = main_lcd_timer;
 	}
 
-	if((result == TMO_FEVR)
-		|| ((main_rly_timer != TMO_FEVR) && (main_rly_timer < result))){
+	if ((result == TMO_FEVR)
+		|| ((main_rly_timer != TMO_FEVR) && (main_rly_timer < result))) {
 		result = main_rly_timer;
 	}
@@ -560,28 +565,28 @@
 static void main_progress(int interval)
 {
-	if(main_timer != TMO_FEVR){
+	if (main_timer != TMO_FEVR) {
 		main_timer -= interval;
-		if(main_timer < 0){
+		if (main_timer < 0) {
 			main_timer = 0;
 		}
 	}
 
-	if(main_btn_timer != TMO_FEVR){
+	if (main_btn_timer != TMO_FEVR) {
 		main_btn_timer -= interval;
-		if(main_btn_timer < 0){
+		if (main_btn_timer < 0) {
 			main_btn_timer = 0;
 		}
 	}
 
-	if(main_lcd_timer != TMO_FEVR){
+	if (main_lcd_timer != TMO_FEVR) {
 		main_lcd_timer -= interval;
-		if(main_lcd_timer < 0){
+		if (main_lcd_timer < 0) {
 			main_lcd_timer = 0;
 		}
 	}
 
-	if(main_rly_timer != TMO_FEVR){
+	if (main_rly_timer != TMO_FEVR) {
 		main_rly_timer -= interval;
-		if(main_rly_timer < 0){
+		if (main_rly_timer < 0) {
 			main_rly_timer = 0;
 		}
@@ -605,19 +610,19 @@
 
 	eobjid = ecn_get_eobj(esv);
-	if(eobjid == EOBJ_NULL){
+	if (eobjid == EOBJ_NULL) {
 		syslog(LOG_ERROR, "ecn_get_eobj");
 	}
 
 	ret = ecn_itr_ini(&enm, esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_itr_ini");
 		return;
 	}
 
-	for(;;) {
-		while((ret = ecn_itr_nxt(&enm, &epc, &pdc, p_edt)) == E_OK) {
+	for (;;) {
+		while ((ret = ecn_itr_nxt(&enm, &epc, &pdc, p_edt)) == E_OK) {
 			switch (epc) {
 			case 0xD6:
-				switch(main_state){
+				switch (main_state) {
 				case main_state_idle:
 				case main_state_search:
@@ -630,5 +635,5 @@
 				break;
 			case 0xE0:
-				switch(main_state){
+				switch (main_state) {
 				case main_state_survey_01:
 					/* 温度センサー２温度監視 */
@@ -660,9 +665,9 @@
 			}
 		}
-		if(ret != E_BOVR){
+		if (ret != E_BOVR) {
 			syslog(LOG_ERROR, "ecn_itr_nxt");
 			break;
 		}
-		if(enm.is_eof)
+		if (enm.is_eof)
 			break;
 	}
@@ -685,5 +690,5 @@
 	/* 温度センサー動作状態取得電文作成 */
 	ret = ecn_esv_get(&esv, senserids[no - 1], 0x80);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_get");
 		return;
@@ -692,9 +697,9 @@
 	/* 温度計測値取得追加 */
 	ret = ecn_add_epc(esv, 0xE0);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_add_epc");
 
 		ret = ecn_rel_esv(esv);
-		if(ret != E_OK){
+		if (ret != E_OK) {
 			syslog(LOG_ERROR, "ecn_rel_esv");
 		}
@@ -704,5 +709,5 @@
 	/* 電文送信 */
 	ret = ecn_snd_esv(esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -717,20 +722,20 @@
 	int templ = 0;
 
-	if(temp_sensor_01_data.property80 == 0x30){
+	if (temp_sensor_01_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_01_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_01_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_02_data.property80 == 0x30){
+	if (temp_sensor_02_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_02_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_02_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_03_data.property80 == 0x30){
+	if (temp_sensor_03_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_03_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_03_data.propertyE0) & 0xFF00) >> 8);
 		count++;
 	}
-	if(temp_sensor_04_data.property80 == 0x30){
+	if (temp_sensor_04_data.property80 == 0x30) {
 		templ += ((((uint16_t)temp_sensor_04_data.propertyE0) & 0xFF) << 8)
 			| ((((uint16_t)temp_sensor_04_data.propertyE0) & 0xFF00) >> 8);
@@ -738,9 +743,9 @@
 	}
 
-	if(count > 0){
+	if (count > 0) {
 		templ = templ / count;
-		if(templ < -2732)
+		if (templ < -2732)
 			main_ave_templ = 0x8000;
-		else if(templ > 32766)
+		else if (templ > 32766)
 			main_ave_templ = 0x7FFF;
 		else
@@ -748,6 +753,6 @@
 
 		/* FANが停止中の場合 */
-		if(!main_tmp_fan_on){
-			if(main_ave_templ > (10 * home_air_conditioner_data.propertyB3 + 5)){
+		if (!main_tmp_fan_on) {
+			if (main_ave_templ > (10 * home_air_conditioner_data.propertyB3 + 5)) {
 				main_tmp_fan_on = true;
 
@@ -758,6 +763,6 @@
 		}
 		/* FANが稼働中の場合 */
-		else{
-			if(main_ave_templ < (10 * home_air_conditioner_data.propertyB3 - 5)){
+		else {
+			if (main_ave_templ < (10 * home_air_conditioner_data.propertyB3 - 5)) {
 				main_tmp_fan_on = false;
 
@@ -777,25 +782,50 @@
 static void main_break_wait(uint8_t *brkdat, int32_t len)
 {
+	char mac_text[30] = "mac: ";
+	char ipaddr_text[30] = "ipadr: ";
+	const T_IN4_ADDR *ip4_addr;
+	int pos;
+	bool_t prev;
+
 	switch (brkdat[0]) {
 	case 0x01:
-		// Link up/down
+		switch (brkdat[1] >> 4) {
+		case 1:
+			break;
+		case 2:
+			break;
+		}
+
+		pos = str_macaddr(&mac_text[4], sizeof(mac_text) - 4, mac_addr, 0);
+		mac_text[pos + 4] = '\0';
+		lcd_drawString(&lcd, mac_text, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 11), ST7735_BLACK, ST7735_WHITE);
+
+		ip4_addr = in4_get_ifaddr(0);
+		pos = str_ipv4addr(&ipaddr_text[6], sizeof(ipaddr_text) - 6, ip4_addr, 0);
+		ipaddr_text[pos + 6] = '\0';
+		lcd_drawString(&lcd, ipaddr_text, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 12), ST7735_BLACK, ST7735_WHITE);
 		break;
 	}
 
 	/* 運転モードが送風の場合、温度によらずFANをON */
-	if (*brkdat == 0xB0) {
-		bool_t prev = main_ctl_fan_on;
+	switch (*brkdat) {
+	case 0x80:
+		if (main_ctl_fan_on) {
+			/* リレー出力をON/OFF */
+			main_rly_onoff(home_air_conditioner_data.property80 == 0x30);
+		}
+		break;
+	case 0xB0:
+		prev = main_ctl_fan_on;
 		main_ctl_fan_on = home_air_conditioner_data.propertyB0 == 0x45;
 
 		if (prev != main_ctl_fan_on) {
 			if (main_ctl_fan_on) {
-				/* リレー出力をON */
-				if (!main_tmp_fan_on)
-					main_rly_onoff(true);
+				/* リレー出力をON/OFF */
+				main_rly_onoff(home_air_conditioner_data.property80 == 0x30);
 			}
 			else {
-				/* リレー出力をOFF */
-				if (!main_tmp_fan_on)
-					main_rly_onoff(false);
+				/* リレー出力をON/OFF */
+				main_rly_onoff(main_tmp_fan_on);
 			}
 		}
@@ -813,17 +843,17 @@
 static void main_timeout()
 {
-	if(main_timer == 0){
+	if (main_timer == 0) {
 		main_ontimer();
 	}
 
-	if(main_btn_timer == 0){
+	if (main_btn_timer == 0) {
 		main_btn_ontimer();
 	}
 
-	if(main_lcd_timer == 0){
+	if (main_lcd_timer == 0) {
 		main_lcd_ontimer();
 	}
 
-	if(main_rly_timer == 0){
+	if (main_rly_timer == 0) {
 		main_rly_ontimer();
 	}
@@ -834,5 +864,18 @@
 static void main_ontimer()
 {
-	switch(main_state){
+	ER ret;
+
+	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_idle;
+		main_timer = 1000 * 1000;
+		break;
 	case main_state_idle:
 	case main_state_search:
@@ -891,5 +934,5 @@
 	/* 温度センサー検索 */
 	ret = ecn_esv_inf_req(&esv, EOBJ_NULL, 0xD6);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_inf_req");
 		return;
@@ -898,5 +941,5 @@
 	/* 電文送信 */
 	ret = ecn_snd_esv(esv);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -919,5 +962,5 @@
 	if ((btn == BUTTON_LEFT) && !main_btn1_state) {
 		main_btn1_count++;
-		if(main_btn1_count > 10){
+		if (main_btn1_count > 10) {
 			main_btn1_count = 0;
 			main_btn1_state = true;
@@ -928,5 +971,5 @@
 	else if ((btn != BUTTON_LEFT) && main_btn1_state) {
 		main_btn1_count++;
-		if(main_btn1_count > 10){
+		if (main_btn1_count > 10) {
 			main_btn1_count = 0;
 			main_btn1_state = false;
@@ -939,5 +982,5 @@
 	if ((btn == BUTTON_RIGHT) && !main_btn2_state) {
 		main_btn2_count++;
-		if(main_btn2_count > 10){
+		if (main_btn2_count > 10) {
 			main_btn2_count = 0;
 			main_btn2_state = true;
@@ -948,5 +991,5 @@
 	else if ((btn != BUTTON_RIGHT) && main_btn2_state) {
 		main_btn2_count++;
-		if(main_btn2_count > 10){
+		if (main_btn2_count > 10) {
 			main_btn2_count = 0;
 			main_btn2_state = false;
@@ -963,5 +1006,5 @@
 	char temp2[] = "測定温度：+00.0℃";
 	char mode[] = "運転モード：自動  ";
-	char *mode_texts[] = { "自動  ", "冷房  ", "暖房  ", "除湿  ", "送風  ", "その他" };
+	char *mode_texts[] = { "その他", "自動  ", "冷房  ", "暖房  ", "除湿  ", "送風  " };
 	char *btn_texts[] = { "none  ", "down  ", "left  ", "select", "up    ", "right " };
 	int temp, btn;
@@ -979,5 +1022,5 @@
 			power[11] = 'f';
 		}
-		lcd_drawString(&lcd, &power[9], X_LINE_HALF_TO_PIX(&lcd, 6) + 10, Y_ROW_TO_PIX(&lcd, main_lcd_state + 4) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, &power[9], X_LINE_HALF_TO_PIX(&lcd, 6), Y_ROW_TO_PIX(&lcd, main_lcd_state + 2), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state++;
 		break;
@@ -992,5 +1035,5 @@
 			temp = -temp;
 		temp1[17] = '0' + temp;
-		lcd_drawString(&lcd, &temp1[15], X_LINE_HALF_TO_PIX(&lcd, 10) + 10, Y_ROW_TO_PIX(&lcd, main_lcd_state + 4) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, &temp1[15], X_LINE_HALF_TO_PIX(&lcd, 10), Y_ROW_TO_PIX(&lcd, main_lcd_state + 2), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state++;
 		break;
@@ -1009,10 +1052,10 @@
 			temp = -temp;
 		temp2[19] = '0' + temp;
-		lcd_drawString(&lcd, &temp2[15], X_LINE_HALF_TO_PIX(&lcd, 10) + 10, Y_ROW_TO_PIX(&lcd, main_lcd_state + 4) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, &temp2[15], X_LINE_HALF_TO_PIX(&lcd, 10), Y_ROW_TO_PIX(&lcd, main_lcd_state + 2), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state++;
 		break;
 	case 3:
 		temp = home_air_conditioner_data.propertyB0 - 0x40;
-		lcd_drawString(&lcd, mode_texts[temp], X_LINE_HALF_TO_PIX(&lcd, 12) + 10, Y_ROW_TO_PIX(&lcd, main_lcd_state + 4) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, mode_texts[temp], X_LINE_HALF_TO_PIX(&lcd, 12), Y_ROW_TO_PIX(&lcd, main_lcd_state + 2), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state++;
 		break;
@@ -1023,5 +1066,5 @@
 	case 6:
 		btn = main_read_button(&joystick);
-		lcd_drawString(&lcd, btn_texts[btn], X_LINE_TO_PIX(&lcd, 0) + 10, Y_ROW_TO_PIX(&lcd, 10) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, btn_texts[btn], X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 9), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state++;
 		break;
@@ -1030,9 +1073,9 @@
 		break;
 	case 10:
-		lcd_drawString(&lcd, "エアコン", X_LINE_TO_PIX(&lcd, 9) + 10, Y_ROW_TO_PIX(&lcd, 0) + 10, ST7735_BLACK, ST7735_WHITE);
-		lcd_drawString(&lcd, power, X_LINE_TO_PIX(&lcd, 0) + 10, Y_ROW_TO_PIX(&lcd, 0 + 4) + 10, ST7735_BLACK, ST7735_WHITE);
-		lcd_drawString(&lcd, temp1, X_LINE_TO_PIX(&lcd, 0) + 10, Y_ROW_TO_PIX(&lcd, 1 + 4) + 10, ST7735_BLACK, ST7735_WHITE);
-		lcd_drawString(&lcd, temp2, X_LINE_TO_PIX(&lcd, 0) + 10, Y_ROW_TO_PIX(&lcd, 2 + 4) + 10, ST7735_BLACK, ST7735_WHITE);
-		lcd_drawString(&lcd, mode, X_LINE_TO_PIX(&lcd, 0) + 10, Y_ROW_TO_PIX(&lcd, 3 + 4) + 10, ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, "エアコン", X_LINE_TO_PIX(&lcd, 6), Y_ROW_TO_PIX(&lcd, 0), ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, power, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 0 + 2), ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, temp1, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 1 + 2), ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, temp2, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 2 + 2), ST7735_BLACK, ST7735_WHITE);
+		lcd_drawString(&lcd, mode, X_LINE_TO_PIX(&lcd, 0), Y_ROW_TO_PIX(&lcd, 3 + 2), ST7735_BLACK, ST7735_WHITE);
 		main_lcd_state = 0;
 		break;
@@ -1079,9 +1122,9 @@
 
 	/* 押されて戻った時に処理する */
-	if(push)
+	if (push)
 		return;
 
 	/* 設定温度 */
-	if(main_templ > 0)
+	if (main_templ > 0)
 		main_templ--;	/* - 1℃ */
 
@@ -1090,5 +1133,5 @@
 	/* プロパティ設定電文作成 */
 	ret = ecn_esv_seti(&esv, HOME_AIR_CONDITIONER_EOBJ, 0xB3, 1, p_edt);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_seti");
 		return;
@@ -1096,6 +1139,6 @@
 
 	/* 電文送信 */
-	ecn_snd_esv(esv);
-	if(ret != E_OK){
+	ret = ecn_snd_esv(esv);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -1112,9 +1155,9 @@
 
 	/* 押されて戻った時に処理する */
-	if(push)
+	if (push)
 		return;
 
 	/* 設定温度 */
-	if(main_templ < 50)
+	if (main_templ < 50)
 		main_templ++;	/* + 1.0℃ */
 
@@ -1123,5 +1166,5 @@
 	/* プロパティ設定電文作成 */
 	ret = ecn_esv_seti(&esv, HOME_AIR_CONDITIONER_EOBJ, 0xB3, 1, p_edt);
-	if(ret != E_OK){
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_esv_seti");
 		return;
@@ -1129,6 +1172,6 @@
 
 	/* 電文送信 */
-	ecn_snd_esv(esv);
-	if(ret != E_OK){
+	ret = ecn_snd_esv(esv);
+	if (ret != E_OK) {
 		syslog(LOG_ERROR, "ecn_snd_esv");
 	}
@@ -1137,9 +1180,9 @@
 static void main_rly_onoff(bool_t onoff)
 {
-	if(onoff){
+	if (onoff) {
 		/* リレー出力をON */
 		gpio_write(&relay_sw, 1);
 	}
-	else{
+	else {
 		/* リレー出力をOFF */
 		gpio_write(&relay_sw, 0);
@@ -1159,5 +1202,5 @@
 	/* 500msパルス出力 */
 	main_rly_state = main_rly_state_on;
-	main_rly_timer = 500;
+	main_rly_timer = 500 * 1000;
 }
 
@@ -1167,6 +1210,5 @@
 static void main_rly_ontimer()
 {
-	switch(main_rly_state)
-	{
+	switch (main_rly_state) {
 	case main_rly_state_off:
 		main_rly_timer = TMO_FEVR;
Index: asp3_tinet_ecnl_arm/trunk/app4_aircon/src/main.c
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/src/main.c	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/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_arm/trunk/app4_aircon/src/main.cfg
===================================================================
--- asp3_tinet_ecnl_arm/trunk/app4_aircon/src/main.cfg	(revision 359)
+++ asp3_tinet_ecnl_arm/trunk/app4_aircon/src/main.cfg	(revision 364)
@@ -54,5 +54,4 @@
 INCLUDE("tinet/tinet_asp.cfg");
 INCLUDE("tinet_main.cfg");
-INCLUDE("netinet/ip_igmp.cfg");
 
 /* DHCP クライアント */
