This repository has been archived by the owner on May 7, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Wouter Born <eclipse@maindrain.net>
- Loading branch information
1 parent
be30103
commit f7155c4
Showing
11 changed files
with
178 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...inding.lifx/src/main/java/org/eclipse/smarthome/binding/lifx/internal/fields/Version.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2014-2017 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.binding.lifx.internal.fields; | ||
|
||
/** | ||
* @author Wouter Born - Add Thing properties | ||
*/ | ||
public class Version { | ||
|
||
private long major; | ||
private long minor; | ||
|
||
public Version(long major, long minor) { | ||
this.major = major; | ||
this.minor = minor; | ||
} | ||
|
||
public long getMajor() { | ||
return major; | ||
} | ||
|
||
public long getMinor() { | ||
return minor; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return major + "." + minor; | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...g.lifx/src/main/java/org/eclipse/smarthome/binding/lifx/internal/fields/VersionField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) 2014-2017 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.eclipse.smarthome.binding.lifx.internal.fields; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* @author Wouter Born - Add Thing properties | ||
*/ | ||
public class VersionField extends Field<Version> { | ||
|
||
@Override | ||
public int defaultLength() { | ||
return 4; | ||
} | ||
|
||
@Override | ||
public Version value(ByteBuffer bytes) { | ||
long value = bytes.getInt() & 0xFFFFFFFFL; | ||
long major = (value >> 16) & 0xFFL; | ||
long minor = value & 0xFFL; | ||
return new Version(major, minor); | ||
} | ||
|
||
@Override | ||
public ByteBuffer bytesInternal(Version value) { | ||
return ByteBuffer.allocate(4).putInt((int) (((value.getMajor() << 16) | value.getMinor()) & 0xFFFFFFFFL)); | ||
} | ||
|
||
} |
45 changes: 0 additions & 45 deletions
45
...ain/java/org/eclipse/smarthome/binding/lifx/internal/protocol/GetMeshFirmwareRequest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.