readJSON function

read a message in JSON format