- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can connect to the device and start the .pair process. I'm just having trouble getting to a point to input the passkey. Any examples would be great. Thank you
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Tim,
The description of BLE_ERROR_GAP_AUTH_PASSKEY_ENTRY_FAILED is "User input of passkey failed, for example, the user cancelled the operation"
This error code may occur when the peer device sends a security request to Mobile App for initiating the pairing procedure and if the peer device sends a security request ( Basically, calling CyBle_AuthReq() API ), first we need to accept the security request and then only pairing procedure will start.
In this case first you might need to update the enum CyPairingResponseCode to ACCEPT to start the pairing procedure. Please try it.
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please go through the example linked below which implements bonding using passkey entry.
Thanks,
Sayani.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not exactly what I'm looking for, I'm trying to bond to a device using the Cysmart Dongle API in C# to enter a passkey and bond to the device. I've gone through the reference guide and able to connect to the device, but I'm struggling to progress from there to enter the passkey to bond to the device. Any examples of that on the Cysmart API side would be greatly appreciated. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Are u using the CyPairSettings() API and setting the parameters to their appropriate values. Depending on the IO capabilities and the MITM, the bonding process will be done. Please check these parameters in your code.
Thanks,
Sayani.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I am using CyPairSettings, I am trying to get the Passkey function to work, since the device requires a passkey to bond to the device. Looking for possibly some example code on that process since the API reference guide isn't very clear on how that function is supposed to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
For the passkey pairing procedure , you need to set the security level as AUTHENTICATED_PAIRING_WITH_ENCRYPTION. If you want the devices to be bond you also need to 'set' the bonding flag.
With above said , the API will look like below.
CyPairSettings(CySecurityLevel.AUTHENTICATED_PAIRING_WITH_ENCRYPTION, true, 16, CyPairingProperties.None);
Also, you need appropriate IO capabilities to be be set to perform the passkey pairing procedure. If the peer device has display capability (to display the passkey) , you should have keyboard capability to enter the passkey.
You can set/get your device IO capability by using the c# API SetDeviceIoCapabilities (CyBleDeviceIoCapabilities ioCapability) /GetDeviceIoCapabilities (CyBleDeviceIoCapabilities ioCapability) respectively. ( Handle the callback function)
The bonding flag should be 'set' in both of the BLE devices ( central and peripheral ) to store the bonding data.
We do not have any sample examples to demonstrate all of the concepts but a simple example project with few features can be found from below link.
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's been helpful, as I've made some progress now I'm getting from the "OnPairingCompleted" BLE_ERROR_GAP_AUTH_INSUFFICIENT_ENCRYPTION_KEY_SIZE. Any idea's on what I could be doing wrong here? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So it looks like I've made quite a bit of progress into bonding, the question I have now is I'm getting a response.Response = REJECT for my passkey. I am currently doing this.
public override void OnPasskeyEntryRequest(CyPasskeyEntryResponse response)
{
response.Passkey = 000000;
base.OnPasskeyEntryRequest(response);
}
Is there something else I am missing or doing incorrectly?
gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Tim Krous,
Can you get the error code for passkey REJECT ? All the error code definitions are given in the CySmart API reference guide (http://www.cypress.com/file/232791/download ) ?
Also , which peer peripheral device are you using to connect with your App ? Could you share the peripheral project to confirm if the security settings are configured well in your project?
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting an error for the passkey reject, the Cystatus comes back as BLE_OK. I have verified that it works in the Cysmart Windows Application and successfully bonds after it prompts for the passcode. Is there another call or callback I need to handle after the ONPasskeyEntryRequest?
gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So I solved one issue that I was having, it looks like you have to call the SendPassKey inside that OnpasskeyEntryResponse in which i posted above. No i'm getting the CyStatus error BLE_ERROR_GAP_AUTH_PASSKEY_ENTRY_FAILED.
Any idea's on my next step? Is there another callback that I need to handle or something else i need to send out? Thanks
gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Tim,
The description of BLE_ERROR_GAP_AUTH_PASSKEY_ENTRY_FAILED is "User input of passkey failed, for example, the user cancelled the operation"
This error code may occur when the peer device sends a security request to Mobile App for initiating the pairing procedure and if the peer device sends a security request ( Basically, calling CyBle_AuthReq() API ), first we need to accept the security request and then only pairing procedure will start.
In this case first you might need to update the enum CyPairingResponseCode to ACCEPT to start the pairing procedure. Please try it.
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
setting the passkey.passkey and passkey.Cypariing Response code = Accept worked and allowed me to bond to the device. Thank you.
gyan