title: how to send data to hid device when the screen is locked
body: <p>I'm trying to make a screen share program and the data will be send to the TV through a hid deivce. I found that when my MacBook is locked, the TV cannot get the screen data. And my program will send an ERROR:kIOReturnNotPermitted(0xe00002e2). And when I reopen the Mac, it will send successfully.</p>
  <pre><code>IOHIDDeviceSetReport( device, kIOHIDReportTypeOutput, 0, buffer, 256);
  </code></pre>
  <p>I also tried <code>IOHIDDeviceSetReportWithCallback</code> but it also failed.</p>
  <p>Can anybody tell me how to send data from Mac to hid device when the Mac's screen is locked?</p>
  <p>this is the output:</p>
  <pre><code>2021-01-07 11:26:08.928251+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:09.933178+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:10.936634+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:11.939906+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:12.945052+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:13.945823+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:14.949406+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:15.952339+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:16.957833+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:17.960691+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:18.968031+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:19.977719+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:20.982127+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:21.992468+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:22.997566+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:24.000317+0800 hidapi[60570:2874002] send fail!!! (e00002e2).
  2021-01-07 11:26:25.002548+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:26.006473+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:27.011613+0800 hidapi[60570:2874002] send success (0)
  2021-01-07 11:26:28.013098+0800 hidapi[60570:2874002] send success (0)
  </code></pre>