question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error writing 337 bytes at offset 0 length=337

See original GitHub issue

Hey, I’m trying to write something from my android app to the payment terminal iWL250. Application should send json with data and then terminal prints something.

serial.requestPermission({
                vid: '079B',
                pid: '0028'
            },
                function (successMessage) {
                    serial.open(
                        { baudRate: 57600 },
                        function (successMessage) {

                            serial.writeHex(
                                JSON.stringify(text),
                                function (successMessage) {
                                    $cordovaToast.showLongBottom(succesMessage);
                                    alert(successMessage);
                                },
                                errorCallback
                            );
                        },
                        errorCallback
                    );
                },
                errorCallback
            );

application connects to the terminal, but when it tries to write data I get an error: “Error writing 337 bytes at offset 0 length=337”

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:35 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jun 19, 2018

How to change the endpoint as mentioned above ?

0reactions
sureshkumar-s89commented, Jan 2, 2018

I used this (https://play.google.com/store/apps/details?id=aws.apps.usbDeviceEnumerator&hl=en) android app to get information of connected device. Here I have attached the screenshot (DeviceInfo.zip) of my weight scale device info using this app.

I found that it has five interface of which two are CDC class and both have two Endpoints. Does it causes any problem? I don’t know whether this information is useful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to repair a serialized string which has been corrupted by ...
Notice: unserialize() [function.unserialize]: Error at offset 337 of 338 bytes. Recalculating $data = preg_replace('!s:(\d+):"(.
Read more >
"Unable to read from offset" error when loading line data ... - IBM
Cause. The error means that the ACIF indexer cannot read the entire length from the offset specified. The length and offset added together ......
Read more >
How to output file from the specified offset, but not "dd bs=1 ...
To be simple (for non-simple I can write some Perl oneliner that will do this); To support large offsets and lengths (so hacks...
Read more >
_ListenerResponseStream.cs
Length ) { throw new ArgumentOutOfRangeException("offset"); } if (size<0 || size>buffer. ... HashString(this) + "::Write() suppressing error"); statusCode ...
Read more >
Bytes xref - Apache HBase
writeVInt(out, length); 265 out.write(b, offset, length); 266 } 267 268 /** 269 * Write byte-array from src to tgt with a vint length...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found