當前位置: 首頁>>代碼示例>>Java>>正文


Java DeviceStatus類代碼示例

本文整理匯總了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);
}
 
開發者ID:smartdevicelink,項目名稱:sdl_android,代碼行數:17,代碼來源:DeviceStatusTests.java

示例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);
    }
}
 
開發者ID:smartdevicelink,項目名稱:sdl_android,代碼行數:29,代碼來源:DeviceStatusTests.java

示例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;
}
 
開發者ID:smartdevicelink,項目名稱:sdl_android,代碼行數:45,代碼來源:Validator.java


注:本文中的com.smartdevicelink.proxy.rpc.DeviceStatus類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。