Skip to content

Commit

Permalink
add better reolink discovery check
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Skinner <matt@pcmus.com>
  • Loading branch information
Skinah committed Jun 18, 2023
1 parent 663b4d9 commit d0fb584
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,18 @@ void processCameraReplys() {
if (!xAddr.isEmpty()) {
searchReply(xAddr, xml);
} else if (xml.contains("onvif")) {
logger.info("Possible ONVIF camera found at:{}", packet.sender().getHostString());
ipCameraDiscoveryService.newCameraFound("onvif", packet.sender().getHostString(), 80);
String brand;
try {
brand = getBrandFromLoginPage(packet.sender().getHostString());
} catch (IOException e) {
brand = "onvif";
}
logger.info("Possible {} camera found at:{}", brand, packet.sender().getHostString());
if (brand.equals("reolink")) {
ipCameraDiscoveryService.newCameraFound(brand, packet.sender().getHostString(), 80);
} else {
ipCameraDiscoveryService.newCameraFound(brand, packet.sender().getHostString(), 80);
}
}
}
}
Expand All @@ -155,14 +165,16 @@ String checkForBrand(String response) {
return "dahua";
} else if (response.toLowerCase().contains("dahua")) {
return "dahua";
} else if (response.toLowerCase().contains("doorbird")) {
return "doorbird";
} else if (response.toLowerCase().contains("foscam")) {
return "foscam";
} else if (response.toLowerCase().contains("hikvision")) {
return "hikvision";
} else if (response.toLowerCase().contains("instar")) {
return "instar";
} else if (response.toLowerCase().contains("doorbird")) {
return "doorbird";
} else if (response.toLowerCase().contains("reolink")) {
return "reolink";
} else if (response.toLowerCase().contains("ipc-")) {
return "dahua";
} else if (response.toLowerCase().contains("dh-sd")) {
Expand Down

0 comments on commit d0fb584

Please sign in to comment.