sNET library for Arduino now on github

After a week of testing and tuning up, we are finally ready to push the Arduino sNET library on our github account at http://github.com/airqnetworks :-) The library repository is named snet-arduino, and it can be easily downloaded using git:

Those who aren’t confident with git version system can download the library zip file using this link https://github.com/airqnetworks/snet-arduino/archive/master.zip.

Library implementation is still partial. Only AirQ 300 and 310 control boards are supported at the moment. However, the underlying structure is almost complete, so we will spend less time to support all other AirQ Networks devices. There is a lack of documentation too. We’ll add documentation to our technical wiki soon. In the github repository there is a REAME file that explains the main concepts of the library. Library is really simple to use. Let’s suppose that we want to turn-on the RELAY1 of an AirQ 310 control board with a sNET address equal to 4.0.1.2. This can be simply achieved with the following Arduino code:

Let’s give some explanations. At line 10 we create a new sNET object. This object is responsible to collect all messages coming from the sensor networks and captured by the AirQ ShielD. Every time we create a new sNET object we must specify how many devices the shield will interact with (in this case we assume only one AirQ 310 board). Usually, an Arduino sketch uses only one sNET object.

Next on the line 19 we ask to sNET library to process all messages coming from sensor network using sNET::processMessages() method. This a cyclical task and programmer have to call this method every time they can in order to avoid that messages are lost (for more info, see attached doc in the library). sNET library will create a device object for us when a new message coming from the AirQ 310 is detected. A device object is an abstraction that allows us to interact with a wireless device without knowing underlying details of sNET protocol. Line 26 checks if the library has created the device object for us and if so we turn ON the RELAY1.

We’ll publish further details in the next days. Stay tuned 😉

Be Sociable, Share!

Posted on by admin in Arduino 1 Comment

One Response to sNET library for Arduino now on github

  1. pirate bay unblocked

    For example, being looking for film, you can select files by limiting their size –
    by using this option you’ll except low-quality films (SAT-Rip, CAM-Rip,
    Telesync). Unlike many synthetics this material also has an extremely natural feel, and offers excellent breath-ability, allowing body moisture to leave,
    ensuring the driest ride possible. s the point of anything you do if
    the nose is indeed close to the grindstone that you don.

     

Add a Comment