@@ -114,6 +114,11 @@ void tud_network_recv_renew(void)
114
114
static void do_in_xfer (uint8_t * buf , uint16_t len )
115
115
{
116
116
can_xmit = false;
117
+
118
+ if (tud_network_idle_status_change_cb ) {
119
+ tud_network_idle_status_change_cb (can_xmit );
120
+ }
121
+
117
122
usbd_edpt_xfer (TUD_OPT_RHPORT , _netd_itf .ep_in , buf , len );
118
123
}
119
124
@@ -212,6 +217,9 @@ uint16_t netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint1
212
217
213
218
// we are ready to transmit a packet
214
219
can_xmit = true;
220
+ if (tud_network_idle_status_change_cb ) {
221
+ tud_network_idle_status_change_cb (can_xmit );
222
+ }
215
223
216
224
// prepare for incoming packets
217
225
tud_network_recv_renew ();
@@ -276,6 +284,9 @@ bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t
276
284
// Also should have opposite callback for application to disable network !!
277
285
tud_network_init_cb ();
278
286
can_xmit = true; // we are ready to transmit a packet
287
+ if (tud_network_idle_status_change_cb ) {
288
+ tud_network_idle_status_change_cb (can_xmit );
289
+ }
279
290
tud_network_recv_renew (); // prepare for incoming packets
280
291
}
281
292
}else
@@ -396,6 +407,9 @@ bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
396
407
{
397
408
/* we're finally finished */
398
409
can_xmit = true;
410
+ if (tud_network_idle_status_change_cb ) {
411
+ tud_network_idle_status_change_cb (can_xmit );
412
+ }
399
413
}
400
414
}
401
415
0 commit comments