ソースの整理中ですが、利用はできます。

Dependencies:   EthernetInterface HttpServer TextLCD mbed-rpc mbed-rtos mbed Socket lwip-eth lwip-sys lwip

Committer:
yueee_yt
Date:
Wed Mar 12 04:39:15 2014 +0000
Revision:
2:14b689a85306
Parent:
0:7766f6712673
bug fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yueee_yt 0:7766f6712673 1 /* mbed Microcontroller Library
yueee_yt 0:7766f6712673 2 * Copyright (c) 2006-2013 ARM Limited
yueee_yt 0:7766f6712673 3 *
yueee_yt 0:7766f6712673 4 * Licensed under the Apache License, Version 2.0 (the "License");
yueee_yt 0:7766f6712673 5 * you may not use this file except in compliance with the License.
yueee_yt 0:7766f6712673 6 * You may obtain a copy of the License at
yueee_yt 0:7766f6712673 7 *
yueee_yt 0:7766f6712673 8 * http://www.apache.org/licenses/LICENSE-2.0
yueee_yt 0:7766f6712673 9 *
yueee_yt 0:7766f6712673 10 * Unless required by applicable law or agreed to in writing, software
yueee_yt 0:7766f6712673 11 * distributed under the License is distributed on an "AS IS" BASIS,
yueee_yt 0:7766f6712673 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
yueee_yt 0:7766f6712673 13 * See the License for the specific language governing permissions and
yueee_yt 0:7766f6712673 14 * limitations under the License.
yueee_yt 0:7766f6712673 15 */
yueee_yt 0:7766f6712673 16 #ifndef RPCFUNCTION_RPC
yueee_yt 0:7766f6712673 17 #define RPCFUNCTION_RPC
yueee_yt 0:7766f6712673 18
yueee_yt 0:7766f6712673 19 #include "rpc.h"
yueee_yt 0:7766f6712673 20 #define STR_LEN 64
yueee_yt 0:7766f6712673 21
yueee_yt 0:7766f6712673 22 namespace mbed {
yueee_yt 0:7766f6712673 23
yueee_yt 0:7766f6712673 24 /**
yueee_yt 0:7766f6712673 25 *
yueee_yt 0:7766f6712673 26 *Class to call custom functions over RPC
yueee_yt 0:7766f6712673 27 *
yueee_yt 0:7766f6712673 28 */
yueee_yt 0:7766f6712673 29 class RPCFunction: public RPC {
yueee_yt 0:7766f6712673 30 public:
yueee_yt 0:7766f6712673 31 /**
yueee_yt 0:7766f6712673 32 * Constructor
yueee_yt 0:7766f6712673 33 *
yueee_yt 0:7766f6712673 34 *@param f Pointer to the function to call. the function must be of the form void foo(char * input, char * output)
yueee_yt 0:7766f6712673 35 *@param name The name of this object
yueee_yt 0:7766f6712673 36 */
yueee_yt 0:7766f6712673 37 RPCFunction(void (*f)(Arguments*, Reply*), const char* = NULL);
yueee_yt 0:7766f6712673 38
yueee_yt 0:7766f6712673 39 /**
yueee_yt 0:7766f6712673 40 *run
yueee_yt 0:7766f6712673 41 *
yueee_yt 0:7766f6712673 42 *Calls the attached function passing the string in but doesn't return the result.
yueee_yt 0:7766f6712673 43 *@param str The string to be passed into the attached function. This string can consist of any ASCII characters apart from escape codes. The usual limtations on argument content for RPC strings has been removed
yueee_yt 0:7766f6712673 44 *@return A string output from the function
yueee_yt 0:7766f6712673 45 */
yueee_yt 0:7766f6712673 46 void run(Arguments* args, Reply* r);
yueee_yt 0:7766f6712673 47
yueee_yt 0:7766f6712673 48 virtual const struct rpc_method *get_rpc_methods();
yueee_yt 0:7766f6712673 49
yueee_yt 0:7766f6712673 50 private:
yueee_yt 0:7766f6712673 51 void (*_ftr)(Arguments*, Reply*);
yueee_yt 0:7766f6712673 52
yueee_yt 0:7766f6712673 53 char _input[STR_LEN];
yueee_yt 0:7766f6712673 54 char _output[STR_LEN];
yueee_yt 0:7766f6712673 55 };
yueee_yt 0:7766f6712673 56
yueee_yt 0:7766f6712673 57 }
yueee_yt 0:7766f6712673 58
yueee_yt 0:7766f6712673 59 #endif