Results 1 to 3 of 3

Thread: [RESOLVED] Don't understand this part of the manual...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Posts
    245

    Resolved [RESOLVED] Don't understand this part of the manual...

    Hi. I'm reading some data from a device. The device returns a total of 217 bytes.

    The byte number 10 is supposed to be a "check byte", wich I think is a byte you can use to check that the data I've recieved is correct. I can read all the data, and the data makes sense except the checkbyte! I don't know how to use it. So... Can anyone out there help me? Here's the information needed to crack the code

    The manual says that all data have to be XOR'ed with 223 before you can make sense out of it. So in the table below the first column is the byte number, the second is the "raw" data from the device and the last column is the data XOR'ed with 223.
    10 first bytes:
    Code:
    1 -  32  - 255
    2  - 32  - 255
    3  - 156 - 67
    4  - 202 - 21
    5  - 223 - 0
    6  - 223 - 0
    7  - 212 - 11
    8  - 219 - 4
    9  - 223 - 0
    10 - 70  - 153
    Now, the (crappy) manual says the following about byte number 10:
    Code:
    check byte e-card no. Addition of bytes 3-10= Bin 0 (Mod 256)
    Can anyone make any sense out of this? Thanks for all help!

    EDIT:
    Here is the data from an another device, if it helps.
    Code:
    1  - 32  - 255
    2  - 32  - 255
    3  - 51  - 236
    4  - 39  - 248
    5  - 223 - 0
    6  - 223 - 0
    7  - 207 - 16
    8  - 188 - 99
    9  - 223 - 0
    10 - 118 - 169
    Last edited by erik; Sep 28th, 2009 at 03:13 PM.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Don't understand this part of the manual...

    It's correct. Sum bytes 3-10 after the transformation and you will end up with &H0100. Mod 256 is the same as ANDing with &H00FF. Thus:

    &H00FF AND &H0100 = 0

    Why they said Bin 0 is beyond me.
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2009
    Posts
    245

    Re: Don't understand this part of the manual...

    Ah, thanks a bunch!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width