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 mbed official

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.

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?

UserRevisionLine numberNew contents of line
emilmont 1:6919289a5946 1 /* mbed Microcontroller Library
emilmont 1:6919289a5946 2 * Copyright (c) 2006-2013 ARM Limited
emilmont 1:6919289a5946 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
emilmont 1:6919289a5946 7 *
emilmont 1:6919289a5946 8 * http://www.apache.org/licenses/LICENSE-2.0
emilmont 1:6919289a5946 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.
emilmont 1:6919289a5946 15 */
emilmont 1:6919289a5946 16 #ifndef MBED_PINMAP_H
emilmont 1:6919289a5946 17 #define MBED_PINMAP_H
emilmont 1:6919289a5946 18
emilmont 1:6919289a5946 19 #include "PinNames.h"
emilmont 1:6919289a5946 20
emilmont 1:6919289a5946 21 namespace mbed {
emilmont 1:6919289a5946 22
emilmont 1:6919289a5946 23 PinName parse_pins(const char *str);
emilmont 1:6919289a5946 24
emilmont 1:6919289a5946 25 }
emilmont 1:6919289a5946 26
emilmont 1:6919289a5946 27 #endif