Пример #1
0
        private bool getStatus(string statusJSON)
        {
            if (statusJSON.Length > 0)
            {
                s = JsonConvert.DeserializeObject <Status>(statusJSON);

                if (s.UIPort != radioServer.Port)
                {
                    UpdateMSGtoUI($"Service UI port not match, update UI port to service : {radioServer.Port}", FConstants.FreyaLogLevel.FreyaInfo);
                    return(getStatus(radioClient.Send(JsonConvert.SerializeObject(new FMsg {
                        Type = "CMD", Data = "SetUIPort", Data2 = radioServer.Port.ToString()
                    }))));
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                UpdateMSGtoUI($"Getstatus - Service No Response! (Service port: {radioClient.GetPort()})", FConstants.FreyaLogLevel.FreyaInfo);
                logger.WriteLine($"[FreyaUI] GetStatus - Service No Response! (Service port: {radioClient.GetPort()})");
                return(false); //沒有收到回應,Server not ready
            }
        }