コード例 #1
0
ファイル: PhoneServicePage.xaml.cs プロジェクト: rphuang/riot
 protected override void OnAppearing()
 {
     Initialize();
     // temporary: make sure all sensors are started
     if (_active)
     {
         _host.Start();
     }
 }
コード例 #2
0
 private void StartPhoneService()
 {
     ServiceOnOffButton.Text = "S.Off";
     _phoneServiceStarted    = true;
     _host.Start();
     _host.ProcessRequestsAsync(null);
     if (_jsonForEnableCommandToSpeech == null)
     {
         string hostName = Dns.GetHostName(); // Retrive the Name of HOST
         var    entry    = Dns.GetHostEntry(hostName);
         string myIP     = entry.AddressList[0].ToString();
         string port     = _host.GetServicePort();
         _jsonForEnableCommandToSpeech = $"{{\"piCar.commandToSpeechMode\": \"yes\", \"piCar.commandToSpeechService\": \"http://{myIP}{port}/cmd/speak\"}}";
     }
     _piCar.PostSetting(_jsonForEnableCommandToSpeech);
 }