If your application is considering the use of bleprofile_PrepareHidOff() to enter deep-sleep (HIDOFF) mode, there are some considerations you should be aware of, or the request may fail.
For example, make sure there are no outstanding (un-cleared) GPIO interrupts pending, or in the middle of being processed.
Note: GPIO:P0 should be pulled high (via 10k), or the key-scan feature of the device may think a key on a keyboard is pressed and it will stay awake to perform further scanning.
You may also want to consider registering for a call-back in the event your request is denied, as follows:
// hid-off aborted.
ble_trace0(“hid-off aborted”); // print a message or toggle a GPIO
// Call the profile level function