Mohankumar Posted July 17, 2014 Share Posted July 17, 2014 Hi, In my sample driver used its name itself in proxy tag.Therefore i created device specific Execute Command().Following are Execute Command in driver file:function ExecuteCommand(strCommand, tParams) if (tParams == nil) then if(strCommand == "GET_ENERGYREADINGS") then GET_ENERGYREADINGS() else print ("From ExecuteCommand Function - Unutilized command: " .. strCommand) end endendfunction GET_ENERGYREADINGS() OnDriverInit() C4:SendDataToUI("<data>".. filedata .."</data>") --C4:SetVariable("READING", 523190)end In GET_ENERGYREADINGS() method given two things to execute:1)OnDriverInit() this method is starting point to proceed further collection of other device variable and save it in xml file.2)The saved data in file are read and send that to Flash UI using ( C4:SendDataToUI("<data>".. filedata .."</data>" ) once the command i received from Front end. Above is my scenario in driver in which once loading sampledriver.c4i file in composer and then from Front end i used to passcommand to receive values for display and calculation purpose.For the first time it is not executing automatically since i copied entire <script> section to composer lua part and executed.After that when ever i send command from Front end means the values are thrown by driver to Front end. Please any one suggest instead of executing script code manually ,shall i execute automatically once i load driver file in Composer.If it is possible means please suggest whether i should use any custom button to send events for Front end or by using any other API. Please any one suggest the better way to resolve the defects which i am facing. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.