You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android IVI与三星Galaxy M32重复配对失败求助

蓝牙配对故障:Android IVI单元与三星Galaxy M32首次配对成功,后续配对失败

多次尝试对基于Android的IVI单元与三星Galaxy M32执行配对/取消配对操作,首次流程可正常完成,但后续所有配对尝试均失败。测试用例由Python编写,核心配对/取消配对功能通过调用Java实现的RPC完成。

操作流程

初始化步骤

  • 调用preconditions()开启IVI单元(代码中用self.target指代)与手机的蓝牙功能
    前置条件代码

配对函数执行步骤

  1. 调用unPairAllPairedDevices()逐个取消所有已配对设备的配对
    取消所有配对代码
  2. 通过MAC地址获取远程设备ID:
    self.target.gbs.btGetRemoteDevice(macAddress)
    
  3. 创建IVI单元与手机的绑定关系,返回布尔值表示操作结果:
    self.target.gbs.btCreateBond()
    
  4. 手动点击Galaxy M32上弹出的配对确认弹窗
    配对弹窗
  5. 设置配对确认,返回布尔值表示操作结果:
    self.target.gbs.btSetPairingConfirmation(True)
    
  6. 获取已配对设备信息:
    Paired_info = self.target.gbs.btGetPairedDevices()
    

取消配对函数实现

def unPairDevice(self,macAddress):
        self.target.gbs.btGetRemoteDevice(macAddress)
        self.target.gbs.btRemoveBond()
        sleep(5)
        Paired_info = self.target.gbs.btGetPairedDevices()
        logging.info(f"btGetPairedDevices {Paired_info}")
        # getting length of list
        length = len(Paired_info)
        logging.info(f"length>>>>>> {length}")
        if length != 0 :
            # Iterating paired device list
            for i in range(length):
                if Paired_info[i]['Address'] == macAddress:
                    logging.info(f"Device still exists in list {Paired_info[i]['Name']}")
        else :
            logging.info(f"Device is unpaired successfully {macAddress}")

该函数通过MAC地址定位目标设备,调用RemoveBond方法解除绑定,随后校验已配对设备列表确认操作结果。

首次配对与取消配对流程完全正常,但从第二次尝试开始,配对操作无法完成,寻求技术解决方案。

内容的提问来源于stack exchange,提问作者Vishwanath R Kulkarni

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 09:35:14