lib/mqttbridge/YalgaarPublish.rb in yalgaar-1.0.1 vs lib/mqttbridge/YalgaarPublish.rb in yalgaar-1.0.2

- old
+ new

@@ -1,10 +1,10 @@ #@fileName <YalgaarPublish.rb> #@brief - <Publish methods> # #Revision Log: -# v1.0.1 : Aug 4, 2016 INITIAL OF PROGRAMMER - REVISION DETAIL_1 <- THIS IS THE LATEST REVISION +# v1.0.2 : Aug 4, 2016 INITIAL OF PROGRAMMER - REVISION DETAIL_1 <- THIS IS THE LATEST REVISION #Description: #YalgaarInitModule contents methods and variables and enum.. # #@bug Known Issues: # 1. ISSUE NAME - NONE @@ -29,10 +29,15 @@ #@param <Length> : <length for how long uuid generating> #DESCRIPTION:<To yalgaarPublish as given length> def yalgaarPublish(channel,message) if @@isConnected==true topic=@@clientKey+'/'+channel - @@client.publish(topic, message, retain=false) + if @@isEncrpt==1 + cyperText=encryption(message) + @@client.publish(topic, cyperText, retain=false) + else + @@client.publish(topic, message, retain=false) + end else return YALGAAR_NO_SERVER_CONNECTION end end end