From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14697 invoked from network); 12 Jan 2024 17:24:07 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 12 Jan 2024 17:24:07 -0000 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by 9front; Fri Jan 12 12:22:08 -0500 2024 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DD9971C327B for <9front@9front.org>; Fri, 12 Jan 2024 12:22:03 -0500 (EST) (envelope-from unobe@cpan.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id :to:subject:date:from:in-reply-to:mime-version:content-type :content-transfer-encoding; s=sasl; bh=YP2dZEG7Sol04VnHnJufYRgij KIThI/TZYz3gsbFgkY=; b=P+CDRPJshK5K8bWAKBRIxqQZnoyhSsZJjkBB+MHzd uGy2hzdquknnaBbU3/evze+AzTubVvRZIyklSFj+IVFGFhjecVpIiFb9Geh3x/Qg zJIKrpBYB5TAVpyKu8bpRBf7AMEetBtLM0IvMth+hogY5ax7KDqhB38Gk3IJ0ZYL gk= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id D14521C327A for <9front@9front.org>; Fri, 12 Jan 2024 12:22:03 -0500 (EST) (envelope-from unobe@cpan.org) Received: from strider.localdomain (unknown [24.205.13.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id EA4671C3278 for <9front@9front.org>; Fri, 12 Jan 2024 12:22:02 -0500 (EST) (envelope-from unobe@cpan.org) Message-ID: <84C5A9129D452A65D1989D888BF3BFF5@smtp.pobox.com> To: 9front@9front.org Date: Fri, 12 Jan 2024 09:22:01 -0800 From: unobe@cpan.org In-Reply-To: <29B9949F335D74FC85BAA0A483E809AD@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Pobox-Relay-ID: 19FFCD08-B16F-11EE-A91E-78DCEB2EC81B-09620299!pb-smtp1.pobox.com List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: configuration SVG map/reduce shader 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. Reply-To: 9front@9front.org Precedence: bulk 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 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");