• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BaseTransportConfig类的典型用法和代码示例

java 1次浏览

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

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

示例1: SdlProxyALM

点赞 3

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
/**
 * Constructor for the SdlProxy object, the proxy for communicating between the App and SDL via specified transport.
 *
 * Takes advantage of the advanced lifecycle management.
 *
 * @param listener Reference to the object in the App listening to callbacks from SDL.
 * @param appName Name of the application displayed on SDL.
 * @param isMediaApp Indicates if the app is a media application.
 * @param transportConfig Initial configuration for transport.
 * @throws SdlException
 */
public SdlProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp,
				   Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
				   BaseTransportConfig transportConfig) throws SdlException {
	super(  listener,
               /*sdl proxy configuration resources*/null,
               /*enable advanced lifecycle management*/true,
			appName,
               /*TTS Name*/null,
               /*ngn media app*/null,
               /*vr synonyms*/null,
               /*is media app*/isMediaApp,
               /*sdlMsgVersion*/null,
               /*language desired*/languageDesired,
               /*HMI Display Language Desired*/hmiDisplayLanguageDesired,
               /*App Type*/null,
               /*App ID*/appID,
               /*autoActivateID*/null,
               /*callbackToUIThread*/ false,
			transportConfig);

	SdlTrace.logProxyEvent("Application constructed SdlProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, and isMediaApp.", SDL_LIB_TRACE_KEY);
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:34,
代码来源:SdlProxyALM.java

示例2: SdlConnection

点赞 3

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param listener Sdl connection listener.
 * @param transportConfig Transport configuration for this connection.
 */
public SdlConnection(BaseTransportConfig transportConfig) {
	RouterServiceValidator vlad = null;
	//Let's check if we can even do multiplexing
	if(transportConfig.getTransportType() == TransportType.MULTIPLEX){
		ComponentName tempCompName = SdlBroadcastReceiver.consumeQueuedRouterService();
		MultiplexTransportConfig multiConfig = (MultiplexTransportConfig)transportConfig;
		if(tempCompName!=null){
			vlad =new RouterServiceValidator(multiConfig.getContext(),tempCompName);
		}else{
			vlad =new RouterServiceValidator(multiConfig.getContext());
		}
		//vlad.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
		vlad.setSecurityLevel(multiConfig.getSecurityLevel());
	}
	constructor(transportConfig,vlad);
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:23,
代码来源:SdlConnection.java

示例3: testHandleInitResult

点赞 3

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public void testHandleInitResult() {
	byte testWiproVersion = (byte) 0x0B;
	boolean testInitResult = true;
	MockInterfaceBroker interfaceBroker = new MockInterfaceBroker();
	BaseTransportConfig transportConfig = new BTTransportConfig(true);
	MockSdlSecurityBase mockSdlSecurityBase = new MockSdlSecurityBase();
	
	SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,interfaceBroker, transportConfig);
	
	assertNotNull(Test.NOT_NULL, mockSdlSecurityBase);
	assertNotNull(Test.NOT_NULL, testSdlSession);
	
	testSdlSession.setSdlSecurity(mockSdlSecurityBase);

	mockSdlSecurityBase.handleSdlSession(testSdlSession);
	
	assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession(), testSdlSession);
	assertEquals(Test.MATCH, mockSdlSecurityBase.getSdlSession().getSessionId(), testSdlSession.getSessionId());
	
	mockSdlSecurityBase.handleInitResult(testInitResult);
	
	assertEquals(Test.MATCH, testInitResult, mockSdlSecurityBase.getInitSuccess());
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:24,
代码来源:SdlSecurityBaseTest.java

示例4: testConstructor

点赞 3

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
/**
 * This is a unit test for the following methods : 
 * {@link com.smartdevicelink.streaming.StreamPacketizer#StreamPacketizer(IStreamListener, InputStream, SessionType, byte)}
 */
public void testConstructor () {
	
	// Test Values
	byte            testSessionId   = (byte) 0x0A;
	SessionType     testSessionType = SessionType.RPC;
	InputStream     testInputStream = null;
	byte            testWiproVersion = (byte) 0x0B;
	IStreamListener testListener    = new MockStreamListener();
	MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
	BaseTransportConfig _transportConfig = new BTTransportConfig(true);
	SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
	try {
		testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
		StreamPacketizer testStreamPacketizer = new StreamPacketizer(testListener, testInputStream, testSessionType, testSessionId, testSdlSession);
		assertNotNull(Test.NOT_NULL, testStreamPacketizer);
					
		// NOTE: Cannot test thread handling methods currently.
		
	} catch (IOException e) {
		fail("IOException was thrown.");
	}
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:27,
代码来源:StreamPacketizerTests.java

示例5: testConstructor

点赞 3

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
/**
 * This is a unit test for the following methods : 
 * {@link com.smartdevicelink.streaming.StreamRPCPacketizer#StreamRPCPacketizer(SdlProxyBase, IStreamListener, InputStream, RPCRequest, SessionType, byte, byte, long, SdlSession)}
 */
public void testConstructor () {
	
	// Test Values
	byte testSessionId           = (byte) 0x0A;
	byte testWV                  = (byte) 0x0B;
	RPCRequest  testRequest      = new RPCRequest("test");
	SessionType testSessionType  = SessionType.RPC;
	InputStream testInputStream  = null;
	IStreamListener testListener = new MockStreamListener();
	
	byte            testWiproVersion = (byte) 0x0B;
	MockInterfaceBroker _interfaceBroker = new MockInterfaceBroker();
	BaseTransportConfig _transportConfig = new BTTransportConfig(true);
	SdlSession testSdlSession = SdlSession.createSession(testWiproVersion,_interfaceBroker, _transportConfig);
	try {
		testInputStream = new BufferedInputStream(new ByteArrayInputStream("sdl streaming test".getBytes()));
		StreamRPCPacketizer testStreamRpcPacketizer = new StreamRPCPacketizer(null, testListener, testInputStream, testRequest, testSessionType, testSessionId, testWV, testWV, testSdlSession);
		assertNotNull(Test.NOT_NULL, testStreamRpcPacketizer);
		
		// NOTE: Cannot test thread handling methods currently.
		
	} catch (IOException e) {
		fail("IOException was thrown.");
	}		
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:30,
代码来源:StreamRPCPacketizerTests.java

示例6: SdlProxyBase

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
protected SdlProxyBase(proxyListenerType listener, SdlProxyConfigurationResources sdlProxyConfigurationResources, 
		boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName, 
		String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SdlMsgVersion sdlMsgVersion, 
		Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, 
		String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sHashID, Boolean bEnableResume, BaseTransportConfig transportConfig) 
		throws SdlException 
{
		performBaseCommon(listener, sdlProxyConfigurationResources, enableAdvancedLifecycleManagement, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp,
			sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, appID, autoActivateID, callbackToUIThread, preRegister, sHashID, bEnableResume, transportConfig);
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:11,
代码来源:SdlProxyBase.java

示例7: createSession

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public static SdlSession createSession(byte wiproVersion, ISdlConnectionListener listener, BaseTransportConfig btConfig) {
	
	SdlSession session =  new SdlSession();
	session.wiproProcolVer = wiproVersion;
	session.sessionListener = listener;
	session.transportConfig = btConfig;
				
	return session;
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:10,
代码来源:SdlSession.java

示例8: getBroadcastComment

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public String getBroadcastComment(BaseTransportConfig myTransport) {
	SdlConnection connection = null;
	if (myTransport.shareConnection()) {
		 connection = findTheProperConnection(myTransport);			
	} else {
		connection = this._sdlConnection;
	}
	
	if (connection != null)
		return connection.getBroadcastComment();
	
	return "";
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:14,
代码来源:SdlSession.java

示例9: findTheProperConnection

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
private static SdlConnection findTheProperConnection(BaseTransportConfig config) {
	SdlConnection connection = null;
	
	int minCount = 0;
	for (SdlConnection c : shareConnections) {
		if (c.getCurrentTransportType() == config.getTransportType()) {
			if (minCount == 0 || minCount >= c.getRegisterCount()) {
				connection = c;
				minCount = c.getRegisterCount();
			}
		}
	}
	
	return connection;
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:16,
代码来源:SdlSession.java

示例10: setTransportType

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public Builder setTransportType(BaseTransportConfig val)
{ mTransport = val; return this; }
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:3,
代码来源:SdlProxyBuilder.java

示例11: getTransportConfig

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public BaseTransportConfig getTransportConfig() {
	return this.transportConfig;
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:4,
代码来源:SdlSession.java

示例12: SdlConnectionTestClass

点赞 2

import com.smartdevicelink.transport.BaseTransportConfig; //导入依赖的package包/类
public SdlConnectionTestClass(BaseTransportConfig transportConfig) {
	super(transportConfig);
}
 

开发者ID:smartdevicelink,
项目名称:sdl_android,
代码行数:4,
代码来源:WiProProtocolTests.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)