private void decode(byte[] sensorData) {
        kiwriousReader.setRawValues(sensorData);
        switch (sensorData[KIWRIOUS_SENSOR_TYPE]) {
            //TODO: complete decode calls using bye array data
            case SENSOR_COLOUR:
                String[] colorValues = sensorDecoder.decodeColor(sensorData);
                kiwriousReader.setR(Integer.parseInt(colorValues[0]));
                kiwriousReader.setG(Integer.parseInt(colorValues[1]));
                kiwriousReader.setB(Integer.parseInt(colorValues[2]));
                break;
            case SENSOR_CONDUCTIVITY:
                String[] conductivityValues = sensorDecoder.decodeConductivity(sensorData);
                kiwriousReader.setResistance(Long.parseLong(conductivityValues[0]));
                kiwriousReader.setConductivity(Float.parseFloat(conductivityValues[1]));
                break;
            case SENSOR_HEART_RATE:
                String heartRateValue = sensorDecoder.decodeHeartRate(sensorData);
                kiwriousReader.setHeartRate(Integer.parseInt(heartRateValue));
                break;
            case SENSOR_HUMIDITY:
                Float[] humidityValues = sensorDecoder.decodeHumidity(sensorData);
                kiwriousReader.setTemperature(humidityValues[0]);
                kiwriousReader.setHumidity(humidityValues[1]);
                break;
            case SENSOR_SOUND:
//                sensorDecoder.decodeSound(values);
                break;
            case SENSOR_TEMPERATURE:
                String[] temperatureValues = sensorDecoder.decodeTemperature(sensorData);
                kiwriousReader.setAmbientTemperature(Integer.parseInt(temperatureValues[0]));
                kiwriousReader.setInfraredTemperature(Integer.parseInt(temperatureValues[1]));
                break;
            case SENSOR_TEMPERATURE2:
                String[] temperature2Values = sensorDecoder.decodeTemperature2(sensorData);
                kiwriousReader.setAmbientTemperature(Integer.parseInt(temperature2Values[0]));
                kiwriousReader.setInfraredTemperature(Integer.parseInt(temperature2Values[1]));
                break;
            case SENSOR_UV:
                String[] lightValues = sensorDecoder.decodeUV(sensorData);
                kiwriousReader.setLux(Long.parseLong(lightValues[0]));
                kiwriousReader.setUv(Float.parseFloat(lightValues[1]));
                break;
            case SENSOR_VOC:
                String[] vocValues = sensorDecoder.decodeVOC(sensorData);
                kiwriousReader.setVoc(Integer.parseInt(vocValues[0]));
                kiwriousReader.setCo2(Integer.parseInt(vocValues[1]));
                break;
            default:
                Log.e("kiwrious-plugin", "unexpected sensor type "+sensorData[KIWRIOUS_SENSOR_TYPE]);
                break;
        }
    }
private void decode(byte[] sensorData) {
        kiwriousReader.setRawValues(sensorData);
        switch (sensorData[KIWRIOUS_SENSOR_TYPE]) {
           
            case SENSOR_COLOUR:
                String[] colorValues = sensorDecoder.decodeColor(sensorData);
                kiwriousReader.setR(Integer.parseInt(colorValues[0]));
                kiwriousReader.setG(Integer.parseInt(colorValues[1]));
                kiwriousReader.setB(Integer.parseInt(colorValues[2]));
                break;
            case SENSOR_CONDUCTIVITY:
                String[] conductivityValues = sensorDecoder.decodeConductivity(sensorData);
                kiwriousReader.setResistance(Long.parseLong(conductivityValues[0]));
                kiwriousReader.setConductivity(Float.parseFloat(conductivityValues[1]));
                break;
            case SENSOR_HEART_RATE:
                String heartRateValue = sensorDecoder.decodeHeartRate(sensorData);
                kiwriousReader.setHeartRate(Integer.parseInt(heartRateValue));
                break;
            case SENSOR_HUMIDITY:
                Float[] humidityValues = sensorDecoder.decodeHumidity(sensorData);
                kiwriousReader.setTemperature(humidityValues[0]);
                kiwriousReader.setHumidity(humidityValues[1]);
                break;
            case SENSOR_SOUND:
                break;
            case SENSOR_TEMPERATURE:
                String[] temperatureValues = sensorDecoder.decodeTemperature(sensorData);
                kiwriousReader.setAmbientTemperature(Integer.parseInt(temperatureValues[0]));
                kiwriousReader.setInfraredTemperature(Integer.parseInt(temperatureValues[1]));
                break;
            case SENSOR_TEMPERATURE2:
                String[] temperature2Values = sensorDecoder.decodeTemperature2(sensorData);
                kiwriousReader.setAmbientTemperature(Integer.parseInt(temperature2Values[0]));
                kiwriousReader.setInfraredTemperature(Integer.parseInt(temperature2Values[1]));
                break;
            case SENSOR_UV:
                String[] lightValues = sensorDecoder.decodeUV(sensorData);
                kiwriousReader.setLux(Long.parseLong(lightValues[0]));
                kiwriousReader.setUv(Float.parseFloat(lightValues[1]));
                break;
            case SENSOR_VOC:
                String[] vocValues = sensorDecoder.decodeVOC(sensorData);
                kiwriousReader.setVoc(Integer.parseInt(vocValues[0]));
                kiwriousReader.setCo2(Integer.parseInt(vocValues[1]));
                break;
            default:
                Log.e("kiwrious-plugin", "unexpected sensor type "+sensorData[KIWRIOUS_SENSOR_TYPE]);
                break;
        }
    }
private void decode(byte[] sensordata) { kiwriousreader.setrawvalues(sensordata); switch (sensordata[kiwrious_sensor_type]) { case sensor_colour: string[] colorvalues = sensordecoder.decodecolor(sensordata); kiwriousreader.setr(integer.parseint(colorvalues[0])); kiwriousreader.setg(integer.parseint(colorvalues[1])); kiwriousreader.setb(integer.parseint(colorvalues[2])); break; case sensor_conductivity: string[] conductivityvalues = sensordecoder.decodeconductivity(sensordata); kiwriousreader.setresistance(long.parselong(conductivityvalues[0])); kiwriousreader.setconductivity(float.parsefloat(conductivityvalues[1])); break; case sensor_heart_rate: string heartratevalue = sensordecoder.decodeheartrate(sensordata); kiwriousreader.setheartrate(integer.parseint(heartratevalue)); break; case sensor_humidity: float[] humidityvalues = sensordecoder.decodehumidity(sensordata); kiwriousreader.settemperature(humidityvalues[0]); kiwriousreader.sethumidity(humidityvalues[1]); break; case sensor_sound: break; case sensor_temperature: string[] temperaturevalues = sensordecoder.decodetemperature(sensordata); kiwriousreader.setambienttemperature(integer.parseint(temperaturevalues[0])); kiwriousreader.setinfraredtemperature(integer.parseint(temperaturevalues[1])); break; case sensor_temperature2: string[] temperature2values = sensordecoder.decodetemperature2(sensordata); kiwriousreader.setambienttemperature(integer.parseint(temperature2values[0])); kiwriousreader.setinfraredtemperature(integer.parseint(temperature2values[1])); break; case sensor_uv: string[] lightvalues = sensordecoder.decodeuv(sensordata); kiwriousreader.setlux(long.parselong(lightvalues[0])); kiwriousreader.setuv(float.parsefloat(lightvalues[1])); break; case sensor_voc: string[] vocvalues = sensordecoder.decodevoc(sensordata); kiwriousreader.setvoc(integer.parseint(vocvalues[0])); kiwriousreader.setco2(integer.parseint(vocvalues[1])); break; default: log.e("kiwrious-plugin", "unexpected sensor type "+sensordata[kiwrious_sensor_type]); break; } }