//---------------------------------------------------------------------------- //Initialisierung des NTP Ports (für Daten empfang) void udp_cmd_init (void) { kill_udp_app(UDP_CMD_PORT_RX); //Port in Anwendungstabelle eintragen für eingehende UDP Daten! add_udp_app (UDP_CMD_PORT_RX, (void(*)(unsigned char))udp_cmd_get); add_udp_app (UDP_BOOTLOADER_RESET, (void(*)(unsigned char))udp_bootloader_reset); return; }
// ---------------------------------------------------------------------------- // initialization of network settings void artnet_netInit(void) { if (artnet_netConfig == 1) { if (*((unsigned long*)&myip[0]) == IP(127,127,127,127)) { #if USE_DHCP //ARTNET_DEBUG("Setting network address: Custom (DHCP)\r\n"); dhcp_init(); if (dhcp() != 0) { //ARTNET_DEBUG("DHCP fail\r\n"); //use programmed value (*((unsigned long*)&myip[0])) = MYIP; (*((unsigned long*)&netmask[0])) = NETMASK; } #else //ARTNET_DEBUG("Setting network address: Custom\r\n"); (*((unsigned long*)&myip[0])) = MYIP; (*((unsigned long*)&netmask[0])) = NETMASK; #endif //USE_DHCP } else { read_ip_addresses(); } } // calculate broadcast adress (*((unsigned long*)&broadcast_ip[0])) = (((*((unsigned long*)&myip[0])) & (*((unsigned long*)&netmask[0]))) | (~(*((unsigned long*)&netmask[0])))); // remove any existing app from port kill_udp_app(artnet_port); // add port to stack with callback add_udp_app(artnet_port, (void(*)(unsigned char))artnet_get); }
//---------------------------------------------------------------------------- //Init of DHCP client port void dhcp_init (void) { //Port in Anwendungstabelle eintragen für eingehende DHCP Daten! add_udp_app (DHCP_CLIENT_PORT, (void(*)(unsigned char))dhcp_get); dhcp_state = DHCP_STATE_IDLE; return; }
//---------------------------------------------------------------------------- //Init of DHCP client port void dhcp_init (void) { DHCP_DEBUG("\r\nIP %1i.%1i.%1i.%1i\r\n", myip[0] , myip[1] , myip[2] , myip[3]); //Port in Anwendungstabelle eintragen für eingehende DHCP Daten! add_udp_app (DHCP_CLIENT_PORT, (void(*)(unsigned char))dhcp_get); dhcp_state = DHCP_STATE_IDLE; (*((unsigned long*)&myip[0])) = IP(0,0,0,0); (*((unsigned long*)&dhcp_offer_ip[0])) = IP(10,42,23,99); return; }
//---------------------------------------------------------------------------- //Eintrag des DNS clients im stack void dns_init (void) { //ADD the DNS port as apllication to the list add_udp_app (DNS_CLIENT_PORT, (void(*)(unsigned char))dns_get); //DNS IP read from EEPROM (*((unsigned long*)&dns_server_ip[0])) = get_eeprom_value(DNS_IP_EEPROM_STORE,DNS_IP); DNS_DEBUG("DNS %1i.%1i.%1i.%1i\r\n",dns_server_ip[0],dns_server_ip[1],dns_server_ip[2],dns_server_ip[3]); return; }
//---------------------------------------------------------------------------- //Initialisierung des NTP Ports (für Daten empfang) void udp_lcd_init (void) { //Port in Anwendungstabelle eintragen für eingehende NTP Daten! add_udp_app (UDP_LCD_PORT, (void(*)(unsigned char))udp_lcd_get); return; }