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

uploadNames and uploadLogEventData always throw an exception? #16

Open
boc-tothefuture opened this issue Jul 25, 2017 · 3 comments
Open

Comments

@boc-tothefuture
Copy link
Contributor

@digitaldan
I haven't run into an issue in practice and maybe I am just missing something here. But I think the logic is off on uploadNames and uploadLogEventData methods.
The code is here

public Message uploadEventLogData(int number, int direction) throws IOException, OmniNotConnectedException,
			OmniInvalidResponseException, OmniUnknownMessageTypeException {
		Message msg = sendAndReceive(new UploadEventRecord(number, direction));
		if (msg.getMessageType() != Message.MESG_TYPE_EVENT_LOG_DATA
				&& msg.getMessageType() != Message.MESG_TYPE_END_OF_DATA) {
			throw new OmniInvalidResponseException(msg);
		}
		return msg;
	}

Doesn't that check on message type need to be a logical or rather than a logical and? The returned method type is never going to be both types, so it would always throw an exception, right?

@digitaldan
Copy link
Owner

I'll take a look , but i don't doubt what you say, I never actually used those calls or even tested them, my guess is I had planned to but forgot then never had a reason to in apps that used the library

@boc-tothefuture
Copy link
Contributor Author

Ok. A sanity check in my logic would be appreciated. No rush.

@ecdye
Copy link
Contributor

ecdye commented Nov 10, 2020

This should not be an issue now, as it was an issue with boolean logic and is correct, as was discussed in #32.

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

No branches or pull requests

3 participants