Conversation
Member
|
strange ascii character list https://theasciicode.com.ar/ascii-control-characters/unit-separator-ascii-code-31.html |
Member
|
@sriharivishnu i m getting this error |
rrijal53
reviewed
Apr 30, 2020
Comment on lines
156
to
176
| compositeDisposable.add(bluetoothConnection.observeByteStream().lift((FlowableOperator<String, Byte>) this::getWriter).onBackpressureBuffer().observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()) | ||
| .subscribe(s -> { | ||
| // READ COMMAND RESPONSE | ||
| Log.d(TAG, "READ: " + s); | ||
| //Remove the last command because response has been received | ||
| if (!sentCommands.isEmpty()) sentCommands.remove(); | ||
| //Send the response to the target | ||
| if (!switchedHandler) mHandler.obtainMessage(Constants.MESSAGE_READ, s).sendToTarget(); | ||
|
|
||
| //Sent all the waiting commands | ||
| if (switchedHandler && sentCommands.isEmpty()) { | ||
| Log.e(TAG, "SENT ALL PREVIOUS"); | ||
| switchedHandler = false; | ||
| mHandler = tempHandler; | ||
| writeOverflow(); | ||
| } | ||
|
|
||
| }, throwable -> { | ||
| Log.e(TAG, "startChat: "+ "ERROR OCCURRED WHILE READING"); | ||
| disconnect(); | ||
| })); |
Member
There was a problem hiding this comment.
@sriharivishnu Can't we use this??
compositeDisposable.add(bluetoothConnection.observeStringStream('~')
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.io())
.subscribe(new Consumer<String>() {
@Override
public void accept(String s) throws Exception {
Log.d(TAG, "accept: " + s);
}
}));
Contributor
Author
There was a problem hiding this comment.
@rrijal53 There is an error in their implementation. I had to modify the components of their function, which is why wrote it myself.
Member
|
For |
5c640ca to
7f9f670
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Features
updateHandler()is called, make sure there is no overflow, and if there is, wait till it is finished before executing commands in the new fragment.Info
PLEASE USE THE FOLLOWING BLUETOOTH SERVER:
Steps
Main Change:
Switched the delimiter and now sends the entire output of the CLI in one stream.