本文整理汇总了Java中io.evercam.network.query.EvercamQuery类的典型用法代码示例。如果您正苦于以下问题:Java EvercamQuery类的具体用法?Java EvercamQuery怎么用?Java EvercamQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EvercamQuery类属于io.evercam.network.query包,在下文中一共展示了EvercamQuery类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Override
protected Drawable doInBackground(Void... params) {
discoveredCamera = EvercamQuery.fillDefaults(discoveredCamera);
String thumbnailUrl = discoveredCamera.getModelThumbnail();
Drawable drawable = null;
if (!thumbnailUrl.isEmpty()) {
try {
InputStream stream = Unirest.get(thumbnailUrl).asBinary().getRawBody();
drawable = Drawable.createFromStream(stream, "src");
} catch (UnirestException e) {
Log.e(TAG, e.getStackTrace()[0].toString());
}
}
return drawable;
}
示例2: run
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Override
public void run() {
if (withDefaults) {
EvercamDiscover.printLogMessage("Retrieving defaults for camera "
+ discoveredCamera.getIP());
discoveredCamera = EvercamQuery.fillDefaults(discoveredCamera);
}
onFinished();
}
示例3: testGetThumbnailUrl
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Test
public void testGetThumbnailUrl() throws EvercamException {
final String TEST_LOGO_URL = "http://evercam-public-assets.s3.amazonaws.com/hikvision/logo.jpg";
final String TEST_MODEL_URL = "http://evercam-public-assets.s3.amazonaws.com/hikvision/ds-2cd7164-e/thumbnail.jpg";
assertEquals(TEST_LOGO_URL,
EvercamQuery.getThumbnailUrlFor("hikvision", "wrongModel"));
assertEquals(TEST_MODEL_URL,
EvercamQuery.getThumbnailUrlFor("hikvision", "ds-2cd7164-e"));
}
示例4: testFillCameraDefaults
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Test
public void testFillCameraDefaults() {
DiscoveredCamera testCamera = new DiscoveredCamera("192.168.0.88");
testCamera.setVendor("dlink");
testCamera.setModel("DCS-2121");
EvercamQuery.fillDefaults(testCamera);
assertEquals("play1.sdp", testCamera.getH264());
assertEquals(
"http://evercam-public-assets.s3.amazonaws.com/dlink/dcs-2121/thumbnail.jpg",
testCamera.getModelThumbnail());
assertEquals(
"http://evercam-public-assets.s3.amazonaws.com/dlink/logo.jpg",
testCamera.getVendorThumbnail());
}
示例5: run
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Override
public void run()
{
try
{
String macAddress = MacAddress.getByIpAndroid(ip);
if (!macAddress.equals(Constants.EMPTY_MAC))
{
Vendor vendor = EvercamQuery.getCameraVendorByMac(macAddress);
if (vendor != null)
{
String vendorId = vendor.getId();
if (!vendorId.isEmpty())
{
// Then fill details discovered from IP scan
DiscoveredCamera camera = new DiscoveredCamera(ip);
camera.setMAC(macAddress);
camera.setVendor(vendorId);
camera.setExternalIp(externalIp);
// Start port scan
PortScan portScan = new PortScan(null);
portScan.start(ip);
ArrayList<Integer> activePortList = portScan.getActivePorts();
if(activePortList.size() > 0)
{
// Add active ports to camera object
for (Integer port : activePortList)
{
camera = PortScan.mergePort(camera, port);
}
//Iterate UPnP device list and publish the UPnP details if matches
if(upnpDeviceList.size() > 0)
{
for(UpnpDevice upnpDevice : upnpDeviceList)
{
String ipFromUpnp = upnpDevice.getIp();
if (ipFromUpnp != null && !ipFromUpnp.isEmpty())
{
if(ipFromUpnp.equals(camera.getIP()))
{
EvercamDiscover.mergeSingleUpnpDeviceToCamera(upnpDevice, camera);
break;
}
}
}
}
publishProgress(camera);
}
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
singleIpEndedCount ++;
}
示例6: run
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Override
public void run() {
EvercamDiscover.printLogMessage("Identifying : " + ip);
try {
String macAddress = MacAddress.getByIpLinux(ip);
if (!macAddress.equals(Constants.EMPTY_MAC)) {
Vendor vendor = EvercamQuery.getCameraVendorByMac(macAddress);
if (vendor != null) {
String vendorId = vendor.getId();
if (!vendorId.isEmpty()) {
EvercamDiscover.printLogMessage(ip
+ " is identified as a camera, vendor is: "
+ vendorId);
// Then fill details discovered from IP scan
DiscoveredCamera camera = new DiscoveredCamera(ip);
camera.setMAC(macAddress);
camera.setVendor(vendorId);
// Start port scan
PortScan portScan = new PortScan();
portScan.start(ip);
ArrayList<Port> activePortList = portScan
.getActivePorts();
if (activePortList.size() > 0) {
camera = camera.mergePorts(activePortList);
}
onCameraFound(camera, vendor);
}
} else {
Device device = new Device(ip);
device.setMAC(macAddress);
device.setPublicVendor(PublicVendor.getByMac(macAddress)
.getCompany());
onNonCameraDeviceFound(device);
}
}
} catch (Exception e) {
if (Constants.ENABLE_LOGGING) {
e.printStackTrace();
}
}
EvercamDiscover.printLogMessage("Identification finished: " + ip);
onFinished();
}
示例7: testGetCameraVendorByMac
import io.evercam.network.query.EvercamQuery; //导入依赖的package包/类
@Test
public void testGetCameraVendorByMac() {
assertNull(EvercamQuery.getCameraVendorByMac("00:00:00"));
assertNotNull(EvercamQuery.getCameraVendorByMac("8c:e7:48"));
}