Commit 0406448b authored by Robert Karlsson's avatar Robert Karlsson

Minor bugfixes

parent 109a31a3
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts) PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts, const char *dev_name)
{ {
int s; int s;
struct ifreq ifr = {}; struct ifreq ifr = {};
...@@ -59,7 +59,7 @@ PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts) ...@@ -59,7 +59,7 @@ PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts)
/* Get configs for device */ /* Get configs for device */
s = socket(AF_INET, SOCK_DGRAM, 0); s = socket(AF_INET, SOCK_DGRAM, 0);
strncpy(ifr.ifr_name, "eth1", sizeof(ifr.ifr_name)); strncpy(ifr.ifr_name, dev_name, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFADDR, &ifr) >= 0) { if (ioctl(s, SIOCGIFADDR, &ifr) >= 0) {
strcpy(dev_data.ip_address, inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr)); strcpy(dev_data.ip_address, inet_ntoa(((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr));
} }
...@@ -73,7 +73,7 @@ PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts) ...@@ -73,7 +73,7 @@ PnViewerPNAC::PnViewerPNAC( pwr_tStatus *sts)
strcpy(dev_data.device_name, "dumle"); strcpy(dev_data.device_name, "dumle");
dev_data.device_num = PN_DEVICE_REFERENCE_THIS_STATION; dev_data.device_num = PN_DEVICE_REFERENCE_THIS_STATION;
strcpy(dev_data.device_text, "eth1"); strcpy(dev_data.device_text, dev_name);
dev_data.vendor_id = 279; // Softing vendor id dev_data.vendor_id = 279; // Softing vendor id
dev_data.device_id = 0; dev_data.device_id = 0;
strcpy(dev_data.version, "1.0"); strcpy(dev_data.version, "1.0");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment