<?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>HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24486/hid-get-report-from-a-mac-not-as-expected</link><description>Hello again,
This time I am trying to read HID reports using bluetooth to get the state of the caps lock.
I know this should be super simple and its explained in the hid keyboard peripheral example using ble_hids_outp_rep_get. I am using a mac as a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Jan 2021 08:56:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24486/hid-get-report-from-a-mac-not-as-expected" /><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/290150?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 08:56:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34a4e779-70d3-4cca-bd8f-0e60b63f5af7</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;Hey eekwils,&lt;/p&gt;
&lt;p&gt;Now having some more experience with macOS and its peripherals I believe that its caveats of the OS.&lt;/p&gt;
&lt;p&gt;For example there is another magic report you can send which will show your devices battery life in the macOS bar (like magic mice do etc).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for replying to my 3 year old question! I deeply appreciate it:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/290139?ContentTypeID=1</link><pubDate>Wed, 20 Jan 2021 08:32:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:297a5d53-43cb-4a3d-bf93-23085122953b</guid><dc:creator>eekwils</dc:creator><description>&lt;p&gt;I know this thread is 3 years old but I think I&amp;#39;ve found a solution to this issue if anyone else is coming across it.&lt;/p&gt;
&lt;p&gt;When using the ble_hids_keyboard example from the SDK I was experiencing the same problem, I would receive a report from macOS but the value of the caps lock bit wouldn&amp;#39;t change. As I developed my firmware further I added a consumer control report to the hid device descriptor which meant that I needed to explicitly add a report ID to both the keyboard report and consumer control report. After adding the report ID to the keyboard report the capslock functionality started working on macOS. I haven&amp;#39;t had time to fully test that this was the change that did it but I pretty sure it was.&lt;/p&gt;
&lt;p&gt;My report descriptor looks like this:&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint8_t report_map_data[] = 
    {
        0x05, 0x01,       // Usage Page (Generic Desktop)
        0x09, 0x06,       // Usage (Keyboard)
        0xA1, 0x01,       // Collection (Application)
        0x85, 0x01,       // Report ID (1) &lt;strong&gt;&amp;lt;---- !!!!This is the bit I added&lt;/strong&gt;
        0x05, 0x07,       // Usage Page (Key Codes)
        0x19, 0xe0,       // Usage Minimum (224)
        0x29, 0xe7,       // Usage Maximum (231)
        0x15, 0x00,       // Logical Minimum (0)
        0x25, 0x01,       // Logical Maximum (1)
        0x75, 0x01,       // Report Size (1)
        0x95, 0x08,       // Report Count (8)
        0x81, 0x02,       // Input (Data, Variable, Absolute)

        0x95, 0x01,       // Report Count (1)
        0x75, 0x08,       // Report Size (8)
        0x81, 0x01,       // Input (Constant) reserved byte(1)

        0x95, 0x05,       // Report Count (5)
        0x75, 0x01,       // Report Size (1)
        0x05, 0x08,       // Usage Page (Page# for LEDs)
        0x19, 0x01,       // Usage Minimum (1)
        0x29, 0x05,       // Usage Maximum (5)
        0x91, 0x02,       // Output (Data, Variable, Absolute), Led report
        0x95, 0x01,       // Report Count (1)
        0x75, 0x03,       // Report Size (3)
        0x91, 0x01,       // Output (Data, Variable, Absolute), Led report padding

        0x95, 0x06,       // Report Count (6)
        0x75, 0x08,       // Report Size (8)
        0x15, 0x00,       // Logical Minimum (0)
        0x25, 0x65,       // Logical Maximum (101)
        0x05, 0x07,       // Usage Page (Key codes)
        0x19, 0x00,       // Usage Minimum (0)
        0x29, 0x65,       // Usage Maximum (101)
        0x81, 0x00,       // Input (Data, Array) Key array(6 bytes)

        0x09, 0x05,       // Usage (Vendor Defined)
        0x15, 0x00,       // Logical Minimum (0)
        0x26, 0xFF, 0x00, // Logical Maximum (255)
        0x75, 0x08,       // Report Size (8 bit)
        0x95, 0x02,       // Report Count (2)
        0xB1, 0x02,       // Feature (Data, Variable, Absolute)

        0xC0,             // End Collection (Application)

        //Consumer Control report
        0x05, 0x0C,       // Usage Page (Consumer Devices)
        0x09, 0x01,       // Usage (Consumer Control)
        0xA1, 0x01,       // Collection (Application)
        0x85, 0x02,       // Report ID (2)
        0x15, 0x00,       // Logical Minimum (0)
        0x25, 0x01,       // Logical Maximum (1)
        0x75, 0x01,       // Report Size (1)
        0x95, 0x01,       // Report Count (1)

        0x09, 0xCD,       // Usage (Play/Pause)
        0x81, 0x02,       // Input (Data, Value, Relative, Bit Field)
        0x09, 0xB5,       // Usage (Scan Next Track)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0xB6,       // Usage (Scan Previous Track)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0xE2,       // Usage (Mute)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0xE9,       // Usage (Vol Up)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0xEA,       // Usage (Vol Down)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0x6F,       // Usage (Brightness Up)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)
        0x09, 0x70,       // Usage (Brightness Down)
        0x81, 0x02,       // Input (Data,Value,Relative,Bit Field)

        0xC0
    };&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;And my output report now looks like this:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;    #define OUTPUT_REPORT_INDEX   0
    #define OUTPUT_REP_REF_ID     1&lt;strong&gt;//&amp;lt;----!!! This must match the report id specified in the descriptor&lt;/strong&gt;
    #define OUTPUT_REPORT_MAX_LEN 1

    p_output_report                       = &amp;amp;output_report_array[OUTPUT_REPORT_INDEX];
    p_output_report-&amp;gt;max_len              = OUTPUT_REPORT_MAX_LEN;
    p_output_report-&amp;gt;rep_ref.report_id    = OUTPUT_REP_REF_ID;
    p_output_report-&amp;gt;rep_ref.report_type  = BLE_HIDS_REP_TYPE_OUTPUT;

    p_output_report-&amp;gt;sec.wr               = SEC_JUST_WORKS;
    p_output_report-&amp;gt;sec.rd               = SEC_JUST_WORKS;&lt;/pre&gt;
&lt;p&gt;I have no idea why specifying a report id would cause macOS to act differently but it seems it does.&lt;/p&gt;
&lt;p&gt;I hope this can help anyone who&amp;#39;s having this problem!&lt;/p&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/135719?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 10:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:334d596b-a157-4763-a2c9-82f361ccde7f</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;For anyone still looking into this a solution has not been found&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96404?ContentTypeID=1</link><pubDate>Mon, 11 Sep 2017 12:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17fdf267-e9c5-4f57-9da6-a43003d14a15</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;Hello Again Sigurd,
Thanks for the links, i created a report in the forum &lt;a href="https://forums.developer.apple.com/message/257980#257980"&gt;forums.developer.apple.com/.../257980&lt;/a&gt; however I am not willing to pay 99$ to get code level support :P. I am just leaving the link here for future reference if the issue is ever solved.&lt;/p&gt;
&lt;p&gt;Yiangos&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96403?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2017 13:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42a13486-48a0-4fb5-bc18-561e17199d4a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Maybe create a post &lt;a href="https://forums.developer.apple.com/community/core-os/bluetooth"&gt;here&lt;/a&gt;,
and you can also contact apple direclty on this &lt;a href="https://developer.apple.com/support/technical/"&gt;page&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96405?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 14:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a362e99-a4a5-4c26-ad35-0e502a7fad11</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;bump, Anyone had a look at this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96406?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 21:15:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:652a7e6d-47d3-491b-87ed-1fa11be3b78b</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;Yes same 10.12.6.
Is there any dev way to contact Apple perhaps? Also as a work around, I imagine there is no way to tell that its an apple device that the keyboard has connected to (from the nordic side of thinks)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96402?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 14:55:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99bea79f-038e-406d-a357-41817809a70a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;What version of macOS did you try with? I tested with macOS version 10.12.6 here.&lt;/p&gt;
&lt;p&gt;According to the BLE-HID spec, the mac should have sent a Output report containing the Caps lock state, both when the state changes and when you reconnect/connect. It did some sniffer tests, but did not see any on-air packets for the CAPS-lock state being sent unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96408?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 06:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb73673b-76ed-4bbb-855f-c9d8776c8295</guid><dc:creator>yiancar</dc:creator><description>&lt;p&gt;Thank you for having a look Sigurd.
As you may understand I am trying to develop a bluetooth keyboard. I could just check for when the capslock key is pressed to turn on the led but this wouldnt be in sync with the actual OS. As a worst case scenario maybe somehow I can detect if its connected to mac or windows and act accordingly?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HID get report from a mac not as expected</title><link>https://devzone.nordicsemi.com/thread/96407?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2017 16:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d7c7772-bc85-4e6f-8cbc-9a4d0ccd8cf5</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tested this on a MacBook Air, and I&amp;#39;m seeing the same issue here, the caps-lock state is not reported back to the nRF5x-DK. I also tested this on a Windows 8 laptop, but it worked 100% fine on the Windows laptop. So this is a issue with the Mac. I will look for more information about why the mac behaves this way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>