The embodiment of the present application discloses a Bluetooth connection method and device. The Bluetooth slave device establishes a Bluetooth connection with the Bluetooth master device in response to a connection request sent by the Bluetooth master device, and determines whether or not it receives the confirmation connection information sent by the Bluetooth master device in accordance with the preset conditions within a preset period of time, and if not, disconnects the bluetooth. The teeth are connected. This method can judge whether the Bluetooth slave device receives the confirmation connection information which meets the preset conditions in the preset time interval after the Bluetooth slave device establishes the Bluetooth connection with the Bluetooth master device. If the confirmation connection information is not received or the received confirmation connection information does not meet the preset conditions, the Bluetooth master device is not required by the Bluetooth slave device. To connect the target master device, the Bluetooth connection can be disconnected so that the Bluetooth slave device can continue to broadcast, and then connect with the target master device which needs to establish a connection with it, thus reducing the interference of non-target master device to the Bluetooth connection and improving the success rate of Bluetooth connection with the Bluetooth master device.
【技术实现步骤摘要】
一种蓝牙连接方法及装置
本申请涉及通信领域,尤其涉及一种蓝牙连接方法及装置。
技术介绍
蓝牙(Bluetooth)是一种无线技术标准,可实现固定设备、移动设备和个人域网之间的短距离数据交换,将具有蓝牙功能的设备统称为蓝牙设备。随着蓝牙技术的发展和电子设备的普及,出现了越来越多的蓝牙设备,蓝牙设备间的通信丰富了人们的生活,例如蓝牙手环、蓝牙耳机、蓝牙音箱、蓝牙智能密码钥匙等可作为蓝牙从设备,通过与具有蓝牙功能的手机等蓝牙主设备智能连接来实现多种功能,例如可进行手机中的电话、短信、邮件、照片的同步,或者,与手机进行数据交互完成加密云端、数据提取等。现有的蓝牙从设备与蓝牙主设备建立连接时,通常会向外发送广播,该广播中包含该蓝牙从设备的唯一标识,蓝牙主设备通过搜索附近的正在广播的蓝牙从设备,对搜索到的蓝牙从设备发起连接请求,建立与蓝牙从设备之间的蓝牙连接。但是在实际应用中,蓝牙从设备可能被其他蓝牙主设备搜索到并建立连接,此时该蓝牙从设备将不再向外发送广播,需要与蓝牙从设备建立蓝牙连接的目标主设备搜索不到该蓝牙从设备的唯一标识,不能与其建立蓝牙连接,导致蓝牙连接的抗干扰性差,蓝牙从设备与目标主设备建立蓝牙连接的成功率较低,影响蓝牙设备的使用。
技术实现思路
为了解决现有技术的蓝牙连接方法的抗干扰性差、成功率较低的问题,本申请实施例提供了一种蓝牙连接方法及装置。本申请实施例提供的蓝牙连接方法,适用于蓝牙从设备,该方法包括:响应于蓝牙主设备发送的连接请求,与所述蓝牙主设备建立蓝牙连接;判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,若否,断开所述 ...
【技术保护点】
1.一种蓝牙连接方法,其特征在于,适用于蓝牙从设备,所述方法包括:响应于蓝牙主设备发送的连接请求,与所述蓝牙主设备建立蓝牙连接;判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,若否,断开所述蓝牙连接。
【技术特征摘要】
1.一种蓝牙连接方法,其特征在于,适用于蓝牙从设备,所述方法包括:响应于蓝牙主设备发送的连接请求,与所述蓝牙主设备建立蓝牙连接;判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,若否,断开所述蓝牙连接。2.根据权利要求1所述的方法,其特征在于,所述确认连接信息包括加密信息,所述判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,包括:判断在预设时间段内,是否获取到所述蓝牙主设备发送的所述加密信息;若是,对所述加密信息进行解密,判断是否解密成功。3.根据权利要求2所述的方法,其特征在于,所述加密信息包括加密的连接类型标识,所述判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,还包括:若判断解密成功,判断解密后的连接类型标识与预设连接类型标识是否匹配。4.根据权利要求1所述的方法,其特征在于,所述确认连接信息包括连接类型标识,所述判断在预设时间段内是否获取到所述蓝牙主设备发送的符合预设条件的确认连接信息,包括:判断在预设时间段内,是否获取到所述蓝牙主设备发送的所述连接类型标识;若是,判断所述连接类型标识与预设连接类型标识是否匹配。5.根据权利要求3或4所述的方法,其特征在于,所述连接类型标识包括长连接标识或短连接标识,所述长连接标识用于与所述蓝牙从设备建立蓝牙长连接,所述短连接标识用于与所述蓝牙从设备建立蓝牙短连接。6.一种蓝牙连接装...
【专利技术属性】
技术研发人员:郭军,徐翔,
申请(专利权)人:北京华大智宝电子系统有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。