Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mob41 committed Sep 6, 2016
1 parent d99bc89 commit 691c387
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .classpath
Expand Up @@ -22,7 +22,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=1.7
20 changes: 10 additions & 10 deletions src/main/java/org/ev3dev/hardware/sensors/ColorSensor.java
Expand Up @@ -17,52 +17,52 @@ public class ColorSensor extends Sensor {
/**
* Reflected Light Intensity required Sysfs mode
*/
private static final String SYSFS_REFLECTED_LIGHT_INTENSITY_MODE = "COL-REFLECT";
public static final String SYSFS_REFLECTED_LIGHT_INTENSITY_MODE = "COL-REFLECT";

/**
* Reflected Light Intensity Sysfs value index
*/
private static final int SYSFS_REFLECTED_LIGHT_INTENSITY_VALUE_INDEX = 0;
public static final int SYSFS_REFLECTED_LIGHT_INTENSITY_VALUE_INDEX = 0;

/**
* Ambient Light Intensity required Sysfs mode
*/
private static final String SYSFS_AMBIENT_LIGHT_INTENSITY_MODE = "COL-AMBIENT";
public static final String SYSFS_AMBIENT_LIGHT_INTENSITY_MODE = "COL-AMBIENT";

/**
* Ambient Light Intensity Sysfs value index
*/
private static final int SYSFS_AMBIENT_LIGHT_INTENSITY_VALUE_INDEX = 0;
public static final int SYSFS_AMBIENT_LIGHT_INTENSITY_VALUE_INDEX = 0;

/**
* Color required Sysfs mode
*/
private static final String SYSFS_COLOR_MODE = "COL-COLOR";
public static final String SYSFS_COLOR_MODE = "COL-COLOR";

/**
* Color Sysfs value index
*/
private static final int SYSFS_COLOR_VALUE_INDEX = 0;
public static final int SYSFS_COLOR_VALUE_INDEX = 0;

/**
* RGB required Sysfs mode
*/
private static final String SYSFS_RGB_MODE = "RGB-RAW";
public static final String SYSFS_RGB_MODE = "RGB-RAW";

/**
* RGB Red Sysfs value index
*/
private static final int SYSFS_RGB_R_VALUE_INDEX = 0;
public static final int SYSFS_RGB_R_VALUE_INDEX = 0;

/**
* RGB Green Sysfs value index
*/
private static final int SYSFS_RGB_G_VALUE_INDEX = 1;
public static final int SYSFS_RGB_G_VALUE_INDEX = 1;

/**
* RGB Blue Sysfs value index
*/
private static final int SYSFS_RGB_B_VALUE_INDEX = 2;
public static final int SYSFS_RGB_B_VALUE_INDEX = 2;

/**
* This device's default driver name
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/ev3dev/io/Sysfs.java
Expand Up @@ -18,9 +18,9 @@
public class Sysfs {

/**
* The Sysfs class path (/sys/class)
* The Sysfs class path (/sys/class/)
*/
public static final String SYSTEM_CLASS_PATH = "/sys/class";
public static final String SYSTEM_CLASS_PATH = "/sys/class/";

/**
* Get all sub-class files
Expand Down Expand Up @@ -105,9 +105,6 @@ public static void setAttribute(String class_name, String subclass, String prope
*/
public static void setAttribute(String class_name, String property, String new_value) throws FileNotFoundException, IOException{
PrintWriter out = new PrintWriter(SYSTEM_CLASS_PATH + class_name + "/" + property);
class_name = class_name.toLowerCase();
property = property.toLowerCase();
new_value = new_value.toLowerCase();
out.write(new_value);
out.flush();
out.close();
Expand Down

0 comments on commit 691c387

Please sign in to comment.