@@ -32,30 +32,26 @@ NBConnectionHandler conMan(SECRET_PIN);
3232
3333void setup () {
3434 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 */
3636 delay (4000 );
3737
3838 setDebugMessageLevel (DBG_INFO);
3939
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);
4944}
5045
5146void 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+ */
5955
6056 conMan.update ();
6157}
0 commit comments