Skip to content
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: bluetooth: tester: Add MESH_START command from upstream tester #12572

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/bluetooth/tester/src/bttester.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* bttester.h - Bluetooth tester headers */

Check failure on line 1 in tests/bluetooth/tester/src/bttester.h

View workflow job for this annotation

GitHub Actions / call-workflow / Run license checks on patch series (PR)

License Problem

"APACHE-2.0" license is not allowed for this file.

/*
* Copyright (c) 2015-2016 Intel Corporation
Expand Down Expand Up @@ -145,6 +145,7 @@

#define MESH_INIT 0x04
#define MESH_RESET 0x05
#define MESH_START 0x78

/* events */
#define MESH_EV_OUT_NUMBER_ACTION 0x80
Expand Down
20 changes: 16 additions & 4 deletions tests/bluetooth/tester/src/mesh.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* mesh.c - Bluetooth Mesh Tester */

Check failure on line 1 in tests/bluetooth/tester/src/mesh.c

View workflow job for this annotation

GitHub Actions / call-workflow / Run license checks on patch series (PR)

License Problem

"APACHE-2.0" license is not allowed for this file.

/*
* Copyright (c) 2017 Intel Corporation
Expand Down Expand Up @@ -63,6 +63,7 @@
tester_set_bit(buf->data, MESH_CONFIG_PROVISIONING);
tester_set_bit(buf->data, MESH_INIT);
tester_set_bit(buf->data, MESH_RESET);
tester_set_bit(buf->data, MESH_START);

tester_send(BTP_SERVICE_ID_MESH, MESH_READ_SUPPORTED_COMMANDS,
CONTROLLER_INDEX, buf->data, buf->len);
Expand Down Expand Up @@ -234,10 +235,19 @@
err = bt_mesh_init(&prov, comp);
if (err) {
status = BTP_STATUS_FAILED;

goto rsp;
}

tester_rsp(BTP_SERVICE_ID_MESH, MESH_INIT, CONTROLLER_INDEX,
status);
}

static void start(uint8_t *data, uint16_t len)
{
uint8_t status = BTP_STATUS_SUCCESS;
int err;

LOG_DBG("");

if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
printk("Loading stored settings\n");
settings_load();
Expand All @@ -256,8 +266,7 @@
}
}

rsp:
tester_rsp(BTP_SERVICE_ID_MESH, MESH_INIT, CONTROLLER_INDEX,
tester_rsp(BTP_SERVICE_ID_MESH, MESH_START, CONTROLLER_INDEX,
status);
}

Expand All @@ -283,6 +292,9 @@
case MESH_INIT:
init(data, len);
break;
case MESH_START:
start(data, len);
break;
case MESH_RESET:
reset(data, len);
break;
Expand Down
Loading