Improved RPC library with added bounds checking to stop memory corruption, removed memory leaks, Arduino pin names, better object discovery.
Fork of mbed-rpc by
I have added bounds checking in both Argument and Reply classes to stop existing buffer over-runs in both classes.
Added the ability to discover the name and class of an RPC object to allow better discovery of existing objects on a server. Removed a memory leak with externally created RPC objects. Ensured consistency so that externally created objects can't be deleted using the RPC interface and are correctly listed after RPC::clear.
Updated RPCVariable to use references instead of pointers to ensure that the compiler checks that there is always a valid backing variable. Also removed RPC new/delete functionality as this is not valid. Added a specialisation of RPCVariable to allow for strings to be read and written via RPC.
Added Arduino pin names to parse_pins, currently only for FRDM boards but same code should work for others just need to add them to the #ifdef.
mbed_rpc.h@10:7511acfaa62d, 2015-03-30 (annotated)
- Committer:
- rhourahane
- Date:
- Mon Mar 30 16:43:47 2015 +0000
- Revision:
- 10:7511acfaa62d
- Parent:
- 1:6919289a5946
Updates to improve robustness and remove memory leak. Added RCVariable specialisation for char buffer.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 0:efe8172b4113 | 1 | /* mbed Microcontroller Library |
emilmont | 1:6919289a5946 | 2 | * Copyright (c) 2006-2013 ARM Limited |
mbed_official | 0:efe8172b4113 | 3 | * |
emilmont | 1:6919289a5946 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
emilmont | 1:6919289a5946 | 5 | * you may not use this file except in compliance with the License. |
emilmont | 1:6919289a5946 | 6 | * You may obtain a copy of the License at |
mbed_official | 0:efe8172b4113 | 7 | * |
emilmont | 1:6919289a5946 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 0:efe8172b4113 | 9 | * |
emilmont | 1:6919289a5946 | 10 | * Unless required by applicable law or agreed to in writing, software |
emilmont | 1:6919289a5946 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
emilmont | 1:6919289a5946 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
emilmont | 1:6919289a5946 | 13 | * See the License for the specific language governing permissions and |
emilmont | 1:6919289a5946 | 14 | * limitations under the License. |
mbed_official | 0:efe8172b4113 | 15 | */ |
mbed_official | 0:efe8172b4113 | 16 | #ifndef MBED_RPC_H |
mbed_official | 0:efe8172b4113 | 17 | #define MBED_RPC_H |
mbed_official | 0:efe8172b4113 | 18 | |
mbed_official | 0:efe8172b4113 | 19 | #include "rpc.h" |
mbed_official | 0:efe8172b4113 | 20 | #include "RPCVariable.h" |
mbed_official | 0:efe8172b4113 | 21 | #include "RPCFunction.h" |
mbed_official | 0:efe8172b4113 | 22 | #include "RpcClasses.h" |
mbed_official | 0:efe8172b4113 | 23 | #include "Arguments.h" |
mbed_official | 0:efe8172b4113 | 24 | |
mbed_official | 0:efe8172b4113 | 25 | #endif |