mirror of
https://gitlab.com/wirelos/sprocket-lib.git
synced 2025-12-16 13:25:03 +01:00
layer basic com
This commit is contained in:
@@ -11,7 +11,6 @@ Network* MeshNet::init(){
|
||||
mesh.setDebugMsgTypes( config.debugTypes );
|
||||
mesh.init( config.meshSSID, config.meshPassword, scheduler, config.meshPort, WIFI_AP_STA, config.channel );
|
||||
|
||||
//mesh.onReceive(bind(&MeshNet::receivedCallback,this, _1, _2));
|
||||
mesh.onNewConnection(bind(&MeshNet::newConnectionCallback, this, _1));
|
||||
mesh.onChangedConnections(bind(&MeshNet::changedConnectionCallback, this));
|
||||
mesh.onNodeTimeAdjusted(bind(&MeshNet::nodeTimeAdjustedCallback, this, _1));
|
||||
@@ -36,8 +35,8 @@ void MeshNet::update(){
|
||||
// only needed when no scheduler was passed to mesh.init
|
||||
mesh.update();
|
||||
}
|
||||
void MeshNet::receivedCallback( uint32_t from, String &msg ) {
|
||||
Serial.printf("--> Received from %u msg=%s\n", from, msg.c_str());
|
||||
void MeshNet::onReceive( std::function<void(uint32_t from, String &msg)> cb) {
|
||||
mesh.onReceive(cb);
|
||||
}
|
||||
|
||||
void MeshNet::newConnectionCallback(uint32_t nodeId) {
|
||||
|
||||
Reference in New Issue
Block a user