Comments (1)
Been investigating this and found a few issues. I have ported this code and have a working copy in tkeyclient/load_app_multi_frame so will close this issue.
What i found.
CH552 drops bytes, and that is what you saw when the transfer failed. I have a fix for it in this branch. It was most likely more prone to happen when sending multiple frames in parallel, compared to "ordinary" usage.
Some minor issues I found was that the nsent
variable was not set to zero if the queue is full, hence offset
is updated even if we don't transfer anything. Se this snipped from above, offset
goes from 254 to 889 with just one transfer.
LoadAppData tx (frame len: 1+128):
00000000 53 05 13 05 55 e8 aa cf 37 a5 ca 84 13 05 b5 73 |S...U...7......s|
00000010 aa cd 37 f5 6e 3c 13 05 25 37 aa d3 37 05 95 fe |..7.n<..%7..7...|
00000020 13 05 b5 82 aa d1 37 f5 4f a5 13 05 a5 53 aa d7 |......7.O....S..|
00000030 37 35 1d 5f 13 05 15 6f aa d5 37 55 0e 51 13 05 |75._...o..7U.Q..|
00000040 f5 27 aa db 37 85 e6 ad 13 05 15 2d aa d9 37 75 |.'..7......-..7u|
00000050 05 9b 13 05 c5 88 aa df 37 75 3e 2b 13 05 f5 c1 |........7u>+....|
00000060 aa dd 37 e5 83 1f 13 05 b5 9a 23 22 a1 10 37 c5 |..7.......#"..7.|
00000070 41 fb 13 05 b5 d6 23 20 a1 10 37 d5 e0 5b 13 05 |A.....# ..7..[..|
00000080 95 |.|
QUEUE after send ID:2: [0 1 2] (nsent:127 offset:254 binlen:27656)
LoadAppData rx (expectedID:0): no data
no frame to read yet
QUEUE: [0 1 2]
LoadAppData rx (expectedID:0): no data
no frame to read yet
QUEUE: [0 1 2]
LoadAppData rx (expectedID:0): no data
no frame to read yet
QUEUE: [0 1 2]
LoadAppData rx (expectedID:0): no data
no frame to read yet
QUEUE: [0 1 2]
LoadAppData rx (expectedID:0) (frame len: 1+4):
00000000 11 06 00 00 00 |.....|
QUEUE after recv: [1 2]
LoadAppData tx (frame len: 1+128):
00000000 73 05 08 6d f2 fd 15 e5 fd 13 45 15 00 e5 b7 13 |s..m......E.....|
00000010 fc 34 00 13 15 2c 00 4e 95 00 41 05 65 13 05 05 |.4...,.N..A.e...|
00000020 15 0a 95 13 06 00 08 81 45 97 60 00 00 e7 80 a0 |........E.`.....|
00000030 d5 01 45 83 a5 0d 08 f5 dd 83 a5 4d 08 33 06 ad |..E........M.3..|
00000040 00 05 05 23 00 b6 00 e3 16 85 fe 93 f5 84 01 01 |...#............|
00000050 45 e3 92 75 fb 13 d5 54 00 93 7c 35 00 05 65 13 |E..u...T..|5..e.|
00000060 05 05 0d 0a 95 13 06 00 08 81 45 97 60 00 00 e7 |..........E.`...|
00000070 80 80 d1 05 65 13 05 05 15 0a 95 03 45 05 00 7d |....e.......E..}|
00000080 15 |.|
QUEUE after send ID:3: [1 2 3] (nsent:127 offset:889 binlen:27656)
from tkey-ssh-agent.
Related Issues (20)
- LGPL licenses on libraries HOT 2
- Break out device libraries
- Add Windows support to tkey-ssh-agent
- windows: getting "access denied" notification if named pipe already exists HOT 3
- Break out Go packages HOT 4
- Break out device apps HOT 1
- Break out client apps
- Break out ssh-agent HOT 3
- Use with gpg-agent / scdaemon HOT 2
- Question: Why use `RM=/bin/rm` in certain places and not others? HOT 4
- detect os when building to support darwin HOT 1
- Update go-serial to build for darwin HOT 3
- Server use-case with no touch
- Embed tagged signer in tkey-ssh-agent HOT 2
- Did 0.0.6 release get re-tagged? HOT 13
- Use Goreleaser to build releases
- Building MSI package in CI fails HOT 1
- Convert man page to scdoc
- Handle if the socket exists when a service tries to start tkey-ssh-agent
- Linux: Document pinentry and Desktop Notifications HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tkey-ssh-agent.