第一部分:HCI协议(八)具体的HCI command和event(9、SYNCHRONOUS CONNECTIONS 二)

(6)Read Voice Setting Command

这个命令用来获取Voice_Setting的值

返回参数说明:

Status(1 Octet):0x00表示success;0x01-0xFF表示失败

Voice_Setting(2 Octet):语音连接的相关配置,用来配置Input Coding, Air coding format, input data format, Input sample size, and linear PCM parameter

举例说明:(暂时没有)

(7)Write Voice Setting Command

参数说明:

Voice_Setting(2 Octet):语音连接的相关配置,用来配置Input Coding, Air coding format, input data format, Input sample size, and linear PCM parameter

返回参数说明:

Status(1 Octet):0x00表示success;0x01-0xFF表示失败

举例说明:

Command如下:

0x01:表示HCI Command Packet

0x0426:表示是HCI_Write_Voice_Setting command

指令的OGF是0x01即0000 01

OCF是0x0026即00 0010 0110

所以整个opcode是0000 0100 0010 0110即0x0426

0x02:表示Parameter_Total_Length=2,即参数总长度是2个byte

0x0003:表示Connection_Handle,这个Connection_Handle是一个ACL连接

0x0060:表示Voice_Setting=0000 0000 0110 0000,即Air Coding Format:CVSD、Input Sample Size: 16-bit、Linear_PCM_Bit_Pos:0、Input Data Format: 2’s complement、Input Coding: Linear

对应的Event:

Command Complete event:

0x04:表示HCI Event Packet

0x0e:表示这个event是command completeevent

0x04:表示Parameter_Total_Length即4个byte

0x01:表示Num_HCI_Command_Packets

0x0426:表示是HCI_Write_Voice_Setting command

0x00:表示status是success

(8)Enhanced Setup Synchronous Connection Command

这个命令根据Connection_Handle建立一个新的SCO or eSCO或者修改一个已存在的eSCO

注意:

a)如果要建立一个新的SCO or eSCO,要使用ACL连接的Connection_Handle(新建立的SCO or eSCO将会和这个ACL关联在一起),但是如果ACL连接使用AES-CCM加密的,那么不能建立eSCO,只能建立SCO,如果此时要求建立eSCO,会返回Error code 0x0E(Connection Rejected Due to Security Reasons);

b)如果Connection_Handle表示一个已存在的eSCO,那么使用这个命令eSCO连接将会被修改,只有eSCO使用这个command进行修改,如果要修改一个SCO连接,需要使用Change Connection Packet Type command.

c)如果修改一个已存在的eSCO,只有Packet_Type、Retransmission_Effort和Max_Latency可以修改

d)SCO or eSCO只能在ACL连接已经存在的时候建立,并且ACL连接不能处于Park状态

e)latency是上层用来限制eSCO (or SCO)的最大延迟时间(eSCO (or SCO) instants, plus the size of the retransmission window, plus the length of the reserved synchronous slots)

f)当SCO/eSCO建立完成以后,本地host会接收到Synchronous Connection Complete event,远端设备host会接收到Synchronous Connection Complete event (使用Accept Synchronous Connection Request Command&#

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值