Implement in peripheral obligated static PIN for pairing.

12 posts / 0 new
Last post
Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
Implement in peripheral obligated static PIN for pairing.

我使用带有SDK的LBCA2HNZYZ从对话框版本3.0.6使用。基于“Reporter_FH”示例的应用。

我必须在BLE连接时实现引脚功能。
该设备没有显示和键盘。设备是“外设(从属)”。
对于配对需要从“Central(Master)”侧需要静态PIN码。中央是iOS SDK的iPad。
When I try to pairing with the device from Android Phone, I get a pop up window with keyboard to enter pin. Correct pin allows to pairing. iOS connects with the device without any code.
How can I require PIN obligatory?
你能告诉我什么是错的吗?

提前致谢。

设备:
MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

You mean that the iOS completes the pairing without asking you the PIN and before entering the number you can see the services and the characteristics? can you write them? If your characteristics dont have authorization then nobody forces the host to require pairing in order to read them. Also bare in mind that service discovery isn't part of the security. Meaning that the host is able to see the supported services and characteristics without require authentication, all the services and characteristcis are available during the service discovery (not their values). If you want the host not to be able to see your services you can enable them after a successful pairing/bonding to the peripheral. Now i suppose that seeing the services/characteristics on iphone and not seeing them on android its a matter of UI.

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
你好。我不是很大的专家

你好。我不是很大的专家in Bluetooth Low Energy protocol, so may be somebody can help me with few questions:

1.是否有能力在每次连接到同一设备时每次询问PIN码?
2. What are definitions I need to do for obligatory asking pin code when pairing with the device?
3.是否需要使用授权或识别进行授权或识别进行接近的配置文件
4. In connect establishment process, the function app_send_pairing_rsp_func() doesn't called. How can I obligate the central to ask the connection parameters?
在项目中定义的项目中:app_sec_env.auth =(gap_auth_req_mitm_bond);

谢谢!

MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
嗨Vadym,

嗨Vadym,

In BLE when a device is paired when disconnected doesn't go through the pairing procedure again, if the host was previously connected to the device it will require to validate the keys that are exchanged during the pairing procedure. So if your device is properly paired the only way a pairing procedure to be repeated is to be unpaired. You have to set your service or the specific characteristics to require authorization in order the host to be able to read and write the characteristics only after the pairing sequence, the host will be able to see the services and the characteristics but he wont be able to read them or write to them before pairing. Your host have to issue a pairing request command when he sees that the characteristics need authorization in order to be read.

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
你好。

你好。

If I understand right, I need to define the connection security option in function:
void app_send_pairing_rsp_func(struct gapc_bond_req_ind *param)
并且还设置服务或特定的特性以要求授权。
当我尝试从iPad连接时,我不会输入“app_send_pairing_rsp_func”函数。显然,iPad已经配对设备。
在我们的申请中,现在没有选择unapairing。
What API for Core BLE (iOS) we need to use for unpairing the device and clear the validations keys?
I see the device in " Bluetooth devices" (Settings->Bluetooth) but I can't to do anything.

谢谢。

MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

During connection establishment do you invoke the app_security_start() in the app_connection_func? You can find the the implementation of the function and an example of the pairing procedure in the SmartTag reference design. To complete the pairing procedure without invoking the app_send_pairing respose_func is a bit weird.

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
你好。

你好。

Thanks for all answers! It really helpful!
现在我有下一个情况。
When the device connects with central first time, the request pin code popup window appears on iPAD. And first time it connects properly.
After the Central disconnection from the Device (not forget bonding), it can't connect again. IPAD give a message "Connection Alert. The peripheral disconnected while being interrogated”. I try to use function from SmartTag reference design:
void app_store_bond_data( void );
空白app_clear_bond_data( void );
int app_check_bond_data( struct rand_nb *rand_nb, uint16_t ediv );
void app_load_bond_data( void );

This hasn't improved the situation.
Can anybody give me a tip for this?
谢谢!

MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

When a device is paired is doesn't go through the pairing procedure again, the host has to send and ecryption request in order to establish a secure link with peer device. In smarttag when your device is bonded and goes through the pairing procedure again will find data in the flash and will reject the connection.

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
嗨亲爱的支持。

嗨亲爱的支持。

我正在尝试使用智能标签的示例,但没有这么成功......

当iOS尝试在绑定后连接并断开连接到Gapc_encrypt_req_ind_handler()函数并调用到app_connect_confirm()。进入app_send_pairing_rsp_func()后。如果我理解它,它不应该发生。
之后,设备断开连接。

With Android it connects right after bonding and when android central forgets bond information, the device rejects the connection.
1. What is defined wrong for IOS?
2.评估板的示例是我可以看到相同的情况,当我想用​​静态引脚码(用显示器定义的设备)连接外围设备时。

谢谢!

MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

在智能标签中,当设备对iOS与IOS断开连接时,IOS应再次连接,因为它们是绑定的。在您的情况下,在重新连接时,设备再次发送配对请求,并且设备命令外围设备再次通过配对过程?(yep这不应该发生,因为设备绑定,请检查设备是否在Android手机中的“设置”选项卡中绑定。在iOS和Android中运行没有特殊定义。智能标记应在Android和iOS上工作,而无需任何修改。

Thanks MT_dialog

Vadym
Offline
Last seen:1 year 6 days ago
加入:2015-08-13 08:28
你好。

你好。

It starts to work.
问题与iOS 7有关。它使用iOS 9它正常工作。

Does anybody know if I can use hard coded ALPHANUMERIC PIN code that more than 6 digits?

谢谢。

MT_dialog
Offline
Last seen:4天20小时前
工作人员
加入:2015-06-08 11:34
Hi Vadym,

Hi Vadym,

我认为PIN码是按蓝牙规范(从000000到99999)的6位数。

Thanks MT_dialog