当前位置: 首页>>代码示例>>Java>>正文


Java EvercamQuery类代码示例

本文整理汇总了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;
}
 
开发者ID:evercam,项目名称:evercam-android,代码行数:20,代码来源:ScanActivity.java

示例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();
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:11,代码来源:EvercamQueryRunnable.java

示例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"));
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:10,代码来源:EvercamQueryTest.java

示例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());
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:15,代码来源:EvercamQueryTest.java

示例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 ++;
}
 
开发者ID:GNUDimarik,项目名称:evercam-play-android2,代码行数:63,代码来源:ScanForCameraTask.java

示例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();
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:49,代码来源:IdentifyCameraRunnable.java

示例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"));
   }
 
开发者ID:evercam,项目名称:evercam-discovery-java,代码行数:6,代码来源:EvercamQueryTest.java


注:本文中的io.evercam.network.query.EvercamQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。