-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests: add nimble_l2cap test and benchmark applications #11235
Conversation
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.
ACK for the testing for now (I used this to test #11233).
Please rebase. |
93f8de2
to
24184e7
Compare
rebased |
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.
Code-wise it looks good (can't say much about the functionality though, but obviously it works). Some nit-picks about Makefiles and style though.
tests/nimble_l2cap/main.c
Outdated
size_t step = 10; | ||
size_t limit = APP_MTU; | ||
|
||
if ((argc == 2) && strncmp(argv[1], "help", 4) == 0) { |
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.
parens missing
tests/nimble_l2cap/main.c
Outdated
static uint32_t _rxbuf[APP_MTU / 4]; | ||
static uint32_t _txbuf[APP_MTU / 4]; | ||
|
||
|
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.
Extra newline
tests/nimble_l2cap/main.c
Outdated
size_t pktsize = PKTSIZE_DEFAULT; | ||
unsigned limit = FLOOD_DEFAULT; | ||
|
||
if ((argc == 2) && strncmp(argv[1], "help", 4) == 0) { |
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.
parens missing
tests/nimble_l2cap/Makefile
Outdated
USEMODULE += bluetil_ad | ||
|
||
# Get the shared NimBLE and test configuration from the backend server | ||
include $(CURDIR)/../nimble_l2cap_server/nimble.inc.mk |
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.
Better use $(RIOTBASE)
here. I had problems with this construct in #11256.
tests/nimble_l2cap_server/Makefile
Outdated
USEMODULE += bluetil_ad | ||
|
||
# Get the shared NimBLE and test configuration from the backend server | ||
include $(CURDIR)/../nimble_l2cap_server/nimble.inc.mk |
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.
Dito
tests/nimble_l2cap_server/main.c
Outdated
static bluetil_ad_t _ad; | ||
static struct ble_gap_adv_params _adv_params = { 0 }; | ||
|
||
|
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.
Extra new-line
24184e7
to
07a1210
Compare
addressed comments and cppcheck findings. |
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.
ACK
Contribution description
I continuously ran into buffering trouble with nimble connected to the buffer handling for connection oriented L2CAP channels. As I got tired debugging this, I decided its time for an automated and easy to use test application that can be used to stress-test these L2CAP COC connections. So this PR provides just that.
This test is still missing a fitting
pexpect
script for itsmake test
target - this will be added soon in a follow up PR.Testing procedure
Take two NimBLE capable boards (e.g.
nrf52dk
ornrf52840dk
) and flash the client and server application on them. Once they are both started, they should automatically connect and you can run theflood
andinctest
commands with any parameters... They should never crash :-)Issues/PRs references
This PR depends (is reabsed on) #11232 and #11233