nrkhara:
So if payload contains 'F' the above code sends 46 which is the ascii representation.
That's not enough information to provide a context.
Post an example of a complete message and explain what needs to happen in response to the whole thing. At the moment this is a typical XY problem
...R