Esempio n. 1
0
        public async void ExecuteSerialWriteRead_Click(object sender, EventArgs e)
        {
            OperationsPanel.Enabled  = false;
            CredentialsPanel.Enabled = false;
            Response.Text            = "Waiting for response..";
            Status.Text = "Executing..";

            Bolt myBolt = new Bolt(ApiKey.Text.Trim(), DeviceId.Text.Trim());

            string till = SerialWriteReadTill.Value.ToString();
            string data = SerialWriteReadData.Text.Trim();

            RequestURL.Text = BuildRequestUrl("serialWR", new List <string> {
                "data", "till"
            }, new List <string> {
                Uri.EscapeUriString(data), till
            });

            Response response = await myBolt.SerialWriteRead(data, till);

            Response.Text            = response.ResponseString;
            Status.Text              = "Ready";
            OperationsPanel.Enabled  = true;
            CredentialsPanel.Enabled = true;
        }