nusb/ptp: transaction IDs are sequences of numbers starting with 0 (thanks unobe)

According to 'Digital Camera connectivity solutions using the picture
transfer protocol' [1] Section 2.3: "the PTP is specified using the
transaction model.  A transaction is composed of a request operation,
followed by an optional data transfer and a response.  Each
transaction has an identifier (TransactionID) that is session unique
and comprise of a 32 bit unsigned number.  The transaction IDs are a
sequence of numbers starting with 0x00000000 (for the SessionOpen
transaction) and increasing with every following operation."

[1] https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2012/jmv87/site/files/PTP%20Protocol.pdf
This commit is contained in:
Igor Böhm 2024-01-15 01:11:18 +00:00
parent c8d87b22d5
commit 53fe82ee86
2 changed files with 8 additions and 4 deletions

View file

@ -194,6 +194,10 @@ and
The
.B ctl
file supplies the device geometry and partitions when read.
.I Ptp
configures and exposes a camera's (and often a mobile
device's) storage to allow transferring data via the
Picture Transfer Protocol (PTP).
.SS Ethernet
.I Ether
handles USB ethernet devices. The file system provided is

View file

@ -75,9 +75,8 @@ static Dev *usbep[Setup+1];
static int debug = 0;
static ulong time0;
static int maxpacket = 64;
static int sessionId = 1;
static int transId = 1;
static int sessionId;
static int transId;
static Node **nodes;
static int nnodes;
@ -556,7 +555,7 @@ getnode(Req *r, uvlong path)
}
/*
* another proc migh'v come in and done it for us,
* another proc might've come in and done it for us,
* so check the cache again.
*/
if(y = cachednode(path, &f))
@ -1048,6 +1047,7 @@ threadmain(int argc, char **argv)
sendp(iochan, ioproc());
sessionId = getpid();
transId = 0;
if(ptprpc(nil, OpenSession, 1, sessionId) < 0)
sysfatal("open session: %r");