tinyb icon indicating copy to clipboard operation
tinyb copied to clipboard

write_value to NRF52 on Ubuntu 18.04 takes at least 75 ms.

Open wiesener opened this issue 5 years ago • 2 comments

I've measured the duration of sending one packet of 8 bytes to the peripheral with the code below:

auto tick = boost::posix_time::microsec_clock::local_time(); this->nus_char_tx->write_value(buffer); auto now = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration diff = now - tick; auto mili = diff.total_milliseconds(); std::cout << "Time elpased: " << mili << std::endl;

It gives me around 70-90 ms. My peripheral set the connection interval between 7.5-75 ms. So how could it be that long for sending just some data.

Best regards,

wiesener avatar Jan 22 '19 19:01 wiesener

I've just checked: write_value calls: gatt_characteristic1_call_write_value_sync Which seems to be generated code? Is there a way to call it asynchronously? And is there a way to reduce the connection interval from dbus?

wiesener avatar Jan 22 '19 21:01 wiesener

I've just checked: write_value calls: gatt_characteristic1_call_write_value_sync Which seems to be generated code? Is there a way to call it asynchronously? And is there a way to reduce the connection interval from dbus?

wiesener avatar Jan 22 '19 21:01 wiesener