9front - general discussion about 9front
 help / color / mirror / Atom feed
From: unobe@cpan.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH 3/6] nusb/ptp: add mention to nusb man page and fix implementation per spec to start with transaction id 0, not 1.
Date: Fri, 12 Jan 2024 09:22:01 -0800	[thread overview]
Message-ID: <84C5A9129D452A65D1989D888BF3BFF5@smtp.pobox.com> (raw)
In-Reply-To: <29B9949F335D74FC85BAA0A483E809AD@eigenstate.org>

Quoth ori@eigenstate.org:
> Quoth unobe@cpan.org:
> > 
> > So this patch looks good as well?  I don't have a commit bit.
> 
> No. It doesn't seem to do what you said it does.
> 
> I thought the goal was to start from transaction id 1,
> but your change makes it start from id 0.
> 

This is what I wrote a month ago:

Quoth unobe@cpan.org:
> Ping.
> 
> Re: transaction ID, it must be set to 0 for opening a session, not 1.
> See section 2.3 (page 3) of this pdf:
> https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2012/jmv87/site/files/PTP%20Protocol.pdf
> 
> And also (I suppose more importantly, the standard referenced) section
> 9.3.1 (page 50) of this pdf:
> https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2012/jmv87/site/files/pima15740-2000.pdf
> 
> Quoth unobe@cpan.org:
> > The transaction id is meant to be 0, not 1, per the spec (and what the
> > patch shows): slipped up on the first line of the commit message.
> > 

I've changed the subject line (the first line of the commit message)
in this reply and here's my original message (with the corrected
subject line) from September 27:

From: Romano <unobe@cpan.org>
Date: Wed Sep 27 23:58:39 -0700 2023
Subject: [PATCH 3/6] nusb/ptp: add mention to nusb man page and fix implementation per spec to start with transaction id 0, not 1.


Apple iPhones can now be used to transfer images. There is still an issue with the iPhone permission, wherein an actor has to be pretty quick on the trigger to Allow the connection from the iPhone side, but that would require a pause somewhere in the handshake that I did not have time to look into further. This patch at least allows the connection to succeed when permitted.
---
diff c9c5d6455a6502ffb0f5490d5602396852261f4c 755ac2c11ce134f76d83a2a42edb07a6304d1de8
--- a/sys/man/4/nusb
+++ b/sys/man/4/nusb
@@ -194,6 +194,10 @@
 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
--- a/sys/src/cmd/nusb/ptp/ptp.c
+++ b/sys/src/cmd/nusb/ptp/ptp.c
@@ -75,9 +75,8 @@
 
 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 @@
 		}
 
 		/*
-		 * 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 @@
 	sendp(iochan, ioproc());
 
 	sessionId = getpid();
+	transId   = 0;
 	if(ptprpc(nil, OpenSession, 1, sessionId) < 0)
 		sysfatal("open session: %r");
 




      reply	other threads:[~2024-01-12 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  6:26 [9front] [PATCH 3/6] nusb/ptp: add mention to nusb man page and fix implementation per spec to start with transaction id 1, not 0 Romano
2023-09-28  7:01 ` unobe
2023-12-11 19:19   ` [9front] [PATCH 3/6] nusb/ptp: add mention to nusb man page and fix implementation per spec to start with transaction id 0, not 1 unobe
2023-12-11 20:22 ` [9front] [PATCH 3/6] nusb/ptp: add mention to nusb man page and fix implementation per spec to start with transaction id 1, not 0 ori
2023-12-11 22:55   ` unobe
2023-12-11 20:36 ` ori
2024-01-12  4:14   ` unobe
2024-01-12  8:05     ` igor
2024-01-12 15:16     ` ori
2024-01-12 17:22       ` unobe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84C5A9129D452A65D1989D888BF3BFF5@smtp.pobox.com \
    --to=unobe@cpan.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).