This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

libMiMic(MiMic library for mbed)は、WebService機能を提供するSDKです。 mbedでWebAPIに対応したネットワークデバイスを簡単に作ることが出来ます。

libMiMicはMiMic projectで開発しています。MiMic projectについてはこちらをご覧ください。 http://nyatla.jp/mimic/wp/

構成

libMiMicはmbedRTOS上で動作し、ユーザアプリケーションにAPIを提供します。コアAPIはC言語で記述されていますが、使用頻度の高いものについてはmbed向けのC++APIが準備されています。

/media/uploads/nyatla/libmimic-sdk.png

※libMiMicはmbedの標準イーサネットドライバをしようしていません。

標準イーサネットドライバと同時に使用することはできません。

  • MiMicIP - IPv4スタックです。レテンシとメモリ消費量を抑えたuipベースのライブラリです。
  • ARP/ICMP/UDP/TCP - 基礎的なソケットAPIを提供します。APIは独自です。
  • HTTP/1.1 Server - HTTP/1.1に対応したサーバです。マルチセッション・Chunked・持続性接続に対応しています。
  • HTTP Modules - HTTP/1.1の機能モジュールです。以下のモジュールがあります。
    • ROM file provider - ROMに格納したファイルイメージを公開します。
    • File system provider - mbedファイルシステムを公開します。
    • Onchip configuration - プログラムフラッシュを利用して設定を保存します。
    • MiMicVM processor - RPCリクエスト(MiMicVM)を処理します。
    • FileUpload - ファイルアップロードを受け取ります。
    • URL decoder - HTTPリクエストを解析します。
    • UPnP handler -UPnPメッセージを処理します。
    • WebSocket - Websocketサーバです。
  • mDNS - マルチキャストDNSサービスです。
  • UPnP - UPnP/1.0の機能を提供します。UPnP handlerと協調して動作します。(現在はデバイス探索(SSDP)・デスクリプション(Description)のみ実装してあります。)
  • DHCP/APIPA - ゼロコンフィギュレーション用のモジュールです。
  • HTTP/1.1 Client
  • mbed C++ class library - mbed向けのC++CPIです。C言語のものより簡単です。

対応機種

  • mbed(mbed LPC1768)
  • LPCXpresso1769

プログラム

Import programMiMicRemoteMCU-for-Mbed

MiMic RemoteMCU for mbed. This program provides MCU control API over REST API. It can control MCU from Javascript,PHP or any HTTP rest client directly. And, The application has self development environment.

Import programMbedFileServer

The program publishes files at local directory and SD filesystem. It is a full-fledged webServer somewhat.

サンプル

Import programMiMicSimpleHttpd

This is a simplest HTTP server made ​​of libMiMic. It will echo back a request path.

Import programUPnPBasicDevice

Simplest UPnP basic device example. This program to run UPnP basic device on the mbed.

Import programWebSocketSample

MiMicSDK Websocket module sample program.

Import programHttpClientSamlpe

A http client sample program.

Import programTcpSocketClientSamlpe

MiMicSDK Tcp client socket sample program.

Import programUdpSocketSamlpe

Udp socket sample program. This program will send back the received packet.

チュートリアル

English

libMiMic(MiMic library for mbed) is SDK which provides Webservice functions. It can be created networking device easily using mbed.

See more MiMic information, See MiMic project website. http://nyatla.jp/mimic/wp/

Structure

libMiMic run on mbed RTOS and provides networking API to user application. This library has C++ class API for the mbed, and low-level C language API.

/media/uploads/nyatla/libmimic-sdk.png

For WebService general, it can be written in a simple C + + API.

libMiMic does not have the standard Ethernet driver of mbed. It is not possible that will be used with the standard Ethernet driver.

  • MiMicIP - IPv4 protocol stack. This is based uip which is reduced memory and latency.
  • ARP / ICMP / UDP / TCP - Those are provide basic IP protocols.
  • HTTP/1.1 Server - The Http server compatible HTTP/1.1. It supports multi-session, chunked transport, persistent connection.
  • HTTP Modules - There are addon-module for HTTP server. The following modules.
    • ROM file module - Publish the file images in ROM.
    • File system module - Publish thefiles in mbed file system.
    • Onchip configuration module - To save the network settings to the program flash via REST.
    • MiMicVM module - To handle the (MiMicVM) RPC request.
    • FileUpload module - Accept a file via HTTP POST.
    • URL dedoce module - A versatility URL decoder.
    • UPnP handle module - To handle UPnP messages.
    • UPnP - This provides UPnP/1.0 device functions. It works together with UPnP handler.
    • Websocket - websocket (version13) server
  • mDNS Service - DNS-SD protocol server.
  • UPnP - This provides UPnP/1.0 device functions which works with UPnP handler. (You have been implemented (SSDP) ? description only (Description) device search now.) It is a module zero configuration for - DHCP / APIPA. mbed C + + class library - C of mbed for + + is the CPI. It is simple than that of the C language.
  • DHCP/APIPA - It support zero-cpnfigulation.
  • mbed C++ class library. Almost APIs for Web applications are available.
  • HTTP/1.1 Client

Supported target

  • mbed(mbed LPC1768)
  • LPCXpresso1769

Application

Import programMiMicRemoteMCU-for-Mbed

MiMic RemoteMCU for mbed. This program provides MCU control API over REST API. It can control MCU from Javascript,PHP or any HTTP rest client directly. And, The application has self development environment.

Import programMbedFileServer

The program publishes files at local directory and SD filesystem. It is a full-fledged webServer somewhat.

Sample

Import programMiMicSimpleHttpd

This is a simplest HTTP server made ​​of libMiMic. It will echo back a request path.

Import programUPnPBasicDevice

Simplest UPnP basic device example. This program to run UPnP basic device on the mbed.

Import programWebSocketSample

MiMicSDK Websocket module sample program.

Import programHttpClientSamlpe

A http client sample program.

Import programTcpSocketClientSamlpe

MiMicSDK Tcp client socket sample program.

Import programUdpSocketSamlpe

Udp socket sample program. This program will send back the received packet.

Tutorial

Files at this revision

API Documentation at this revision

Comitter:
nyatla
Date:
Sat Sep 27 13:33:26 2014 +0000
Parent:
90:d35c976570fc
Child:
92:4f77028cce64
Commit message:
NyLPC_TTxBufferHeader???????????????????; ???????????; K64F???????????

Changed in this revision

core/NyLPC_cMiMicEnv.c Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/NyLPC_IEthernetDevice.h Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/NyLPC_cEthernetMM.c Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/NyLPC_cEthernetMM.h Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/lpc17xx/EthDev_LPC17xx.c Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/lpc17xx/EthDev_LPC17xx.h Show annotated file Show diff for this revision Revisions of this file
core/driver/ethernet/lpc17xx/EtherDev_LAN8720.c Show annotated file Show diff for this revision Revisions of this file
core/include/NyLPC_config.h Show annotated file Show diff for this revision Revisions of this file
core/os/mbedrtos/NyLPC_cIsr.cpp Show annotated file Show diff for this revision Revisions of this file
core/uip/NyLPC_cUipService.c Show annotated file Show diff for this revision Revisions of this file
mbed/jsonrpc/Target_K64F.cpp Show annotated file Show diff for this revision Revisions of this file
mbed/jsonrpc/Target_LPC4088.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/core/NyLPC_cMiMicEnv.c	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/NyLPC_cMiMicEnv.c	Sat Sep 27 13:33:26 2014 +0000
@@ -7,6 +7,8 @@
 const static char* MCU="LPC4088";
 #elif NyLPC_MCU==NyLPC_MCU_LPC17xx
 const static char* MCU="LPC176x";
+#elif NyLPC_MCU==NyLPC_MCU_K64F
+const static char* MCU="K64F";
 #endif
 
 const static char* UNKNOWN="UNKNOWN";
--- a/core/driver/ethernet/NyLPC_IEthernetDevice.h	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/NyLPC_IEthernetDevice.h	Sat Sep 27 13:33:26 2014 +0000
@@ -1,7 +1,7 @@
 /*
  * NyLPC_IEthernetDevice.h
  *
- *  Created on: 2011/12/06
+ *  Created: 2011/12/06
  * MiMicのイーサネットドライバインタフェイスを定義する。
  */
 #ifndef NyLPC_IEthernetDevice_h
@@ -13,6 +13,8 @@
 extern "C" {
 #endif /* __cplusplus */
 
+
+
 typedef struct NyLPC_TiEthernetDevice NyLPC_TiEthernetDevice_t;
 
 /**非同期イベントのメッセージタイプ*/
@@ -29,24 +31,6 @@
 
 typedef void (*NyLPC_TiEthernetDevice_onEvent)(void* i_param,NyLPC_TiEthernetDevice_EVENT i_type);
 
-/**
- * 送信バッフメモリのヘッダ。
- * この構造体は、TXバッファメモリブロックのヘッダーです。
- * TXバッファメモリブロックは、この構造体の後ろに、sizeに一致したメモリを連結したもので表現します。
- * <pre>
- * buffer=[struct NyLPC_TTxBufferHeader][n]
- * </pre>
- */
-struct NyLPC_TTxBufferHeader
-{
-	//メモリブロックの参照カウンタ。
-	NyLPC_TInt8  ref;
-	//送信用にロックしたかを示すフラグ
-	NyLPC_TUInt8 is_lock;
-	//32ビット境界に合わせるためのパディング。
-	NyLPC_TUInt16 padding;
-};
-
 
 
 /**
@@ -82,7 +66,7 @@
  * 割り当てたメモリブロックのヘッダ。
  */
 #define NyLPC_iEthernetDevice_allocTxBuf(i,h,s) (i)->allocTxBuf((h),(s))
-typedef struct NyLPC_TTxBufferHeader* (*NyLPC_TiEthernetDevice_allocTxBuf)(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
+typedef void* (*NyLPC_TiEthernetDevice_allocTxBuf)(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
 
 
 /**
@@ -90,7 +74,7 @@
  * 関数は、メモリブロックの参照カウンタを1減算する。
  */
 #define NyLPC_iEthernetDevice_releaseTxBuf(i,b) (i)->releaseTxBuf(b)
-typedef void (*NyLPC_TiEthernetDevice_releaseTxBuf)(struct NyLPC_TTxBufferHeader* i_buf);
+typedef void (*NyLPC_TiEthernetDevice_releaseTxBuf)(void* i_buf);
 
 
 
@@ -99,12 +83,11 @@
  * @param i_buf
  * allocTxBufで得たメモリか、初期化したNyLPC_TTxBufferHeaderメモリブロックを指定する。
  * 送信が終わるまでの間、メモリを開放してはならない。
- * #外部で確保したメモリについては、利用不能なケースがあるかもしれない。現在のMiMicでは、使用できることを前提としている。
  * @oaram i_size
  * i_bufの後ろに連結されているデータメモリの長さ
  */
 #define NyLPC_iEthernetDevice_sendTxEthFrame(i,b,s) (i)->sendTxEthFrame((b),(s))
-typedef void (*NyLPC_TiEthernetDevice_sendTxEthFrame)(struct NyLPC_TTxBufferHeader* i_buf,unsigned short i_size);
+typedef void (*NyLPC_TiEthernetDevice_sendTxEthFrame)(void* i_buf,unsigned short i_size);
 
 
 /**
--- a/core/driver/ethernet/NyLPC_cEthernetMM.c	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/NyLPC_cEthernetMM.c	Sat Sep 27 13:33:26 2014 +0000
@@ -1,51 +1,9 @@
 #include "NyLPC_cEthernetMM.h"
-/**
- * メモリブロックの数
- */
-#define NUM_OF_MAX_BUF  3
-#define NUM_OF_512_BUF  3
-#define NUM_OF_256_BUF  4
-#define NUM_OF_128_BUF 16
-#define NUM_OF_64_BUF   4
-
-/**
- * FULLサイズのEthernetFrame送信メモリのサイズ。
- * ここで最大送信サイズを制限する。
- * 通常は1460+20+20+14=1514バイト
- */
-#define MAX_TX_ETHERNET_FRAME_SIZE	1514
 
 /**
- * TXメモリブロックの配置
- * 9518バイト
- */
-struct TTxMemoryBlock
-{
-	struct{
-		struct NyLPC_TTxBufferHeader h;
-		NyLPC_TUInt8 b[MAX_TX_ETHERNET_FRAME_SIZE];
-	}buf_max[NUM_OF_MAX_BUF];//(4+MAX_TX_ETHERNET_FRAME_SIZE(1514))*3=? default=4554
-	struct{
-		struct NyLPC_TTxBufferHeader h;
-		NyLPC_TUInt8 b[512];
-	}buf_512[NUM_OF_512_BUF];//(4+512)*3=1548
-	struct{
-		struct NyLPC_TTxBufferHeader h;
-		NyLPC_TUInt8 b[256];
-	}buf_256[NUM_OF_256_BUF];//(4+256)*4=1560
-	struct{
-		struct NyLPC_TTxBufferHeader h;
-		NyLPC_TUInt8 b[128];
-	}buf_128[NUM_OF_128_BUF];//(4+128)*16=1584
-	struct{
-		struct NyLPC_TTxBufferHeader h;
-		NyLPC_TUInt8 b[64];
-	}buf_64[NUM_OF_64_BUF];//(4+64)*4=272
-};
-/**
  * メモリブロックの配置
  */
-static struct TTxMemoryBlock* _mem_addr;
+static struct NyLPC_TcEthernetMM_TxMemoryBlock* _mem_addr;
 
 
 
@@ -57,31 +15,31 @@
 	int x;
 	NyLPC_TUInt8 r1,r2,r3,r4,r5;
 	r1=r2=r3=r4=r5=0;
-	for(x=0;x<NUM_OF_MAX_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_MAX_BUF;x++){
 		if(_mem_addr->buf_max[x].h.is_lock || _mem_addr->buf_max[x].h.ref>0){
 			r1++;
 			continue;
 		}
 	}
-	for(x=0;x<NUM_OF_512_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_512_BUF;x++){
 		if(_mem_addr->buf_512[x].h.is_lock || _mem_addr->buf_512[x].h.ref>0){
 			r2++;
 			continue;
 		}
 	}
-	for(x=0;x<NUM_OF_256_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_256_BUF;x++){
 		if(_mem_addr->buf_256[x].h.is_lock || _mem_addr->buf_256[x].h.ref>0){
 			r3++;
 			continue;
 		}
 	}
-	for(x=0;x<NUM_OF_128_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_128_BUF;x++){
 		if(_mem_addr->buf_128[x].h.is_lock || _mem_addr->buf_128[x].h.ref>0){
 			r4++;
 			continue;
 		}
 	}
-	for(x=0;x<NUM_OF_64_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_64_BUF;x++){
 		if(_mem_addr->buf_64[x].h.is_lock || _mem_addr->buf_64[x].h.ref>0){
 			r5++;
 			continue;
@@ -96,23 +54,23 @@
 	int x;
 	_mem_addr=i_memblock_addr;
 	//TXバッファを初期化
-	for(x=0;x<NUM_OF_MAX_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_MAX_BUF;x++){
 		_mem_addr->buf_max[x].h.is_lock=NyLPC_TUInt8_FALSE;
 		_mem_addr->buf_max[x].h.ref=0;
 	}
-	for(x=0;x<NUM_OF_512_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_512_BUF;x++){
 		_mem_addr->buf_512[x].h.is_lock=NyLPC_TUInt8_FALSE;
 		_mem_addr->buf_512[x].h.ref=0;
 	}
-	for(x=0;x<NUM_OF_256_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_256_BUF;x++){
 		_mem_addr->buf_256[x].h.is_lock=NyLPC_TUInt8_FALSE;
 		_mem_addr->buf_256[x].h.ref=0;
 	}
-	for(x=0;x<NUM_OF_128_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_128_BUF;x++){
 		_mem_addr->buf_128[x].h.is_lock=NyLPC_TUInt8_FALSE;
 		_mem_addr->buf_128[x].h.ref=0;
 	}
-	for(x=0;x<NUM_OF_64_BUF;x++){
+	for(x=0;x<NyLPC_TcEthernetMM_NUM_OF_64_BUF;x++){
 		_mem_addr->buf_64[x].h.is_lock=NyLPC_TUInt8_FALSE;
 		_mem_addr->buf_64[x].h.ref=0;
 	}
@@ -121,21 +79,21 @@
 /**
  * 空のTxバッファのポインタを返します。
  */
-struct NyLPC_TTxBufferHeader* NyLPC_cEthernetMM_alloc(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size)
+void* NyLPC_cEthernetMM_alloc(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size)
 {
 	int i;
 	//ヒントから、割り当てるメモリブロックを決定
 
 	//特殊ブロック
 	if(i_hint==NyLPC_TcEthernetMM_HINT_CTRL_PACKET){
-		for(i=0;i<NUM_OF_64_BUF;i++){
+		for(i=0;i<NyLPC_TcEthernetMM_NUM_OF_64_BUF;i++){
 			//未参照かつ送信中でないもの。
 			if(_mem_addr->buf_64[i].h.ref>0 || _mem_addr->buf_64[i].h.is_lock){
 				continue;
 			}
 			_mem_addr->buf_64[i].h.ref++;
 			*o_size=64;
-			return &(_mem_addr->buf_64[i].h);
+			return _mem_addr->buf_64[i].b;
 		}
 		return NULL;
 	}
@@ -152,54 +110,55 @@
 	}
 
 ALLOC_MAX:
-	for(i=0;i<NUM_OF_MAX_BUF;i++){
+	for(i=0;i<NyLPC_TcEthernetMM_NUM_OF_MAX_BUF;i++){
 		//未参照かつ送信中でないもの。
 		if(_mem_addr->buf_max[i].h.ref>0 || _mem_addr->buf_max[i].h.is_lock){
 			continue;
 		}
 		_mem_addr->buf_max[i].h.ref++;
-		*o_size=MAX_TX_ETHERNET_FRAME_SIZE;
-		return &(_mem_addr->buf_max[i].h);
+		*o_size=NyLPC_TcEthernetMM_MAX_TX_ETHERNET_FRAME_SIZE;
+		return _mem_addr->buf_max[i].b;
 	}
 ALLOC_512:
-	for(i=0;i<NUM_OF_512_BUF;i++){
+	for(i=0;i<NyLPC_TcEthernetMM_NUM_OF_512_BUF;i++){
 		//未参照かつ送信中でないもの。
 		if(_mem_addr->buf_512[i].h.ref>0 || _mem_addr->buf_512[i].h.is_lock){
 			continue;
 		}
 		*o_size=512;
 		_mem_addr->buf_512[i].h.ref++;
-		return &(_mem_addr->buf_512[i].h);
+		return _mem_addr->buf_512[i].b;
 	}
 ALLOC_256:
-	for(i=0;i<NUM_OF_256_BUF;i++){
+	for(i=0;i<NyLPC_TcEthernetMM_NUM_OF_256_BUF;i++){
 		//未参照かつ送信中でないもの。
 		if(_mem_addr->buf_256[i].h.ref>0 || (_mem_addr->buf_256[i].h.is_lock)){
 			continue;
 		}
 		*o_size=256;
 		_mem_addr->buf_256[i].h.ref++;
-		return &(_mem_addr->buf_256[i].h);
+		return _mem_addr->buf_256[i].b;
 	}
 ALLOC_128:
-	for(i=0;i<NUM_OF_128_BUF;i++){
+	for(i=0;i<NyLPC_TcEthernetMM_NUM_OF_128_BUF;i++){
 		//未参照かつ送信中でないもの。
 		if(_mem_addr->buf_128[i].h.ref>0 || (_mem_addr->buf_128[i].h.is_lock)){
 			continue;
 		}
 		*o_size=128;
 		_mem_addr->buf_128[i].h.ref++;
-		return &(_mem_addr->buf_128[i].h);
+		return _mem_addr->buf_128[i].b;
 	}
 	return NULL;
 }
 
 
-void NyLPC_cEthernetMM_release(struct NyLPC_TTxBufferHeader* i_buf)
+void NyLPC_cEthernetMM_release(void* i_buf)
 {
+	struct NyLPC_TTxBufferHeader* h=NyLPC_TTxBufferHeader_getBufferHeaderAddr(i_buf);
 	//参照カウンタを1減算
-	NyLPC_Assert(i_buf->ref>0);
-	i_buf->ref--;
+	NyLPC_Assert(h->ref>0);
+	h->ref--;
 	return;
 }
 
--- a/core/driver/ethernet/NyLPC_cEthernetMM.h	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/NyLPC_cEthernetMM.h	Sat Sep 27 13:33:26 2014 +0000
@@ -23,7 +23,10 @@
  *	<airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
  *
  *********************************************************************************/
-
+/**
+ * @file
+ * このファイルは、イーサネットメモリマネージャクラスを定義します。
+ */
 #ifndef NyLPC_cEthernetMM_protected_h
 #define NyLPC_cEthernetMM_protected_h
 
@@ -34,15 +37,98 @@
 extern "C" {
 #endif /* __cplusplus */
 
+#ifndef PACK_STRUCT_END
+    #define PACK_STRUCT_END __attribute((packed))
+#endif
+
+/**
+ * 構造体のアライメントサイズ(4 or 16)
+ */
+#ifndef NyLPC_TTxBufferHeader_ALIGNMENT
+#	define NyLPC_TTxBufferHeader_ALIGNMENT 4
+#endif
+
+/**
+ * 送信バッフメモリのヘッダ。
+ * この構造体は、TXバッファメモリブロックのヘッダーです。
+ * TXバッファメモリブロックは、この構造体の後ろに、sizeに一致したメモリを連結したもので表現します。
+ * <pre>
+ * buffer=[struct NyLPC_TTxBufferHeader][n]
+ * </pre>
+ */
+struct NyLPC_TTxBufferHeader
+{
+	//メモリブロックの参照カウンタ。
+	NyLPC_TInt8  ref;
+	//送信用にロックしたかを示すフラグ
+	NyLPC_TUInt8 is_lock;
+	//Nビット境界に合わせるためのパディング。
+	NyLPC_TUInt8 padding[NyLPC_TTxBufferHeader_ALIGNMENT-2];
+}PACK_STRUCT_END;
+
+/**
+ * バッファメモリアドレスからメモリヘッダアドレスを復元します。
+ */
+#define NyLPC_TTxBufferHeader_getBufferHeaderAddr(a)	((struct NyLPC_TTxBufferHeader*)(((NyLPC_TUInt8*)a)-sizeof(struct NyLPC_TTxBufferHeader)))
+
+
 /**
  * NyLPC_cEthernetMM_allocのヒント値。
  * コントロールパケット用のサイズ要求をするときに使用します。
  */
 #define NyLPC_TcEthernetMM_HINT_CTRL_PACKET 0
+
+
 /**
- * @file
- * このファイルは、イーサネットメモリマネージャクラスを定義します。
+ * メモリブロック構造体の定数値
+ */
+#define NyLPC_TcEthernetMM_NUM_OF_MAX_BUF  3
+#define NyLPC_TcEthernetMM_NUM_OF_512_BUF  3
+#define NyLPC_TcEthernetMM_NUM_OF_256_BUF  4
+#define NyLPC_TcEthernetMM_NUM_OF_128_BUF 16
+#define NyLPC_TcEthernetMM_NUM_OF_64_BUF   4
+
+/**
+ * FULLサイズのEthernetFrame送信メモリのサイズ。
+ * ここで最大送信サイズを制限します。
+ * 通常は1460+20+20+14=1514バイト
+ * パディングと合計で128bit(16byte)アライメントにしておかないと不幸になる。
+ */
+#define NyLPC_TcEthernetMM_MAX_TX_ETHERNET_FRAME_SIZE	1514
+/**
+ * Alignment padding(128bit)
+ */
+#define NyLPC_TcEthernetMM_MAX_TX_ETHERNET_PADDING		22
+
+/**
+ * TXメモリブロックの定義配列
  */
+struct NyLPC_TcEthernetMM_TxMemoryBlock
+{
+	struct{
+		struct NyLPC_TTxBufferHeader h;
+		NyLPC_TUInt8 b[NyLPC_TcEthernetMM_MAX_TX_ETHERNET_FRAME_SIZE];
+		NyLPC_TUInt8 _padding[NyLPC_TcEthernetMM_MAX_TX_ETHERNET_PADDING];
+	}buf_max[NyLPC_TcEthernetMM_NUM_OF_MAX_BUF];//(4+MAX_TX_ETHERNET_FRAME_SIZE(1514))*3=? default=4554
+	struct{
+		struct NyLPC_TTxBufferHeader h;
+		NyLPC_TUInt8 b[512];
+	}buf_512[NyLPC_TcEthernetMM_NUM_OF_512_BUF];//(4+512)*3=1548
+	struct{
+		struct NyLPC_TTxBufferHeader h;
+		NyLPC_TUInt8 b[256];
+	}buf_256[NyLPC_TcEthernetMM_NUM_OF_256_BUF];//(4+256)*4=1560
+	struct{
+		struct NyLPC_TTxBufferHeader h;
+		NyLPC_TUInt8 b[128];
+	}buf_128[NyLPC_TcEthernetMM_NUM_OF_128_BUF];//(4+128)*16=1584
+	struct{
+		struct NyLPC_TTxBufferHeader h;
+		NyLPC_TUInt8 b[64];
+	}buf_64[NyLPC_TcEthernetMM_NUM_OF_64_BUF];//(4+64)*4=272
+}PACK_STRUCT_END;
+
+
 
 int NyLPC_cEthernetMM_dbg_getNumofUsedTx(void);
 
@@ -64,13 +150,13 @@
  * @return
  * 割り当て不能な場合はNULLが帰ります。
  * @bug
- * 戻り値、メモリブロックヘッダ不要では?
+ * パケットバッファの先頭アドレス
  */
-struct NyLPC_TTxBufferHeader* NyLPC_cEthernetMM_alloc(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
+void* NyLPC_cEthernetMM_alloc(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
 /**
  * NyLPC_EthernetMM_allocで得たメモリを解放します。
  */
-void NyLPC_cEthernetMM_release(struct NyLPC_TTxBufferHeader* i_buf);
+void NyLPC_cEthernetMM_release(void* i_buf);
 
 #ifdef __cplusplus
 }
--- a/core/driver/ethernet/lpc17xx/EthDev_LPC17xx.c	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/lpc17xx/EthDev_LPC17xx.c	Sat Sep 27 13:33:26 2014 +0000
@@ -10,6 +10,7 @@
 #include "EthDev_LPC17xx.h"
 #include "NyLPC_os.h"
 #include "LPC17xx.h"
+#include "NyLPC_cEthernetMM.h"
 /* If no buffers are available, then wait this long before looking again.... */
 #define emacBUFFER_WAIT_DELAY_MS		 3
 #define emacBUFFER_WAIT_EMPTY_DELAY_MS	10
@@ -94,10 +95,10 @@
  * この関数は、i_bufが
  * </div>
  */
-void EthDev_LPC17xx_sendTxEthFrame(struct NyLPC_TTxBufferHeader* i_buf,unsigned short i_size)
+void EthDev_LPC17xx_sendTxEthFrame(void* i_buf,unsigned short i_size)
 {
 	NyLPC_TUInt32	IndexNext,Index;
-
+	struct NyLPC_TTxBufferHeader* bh=NyLPC_TTxBufferHeader_getBufferHeaderAddr(i_buf);
 	//サイズ0なら送信の必要なし
 	if(i_size == 0)
 	{
@@ -109,11 +110,11 @@
 	//送信対象のメモリブロックを送信中に設定。
 //	b=(i_buf+1);
 	//送信中のメモリブロックなら無視
-	if(i_buf->is_lock){
+	if(bh->is_lock){
 		return;
 	}
 	//送信中にセット
-	i_buf->is_lock=NyLPC_TUInt8_TRUE;
+	bh->is_lock=NyLPC_TUInt8_TRUE;
 
 	//送信データのセット
 	Index = LPC_EMAC->TxProduceIndex;
@@ -122,7 +123,7 @@
 	}
 
 	//送信処理
-	TX_DESC_PACKET( Index ) = ( unsigned long )(i_buf+1);
+	TX_DESC_PACKET( Index ) = ( unsigned long )(bh+1);
 	//See UM10360.pdf Table 181. Transmit descriptor control word
 	TX_DESC_CTRL( Index ) = ((i_size-1) | TCTRL_LAST | TCTRL_INT );
 	LPC_EMAC->TxProduceIndex = IndexNext;
--- a/core/driver/ethernet/lpc17xx/EthDev_LPC17xx.h	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/lpc17xx/EthDev_LPC17xx.h	Sat Sep 27 13:33:26 2014 +0000
@@ -320,7 +320,7 @@
 
 
 void EthDev_LPC17xx_processTx(void);
-void EthDev_LPC17xx_sendTxEthFrame(struct NyLPC_TTxBufferHeader* i_buf,unsigned short i_size);
+void EthDev_LPC17xx_sendTxEthFrame(void* i_buf,unsigned short i_size);
 void* EthDev_LPC17xx_getRxEthFrame(unsigned short* o_len_of_data);
 void EthDev_LPC17xx_nextRxEthFrame(void);
 
--- a/core/driver/ethernet/lpc17xx/EtherDev_LAN8720.c	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/driver/ethernet/lpc17xx/EtherDev_LAN8720.c	Sat Sep 27 13:33:26 2014 +0000
@@ -123,8 +123,8 @@
 
 static NyLPC_TBool start(const struct NyLPC_TEthAddr* i_eth_addr,NyLPC_TiEthernetDevice_onEvent i_handler,void* i_param);
 static void stop(void);
-static struct NyLPC_TTxBufferHeader* allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
-static void releaseTxBuf(struct NyLPC_TTxBufferHeader* i_buf);
+static void* allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);
+static void releaseTxBuf(void* i_buf);
 
 /** EMAC ISRハンドラ*/
 static void emacIsrHandler(unsigned long i_status);
@@ -245,11 +245,11 @@
 }
 
 
-static struct NyLPC_TTxBufferHeader* allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size)
+static void* allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size)
 {
 	return NyLPC_cEthernetMM_alloc(i_hint,o_size);
 }
-static void releaseTxBuf(struct NyLPC_TTxBufferHeader* i_buf)
+static void releaseTxBuf(void* i_buf)
 {
 	NyLPC_cEthernetMM_release(i_buf);
 }
--- a/core/include/NyLPC_config.h	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/include/NyLPC_config.h	Sat Sep 27 13:33:26 2014 +0000
@@ -59,6 +59,7 @@
 #define NyLPC_MCU_UNKNOWN 1
 #define NyLPC_MCU_LPC17xx 2
 #define NyLPC_MCU_LPC4088 3
+#define NyLPC_MCU_K64F    4
 
 #define NyLPC_MCU NyLPC_MCU_LPC17xx
 
@@ -128,8 +129,13 @@
 #define NyLPC_ARCH NyLPC_ARCH_MBEDRTOS
 
 #ifdef TARGET_LPC4088
-#undef NyLPC_MCU
-#define NyLPC_MCU NyLPC_MCU_LPC4088
+#   undef NyLPC_MCU
+#   define NyLPC_MCU NyLPC_MCU_LPC4088
+#endif
+#ifdef TARGET_K64F
+#   undef NyLPC_MCU
+#   define NyLPC_MCU NyLPC_MCU_K64F
+#   define NyLPC_TTxBufferHeader_ALIGNMENT 16   //EthernetのTXメモリブロックヘッダを16バイトアラインメントにする
 #endif
 
 #ifdef __cplusplus
--- a/core/os/mbedrtos/NyLPC_cIsr.cpp	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/os/mbedrtos/NyLPC_cIsr.cpp	Sat Sep 27 13:33:26 2014 +0000
@@ -47,6 +47,8 @@
     _eth_irs=i_handler;
 }
 
+//LPC176xとLPC4088の場合
+#if NyLPC_MCU==NyLPC_MCU_LPC4088 || NyLPC_MCU==NyLPC_MCU_LPC17xx
 /**
  * 割込み解除を通知するセマフォ。lEMACInitで設定する。
  */
@@ -59,6 +61,10 @@
     if(_eth_irs!=NULL){
         _eth_irs(ulStatus);
     }
-
 }
+#elif NyLPC_MCU==NyLPC_MCU_K64F
+//F64Fのイーサネットハンドラはドライバに書いてあります。
+#else
+#error "BAD MCU"
 #endif
+#endif
--- a/core/uip/NyLPC_cUipService.c	Sat Sep 06 02:41:20 2014 +0000
+++ b/core/uip/NyLPC_cUipService.c	Sat Sep 27 13:33:26 2014 +0000
@@ -63,7 +63,6 @@
 
 
 
-
 /****************************************************
  * UipServiceに関する宣言:その他
  ***************************************************/
@@ -105,7 +104,7 @@
 //--------------------------------------------------------------
 
 
-static NyLPC_TBool sendIPv4Tx(struct NyLPC_TTxBufferHeader* i_eth_buf);
+static NyLPC_TBool sendIPv4Tx(struct TEthPacket* i_eth_buf);
 
 //static void sendArpReqest(const struct TEthPacket* i_eth_packet);
 static void sendRawEthFrameNL(void* i_buf,NyLPC_TUInt16 i_len);
@@ -306,7 +305,7 @@
                     NyLPC_cMutex_unlock(&(inst->_mutex));
                     //IPパケットの処理
                     r=NyLPC_cIPv4_rx(&(inst->_tcpv4),&(ethbuf->data.ipv4),rx_len);
-                    if(r!=NULL){
+                    if(r!=NULL){                        
                         //IPパケットとして送信
                         NyLPC_cUipService_sendIPv4Tx(r);
                     }
@@ -381,7 +380,7 @@
 void NyLPC_cUipService_sendArpRequest(const struct NyLPC_TIPv4Addr* i_addr)
 {
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
-    struct NyLPC_TTxBufferHeader* p;
+    void* p;
     NyLPC_TUInt16 tx_len;
     struct TEthPacket* ethbuf;
     //システムTxBufを得る
@@ -390,7 +389,7 @@
     NyLPC_TArpHeader_setArpRequest(&(ethbuf->data.arp),inst->_ref_config->ip_addr,&(inst->_ref_config->eth_mac),i_addr);
     tx_len=NyLPC_TEthernetIIHeader_setArpTx(&(ethbuf->header),&(inst->_ref_config->eth_mac));
     //送信
-    p=((struct NyLPC_TTxBufferHeader*)(((struct NyLPC_TEthernetIIHeader*)ethbuf)-1))-1;
+    p=((struct NyLPC_TEthernetIIHeader*)ethbuf)-1;
 
     NyLPC_cMutex_lock(&(inst->_mutex));
     NyLPC_iEthernetDevice_sendTxEthFrame(inst->_ethif,p,tx_len);
@@ -411,10 +410,10 @@
 void NyLPC_cUipService_sendIPv4Tx(void* i_eth_payload)
 {
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
-    struct NyLPC_TTxBufferHeader* p=((struct NyLPC_TTxBufferHeader*)(((struct NyLPC_TEthernetIIHeader*)i_eth_payload)-1))-1;
+    void* p=((struct NyLPC_TEthernetIIHeader*)i_eth_payload)-1;
     NyLPC_cMutex_lock(&(inst->_mutex));
     //IPパケットの送信を試行
-    if(sendIPv4Tx(p)){
+    if(sendIPv4Tx((struct TEthPacket*)p)){
         NyLPC_cMutex_unlock(&(inst->_mutex));
         return;
     }
@@ -442,11 +441,11 @@
 {
     NyLPC_TUInt16 s;
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
-    struct NyLPC_TTxBufferHeader* ethbuf;
+    struct TEthPacket* ethbuf;
     //排他処理をして、メモリを取得する。SYSTEMメモリはEthernetドライバの解放待ちのみなのでまとめてLOCKしておk
     NyLPC_cMutex_lock(&(inst->_mutex));
     for(;;){
-        ethbuf=(struct NyLPC_TTxBufferHeader*)NyLPC_iEthernetDevice_allocTxBuf(inst->_ethif,NyLPC_TcEthernetMM_HINT_CTRL_PACKET,&s);
+        ethbuf=(struct TEthPacket*)NyLPC_iEthernetDevice_allocTxBuf(inst->_ethif,NyLPC_TcEthernetMM_HINT_CTRL_PACKET,&s);
         if(ethbuf==NULL){
             NyLPC_cThread_yield();
             continue;
@@ -455,7 +454,7 @@
     }
     NyLPC_cMutex_unlock(&(inst->_mutex));
     //イーサネットバッファのアドレスを計算
-    return &(((struct TEthPacket*)(ethbuf+1))->data);
+    return &(ethbuf->data);
 }
 
 
@@ -463,10 +462,10 @@
 void* NyLPC_cUipService_allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size)
 {
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
-    struct NyLPC_TTxBufferHeader* ethbuf;
+    struct TEthPacket* ethbuf;
     //排他処理をして、メモリを取得する。
     NyLPC_cMutex_lock(&(inst->_mutex));
-    ethbuf=(struct NyLPC_TTxBufferHeader*)NyLPC_iEthernetDevice_allocTxBuf(inst->_ethif,i_hint+sizeof(struct NyLPC_TEthernetIIHeader),o_size);
+    ethbuf=(struct TEthPacket*)NyLPC_iEthernetDevice_allocTxBuf(inst->_ethif,i_hint+sizeof(struct NyLPC_TEthernetIIHeader),o_size);
     NyLPC_cMutex_unlock(&(inst->_mutex));
     if(ethbuf==NULL){
         return NULL;
@@ -474,7 +473,7 @@
     //イーサネットバッファのサイズを計算
     *o_size-=sizeof(struct NyLPC_TEthernetIIHeader);
     //イーサネットバッファのアドレスを計算
-    return &(((struct TEthPacket*)(ethbuf+1))->data);
+    return &(ethbuf->data);
 }
 
 
@@ -484,7 +483,7 @@
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
     NyLPC_cMutex_lock(&(inst->_mutex));
     //ペイロードの位置から、メモリブロックを再生。
-    NyLPC_iEthernetDevice_releaseTxBuf(inst->_ethif,((struct NyLPC_TTxBufferHeader*)(((struct NyLPC_TEthernetIIHeader*)i_buf)-1))-1);
+    NyLPC_iEthernetDevice_releaseTxBuf(inst->_ethif,((struct NyLPC_TEthernetIIHeader*)i_buf)-1);
     NyLPC_cMutex_unlock(&(inst->_mutex));
     return NULL;
 }
@@ -555,7 +554,7 @@
 {
     NyLPC_iEthernetDevice_sendTxEthFrame(
         _NyLPC_TcUipService_inst->_ethif,
-        ((struct NyLPC_TTxBufferHeader*)(((struct NyLPC_TEthernetIIHeader*)i_buf)-1))-1,
+        ((struct NyLPC_TEthernetIIHeader*)i_buf)-1,
         i_len);
     return;
 }
@@ -568,7 +567,7 @@
     //ペイロードの位置から、メモリブロックを再生。
     NyLPC_iEthernetDevice_releaseTxBuf(
         _NyLPC_TcUipService_inst->_ethif,
-        ((struct NyLPC_TTxBufferHeader*)(((struct NyLPC_TEthernetIIHeader*)i_buf)-1))-1);
+        ((struct NyLPC_TEthernetIIHeader*)i_buf)-1);
     return;
 }
 /**
@@ -593,34 +592,33 @@
  * allocTxBufで確保したメモリを指定してください。
  * ペイロードには、TCP/IPパケットを格納します。
  */
-static NyLPC_TBool sendIPv4Tx(struct NyLPC_TTxBufferHeader* i_eth_buf)
+static NyLPC_TBool sendIPv4Tx(struct TEthPacket* i_eth_buf)
 {
     NyLPC_TcUipService_t* inst=_NyLPC_TcUipService_inst;
     struct NyLPC_TEthAddr emac;
     NyLPC_TUInt16 tx_len;
     const struct NyLPC_TEthAddr* eth_dest;
-    struct TEthPacket* ethbuf=(struct TEthPacket*)(i_eth_buf+1);
     //ペイロードのアドレスから、イーサネットフレームバッファのアドレスを復元
 
-    if(NyLPC_TIPv4Addr_isEqual(&(ethbuf->data.ipv4.destipaddr),&NyLPC_TIPv4Addr_BROADCAST)) {
+    if(NyLPC_TIPv4Addr_isEqual(&(i_eth_buf->data.ipv4.destipaddr),&NyLPC_TIPv4Addr_BROADCAST)) {
         //ブロードキャストならそのまま
         eth_dest=&NyLPC_TEthAddr_BROADCAST;
-    }else if(NyLPC_TIPv4Addr_isEqualWithMask(&(ethbuf->data.ipv4.destipaddr),&NyLPC_TIPv4Addr_MULTICAST,&NyLPC_TIPv4Addr_MULTICAST_MASK)){
+    }else if(NyLPC_TIPv4Addr_isEqualWithMask(&(i_eth_buf->data.ipv4.destipaddr),&NyLPC_TIPv4Addr_MULTICAST,&NyLPC_TIPv4Addr_MULTICAST_MASK)){
         //マルチキャスト
-        ip2MulticastEmacAddr(&(ethbuf->data.ipv4.destipaddr),&emac);
+        ip2MulticastEmacAddr(&(i_eth_buf->data.ipv4.destipaddr),&emac);
         eth_dest=&emac;
     }else{
         //LocalIP以外ならdefaultRootへ変換
         eth_dest=NyLPC_cIPv4Arp_IPv4toEthAddr(
             &inst->_arp,
-            NyLPC_cIPv4Config_isLocalIP(inst->_ref_config, &(ethbuf->data.ipv4.destipaddr))?(ethbuf->data.ipv4.destipaddr):(inst->_ref_config->dr_addr));
+            NyLPC_cIPv4Config_isLocalIP(inst->_ref_config, &(i_eth_buf->data.ipv4.destipaddr))?(i_eth_buf->data.ipv4.destipaddr):(inst->_ref_config->dr_addr));
         //IP->MAC変換をテスト。
         if(eth_dest==NULL){
             return NyLPC_TBool_FALSE;
         }
     }
     //変換可能なら、イーサネットヘッダを更新して、送信処理へ。
-    tx_len=NyLPC_TEthernetIIHeader_setIPv4Tx(&(ethbuf->header),&(inst->_ref_config->eth_mac),eth_dest);
+    tx_len=NyLPC_TEthernetIIHeader_setIPv4Tx(&(i_eth_buf->header),&(inst->_ref_config->eth_mac),eth_dest);
     NyLPC_iEthernetDevice_sendTxEthFrame(inst->_ethif,i_eth_buf,tx_len);
     return NyLPC_TBool_TRUE;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed/jsonrpc/Target_K64F.cpp	Sat Sep 27 13:33:26 2014 +0000
@@ -0,0 +1,83 @@
+/**
+ * @file
+ *K64Fのターゲットテーブルです。
+ */
+#include "TargetTypes.h"
+#include "RpcHandlerBase.h"
+#ifdef TARGET_K64F
+namespace MiMic
+{
+
+
+
+const static struct TPinNameMapItem pin_table[]={
+
+        
+    // Other mbed Pin Names 
+
+    {LED1  ,PINID_OTHER_MBED_LEDx+0},  {LED2  ,PINID_OTHER_MBED_LEDx+1},  {LED3  ,PINID_OTHER_MBED_LEDx+2},  {LED4  ,PINID_OTHER_MBED_LEDx+3},
+
+    {USBTX,PINID_OTHER_MBED_USBx+0},{USBRX,PINID_OTHER_MBED_USBx+1},
+
+    // Arch Pro Pin Names(Arudino)
+    {D0 ,PINID_ARCH_PRO_Dx+0},  {D1 ,PINID_ARCH_PRO_Dx+1},  {D2,PINID_ARCH_PRO_Dx+2},  {D3,PINID_ARCH_PRO_Dx+3},
+    {D4 ,PINID_ARCH_PRO_Dx+4},  {D5 ,PINID_ARCH_PRO_Dx+5},  {D6,PINID_ARCH_PRO_Dx+6},  {D7,PINID_ARCH_PRO_Dx+7},
+    {D8 ,PINID_ARCH_PRO_Dx+8},  {D9 ,PINID_ARCH_PRO_Dx+9},  {D10,PINID_ARCH_PRO_Dx+10},{D11,PINID_ARCH_PRO_Dx+11},
+    {D12,PINID_ARCH_PRO_Dx+12}, {D13,PINID_ARCH_PRO_Dx+13}, {D14,PINID_ARCH_PRO_Dx+14},{D15,PINID_ARCH_PRO_Dx+15},
+   
+    {A0,PINID_ARCH_PRO_Ax+0},  {A1,PINID_ARCH_PRO_Ax+1},  {A2,PINID_ARCH_PRO_Ax+2},  {A3,PINID_ARCH_PRO_Ax+3},
+    {A4,PINID_ARCH_PRO_Ax+4},  {A5,PINID_ARCH_PRO_Ax+5},
+ 
+    {NC,PINID_NC}
+};
+
+#define NUMBER_OF_PINMODE 4
+const static struct TPinModeMapItem pinmode_table[]=
+{
+    {PullUp     ,PINMODEID+0},
+    {PullDown   ,PINMODEID+1},
+    {PullNone   ,PINMODEID+2},
+    {PullDefault,PINMODEID+1}
+};
+#define NUMBER_OF_PORT_NAME 5
+const static struct TPortNameMapItem portname_table[]=
+{
+    {PortA  ,PORTID+0},
+    {PortB  ,PORTID+1},
+    {PortC  ,PORTID+2},
+    {PortD  ,PORTID+3},
+    {PortE  ,PORTID+4},
+};
+
+PinName RpcHandlerBase::pinId2PinName(unsigned int i_id)
+{
+    for(int i=0;pin_table[i].name!=NC;i++){
+        if(i_id==pin_table[i].id){
+            return pin_table[i].name;
+        }
+    }
+    return NC;
+}
+
+PinMode RpcHandlerBase::pinmodeId2PinMode(unsigned int i_id)
+{
+    for(int i=0;i<NUMBER_OF_PINMODE;i++){
+        if(i_id==pinmode_table[i].id){
+            return pinmode_table[i].mode;
+        }
+    }
+    return PullDefault;
+}
+PortName RpcHandlerBase::portId2PortName(unsigned int i_id)
+{
+    for(int i=0;i<NUMBER_OF_PORT_NAME;i++){
+        if(i_id==portname_table[i].id){
+            return portname_table[i].port;
+        }
+    }
+    return PortA;
+}
+
+}
+#endif
+
--- a/mbed/jsonrpc/Target_LPC4088.cpp	Sat Sep 06 02:41:20 2014 +0000
+++ b/mbed/jsonrpc/Target_LPC4088.cpp	Sat Sep 27 13:33:26 2014 +0000
@@ -87,11 +87,6 @@
 	{p33,PINID_ARCH_PRO_Dx+4},	{p37,PINID_ARCH_PRO_Dx+5},	{p38,PINID_ARCH_PRO_Dx+6},	{p34,PINID_ARCH_PRO_Dx+7},
 	{p8,PINID_ARCH_PRO_Dx+8},	{p39,PINID_ARCH_PRO_Dx+9},	{p14,PINID_ARCH_PRO_Dx+10},	{p11,PINID_ARCH_PRO_Dx+11},
 	{p12,PINID_ARCH_PRO_Dx+12},	{p13,PINID_ARCH_PRO_Dx+13},	{p19,PINID_ARCH_PRO_Dx+14},	{p20,PINID_ARCH_PRO_Dx+15},
-
-	{P4_29	,PINID_ARCH_PRO_Dx+0},	{P4_28	,PINID_ARCH_PRO_Dx+1},	{P0_4	,PINID_ARCH_PRO_Dx+2},	{P0_5	,PINID_ARCH_PRO_Dx+3},
-	{P2_2	,PINID_ARCH_PRO_Dx+4},	{P2_3	,PINID_ARCH_PRO_Dx+5},	{P2_4	,PINID_ARCH_PRO_Dx+6},	{P2_5	,PINID_ARCH_PRO_Dx+7},
-	{P0_0	,PINID_ARCH_PRO_Dx+8},	{P0_1	,PINID_ARCH_PRO_Dx+9},	{P0_6	,PINID_ARCH_PRO_Dx+10},{P0_9	,PINID_ARCH_PRO_Dx+11},
-	{P0_8	,PINID_ARCH_PRO_Dx+12},{P0_7	,PINID_ARCH_PRO_Dx+13},{P0_27	,PINID_ARCH_PRO_Dx+14},{P0_28	,PINID_ARCH_PRO_Dx+15},
 	
 	{p15,PINID_ARCH_PRO_Ax+0},	{p16,PINID_ARCH_PRO_Ax+1},	{p17,PINID_ARCH_PRO_Ax+2},	{p18,PINID_ARCH_PRO_Ax+3},
 	{p19,PINID_ARCH_PRO_Ax+4},	{p20,PINID_ARCH_PRO_Ax+5},