Bluetooth: btp: Add event indicating expiration of incomp timer
This event indicates that segmented message incomplete timer expired. Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
parent
9977caefa1
commit
813ec50838
7 changed files with 35 additions and 0 deletions
|
@ -35,6 +35,7 @@ struct bt_test_cb {
|
|||
void (*mesh_model_unbound)(u16_t addr, struct bt_mesh_model *model,
|
||||
u16_t key_idx);
|
||||
void (*mesh_prov_invalid_bearer)(u8_t opcode);
|
||||
void (*mesh_trans_incomp_timer_exp)(void);
|
||||
|
||||
sys_snode_t node;
|
||||
};
|
||||
|
|
|
@ -978,6 +978,11 @@ static void seg_ack(struct k_work *work)
|
|||
send_ack(rx->sub, rx->dst, rx->src, rx->ttl,
|
||||
&rx->seq_auth, 0, rx->obo);
|
||||
seg_rx_reset(rx);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_TESTING)) {
|
||||
bt_test_mesh_trans_incomp_timer_exp();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,17 @@ void bt_test_mesh_prov_invalid_bearer(u8_t opcode)
|
|||
}
|
||||
}
|
||||
|
||||
void bt_test_mesh_trans_incomp_timer_exp(void)
|
||||
{
|
||||
struct bt_test_cb *cb;
|
||||
|
||||
SYS_SLIST_FOR_EACH_CONTAINER(&cb_slist, cb, node) {
|
||||
if (cb->mesh_trans_incomp_timer_exp) {
|
||||
cb->mesh_trans_incomp_timer_exp();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int bt_test_mesh_lpn_group_add(u16_t group)
|
||||
{
|
||||
bt_mesh_lpn_group_add(group);
|
||||
|
|
|
@ -16,3 +16,4 @@ void bt_test_mesh_model_bound(u16_t addr, struct bt_mesh_model *model,
|
|||
void bt_test_mesh_model_unbound(u16_t addr, struct bt_mesh_model *model,
|
||||
u16_t key_idx);
|
||||
void bt_test_mesh_prov_invalid_bearer(u8_t opcode);
|
||||
void bt_test_mesh_trans_incomp_timer_exp(void);
|
||||
|
|
|
@ -1613,3 +1613,11 @@ Events:
|
|||
|
||||
This event indicates reception of provisioning message with
|
||||
invalid RFU BearerOpcode.
|
||||
|
||||
Opcode 0x88 - Transport Incomplete Timer Expired Event
|
||||
|
||||
Controller Index: <controller id>
|
||||
Event parameters: <none>
|
||||
|
||||
This event indicates that segmented message incomplete timer
|
||||
expired.
|
||||
|
|
|
@ -815,6 +815,8 @@ struct mesh_invalid_bearer_ev {
|
|||
u8_t opcode;
|
||||
} __packed;
|
||||
|
||||
#define MESH_EV_INCOMP_TIMER_EXP 0x88
|
||||
|
||||
void tester_init(void);
|
||||
void tester_rsp(u8_t service, u8_t opcode, u8_t index, u8_t status);
|
||||
void tester_send(u8_t service, u8_t opcode, u8_t index, u8_t *data,
|
||||
|
|
|
@ -857,11 +857,18 @@ static void invalid_bearer_cb(u8_t opcode)
|
|||
CONTROLLER_INDEX, (u8_t *) &ev, sizeof(ev));
|
||||
}
|
||||
|
||||
static void incomp_timer_exp_cb(void)
|
||||
{
|
||||
tester_send(BTP_SERVICE_ID_MESH, MESH_EV_INCOMP_TIMER_EXP,
|
||||
CONTROLLER_INDEX, NULL, 0);
|
||||
}
|
||||
|
||||
static struct bt_test_cb bt_test_cb = {
|
||||
.mesh_net_recv = net_recv_ev,
|
||||
.mesh_model_bound = model_bound_cb,
|
||||
.mesh_model_unbound = model_unbound_cb,
|
||||
.mesh_prov_invalid_bearer = invalid_bearer_cb,
|
||||
.mesh_trans_incomp_timer_exp = incomp_timer_exp_cb,
|
||||
};
|
||||
|
||||
u8_t tester_init_mesh(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue