1 Reply Latest reply on Jul 6, 2012 5:24 AM by Geoffrey Poremba

    Device settings in rhoconnect

      Hello,

       

      we want to receive the device settings in the rhoconnect sever. Our terminals have several attributes we want to save in rhoconnect for future use. For example, to obtain data for a source we call a webservice with a device attribute as a parameter. If the rhoconnect do not have this attrributes it can not call the automatic sync.

       

      We suposed that the device terminal should send its attributes in the autorization / registration time, but we do not how to do it.

       

      How can we pass the device attributes to rhoconnect? and how can we store it in association to the device_id?

       

      Regards,

      Oesia

        • Re: Device settings in rhoconnect

          There are probably a number of ways to do this, but here is one possible scenario.

           

          Step 1: Create a Model to act as your mechanism for sending and storing device attributes to RhoConnect.  For example call it "DeviceAttributes". 

           

          Step 2: In your Source Adapter for this Model, Implement the Search method and in the Search method extract the attributes that you want to store (e.g. device_id, etc). Once you extract the attributes that you want, you can store them in Redis for future use.  For example, let's say you want to associate a specific device_id with a specific attribute. If you pass these as params to the Search method, you can then use the Redis api to call:

           

          Store.put_value(device_id, attribute)

           

          You can then retrieve the attribute later on by calling:

           

          Store.get_value(device_id)

           

          Step 3: In your application, call a Search on the Model when you login, passing the necessary parameters.

           

          You could also probably do this by saving the data to the DeviceAttributes Model from Step 1, and utilize the Create and Update methods of the Source Adapter instead, or perhaps both.  You have some flexibility and it really depends on what you're trying to accomplish.