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


Java Command类代码示例

本文整理汇总了Java中com.ibm.iotf.client.device.Command的典型用法代码示例。如果您正苦于以下问题:Java Command类的具体用法?Java Command怎么用?Java Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Command类属于com.ibm.iotf.client.device包,在下文中一共展示了Command类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processCommand

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
/**
 * This method is invoked by the library whenever there is command matching the subscription criteria
 */
@Override
public void processCommand(Command cmd) {
	try {
		queue.put(cmd);
		} catch (InterruptedException e) {
	}			
}
 
开发者ID:ibm-watson-iot,项目名称:iot-device-samples,代码行数:11,代码来源:RegisteredDeviceCommandSubscribe.java

示例2: run

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
@Override
public void run() {
	while(true) {
		Command cmd = null;
		try {
			//In this sample, we just display the command
			cmd = queue.take();
			System.out.println("COMMAND RECEIVED = '" + cmd.getCommand() + "'\twith Payload = '" + cmd.getPayload() + "'");
		} catch (InterruptedException e) {}
	}
}
 
开发者ID:ibm-watson-iot,项目名称:iot-device-samples,代码行数:12,代码来源:RegisteredDeviceCommandSubscribe.java

示例3: accept

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
@Override
public void accept(Consumer<Command> commandSubmitter) {
    
    try {
        connector.subscribeCommands(commandSubmitter);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:quarks-edge,项目名称:quarks,代码行数:11,代码来源:IotfDeviceCommands.java

示例4: subscribeCommands

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
synchronized void subscribeCommands(Consumer<Command> tupleSubmitter) throws Exception {
    DeviceClient client = getClient();
    
    client.setCommandCallback(cmd -> {
        tupleSubmitter.accept(cmd);
    });
}
 
开发者ID:quarks-edge,项目名称:quarks,代码行数:8,代码来源:IotfConnector.java

示例5: processCommand

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
/**
 * This method is invoked by the library whenever there is command matching the subscription criteria
 */
@Override
public void processCommand(Command cmd) {
	commandReceived = true;
	System.out.println("Received command, name = "+cmd.getCommand() +
			", format = " + cmd.getFormat() + ", Payload = "+cmd.getPayload() + ", time = "+cmd.getTimestamp());
}
 
开发者ID:ibm-watson-iot,项目名称:iot-java,代码行数:10,代码来源:DeviceCommandSubscriptionTest.java

示例6: processCommand

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
@Override
public void processCommand(Command command) {
	System.out.println("COMMAND RECEIVED = '" + command.getCommand() + 
			"'\twith Payload = '" + command.getPayload() + "'");		
}
 
开发者ID:ibm-watson-iot,项目名称:iot-device-samples,代码行数:6,代码来源:SampleRasPiManagedDevice.java

示例7: allCommands

import com.ibm.iotf.client.device.Command; //导入依赖的package包/类
private TStream<Command> allCommands() {
    if (commandStream == null)
        commandStream = topology.events(new IotfDeviceCommands(connector));
    return commandStream;
}
 
开发者ID:quarks-edge,项目名称:quarks,代码行数:6,代码来源:IotfDevice.java


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