Index: uKadecot/trunk/kadecot/wamp_dealer.c
===================================================================
--- uKadecot/trunk/kadecot/wamp_dealer.c	(revision 108)
+++ uKadecot/trunk/kadecot/wamp_dealer.c	(revision 125)
@@ -569,4 +569,8 @@
 {
 	static const char macAddr[] = "macAddr";
+	static const char dhcpEnable[] = "dhcpEnable";
+	static const char ipAddr[] = "ipAddr";
+	static const char netmask[] = "netmask";
+	static const char gateway[] = "gateway";
 
 	switch (state->level) {
@@ -579,5 +583,32 @@
 				if(strcmp(macAddr, dealer->s->jsn_buf) == 0){
 					dealer->state = WAMP_DEALER_STATE_MAC_ADDR_VALUE;
-					memset(&dealer->init_params, 0, sizeof(dealer->init_params));
+					dealer->init_params.pos = 0;
+					memset(&dealer->init_params.mac_addr, 0, sizeof(dealer->init_params.mac_addr));
+				}
+				if(strcmp(dhcpEnable, dealer->s->jsn_buf) == 0){
+					dealer->state = WAMP_DEALER_STATE_DHCP_ENABLE_VALUE;
+					dealer->init_params.dhcp_enable = false;
+				}
+				if(strcmp(ipAddr, dealer->s->jsn_buf) == 0){
+					dealer->state = WAMP_DEALER_STATE_IP_ADDR_VALUE;
+					dealer->init_params.pos = 0;
+					memset(&dealer->init_params.ip_addr, 0, sizeof(dealer->init_params.ip_addr));
+				}
+				if(strcmp(netmask, dealer->s->jsn_buf) == 0){
+					dealer->state = WAMP_DEALER_STATE_NETMASK_VALUE;
+					dealer->init_params.pos = 0;
+					memset(&dealer->init_params.netmask, 0, sizeof(dealer->init_params.netmask));
+				}
+				if(strcmp(gateway, dealer->s->jsn_buf) == 0){
+					dealer->state = WAMP_DEALER_STATE_GATEWAY_VALUE;
+					dealer->init_params.pos = 0;
+					memset(&dealer->init_params.gateway, 0, sizeof(dealer->init_params.gateway));
+				}
+				break;
+			case JSONSL_T_SPECIAL:
+				switch(dealer->state){
+				case WAMP_DEALER_STATE_DHCP_ENABLE_VALUE:
+					dealer->init_params.dhcp_enable = strcmp("true", dealer->s->jsn_buf) == 0;
+					break;
 				}
 				break;
@@ -597,4 +628,13 @@
 				case WAMP_DEALER_STATE_MAC_ADDR_VALUE:
 					dealer->init_params.mac_addr[dealer->init_params.pos++] = atoi(dealer->s->jsn_buf);
+					break;
+				case WAMP_DEALER_STATE_IP_ADDR_VALUE:
+					dealer->init_params.ip_addr[dealer->init_params.pos++] = atoi(dealer->s->jsn_buf);
+					break;
+				case WAMP_DEALER_STATE_NETMASK_VALUE:
+					dealer->init_params.netmask[dealer->init_params.pos++] = atoi(dealer->s->jsn_buf);
+					break;
+				case WAMP_DEALER_STATE_GATEWAY_VALUE:
+					dealer->init_params.gateway[dealer->init_params.pos++] = atoi(dealer->s->jsn_buf);
 					break;
 				}
@@ -1777,6 +1817,14 @@
 	ECN_FBS_SSIZE_T pos = 0;
 	ER ret;
-
-	ret = data_flash_write(0, dealer->init_params.mac_addr);
+	uint8_t data[32];
+
+	memset(data, 0, sizeof(data));
+	memcpy(&data[0], dealer->init_params.mac_addr, sizeof(dealer->init_params.mac_addr));
+	data[6] = dealer->init_params.dhcp_enable ? 1 : 0;
+	memcpy(&data[7], dealer->init_params.ip_addr, sizeof(dealer->init_params.ip_addr));
+	memcpy(&data[11], dealer->init_params.netmask, sizeof(dealer->init_params.netmask));
+	memcpy(&data[15], dealer->init_params.gateway, sizeof(dealer->init_params.gateway));
+
+	ret = data_flash_write(0, data);
 	if (ret != E_OK) {
 		syslog(LOG_WARNING, "data_flash_write() result = %d", ret);
@@ -1804,4 +1852,34 @@
 
 	dealer->error = NULL;
+}
+
+static ER wamp_dealer_write_ip_addr(struct wamp_dealer *dealer, ECN_FBS_ID buf,
+	ECN_FBS_SSIZE_T *pos, uint8_t *ip_addr, char *name)
+{
+	ER ret;
+	int i;
+
+	/* IPアドレス */
+	ret = fbs_printf(buf, pos, "\"%s\":[", name);
+	if (ret != E_OK) {
+		return ret;
+	}
+
+	for (i = 0; i < 4; i++) {
+		ret = fbs_printf(buf, pos, "%d,", ip_addr[i]);
+		if (ret != E_OK) {
+			return ret;
+		}
+	}
+
+	/* 最後の","を消す */
+	*pos = *pos - 1;
+
+	ret = fbs_printf(buf, pos, "],");
+	if (ret != E_OK) {
+		return ret;
+	}
+
+	return E_OK;
 }
 
@@ -1813,6 +1891,7 @@
 	ER ret;
 	int i;
-
-	ret = data_flash_read(0, dealer->init_params.mac_addr);
+	uint8_t data[32];
+
+	ret = data_flash_read(0, data);
 	if (ret != E_OK) {
 		syslog(LOG_WARNING, "data_flash_read() result = %d", ret);
@@ -1820,4 +1899,10 @@
 	}
 
+	memcpy(dealer->init_params.mac_addr, &data[0], sizeof(dealer->init_params.mac_addr));
+	dealer->init_params.dhcp_enable = data[6] != 0;
+	memcpy(dealer->init_params.ip_addr, &data[7], sizeof(dealer->init_params.ip_addr));
+	memcpy(dealer->init_params.netmask, &data[11], sizeof(dealer->init_params.netmask));
+	memcpy(dealer->init_params.gateway, &data[15], sizeof(dealer->init_params.gateway));
+
 	ret = _ecn_fbs_cre(1, &buf);
 	if (ret != E_OK) {
@@ -1826,5 +1911,13 @@
 	}
 
-	ret = fbs_printf(buf, &pos, "[50,%d,{},[],{\"macAddr\":[", dealer->requestId);
+	ret = fbs_printf(buf, &pos, "[50,%d,{},[],{", dealer->requestId);
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "fbs_printf() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* MACアドレス */
+	ret = fbs_printf(buf, &pos, "\"macAddr\":[");
 	if (ret != E_OK) {
 		syslog(LOG_WARNING, "fbs_printf() result = %d", ret);
@@ -1845,5 +1938,47 @@
 	pos--;
 
-	ret = fbs_printf(buf, &pos, "]}]");
+	ret = fbs_printf(buf, &pos, "],");
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "fbs_printf() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* DHCP有効／無効 */
+	ret = fbs_printf(buf, &pos, "\"dhcpEnable\":%s,", dealer->init_params.dhcp_enable ? "true" : "false");
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "fbs_printf() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* IPアドレス */
+	ret = wamp_dealer_write_ip_addr(dealer, buf, &pos, dealer->init_params.ip_addr, "ipAddr");
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "wamp_dealer_write_ip_addr() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* サブネットマスク */
+	ret = wamp_dealer_write_ip_addr(dealer, buf, &pos, dealer->init_params.netmask, "netmask");
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "wamp_dealer_write_ip_addr() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* デフォルトゲートウェイ */
+	ret = wamp_dealer_write_ip_addr(dealer, buf, &pos, dealer->init_params.gateway, "gateway");
+	if (ret != E_OK) {
+		syslog(LOG_WARNING, "wamp_dealer_write_ip_addr() result = %d", ret);
+		_ecn_fbs_del(buf);
+		return;
+	}
+
+	/* 最後の","を消す */
+	pos--;
+
+	ret = fbs_printf(buf, &pos, "}]");
 	if (ret != E_OK) {
 		syslog(LOG_WARNING, "fbs_printf() result = %d", ret);
Index: uKadecot/trunk/kadecot/wamp_dealer.h
===================================================================
--- uKadecot/trunk/kadecot/wamp_dealer.h	(revision 108)
+++ uKadecot/trunk/kadecot/wamp_dealer.h	(revision 125)
@@ -53,4 +53,8 @@
 	WAMP_DEALER_STATE_ANALOG_VALUE,
 	WAMP_DEALER_STATE_MAC_ADDR_VALUE,
+	WAMP_DEALER_STATE_DHCP_ENABLE_VALUE,
+	WAMP_DEALER_STATE_IP_ADDR_VALUE,
+	WAMP_DEALER_STATE_NETMASK_VALUE,
+	WAMP_DEALER_STATE_GATEWAY_VALUE,
 } wamp_dealer_state_t;
 
@@ -110,5 +114,9 @@
 typedef struct wamp_dealer_init_params{
 	int pos;
-	uint8_t mac_addr[32]; /* DATA FLASHのサイズ分 */
+	uint8_t mac_addr[6];
+	bool_t dhcp_enable;
+	uint8_t ip_addr[4];
+	uint8_t netmask[4];
+	uint8_t gateway[4];
 } wamp_dealer_init_params_t;
 
