mobile|Protocol Version|4.0
mobile|Available Template List|1|2|3|4|5|6|7|8|9|10
mobile|Selected Template|1
-mobile|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|102|200|201|202|203|204
-mobile|Selected Feature List|1|5|1000:1000|100|101|1001:10
-mobile|Available Chart List|CPU|CPU core|CPU frequency|Heap allocation|Process Size|Memory|Screenshot|UI event|Disk IO|Network IO|Device|Energy
-mobile|Protocol Version|4.1
-mobile|Available Template List|1|2|3|4|5|6|7|8|9|10
-mobile|Selected Template|1
mobile|Available Feature List|1|1000|4|5|6|7|8|9|100|101|1001|102|200|201|202|203|204|206
mobile|Selected Feature List|1|5|1000:1000|100|101|1001:10
mobile|Available Chart List|CPU|CPU core|CPU frequency|Heap allocation|Process Size|Memory|Screenshot|UI event|Disk IO|Network IO|Device|Energy
import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.protocol.p30.ProtocolConfig30;
import org.tizen.dynamicanalyzer.protocol.p40.ProtocolConfig40;
+import org.tizen.dynamicanalyzer.protocol.p41.ProtocolConfig41;
import org.tizen.dynamicanalyzer.setting.Feature;
public enum Protocol {
case VERSION_40:
configs = ProtocolConfig40.getProtocolConfig(feature);
break;
+ case VERSION_41:
+ configs = ProtocolConfig41.getProtocolConfig(feature);
+ break;
default: // unknown protocol
throw new UnknownProtocolException();
}
package org.tizen.dynamicanalyzer.protocol.p41;
import java.io.File;
+import java.util.Set;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DAResult;
import org.tizen.dynamicanalyzer.communicator.UnsupportedProtocolException;
import org.tizen.dynamicanalyzer.control.IProgress;
import org.tizen.dynamicanalyzer.protocol.p40.Communicator40;
+import org.tizen.dynamicanalyzer.setting.Feature;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
+import org.tizen.dynamicanalyzer.setting.TargetData;
import org.tizen.dynamicanalyzer.swap.communicator.SwapErrorCode;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.utils.DownloadContentfileManager;
}
@Override
+ public DAResult sendConfigurationMessage(IProgress progress) {
+ // send config message
+ ProtocolSerializer ps = new ProtocolSerializer();
+ ps.setMessageID(ProtocolConstant41.MSG_CONFIG);
+
+ // set feature flag value
+ Set<Feature> selectedFeatures = SettingDataManager.INSTANCE.getSelectedFeatureSet();
+ byte[] featureFlag = ProtocolConfig41.getFeatureFlagValue(selectedFeatures);
+ ps.putByteArray(featureFlag);
+
+ // set sampling period value
+ TargetData target = SettingDataManager.INSTANCE.getConnectedTarget();
+ int systemPeriod = target.getSelectedFeatureValue(Feature.SYSTEM_SAMPLING_RATE);
+ if (systemPeriod < 0) {
+ systemPeriod = Feature.SYSTEM_SAMPLING_RATE.getData().getDefaultValue();
+ }
+ int samplingPeriod = target.getSelectedFeatureValue(Feature.FUNCTION_SAMPLING_RATE);
+ if (samplingPeriod < 0) {
+ samplingPeriod = Feature.FUNCTION_SAMPLING_RATE.getData().getDefaultValue();
+ }
+ ps.putInt(systemPeriod);
+ ps.putInt(samplingPeriod);
+
+ byte[] msg = ps.toByteArray();
+
+ AckMessage result = parent.handleControlMessage(msg);
+
+ if (result != null && result.isSuccess()
+ && result.isCorrectID(ProtocolConstant41.MSG_CONFIG_ACK)) {
+ return new DAResult(ErrorCode.SUCCESS);
+ } else {
+ return new DAResult(ErrorCode.ERR_CONFIG_FAILED);
+ }
+ }
+
+ @Override
public DAResult sendUIHierarchyMessage(IProgress progress, int requestOption)
throws InterruptedException, UnsupportedProtocolException {
ProtocolSerializer ps = new ProtocolSerializer();