mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-15 13:08:21 +01:00
add default callbacks for mesh to sprocket
This commit is contained in:
@@ -22,6 +22,9 @@ class MeshSprocket : public Sprocket {
|
||||
|
||||
}
|
||||
|
||||
virtual void onChangedConnections(){};
|
||||
virtual void onNewConnection(){};
|
||||
|
||||
Sprocket* activate(Scheduler* scheduler, Network* network) {
|
||||
Sprocket::activate(scheduler, network);
|
||||
net = static_cast<MeshNet*>(network);
|
||||
@@ -34,9 +37,11 @@ class MeshSprocket : public Sprocket {
|
||||
|
||||
virtual void newConnection(uint32_t nodeId){
|
||||
PRINT_MSG(Serial, "MeshSprocket", "connected to %u", nodeId);
|
||||
onNewConnection();
|
||||
}
|
||||
virtual void connectionChanged(){
|
||||
PRINT_MSG(Serial, "MeshSprocket", "connection changed");
|
||||
onChangedConnections();
|
||||
}
|
||||
|
||||
virtual void onMessage(uint32_t from, String &msg) {
|
||||
|
||||
Reference in New Issue
Block a user