@@ -277,6 +277,50 @@ ble_hci_sock_acl_tx(struct os_mbuf *om)
277277
278278#if MYNEWT_VAL (BLE_SOCK_USE_LINUX_BLUE ) || MYNEWT_VAL (BLE_SOCK_USE_TCP )
279279static int
280+ ble_hci_sock_iso_tx (struct os_mbuf * om )
281+ {
282+ struct msghdr msg ;
283+ struct iovec iov [8 ];
284+ int i ;
285+ struct os_mbuf * m ;
286+ uint8_t ch ;
287+
288+ memset (& msg , 0 , sizeof (msg ));
289+ memset (iov , 0 , sizeof (iov ));
290+
291+ msg .msg_iov = iov ;
292+
293+ ch = BLE_HCI_UART_H4_ISO ;
294+ iov [0 ].iov_len = 1 ;
295+ iov [0 ].iov_base = & ch ;
296+ i = 1 ;
297+ for (m = om ; m ; m = SLIST_NEXT (m , om_next )) {
298+ iov [i ].iov_base = m -> om_data ;
299+ iov [i ].iov_len = m -> om_len ;
300+ i ++ ;
301+ }
302+ msg .msg_iovlen = i ;
303+
304+ STATS_INC (hci_sock_stats , omsg );
305+ STATS_INC (hci_sock_stats , oiso );
306+ STATS_INCN (hci_sock_stats , obytes , OS_MBUF_PKTLEN (om ) + 1 );
307+ i = sendmsg (ble_hci_sock_state .sock , & msg , 0 );
308+ os_mbuf_free_chain (om );
309+ if (i != OS_MBUF_PKTLEN (om ) + 1 ) {
310+ if (i < 0 ) {
311+ dprintf (1 , "sendmsg() failed : %d\n" , errno );
312+ } else {
313+ dprintf (1 , "sendmsg() partial write: %d\n" , i );
314+ }
315+ STATS_INC (hci_sock_stats , oerr );
316+ return BLE_ERR_MEM_CAPACITY ;
317+ }
318+ return 0 ;
319+ }
320+ #endif /* BLE_SOCK_USE_LINUX_BLUE */
321+
322+ #if MYNEWT_VAL (BLE_SOCK_USE_LINUX_BLUE )
323+ static int
280324ble_hci_sock_cmdevt_tx (uint8_t * hci_ev , uint8_t h4_type )
281325{
282326 struct msghdr msg ;
@@ -871,6 +915,12 @@ ble_hci_sock_init(void)
871915 SYSINIT_PANIC_ASSERT (rc == 0 );
872916}
873917
918+ int
919+ ble_transport_to_ll_iso_impl (struct os_mbuf * om )
920+ {
921+ return ble_hci_sock_iso_tx (om );
922+ }
923+
874924void
875925ble_transport_ll_init (void )
876926{
0 commit comments