From e43d27bd82c37b97fce869bee128d8d4611d9e73 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Fri, 18 Mar 2022 18:59:08 -0400 Subject: [PATCH] Add another idea for future improvement. Show the IP address of the GS in the NDA window. Add a file to document the protocol (more to come). --- Listener.xcodeproj/project.pbxproj | 2 ++ Listener/Protocol.md | 3 +++ Listener/Readme.md | 1 + Listener/main.c | 13 ++++++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Listener/Protocol.md diff --git a/Listener.xcodeproj/project.pbxproj b/Listener.xcodeproj/project.pbxproj index 3b168af..efa26af 100644 --- a/Listener.xcodeproj/project.pbxproj +++ b/Listener.xcodeproj/project.pbxproj @@ -52,6 +52,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 9D2ABA2827E3DB0400F40856 /* Protocol.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Protocol.md; sourceTree = ""; }; 9D51559926A1ED510075EBC7 /* Listener */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Listener; sourceTree = BUILT_PRODUCTS_DIR; }; 9D51559C26A1ED510075EBC7 /* Listener.2mg */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Listener.2mg; sourceTree = BUILT_PRODUCTS_DIR; }; 9D51559E26A1ED510075EBC7 /* Listener.shk */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Listener.shk; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -119,6 +120,7 @@ 9D5155A826A1ED510075EBC7 /* main.rez */, 9D5155AA26A1ED510075EBC7 /* Makefile */, 9D5156A426A8C8B30075EBC7 /* Readme.md */, + 9D2ABA2827E3DB0400F40856 /* Protocol.md */, 9D5155AC26A1ED510075EBC7 /* make */, 9D5155C526A1ED510075EBC7 /* Supporting Files */, ); diff --git a/Listener/Protocol.md b/Listener/Protocol.md new file mode 100644 index 0000000..c4d5359 --- /dev/null +++ b/Listener/Protocol.md @@ -0,0 +1,3 @@ +# Listener Protocol + + diff --git a/Listener/Readme.md b/Listener/Readme.md index c1e08d7..f6f32d2 100644 --- a/Listener/Readme.md +++ b/Listener/Readme.md @@ -58,3 +58,4 @@ There are a number of improvements to make: * Instead of injecting keyboard events through the Event Manager on the GS, look at injecting fake keypresses into ADB itself. This should improve compatibility with applications that do not get their key events from the Event Manager. Based on what I have read, the SendInfo toolbox routine with the keyCode command should be able to do this. It should be possible based on what things like Video Keyboard does in the System 6.0.1 distribution. * Investigate if some minimal amount of bonjour support could be introduced on the GS side so that the modern device could detect its presence on the network. That way, you wouldn't need to set the IP address of the GS in the app. * There have been suggestions to turn this into a general solution for integrating a modern machine with a GS. This might involve things like file transfer in either direction, clipboard syncing and perhaps other things along those lines. +* Add a mode in the app where you can just type instead of using speech. And this would let you paste also. diff --git a/Listener/main.c b/Listener/main.c index 65d726f..02f709b 100644 --- a/Listener/main.c +++ b/Listener/main.c @@ -126,11 +126,13 @@ static tStateHandler stateHandlers[NUM_LISTEN_STATES] = { handleErrorState, }; + +static char waitingMessage[48] = "Waiting for connection"; static char * stateMessages[NUM_LISTEN_STATES] = { "Starting network tools", "Connecting to network", "Creating listen socket", - "Waiting for connection", + waitingMessage, "Establishing connection", "Connected to device", "Receiving text", @@ -395,6 +397,15 @@ void handleNetworkConnectedState(void) Word error; TCPIPPoll(); + + Long ipAddress = TCPIPGetMyIPAddress(); + if (!toolerror()) { + strcpy(waitingMessage, "Waiting for connection at "); + TCPIPConvertIPToCASCII(ipAddress, &(waitingMessage[26]), 0); + } else { + strcpy(waitingMessage, "Waiting for connection"); + } + globals->listenIpid = TCPIPLogin(userId, 0, 0, 0, 64); if (toolerror()) { enterErrorState("Unable to create socket", toolerror());