private void Start() { Initialize(); _active = true; StartStopButton.Text = "Stop"; string lsv = string.Join("\n", _host.Prefixes); TextLabel.Text = $"HttpHost started at {DateTime.Now} listening:\n{lsv}"; _host.Start(); _host.ProcessRequestsAsync(this); ProcessActionAsync(); }
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); }