-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support printers? #67
Comments
Hi @Artur- , Thanks for commenting on your findings!
The library purpose is to establish serial communication, and the basis for that is the notifications mechanism, so how would you implement it differently?
As I get it is that send() is an abstraction you'd like to avoid? Would exposing something like sendRaw() help? |
I know I am (ab)using the project for the wrong thing as a basic thermal printer does not use bidirectional communications thus there is no need to get notifications, you only need to send data to the printer. I was really looking for some kind of helper library for web bluetooth and this was the closest I found on https://www.npmjs.com/. What I did was this Artur-@24d36f9 i.e. just do not call
Yes, I actually implemented a |
Hi @Artur- , Now I get it! Well, do you mind if I leave this issue open? As soon as get back to the project (want to rewrite on TS) I think on how to include that & test. |
Go ahead. I used the TS version and made some small fixes there also |
Hi,
I was experimenting with web bluetooth with a thermal printer and tried using your nice lib instead of rewriting the same thing myself. This mostly worked out except for two things:
characteristic.properties.notify
isfalse
so anyconnect()
attempt will failstring
encoded using aTextEncoder
but the printer wants something encoded using aEscPosEncoder
. As you have implementedsend
aspublic send(data: string): Promise<void>
I had to rewrite that part including chunk splitting.Would you be interesting in incorporating something for this or should i just keep it in a fork?
The text was updated successfully, but these errors were encountered: