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

Committer:
nyatla
Date:
Sun Jun 29 12:56:59 2014 +0000
Revision:
83:d46aa580722a
Parent:
77:8651d3c19a55
MiMicCore-r379??;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nyatla 71:855020258513 1 #ifndef NYLPC_CJSONRPCPARSER_H_
nyatla 71:855020258513 2 #define NYLPC_CJSONRPCPARSER_H_
nyatla 71:855020258513 3 #ifdef __cplusplus
nyatla 71:855020258513 4 extern "C" {
nyatla 71:855020258513 5 #endif
nyatla 71:855020258513 6
nyatla 71:855020258513 7 #include "NyLPC_stdlib.h"
nyatla 71:855020258513 8
nyatla 72:c118a7aa37a3 9
nyatla 72:c118a7aa37a3 10 #define NyLPC_TJsonRpcErrorCode_PARSE_ERROR (-32700)
nyatla 72:c118a7aa37a3 11 #define NyLPC_TJsonRpcErrorCode_INVALID_REQUEST (-32600)
nyatla 72:c118a7aa37a3 12 #define NyLPC_TJsonRpcErrorCode_METHOD_NOT_FOUND (-32601)
nyatla 72:c118a7aa37a3 13 #define NyLPC_TJsonRpcErrorCode_INVALID_PARAMS (-32602)
nyatla 72:c118a7aa37a3 14 #define NyLPC_TJsonRpcErrorCode_INTERNAL_ERROR (-32603)
nyatla 72:c118a7aa37a3 15 #define NyLPC_TJsonRpcErrorCode_SERVER_ERROR_BASE (-32000)
nyatla 72:c118a7aa37a3 16
nyatla 72:c118a7aa37a3 17
nyatla 71:855020258513 18 /** 型定義*/
nyatla 71:855020258513 19 union NyLPC_TJsonRpcParserResult;
nyatla 71:855020258513 20
nyatla 71:855020258513 21 /**
nyatla 71:855020258513 22 * RPC関数ハンドラ型です。
nyatla 71:855020258513 23 * @param
nyatla 71:855020258513 24 */
nyatla 71:855020258513 25 typedef NyLPC_TBool (*NyLPC_TJsonRpcHandler)(const union NyLPC_TJsonRpcParserResult* i_rpc,void* i_param);
nyatla 71:855020258513 26
nyatla 71:855020258513 27 /**
nyatla 71:855020258513 28 * JSON RPC定義テーブルの一要素。
nyatla 71:855020258513 29 * メソッド名とパラメータパターンのセットを定義します。
nyatla 71:855020258513 30 * この構造体は配列としてNyLPC_TJsonRpcFunctionTableから参照されます。
nyatla 71:855020258513 31 */
nyatla 71:855020258513 32 struct NyLPC_TJsonRpcMethodDef
nyatla 71:855020258513 33 {
nyatla 71:855020258513 34 /**
nyatla 71:855020258513 35 * 関数名
nyatla 71:855020258513 36 */
nyatla 71:855020258513 37 const char* name;
nyatla 71:855020258513 38 /**
nyatla 71:855020258513 39 * パラメータパターン
nyatla 71:855020258513 40 * <ul>
nyatla 71:855020258513 41 * <li>s - 文字列</li>
nyatla 71:855020258513 42 * <li>i - signed int32</li>
nyatla 83:d46aa580722a 43 * <li>u - unsigned int32</li>
nyatla 83:d46aa580722a 44 * <li>b - unsigned int8</li>
nyatla 83:d46aa580722a 45 * <li>B - BSTR (string ByteArray)</li>
nyatla 71:855020258513 46 * </ul>
nyatla 71:855020258513 47 */
nyatla 71:855020258513 48 const char* param_patt;
nyatla 71:855020258513 49 /**
nyatla 71:855020258513 50 * 外部のDispatch関数で使われるRPC関数ハンドラ。
nyatla 71:855020258513 51 */
nyatla 71:855020258513 52 NyLPC_TJsonRpcHandler handler;
nyatla 71:855020258513 53 };
nyatla 71:855020258513 54
nyatla 71:855020258513 55
nyatla 71:855020258513 56 /**
nyatla 71:855020258513 57 * JsonRPCクラスの定義テーブル。
nyatla 71:855020258513 58 * JsonRPCは、 [namespace]::[]
nyatla 71:855020258513 59 */
nyatla 71:855020258513 60 struct NyLPC_TJsonRpcClassDef
nyatla 71:855020258513 61 {
nyatla 71:855020258513 62 const char* names_pace;
nyatla 71:855020258513 63 const char* class_name;
nyatla 71:855020258513 64 const struct NyLPC_TJsonRpcMethodDef* functions;
nyatla 71:855020258513 65 };
nyatla 71:855020258513 66
nyatla 71:855020258513 67
nyatla 71:855020258513 68
nyatla 71:855020258513 69
nyatla 71:855020258513 70
nyatla 71:855020258513 71 #define NyLPC_TJsonRpcParserResult_TYPE_UNKNOWN 0
nyatla 71:855020258513 72 #define NyLPC_TJsonRpcParserResult_TYPE_RESULT 1
nyatla 71:855020258513 73 #define NyLPC_TJsonRpcParserResult_TYPE_METHOD 2
nyatla 71:855020258513 74
nyatla 83:d46aa580722a 75 /** NyLPC_TJsonRpcParserResultが格納できる引数の最大数。パラメータの最大数に等しくなります。 */
nyatla 77:8651d3c19a55 76 #define NyLPC_TJsonRpcParserResult_NUMBER_OF_PARAM_INDEX 32
nyatla 71:855020258513 77 /**
nyatla 71:855020258513 78 * NyLPC_TJsonRpcParserResultが格納できるパラメータの総バイト数。
nyatla 71:855020258513 79 * (文字数+1)+(uint32|int32)*4+uint8の合計値です。
nyatla 71:855020258513 80 */
nyatla 77:8651d3c19a55 81 #define NyLPC_TJsonRpcParserResult_PARAM_BUF 256
nyatla 71:855020258513 82
nyatla 71:855020258513 83 /**
nyatla 71:855020258513 84 * JSONRPC構文のパース結果を格納します。
nyatla 71:855020258513 85 * 開発メモ
nyatla 71:855020258513 86 * 更新する場合は、param_indexまでの構造体のレイアウトを破壊しないようにしてください。
nyatla 71:855020258513 87 */
nyatla 71:855020258513 88 union NyLPC_TJsonRpcParserResult
nyatla 71:855020258513 89 {
nyatla 71:855020258513 90 NyLPC_TUInt8 type; //タイプ
nyatla 83:d46aa580722a 91 /** この構造体は type==NyLPC_TJsonRpcParserResult_TYPE_METHODのときに有効です。 */
nyatla 71:855020258513 92 struct{
nyatla 71:855020258513 93 NyLPC_TUInt8 _type; //タイプ
nyatla 71:855020258513 94 NyLPC_TUInt8 func_number; //確定した関数番号。
nyatla 71:855020258513 95 NyLPC_TUInt8 _padding[2]; //パディング
nyatla 71:855020258513 96 NyLPC_TInt32 id; //idパラメータの値
nyatla 71:855020258513 97 NyLPC_TChar param_buf[NyLPC_TJsonRpcParserResult_PARAM_BUF];
nyatla 71:855020258513 98 NyLPC_TUInt8 param_index[NyLPC_TJsonRpcParserResult_NUMBER_OF_PARAM_INDEX];
nyatla 83:d46aa580722a 99 /** 関数の含まれるクラスへのポインタ。 */
nyatla 71:855020258513 100 const struct NyLPC_TJsonRpcClassDef* class_def;
nyatla 71:855020258513 101 }method;
nyatla 71:855020258513 102 struct{
nyatla 71:855020258513 103 NyLPC_TUInt8 _type; //タイプ
nyatla 71:855020258513 104 NyLPC_TUInt8 _padding[3]; //パディング
nyatla 71:855020258513 105 NyLPC_TInt32 id; //idパラメータの値
nyatla 71:855020258513 106 NyLPC_TChar param_buf[NyLPC_TJsonRpcParserResult_PARAM_BUF];
nyatla 71:855020258513 107 NyLPC_TUInt8 param_index[NyLPC_TJsonRpcParserResult_NUMBER_OF_PARAM_INDEX];
nyatla 71:855020258513 108 }result;
nyatla 71:855020258513 109 struct{
nyatla 71:855020258513 110 NyLPC_TUInt8 _type; //タイプ
nyatla 71:855020258513 111 NyLPC_TInt8 _padding[3];//
nyatla 71:855020258513 112 NyLPC_TInt32 _id; //idパラメータの値
nyatla 71:855020258513 113 NyLPC_TChar param_buf[NyLPC_TJsonRpcParserResult_PARAM_BUF];
nyatla 71:855020258513 114 NyLPC_TUInt8 param_index[NyLPC_TJsonRpcParserResult_NUMBER_OF_PARAM_INDEX];
nyatla 71:855020258513 115 }raw;
nyatla 71:855020258513 116 };
nyatla 71:855020258513 117 /**
nyatla 71:855020258513 118 * Resultに格納される結果がハンドラを持っているかを返します。
nyatla 71:855020258513 119 */
nyatla 71:855020258513 120 #define NyLPC_TJsonRpcParserResult_hasMethodHandler(i_struct) ((i_struct)->method.class_def->functions[(i_struct)->method.func_number].handler!=NULL)
nyatla 71:855020258513 121 /**
nyatla 71:855020258513 122 * Resultに含まれるハンドラを呼び出します。
nyatla 71:855020258513 123 * @param i_struct
nyatla 71:855020258513 124 * Result構造体
nyatla 71:855020258513 125 * @param i_param
nyatla 71:855020258513 126 * ハンドラに引き渡すパラメータ
nyatla 71:855020258513 127 * @return
nyatla 71:855020258513 128 * FALSEの場合、ループを終了してください。
nyatla 71:855020258513 129 */
nyatla 71:855020258513 130 #define NyLPC_TJsonRpcParserResult_callMethodHandler(i_struct,i_param) (i_struct)->method.class_def->functions[(i_struct)->method.func_number].handler((i_struct),(i_param))
nyatla 71:855020258513 131
nyatla 71:855020258513 132 /**
nyatla 71:855020258513 133 * i_idx番目のパラメータをuint32としてo_valへ取り出します。
nyatla 71:855020258513 134 */
nyatla 71:855020258513 135 NyLPC_TBool NyLPC_TJsonRpcParserResult_getUInt32(const union NyLPC_TJsonRpcParserResult* i_struct, NyLPC_TInt16 i_idx, NyLPC_TUInt32* o_val);
nyatla 71:855020258513 136 /**
nyatla 71:855020258513 137 * i_idx番目のパラメータをint32としてo_valへ取り出します。
nyatla 71:855020258513 138 */
nyatla 71:855020258513 139 NyLPC_TBool NyLPC_TJsonRpcParserResult_getInt32(const union NyLPC_TJsonRpcParserResult* i_struct, NyLPC_TInt16 i_idx, NyLPC_TInt32* o_val);
nyatla 71:855020258513 140 /**
nyatla 71:855020258513 141 * i_idx番目のパラメータをchar[]としてo_valへ取り出します。
nyatla 71:855020258513 142 */
nyatla 83:d46aa580722a 143 NyLPC_TBool NyLPC_TJsonRpcParserResult_getStr(const union NyLPC_TJsonRpcParserResult* i_struct, NyLPC_TInt16 i_idx, const NyLPC_TChar** o_val, NyLPC_TUInt8* o_len);
nyatla 83:d46aa580722a 144 /**
nyatla 83:d46aa580722a 145 * i_idx番目のパラメータをuchar[]としてo_valへ取り出します。
nyatla 83:d46aa580722a 146 */
nyatla 83:d46aa580722a 147 NyLPC_TBool NyLPC_TJsonRpcParserResult_getByteArray(const union NyLPC_TJsonRpcParserResult* i_struct, NyLPC_TInt16 i_idx, const NyLPC_TUInt8** o_val, NyLPC_TUInt8* o_len);
nyatla 83:d46aa580722a 148
nyatla 71:855020258513 149 /**
nyatla 71:855020258513 150 * i_idx番目のパラメータをuint8としてo_valへ取り出します。
nyatla 71:855020258513 151 */
nyatla 71:855020258513 152 NyLPC_TBool NyLPC_TJsonRpcParserResult_getByte(const union NyLPC_TJsonRpcParserResult* i_struct, NyLPC_TInt16 i_idx, NyLPC_TUInt8* o_val);
nyatla 71:855020258513 153
nyatla 71:855020258513 154 /********************************************************************************
nyatla 71:855020258513 155 *
nyatla 71:855020258513 156 * NyLPC_TcJsonRpcParser
nyatla 71:855020258513 157 *
nyatla 71:855020258513 158 ********************************************************************************/
nyatla 71:855020258513 159 /**
nyatla 71:855020258513 160 * JSONRPCの型定義定数です。
nyatla 71:855020258513 161 */
nyatla 71:855020258513 162 #define NyLPC_cJsonRpcParser_TYPE_INT32 'd'
nyatla 71:855020258513 163 #define NyLPC_cJsonRpcParser_TYPE_UINT32 'u'
nyatla 71:855020258513 164 #define NyLPC_cJsonRpcParser_TYPE_STRING 's'
nyatla 71:855020258513 165 #define NyLPC_cJsonRpcParser_TYPE_BYTE 'b'
nyatla 83:d46aa580722a 166 #define NyLPC_cJsonRpcParser_TYPE_BSTRING 'B'
nyatla 71:855020258513 167
nyatla 71:855020258513 168 /**
nyatla 71:855020258513 169 * JsonRPCメッセージをパースします。パース出来るメッセージは以下の通りです。
nyatla 71:855020258513 170 * クラスは、RPC関数定義テーブルに従ってメッセージを分析し、テーブルに存在する関数のみを返却することができます。
nyatla 71:855020258513 171 * <p>
nyatla 71:855020258513 172 * メッセージ形式
nyatla 71:855020258513 173 * <pre>
nyatla 71:855020258513 174 * METHOD:
nyatla 71:855020258513 175 * {"method":METHOD,"version":VERSION,"params":PARAMS,"id":ID}
nyatla 71:855020258513 176 * METHOD VERSION as string
nyatla 71:855020258513 177 * ID as uint32
nyatla 71:855020258513 178 * PARAMS as Array of (string|uint32|int32)
nyatla 71:855020258513 179 * </pre>
nyatla 71:855020258513 180 * </p>
nyatla 71:855020258513 181 */
nyatla 71:855020258513 182 typedef struct NyLPC_TcJsonRpcParser NyLPC_TcJsonRpcParser_t;
nyatla 71:855020258513 183
nyatla 71:855020258513 184
nyatla 71:855020258513 185
nyatla 71:855020258513 186
nyatla 71:855020258513 187 /** パーサの状態値*/
nyatla 71:855020258513 188 typedef NyLPC_TUInt8 NyLPC_TcJsonRpcParser_TStatus;
nyatla 71:855020258513 189
nyatla 71:855020258513 190 #define NyLPC_TcJsonRpcParser_ST_START 0x01 //開始ブランケット受信待ち
nyatla 71:855020258513 191 #define NyLPC_TcJsonRpcParser_ST_END 0x02 //終了受信済
nyatla 71:855020258513 192 #define NyLPC_TcJsonRpcParser_ST_ERROR 0x03 //エラー発生
nyatla 71:855020258513 193 #define NyLPC_TcJsonRpcParser_ST_NAME_Q 0x04 //名前クオート受信待ち
nyatla 71:855020258513 194 #define NyLPC_TcJsonRpcParser_ST_NAME_STR 0x05 //名前受信中
nyatla 71:855020258513 195 #define NyLPC_TcJsonRpcParser_ST_NV_SEP 0x06 //名前と値のセパレータ待ち
nyatla 71:855020258513 196 #define NyLPC_TcJsonRpcParser_ST_VAL 0x07 //値開始待ち
nyatla 71:855020258513 197 #define NyLPC_TcJsonRpcParser_ST_VAL_STR 0x08 //文字列受信
nyatla 71:855020258513 198 #define NyLPC_TcJsonRpcParser_ST_VAL_UINT 0x09 //UINT受信中
nyatla 71:855020258513 199 #define NyLPC_TcJsonRpcParser_ST_VAL_INT 0x10 //INT受信中
nyatla 71:855020258513 200 #define NyLPC_TcJsonRpcParser_ST_NEXT 0x11 //次のNAMEもしくは終了ブランケット
nyatla 71:855020258513 201 #define NyLPC_TcJsonRpcParser_ST_PARAMS 0x12 //PARAM要素パース中
nyatla 71:855020258513 202
nyatla 71:855020258513 203
nyatla 71:855020258513 204
nyatla 83:d46aa580722a 205 /** NyLPC_TcJsonRpcParserの定数値です。 字句解析ワークメモリの長さ。256未満8*n-4の数を指定してください。 */
nyatla 83:d46aa580722a 206 #define NyLPC_TcJsonRpcParser_WORK_MAX (48-4)
nyatla 71:855020258513 207
nyatla 71:855020258513 208 /**
nyatla 71:855020258513 209 * クラス構造体です。
nyatla 71:855020258513 210 */
nyatla 71:855020258513 211 struct NyLPC_TcJsonRpcParser
nyatla 71:855020258513 212 {
nyatla 71:855020258513 213 const struct NyLPC_TJsonRpcClassDef** _class_def;
nyatla 71:855020258513 214 union{
nyatla 71:855020258513 215 struct{
nyatla 71:855020258513 216 NyLPC_TChar buf[NyLPC_TcJsonRpcParser_WORK_MAX]; //文字解析メモリ
nyatla 71:855020258513 217 NyLPC_TUInt8 n; //字句解析の文字数
nyatla 83:d46aa580722a 218 NyLPC_TUInt8 st; //字句解析のサブステータス
nyatla 83:d46aa580722a 219 NyLPC_TUInt8 vt; //数字エスケープ解釈のテンポラリ
nyatla 83:d46aa580722a 220 NyLPC_TUInt8 _padding; //
nyatla 71:855020258513 221 }str;
nyatla 71:855020258513 222 struct{
nyatla 71:855020258513 223 NyLPC_TInt32 v;
nyatla 71:855020258513 224 NyLPC_TInt8 s;
nyatla 71:855020258513 225 }int32;
nyatla 71:855020258513 226 NyLPC_TUInt32 uint32;
nyatla 71:855020258513 227 }_work;
nyatla 71:855020258513 228 NyLPC_TcJsonRpcParser_TStatus _st; //パーサステータス
nyatla 71:855020258513 229 NyLPC_TUInt8 _pst; //PARAMS解析ステータス
nyatla 71:855020258513 230 NyLPC_TUInt8 _name_id; //解析中のNAME_ID
nyatla 71:855020258513 231 NyLPC_TUInt8 _pcounter; //パラメタ解析に使うワークカウンタ
nyatla 71:855020258513 232 union NyLPC_TJsonRpcParserResult* _result;//出力格納先
nyatla 71:855020258513 233 };
nyatla 71:855020258513 234
nyatla 71:855020258513 235
nyatla 71:855020258513 236
nyatla 71:855020258513 237
nyatla 71:855020258513 238
nyatla 71:855020258513 239
nyatla 71:855020258513 240 /**
nyatla 71:855020258513 241 * インスタンスを初期化します。
nyatla 71:855020258513 242 * @param i_class_def
nyatla 71:855020258513 243 * クラステーブルの配列です。NULLで終端します。
nyatla 71:855020258513 244 */
nyatla 71:855020258513 245 void NyLPC_cJsonRpcParser_initialize(
nyatla 71:855020258513 246 NyLPC_TcJsonRpcParser_t* i_inst,
nyatla 71:855020258513 247 const struct NyLPC_TJsonRpcClassDef** i_class_def);
nyatla 71:855020258513 248
nyatla 71:855020258513 249 #define NyLPC_cJsonRpcParser_finalize(i)
nyatla 71:855020258513 250 /**
nyatla 71:855020258513 251 * パーサの状態を初期化します。
nyatla 71:855020258513 252 * @param i_result
nyatla 71:855020258513 253 * パース結果の出力先構造体のアドレスです。
nyatla 71:855020258513 254 */
nyatla 71:855020258513 255 void NyLPC_cJsonRpcParser_initParser(NyLPC_TcJsonRpcParser_t* i_inst, union NyLPC_TJsonRpcParserResult* i_result);
nyatla 71:855020258513 256 /**
nyatla 71:855020258513 257 * パーサに文字列を入力します。入力後は、NyLPC_cJsonRpcParser_getStatusでパーサの状態をチェックしてください。
nyatla 71:855020258513 258  */
nyatla 71:855020258513 259 void NyLPC_cJsonRpcParser_putChar(NyLPC_TcJsonRpcParser_t* i_inst, char i_c);
nyatla 71:855020258513 260
nyatla 71:855020258513 261 #define NyLPC_cJsonRpcParser_getStatus(i) ((i)->_st)
nyatla 71:855020258513 262 /** クラス定義テーブルを返します。*/
nyatla 71:855020258513 263 #define NyLPC_cJsonRpcParser_getClassDef(i) ((i)->_class_def)
nyatla 71:855020258513 264
nyatla 71:855020258513 265
nyatla 71:855020258513 266 #ifdef __cplusplus
nyatla 71:855020258513 267 }
nyatla 71:855020258513 268 #endif /* __cplusplus */
nyatla 71:855020258513 269
nyatla 71:855020258513 270 #endif /* NYLPC_CJSONRPCPARSER4_H_ */