27
27
extern "C" {
28
28
#endif
29
29
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 );
33
51
};
34
- struct ble_ll_iso_test_mode {
52
+ struct ble_ll_iso_rx {
35
53
struct {
36
- uint32_t rand ;
37
54
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 ;
40
69
};
41
70
struct ble_ll_iso_conn {
42
71
/* Connection handle */
43
72
uint16_t handle ;
44
73
45
- /* Maximum SDU size */
46
- uint16_t max_sdu ;
74
+ /* ISO Rx */
75
+ struct ble_ll_iso_rx * rx ;
47
76
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 ;
53
79
54
80
/* ISOAL Multiplexer */
55
81
struct ble_ll_isoal_mux mux ;
@@ -74,36 +100,28 @@ int ble_ll_iso_reject_cis_req(const uint8_t *cmdbuf, uint8_t len);
74
100
int ble_ll_iso_create_big (const uint8_t * cmdbuf , uint8_t len );
75
101
int ble_ll_iso_create_big_test (const uint8_t * cmdbuf , uint8_t len );
76
102
int 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 );
78
104
int ble_ll_iso_big_terminate_sync (const uint8_t * cmdbuf , uint8_t len );
79
105
int ble_ll_iso_setup_iso_data_path (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
80
106
int ble_ll_iso_remove_iso_data_path (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
81
107
int 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 );
84
110
int ble_ll_iso_end_test (const uint8_t * cmdbuf , uint8_t len , uint8_t * rspbuf , uint8_t * rsplen );
85
111
86
112
void ble_ll_iso_init (void );
87
113
void ble_ll_iso_reset (void );
88
114
89
- /* ISO Data handler */
115
+ /* ISO Data SDU handler */
90
116
int ble_ll_iso_data_in (struct os_mbuf * om );
91
117
92
118
int ble_ll_iso_pdu_get (struct ble_ll_iso_conn * conn , uint8_t idx , uint32_t pkt_counter , uint8_t * llid , void * dptr );
93
119
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 );
104
122
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 );
107
125
108
126
int ble_ll_iso_conn_event_start (struct ble_ll_iso_conn * conn , uint32_t timestamp );
109
127
int ble_ll_iso_conn_event_done (struct ble_ll_iso_conn * conn );
0 commit comments