We want to turn NumericComparison off. We don’t need it, and JustWorks encryption would be just fine, so long as it bonded and paired with the phone all the same. Trying to turn it off. Can’t seem to get anything working except NumComp turned on.
/**
* @brief Configuration to enable numeric comparison for authentication.
*
* If the configuration is set to 0 and #IOT_BLE_ENABLE_SECURE_CONNECTION is set to 1, then
* device will use just works pairing.
*/
#ifndef IOT_BLE_ENABLE_NUMERIC_COMPARISON
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON ( 0 )
#endif
Using the the latest 202012.00 release, but also at least 202011… Turning off NumericComparison for BLE connection and asking for “Just Works” encryption instead does not work.
The phone will show this with NumbericComparison turned off, it still looks like it’s trying to numerically compare to me:
The code that asserts is this, because the transferControl never sees a “1” published to open the channel.
if( status != MQTTSuccess )
{
LogError( ( "There was a problem initializing the data channel" ) );
configASSERT( false );
If this code wasn’t here, eventually this will be sent to the console from nordic/…/ports/ble/iot_ble_hal_common_gap.c
18 38687 [BLE] [ERROR][BLE_HAL][38687] Failed to secure connection. Disconnecting.
This is getting more into the Nordic side of things.
Likewise, as I understand it, JustWorks encryption for the Nordic requires in the same common_gap.c file, this is being called as I think it should when the phone is about to be asked to pair.
case BLE_GAP_EVT_LESC_DHKEY_REQUEST:
nrf_ble_lesc_request_handler();
break;
So… SO FAR AS I CAN TELL… Most things seem to be on the right path. But something is wrong. Our device does not have output so NumComp is not for us, and even in development I’d rather turn it off.
We have tested this on a Galaxy S7 (didn’t still show pair, but same error eventually) and an iPhone 11, same issue.