2727extern "C" {
2828#endif
2929
30- struct ble_ll_iso_data_path {
31- uint8_t data_path_id ;
32- uint8_t enabled : 1 ;
30+ /**
31+ * @struct ble_ll_iso_data_path_cb
32+ *
33+ * Interface structure for ISO data path callbacks.
34+ */
35+ struct ble_ll_iso_data_path_cb {
36+ /**
37+ * @brief Callback function for sending an ISO SDU (Service Data Unit).
38+ *
39+ * @param conn_handle The connection handle associated with the received SDU.
40+ * @param om Pointer to the `os_mbuf` structure containing the SDU data.
41+ * Can be `NULL` if the SDU is considered as lost.
42+ * @param timestamp Timestamp associated with the received SDU.
43+ * @param seq_num Sequence number of the SDU.
44+ * @param valid Status of the SDU reception.
45+ * - `true`: SDU was received successfully, and `om` contains valid data.
46+ * - `false`: An error occurred during processing, but partial or corrupted
47+ * SDU data may be available in `om`.
48+ */
49+ void (* sdu_send )(uint16_t conn_handle , const struct os_mbuf * om , uint32_t timestamp ,
50+ uint16_t seq_num , bool valid );
3351};
34- struct ble_ll_iso_test_mode {
52+ struct ble_ll_iso_rx {
3553 struct {
36- uint32_t rand ;
3754 uint8_t payload_type ;
38- uint8_t enabled : 1 ;
39- } transmit ;
55+ uint32_t received_sdu_count ;
56+ uint32_t missed_sdu_count ;
57+ uint32_t failed_sdu_count ;
58+ } test ;
59+
60+ const struct ble_ll_iso_data_path_cb * data_path ;
61+ };
62+ struct ble_ll_iso_tx {
63+ struct {
64+ uint8_t payload_type ;
65+ uint32_t rand ;
66+ } test ;
67+
68+ const struct ble_ll_iso_data_path_cb * data_path ;
4069};
4170struct ble_ll_iso_conn {
4271 /* Connection handle */
4372 uint16_t handle ;
4473
45- /* Maximum SDU size */
46- uint16_t max_sdu ;
74+ /* ISO Rx */
75+ struct ble_ll_iso_rx * rx ;
4776
48- /* ISO Data Path */
49- struct ble_ll_iso_data_path data_path ;
50-
51- /* ISO Test Mode */
52- struct ble_ll_iso_test_mode test_mode ;
77+ /* ISO Tx */
78+ struct ble_ll_iso_tx * tx ;
5379
5480 /* ISOAL Multiplexer */
5581 struct ble_ll_isoal_mux mux ;
@@ -74,36 +100,28 @@ int ble_ll_iso_reject_cis_req(const uint8_t *cmdbuf, uint8_t len);
74100int ble_ll_iso_create_big (const uint8_t * cmdbuf , uint8_t len );
75101int ble_ll_iso_create_big_test (const uint8_t * cmdbuf , uint8_t len );
76102int ble_ll_iso_terminate_big (const uint8_t * cmdbuf , uint8_t len );
77- int ble_ll_iso_big_create_sync (const uint8_t * cmdbuf , uint8_t len );
103+ int ble_ll_iso_big_create_sync (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
78104int ble_ll_iso_big_terminate_sync (const uint8_t * cmdbuf , uint8_t len );
79105int ble_ll_iso_setup_iso_data_path (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
80106int ble_ll_iso_remove_iso_data_path (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
81107int ble_ll_iso_transmit_test (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
82- int ble_ll_iso_receive_test (const uint8_t * cmdbuf , uint8_t len );
83- int ble_ll_iso_read_counters_test (const uint8_t * cmdbuf , uint8_t len );
108+ int ble_ll_iso_receive_test (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
109+ int ble_ll_iso_read_counters_test (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
84110int ble_ll_iso_end_test (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
85111
86112void ble_ll_iso_init (void );
87113void ble_ll_iso_reset (void );
88114
89- /* ISO Data handler */
115+ /* ISO Data SDU handler */
90116int ble_ll_iso_data_in (struct os_mbuf * om );
91117
92118int ble_ll_iso_pdu_get (struct ble_ll_iso_conn * conn , uint8_t idx , uint32_t pkt_counter , uint8_t * llid , void * dptr );
93119
94- struct ble_ll_iso_conn_init_param {
95- uint32_t iso_interval_us ;
96- uint32_t sdu_interval_us ;
97- uint16_t conn_handle ;
98- uint16_t max_sdu ;
99- uint8_t max_pdu ;
100- uint8_t framing ;
101- uint8_t pte ;
102- uint8_t bn ;
103- };
120+ /* ISO Data PDU handler */
121+ int ble_ll_iso_data_pdu_in (struct ble_ll_iso_conn * conn , uint8_t idx , struct os_mbuf * om );
104122
105- void ble_ll_iso_conn_init (struct ble_ll_iso_conn * conn , struct ble_ll_iso_conn_init_param * param );
106- void ble_ll_iso_conn_free (struct ble_ll_iso_conn * conn );
123+ void ble_ll_iso_conn_add (struct ble_ll_iso_conn * conn );
124+ void ble_ll_iso_conn_rem (struct ble_ll_iso_conn * conn );
107125
108126int ble_ll_iso_conn_event_start (struct ble_ll_iso_conn * conn , uint32_t timestamp );
109127int ble_ll_iso_conn_event_done (struct ble_ll_iso_conn * conn );
0 commit comments