private void checkRecievedData(String message) { //process recieved data
        // ******** CAM block ********
        if (message.length()>10 && message.substring(message.length()-11, message.length()).equals(sCamInit)) {
            System.out.println("initComplete");
            
            camDeath.killTick();
            
            compresRatio=true;
            
            sendToCam(camDo.compressRatio); //change compress ratio
        }
        if (message.equals(sImageRatioSize)) { //compress ratio, change img size
            if (compresRatio) {
                System.out.println("changed compress ratio");
                compresRatio=false;
                
                camDeath.killTick();
                
                sendToCam(camDo.setJpegSize); //change img size to 320x240
            }
            else {
                System.out.println("changed image size");
                camDeath.killTick();
                
                startTimer("imageResizedPhotoTimerA");
            }
        }
        if (message.equals(sImageResized)) { //picture taked
            System.out.println("changed image size");
            camDeath.killTick();

            startTimer("imageResizedPhotoTimerB");
        }
        if (message.equals(sTakePicture)) { //picture taked
            System.out.println("picture taked");
            
            camDeath.killTick();
            
            if (!stopTakingPicture) sendToCam(camDo.readJpegSize); //read JPEG size
            stopTakingPicture=false;
        }
        if (message.length()>2 && message.substring(0, message.length()-2).equals(sJpegSize)) { //recieve JPEG size
            System.out.println("get Jpeg size");
           
            camDeath.killTick();
            
            XH=(int)message.charAt(7);
            XL=(int)message.charAt(8);
            jpegReading=false;
            
            sendToCam(camDo.jpegData);
            //conn.send(new String(new char[] {0x56, 0x00, 0x32, 0x0C, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (char)XH, (char)XL, 0x00, 0x0A})); //read JPEG data
            
            /*  56 00 32 0C 00 0A 00 00 MM MM 00 00 KK KK XX XX 
                Return  ： 76 00 32 00 00  （Spacing Interval） FF D8  。。。 ……。。 。（Spacing Interval）
                76 00 32 00 00 
                （spacing interval）= XX  XX*0.01ms 
                00  00  MM  MM    Init address 
                00  00  KK  KK  data length
            */
            
            //76 00 34 00 04 00 00 XH XL 
        }
        if (message.equals(sJpegFileContent)) { //picture taked
            
            camDeath.killTick();
            
            if (jpegReading) {
                jpegReading=false;
                System.out.println("picture file content stop");
                
                makeImgFile.close();
                
                stopTakingPicture=true;
                sendToCam(camDo.stopTakePhoto);
                
                
                //conn.send(sOutStopTakePicture); //ukončení přijímání .jpg
            }
            else {
                jpegReading=true;
                System.out.println("picture file content start");
                
                makeImgFile = new MakeFile();
                fileThread = new Thread(makeImgFile);
                fileThread.setPriority(4);
                fileThread.setDaemon(true);
                fileThread.setName("MakeFile");
                fileThread.start();
            }
        }
        // ******** end CAM block ********
        // ******** MCU block ********
        if (message.equals(sMcuCommandsStart)) { //switch MCU to listen mode
            System.out.println("MCU listen");
            mcuListen=true;
        }
        if (message.equals(sMcuCommandsStop)) { //switch off MCU listen mode
            System.out.println("MCU not listen"); 
            mcuListen=false;
        }
        if (message.length()>3 && message.substring(0, message.length()-3).equals(sMcuCommand)) { //recieve MCU message
            System.out.println("MCU command");  
            messageToMcu(message.substring(3, message.length()));
        }
        
        // ******** end MCU block ********
    }