Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onMessage(client, topic, message)
- if handleQuery(topic.."+"..message) then
- uart.write(0,topic.."+"..message)
- uart.on("data","%", function(data)
- if data=="quit%" then
- uart.on("data") -- unregister event
- end
- if data ~= "quit%" then
- client:publish(topic.."/response","REPLY:"..data,0,0)
- end
- end,0)
- else
- client:publish(topic.."/response","REPLY: Invalid query",0,0)
- end
- end
- REPLY:<value>%
- quit%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement