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


Java XBee.initProviderConnection方法代码示例

本文整理汇总了Java中com.rapplogic.xbee.api.XBee.initProviderConnection方法的典型用法代码示例。如果您正苦于以下问题:Java XBee.initProviderConnection方法的具体用法?Java XBee.initProviderConnection怎么用?Java XBee.initProviderConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.rapplogic.xbee.api.XBee的用法示例。


在下文中一共展示了XBee.initProviderConnection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testJSSCStartup

import com.rapplogic.xbee.api.XBee; //导入方法依赖的package包/类
public void testJSSCStartup() throws Exception {
	// create the JSSCSerialComm object, this is the replacement object for the default RxTx one used internally.
	JSSCSerialComm serial = new JSSCSerialComm();

	// connect to COM7 at 115200 baud. 8 bits, 1 stop bit, 0 parity is assumed
	serial.openSerialPort("COM7", 115200);

	// xbee object that we will connect up too
	XBee xbee = new XBee();

	// replaces xbee.open() which uses the RxTx model
	xbee.initProviderConnection(serial);

	// test we are connected (This is a jUnit test after all)
	assertTrue(xbee.isConnected());

	// close the xBee
	xbee.close();
}
 
开发者ID:SodaGremlin,项目名称:xbeeapi-jssc-adapter,代码行数:20,代码来源:JSSCXbeeTest.java

示例2: ZBIOSampleReceiveExample

import com.rapplogic.xbee.api.XBee; //导入方法依赖的package包/类
public ZBIOSampleReceiveExample() throws SerialPortException, XBeeException, InterruptedException {
    LOG.info(String.format("Will use port %s", portName));

    try {
        xbee = new XBee();
        xbee.initProviderConnection(new JSSCXBeeConnection(portName));
        LOG.info("Connection to XBee initialised successfully");
        receive(10);
    } finally {
        // Ensure xbee is always closed otherwise port will be in use the next time we try to use it
        LOG.info("Closing XBee connection");
        xbee.close();
    }
}
 
开发者ID:allanlang,项目名称:xbee-api-jssc,代码行数:15,代码来源:ZBIOSampleReceiveExample.java

示例3: ConnectionInitialisationExample

import com.rapplogic.xbee.api.XBee; //导入方法依赖的package包/类
public ConnectionInitialisationExample() throws SerialPortException, XBeeException {
    LOG.info(String.format("Will use port %s", portName));

    try {
        xbee = new XBee();
        xbee.initProviderConnection(new JSSCXBeeConnection(portName));
        LOG.info("Connection to XBee initialised successfully");
    } finally {
        // Ensure xbee is always closed otherwise port will be in use the next time we try to use it
        LOG.info("Closing XBee connection");
        xbee.close();
    }
}
 
开发者ID:allanlang,项目名称:xbee-api-jssc,代码行数:14,代码来源:ConnectionInitialisationExample.java

示例4: testJSSCGetAddress

import com.rapplogic.xbee.api.XBee; //导入方法依赖的package包/类
public void testJSSCGetAddress() throws Exception {
		JSSCSerialComm serial = new JSSCSerialComm();

		serial.openSerialPort("COM7", 115200);

		XBee xbee = new XBee();

		xbee.initProviderConnection(serial);

		assertTrue(xbee.isConnected());

//		xbee.sendRequest();

		xbee.close();
	}
 
开发者ID:SodaGremlin,项目名称:xbeeapi-jssc-adapter,代码行数:16,代码来源:JSSCXbeeTest.java


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