I'm working on hid keyboard example. How can I check whether multiple bytes are received & transmitted after I increase the assigned no. of bytes in input/output report? From the code I understood that nrf device can send 64 bytes to host device. So how do I append bytes in one packet of 64 bytes when sending to host? How does it work from host side? Does nrf read 1 byte at a time sent from host?
So how do I append bytes in one packet of 64 bytes when sending to host?
What do you mean by that? Do you want to increase the packet size so you can send more than 64 bytes?
I read somewhere that Windows machine accepts 64 bytes from BLE device. So accordingly I should make changes in HID descriptor which are - REPORT_COUNT = 64, REPORT_SIZE = 8. In the current situation, the below image demonstrates how many no. of bytes are sent/received in nrfConnect.
If I make the changes for 64 bytes, do I need to take care of any header bytes getting added to the packet or can all 64 bytes be data bytes? I know for sure that the first byte to be sent from nrf to pc should be report ID.
Also in the code, in which locations are the packet size actually being checked for input & output report?
I would like maximum size possible for input & output report for Windows OS & Mac OS.
And you get just one byte every time?
I'm not able to send 26 byte output report from all applications, after that the board just disconnects.
static void on_hid_rep_char_write(ble_hids_evt_t * p_evt)
if (p_evt->params.char_write.char_id.rep_type == BLE_HIDS_REP_TYPE_OUTPUT)
uint8_t report_index = p_evt->params.char_write.char_id.rep_index;
if (report_index == OUTPUT_REPORT_INDEX)
// This code assumes that the output report is one byte long. Hence the following static assert is made.
STATIC_ASSERT(OUTPUT_REPORT_MAX_LEN == 26);//1);
err_code = ble_hids_outp_rep_get(&m_hids, report_index, OUTPUT_REPORT_MAX_LEN, 0, m_conn_handle, &report_val);
// For HID
if (report_val != 0x00)
NRF_LOG_INFO("Caps Lock is turned On!");
err_code = bsp_indication_set(BSP_INDICATE_ALERT_3);
else if (report_val == 0x00)
NRF_LOG_INFO("Caps Lock is turned Off!");
err_code = bsp_indication_set(BSP_INDICATE_ALERT_OFF);
// The report received is not supported by this application. Do nothing.
In nrfConnect, I get this error. What does it mean? Does it mean I can only send 20 bytes?
With 20 bytes, I can send output report from all applications.
Have you tried changing the report descriptor for output report to accommodate 26 bytes?
Yes I did but I received BLE_GATT_OP_WRITE_CMD error and did a little search in Nordic forum. What should I do?
Which function returned that error?
This error was thrown by nrfConnect.
Should I increase the ATT MTU size?
Yes, try that.
Bluetooth disconnects if I try to increase the MTU size.
I want to receive 6kb file as an output report. What is the best way to do it?
Should the file be divided into data chunks? If yes then what should be the maximum size of the packet? Will it increase the throughput?
Please guide me with a few steps which I should follow.
Could you please log the disconnect reason?