有BIS和CIS两种
BIS是广播的,不需要连接,只需要监听
CIS要建立连接的,除了ACL链路,还需要建立CIS链路
只需要记住3个指令就可以了
主要是HCI的3个指令 2068 206b 206e 这3个指令即可
2068是创建的BIS的,206B就是去监听的,想听那个BIS可以选择,206e是datapath的
//第一部分初始化
MbtHost.PrvMakeCmd: 0x0c03 0B
MbtHost.EvtCommandComplete: 0x0c03
MbtHost.PrvMakeCmd: 0x1001 0B
MbtHost.EvtCommandComplete: 0x1001
MbtHost.PrvMakeCmd: 0x1009 0B
MbtHost.EvtCommandComplete: 0x1009
MbtHost.PrvMakeCmd: 0x0c01 8B
MbtHost.EvtCommandComplete: 0x0c01 //HCI_Set_Event_Mask = 0x0C01,
MbtHost.PrvMakeCmd: 0x0c63 8B
MbtHost.EvtCommandComplete: 0x0c63 //HCI_Set_Event_Mask_Page_2 = 0x0C63,
MbtHost.PrvMakeCmd: 0x2001 8B
MbtHost.EvtCommandComplete: 0x2001 //HCI_LE_Set_Event_Mask = 0x2001,
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074 //HCI_LE_Set_Host_Feature = 0x2074,
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2060 0B
MbtHost.EvtCommandComplete: 0x2060 //HCI_LE_Read_Buffer_Size_v2 = 0x2060,
TC step done
//第二部分开启BIS的传输
MbtHost.PrvMakeCmd: 0x2036 25B //HCI_LE_Set_Extended_Advertising_Parameters = 0x2036,
MbtHost.EvtCommandComplete: 0x2036
MbtHost.PrvMakeCmd: 0x2037 18B //HCI_LE_Set_Extended_Advertising_Data = 0x2037,
MbtHost.EvtCommandComplete: 0x2037
MbtHost.PrvMakeCmd: 0x2039 6B //HCI_LE_Set_Extended_Advertising_Enable = 0x2039,
MbtHost.EvtCommandComplete: 0x2039
MbtHost.PrvMakeCmd: 0x203e 7B //HCI_LE_Set_Periodic_Advertising_Parameters = 0x203E,
MbtHost.EvtCommandComplete: 0x203e
MbtHost.PrvMakeCmd: 0x2040 2B //HCI_LE_Set_Periodic_Advertising_Enable = 0x2040,
MbtHost.EvtCommandComplete: 0x2040
MbtHost.PrvMakeCmd: 0x2068 31B //HCI_LE_Create_BIG = 0x2068, 创建一下BIG的连接 *
MbtHost.PrvEvtCommandStatus: 0x2068
MbtHost.OnLeMetaEvent: 0x1b //HCI_LE_Create_BIG_Complete = 0x1B,
MbtHost.PrvMakeCmd: 0x206e 13B //HCI_LE_Setup_ISO_Data_Path = 0x206E, 设置一下iso数据的源路径 *
MbtLink[0006].OnConnected: nResult00000000
MbtHost.EvtCommandComplete: 0x206e
TC step done
MbaIso[0006].OnTimer: rx0 tx174pkts
MbaIso[0006].OnTimer: rx0 tx358pkts
MbaIso[0006].OnTimer: rx0 tx542pkts
MbaIso[0006].OnTimer: rx0 tx726pkts
MbaIso[0006].OnTimer: rx0 tx910pkts
MbaIso[0006].OnTimer: rx0 tx1094pkts
MbaIso[0006].OnTimer: rx0 tx1278pkts
MbaIso[0006].OnTimer: rx0 tx1462pkts
//第一部同上
MbtHost.PrvMakeCmd: 0x0c03 0B
MbtHost.EvtCommandComplete: 0x0c03
MbtHost.PrvMakeCmd: 0x1001 0B
MbtHost.EvtCommandComplete: 0x1001
MbtHost.PrvMakeCmd: 0x1009 0B
MbtHost.EvtCommandComplete: 0x1009
MbtHost.PrvMakeCmd: 0x0c01 8B
MbtHost.EvtCommandComplete: 0x0c01
MbtHost.PrvMakeCmd: 0x0c63 8B
MbtHost.EvtCommandComplete: 0x0c63
MbtHost.PrvMakeCmd: 0x2001 8B
MbtHost.EvtCommandComplete: 0x2001
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2060 0B
MbtHost.EvtCommandComplete: 0x2060
TC step done
//第二部分是监听的部分
MbtHost.PrvMakeCmd: 0x2041 8B //HCI_LE_Set_Extended_Scan_Parameters = 0x2041,
MbtHost.EvtCommandComplete: 0x2041
MbtHost.PrvMakeCmd: 0x2042 6B //HCI_LE_Set_Extended_Scan_Enable = 0x2042,
MbtHost.EvtCommandComplete: 0x2042
MbtHost.PrvMakeCmd: 0x2044 14B
MbtHost.PrvEvtCommandStatus: 0x2044 //HCI_LE_Periodic_Advertising_Create_Sync =0x2044, 这个地方传入监听的BIS的地址
MbtHost.OnLeMetaEvent: 0x0e
MbtHost.PrvMakeCmd: 0x206b 25B //HCI_LE_BIG_Create_Sync = 0x206B, //启动监听 监听的BIS 第几个等等
MbtHost.PrvEvtCommandStatus: 0x206b
MbtHost.OnLeMetaEvent: 0x1d
MbtHost.PrvMakeCmd: 0x206e 13B //HCI_LE_Setup_ISO_Data_Path = 0x206E, //HCI传输
MbtLink[0203].OnConnected: nResult00040000
MbtHost.EvtCommandComplete: 0x206e
TC step done
MbaIso[0203].OnTimer: rx200 tx0pkts
MbaIso[0203].OnTimer: rx401 tx0pkts
MbaIso[0203].OnTimer: rx602 tx0pkts
MbaIso[0203].OnTimer: rx803 tx0pkts
MbaIso[0203].OnTimer: rx1005 tx0pkts
MbaIso[0203].OnTimer: rx1206 tx0pkts
MbaIso[0203].OnTimer: rx1407 tx0pkts
MbaIso[0203].OnTimer: rx1608 tx0pkts
创建的时候,主要关心几个参数
比如小红创建了BIS广播,小明和小强来听,创建的时候就要创建两条BIS
这几个参数主要是说,小明和小强获取数据的同步问题
BN IRC PTO NSE 这些,这个可以看最新的5.3的协议
调试时延最小的时候,irc =1 bn=1 nse=1 但重传少于2可能导致丢包
CIS和BIS差不多,就是要和之前一样先连上ACL,然后发LL指令再建立ISO
//第一部分初始化同上
MbtHost.EvtCommandComplete: 0x0c03
MbtHost.PrvMakeCmd: 0x1001 0B
MbtHost.EvtCommandComplete: 0x1001
MbtHost.PrvMakeCmd: 0x1009 0B
MbtHost.EvtCommandComplete: 0x1009
MbtHost.PrvMakeCmd: 0x0c01 8B
MbtHost.EvtCommandComplete: 0x0c01
MbtHost.PrvMakeCmd: 0x0c63 8B
MbtHost.EvtCommandComplete: 0x0c63
MbtHost.PrvMakeCmd: 0x2001 8B
MbtHost.EvtCommandComplete: 0x2001
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2060 0B
MbtHost.EvtCommandComplete: 0x2060
TC step done
//第二部分
MbtHost.PrvMakeCmd: 0x2006 15B //HCI_LE_Set_Advertising_Parameters = 0x2006,
MbtHost.EvtCommandComplete: 0x2006
MbtHost.PrvMakeCmd: 0x2008 32B
MbtHost.EvtCommandComplete: 0x2008 //HCI_LE_Set_Advertising_Data = 0x2008,
MbtHost.PrvMakeCmd: 0x2009 32B
MbtHost.EvtCommandComplete: 0x2009 //HCI_LE_Set_Scan_Response_Data = 0x2009,
MbtHost.PrvMakeCmd: 0x200a 1B
MbtHost.EvtCommandComplete: 0x200a //HCI_LE_Set_Advertise_Enable = 0x200A,
MbtHost.OnLeMetaEvent: 0x0a //HCI_LE_Enhanced_Connection_Complete = 0x0A, 首先就是普通的广告 对端来接收成功
MbtHost.OnLeMetaEvent: 0x14 //CI_LE_Channel_Selection_Algorithm = 0x14,
MbtHost.OnLeMetaEvent: 0x1a //HCI_LE_CIS_Request = 0x1A, 然后对端发起cis request llid 多了一个cis data
MbtHost.PrvMakeCmd: 0x2066 2B //HCI_LE_Accept_CIS_Request = 0x2066, 发起接受
MbtHost.PrvEvtCommandStatus: 0x2066
MbtHost.OnLeMetaEvent: 0x19 //HCI_LE_CIS_Established = 0x19, 建立CIS
MbtHost.PrvMakeCmd: 0x206e 13B
MbtHost.EvtCommandComplete: 0x206e //HCI_LE_Setup_ISO_Data_Path = 0x206E, 设置hci
MbtHost.PrvMakeCmd: 0x206e 13B
MbtLink[0102].OnConnected: nResult00000000
MbtHost.EvtCommandComplete: 0x206e
TC step done
MbaIso[0102].OnTimer: rx0 tx174pkts
MbaIso[0102].OnTimer: rx0 tx358pkts
MbaIso[0102].OnTimer: rx0 tx542pkts
MbaIso[0102].OnTimer: rx0 tx726pkts
//第一部同上
MbtHost.PrvMakeCmd: 0x0c03 0B
MbtHost.EvtCommandComplete: 0x0c03
MbtHost.PrvMakeCmd: 0x1001 0B
MbtHost.EvtCommandComplete: 0x1001
MbtHost.PrvMakeCmd: 0x1009 0B
MbtHost.EvtCommandComplete: 0x1009
MbtHost.PrvMakeCmd: 0x0c01 8B
MbtHost.EvtCommandComplete: 0x0c01
MbtHost.PrvMakeCmd: 0x0c63 8B
MbtHost.EvtCommandComplete: 0x0c63
MbtHost.PrvMakeCmd: 0x2001 8B
MbtHost.EvtCommandComplete: 0x2001
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2074 2B
MbtHost.EvtCommandComplete: 0x2074
MbtHost.PrvMakeCmd: 0x2060 0B
MbtHost.EvtCommandComplete: 0x2060
TC step done
//第二部分
MbtHost.PrvMakeCmd: 0x200d 25B //特别熟悉的200d 就是发起ble的连接
MbtHost.PrvEvtCommandStatus: 0x200d
MbtHost.OnLeMetaEvent: 0x0a //HCI_LE_Enhanced_Connection_Complete = 0x0A,
MbtHost.OnLeMetaEvent: 0x14 //HCI_LE_Channel_Selection_Algorithm = 0x14,
MbtHost.PrvMakeCmd: 0x2062 33B //HCI_LE_Set_CIG_Parameters = 0x2062, 设置cig的参数
MbtHost.EvtCommandComplete: 0x2062
MbtHost.PrvMakeCmd: 0x2064 5B //HCI_LE_Create_CIS = 0x2064, 发起cis的连接
MbtHost.PrvEvtCommandStatus: 0x2064
MbtHost.OnLeMetaEvent: 0x19 //HCI_LE_CIS_Established = 0x19, 已经建立cis
MbtHost.PrvMakeCmd: 0x206e 13B
MbtHost.EvtCommandComplete: 0x206e //HCI_LE_Setup_ISO_Data_Path = 0x206E, 设置hci
MbtHost.PrvMakeCmd: 0x206e 13B
MbtLink[0002].OnConnected: nResult00000000
MbtHost.EvtCommandComplete: 0x206e
TC step done
MbaIso[0002].OnTimer: rx976 tx174pkts
MbaIso[0002].OnTimer: rx1949 tx358pkts
MbaIso[0002].OnTimer: rx2941 tx542pkts
MbaIso[0002].OnTimer: rx3925 tx726pkts
MbaIso[0002].OnTimer: rx4918 tx910pkts
MbaIso[0002].OnTimer: rx5906 tx1094pkts
MbaIso[0002].OnTimer: rx6895 tx1278pkts
HCI指令2064 2066和 206e 发起cis的连接 ,直接看一个LL的指令即可
原理差不多一样,两条链路,然后考虑重复传输和交叉传输
怎么传由参数决定,LL REQ的时候就可以设置,这个图就是两条CIS链路