12 printf(
"DHCP&AutoIP\n");
20 printf(
"\tAddress:\t%s\n", inet_ntoa(addr));
22 printf(
"\tSubnet:\t\t%s\n", inet_ntoa(addr));
24 printf(
"\tGateway:\t%s\n", inet_ntoa(addr));
27 int main(
int argc,
char** argv)
30 printf(
"Usage: %s 10.68.0.20 [255.255.255.0] [0.0.0.0]\n", argv[0]);
34 char nm[] =
"255.255.255.0";
40 char gw[] =
"0.0.0.0";
51 char* ip_address = argv[1];
52 unsigned long IP = inet_addr(ip_address);
57 printf(
"Camera found at requested IP address:\n");
61 printf(
"No camera found at %s, trying to change settings of a local camera...\n", ip_address);
64 printf(
"ERROR: No camera detected. Is it plugged in?\n");
68 printf(
"ERROR: Multiple cameras (%u) found. Do you have more than one plugged in?\n", (
unsigned)num_cams);
72 printf(
"Detected camera.\n");
76 printf(
"ERROR: could not retrieve camera info.\n");
80 printf(
"ERROR: could not retrieve camera IP settings.\n");
83 printf(
"Original settings:\n");
86 printf(
"Applying new settings...\n");
93 printf(
"ERROR: Failed to apply the new settings\n");
96 printf(
"New settings:\n");
tPvErr PVDECL PvCameraIpSettingsChange(unsigned long UniqueId, const tPvIpSettings *pSettings)
unsigned long PersistentIpSubnet
uint64_t getGuid(size_t i)
void printSettings(const tPvCameraInfo &info, const tPvIpSettings &conf)
int main(int argc, char **argv)
unsigned long CurrentIpGateway
unsigned long PersistentIpAddr
unsigned long CurrentIpAddress
unsigned long PersistentIpGateway
tPvErr PVDECL PvCameraInfo(unsigned long UniqueId, tPvCameraInfo *pInfo)
tPvErr PVDECL PvCameraIpSettingsGet(unsigned long UniqueId, tPvIpSettings *pSettings)
tPvErr PVDECL PvCameraInfoByAddr(unsigned long IpAddr, tPvCameraInfo *pInfo, tPvIpSettings *pIpSettings)
unsigned long CurrentIpSubnet