mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 01:20:44 +00:00
mesh: emit MESH_SUBEVENT_MESSAGE_NOT_ACKNOWLEDGED if expected reply was not received
This commit is contained in:
parent
2a243a1054
commit
d0c07177da
@ -146,6 +146,9 @@ void mesh_access_send_acknowledged_pdu(mesh_pdu_t * pdu, uint8_t retransmissions
|
|||||||
|
|
||||||
mesh_upper_transport_send_access_pdu(pdu);
|
mesh_upper_transport_send_access_pdu(pdu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MESH_SUBEVENT_MESSAGE_NOT_ACKNOWLEDGED 0x30
|
||||||
|
|
||||||
static void mesh_access_acknowledged_run(btstack_timer_source_t * ts){
|
static void mesh_access_acknowledged_run(btstack_timer_source_t * ts){
|
||||||
UNUSED(ts);
|
UNUSED(ts);
|
||||||
|
|
||||||
@ -166,6 +169,7 @@ static void mesh_access_acknowledged_run(btstack_timer_source_t * ts){
|
|||||||
} else {
|
} else {
|
||||||
// find correct model and emit error
|
// find correct model and emit error
|
||||||
uint16_t src = mesh_pdu_src(pdu);
|
uint16_t src = mesh_pdu_src(pdu);
|
||||||
|
uint16_t dst = mesh_pdu_dst(pdu);
|
||||||
mesh_element_t * element = mesh_element_for_unicast_address(src);
|
mesh_element_t * element = mesh_element_for_unicast_address(src);
|
||||||
if (element){
|
if (element){
|
||||||
// find
|
// find
|
||||||
@ -176,8 +180,16 @@ static void mesh_access_acknowledged_run(btstack_timer_source_t * ts){
|
|||||||
// find opcode in table
|
// find opcode in table
|
||||||
const mesh_operation_t * operation = mesh_model_lookup_operation_by_opcode(model, pdu->ack_opcode);
|
const mesh_operation_t * operation = mesh_model_lookup_operation_by_opcode(model, pdu->ack_opcode);
|
||||||
if (operation == NULL) continue;
|
if (operation == NULL) continue;
|
||||||
|
if (model->model_packet_handler == NULL) continue;
|
||||||
// emit event
|
// emit event
|
||||||
// TODO:
|
uint8_t event[13];
|
||||||
|
event[0] = HCI_EVENT_MESH_META;
|
||||||
|
event[1] = sizeof(event) - 2;
|
||||||
|
event[2] = element->element_index;
|
||||||
|
little_endian_store_32(event, 3, model->model_identifier);
|
||||||
|
little_endian_store_32(event, 7, pdu->ack_opcode);
|
||||||
|
little_endian_store_16(event, 11, dst);
|
||||||
|
(*model->model_packet_handler)(HCI_EVENT_PACKET, 0, event, sizeof(event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user