<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1813/getting-nrf_invalid_param-when-hid-device-is-not-keyboard-nor-mouse</link><description>SDK version: 5.1.0
S110 version: 6.0.0
chip: nRF51822 
 I am experimenting a generic Data transfer hid device, the report map is as follows: 
 
 0x05, 0x0C, // Usage Page (Consumer devices),
 0x09, 0x00, // Usage (unassigned),
 0xa1, 0x02, // Collection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 Mar 2014 01:10:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1813/getting-nrf_invalid_param-when-hid-device-is-not-keyboard-nor-mouse" /><item><title>RE: Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/thread/7877?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2014 01:10:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47725466-c0d5-4ac9-a50e-f628962fb2fc</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;I found out to get HID generic working is to comment out this line :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//if (p_hids_init-&amp;gt;is_kb || p_hids_init-&amp;gt;is_mouse)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the function ble_hids_init(...) of ble_hids.c line 1060.  That was the missing parameter setting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/thread/7876?ContentTypeID=1</link><pubDate>Wed, 26 Mar 2014 16:50:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a197e28-67d4-4bb4-9710-44c34f07d4bf</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;I have same issue.  If I ignore the sd_ble_gatts_value_set(...) as you mention.  It will crash at ble_bondmngr_sys_attr_store(); 
When can we expect this bug resolved ?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/thread/7875?ContentTypeID=1</link><pubDate>Sun, 09 Mar 2014 13:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89fb975e-86eb-47cd-aa5d-aa3f00eaa7c0</guid><dc:creator>Peeter Vois</dc:creator><description>&lt;p&gt;At the moment it seems to me that on Linux, sending oversized output report (more than 22 bytes) will cause the bluetoothd not to send any more output reports (including reports with correct size) until the device is disconnected and reconnected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/thread/7874?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2014 13:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0be4dcc5-8443-47e5-bfc9-f6824c2fd337</guid><dc:creator>Peeter Vois</dc:creator><description>&lt;p&gt;Yes, I am struggling with the interface and maybe there is connection with 64 bytes... I need to port a USB device to use BLE... I will think something out.&lt;/p&gt;
&lt;p&gt;I have also faked this device to be mouse and in that case there is no assert. And I also tried to ignore the assert. With MasterControlPanel I can send and receive reports with few bytes independent of the mouse issue. Although with Linux bluez library I have issue sending output report. Input report arrives well. At the moment I have no clear understanding what can be wrong. Reducing the size to 20 bytes does not improve things....  I&amp;#39;ll dig further.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting NRF_INVALID_PARAM when hid device is not keyboard nor mouse</title><link>https://devzone.nordicsemi.com/thread/7873?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2014 13:07:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f0f7fd-a378-4a10-96e8-20fe5cacfda3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Peeter,&lt;/p&gt;
&lt;p&gt;The ble_hids library has a bug, where it will assert if is_kb &amp;amp;&amp;amp; is_mouse == false.
In file ble_hids.c, function on_connect, it will try to set protocol mode (for mice and keyboard), however the characteristic is not added (as you&amp;#39;ve already found out).&lt;/p&gt;
&lt;p&gt;This bug is reported internally and we are working on a fix.
Proposed workaround:
add is_kb and is_mouse to a static global inside the ble_hids library, and then do a check in function &amp;quot;on_connect&amp;quot;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (is_kb || is_mouse)
  err_code = sd_ble_gatts_value_set(...);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another note:
I see that your usb descriptor is setup with a size of 64 byte. You will have issues with this descriptor.
The maximum in BLE is 20 bytes from peripheral to central, and 22 bytes from central to peripheral.&lt;/p&gt;
&lt;p&gt;Best regards
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>