Includes library modifications to allow access to AIN_4 (AIN_0 / 5)

Committer:
bryantaylor
Date:
Tue Sep 20 21:26:12 2016 +0000
Revision:
0:eafc3fd41f75
hackathon

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bryantaylor 0:eafc3fd41f75 1 /* mbed Microcontroller Library
bryantaylor 0:eafc3fd41f75 2 * Copyright (c) 2006-2013 ARM Limited
bryantaylor 0:eafc3fd41f75 3 *
bryantaylor 0:eafc3fd41f75 4 * Licensed under the Apache License, Version 2.0 (the "License");
bryantaylor 0:eafc3fd41f75 5 * you may not use this file except in compliance with the License.
bryantaylor 0:eafc3fd41f75 6 * You may obtain a copy of the License at
bryantaylor 0:eafc3fd41f75 7 *
bryantaylor 0:eafc3fd41f75 8 * http://www.apache.org/licenses/LICENSE-2.0
bryantaylor 0:eafc3fd41f75 9 *
bryantaylor 0:eafc3fd41f75 10 * Unless required by applicable law or agreed to in writing, software
bryantaylor 0:eafc3fd41f75 11 * distributed under the License is distributed on an "AS IS" BASIS,
bryantaylor 0:eafc3fd41f75 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
bryantaylor 0:eafc3fd41f75 13 * See the License for the specific language governing permissions and
bryantaylor 0:eafc3fd41f75 14 * limitations under the License.
bryantaylor 0:eafc3fd41f75 15 */
bryantaylor 0:eafc3fd41f75 16 #ifndef RPC_H
bryantaylor 0:eafc3fd41f75 17 #define RPC_H
bryantaylor 0:eafc3fd41f75 18
bryantaylor 0:eafc3fd41f75 19 #include "mbed.h"
bryantaylor 0:eafc3fd41f75 20 #include "Arguments.h"
bryantaylor 0:eafc3fd41f75 21
bryantaylor 0:eafc3fd41f75 22 namespace mbed {
bryantaylor 0:eafc3fd41f75 23
bryantaylor 0:eafc3fd41f75 24 #define RPC_MAX_STRING 128
bryantaylor 0:eafc3fd41f75 25
bryantaylor 0:eafc3fd41f75 26 struct rpc_function {
bryantaylor 0:eafc3fd41f75 27 const char *name;
bryantaylor 0:eafc3fd41f75 28 void (*function_caller)(Arguments*, Reply*);
bryantaylor 0:eafc3fd41f75 29 };
bryantaylor 0:eafc3fd41f75 30
bryantaylor 0:eafc3fd41f75 31 struct rpc_class {
bryantaylor 0:eafc3fd41f75 32 const char *name;
bryantaylor 0:eafc3fd41f75 33 const rpc_function *static_functions;
bryantaylor 0:eafc3fd41f75 34 struct rpc_class *next;
bryantaylor 0:eafc3fd41f75 35 };
bryantaylor 0:eafc3fd41f75 36
bryantaylor 0:eafc3fd41f75 37 /* Class RPC
bryantaylor 0:eafc3fd41f75 38 * The RPC class for most things
bryantaylor 0:eafc3fd41f75 39 */
bryantaylor 0:eafc3fd41f75 40 class RPC {
bryantaylor 0:eafc3fd41f75 41
bryantaylor 0:eafc3fd41f75 42 public:
bryantaylor 0:eafc3fd41f75 43
bryantaylor 0:eafc3fd41f75 44 RPC(const char *name = NULL);
bryantaylor 0:eafc3fd41f75 45
bryantaylor 0:eafc3fd41f75 46 virtual ~RPC();
bryantaylor 0:eafc3fd41f75 47
bryantaylor 0:eafc3fd41f75 48 /* Function get_rpc_methods
bryantaylor 0:eafc3fd41f75 49 * Returns a pointer to an array describing the rpc methods
bryantaylor 0:eafc3fd41f75 50 * supported by this object, terminated by either
bryantaylor 0:eafc3fd41f75 51 * RPC_METHOD_END or RPC_METHOD_SUPER(Superclass).
bryantaylor 0:eafc3fd41f75 52 *
bryantaylor 0:eafc3fd41f75 53 * Example
bryantaylor 0:eafc3fd41f75 54 * > class Example : public RPC {
bryantaylor 0:eafc3fd41f75 55 * > int foo(int a, int b) { return a + b; }
bryantaylor 0:eafc3fd41f75 56 * > virtual const struct rpc_method *get_rpc_methods() {
bryantaylor 0:eafc3fd41f75 57 * > static const rpc_method rpc_methods[] = {
bryantaylor 0:eafc3fd41f75 58 * > { "foo", generic_caller<int, Example, int, int, &Example::foo> },
bryantaylor 0:eafc3fd41f75 59 * > RPC_METHOD_SUPER(RPC)
bryantaylor 0:eafc3fd41f75 60 * > };
bryantaylor 0:eafc3fd41f75 61 * > return rpc_methods;
bryantaylor 0:eafc3fd41f75 62 * > }
bryantaylor 0:eafc3fd41f75 63 * > };
bryantaylor 0:eafc3fd41f75 64 */
bryantaylor 0:eafc3fd41f75 65 virtual const struct rpc_method *get_rpc_methods();
bryantaylor 0:eafc3fd41f75 66
bryantaylor 0:eafc3fd41f75 67 static bool call(const char *buf, char *result);
bryantaylor 0:eafc3fd41f75 68
bryantaylor 0:eafc3fd41f75 69 /* Function lookup
bryantaylor 0:eafc3fd41f75 70 * Lookup and return the object that has the given name.
bryantaylor 0:eafc3fd41f75 71 *
bryantaylor 0:eafc3fd41f75 72 * Variables
bryantaylor 0:eafc3fd41f75 73 * name - the name to lookup.
bryantaylor 0:eafc3fd41f75 74 */
bryantaylor 0:eafc3fd41f75 75 static RPC *lookup(const char *name);
bryantaylor 0:eafc3fd41f75 76
bryantaylor 0:eafc3fd41f75 77 protected:
bryantaylor 0:eafc3fd41f75 78 static RPC *_head;
bryantaylor 0:eafc3fd41f75 79 RPC *_next;
bryantaylor 0:eafc3fd41f75 80 char *_name;
bryantaylor 0:eafc3fd41f75 81 bool _from_construct;
bryantaylor 0:eafc3fd41f75 82
bryantaylor 0:eafc3fd41f75 83 private:
bryantaylor 0:eafc3fd41f75 84 static rpc_class *_classes;
bryantaylor 0:eafc3fd41f75 85
bryantaylor 0:eafc3fd41f75 86 static const rpc_function _RPC_funcs[];
bryantaylor 0:eafc3fd41f75 87 static rpc_class _RPC_class;
bryantaylor 0:eafc3fd41f75 88
bryantaylor 0:eafc3fd41f75 89 void delete_self();
bryantaylor 0:eafc3fd41f75 90 static void list_objs(Arguments *args, Reply *result);
bryantaylor 0:eafc3fd41f75 91 static void clear(Arguments *args, Reply *result);
bryantaylor 0:eafc3fd41f75 92
bryantaylor 0:eafc3fd41f75 93 public:
bryantaylor 0:eafc3fd41f75 94 /* Function add_rpc_class
bryantaylor 0:eafc3fd41f75 95 * Add the class to the list of classes which can have static
bryantaylor 0:eafc3fd41f75 96 * methods called via rpc (the static methods which can be called
bryantaylor 0:eafc3fd41f75 97 * are defined by that class' get_rpc_class() static method).
bryantaylor 0:eafc3fd41f75 98 */
bryantaylor 0:eafc3fd41f75 99 template<class C>
bryantaylor 0:eafc3fd41f75 100 static void add_rpc_class() {
bryantaylor 0:eafc3fd41f75 101 rpc_class *c = C::get_rpc_class();
bryantaylor 0:eafc3fd41f75 102 c->next = _classes;
bryantaylor 0:eafc3fd41f75 103 _classes = c;
bryantaylor 0:eafc3fd41f75 104 }
bryantaylor 0:eafc3fd41f75 105
bryantaylor 0:eafc3fd41f75 106 template<class C>
bryantaylor 0:eafc3fd41f75 107 static const char *construct() {
bryantaylor 0:eafc3fd41f75 108 RPC *p = new C();
bryantaylor 0:eafc3fd41f75 109 p->_from_construct = true;
bryantaylor 0:eafc3fd41f75 110 return p->_name;
bryantaylor 0:eafc3fd41f75 111 }
bryantaylor 0:eafc3fd41f75 112
bryantaylor 0:eafc3fd41f75 113 template<class C, typename A1>
bryantaylor 0:eafc3fd41f75 114 static const char *construct(A1 arg1) {
bryantaylor 0:eafc3fd41f75 115 RPC *p = new C(arg1);
bryantaylor 0:eafc3fd41f75 116 p->_from_construct = true;
bryantaylor 0:eafc3fd41f75 117 return p->_name;
bryantaylor 0:eafc3fd41f75 118 }
bryantaylor 0:eafc3fd41f75 119
bryantaylor 0:eafc3fd41f75 120 template<class C, typename A1, typename A2>
bryantaylor 0:eafc3fd41f75 121 static const char *construct(A1 arg1, A2 arg2) {
bryantaylor 0:eafc3fd41f75 122 RPC *p = new C(arg1, arg2);
bryantaylor 0:eafc3fd41f75 123 p->_from_construct = true;
bryantaylor 0:eafc3fd41f75 124 return p->_name;
bryantaylor 0:eafc3fd41f75 125 }
bryantaylor 0:eafc3fd41f75 126
bryantaylor 0:eafc3fd41f75 127 template<class C, typename A1, typename A2, typename A3>
bryantaylor 0:eafc3fd41f75 128 static const char *construct(A1 arg1, A2 arg2, A3 arg3) {
bryantaylor 0:eafc3fd41f75 129 RPC *p = new C(arg1, arg2, arg3);
bryantaylor 0:eafc3fd41f75 130 p->_from_construct = true;
bryantaylor 0:eafc3fd41f75 131 return p->_name;
bryantaylor 0:eafc3fd41f75 132 }
bryantaylor 0:eafc3fd41f75 133
bryantaylor 0:eafc3fd41f75 134 template<class C, typename A1, typename A2, typename A3, typename A4>
bryantaylor 0:eafc3fd41f75 135 static const char *construct(A1 arg1, A2 arg2, A3 arg3, A4 arg4) {
bryantaylor 0:eafc3fd41f75 136 RPC *p = new C(arg1, arg2, arg3, arg4);
bryantaylor 0:eafc3fd41f75 137 p->_from_construct = true;
bryantaylor 0:eafc3fd41f75 138 return p->_name;
bryantaylor 0:eafc3fd41f75 139 }
bryantaylor 0:eafc3fd41f75 140 };
bryantaylor 0:eafc3fd41f75 141
bryantaylor 0:eafc3fd41f75 142 /* Macro MBED_OBJECT_NAME_MAX
bryantaylor 0:eafc3fd41f75 143 * The maximum size of object name (including terminating null byte)
bryantaylor 0:eafc3fd41f75 144 * that will be recognised when using fopen to open a FileLike
bryantaylor 0:eafc3fd41f75 145 * object, or when using the rpc function.
bryantaylor 0:eafc3fd41f75 146 */
bryantaylor 0:eafc3fd41f75 147 #define MBED_OBJECT_NAME_MAX 32
bryantaylor 0:eafc3fd41f75 148
bryantaylor 0:eafc3fd41f75 149 /* Macro MBED_METHOD_NAME_MAX
bryantaylor 0:eafc3fd41f75 150 * The maximum size of rpc method name (including terminating null
bryantaylor 0:eafc3fd41f75 151 * byte) that will be recognised by the rpc function (in rpc.h).
bryantaylor 0:eafc3fd41f75 152 */
bryantaylor 0:eafc3fd41f75 153 #define MBED_METHOD_NAME_MAX 32
bryantaylor 0:eafc3fd41f75 154
bryantaylor 0:eafc3fd41f75 155 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 156 */
bryantaylor 0:eafc3fd41f75 157 template<class T, void(T::*member)(const char *, char *)>
bryantaylor 0:eafc3fd41f75 158 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 159 (static_cast<T*>(this_ptr)->*member)(arguments, result);
bryantaylor 0:eafc3fd41f75 160 }
bryantaylor 0:eafc3fd41f75 161
bryantaylor 0:eafc3fd41f75 162 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 163 */
bryantaylor 0:eafc3fd41f75 164 template<class T, void(T::*member)()>
bryantaylor 0:eafc3fd41f75 165 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 166 (static_cast<T*>(this_ptr)->*member)();
bryantaylor 0:eafc3fd41f75 167 }
bryantaylor 0:eafc3fd41f75 168
bryantaylor 0:eafc3fd41f75 169 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 170 */
bryantaylor 0:eafc3fd41f75 171 template<class T, typename A1, void(T::*member)(A1)>
bryantaylor 0:eafc3fd41f75 172 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 173 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 174
bryantaylor 0:eafc3fd41f75 175 (static_cast<T*>(this_ptr)->*member)(arg1);
bryantaylor 0:eafc3fd41f75 176 }
bryantaylor 0:eafc3fd41f75 177
bryantaylor 0:eafc3fd41f75 178 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 179 */
bryantaylor 0:eafc3fd41f75 180 template<class T, typename A1, typename A2, void(T::*member)(A1, A2)>
bryantaylor 0:eafc3fd41f75 181 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 182 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 183 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 184
bryantaylor 0:eafc3fd41f75 185 (static_cast<T*>(this_ptr)->*member)(arg1, arg2);
bryantaylor 0:eafc3fd41f75 186 }
bryantaylor 0:eafc3fd41f75 187
bryantaylor 0:eafc3fd41f75 188 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 189 */
bryantaylor 0:eafc3fd41f75 190 template<class T, typename A1, typename A2, typename A3, void(T::*member)(A1, A2, A3)>
bryantaylor 0:eafc3fd41f75 191 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 192 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 193 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 194 A3 arg3 = arguments->getArg<A3>();
bryantaylor 0:eafc3fd41f75 195
bryantaylor 0:eafc3fd41f75 196 (static_cast<T*>(this_ptr)->*member)(arg1, arg2, arg3);
bryantaylor 0:eafc3fd41f75 197 }
bryantaylor 0:eafc3fd41f75 198
bryantaylor 0:eafc3fd41f75 199 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 200 */
bryantaylor 0:eafc3fd41f75 201 template<typename R, class T, R(T::*member)()>
bryantaylor 0:eafc3fd41f75 202 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 203 R res = (static_cast<T*>(this_ptr)->*member)();
bryantaylor 0:eafc3fd41f75 204 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 205 }
bryantaylor 0:eafc3fd41f75 206
bryantaylor 0:eafc3fd41f75 207 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 208 */
bryantaylor 0:eafc3fd41f75 209 template<typename R, class T, typename A1, R(T::*member)(A1)>
bryantaylor 0:eafc3fd41f75 210 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 211 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 212
bryantaylor 0:eafc3fd41f75 213 R res = (static_cast<T*>(this_ptr)->*member)(arg1);
bryantaylor 0:eafc3fd41f75 214 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 215 }
bryantaylor 0:eafc3fd41f75 216
bryantaylor 0:eafc3fd41f75 217 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 218 */
bryantaylor 0:eafc3fd41f75 219 template<typename R, class T, typename A1, typename A2, R(T::*member)(A1, A2)>
bryantaylor 0:eafc3fd41f75 220 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 221 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 222 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 223
bryantaylor 0:eafc3fd41f75 224 R res = (static_cast<T*>(this_ptr)->*member)(arg1, arg2);
bryantaylor 0:eafc3fd41f75 225 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 226 }
bryantaylor 0:eafc3fd41f75 227
bryantaylor 0:eafc3fd41f75 228 /* Function rpc_method_caller
bryantaylor 0:eafc3fd41f75 229 */
bryantaylor 0:eafc3fd41f75 230 template<typename R, class T, typename A1, typename A2, typename A3, R(T::*member)(A1, A2, A3)>
bryantaylor 0:eafc3fd41f75 231 void rpc_method_caller(RPC *this_ptr, Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 232 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 233 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 234 A3 arg3 = arguments->getArg<A3>();
bryantaylor 0:eafc3fd41f75 235
bryantaylor 0:eafc3fd41f75 236 R res = (static_cast<T*>(this_ptr)->*member)(arg1, arg2, arg3);
bryantaylor 0:eafc3fd41f75 237 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 238 }
bryantaylor 0:eafc3fd41f75 239
bryantaylor 0:eafc3fd41f75 240 /* Function rpc_function caller
bryantaylor 0:eafc3fd41f75 241 */
bryantaylor 0:eafc3fd41f75 242 template<typename R, R(*func)()>
bryantaylor 0:eafc3fd41f75 243 void rpc_function_caller(Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 244 R res = (*func)();
bryantaylor 0:eafc3fd41f75 245 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 246 }
bryantaylor 0:eafc3fd41f75 247
bryantaylor 0:eafc3fd41f75 248 /* Function rpc_function caller
bryantaylor 0:eafc3fd41f75 249 */
bryantaylor 0:eafc3fd41f75 250 template<typename R, typename A1, R(*func)(A1)>
bryantaylor 0:eafc3fd41f75 251 void rpc_function_caller(Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 252 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 253 R res = (*func)(arg1);
bryantaylor 0:eafc3fd41f75 254 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 255 }
bryantaylor 0:eafc3fd41f75 256
bryantaylor 0:eafc3fd41f75 257 /* Function rpc_function caller
bryantaylor 0:eafc3fd41f75 258 */
bryantaylor 0:eafc3fd41f75 259 template<typename R, typename A1, typename A2, R(*func)(A1, A2)>
bryantaylor 0:eafc3fd41f75 260 void rpc_function_caller(Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 261 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 262 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 263
bryantaylor 0:eafc3fd41f75 264 R res = (*func)(arg1, arg2);
bryantaylor 0:eafc3fd41f75 265 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 266 }
bryantaylor 0:eafc3fd41f75 267
bryantaylor 0:eafc3fd41f75 268 /* Function rpc_function caller
bryantaylor 0:eafc3fd41f75 269 */
bryantaylor 0:eafc3fd41f75 270 template<typename R, typename A1, typename A2, typename A3, R(*func)(A1, A2, A3)>
bryantaylor 0:eafc3fd41f75 271 void rpc_function_caller(Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 272 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 273 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 274 A3 arg3 = arguments->getArg<A3>();
bryantaylor 0:eafc3fd41f75 275
bryantaylor 0:eafc3fd41f75 276 R res = (*func)(arg1, arg2, arg3);
bryantaylor 0:eafc3fd41f75 277 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 278 }
bryantaylor 0:eafc3fd41f75 279
bryantaylor 0:eafc3fd41f75 280 /* Function rpc_function caller
bryantaylor 0:eafc3fd41f75 281 */
bryantaylor 0:eafc3fd41f75 282 template<typename R, typename A1, typename A2, typename A3, typename A4, R(*func)(A1, A2, A3, A4)>
bryantaylor 0:eafc3fd41f75 283 void rpc_function_caller(Arguments *arguments, Reply *result) {
bryantaylor 0:eafc3fd41f75 284 A1 arg1 = arguments->getArg<A1>();
bryantaylor 0:eafc3fd41f75 285 A2 arg2 = arguments->getArg<A2>();
bryantaylor 0:eafc3fd41f75 286 A3 arg3 = arguments->getArg<A3>();
bryantaylor 0:eafc3fd41f75 287 A4 arg4 = arguments->getArg<A4>();
bryantaylor 0:eafc3fd41f75 288
bryantaylor 0:eafc3fd41f75 289 R res = (*func)(arg1, arg2, arg3, arg4);
bryantaylor 0:eafc3fd41f75 290 result->putData<R>(res);
bryantaylor 0:eafc3fd41f75 291 }
bryantaylor 0:eafc3fd41f75 292
bryantaylor 0:eafc3fd41f75 293 struct rpc_method {
bryantaylor 0:eafc3fd41f75 294 const char *name;
bryantaylor 0:eafc3fd41f75 295 typedef void (*method_caller_t)(RPC*, Arguments*, Reply*);
bryantaylor 0:eafc3fd41f75 296 typedef const struct rpc_method *(*super_t)(RPC*);
bryantaylor 0:eafc3fd41f75 297 union {
bryantaylor 0:eafc3fd41f75 298 method_caller_t method_caller;
bryantaylor 0:eafc3fd41f75 299 super_t super;
bryantaylor 0:eafc3fd41f75 300 };
bryantaylor 0:eafc3fd41f75 301 };
bryantaylor 0:eafc3fd41f75 302
bryantaylor 0:eafc3fd41f75 303 template<class C>
bryantaylor 0:eafc3fd41f75 304 const struct rpc_method *rpc_super(RPC *this_ptr) {
bryantaylor 0:eafc3fd41f75 305 return static_cast<C*>(this_ptr)->C::get_rpc_methods();
bryantaylor 0:eafc3fd41f75 306 }
bryantaylor 0:eafc3fd41f75 307
bryantaylor 0:eafc3fd41f75 308 #define RPC_METHOD_END { NULL, NULL }
bryantaylor 0:eafc3fd41f75 309 #define RPC_METHOD_SUPER(C) { NULL, (rpc_method::method_caller_t)rpc_super<C> }
bryantaylor 0:eafc3fd41f75 310
bryantaylor 0:eafc3fd41f75 311 } // namespace mbed
bryantaylor 0:eafc3fd41f75 312
bryantaylor 0:eafc3fd41f75 313 #endif