private void btnLogin_Click(object sender, EventArgs e) { var wifi = EncodingHelper.ToBytes(txtWifi.Text).ToHex(); var hard = NaryHelper.ToYmHex(txtHard.Text.Trim(), 4); var soft = NaryHelper.ToYmHex(txtSoft.Text.Trim(), 4); var req = IotRequest.CreateRequest(filter, txtMac.Text.Trim(), "00F1", soft + hard + wifi); Send(req); }
private string GetWeaHex(string mac) { var iotData = App.Cache.Get <IotData>($"iot_data_{mac}"); if (iotData != null && iotData.Weather != null) { var pm25 = int.Parse(iotData.Weather.aqi.pm25); var temp = double.Parse(iotData.Weather.condition.temp); var humi = int.Parse(iotData.Weather.condition.humidity); return($"{NaryHelper.ToYmHex(pm25, 2)}{NaryHelper.ToYmHex(temp, 4)}{NaryHelper.ToYmHex(humi, 2)}"); } return($"EEEEEEEE"); }