I am using the c# dlls to create a windows pc app, and I am having trouble figuring out how to programmatically set the security level, and the bonding option. I know how to do this in the CySmart app (Configure master settings -> security parameters -> security level and bonding), but I dont know how to use the api to do this myself. Any help is appreciated.
Thanks for the response, but the example code in the thread shows how to connect to the dongle and peripheral device, and perform read/write/notify operations. It doesn't seem to mention setting local device security.
The API document only mentions its use when setting pair settings, but that is not what I am trying to accomplish:
I am trying to set the Security Parameters to have a security level of NO_SECURITY and set Bonding to false (picture from CySmart configuration master settings):
The CypairSettings() refer to pairing, and a unit is "paired" when it connects to another device. Just use that function to setup the pair settings to NO_SECURITY with the CySecurityLevel setting passed as the parameter for the function.
Page 13 of the PDF I linked shows it.
I am trying to do a OTA firmware update to a device, and that requires the dongle to be disconnected from the device before initiating the update. I was able to do the firmware update successfully, but now the peripheral device requires NO_SECURITY for the update to work (peripheral device firmware changed). I can set the pair settings that are passed into the OTAfirmware update method, but that didn't work. Maybe I am just missing something here, but the only time that it seems to try to use the settings is when they are called by "Pair()"
The "Pair" operation is when the two devices connect to each other, so that would make sense for the settings to be passed into the Pair() function to operate. You should be able to call Pair() with no security to finish the bootload. The callback procedures only fire if the device has higher security set: Passkey entry, display, numeric comparison. You also should be able to determine if the pairing succeeded with the CyBleDeviceCallback.OnPairingCompleted callback method.
I wanted to try this but the device I am working with doesn't support pairing (OnPairingCompleted gets a status of "BLE_ERROR_GAP_AUTH_PAIRING_NOT_SUPPORTED")
Looks like I might need the device to support pairing if this is the only way to do it. Obviously CySmart can do it a different way but I'm guessing that they are using API that is not supported with the current DLLs....
It could be rejecting just the authentication part of the pairing. Try setting the security to unauthenticated pairing with encryption (under the CyPairSettings() function).
Brute force usually works if there are only a couple options But if the peripheral isn't supporting connections at all, then that is a different issue entirely
Best of luck with getting the next step working