完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我在BLE设备上实现了认证过程,它将与Android 7.1.1手机和其他启用BLE的设备(如笔记本电脑、iPad等)配对。下面是配置信息:
安全模式/级别:模式1认证与加密配对 I/O功能:显示 键合要求:键合/启用 下面是我如何处理配对过程和生成什么事件: 1。当生成CyByLyEvtGAPXDEVICEX连接时,使用API CyByLeGAPAuthReq()发送认证请求,这意味着对等设备(主设备)发起配对。 2。当堆栈接收到CyByLyEvtGAPPASKEKIODISPLAGION请求时,在UART终端中显示密钥。 三。对等设备中的密钥 4。cyble_evt_gap_auth_complete生成显示认证成功 5。调用API cyble_storebondingdata()防止通过配对过程 然而,当我的问题在当前连接的设备cyble_gapdisconnect(),说Android手机,允许其他主设备与BLE对,我观察到的是“配对设备”的电话列表中删除。这可以防止BLE从连接到Android手机。然而,这个问题不用笔记本电脑和iPad,我搭配的发生。 有人知道为什么会这样吗? 以上来自于百度翻译 以下为原文 I implemented the authentication process on BLE device that will pair with an Android 7.1.1 phone and other BLE-enabled devices (eg. laptop, ipad, etc). Below is the configuration info: Security mode/level: Mode 1 authenticated pairing with encryption I/O capabilities: Display Bonding requirement: Bonding/enabled Here's how I handled the pairing process and what events are generated: 1. send authentication request using API CyBle_GapAuthReq() when the CYBLE_EVT_GAP_DEVICE_CONNECTED is generated, which means that peer device (master) initiated pairing. 2. display passkey in UART terminal when CYBLE_EVT_GAP_PASSKEY_DISPLAY_REQUEST is received by the stack. 3. key-in the passkey in the peer device 4. CYBLE_EVT_GAP_AUTH_COMPLETE is generated indicating authentication is successful 5. call API CyBle_StoreBondingData() to prevent going through the pairing process again However, when I issue a CyBle_GapDisconnect() on the currently connected device, say the Android phone, to allow other master devices to pair with the BLE, I observed that the BLE is removed from the list of "paired devices" of the phone. This prevents the BLE from reconnecting to the Android phone. However, this issue does not occur with the laptop and ipad that I paired with the BLE. Does anyone know why this happens? |
|
相关推荐
7个回答
|
|
看起来这个问题是蓝牙V5.0。你能告诉我更多关于你的手机和蓝牙版本。另外,请检查手机与蓝牙版左右。让我知道你的观察结果。
当做, 德黑拉杰 以上来自于百度翻译 以下为原文 Looks like this issue is with Bluetooth v5.0. Can you tell me more about your phone and the Bluetooth version. Also, try checking on phones with Bluetooth v4.2 or so. Let me know your observations. Regards, Dheeraj |
|
|
|
twtetrwerw 发表于 2018-8-20 02:39 嗨,DDKA。我不使用蓝牙V5.0。CyPress芯片I使用的是蓝牙V4.2,我提到的手机是Android V7.1.1,我相信它具有蓝牙V4.0或其他东西,但肯定与BLE一起工作。 以上来自于百度翻译 以下为原文 Hi ddka. I am not working with Bluetooth v5.0. The Cypress ble chip I was using has Bluetooth v4.2 and the phone I mentioned is Android v7.1.1, which I believe has Bluetooth v4.0 or something but surely works with BLE. |
|
|
|
testd00111 发表于 2018-8-20 02:48 我们试图在不同的手机上重现你的问题。我们用蓝牙V5不能存放键信息观察,大多数手机。其他手机蓝牙版及以下,其中大部分的工作完美。这看起来像是Android的bug。你可以使用一个小的延迟为下面所提到的作为一种解决方法: F((CyLyPyPyfLoFrand)!= 0u)&;&;((uart_spiuartgettxbuffersize() + uart_get_tx_fifo_sr_valid)= = 0u)) { / /存储连接信息的闪光 apiresult = cyble_storebondingdata(0U); 如果(apiresult = = cyble_error_ok) { CyDelay(500);(或)增加一些延迟 printf(“连接数据存储rn”); } 其他的 { printf(“连接数据存储待rn”); } } 让我知道这为你工作。 当做, 德黑拉杰 以上来自于百度翻译 以下为原文 We tried to reproduce your issue on different phones. And we observed that most phones with bluetooth v5 aren't able to store the bonding information. Other phones with bluetooth v4.2 and below, most of them worked perfectly. So this looks like some Android bug. You could use a small delay as mentioned below as a workaround: f((cyBle_pendingFlashWrite != 0u) && ((UART_SpiUartGetTxBufferSize() + UART_GET_TX_FIFO_SR_VALID) == 0u)) { // Store Bonding informtation to flash apiResult = CyBle_StoreBondingData(0u); if ( apiResult == CYBLE_ERROR_OK) { CyDelay(500); //Add some delay printf("Bonding data storedrn"); } else { printf ("Bonding data storing pendingrn"); } } Let me know if this worked for you. Regards, Dheeraj |
|
|
|
twtetrwerw 发表于 2018-8-20 02:54 你好,DDKA。谢谢。我按照你的建议添加了延迟,但不幸的是,Android手机(OSv7.1.1)也发生了同样的事情。 这里有更多关于代码中的内容和测试过程中发生什么的信息: 1。BLE成功地与2个设备(膝上型和Android手机)配对后,输入正确的密钥。 2。BLE被配置为以HID作为应用的间隙外围设备,并且它需要能够在主设备之间交换连接。 三。在开断开一段代码表: 卡片bdhandle_toconnect;//即laptop_bdhandle = 4,phone_bdhandle = 3 案例cyble_evt_gatt_connect_ind: 如果(BDANDELYA toCONTION!= CyByLyCal句柄.bD句柄){ CyBLY-GAPDISCONTION(); 聚伞花序; } 断裂; 4。说的是当前连接的Android手机,我想连接到笔记本电脑,可自动连接到任何特定的设备,然后的问题gapdisconnect如果是错误的装置。这连续发生在一个循环直到它连接到正确的设备。 在第一个实例,可断开与Android手机,我观察到,它消除了BLE从配对设备列表。在这一点上,可将成功地连接到笔记本电脑。然而,BLE可以不再连接到Android手机。 5。关闭然后在Android手机蓝牙返回到其配对设备列表的表。然后,可将能够连接到它,但HID功能的稳定不再发生。 以上来自于百度翻译 以下为原文 Hi ddka .Thanks. I added the delay as you suggested, but unfortunately, the same thing happens with the Android phone (OS v7.1.1). Here's more information on what's in the code and what happens during testing: 1. BLE successfully paired with 2 devices (laptop and Android phone) after entering the correct passkey. 2. The BLE is configured as a GAP Peripheral with HID as application, and it needs to be able to swap connection between master devices. 3. A code snippet on BLE issuing a disconnect: uint8 bdHandle_toConnect; //ie. laptop_bdHandle=4, phone_bdHandle=3 case CYBLE_EVT_GATT_CONNECT_IND: if (bdHandle_toConnect!=cyBle_connHandle.bdHandle) { CyBle_GapDisconnect(); CyBle_ProcessEvents(); } break; 4. Say BLE is currently connected with the Android phone and I wanted to connect to the laptop, BLE automatically connects to no specific device, then BLE issues GapDisconnect if it's the wrong device. This continuously happens in a cycle until it connects to the correct device. At the first instance that BLE disconnects with the Android phone, I observed that it removes the BLE from its list of paired devices. At that point, BLE will successully connect to the laptop. However, the BLE can no longer connect back to the Android phone. 5. Turning OFF then ON the bluetooth of the Android phone returns the BLE to its list of paired devices. Then, BLE will be able to connect back to it, but the HID functionality of the BLE no longer happens. |
|
|
|
testd00111 发表于 2018-8-20 03:11 你要记录的事件,然后分享它,这样我可以了解导致问题的事件序列是可能的吗? 当做, 德黑拉杰 以上来自于百度翻译 以下为原文 Is it possible for you to log the events and then share it so that I can understand the sequence of events leading to the issue? Regards, Dheeraj |
|
|
|
这是原木,DDKA。事件经过是六eventparam的值,我也加了一些评论。 事件日志 1.4 K 以上来自于百度翻译 以下为原文 Here are the logs, ddka. The values after the events are eventParam values in HEX, and I've also added some comments.
|
|
|
|
这可能是因为中央装置不能够解决客户。你可以尝试添加添加设备来解决一些代码列表。我有下面的一个项目,演示如何编写代码。你可以找到关于如何解决器件工作在15页的链路层下隐私的更多信息(链接:http://www.cypress.com/file/224826/download 请把这些代码行,让我知道如果有任何进展。 当做, 德黑拉杰 外围解决方案 732.5 K 以上来自于百度翻译 以下为原文 It may be because the central device isn't able to resolve the client. Can you try adding some lines of code for adding devices to a resolving list. I have attached a project below which shows how you can write the code. You can find more information about how resolving a device works in page 15 under Link Layer Privacy (Link: http://www.cypress.com/file/224826/download Kindly add these lines of code and let me know if there is any progress. Regards, Dheeraj |
|
|
|
只有小组成员才能发言,加入小组>>
750个成员聚集在这个小组
加入小组2055 浏览 1 评论
1811 浏览 1 评论
3622 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1747 浏览 6 评论
1499 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
484浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
339浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
401浏览 2评论
343浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
836浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-10 14:50 , Processed in 0.847030 second(s), Total 57, Slave 51 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号