Skip to content

Commit

Permalink
zephyr: set GATT notification context before the call
Browse files Browse the repository at this point in the history
  • Loading branch information
benedekkupper committed Nov 20, 2024
1 parent 0dddeba commit da4ad86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c2usb/port/zephyr/bluetooth/hid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ ::hid::result service::send_report(const std::span<const uint8_t>& data, report:
return result::BUSY;
}

pending_notify = data;
auto ret = attr->notify(
data.subspan(offset),
[](::bt_conn*, void* user_data)
Expand All @@ -396,7 +397,7 @@ ::hid::result service::send_report(const std::span<const uint8_t>& data, report:
// get report selector / boot report info
report::selector sel{report::type::INPUT};
protocol prot = protocol::BOOT;
if (*attr[1].uuid == *input_report_info().uuid)
if (attr[1].uuid == input_report_info().uuid)
{
sel = attr[report_reference_offset()].user_value<report::selector>();
prot = protocol::REPORT;
Expand All @@ -413,7 +414,6 @@ ::hid::result service::send_report(const std::span<const uint8_t>& data, report:
switch (ret)
{
case 0:
pending_notify = data;
return result::OK;
case -ENOENT:
case -EINVAL:
Expand Down

0 comments on commit da4ad86

Please sign in to comment.