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.

How to read a hex sent from a device

See original GitHub issue

I am sending a hex value to a device and expected to receive hex value in response 08 00 00 05 01 00 00 01 03 00 0E. But i am unable to do so. The object that comes in onDataReceived has the key data with empty value. Please guide how to read hex data from a device

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
kenjdavidsoncommented, May 13, 2022

So ya, if you’re not sending a delimiter \n or whatever, then the messages will never be broken up, and therefore never be found. What it does is:

  • Data comes in
  • Do we have any delimiters?
  • For each delimiter send that data (if there is a listener)

for manual reads

  • Do we have a delimter?
  • Each read will get the next data for the delimiter

If you’re getting 11 available, that implies that there should be 11 separate messages, I’m pretty sure that’s what it means anyhow.

You can attempt to do

connectToDevice.(deviceId, { delimiter: '' });

Using an empty/null delimiter, MAY (I think there was a request for this) cause it to skip all the delimiter logic, and just send the stream of data through.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to read Hexadecimal format data from device?
You can try out this code snippet public String convertHexToString(String hex){ StringBuilder sb = new StringBuilder(); StringBuilder temp ...
Read more >
Read a Device and Save the Hex File - Developer Help
Read a Device and Save the Hex File. From the main toolbar, click on the small downward pointing triangle on the right edge...
Read more >
Understanding hex file got from reading device
Hi everybody, I read my dsPIC33F with ICD3CMD and get a hex file of 963kb when the hex I use to program my...
Read more >
How to Read Hex Color Codes - Hexadecimal Color | Pluralsight
Hex color codes are one type of HTML color code that you'll often hear referred to as hexadecimal color ... Learn to read...
Read more >
How to Read and Extract HEX File from Arduino ... - YouTube
How to Read and Extract HEX File from Arduino Board And Upload the HEX File to Another Arduino. In this video I'm gonna...
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