Changes

Jump to navigation Jump to search
878 bytes added ,  00:55, 23 June 2017
Line 208: Line 208:  
</code><br />
 
</code><br />
 
The isStandard() method returns a boolean value asserting whether a board is currently in standard mode. If it is, the boolean mode is true. If it is in silence mode, the returned value is false.
 
The isStandard() method returns a boolean value asserting whether a board is currently in standard mode. If it is, the boolean mode is true. If it is in silence mode, the returned value is false.
 +
 +
=== Gesture Functions ===
 +
Gestures are defined by a struct known as the Gesture struct, which looks as so:
 +
<code>
 +
struct gesture {
 +
  byte type;
 +
  byte flags;
 +
  byte destination;
 +
  char[] data;
 +
}; <br/>
 +
The struct omits the source identifier and checksum, which are inserted automatically by STINGR. It should be noted that the '''data''' field of the struct is '''only''' the payload -- STINGR inserts the start and end designators itself.
 +
 +
<code>
 +
bool myStingr.gesture(struct gesture gest);
 +
</code><br />
 +
The gesture(struct gesture gest) is the primary means of sending data using STINGR. The method takes a valid gesture struct, formats it appropriately, parses it, and sends it through the flight stack over CAN. The method returns a boolean success flag -- true in the case of successful transmission, and false in the case of either failed transmission or invalid struct.

Navigation menu