antus wrote:Are you familiar with the ALDL format? Eg
F2 57 04 00 B3 is:
Device: F2
Length: 57 (57-52=5 Byte packet)
Mode: 04 (type of command)
Mode2: 00 (sorry dont know the correct name, really a paramater to the mode command)
Checksum: B3
So you Read 2 bytes to get as far as the length, Then you know total length is 5, so read 3 more bytes. Then calculate and check the checksum (discard if you calculate B3 but the last byte is not B3). Then check if your handling packets for device F2, and if so go to your handler for mode 4, and it can read 00 and do the appropriate thing.
Having said that, F2 is the dash so your sending it not receiving it, but the concept to read an ALDL packet is about right.
Sorry if this is not clear.
C# is a good language, but your going to need to understand ALDL to structure your app the right way. But if its your first app just jump right in and it'll become clear as you go. In my work as a software dev we have always said "write the first one to throw away" as an investigation exercise.
C# is an object orientated language, so its designed to be written a certain way. If you dont know OO it might be worth reading something general or something which explains that to get an idea of the app layout.
Ok this string here which i read from the tech 2 will move the fuel guage to half...
F2, 83, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7F, 0, 0, 4, [ check sum ]
checked and works on the OSE tool
so with check sum should be 87