main.c
// this gets called when a node is added or removed from the mesh, so set the controller to the node with the lowest chip id
this gets called when a node is added or removed from the mesh, so set the controller to the node with the lowest chip id
this gets called when a node is added or removed from the mesh so set the controller to the node with the lowest chip id
void changedConnectionCallback() {
  Serial.printf("\n > CHANGED CONNECTIONS: %s\n", mesh.subConnectionJson().c_str());
  controllerElection();
  SimpleList<uint32_t> nodes = mesh.getNodeList();
  if (nodes.size() > 0) {
    displayMode = CONNECTED;
  }
  else {
    displayMode = ALONE;
  }
}
void changedConnectionCallback ( ) { Serial . printf ( " \n \n " , mesh . subConnectionJson ( ) . c_str ( ) ) ; controllerElection ( ) ; SimpleList < uint32_t > nodes = mesh . getNodeList ( ) ; if ( nodes . size ( ) > 0 ) { displayMode = CONNECTED ; } else { displayMode = ALONE ; } }
this gets called when a node is added or removed from the mesh, so set the controller to the node with the lowest chip id
this gets called when a node is added or removed from the mesh so set the controller to the node with the lowest chip id
// calling an election when mesh configuration changes // if the node count is zero, go back to the "alone" animation