Created
June 16, 2017 06:26
-
-
Save sankarcheppali/fc578c6bd8ca6bcc23cea1b850557b6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function consume_data( payload ) | |
--we will parse the payload and excute it,publish the return value | |
print(payload) | |
msg=cjson.decode(payload) | |
loadNumber=msg.ln | |
targetStatus=msg.ts | |
if(targetStatus==0) then loadStatus=bit.clear(loadStatus,loadNumber) | |
else loadStatus = bit.set(loadStatus,loadNumber) end | |
serialOut(loadStatus) | |
print ("Status of the loads : ") | |
print (loadStatus) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment