本文整理汇总了Java中org.fosstrak.ale.server.llrp.LLRPControllerManager类的典型用法代码示例。如果您正苦于以下问题:Java LLRPControllerManager类的具体用法?Java LLRPControllerManager怎么用?Java LLRPControllerManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LLRPControllerManager类属于org.fosstrak.ale.server.llrp包,在下文中一共展示了LLRPControllerManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testReadAddROSpec
import org.fosstrak.ale.server.llrp.LLRPControllerManager; //导入依赖的package包/类
/**
* test the loading of the ro specs.
* @throws Exception test failure.
*/
@Test
public void testReadAddROSpec() throws Exception {
tempFolder.create();
File f = tempFolder.newFile("rospec.llrp");
final String fileName = f.getName();
// absolute path encodes the filename, thus remove it.
final String path = f.getAbsolutePath().replace(fileName, "");
FileOutputStream fos = new FileOutputStream(f);
BufferedOutputStream bfos = new BufferedOutputStream(fos);
bfos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><llrp:ADD_ROSPEC xmlns:llrp=\"http://www.llrp.org/ltk/schema/core/encoding/xml/1.0\" xmlns:Impinj=\"http://developer.impinj.com/ltk/schema/encoding/xml/1.0\" Version=\"1\" MessageID=\"4\"><llrp:ROSpec><llrp:ROSpecID>1</llrp:ROSpecID><llrp:Priority>0</llrp:Priority><llrp:CurrentState>Disabled</llrp:CurrentState><llrp:ROBoundarySpec><llrp:ROSpecStartTrigger><llrp:ROSpecStartTriggerType>Null</llrp:ROSpecStartTriggerType></llrp:ROSpecStartTrigger><llrp:ROSpecStopTrigger><llrp:ROSpecStopTriggerType>Null</llrp:ROSpecStopTriggerType><llrp:DurationTriggerValue>0</llrp:DurationTriggerValue></llrp:ROSpecStopTrigger></llrp:ROBoundarySpec><llrp:AISpec><llrp:AntennaIDs>0</llrp:AntennaIDs><llrp:AISpecStopTrigger><llrp:AISpecStopTriggerType>Null</llrp:AISpecStopTriggerType><llrp:DurationTrigger>0</llrp:DurationTrigger></llrp:AISpecStopTrigger><llrp:InventoryParameterSpec><llrp:InventoryParameterSpecID>9</llrp:InventoryParameterSpecID><llrp:ProtocolID>EPCGlobalClass1Gen2</llrp:ProtocolID></llrp:InventoryParameterSpec></llrp:AISpec></llrp:ROSpec></llrp:ADD_ROSPEC>".getBytes());
bfos.close();
FileUtils fileUtils = EasyMock.createMock(FileUtils.class);
EasyMock.expect(fileUtils.getFilesName(path, FileUtils.FILE_ENDING_LLRP)).andReturn(Arrays.asList(new String[] { fileName } ));
EasyMock.replay(fileUtils);
PersistenceConfig persistenceConfig = EasyMock.createMock(PersistenceConfig.class);
EasyMock.expect(persistenceConfig.getRealPathROSpecDir()).andReturn(path).atLeastOnce();
EasyMock.replay(persistenceConfig);
LLRPControllerManager logicalReaderManager = EasyMock.createMock(LLRPControllerManager.class);
logicalReaderManager.define(EasyMock.eq("rospec"), EasyMock.isA(ADD_ROSPEC.class));
EasyMock.replay(logicalReaderManager);
ReadConfigImpl readConfig = new ReadConfigImpl();
readConfig.setFileUtils(fileUtils);
readConfig.setPersistenceConfig(persistenceConfig);
readConfig.setLlrpControllerManager(logicalReaderManager);
// TEST
readConfig.readAddROSpecs();
EasyMock.verify(fileUtils);
EasyMock.verify(persistenceConfig);
EasyMock.verify(logicalReaderManager);
}
示例2: testAddAccessSpec
import org.fosstrak.ale.server.llrp.LLRPControllerManager; //导入依赖的package包/类
/**
* test the loading of the access specs.
* @throws Exception test failure.
*/
@Test
public void testAddAccessSpec() throws Exception {
tempFolder.create();
File f = tempFolder.newFile("access.llrp");
final String fileName = f.getName();
// absolute path encodes the filename, thus remove it.
final String path = f.getAbsolutePath().replace(fileName, "");
FileOutputStream fos = new FileOutputStream(f);
BufferedOutputStream bfos = new BufferedOutputStream(fos);
bfos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><llrp:ADD_ACCESSSPEC xmlns:llrp=\"http://www.llrp.org/ltk/schema/core/encoding/xml/1.0\" xmlns:Impinj=\"http://developer.impinj.com/ltk/schema/encoding/xml/1.0\" Version=\"1\" MessageID=\"5\"><llrp:AccessSpec><llrp:AccessSpecID>1</llrp:AccessSpecID><llrp:AntennaID>0</llrp:AntennaID><llrp:ProtocolID>EPCGlobalClass1Gen2</llrp:ProtocolID><llrp:CurrentState>Disabled</llrp:CurrentState><llrp:ROSpecID>1</llrp:ROSpecID><llrp:AccessSpecStopTrigger><llrp:AccessSpecStopTrigger>Null</llrp:AccessSpecStopTrigger><llrp:OperationCountValue>0</llrp:OperationCountValue></llrp:AccessSpecStopTrigger><llrp:AccessCommand><llrp:C1G2TagSpec><llrp:C1G2TargetTag><llrp:MB>0</llrp:MB><llrp:Match>1</llrp:Match><llrp:Pointer>0</llrp:Pointer><llrp:TagMask>ffffffff</llrp:TagMask><llrp:TagData>01010101</llrp:TagData></llrp:C1G2TargetTag></llrp:C1G2TagSpec><llrp:C1G2Write><llrp:OpSpecID>1</llrp:OpSpecID><llrp:AccessPassword>0</llrp:AccessPassword><llrp:MB>0</llrp:MB><llrp:WordPointer>0</llrp:WordPointer><llrp:WriteData>ffff ffff</llrp:WriteData></llrp:C1G2Write></llrp:AccessCommand></llrp:AccessSpec></llrp:ADD_ACCESSSPEC>".getBytes());
bfos.close();
FileUtils fileUtils = EasyMock.createMock(FileUtils.class);
EasyMock.expect(fileUtils.getFilesName(path, FileUtils.FILE_ENDING_LLRP)).andReturn(Arrays.asList(new String[] { fileName } ));
EasyMock.replay(fileUtils);
PersistenceConfig persistenceConfig = EasyMock.createMock(PersistenceConfig.class);
EasyMock.expect(persistenceConfig.getRealPathAccessSpecDir()).andReturn(path).atLeastOnce();
EasyMock.replay(persistenceConfig);
LLRPControllerManager logicalReaderManager = EasyMock.createMock(LLRPControllerManager.class);
logicalReaderManager.defineAccessSpec(EasyMock.eq("access"), EasyMock.isA(ADD_ACCESSSPEC.class));
EasyMock.replay(logicalReaderManager);
ReadConfigImpl readConfig = new ReadConfigImpl();
readConfig.setFileUtils(fileUtils);
readConfig.setPersistenceConfig(persistenceConfig);
readConfig.setLlrpControllerManager(logicalReaderManager);
// TEST
readConfig.readAddAccessSpecs();
EasyMock.verify(fileUtils);
EasyMock.verify(persistenceConfig);
EasyMock.verify(logicalReaderManager);
}
示例3: setLlrpControllerManager
import org.fosstrak.ale.server.llrp.LLRPControllerManager; //导入依赖的package包/类
/**
* inject a handle to the llrp controller manager.
* @param llrpControllerManager the llrp controller manager to use.
*/
@Autowired
public void setLlrpControllerManager(LLRPControllerManager llrpControllerManager) {
this.llrpControllerManager = llrpControllerManager;
}