JLChen
2020-10-27 3c696793619750511f660d2b0ff8b303cb9fd081
2020-10-27 1.修改音乐协议
9个文件已修改
173 ■■■■ 已修改文件
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/AudioActivity.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/MainActivity.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLAudio/HDLAudio.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLCommand.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLUdpCore.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Parser/DeviceParser.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/Util/TransformUtil/HDLUtlis.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hdl_core/src/main/java/com/hdl/sdk/hdl_core/Util/TransformUtil/StringUtil.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/AudioActivity.java
@@ -22,6 +22,18 @@
import java.util.ArrayList;
import java.util.List;
/**
 * 音源说明:
 * 1------------------------SD-CARD
 * 2------------------------NAS-HDD
 * 3------------------------SERVER    //暂未用
 * 4------------------------WEB-RADIO //暂未用
 * 5------------------------RADIO
 * 6------------------------AUDIO-IN
 * 7------------------------INTERCOM  //暂未用
 * 8------------------------ BLUETOOTH
 * 9------------------------ S/PDIF       //AUDIO_IN2
 */
public class AudioActivity extends AppCompatActivity {
    private Button getCurSongInfoBtn, playPauseBtn, playStopBtn, preSongBtn, nextSongBtn, volMinBtn, volMidBtn, volMaxBtn, modeBtn, nextListBtn, preListBtn;
    private AppliancesInfo appliancesInfo;
@@ -31,6 +43,7 @@
    private TextView curSongInfoTv, curSongNameTv;
    private int curListNum;//由于不同厂商需求,必须自行记录当前的列表号
    private boolean isInit;//记录是否初始化
    private int SourceId = 1;//音源ID号
    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -56,6 +69,10 @@
        if (!EventBus.getDefault().isRegistered(this)) {
            EventBus.getDefault().register(this);
        }
        //设置音源号
        appliancesInfo.setIntCurState(SourceId);
        adapter = new ArrayAdapter<String>(AudioActivity.this, android.R.layout.simple_list_item_1, listString);
        listView.setAdapter(adapter);
        HDLCommand.audioCtrl(appliancesInfo, HDLAudio.GET_AUDIO_CURRRENT_INFO);//获取当前音乐信息。返回当前歌曲、所有信息。
app/src/main/java/com/hdl/sdk/hdl_sdk/activity/MainActivity.java
@@ -27,6 +27,7 @@
import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.ThirdPartyBgmInfoEvent;
import com.hdl.sdk.hdl_core.HDLDeviceManger.EventBusEvent.WarningInfoEvent;
import com.hdl.sdk.hdl_core.Util.NetUtil.NetWorkUtil;
import com.hdl.sdk.hdl_core.Util.TransformUtil.HDLUtlis;
import com.hdl.sdk.hdl_sdk.R;
import com.hdl.sdk.hdl_sdk.utlis.HDLLog;
@@ -79,7 +80,14 @@
        initView();
        setOnClick();
//        String str = "#Z018TYPE0010,music121";
//        String result = str.substring(4, 5);
//        HDLLog.I("result:"+result);
//        hideTestButton();
        double AA = HDLUtlis.byteToDouble((byte)0, (byte)0, (byte)134, (byte) 160);
        HDLLog.I("byteToDouble:"+AA);
    }
    private void initView() {
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLAppliances/HDLAudio/HDLAudio.java
@@ -193,7 +193,8 @@
            EventBus.getDefault().post(new AudioInfoEvent(CALLBACK_CURRENT_VOLUME, 79 - (Integer.parseInt(volNum)), audioInfo));
        } else if (isExitData(arrMusicData[0], "TYPE")) {
            Log.i("djl","Type ----> musicData = "+musicData);
            byte[] musicBytes = audioGetListParse(curListNum, 1);
            String sourceId = musicData.substring(4, 5);
            byte[] musicBytes = audioGetListParse(curListNum, 1, sourceId);
            sendAudioData(getDatas, musicBytes);
        } else if (isExitData(arrMusicData[0], "LIST")) {
@@ -203,7 +204,8 @@
            }
            int intNum = Integer.parseInt(num);
            if (curListNum == intNum) {//判断回复的数据是否为当前列表数
                byte[] musicBytes = audioGetListParse(curListNum, 2);
                String sourceId = musicData.substring(4, 5);
                byte[] musicBytes = audioGetListParse(curListNum, 2, sourceId);
                sendAudioData(getDatas, musicBytes);
            }
        } else if (isExitData(arrMusicData[0], "SONG")) {
@@ -306,15 +308,18 @@
                strAsc += intAsc / 10;
                strAsc += intAsc % 10;
            }
            String byteAsc = stringToAscii(strAsc);
            String[] arrAsc = byteAsc.split(",");
            int a1 = Integer.parseInt(arrAsc[0]);
            int a2 = Integer.parseInt(arrAsc[1]);
            return new byte[]{0x2A, 0x5A, 0x31, 0x56, 0x4F, 0x4C, (byte) a1, (byte) a2, 0x0D};
//            String byteAsc = stringToAscii(strAsc);
//            String[] arrAsc = byteAsc.split(",");
//            int a1 = Integer.parseInt(arrAsc[0]);
//            int a2 = Integer.parseInt(arrAsc[1]);
//            return new byte[]{0x2A, 0x5A, 0x31, 0x56, 0x4F, 0x4C, (byte) a1, (byte) a2, 0x0D};
            byte[] musicBytes =  StringUtil.GetMusicBytes("*Z1VOL" + strAsc);
            return musicBytes;
        }
    }
    public static byte[] audioChooseSongParse(int value1, int value2) {
    public static byte[] audioChooseSongParse(int value1, int value2, int sourceId) {
        int listNum = value1;
        int songNum = value2 + 1;
        String songNumStrAsc = "";
@@ -335,25 +340,28 @@
            listNumStrAsc += listNum;
        }
        String songNumByteAsc = stringToAscii(songNumStrAsc);
        String listNumByteAsc = stringToAscii(listNumStrAsc);
        String[] songNumArrAsc = songNumByteAsc.split(",");
        String[] listNumArrAsc = listNumByteAsc.split(",");
        int a1 = Integer.parseInt(songNumArrAsc[0]);
        int a2 = Integer.parseInt(songNumArrAsc[1]);
        int a3 = Integer.parseInt(songNumArrAsc[2]);
        int b1 = Integer.parseInt(listNumArrAsc[0]);
        int b2 = Integer.parseInt(listNumArrAsc[1]);
        int b3 = Integer.parseInt(listNumArrAsc[2]);
//        String songNumByteAsc = stringToAscii(songNumStrAsc);
//        String listNumByteAsc = stringToAscii(listNumStrAsc);
//
//        String[] songNumArrAsc = songNumByteAsc.split(",");
//        String[] listNumArrAsc = listNumByteAsc.split(",");
//
//        int a1 = Integer.parseInt(songNumArrAsc[0]);
//        int a2 = Integer.parseInt(songNumArrAsc[1]);
//        int a3 = Integer.parseInt(songNumArrAsc[2]);
//
//        int b1 = Integer.parseInt(listNumArrAsc[0]);
//        int b2 = Integer.parseInt(listNumArrAsc[1]);
//        int b3 = Integer.parseInt(listNumArrAsc[2]);
//*Z011SONG001
            return new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x53, 0x4F, 0x4E, 0x47, 0x30
                , 0x30, 0x31, (byte) b1, (byte) b2, (byte) b3, (byte) a1, (byte) a2, (byte) a3, 0x32, 0x0D};
//            return new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x53, 0x4F, 0x4E, 0x47, 0x30
//                , 0x30, 0x31, (byte) b1, (byte) b2, (byte) b3, (byte) a1, (byte) a2, (byte) a3, 0x32, 0x0D};
        byte[] musicBytes =  StringUtil.GetMusicBytes("*Z01" + sourceId+ "SONG" +listNumStrAsc + songNumStrAsc + "2");
        return musicBytes;
    }
    private static byte[] audioGetListParse(int num, int type) {
    private static byte[] audioGetListParse(int num, int type, String sourceId) {
        String strAsc = "";
        if (num < 10) {
            strAsc = "00" + num;
@@ -368,10 +376,15 @@
        int a2 = Integer.parseInt(arrAsc[1]);
        int a3 = Integer.parseInt(arrAsc[2]);
        if (type == 1) {
            return new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53,
                    0x54, 0x30, 0x30, 0x31, (byte) a1, (byte) a2, (byte) a3, 0x31, 0x0D};
//            return new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53,
//                    0x54, 0x30, 0x30, 0x31, (byte) a1, (byte) a2, (byte) a3, 0x31, 0x0D};
            byte[] musicBytes =  StringUtil.GetMusicBytes("*Z01" + sourceId + "LIST001" + strAsc + "1");
            return musicBytes;
        } else {
            return new byte[]{42, 90, 48, 49, 49, 83, 79, 78, 71, 48, 48, 49, (byte) a1, (byte) a2, (byte) a3, 48, 48, 49, 49, 13};
//            return new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x53, 0x4F, 0x4E, 0x47, 0x30, 0x30, 0x31, (byte) a1, (byte) a2, (byte) a3, 0x30, 0x30, 0x31, 0x31, 0x0D};
            byte[] musicBytes =  StringUtil.GetMusicBytes("*Z01" + sourceId + "SONG001" + strAsc + "0011");
            return musicBytes;
        }
    }
}
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLCommand.java
@@ -36,6 +36,7 @@
import com.hdl.sdk.hdl_core.Util.NetUtil.NetWorkUtil;
import com.hdl.sdk.hdl_core.Util.SPUtil.SPUtils;
import com.hdl.sdk.hdl_core.Util.TransformUtil.HDLUtlis;
import com.hdl.sdk.hdl_core.Util.TransformUtil.StringUtil;
import org.greenrobot.eventbus.EventBus;
@@ -843,53 +844,65 @@
    public static void audioCtrl(AppliancesInfo info, int type) {
        byte[] musicBytes;
        int command;
        int sourceId = info.getIntCurState();
        switch (type) {
            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};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x53, 0x54, 0x4F, 0x50, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "PLAYSTOP");
                break;
            case HDLAudio.SET_AUDIO_PLAYPAUSE:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{42, 83, 49, 80, 76, 65, 89, 80, 65, 85, 83, 69, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x50, 0x41, 0x55, 0x53, 0x45, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "PLAYPAUSE");
                break;
            case HDLAudio.SET_NEXT_SONG:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "NEXT");
                break;
            case HDLAudio.SET_PRE_SONG:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "PREV");
                break;
            case HDLAudio.GET_AUDIO_MODE:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x4D, 0x4F, 0x44, 0x45, 0x3F, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x4D, 0x4F, 0x44, 0x45, 0x3F, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "PLAYMODE?");
                break;
            case HDLAudio.SET_AUDIO_MODE_UP:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2B, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2B, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "MODE+");
                break;
            case HDLAudio.SET_AUDIO_MODE_DOWN:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2D, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2D, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "MODE-");
                break;
            case HDLAudio.GET_AUDIO_CURRRENT_INFO:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                //*Z1STAUS?归为键
                musicBytes = new byte[]{0x2A, 0x5A, 0x31, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x3F, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x5A, 0x31, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x3F, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "STATUS?");
                break;
            case HDLAudio.SET_PRE_LIST:
                HDLAudio.isSetPreNextList = true;
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x4C, 0x49, 0x53, 0x54, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x4C, 0x49, 0x53, 0x54, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "PREVLIST");
                break;
            case HDLAudio.SET_NEXT_LIST:
                HDLAudio.isSetPreNextList = true;
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x4C, 0x49, 0x53, 0x54, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x4C, 0x49, 0x53, 0x54, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*S" +sourceId + "NEXTLIST");
                break;
            case HDLAudio.TEXT:
                command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND;
                musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53, 0x54, 0x30, 0x30, 0x31, 0x30, 0x30, 0x32, 0x31, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53, 0x54, 0x30, 0x30, 0x31, 0x30, 0x30, 0x32, 0x31, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*Z01" +sourceId + "LIST0010021");
                break;
            default:
                command = 0;
@@ -920,6 +933,7 @@
    public static void audioCtrl(AppliancesInfo info, int type, int value) {
        byte[] musicBytes;
        int command;
        int sourceId = info.getIntCurState();
        switch (type) {
            case HDLAudio.GET_AUDIO_LIST:
                HDLAudio.numStr.clear();
@@ -927,7 +941,8 @@
                HDLAudio.curListNum = value;
                command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND;
                //*Z011TYPE0011归位键
                musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x54, 0x59, 0x50, 0x45, 0x30, 0x30, 0x31, 0x31, 0x0D};
//                musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x54, 0x59, 0x50, 0x45, 0x30, 0x30, 0x31, 0x31, 0x0D};
                musicBytes =  StringUtil.GetMusicBytes("*Z01" + sourceId + "TYPE0011");
                break;
            case HDLAudio.SET_AUDIO_VOL:
                command = Configuration.AUDIO_CTRL_READ_COMMAND;
@@ -960,11 +975,12 @@
    public static void audioCtrl(AppliancesInfo info, int type, int listId, int songId) {
        byte[] musicBytes;
        int command;
        int sourceId = info.getIntCurState();
        switch (type) {
            case HDLAudio.SET_CHOOSE_PLAY_SONG:
                command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND;
                musicBytes = HDLAudio.audioChooseSongParse(listId, songId);
                musicBytes = HDLAudio.audioChooseSongParse(listId, songId, sourceId);
                break;
            default:
                command = 0;
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLDeviceManager.java
@@ -2545,6 +2545,7 @@
     * @param getDatas
     */
    private static void handleAudioData(UdpDataBean getDatas) {
//        HDLLog.info("处理HDL音乐协议");
        outter:
        for (int i = 0, len = devicesDataList.size(); i < len; i++) {
            if (devicesDataList.get(i).getSourceSubnetID() == getDatas.sourceSubnetID
@@ -2554,7 +2555,7 @@
                for (int j = 0, len2 = infos.size(); j < len2; j++) {
                    if (infos.get(j).getBigType() == Configuration.AUDIO_BIG_TYPE) {
                        //暂时只支持旧版背景音乐
                        if (infos.get(j).getDeviceType() == HDLApConfig.TYPE_MUSIC_MODULE) {
                        if (infos.get(j).getDeviceType() == HDLApConfig.TYPE_MUSIC_MODULE || infos.get(j).getDeviceType() == HDLApConfig.TYPE_MUSIC_NEW_MODULE) {
                            HDLAudio.parseAudioData(getDatas, infos.get(j));
                        }
                        break outter;
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Core/HDLUdpCore.java
@@ -20,7 +20,6 @@
/**
 * Created by djl on 2017/3/17.
 */
public class HDLUdpCore {
//    private static MulticastSocket msr6000 = null;
//    private static MulticastSocket msr6008 = null;
hdl_core/src/main/java/com/hdl/sdk/hdl_core/HDLDeviceManger/Parser/DeviceParser.java
@@ -135,6 +135,12 @@
                    case 1:
                        isWant = true;
                        break;
                    case 2:
                        isWant = true;
                        break;
                    case 3:
                        isWant = true;
                        break;
                    case 7:
                        isWant = true;
                        break;
@@ -286,9 +292,11 @@
                break;
            case 2:
                appliancesInfo.setDeviceName("逻辑灯控制");
                appliancesInfo.setDeviceType(HDLApConfig.TYPE_LIGHT_CCT);
                break;
            case 3:
                appliancesInfo.setDeviceName("逻辑灯RGB");
                appliancesInfo.setDeviceType(HDLApConfig.TYPE_LIGHT_RGB);
                break;
            case 4:
                appliancesInfo.setDeviceName("逻辑灯RGBW");
@@ -333,7 +341,7 @@
            appliancesInfo.setPort(port);
            appliancesInfo.setIpAddress(ipAddress);
            if(littleType == 7 || littleType == 8){
            if(littleType == 2 ||littleType == 3 ||littleType == 7 || littleType == 8){
                appliancesInfo.setCtrlCommand(Configuration.LIGHT_RGB_CTRL_COMMAND);
                appliancesInfo.setCtrlBackCommand(Configuration.LIGHT_RGB_CTRL_BACK_COMMAND);
                appliancesInfo.setStateCommand(Configuration.LIGHT_RGB_STATE_COMMAND);
hdl_core/src/main/java/com/hdl/sdk/hdl_core/Util/TransformUtil/HDLUtlis.java
@@ -63,6 +63,12 @@
        return byteArrayToFloat(mByte);
    }
    public static double byteToDouble(byte b1, byte b2, byte b3, byte b4) {
        return b1 * 256 * 256 * 256 + b2 * 256 * 256 + b3 * 256 + b4;
    }
    /**
     * byte[4]数组 转换为float类型
     *
hdl_core/src/main/java/com/hdl/sdk/hdl_core/Util/TransformUtil/StringUtil.java
@@ -84,7 +84,24 @@
                + (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1);
    }
    /**
     * 音乐命令变成byte数组
     * @param commandString
     * @return
     */
    public static byte [] GetMusicBytes (String commandString){
        byte [] bytes = new byte[0];
        try {
            bytes = commandString.getBytes("US-ASCII");
            byte [] sendBytes = new byte [bytes.length + 1];
            sendBytes [bytes.length] = 0x0D;
            System.arraycopy (bytes, 0, sendBytes, 0, bytes.length);
            return sendBytes;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return bytes;
        }
    }
//    private byte[] formatStyleHDLResponse(String responsePart1, String responsePart2, int maxLen) throws UnsupportedEncodingException {