mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 05:24:30 +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* scheduler, Network* network) {
|
||||||
Sprocket::activate(scheduler, network);
|
Sprocket::activate(scheduler, network);
|
||||||
net = static_cast<MeshNet*>(network);
|
net = static_cast<MeshNet*>(network);
|
||||||
@@ -34,9 +37,11 @@ class MeshSprocket : public Sprocket {
|
|||||||
|
|
||||||
virtual void newConnection(uint32_t nodeId){
|
virtual void newConnection(uint32_t nodeId){
|
||||||
PRINT_MSG(Serial, "MeshSprocket", "connected to %u", nodeId);
|
PRINT_MSG(Serial, "MeshSprocket", "connected to %u", nodeId);
|
||||||
|
onNewConnection();
|
||||||
}
|
}
|
||||||
virtual void connectionChanged(){
|
virtual void connectionChanged(){
|
||||||
PRINT_MSG(Serial, "MeshSprocket", "connection changed");
|
PRINT_MSG(Serial, "MeshSprocket", "connection changed");
|
||||||
|
onChangedConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void onMessage(uint32_t from, String &msg) {
|
virtual void onMessage(uint32_t from, String &msg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user