@@ -32,30 +32,26 @@ NBConnectionHandler conMan(SECRET_PIN);
32
32
33
33
void setup () {
34
34
Serial.begin (9600 );
35
- /* give a few seconds for the Serial connection to be available */
35
+ /* Give a few seconds for the Serial connection to be available */
36
36
delay (4000 );
37
37
38
38
setDebugMessageLevel (DBG_INFO);
39
39
40
- // the following methods allow the sketch to be notified when connected or
41
- // disconnected to the network
42
-
43
- conMan.addConnectCallback (
44
- onNetworkConnect); // look at function onNetworkConnect towards the end of
45
- // this sketch
46
- conMan.addDisconnectCallback (
47
- onNetworkDisconnect); // look at function onNetworkDisconnect towards the
48
- // end of this sketch
40
+ /* Register a function to be called upon connection to a network */
41
+ conMan.addConnectCallback (onNetworkConnect);
42
+ /* Register a function to be called upon disconnection from a network */
43
+ conMan.addDisconnectCallback (onNetworkDisconnect);
49
44
}
50
45
51
46
void loop () {
52
- // the following code keeps on running connection workflows on our
53
- // ConnectionHandler object, hence allowing reconnection in case of failure
54
- // and notification of connect/disconnect event if enabled (see
55
- // addConnectCallback/addDisconnectCallback) NOTE: any use of delay() within
56
- // the loop or methods called from it will delay the execution of .update(),
57
- // which might not guarantee the correct functioning of the ConnectionHandler
58
- // object.
47
+ /* The following code keeps on running connection workflows on our
48
+ * ConnectionHandler object, hence allowing reconnection in case of failure
49
+ * and notification of connect/disconnect event if enabled (see
50
+ * addConnectCallback/addDisconnectCallback) NOTE: any use of delay() within
51
+ * the loop or methods called from it will delay the execution of .update(),
52
+ * which might not guarantee the correct functioning of the ConnectionHandler
53
+ * object.
54
+ */
59
55
60
56
conMan.update ();
61
57
}
0 commit comments