How to enter HIDOFF? How to detect if the request is not honored?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ShawnA_01
Employee
Employee
10 questions asked 5 comments on KBA First comment on KBA

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:


void application_abort_hidoff_cb(void)

{

// hid-off aborted.

ble_trace0(“hid-off aborted”);   // print a message or toggle a GPIO


// Call the profile level function

bleprofile_abortHidoff();

}

void application_create(void)

{

bleprofile_regAppEvtHandler(BLECM_APP_EVT_ABORTING_HIDOFF,(BLECM_NO_PARAM_FUNC)application_abort_hidoff_cb);

}

0 Replies