Changes

Jump to navigation Jump to search
1,708 bytes added ,  01:09, 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.
 +
 +
<code>
 +
byte[] stack = myStingr.getFlightStack();
 +
</code><br />
 +
This method returns a byte array of identifiers indicating what boards are present in the flight stack, including the identifier of the calling board. This byte array fully defines the flight stack.
    
=== Gesture Functions ===
 
=== Gesture Functions ===
Line 228: Line 233:  
</code><br />
 
</code><br />
 
This method is equivalent to the primary gesture method, but accepts the individual parameters as opposed to a filled-out struct.
 
This method is equivalent to the primary gesture method, but accepts the individual parameters as opposed to a filled-out struct.
 +
 +
=== Handlers ===
 +
The STINGR handlers are interrupt-driven handlers that are called when a gesture is received that is either targeted at your board, or is a broadcast gesture. It should be noted that heartbeat gestures (the gestures send every 60 seconds by a board identifying its presence, do not trigger these interrupt handlers).
 +
 +
<code>
 +
myStingr.attachBroadcastHandler();
 +
</code><br />
 +
This method attaches the broadcast handler, which will call broadcastHandler(struct gesture gest) -- a callback that you must implement in your code, whenever a broadcast gesture is identified.
 +
 +
<code>
 +
myStingr.attachRequestHandler();
 +
</code><br />
 +
This method attaches a request handler, which will call gestRequestHandler(struct gesture gest) -- a callback that you must implement in your code, whenever a request gesture targeting your board is identified.
 +
 +
<code>
 +
myStingr.attachResponseHandler();
 +
</code><br />
 +
This method attaches a response handler, which will call gestResponseHandler(struct gesture gest) -- a callback that you must implement in your code, whenever a response gesture targeting your board is identified.
 +
 +
<code>
 +
myStingr.attachGenericHandler();
 +
</code><br />
 +
This method attaches a generic handler, which will call gestGeneralHandler(struct gesture gest) -- a callback that you must implement in your code, whenever '''any''' gesture is identified targeting your board, whether it is a request, response, or broadcast gesture.

Navigation menu