bluerange-io / bluerange-mesh

BlueRange Mesh (formerly FruityMesh) - The first completely connection-based open source mesh on top of Bluetooth Low Energy (4.1/5.0 or higher)
https://bluerange.io/
Other
287 stars 109 forks source link

Send custom messages to nodes #147

Closed NilsMinor closed 4 years ago

NilsMinor commented 4 years ago

Hi, I am building a library for communication between a central (my app) and some nodes (the mesh) --> repo. I implemented the basic BLE stuff as well as the Encryption manager. The next goal is to write a communication manager in order to send data to a node and receive data from it. Therefore I have some additional question.

       u8 data[1];
        data[0] = 123;

        //Send ping packet to that node
        SendModuleActionMessage(
                MessageType::MODULE_TRIGGER_ACTION,
                targetNodeId,
                PingModuleTriggerActionMessages::TRIGGER_PING,
                0,
                data,
                1,
                false
        );

Many thanks, Nils

Brotcrunsher commented 4 years ago

Hi Nils!

You did not explicitly mention it but from the first looks of your Encryption Manager implementation it looks like you are implementing the MeshAccessConnection counterpart for the App, which is certainly the correct approach. You probably already know about this documentation page, but in case you don’t, have a look at this: https://www.bluerange.io/docs/fruitymesh/MeshAccessConnection.html It explains the encryption logic in detail.

Now to your explicit questions:

Hope that helped, Jakob

NilsMinor commented 4 years ago

Hi @Brotcrunsher , thanks for your support!

Yes you are right, I already implemented the mesh access module. I am able to connect to the mesh using the encryption communication. What I am now doing is to implement the message schemes in order to read/write data from/to a specific node.

Your answers helped me thanks :) BR, Nils