2021-09-07 1.之前标准空调模块协议是13位,新的空调回复协议变成长度19位 2.增加单独的播放和暂定指令,解决取反问题
| | |
| | | playPauseBtn.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | HDLCommand.audioCtrl(appliancesInfo, HDLAudio.SET_AUDIO_PLAYPAUSE); |
| | | HDLCommand.audioCtrl(appliancesInfo, HDLAudio.SET_AUDIO_PLAY); |
| | | } |
| | | }); |
| | | |
| | | playStopBtn.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View view) { |
| | | HDLCommand.audioCtrl(appliancesInfo, HDLAudio.SET_AUDIO_PLAYSTOP); |
| | | HDLCommand.audioCtrl(appliancesInfo, HDLAudio.SET_AUDIO_STOP); |
| | | } |
| | | }); |
| | | |
| | |
| | | */ |
| | | private void tv_mesSetText(String mes) { |
| | | airText.setText(mes); |
| | | showToast(mes); |
| | | // showToast(mes); |
| | | } |
| | | } |
| | |
| | | android:layout_height="wrap_content" |
| | | android:text="获取当前歌曲信息" /> |
| | | |
| | | <!-- <Button--> |
| | | <!-- android:id="@+id/playpause"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="播放/暂停" />--> |
| | | |
| | | <!-- <Button--> |
| | | <!-- android:id="@+id/playstop"--> |
| | | <!-- android:layout_width="wrap_content"--> |
| | | <!-- android:layout_height="wrap_content"--> |
| | | <!-- android:text="播放/停止" />--> |
| | | <Button |
| | | android:id="@+id/playpause" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="播放/暂停" /> |
| | | android:text="播放" /> |
| | | |
| | | <Button |
| | | android:id="@+id/playstop" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="播放/停止" /> |
| | | android:text="停止" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | && HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getDeviceType() != HDLApConfig.TYPE_AC_PANEL |
| | | && appliancesInfo.getChannelNum() == HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j).getChannelNum()) { |
| | | newInfo = HDLDeviceManager.devicesDataList.get(i).getAppliancesInfoList().get(j); |
| | | |
| | | if (newInfo.getArrCurState() == null || newInfo.getArrCurState().length != 13) { |
| | | //2021-09-07 之前标准空调模块协议是13位,新的空调回复协议变成长度19位,增加兼容处理 |
| | | if (newInfo.getArrCurState() == null || newInfo.getArrCurState().length < 13) { |
| | | newInfo.setArrCurState(getNewAcByte()); |
| | | } |
| | | airBytes = newInfo.getArrCurState(); |
| | |
| | | public static final int GET_AUDIO_CURRRENT_INFO = 210; |
| | | public static final int SET_NEXT_LIST = 211; |
| | | public static final int SET_PRE_LIST = 212; |
| | | public static final int SET_AUDIO_PLAY = 213;//2021-09-07 增加单独的播放和暂定指令,解决取反问题 |
| | | public static final int SET_AUDIO_STOP = 214;//暂停 |
| | | |
| | | public static final int TEXT = 300; |
| | | |
| | |
| | | int command; |
| | | int sourceId = info.getIntCurState(); |
| | | switch (type) { |
| | | case HDLAudio.SET_AUDIO_PLAY://2021-09-07 增加单独的播放和暂定指令,解决取反问题 |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PLAY"); |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x0D}; |
| | | break; |
| | | case HDLAudio.SET_AUDIO_STOP://2021-09-07 增加单独的播放和暂定指令,解决取反问题 |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "STOP"); |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x53, 0x54, 0x4F, 0x50, 0x0D}; |
| | | break; |
| | | case HDLAudio.SET_AUDIO_PLAYSTOP: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x53, 0x54, 0x4F, 0x50, 0x0D}; |