"HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)",
"WPS_PBC_AP":"Set name of available AP with WPS PBC function",
"WPS_PIN_AP":"Set name of available AP with WPS PIN function",
- "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533."
+ "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.",
+ "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4"
}]
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+using NUnit.Framework.TUnit;
+using System;
+using System.IO;
+
+namespace PreconditionUtils
+{
+ public class PreconditionUtils
+ {
+ public static string STREAMING_URI = null;
+
+ public static void SetPrecondition()
+ {
+ string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json");
+ int index = 0;
+ string[] resultArray = StringParser(result);
+ foreach (string item in resultArray)
+ {
+ switch (item)
+ {
+ case "STREAMING_URI":
+ // Remove backslash
+ resultArray[index + 1] = resultArray[index + 1].Replace("\\", "");
+ STREAMING_URI = resultArray[index + 1];
+ break;
+ default:
+ break;
+ }
+ index++;
+ }
+ }
+
+ private static string ReadFile(string path)
+ {
+ string result = null;
+ string url = path;
+
+ try
+ {
+ StreamReader reader = File.OpenText(path);
+ result = reader.ReadToEnd();
+ }
+ catch (Exception e)
+ {
+ LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message);
+ }
+
+ return result;
+ }
+ private static string[] StringParser(string TCID)
+ {
+ string[] delimiter = { "[{\"", "\":\"", "\",\"", "\":", ",\"", "\"}]", "}" };
+ string[] stringPieces = null;
+
+ try
+ {
+ stringPieces = TCID.Split(delimiter, StringSplitOptions.None);
+ }
+ catch (Exception e)
+ {
+ LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "ResultParser : " + e.Message);
+ }
+
+ return stringPieces;
+ }
+ }
+}
"HERE_MAPS_PROVIDER_KEY_FOR_XAMARIN":"Set the HERE_MAPS_PROVIDER_KEY.(for xamarin)",
"WPS_PBC_AP":"Set name of available AP with WPS PBC function",
"WPS_PIN_AP":"Set name of available AP with WPS PIN function",
- "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533."
+ "PIN_NUMBER_OF_WPS_PIN_AP":"Set pin number of WPS_PIN_AP. The pin number should be generated with the checksum defined in WSC spec (Wi-Fi Simple Configuration Technical Specification). If you are not familiar with it, please use an example number, 47363533.",
+ "STREAMING_URI":"Set the streaming uri such as http://www.samsung.com/xx/xx/aa.mp4"
}]