9front - general discussion about 9front
 help / color / mirror / Atom feed
* [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.
@ 2023-09-28  6:26 Romano
  2023-09-28  7:01 ` unobe
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Romano @ 2023-09-28  6:26 UTC (permalink / raw)
  To: 9front


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");
 



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-01-12 17:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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       ` [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

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).