0
I need to decode a string coming from an external device via PHP.
This equipment is a tracker that emits information in a time interval for a given host and port. I created a socket that reads the same host and port as the tracker and I was able to receive a message. This is the part of the code I’m using to show the received values.
socket_listen($webSocket);
$buff = @socket_read(socket_accept($webSocket), 1024, PHP_BINARY_READ);
echo "Numero de dados recebidos: $flgSl \n";
$receiveStrHex = fread($buff);
var_dump($receiveStrHex);
Part of the received string: Òyšþøçü À ? 0 ô'P 'R@ Hb U eˆ7Xộž,Òyšþøçü À
I had tried to use the unpack() method but I was also unsuccessful.
Thank you.
What is the secret message? is encondig problem?
– rray
I think it is not a problem, because another software already performed the procedure of reading this type of code.
– Henrique Costa