本文整理汇总了Java中com.smartdevicelink.proxy.rpc.DeviceStatus类的典型用法代码示例。如果您正苦于以下问题:Java DeviceStatus类的具体用法?Java DeviceStatus怎么用?Java DeviceStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeviceStatus类属于com.smartdevicelink.proxy.rpc包,在下文中一共展示了DeviceStatus类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.smartdevicelink.proxy.rpc.DeviceStatus; //导入依赖的package包/类
@Override
public void setUp(){
msg = new DeviceStatus();
msg.setBattLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
msg.setBtIconOn(Test.GENERAL_BOOLEAN);
msg.setCallActive(Test.GENERAL_BOOLEAN);
msg.setECallEventActive(Test.GENERAL_BOOLEAN);
msg.setMonoAudioOutputMuted(Test.GENERAL_BOOLEAN);
msg.setPhoneRoaming(Test.GENERAL_BOOLEAN);
msg.setPrimaryAudioSource(Test.GENERAL_PRIMARYAUDIOSOURCE);
msg.setSignalLevelStatus(Test.GENERAL_DEVICELEVELSTATUS);
msg.setStereoAudioOutputMuted(Test.GENERAL_BOOLEAN);
msg.setTextMsgAvailable(Test.GENERAL_BOOLEAN);
msg.setVoiceRecOn(Test.GENERAL_BOOLEAN);
}
示例2: testJson
import com.smartdevicelink.proxy.rpc.DeviceStatus; //导入依赖的package包/类
public void testJson(){
JSONObject reference = new JSONObject();
try{
reference.put(DeviceStatus.KEY_BATT_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
reference.put(DeviceStatus.KEY_SIGNAL_LEVEL_STATUS, Test.GENERAL_DEVICELEVELSTATUS);
reference.put(DeviceStatus.KEY_PRIMARY_AUDIO_SOURCE, Test.GENERAL_PRIMARYAUDIOSOURCE);
reference.put(DeviceStatus.KEY_BT_ICON_ON, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_CALL_ACTIVE, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_E_CALL_EVENT_ACTIVE, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_MONO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_STEREO_AUDIO_OUTPUT_MUTED, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_TEXT_MSG_AVAILABLE, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_PHONE_ROAMING, Test.GENERAL_BOOLEAN);
reference.put(DeviceStatus.KEY_VOICE_REC_ON, Test.GENERAL_BOOLEAN);
JSONObject underTest = msg.serializeJSON();
assertEquals(Test.MATCH, reference.length(), underTest.length());
Iterator<?> iterator = reference.keys();
while(iterator.hasNext()){
String key = (String) iterator.next();
assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
}
} catch(JSONException e){
fail(Test.JSON_FAIL);
}
}
示例3: validateDeviceStatus
import com.smartdevicelink.proxy.rpc.DeviceStatus; //导入依赖的package包/类
public static boolean validateDeviceStatus(DeviceStatus item1, DeviceStatus item2){
if(item1 == null){
return ( item2 == null );
}
if(item2 == null){
return ( item1 == null );
}
if(item1.getBtIconOn() != item2.getBtIconOn()){
return false;
}
if(item1.getCallActive() != item2.getCallActive()){
return false;
}
if(item1.getECallEventActive() != item2.getECallEventActive()){
return false;
}
if(item1.getMonoAudioOutputMuted() != item2.getMonoAudioOutputMuted()){
return false;
}
if(item1.getPhoneRoaming() != item2.getPhoneRoaming()){
return false;
}
if(item1.getStereoAudioOutputMuted() != item2.getStereoAudioOutputMuted()){
return false;
}
if(item1.getTextMsgAvailable() != item2.getTextMsgAvailable()){
return false;
}
if(item1.getVoiceRecOn() != item2.getVoiceRecOn()){
return false;
}
if(item1.getBattLevelStatus() != item2.getBattLevelStatus()){
return false;
}
if(item1.getPrimaryAudioSource() != item2.getPrimaryAudioSource()){
return false;
}
if(item1.getSignalLevelStatus() != item2.getSignalLevelStatus()){
return false;
}
return true;
}