Protocol 7.00 - Resend request ?
9 posts
• Page 1 of 1
- cakeisalie5
- Senior Member
-
- Posts: 102
- Joined: Sun Mar 27, 2016 10:24 am
- Location: France
- Calculators: Casio Afx 1.0, Casio fx-9860GII, Casio fx-CG50
Protocol 7.00 - Resend request ?
Hello,
I am creating a lib that implements protocol 7.00 as described in the fxReverse project documentation (2nd edition). You can see the project here.
I am trying to implement file sending protocol. But the calculator answers weirdly. This is basically the packet flow I obtain :
=> check(initial)
<= ack
=> command (0x45)
<= ack
=> data
<= resend
And as I interpreted the "resend request" as a response to bad checksum (which is not the case here), the lib then resends the packet, then the calculator sends again the resend request, and it loops until the calculator just ends up sending an empty bulk so my lib would let her alone. Here are my logs if you're interested :
I came here to ask : am I getting the theory right, or should I not resend the data packet but the command packet above ? What could be the cause of this ?
Thanks in advance for your help
I am creating a lib that implements protocol 7.00 as described in the fxReverse project documentation (2nd edition). You can see the project here.
I am trying to implement file sending protocol. But the calculator answers weirdly. This is basically the packet flow I obtain :
=> check(initial)
<= ack
=> command (0x45)
<= ack
=> data
<= resend
And as I interpreted the "resend request" as a response to bad checksum (which is not the case here), the lib then resends the packet, then the calculator sends again the resend request, and it loops until the calculator just ends up sending an empty bulk so my lib would let her alone. Here are my logs if you're interested :
Logs: Show
I came here to ask : am I getting the theory right, or should I not resend the data packet but the command packet above ? What could be the cause of this ?
Thanks in advance for your help

Part of the Planète Casio community (FR) - main author of Cahute
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Protocol 7.00 - Resend request ?
I am not sure, but your main data packet looks like you did no 0x5C-padding.
You must transform any data byte b < 0x20 to 0x5C,b and 0x5c to 0x5c,0x5c before transmitting the data packet.
This is because protocol 7.00 uses control codes below 0x20.
If you receive data, you have to reverse the 0x5c-padding.
You must transform any data byte b < 0x20 to 0x5C,b and 0x5c to 0x5c,0x5c before transmitting the data packet.
This is because protocol 7.00 uses control codes below 0x20.
If you receive data, you have to reverse the 0x5c-padding.
I'll be back!
- cakeisalie5
- Senior Member
-
- Posts: 102
- Joined: Sun Mar 27, 2016 10:24 am
- Location: France
- Calculators: Casio Afx 1.0, Casio fx-9860GII, Casio fx-CG50
Re: Protocol 7.00 - Resend request ?
That's what I did ^^
For example, on the third line of the data packet, '\n' (0x0A), is transformed to 0x5C2A
(file i'm sending (which is also the source code of the test) : )
(Escaper)
For example, on the third line of the data packet, '\n' (0x0A), is transformed to 0x5C2A

(file i'm sending (which is also the source code of the test) : )
hidden: Show
(Escaper)
Part of the Planète Casio community (FR) - main author of Cahute
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Protocol 7.00 - Resend request ?
Yes, sry, I overlooked that. I have to consult very old source code now. Could take some time.cakeisalie5 wrote:That's what I did ^^
I'll be back!
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Protocol 7.00 - Resend request ?
I just logged a transfer on my system. This is the ST "45" packet, which my program constructed:
01 34 35 31 30 30 32 37 30 32 30 30 30 30 30 30 .451002702000000
46 45 31 38 30 30 30 42 30 30 30 30 30 34 30 30 FE18000B00000400
49 4E 53 49 47 48 54 2E 47 31 41 66 6C 73 30 35 INSIGHT.G1Afls05
46 F
This is the ST "45" packet out of your log
[libp7 info] 0134 3531 3030 3232 0032 3030 2020 2020 .4510022.200
[libp7 info] 2032 4237 3030 3036 3030 3030 3034 3030 2B7000600000400
[libp7 info] 6D61 696E 2E63 666C 7330 4430 main.cfls0D0
The 8 byte filesize (2B7) is preceded by spaces (0x20). It should be 5 ASCII-zeros (0x30).
OW should be set to "02". In your packet the "2" is preceded by a binary zero. It should be an ASCII-zero.
01 34 35 31 30 30 32 37 30 32 30 30 30 30 30 30 .451002702000000
46 45 31 38 30 30 30 42 30 30 30 30 30 34 30 30 FE18000B00000400
49 4E 53 49 47 48 54 2E 47 31 41 66 6C 73 30 35 INSIGHT.G1Afls05
46 F
This is the ST "45" packet out of your log
[libp7 info] 0134 3531 3030 3232 0032 3030 2020 2020 .4510022.200
[libp7 info] 2032 4237 3030 3036 3030 3030 3034 3030 2B7000600000400
[libp7 info] 6D61 696E 2E63 666C 7330 4430 main.cfls0D0
The 8 byte filesize (2B7) is preceded by spaces (0x20). It should be 5 ASCII-zeros (0x30).
OW should be set to "02". In your packet the "2" is preceded by a binary zero. It should be an ASCII-zero.
I'll be back!
- cakeisalie5
- Senior Member
-
- Posts: 102
- Joined: Sun Mar 27, 2016 10:24 am
- Location: France
- Calculators: Casio Afx 1.0, Casio fx-9860GII, Casio fx-CG50
Re: Protocol 7.00 - Resend request ?
Oh god, you're right Oo
I've fixed the size-thing, but I don't know where the binary zero comes from. I'll investigate.
Thanks soooo much <3
I've fixed the size-thing, but I don't know where the binary zero comes from. I'll investigate.
Thanks soooo much <3
Part of the Planète Casio community (FR) - main author of Cahute
- cakeisalie5
- Senior Member
-
- Posts: 102
- Joined: Sun Mar 27, 2016 10:24 am
- Location: France
- Calculators: Casio Afx 1.0, Casio fx-9860GII, Casio fx-CG50
Re: Protocol 7.00 - Resend request ?
So I've corrected quite some errors related to packets, and now, it should work as hell. But it does not 
Here is the new test file :
And here are the new logs :
I've checked manually the two packets and they should be good (I haven't checked the checksum manually as if it works for the command extended packet, it should work for data packet as well).
I've tried adding a folder name (as I just send an empty string in D1, a.k.a. the folder name) and I still get the same problem : infinite resend requests. I don't understand the problem Oo
(distant repository has been updated with corrections)

Here is the new test file :
test file: Show
And here are the new logs :
logs: Show
I've checked manually the two packets and they should be good (I haven't checked the checksum manually as if it works for the command extended packet, it should work for data packet as well).
I've tried adding a folder name (as I just send an empty string in D1, a.k.a. the folder name) and I still get the same problem : infinite resend requests. I don't understand the problem Oo
(distant repository has been updated with corrections)
Part of the Planète Casio community (FR) - main author of Cahute
- SimonLothar
- Senior Member
-
- Posts: 605
- Joined: Sat Sep 15, 2012 6:59 am
- Location: Krautland ****
- Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400
Re: Protocol 7.00 - Resend request ?
No worries. You are welcome.cakeisalie5 wrote:Thanks soooo much <3
You have to use the same subtype (ST) in the data packet (T=0x02) as in the corresponding command packet (T=0x01).cakeisalie5 wrote:[libp7 info] p7_send_ext: sending the following extended packet :
[libp7 info] 0230 3031 3031 3233 3030 3033 3030 3031 .001012300030001
=>
[libp7 info] 0234 3531 3031 3233 3030 3033 3030 3031 .451012300030001
I'll be back!
- cakeisalie5
- Senior Member
-
- Posts: 102
- Joined: Sun Mar 27, 2016 10:24 am
- Location: France
- Calculators: Casio Afx 1.0, Casio fx-9860GII, Casio fx-CG50
Re: Protocol 7.00 - Resend request ?
Ah crap, I didn't realize that 
It works perfectly now. Thanks <3

It works perfectly now. Thanks <3
Part of the Planète Casio community (FR) - main author of Cahute
9 posts
• Page 1 of 1
Return to Calculator Hacking/Modding Discussions
Who is online
Users browsing this forum: No registered users and 20 guests