Hi Jimmy
The RPC sounds like it could still be of use to you. To use RPC you don't have to use the RPC Interface library so you don't have to give the serial port over to it completely. You just need to pass a string into the rpc function, the RPC interface library is just one way of handling the strings from the serial port.
So perhaps you could create your own code for receiving information over serial which recognises when you want to send the command to RPC (may be when it starts with "/") and when you want to process it in your own way. Or your code could interpret the serial information and then create the necessary string to pass into the rpc. If you use RPC then you also won't have to write any of the code for creating your objects and you'll be able to control them over rpc as well.
As there quite a few benefits to using the rpc format for communicating perhaps you could consider returning your data using rpc as well, for example using the RPCFunction objects to trigger the return of a string of data in csv format. This way all of your communication would be in the rpc format and so you'd be able to easily extend your communication to control other mebd interfaces etc.
Alternativly, and to answer your question directly to convert "p15" into a pin name object you should be able to use some of the tools that the RPC defines and uses. Converting strings to arguments is one of the key tasks of the rpc handler and so rpc.h defines a function:
PinName parse_pins(const char *str)
If you pass your string into this function it should return the PinName. You'll need to include rpc.h
Hope some of these ideas are of use
Michael
I'm trying to dynamically create objects over serial, which is probably similar to the RPC library. The thing is, I'd like to use my USB serial line for other communications as well, so I don't want to hand over full control to SerialRPCInterface.
As an example, suppose I have an LED class, with a member function blink. I want to be able to create these objects over serial by passing a command like "LED p15", and then code on the microcontroller will take care of blinking all of the defined LEDs. I'm just wondering how I can go about converting the string "p15" into a PinName object I can use as an argument to my LED constructor function.