void LWIP_SOCKETS_Driver::Link_callback(struct netif *netif) { if (netif_is_link_up(netif)) { if (!PostAvailabilityOnContinuation.IsLinked()) PostAvailabilityOnContinuation.Enqueue(); } else { if (!PostAvailabilityOffContinuation.IsLinked()) PostAvailabilityOffContinuation.Enqueue(); } Events_Set(SYSTEM_EVENT_FLAG_SOCKET); Events_Set(SYSTEM_EVENT_FLAG_NETWORK); }
void lwip_interrupt_continuation( void ) { NATIVE_PROFILE_PAL_NETWORK(); GLOBAL_LOCK(irq); if(!InterruptTaskContinuation.IsLinked()) { InterruptTaskContinuation.Enqueue(); } }
/*----------------------------------------------------------------------* rtp_thrd_timer_completion *----------------------------------------------------------------------*/ void rtp_thrd_timer_completion(void* arg) { NATIVE_PROFILE_PAL_NETWORK(); /* Schedule the timer task to run as a continuation */ if(!TimerTaskContinuation.IsLinked()) { TimerTaskContinuation.Enqueue(); } ///////////////////////////////////////////////////////////////// // DO NT CHANGE! // KEEP the timeout IN SYNC with _CFG_TIMER_FREQ TimerTaskCompletion.EnqueueDelta(cfg_protocol_data.timer_freq * 1000); // DO NT CHANGE! ///////////////////////////////////////////////////////////////// }
void LWIP_SOCKETS_Driver::Status_callback(struct netif *netif) { if (!PostAddressChangedContinuation.IsLinked()) PostAddressChangedContinuation.Enqueue(); #if !defined(BUILD_RTM) lcd_printf("\f\n\n\n\n\n\nLink Update: %s\n", (netif_is_up(netif) ? "UP " : "DOWN")); lcd_printf(" IP: %d.%d.%d.%d\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); lcd_printf(" SM: %d.%d.%d.%d\n", (netif->netmask.addr >> 0) & 0xFF, (netif->netmask.addr >> 8) & 0xFF, (netif->netmask.addr >> 16) & 0xFF, (netif->netmask.addr >> 24) & 0xFF); lcd_printf(" GW: %d.%d.%d.%d\n", (netif->gw.addr >> 0) & 0xFF, (netif->gw.addr >> 8) & 0xFF, (netif->gw.addr >> 16) & 0xFF, (netif->gw.addr >> 24) & 0xFF); debug_printf("IP Address: %d.%d.%d.%d\n", (netif->ip_addr.addr >> 0) & 0xFF, (netif->ip_addr.addr >> 8) & 0xFF, (netif->ip_addr.addr >> 16) & 0xFF, (netif->ip_addr.addr >> 24) & 0xFF); #if LWIP_DNS if (netif->flags & NETIF_FLAG_DHCP) { struct ip_addr dns1 = dns_getserver(0); struct ip_addr dns2 = dns_getserver(1); lcd_printf(" dns1: %d.%d.%d.%d\n", (dns1.addr >> 0) & 0xFF, (dns1.addr >> 8) & 0xFF, (dns1.addr >> 16) & 0xFF, (dns1.addr >> 24) & 0xFF); lcd_printf(" dns2: %d.%d.%d.%d\n", (dns2.addr >> 0) & 0xFF, (dns2.addr >> 8) & 0xFF, (dns2.addr >> 16) & 0xFF, (dns2.addr >> 24) & 0xFF); } #endif #endif Events_Set(SYSTEM_EVENT_FLAG_SOCKET); Events_Set(SYSTEM_EVENT_FLAG_NETWORK); }