@@ -114,6 +114,11 @@ void tud_network_recv_renew(void)
114114static void do_in_xfer (uint8_t * buf , uint16_t len )
115115{
116116 can_xmit = false;
117+
118+ if (tud_network_idle_status_change_cb ) {
119+ tud_network_idle_status_change_cb (can_xmit );
120+ }
121+
117122 usbd_edpt_xfer (TUD_OPT_RHPORT , _netd_itf .ep_in , buf , len );
118123}
119124
@@ -212,6 +217,9 @@ uint16_t netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint1
212217
213218 // we are ready to transmit a packet
214219 can_xmit = true;
220+ if (tud_network_idle_status_change_cb ) {
221+ tud_network_idle_status_change_cb (can_xmit );
222+ }
215223
216224 // prepare for incoming packets
217225 tud_network_recv_renew ();
@@ -276,6 +284,9 @@ bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t
276284 // Also should have opposite callback for application to disable network !!
277285 tud_network_init_cb ();
278286 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+ }
279290 tud_network_recv_renew (); // prepare for incoming packets
280291 }
281292 }else
@@ -396,6 +407,9 @@ bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
396407 {
397408 /* we're finally finished */
398409 can_xmit = true;
410+ if (tud_network_idle_status_change_cb ) {
411+ tud_network_idle_status_change_cb (can_xmit );
412+ }
399413 }
400414 }
401415
0 commit comments