How to specify your own user passkey

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

cross mob
hinu_4327176
Level 3
Level 3

Hello

How do I specify my own user passkey?
Is there a sample of how to use it?

The development environment is as follows.
  CYW43438 & WICED-Studio-6.4

0 Likes
1 Solution

Hello,

No, there is no option in WICED to use custom/fixed passkey other than stack creates.

One option is as below:

If you have the control to set a fixed passkey on your Central side, whose IO capability is set to Display only.

In that case, on  CYW43438 (peripheral) you can keep IO capability as keyboard and instead of entering the passkey manually , you can use API wiced_bt_dev_pass_key_req_reply and send the known passkey as reply. This will work.

But you may have to check on your peer (Central) applications if this option of providing a fixed passkey is available or not.

Regards,

Anjana

View solution in original post

8 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hello,

Can you please confirm in this Customer scenario , both Peripheral & Central is CYW43438 ?

Note :

When the IO capability is Display , the stack generates passkey. There is no option to set it in the application.

When the IO capability is Keyboard, you can send the required passkey using API  wiced_bt_dev_pass_key_req_reply(WICED_BT_SUCCESS, remote_addr ,passkey);

Regards,

Anjana

0 Likes

It is used in the following environment.
  Peripheral : CYW43438
  Central    : Windows10 & nRF Connect

I have sent a passkey using the API wiced_bt_dev_pass_key_req_reply (), but I cannot connect.
Are there any problems with the following usages?

  ・Specify (local_io_cap = BTM_IO_CAPABILITIES_KEYBOARD_ONLY)
  ・Send a passkey with (event: BTM_PASSKEY_REQUEST_EVT)
      wiced_bt_dev_pass_key_req_reply(WICED_BT_SUCCESS, event_data->user_passkey_request->bd_addr, 12);

0 Likes

Hi

No , there is no problem for keeping BTM_IO_CAPABILITIES_KEYBOARD_ONLY and sending the passkey directly with API wiced_bt_dev_pass_key_req_reply . But you should make sure the same passkey is generated and used on the peer side.

In the previous response , you are passing 12 as passkey . Please make sure you are passing a valid passkey of 6 digits  and try again.

Regards,

Anjana

0 Likes

I confirmed 123456 as a passkey, but could not connect.
Link key exchange did not start after the event (BTM_PASSKEY_REQUEST_EVT) was issued.

The peer also specifies (KEYBOARD_ONLY) and enters the passkey (123456).

Is there a way to make sure the same passkey is generated?

0 Likes

Hi,

For passkey pairing , both Central and Peripheral should not be in same IO capability of Keyboard only.

One side it should be Keyboard and the other side it should be display. Then only it will work.

So only the display side, the passkey should be generated by the BT stack and the same key should be entered on the peer side using Keyboard. You can also skip entering the key using keyboard and send the API wiced_bt_dev_pass_key_req_reply directly. But the scenario should be as explained above.

If this can't be done, then you may have to choose some other pairing mechanism depending upon your device IO capabilities.

Hope you understood. Please let me know if you need any clarification.

Regards,

Anjana

0 Likes

Hello

I'm sorry I don't understand the BT specifications and ask unknown questions.

Is there a way to use my own passkey without using the passkey generated by BT stack?

0 Likes

Hello,

No, there is no option in WICED to use custom/fixed passkey other than stack creates.

One option is as below:

If you have the control to set a fixed passkey on your Central side, whose IO capability is set to Display only.

In that case, on  CYW43438 (peripheral) you can keep IO capability as keyboard and instead of entering the passkey manually , you can use API wiced_bt_dev_pass_key_req_reply and send the known passkey as reply. This will work.

But you may have to check on your peer (Central) applications if this option of providing a fixed passkey is available or not.

Regards,

Anjana

Hello

I will consider it based on the content you answered.

Thank you very much.

0 Likes