-
-
Notifications
You must be signed in to change notification settings - Fork 37
feat:add example for BLE send message #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
examples/send_message_ble.rs
Outdated
|
|
||
| // Get MyInfo from the first message of stream | ||
| // ----------------------------------------------------------------------- | ||
| let RecievedPacket::MyInfo(my_node_info) = RecievedPacket::from(packet_rx.recv().await) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this in the other example code in issue.
This is guaranteed to be the first packet sent by the firmware I assume?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it! It always happen so...
| use meshtastic::Message; | ||
|
|
||
| struct Router { | ||
| sent: VecDeque<MeshPacket>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is sent used for anything in the example, or do you just want to show that the router is informed when messages are sent by send_text() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is used to get the packet id, used later when checking for the ACK
| } | ||
| } | ||
|
|
||
| async fn get_ble_device() -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for showing discovery also, when device is not specified in the command line options.
|
Reviewed and commented, in case it helps. Arguably, it could close #63 too? |
I expect this!
Mmmm... @andrewdavidmackenzie is not still not clear for me the design decisions behind the Maybe if I implement some kind of router some day it would have more sense to me? And thanks for the review 🙌 |
|
You've implemented a router here, it's just quite simple, which makes sense as there is not much other app logic that needs it. I think for some simple sending scenarios, not needing a router at all (but supplying from node id) would make sense. |
I would say a "real router", forwarding packets and so on.
Agree |
Summary
Add an example for sending messages over BLE
Related Issues
Closes #78