Based on nRF52 hardware,I want to develop a phone based on HID protocol to control the phone, send instructions to let the phone into the lock screen state,
How to go about the development, is it a basic source project?
Based on nRF52 hardware,I want to develop a phone based on HID protocol to control the phone, send instructions to let the phone into the lock screen state,
How to go about the development, is it a basic source project?
Hi Torbjørn
I'm sorry, because I am busy with the production problem of another project, I am ready to carry out this project now. Do you have any update on this problem? I need your help
Best regards
alan
Hi Alan
Now I feel a bit stupid. After looking at this again I realized you only have to make a very small change to the ble_app_hids_keyboard example in order to support this command.
The keyboard power command is treated like any other keypress, which means you can send it in the same way that you send any other keys.
All you have to change to support this is to change the Logical Maximum and the Usage Maximum of the key codes from 0x65 to 0x66:

Once I made this change I updated the sample message to send the keyboard power command after typing "hello", instead of sending a newline:
static uint8_t m_sample_key_press_scan_str[] = /**< Key pattern to be sent when the key press button has been pushed. */
{
0x0b, /* Key h */
0x08, /* Key e */
0x0f, /* Key l */
0x0f, /* Key l */
0x12, /* Key o */
0x66 /* Keyboard power */
};
Now if you press Button 1 on the DK it should first type out hello, and then it should put the phone to sleep.
I have added the full project here for your reference:
270484_ble_app_hids_keyboard.zip
Best regards
Torbjørn
Hi Torbjørn
Thank you very much. I'll try
Best regards
alan
Hi Torbjørn
I have tested that for ios, it can only be turned on, but it has no effect when it is turned off.
Is the key value useless?
Best regards
alan
Hi
Are you saying that if the phone is on and you press the button it will not turn off?
This is what I tested, but I only tested it on an Android device, not on an iPhone.
Anyway, it is possible that the iPhone ignores this key. It is up to Apple to decide how they should handle these keys.
Best regards
Torbjørn