How to connect virtual peripheral in mobile

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

cross mob
YaTr_3516311
Level 5
Level 5
25 sign-ins First solution authored 100 replies posted

Hi,

I want to test one central to connect many peripherals function. So I use device A(Hello_client) to do the testing. Device B(Hello_sensor) is OK for the connection. And I use APP in my mobile to simulate the pheripheral(C). A can search it. But when connect to it. It fails.  And I tried with other mobile to simulate central to connect to C, it is OK.  I think it maybe the keys is the problem cause. But I don't know how to fix this problem in Hello_client code. Can you help me?

Below is the failure for A to connect to C.

pastedImage_0.png

0 Likes
4 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

Hello_client demo can only connect with peripheral with hello_sensor service UUID. You may need more kits with hello_sensor demo.

0 Likes

I have modified the hello_client demo. Call wiced_bt_gatt_le_connect function by manual when scanned the outside device.

pastedImage_0.png

I don't have other EVAL boards. I have to use APP in mobile to simulate. But the "Key retrieval failure" happen. I need to know how to modify code to test the connection function and transfer data function.

0 Likes

The key retrieval failure will only happen with the device which has paired before. When the client and the peripheral paire and bond, it will store the link key to the NVRAM. When they connect again, there will be a key request event. If the cllient doesn't have the key, the key retrieval failure will happen.

Could you check if the client is in your paired device list of the phone. Please unpaired it and test again.

BTW, you'd better use the kit to test the function because the simulate APP on your phone may not use the standard spec and may have some problems.

How about "LightBlue" APP?

0 Likes