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


Java IntArrayOutputStream.getIntArray方法代码示例

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


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

示例1: getFrameData

import com.rapplogic.xbee.util.IntArrayOutputStream; //导入方法依赖的package包/类
/**
 * Gets frame data from tx request (super) and inserts necessary bytes
 */
public int[] getFrameData() {
	
	// get frame id from tx request
	IntArrayOutputStream frameData = this.getFrameDataAsIntArrayOutputStream();
	
	// overwrite api id
	frameData.getInternalList().set(0, this.getApiId().getValue());
	
	// insert explicit bytes
	
	// source endpoint
	frameData.getInternalList().add(12, this.getSourceEndpoint());
	// dest endpoint
	frameData.getInternalList().add(13, this.getDestinationEndpoint());
	// cluster id msb
	frameData.getInternalList().add(14, this.getClusterId().getMsb());
	// cluster id lsb
	frameData.getInternalList().add(15, this.getClusterId().getLsb());
	// profile id
	frameData.getInternalList().add(16, this.getProfileId().getMsb());
	frameData.getInternalList().add(17, this.getProfileId().getLsb());
	
	return frameData.getIntArray();
}
 
开发者ID:andrewrapp,项目名称:xbee-api,代码行数:28,代码来源:ZNetExplicitTxRequest.java

示例2: getFrameData

import com.rapplogic.xbee.util.IntArrayOutputStream; //导入方法依赖的package包/类
public int[] getFrameData() {	
	// 3/6/10 fixed bug -- broadcast address is used with broadcast option, not no ACK
	
	IntArrayOutputStream out = new IntArrayOutputStream();

	// api id
	out.write(this.getApiId().getValue());
	// frame id (arbitrary byte that will be sent back with ack)
	out.write(this.getFrameId());
	// destination address (broadcast is 0xFFFF)
	out.write(remoteAddr16.getAddress());
	// options byte disable ack = 1, send pan id = 4
	out.write(this.getOption().getValue());		
	out.write(this.getPayload());

	return out.getIntArray();	
}
 
开发者ID:andrewrapp,项目名称:xbee-api,代码行数:18,代码来源:TxRequest16.java

示例3: getFrameData

import com.rapplogic.xbee.util.IntArrayOutputStream; //导入方法依赖的package包/类
public int[] getFrameData() {
	
	// 3/6/10 fixed bug -- broadcast address is used with broadcast option, not no ACK

	IntArrayOutputStream out = new IntArrayOutputStream();
	
	// api id
	out.write(this.getApiId().getValue());
	// frame id (arbitrary byte that will be sent back with ack)
	out.write(this.getFrameId());
	// destination high (broadcast is 0xFFFF)
	
	// add 64-bit dest address
	out.write(remoteAddr64.getAddress());
	
	// options byte disable ack = 1, send pan id = 4
	out.write(this.getOption().getValue());		
	out.write(this.getPayload());
	
	return out.getIntArray();	
}
 
开发者ID:andrewrapp,项目名称:xbee-api,代码行数:22,代码来源:TxRequest64.java

示例4: getFrameData

import com.rapplogic.xbee.util.IntArrayOutputStream; //导入方法依赖的package包/类
public int[] getFrameData() {
	if (command.length() > 2) {
		throw new IllegalArgumentException("Command should be two characters.  Do not include AT prefix");
	}
	
	IntArrayOutputStream out = new IntArrayOutputStream();
	
	// api id
	out.write(this.getApiId().getValue());
	// frame id
	out.write(this.getFrameId());
	// at command byte 1
	out.write((int) command.substring(0, 1).toCharArray()[0]);
	// at command byte 2
	out.write((int) command.substring(1, 2).toCharArray()[0]);

	// int value is up to four bytes to represent command value
	if (value != null) {
		out.write(value);
	}
	
	return out.getIntArray();
}
 
开发者ID:andrewrapp,项目名称:xbee-api,代码行数:24,代码来源:AtCommand.java

示例5: getFrameData

import com.rapplogic.xbee.util.IntArrayOutputStream; //导入方法依赖的package包/类
public int[] getFrameData() {		
		IntArrayOutputStream out = new IntArrayOutputStream();
		
		// api id
		out.write(this.getApiId().getValue());
		// frame id (arbitrary byte that will be sent back with ack)
		out.write(this.getFrameId());
		
		out.write(remoteAddr64.getAddress());
		
		// 16-bit address
		out.write(remoteAddr16.getAddress());
		
		// TODO S2B remote command options
		// TODO 0x40 is a bit field, ugh
//		0x01 - Disable retries and route repair
//		0x02 - Apply changes.
//		0x20 - Enable APS encryption (if EE=1)
//		0x40 - Use the extended transmission timeout
		
		if (applyChanges) {
			out.write(2);	
		} else {
			// queue changes -- don't forget to send AC command
			out.write(0);
		}
		 
		// command name ascii [1]
		out.write((int) this.getCommand().substring(0, 1).toCharArray()[0]);
		// command name ascii [2]
		out.write((int) this.getCommand().substring(1, 2).toCharArray()[0]);
	
		if (this.getValue() != null) {
			out.write(this.getValue());
		}

		return out.getIntArray();
	}
 
开发者ID:andrewrapp,项目名称:xbee-api,代码行数:39,代码来源:RemoteAtRequest.java


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