//                sensorDecoder.decodeSound(values);
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;
        }
    }
break;
case SENSOR_SOUND:
// sensorDecoder.decodeSound(values);
break;
case SENSOR_TEMPERATURE:
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]));
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]));