| | |
| | | { |
| | | var tempD = new VolumeResponseData(); |
| | | tempD.command = data[10].ToString() + data[11].ToString(); |
| | | tempD.value = Convert.ToInt32(data[13].ToString(), 16); |
| | | tempD.value = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16); |
| | | result = new VolumeResponseAllData { volumeResponseData = tempD }; |
| | | DebugPrintLog($"UI收到通知后的主题_command:0456_{ topic}"); |
| | | } |
| | |
| | | ///<summary > |
| | | ///音量 |
| | | ///<para>命令值: comandValue</para> |
| | | ///<para>comandValue: 0 静音</para> |
| | | ///<para>comandValue:1 最小音量</para> |
| | | ///<para>comandValue:2~13 音量 </para> |
| | | ///<para>comandValue:14 最大音量</para> |
| | | ///<para>comandValue: 0-0x64 音量</para> |
| | | /// </summary> |
| | | public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetVolumeAsync(int comandValue) |
| | | { |
| | |
| | | |
| | | /// <summary> |
| | | /// 音量发送数据 |
| | | ///<para>comandValue: 0 静音</para> |
| | | ///<para>comandValue:1 最小音量</para> |
| | | ///<para>comandValue:2~13 音量 </para> |
| | | ///<para>comandValue:14 最大音量</para> |
| | | ///<para>comandValue: 0-100 音量</para> |
| | | /// </summary> |
| | | public string VolumeData(int comandValue) |
| | | { |
| | |
| | | { |
| | | if (comandValue >= 1) |
| | | { |
| | | //comandValue = comandValue * 100; |
| | | //float v = (float)100 / 15; |
| | | //int vv = Convert.ToInt32(v * 100); |
| | | //var comandValueTemp = comandValue / vv; |
| | | //if (comandValueTemp == 0) |
| | | //{ |
| | | // comandValueTemp = 1; |
| | | //} |
| | | cValue = Convert.ToString(comandValue, 16).ToUpper(); |
| | | cValue = "F" + cValue; |
| | | if (cValue.Length == 1) |
| | | { |
| | | cValue = "0" + cValue; |
| | | } |
| | | else |
| | | { |
| | | cValue = cValue; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |