Skip to content

Updates Usage Docs And Shuffles Around Where Device Gets Configured#51

Open
matt001k wants to merge 4 commits intomainfrom
update_usage_docs
Open

Updates Usage Docs And Shuffles Around Where Device Gets Configured#51
matt001k wants to merge 4 commits intomainfrom
update_usage_docs

Conversation

@matt001k
Copy link
Copy Markdown
Contributor

Device configuration (device_init) should not be an API that the user must call so the struct should be passed into the bristlemout_init function
Updates docs to reflect this change

@towynlin please let me know if you like this, otherwise the user would have to call device_init in their application.

Copy link
Copy Markdown
Contributor

@towynlin towynlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the direction, but it seems there's more work to do.

Comment thread docs/usage.md
// is called should be placed here (application specific), the below
// function call is a must in order to inform L2 that an event must be
// handled
bm_l2_handle_device_interrupt();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this should change to bristlemouth_handle_network_device_interrupt which would allow us to remove the l2.h include above, right?

Comment thread docs/usage.md
register_device_interrupt(network_device_interrupt);

// Information about the device must be configured
DeviceCfg device = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to introduce a change to allow bm_core to set a bristlemouth version? If so, in this PR or a different PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe a different PR.
There is going to be some internal discussion to determine if we want to add that to the info message or create a new message in itself.
If we make a new message it will be a new PR.
Depending on the direction we end up going, it may be best to leave this PR open until we discuss further.

Comment thread docs/usage.md
// ... your other setup code...

BmErr err = bristlemouth_init(network_device_power_callback);
BmErr err = bristlemouth_init(network_device_power_callback, device);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yes I do like this. I think implementors should only have to call one init function and should only have to include one header.

Device configuration (device_init) should not be an API that the user
must call so the struct should be passed into the bristlemout_init
function
Updates docs to reflect this
@matt001k matt001k force-pushed the update_usage_docs branch from 16e8b30 to 9a67bc0 Compare March 28, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants