Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to JavaSE-11 #32

Merged
merged 2 commits into from
Nov 3, 2020
Merged

update to JavaSE-11 #32

merged 2 commits into from
Nov 3, 2020

Conversation

ecdye
Copy link
Contributor

@ecdye ecdye commented Nov 2, 2020

Signed-off-by: Ethan Dye mrtops03@gmail.com

Signed-off-by: Ethan Dye <mrtops03@gmail.com>
@@ -518,7 +518,7 @@ public Message reqObjectProperties(int objectType, int objectNum, int direction,
.build();
Message msg = sendAndReceive(reqObjectProperties);
if (msg.getMessageType() != Message.MESG_TYPE_OBJ_PROP
&& msg.getMessageType() != Message.MESG_TYPE_END_OF_DATA) {
|| msg.getMessageType() != Message.MESG_TYPE_END_OF_DATA) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what the issue is here ? This code has been around for a very long time and i'm trying to understand what this is fixing, and why it has not shown up before.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm, i see the original code does make sense at all, i'm not sure why this never bubbled up as an issue before, strange.

@digitaldan
Copy link
Owner

so these changes break the library for me, when i try running the basic example from the README , i get the following error, running master does not have the error:

java  -cp ./target/jomnilink-1.3.7-jar-with-dependencies.jar  com.digitaldan.jomnilinkII.examples.Main  192.168.0.1 4369 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[main] INFO com.digitaldan.jomnilinkII.examples.Main - SystemInformation(model=38, major=4, minor=0, revision=2, phone=-)
[main] INFO com.digitaldan.jomnilinkII.examples.Main - SystemStatus(timeDateValid=true, year=20, month=11, day=2, dayOfWeek=1, hour=6, minute=19, second=36, daylightSavings=false, sunriseHour=6, sunriseMinute=0, sunsetHour=17, sunsetMinute=11, batteryReading=170, alarms={})
[main] INFO com.digitaldan.jomnilinkII.examples.Main - SystemTroubles(troubles=[2])
[main] INFO com.digitaldan.jomnilinkII.examples.Main - SystemFormats(tempFormat=1, timeFormat=1, dateFormat=1)
[main] INFO com.digitaldan.jomnilinkII.examples.Main - SystemFeatures(features=[])
[main] INFO com.digitaldan.jomnilinkII.examples.Main - ObjectTypeCapacities(objectType=9, capacity=8)
[main] INFO com.digitaldan.jomnilinkII.examples.Main - ObjectTypeCapacities(objectType=10, capacity=8)
[main] ERROR com.digitaldan.jomnilinkII.examples.Main - Invalid Response
com.digitaldan.jomnilinkII.OmniInvalidResponseException
	at com.digitaldan.jomnilinkII.Connection.reqObjectProperties(Connection.java:522)
	at com.digitaldan.jomnilinkII.examples.Main.main(Main.java:133)

Signed-off-by: Ethan Dye <mrtops03@gmail.com>
@ecdye
Copy link
Contributor Author

ecdye commented Nov 2, 2020

@digitaldan I figured it out, apparently your original code was correct because of the way java boolean logic works. I have reverted those changes and it appears to be working now. As a result this PR essentially only upgrades the JavaSE version to 11.

@digitaldan digitaldan changed the title Fix broken code and update to JavaSE-11 update to JavaSE-11 Nov 3, 2020
@digitaldan
Copy link
Owner

LGTM, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants