|
@@ -18,6 +18,7 @@ using System.Linq;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Diagnostics;
|
|
|
using MOKA_Factory_Tools.BLL;
|
|
|
+using Newtonsoft.Json;
|
|
|
|
|
|
namespace MOKA_Factory_Tools
|
|
|
{
|
|
@@ -4406,90 +4407,98 @@ namespace MOKA_Factory_Tools
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- string phone = midListNow.rokuCustomer.supportphone;
|
|
|
- Log.WriteInfoLog("Write Roku phone...");
|
|
|
- if (SerialCMD.SetROKUSupportPhone(TVPort, Encoding.ASCII.GetBytes(phone), out result, out data, out error, SerailDelay))
|
|
|
+ if ( midListNow.rokuCustomer.rokuData != null && midListNow.rokuCustomer.rokuData.Count != 0 )
|
|
|
{
|
|
|
- Log.WriteInfoLog("Check Roku phone...");
|
|
|
- if (SerialCMD.CheckROKUSupportPhone(TVPort, out result, out data, out error, SerailDelay))
|
|
|
+ foreach (var item in midListNow.rokuCustomer.rokuData )
|
|
|
{
|
|
|
- Log.WriteInfoLog("Read Roku phone...");
|
|
|
- if (SerialCMD.GetROKUSupportPhone(TVPort, out result, out data, out error, SerailDelay))
|
|
|
+ Log.WriteInfoLog(string.Format("{0} to be write", item.name));
|
|
|
+
|
|
|
+ string phone = item.supportphone;
|
|
|
+ Log.WriteInfoLog("Write Roku phone...");
|
|
|
+ if (SerialCMD.SetROKUSupportPhone(TVPort, Encoding.ASCII.GetBytes(phone), out result, out data, out error, SerailDelay))
|
|
|
{
|
|
|
- if (SerialInit.BytesCompare_Base64(data, Encoding.ASCII.GetBytes(phone)))
|
|
|
+ Log.WriteInfoLog("Check Roku phone...");
|
|
|
+ if (SerialCMD.CheckROKUSupportPhone(TVPort, out result, out data, out error, SerailDelay))
|
|
|
{
|
|
|
- Log.WriteInfoLog("ROKU phone 写入成功:" + Encoding.ASCII.GetString(data));
|
|
|
+ Log.WriteInfoLog("Read Roku phone...");
|
|
|
+ if (SerialCMD.GetROKUSupportPhone(TVPort, out result, out data, out error, SerailDelay))
|
|
|
+ {
|
|
|
+ if (SerialInit.BytesCompare_Base64(data, Encoding.ASCII.GetBytes(phone)))
|
|
|
+ {
|
|
|
+ Log.WriteInfoLog("ROKU phone 写入成功:" + Encoding.ASCII.GetString(data));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ErrMsg = string.Format("{0} Contrast ROKU phone fail!", SN);
|
|
|
+ Log.WriteErrorLog(ErrMsg);
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ErrMsg = string.Format("{0} Read ROKU phone fail!", SN);
|
|
|
+ Log.WriteErrorLog(ErrMsg);
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ErrMsg = string.Format("{0} Contrast ROKU phone fail!", SN);
|
|
|
+ ErrMsg = string.Format("{0} Check ROKU phone fail!", SN);
|
|
|
Log.WriteErrorLog(ErrMsg);
|
|
|
goto end;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ErrMsg = string.Format("{0} Read ROKU phone fail!", SN);
|
|
|
+ ErrMsg = string.Format("{0} Write ROKU phone fail!", SN);
|
|
|
Log.WriteErrorLog(ErrMsg);
|
|
|
goto end;
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ErrMsg = string.Format("{0} Check ROKU phone fail!", SN);
|
|
|
- Log.WriteErrorLog(ErrMsg);
|
|
|
- goto end;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ErrMsg = string.Format("{0} Write ROKU phone fail!", SN);
|
|
|
- Log.WriteErrorLog(ErrMsg);
|
|
|
- goto end;
|
|
|
- }
|
|
|
|
|
|
- string url = midListNow.rokuCustomer.supporturl;
|
|
|
- Log.WriteInfoLog("Write Roku url...");
|
|
|
- if (SerialCMD.SetROKUSupportURL(TVPort, Encoding.ASCII.GetBytes(url), out result, out data, out error, SerailDelay))
|
|
|
- {
|
|
|
- Log.WriteInfoLog("Check Roku url...");
|
|
|
- if (SerialCMD.CheckROKUSupportURL(TVPort, out result, out data, out error, SerailDelay))
|
|
|
- {
|
|
|
- Log.WriteInfoLog("Read Roku url...");
|
|
|
- if (SerialCMD.GetROKUSupportURL(TVPort, out result, out data, out error, SerailDelay))
|
|
|
+ string url = item.supporturl;
|
|
|
+ Log.WriteInfoLog("Write Roku url...");
|
|
|
+ if (SerialCMD.SetROKUSupportURL(TVPort, Encoding.ASCII.GetBytes(url), out result, out data, out error, SerailDelay))
|
|
|
{
|
|
|
- if (SerialInit.BytesCompare_Base64(data, Encoding.ASCII.GetBytes(url)))
|
|
|
+ Log.WriteInfoLog("Check Roku url...");
|
|
|
+ if (SerialCMD.CheckROKUSupportURL(TVPort, out result, out data, out error, SerailDelay))
|
|
|
{
|
|
|
- Log.WriteInfoLog("ROKU url 写入成功:" + Encoding.ASCII.GetString(data));
|
|
|
+ Log.WriteInfoLog("Read Roku url...");
|
|
|
+ if (SerialCMD.GetROKUSupportURL(TVPort, out result, out data, out error, SerailDelay))
|
|
|
+ {
|
|
|
+ if (SerialInit.BytesCompare_Base64(data, Encoding.ASCII.GetBytes(url)))
|
|
|
+ {
|
|
|
+ Log.WriteInfoLog("ROKU url 写入成功:" + Encoding.ASCII.GetString(data));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ErrMsg = string.Format("{0} Contrast ROKU url fail!", SN);
|
|
|
+ Log.WriteErrorLog(ErrMsg);
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ErrMsg = string.Format("{0} Read ROKU url fail!", SN);
|
|
|
+ Log.WriteErrorLog(ErrMsg);
|
|
|
+ goto end;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ErrMsg = string.Format("{0} Contrast ROKU url fail!", SN);
|
|
|
+ ErrMsg = string.Format("{0} Check ROKU url fail!", SN);
|
|
|
Log.WriteErrorLog(ErrMsg);
|
|
|
goto end;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ErrMsg = string.Format("{0} Read ROKU url fail!", SN);
|
|
|
+ ErrMsg = string.Format("{0} Write ROKU url fail!", SN);
|
|
|
Log.WriteErrorLog(ErrMsg);
|
|
|
goto end;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ErrMsg = string.Format("{0} Check ROKU url fail!", SN);
|
|
|
- Log.WriteErrorLog(ErrMsg);
|
|
|
- goto end;
|
|
|
- }
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- ErrMsg = string.Format("{0} Write ROKU url fail!", SN);
|
|
|
- Log.WriteErrorLog(ErrMsg);
|
|
|
- goto end;
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
if (midListNow.rokuCustomer.remotetype.Length > 0 && midListNow.rokuCustomer.remotetype != "null")
|
|
|
{
|
|
|
byte[] remotetype = new byte[1] { Convert.ToByte(midListNow.rokuCustomer.remotetype) };
|
|
@@ -5333,7 +5342,13 @@ namespace MOKA_Factory_Tools
|
|
|
private void OnBtnOtherView(object sender, EventArgs e)
|
|
|
{
|
|
|
if (midListNow.rokuCustomer != null)
|
|
|
- MessageBox.Show("Roku TV\r\n" + "Brand:" + midListNow.rokuCustomer.brand + "\r\nOEM Model:" + midListNow.rokuCustomer.oemmodel + "\r\nDate:" + midListNow.rokuCustomer.productiondate + "\r\nRegion:" + midListNow.rokuCustomer.region + "\r\nPhone:" + midListNow.rokuCustomer.supportphone + "\r\nUrl:" + midListNow.rokuCustomer.supporturl + "\r\nRemote Type:" + midListNow.rokuCustomer.remotetype, LResource.ProductMsg);
|
|
|
+ MessageBox.Show("Roku TV\r\n" + "Brand:" +
|
|
|
+ midListNow.rokuCustomer.brand + "\r\nOEM Model:" +
|
|
|
+ midListNow.rokuCustomer.oemmodel + "\r\nDate:" +
|
|
|
+ midListNow.rokuCustomer.productiondate + "\r\nRegion:" +
|
|
|
+ midListNow.rokuCustomer.region + "\r\nPhone:" +
|
|
|
+ JsonConvert.SerializeObject(midListNow.rokuCustomer.rokuData).ToString() + "\r\nData:" +
|
|
|
+ midListNow.rokuCustomer.remotetype, LResource.ProductMsg);
|
|
|
else
|
|
|
MessageBox.Show("null");
|
|
|
}
|