Esempio n. 1
0
/* ----------------------------------------------------------------------------
 * 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();
//   }
//  } else {
//   if (!(PINB & (1 << 0))) {
//    ARTNET_DEBUG("Setting network address: Art-Net 2.x.x.x standard\r\n");
//    myip[0] = 10;
//   } else {
//    ARTNET_DEBUG("Setting network address: Art-Net 10.x.x.x standard\r\n");
//    myip[0] = 2;
//   }
//   myip[1] = (((OEM_ID >> 8) & 0xFF) + (OEM_ID & 0xFF) + MYMAC4) & 0xFF;
//   myip[2] = MYMAC5;
//   myip[3] = MYMAC6;
//   (*((unsigned long*)&netmask[0])) = IP(255,0,0,0);
//  }
// 
//  /* 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);

  artnet_net_init();

}
Esempio n. 2
0
/* ----------------------------------------------------------------------------
 * initialization of network settings
 */
void
artnet_netInit(void)
{
  artnet_net_init();
}