Thanks dsl
I known that the best way for optimzation in speed and size for "1" function is to do something like your example.
But let say you have about 100 Uart Ascii Serial protocol command (message length is between 20 to 100 bytes) to interpret and 100 structure to serialize to save it into flash or eeprom.
To use a command like sprintf and sscanf clarify a lot your code and is more easy to understand and manage.
I know that the function take memory a certain amount of space, but consider that those function are use more than 200 times, so you have to split by 200 the space of this function
So your code will be smaller than to treath each case separatly like in your example
Thanks a lot for the suggestion, but for know I think the best way should be sprintf and sscanf
If you have another suggestion, feel free to suggest me