Devkit.WebConnectPlugin.WebDevice.Write C# (CSharp) Method

Write() public method

public Write ( ushort address, ushort data ) : void
address ushort
data ushort
return void
        public override void Write(ushort address, ushort data)
        {
            // if 0 is written, issue request to queued-up url
            if (data == 0)
            {
                try
                {
                    var url = this._downloadUrl.ToString();
                    this._webData = new WebClient().DownloadData(url);
                }
                catch
                {
                    // any errors at all, simply indicate no data available for simplicity
                    this._webData = null;
                }
                _webDataPtr = 0;
                _downloadUrl = null;
                return;
            }

            // append to the url
            if (this._downloadUrl == null) this._downloadUrl = new StringBuilder();
            this._downloadUrl.Append((char)data);
        }