6.0.23.81

This commit is contained in:
John Wiseman 2023-07-29 07:23:11 +01:00
parent ed81fc5267
commit b77dbd8ce1
45 changed files with 28927 additions and 23088 deletions

View File

@ -9668,7 +9668,7 @@ VOID SaveConfig(char * ConfigName)
// Save UI config
for (i=1; i<=32; i++)
for (i=1; i <= GetNumberofPorts(); i++)
{
char Key[100];
@ -10192,7 +10192,7 @@ BOOL GetConfig(char * ConfigName)
GetStringValue(group, "Version", Size);
sscanf(Size,"%d,%d,%d,%d", &LastVer[0], &LastVer[1], &LastVer[2], &LastVer[3]);
for (i=1; i<=32; i++)
for (i =1 ; i <= GetNumberofPorts(); i++)
{
char Key[100];
@ -10654,7 +10654,8 @@ int Disconnected (int Stream)
}
/* ---- TAJ PG SERVER ---- */
if ( conn->UserPointer->Temp->RUNPGPARAMS ) {
if (conn->UserPointer && conn->UserPointer->Temp && conn->UserPointer->Temp->RUNPGPARAMS)
{
printf("Freeing RUNPGPARAMS\n");
free(conn->UserPointer->Temp->RUNPGPARAMS);
conn->UserPointer->Temp->RUNPGPARAMS = NULL;

View File

@ -1110,10 +1110,12 @@
// Fix Webmail auto-refresh when page exceeds 64K bytes (54)
// Fix Webmail send when using both headers/footers and attachmonts (55)
// Fix R: line corruption on some 64 bit builds
// Dont drop empty lines inm TEXTFORWARDING (61)
// Dont drop empty lines in TEXTFORWARDING (61)
// Dont wait for body prompt for TEXTFORWARDING for SID [PMS-3.2-C$] (62)
// Add forwarding mode SETCALLTOSENDER for PMS Systems that don't accept < in SP (63)
// QtTerm Monitoring fixed for 63 port version of BPQ (69)
// Fix to UI system to support up to 63 ports (79)
// Fix recently introduced crash when "Don't allow new users" is set (81)
#include "bpqmail.h"
@ -1711,7 +1713,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
}
/* ---------- TAJ --PG Server------*/
if ( user->Temp->RUNPGPARAMS ) {
if (user->Temp && user->Temp->RUNPGPARAMS ) {
printf("Also freeing RUNPGARGS\n");
free(user->Temp->RUNPGPARAMS);

View File

@ -1115,7 +1115,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Fix processing C command if first port driver is SCSPACTROR (20)
// Fix crash in UZ7HO driver if bad raw frame received (21)
// Fix using FLARQ chat mode with FLDIGI ddriover (22)
// Fixed to KISSHF driver (23)
// Fix to KISSHF driver (23)
// Fix for application buffer loss (24)
// Add Web Sockets auto-refresh option for Webmail index page (25)
// Fix FREEDATA driver for compatibility with FreeData TNC version 0.6.4-alpha.3 (25)
@ -1173,7 +1173,10 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Detect loss of DED application (76)
// Fix connects to Application Alias with UZ7HO Driver (76)
// Fix Interlock of ports on same UZ7HO modem. (76)
// Add extended Ports command
// Add extended Ports command (77)
// Fix crash in Linbpq when stdout is redirected to /dev/tty? and stdin ia redirected (78)
// Fix Web Terminal (80)
// Trap ENCRYPTION message from VARA (81)
#define CKernel

View File

@ -321,10 +321,26 @@
<File
RelativePath="..\CommonSource\Cmd.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\CMSAuth.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\CommonSource\CommonCode.c"

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DESKTOP-MHE5LO8"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DESKTOP-MHE5LO8"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1645,7 +1645,7 @@ int InnerProcessHTTPMessage(struct ConnectionInfo * conn)
HostPtr = strstr(MsgPtr, "Host: ");
WebSock = strstr(MsgPtr, "Upgrade");
WebSock = strstr(MsgPtr, "Upgrade: websocket");
if (HostPtr)
{

4849
HTTPcode.c.bak Normal file

File diff suppressed because it is too large Load Diff

View File

@ -215,7 +215,7 @@ BEGIN
MENUITEM "Strip Linefeeds", BPQStripLF
MENUITEM "Log Output", BPQLogOutput
MENUITEM "Send Disconnected", BPQSendDisconnected
MENUITEM "Chat Terminal Mode", CHATTERM
MENUITEM "Chat Terminal Mode (Send Keppalives)", CHATTERM
MENUITEM "Restore Windows on load", ID_WINDOWS_RESTORE
MENUITEM "Beep if input too long", ID_WARNWRAP
MENUITEM "Wrap Input", ID_WRAP

View File

@ -749,7 +749,10 @@ int main(int argc, char * argv[])
// Disable Console Terminal if stdout redirected
if (!isatty(STDOUT_FILENO))
// printf("STDOUT %d\n",isatty(STDOUT_FILENO));
// printf("STDIN %d\n",isatty(STDIN_FILENO));
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
Redirected = 1;
#endif

427
MCP2221.c Normal file
View File

@ -0,0 +1,427 @@
// MCP2221.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <stdlib.h>
#include "time.h"
#include "winstdint.h"
#include "hidapi.h"
void DecodeCM108(int Port, char * ptr);
#ifdef WIN32
/* Simple Raw HID functions for Windows - for use with Teensy RawHID example
* http://www.pjrc.com/teensy/rawhid.html
* Copyright (c) 2009 PJRC.COM, LLC
*
* rawhid_open - open 1 or more devices
* rawhid_recv - receive a packet
* rawhid_send - send a packet
* rawhid_close - close a device
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above description, website URL and copyright notice and this permission
* notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Version 1.0: Initial Release
*/
#include <stdio.h>
#include <stdlib.h>
//#include <stdint.h>
#include <windows.h>
#include <setupapi.h>
//#include <ddk/hidsdi.h>
//#include <ddk/hidclass.h>
typedef USHORT USAGE;
typedef struct _HIDD_CONFIGURATION {
PVOID cookie;
ULONG size;
ULONG RingBufferSize;
} HIDD_CONFIGURATION, *PHIDD_CONFIGURATION;
typedef struct _HIDD_ATTRIBUTES {
ULONG Size;
USHORT VendorID;
USHORT ProductID;
USHORT VersionNumber;
} HIDD_ATTRIBUTES, *PHIDD_ATTRIBUTES;
typedef struct _HIDP_CAPS {
USAGE Usage;
USAGE UsagePage;
USHORT InputReportByteLength;
USHORT OutputReportByteLength;
USHORT FeatureReportByteLength;
USHORT Reserved[17];
USHORT NumberLinkCollectionNodes;
USHORT NumberInputButtonCaps;
USHORT NumberInputValueCaps;
USHORT NumberInputDataIndices;
USHORT NumberOutputButtonCaps;
USHORT NumberOutputValueCaps;
USHORT NumberOutputDataIndices;
USHORT NumberFeatureButtonCaps;
USHORT NumberFeatureValueCaps;
USHORT NumberFeatureDataIndices;
} HIDP_CAPS, *PHIDP_CAPS;
typedef struct _HIDP_PREPARSED_DATA * PHIDP_PREPARSED_DATA;
// a list of all opened HID devices, so the caller can
// simply refer to them by number
typedef struct hid_struct hid_t;
static hid_t *first_hid = NULL;
static hid_t *last_hid = NULL;
struct hid_struct {
HANDLE handle;
int open;
struct hid_struct *prev;
struct hid_struct *next;
};
static HANDLE rx_event=NULL;
static HANDLE tx_event=NULL;
static CRITICAL_SECTION rx_mutex;
static CRITICAL_SECTION tx_mutex;
// private functions, not intended to be used from outside this file
static void add_hid(hid_t *h);
static hid_t * get_hid(int num);
static void free_all_hid(void);
void print_win32_err(void);
// rawhid_recv - receive a packet
// Inputs:
// num = device to receive from (zero based)
// buf = buffer to receive packet
// len = buffer's size
// timeout = time to wait, in milliseconds
// Output:
// number of bytes received, or -1 on error
//
int rawhid_recv(int num, void *buf, int len, int timeout)
{
hid_t *hid;
unsigned char tmpbuf[516];
OVERLAPPED ov;
DWORD r;
int n;
if (sizeof(tmpbuf) < len + 1) return -1;
hid = get_hid(num);
if (!hid || !hid->open) return -1;
EnterCriticalSection(&rx_mutex);
ResetEvent(&rx_event);
memset(&ov, 0, sizeof(ov));
ov.hEvent = rx_event;
if (!ReadFile(hid->handle, tmpbuf, len + 1, NULL, &ov)) {
if (GetLastError() != ERROR_IO_PENDING) goto return_error;
r = WaitForSingleObject(rx_event, timeout);
if (r == WAIT_TIMEOUT) goto return_timeout;
if (r != WAIT_OBJECT_0) goto return_error;
}
if (!GetOverlappedResult(hid->handle, &ov, &n, FALSE)) goto return_error;
LeaveCriticalSection(&rx_mutex);
if (n <= 0) return -1;
n--;
if (n > len) n = len;
memcpy(buf, tmpbuf + 1, n);
return n;
return_timeout:
CancelIo(hid->handle);
LeaveCriticalSection(&rx_mutex);
return 0;
return_error:
print_win32_err();
LeaveCriticalSection(&rx_mutex);
return -1;
}
// rawhid_send - send a packet
// Inputs:
// num = device to transmit to (zero based)
// buf = buffer containing packet to send
// len = number of bytes to transmit
// timeout = time to wait, in milliseconds
// Output:
// number of bytes sent, or -1 on error
//
int rawhid_send(int num, void *buf, int len, int timeout)
{
hid_t *hid;
unsigned char tmpbuf[516];
OVERLAPPED ov;
DWORD n, r;
if (sizeof(tmpbuf) < len + 1) return -1;
hid = get_hid(num);
if (!hid || !hid->open) return -1;
EnterCriticalSection(&tx_mutex);
ResetEvent(&tx_event);
memset(&ov, 0, sizeof(ov));
ov.hEvent = tx_event;
tmpbuf[0] = 0;
memcpy(tmpbuf + 1, buf, len);
if (!WriteFile(hid->handle, tmpbuf, len + 1, NULL, &ov)) {
if (GetLastError() != ERROR_IO_PENDING) goto return_error;
r = WaitForSingleObject(tx_event, timeout);
if (r == WAIT_TIMEOUT) goto return_timeout;
if (r != WAIT_OBJECT_0) goto return_error;
}
if (!GetOverlappedResult(hid->handle, &ov, &n, FALSE)) goto return_error;
LeaveCriticalSection(&tx_mutex);
if (n <= 0) return -1;
return n - 1;
return_timeout:
CancelIo(hid->handle);
LeaveCriticalSection(&tx_mutex);
return 0;
return_error:
print_win32_err();
LeaveCriticalSection(&tx_mutex);
return -1;
}
HANDLE rawhid_open(char * Device)
{
DWORD index=0;
HANDLE h;
hid_t *hid;
int count=0;
if (first_hid) free_all_hid();
if (!rx_event)
{
rx_event = CreateEvent(NULL, TRUE, TRUE, NULL);
tx_event = CreateEvent(NULL, TRUE, TRUE, NULL);
InitializeCriticalSection(&rx_mutex);
InitializeCriticalSection(&tx_mutex);
}
h = CreateFile(Device, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
if (h == INVALID_HANDLE_VALUE)
return 0;
hid = (struct hid_struct *)malloc(sizeof(struct hid_struct));
if (!hid)
{
CloseHandle(h);
return 0;
}
hid->handle = h;
hid->open = 1;
add_hid(hid);
return h;
}
// rawhid_close - close a device
//
// Inputs:
// num = device to close (zero based)
// Output
// (nothing)
//
void rawhid_close(int num)
{
hid_t *hid;
hid = get_hid(num);
if (!hid || !hid->open) return;
CloseHandle(hid->handle);
hid->handle = NULL;
hid->open = FALSE;
}
static void add_hid(hid_t *h)
{
if (!first_hid || !last_hid) {
first_hid = last_hid = h;
h->next = h->prev = NULL;
return;
}
last_hid->next = h;
h->prev = last_hid;
h->next = NULL;
last_hid = h;
}
static hid_t * get_hid(int num)
{
hid_t *p;
for (p = first_hid; p && num > 0; p = p->next, num--) ;
return p;
}
static void free_all_hid(void)
{
hid_t *p, *q;
for (p = first_hid; p; p = p->next)
{
CloseHandle(p->handle);
p->handle = NULL;
p->open = FALSE;
}
p = first_hid;
while (p) {
q = p;
p = p->next;
free(q);
}
first_hid = last_hid = NULL;
}
void print_win32_err(void)
{
char buf[256];
DWORD err;
err = GetLastError();
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
0, buf, sizeof(buf), NULL);
printf("err %ld: %s\n", err, buf);
}
#endif
HANDLE hDevice;
char * HIDDevice;
int main()
{
int Len;
unsigned char Msg[65] = "";
DecodeCM108(0, "0x4D8:0xDD");
hDevice = rawhid_open(HIDDevice);
if (hDevice)
printf("Rigcontrol HID Device %s opened\n", HIDDevice);
Msg[0] = 0x51;
Msg[0] = 0xB0;
Msg[1] = 0x1;
Len = rawhid_send(0, Msg, 64, 100);
Msg[0] = 0;
#ifdef WIN32
Len = rawhid_recv(0, Msg, 64, 100);
#else
Len = read(PORT->hDevice, Msg, 64);
#endif
return 0;
}
char * CM108Device = NULL;
void DecodeCM108(int Port, char * ptr)
{
// Called if Device Name or PTT = Param is CM108
#ifdef WIN32
// Next Param is VID and PID - 0xd8c:0x8 or Full device name
// On Windows device name is very long and difficult to find, so
// easier to use VID/PID, but allow device in case more than one needed
char * next;
int32_t VID = 0, PID = 0;
char product[256];
char sernum[256] = "NULL";
struct hid_device_info *devs, *cur_dev;
const char *path_to_open = NULL;
hid_device *handle = NULL;
if (strlen(ptr) > 16)
CM108Device = _strdup(ptr);
else
{
VID = strtol(ptr, &next, 0);
if (next)
PID = strtol(++next, &next, 0);
// Look for Device
devs = hid_enumerate(0, 0); // so we list devices(USHORT)VID, (USHORT)PID);
cur_dev = devs;
while (cur_dev)
{
wcstombs(product, cur_dev->product_string, 255);
if (cur_dev->serial_number)
wcstombs(sernum, cur_dev->serial_number, 255);
if (product)
printf("HID Device %s VID %X PID %X Ser %s %s\n", product, cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
else
printf("HID Device %s VID %X PID %X Ser %s %s", "Missing Product\n", cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
if (cur_dev->vendor_id == VID && cur_dev->product_id == PID)
path_to_open = cur_dev->path;
cur_dev = cur_dev->next;
}
if (path_to_open)
{
HIDDevice = _strdup(path_to_open);
}
hid_free_enumeration(devs);
}
#else
// Linux - Next Param HID Device, eg /dev/hidraw0
CM108Device = _strdup(ptr);
#endif
}

203
MCP2221.vcproj Normal file
View File

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="MCP2221"
ProjectGUID="{FCBB40CD-F7C2-4A97-989A-FC5CEADF7FC1}"
RootNamespace="MCP2221"
Keyword="Win32Proj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib setupapi.lib $(NOINHERIT)"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib $(NoInherit)"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\hid.c"
>
</File>
<File
RelativePath=".\MCP2221.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DESKTOP-TGEL8RC"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command="$(TargetPath)"
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DESKTOP-TGEL8RC"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -5286,6 +5286,7 @@ void DecodeCM108(int Port, char * ptr)
char * next;
int32_t VID = 0, PID = 0;
char product[256];
char sernum[256] = "NULL";
struct hid_device_info *devs, *cur_dev;
const char *path_to_open = NULL;
@ -5306,11 +5307,13 @@ void DecodeCM108(int Port, char * ptr)
while (cur_dev)
{
wcstombs(product, cur_dev->product_string, 255);
if (cur_dev->serial_number)
wcstombs(sernum, cur_dev->serial_number, 255);
if (product)
Debugprintf("HID Device %s VID %X PID %X %s", product, cur_dev->vendor_id, cur_dev->product_id, cur_dev->path);
Debugprintf("HID Device %s VID %X PID %X Ser %s %s", product, cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
else
Debugprintf("HID Device %s VID %X PID %X %s", "Missing Product", cur_dev->vendor_id, cur_dev->product_id, cur_dev->path);
Debugprintf("HID Device %s VID %X PID %X Ser %s %s", "Missing Product", cur_dev->vendor_id, cur_dev->product_id, sernum, cur_dev->path);
if (cur_dev->vendor_id == VID && cur_dev->product_id == PID)
path_to_open = cur_dev->path;

View File

@ -552,6 +552,12 @@ ok:
txlen = GetLengthfromBuffer(buff) - (MSGHDDRLEN + 1); // 1 as no PID
if (txlen == 1 && buff->L2DATA[0] == 0) // Keepalive Packet
{
ReleaseBuffer(buffptr);
return 0;
}
buffptr->Len = txlen;
memcpy(buffptr->Data, buff->L2DATA, txlen);
@ -1093,6 +1099,56 @@ void SCSCheckRX(struct TNCINFO * TNC)
// complete. If CRC is duff, we will eventually time out and get a retry. The retry code
// can clear the RC buffer
if (TNC->UsingTermMode)
{
// Send response to Host if connected
PMSGWITHLEN buffptr;
int Len = TNC->RXLen;
int Posn = 0;
// First message is probably ACK of JHO4T - AA AA 1F 00 1E 19
if (TNC->RXBuffer[0] == 0xaa && Len > 6)
{
memmove(TNC->RXBuffer, &TNC->RXBuffer[6], Len - 6);
Len -= 6;
}
// TNC seems to send 1e f7 or 1e 87 regularly
while (TNC->RXBuffer[0] == 0x1e && Len > 1)
{
memmove(TNC->RXBuffer, &TNC->RXBuffer[2], Len - 2);
Len -= 2;
}
if (Len == 0)
{
TNC->RXLen = 0; // Ready for next frame
return;
}
while (Len > 250)
{
buffptr = GetBuff();
buffptr->Len = 250;
memcpy(buffptr->Data, &TNC->RXBuffer[Posn], 250);
C_Q_ADD(&TNC->Streams[0].PACTORtoBPQ_Q, buffptr);
Len -= 250;
Posn += 250;
}
buffptr = GetBuff();
buffptr->Len = Len;
memcpy(buffptr->Data, &TNC->RXBuffer[Posn], Len);
C_Q_ADD(&TNC->Streams[0].PACTORtoBPQ_Q, buffptr);
TNC->RXLen = 0; // Ready for next frame
return;
}
if (TNC->RXBuffer[0] != 170)
{
// Char Mode Frame I think we need to see cmd: on end
@ -1247,6 +1303,51 @@ VOID SCSPoll(int Port)
int nn;
struct STREAMINFO * STREAM;
if (TNC->UsingTermMode)
{
if (TNC->Streams[Stream].BPQtoPACTOR_Q)
{
PMSGWITHLEN buffptr = Q_REM(&TNC->Streams[Stream].BPQtoPACTOR_Q);
// See if enter host mode command
if (_memicmp(buffptr->Data, "ENTERHOST\r", buffptr->Len) == 0)
{
TNC->UsingTermMode = FALSE;
memcpy(Poll, "JHOST4\r", 7);
TNC->TXLen = 7;
WriteCommBlock(TNC);
// No response expected
Sleep(10);
Poll[2] = 255; // Channel
TNC->Toggle = 0;
Poll[3] = 0x41;
Poll[4] = 0; // Len-1
Poll[5] = 'G'; // Poll
CRCStuffAndSend(TNC, Poll, 6);
TNC->InternalCmd = FALSE;
TNC->Timeout = 5; // 1/2 sec - In case missed
}
else
{
// Send to TNC
memcpy(&Poll[0], buffptr->Data, buffptr->Len);
TNC->TXLen = buffptr->Len;;
WriteCommBlock(TNC);
}
ReleaseBuffer(buffptr);
}
return;
}
if (TNC->MinLevelTimer)
{
TNC->MinLevelTimer--;
@ -1721,6 +1822,10 @@ VOID SCSPoll(int Port)
// But we cant set digipeated bit in call, so if we find one, skip message
// This doesn't seem to work
/*
ConvFromAX25(Buffer + 7, ICall); // Origin
strlop(ICall, ' ');
@ -1762,7 +1867,7 @@ VOID SCSPoll(int Port)
1, Buffer, // Flag CmdSet as Data
2, TNC->NodeCall); // Flag as Chan 0 Command
}
*/
ReleaseBuffer((UINT *)buffptr);
return;
}
@ -2006,6 +2111,24 @@ VOID SCSPoll(int Port)
return;
}
if ((Stream == 0) && memcmp(Buffer, "EXITHOST", 8) == 0)
{
UCHAR * Poll = TNC->TXBuffer;
TNC->UsingTermMode = 1;
ExitHost(TNC);
// Send CR to get prompt from TNC
Poll[0] = 13;
TNC->TXLen = 1;
WriteCommBlock(TNC);
ReleaseBuffer(buffptr);
return;
}
if (Stream == 0 && Buffer[0] == 'C' && datalen > 2) // Pactor Connect
Poll[2] = TNC->Streams[0].DEDStream = 31; // Pactor Channel
@ -2087,7 +2210,6 @@ VOID SCSPoll(int Port)
}
}
// Anything else send to tnc.
Poll[4] = datalen - 1;
memcpy(&Poll[5], buffptr->Data, datalen);

View File

@ -290,6 +290,9 @@ ConfigLine:
if (_memicmp(buf, "UPDATEMAP", 9) == 0)
TNC->PktUpdateMap = TRUE;
else
if (_memicmp(buf, "TeensyRPR", 9) == 0)
TNC->TeensyRPR = TRUE;
else
if (_memicmp(buf, "WL2KREPORT", 10) == 0)
TNC->WL2K = DecodeWL2KReportLine(buf);
else
@ -1655,10 +1658,12 @@ VOID TrkExitHost(struct TNCINFO * TNC)
TNC->TXBuffer[0] = 1;
TNC->TXBuffer[1] = 1;
TNC->TXBuffer[2] = 1;
if (!TNC->TeensyRPR) // %R puts TNC into Program Mode.
{
memcpy(&TNC->TXBuffer[3], "%R", 2);
StuffAndSend(TNC, Poll, 5);
}
return;
}

View File

@ -342,7 +342,7 @@ BOOL SendAndCheck(struct ConnectionInfo * sockptr, unsigned char * MsgPtr, int l
VOID SendPortsForMonitor(SOCKET sock, int Secure)
{
UCHAR PortInfo[1500] = {0xff, 0xff};
UCHAR PortInfo[3000] = {0xff, 0xff};
UCHAR * ptr = &PortInfo[2];
char ID[31] = "";
struct PORTCONTROL * PORT;

View File

@ -32,14 +32,14 @@ static char MAILMYCALL[7];
#pragma pack(1)
UINT UIPortMask = 0;
BOOL UIEnabled[33];
BOOL UIMF[33];
BOOL UIHDDR[33];
BOOL UINull[33];
char * UIDigi[33];
char * UIDigiAX[33]; // ax.25 version of digistring
int UIDigiLen[33]; // Length of AX string
uint64_t UIPortMask = 0;
BOOL UIEnabled[MaxBPQPortNo + 1];
BOOL UIMF[MaxBPQPortNo + 1];
BOOL UIHDDR[MaxBPQPortNo + 1];
BOOL UINull[MaxBPQPortNo + 1];
char * UIDigi[MaxBPQPortNo + 1];
char * UIDigiAX[MaxBPQPortNo + 1]; // ax.25 version of digistring
int UIDigiLen[MaxBPQPortNo + 1]; // Length of AX string
@ -52,14 +52,13 @@ struct SEM DGSemaphore = {0, 0}; // For locking access to DG_Q;
VOID UnQueueRaw(void * Param);
static VOID Send_AX_Datagram(UCHAR * Msg, DWORD Len, UCHAR Port, UCHAR * HWADDR, BOOL Queue);
DllExport char * APIENTRY GetApplName(int Appl);
int APIENTRY SendRaw(int port, char * msg, int len);
char * APIENTRY GetApplName(int Appl);
int APIENTRY GetNumberofPorts();
int APIENTRY GetPortNumber(int portslot);
VOID SetupUIInterface()
{
int i, NumPorts = GetNumberofPorts();
int i;
#ifndef LINBPQ
struct _EXCEPTION_POINTERS exinfo;
#endif
@ -70,13 +69,13 @@ VOID SetupUIInterface()
UIPortMask = 0;
for (i = 1; i <= NumPorts; i++)
for (i = 1; i <= MaxBPQPortNo; i++)
{
if (UIEnabled[i])
{
char DigiString[100], * DigiLeft;
UIPortMask |= 1 << (i-1);
UIPortMask |= (uint64_t)1 << (i-1);
UIDigiLen[i] = 0;
if (UIDigi[i])
@ -122,7 +121,7 @@ VOID Free_UI()
int i;
PMESSAGEX AXMSG;
for (i = 1; i <= 32; i++)
for (i = 1; i <= MaxBPQPortNo; i++)
{
if (UIDigi[i])
{
@ -179,18 +178,25 @@ VOID SendMsgUI(struct MsgInfo * Msg)
{
char msg[200];
int len, i;
int Mask = UIPortMask;
int NumPorts = GetNumberofPorts();
uint64_t Mask = UIPortMask;
//12345 B 2053 TEST@ALL F6FBB 920325 This is the subject
char Via[80] = "";
struct tm *tm = gmtime((time_t *)&Msg->datecreated);
len = sprintf_s(msg, sizeof(msg),"%-6d %c %6d %-13s %-6s %02d%02d%02d %s\r",
Msg->number, Msg->type, Msg->length, Msg->to,
if (Msg->via[0])
{
Via[0] = '@';
strcpy(&Via[1], Msg->via);
strlop(Via, '.'); // Only show first part of via
}
len = sprintf_s(msg, sizeof(msg),"%-6d %c %6d %-6s%-7s %-6s %02d%02d%02d %s\r",
Msg->number, Msg->type, Msg->length, Msg->to, Via,
Msg->from, tm->tm_year-100, tm->tm_mon+1, tm->tm_mday, Msg->title);
for (i=1; i <= NumPorts; i++)
for (i=1; i <= MaxBPQPortNo; i++)
{
if ((Mask & 1) && UIHDDR[i])
Send_AX_Datagram(msg, len, i, AXDEST, TRUE);
@ -212,10 +218,19 @@ VOID SendHeaders(int Number, int Port)
while (Number <= LatestMsg)
{
char Via[80] = "";
Msg = FindMessageByNumber(Number);
if (Msg)
{
if (Msg->via[0])
{
Via[0] = '@';
strcpy(&Via[1], Msg->via);
strlop(Via, '.'); // Only show first part of via
}
if (len > (200 - strlen(Msg->title)))
{
Send_AX_Datagram(msg, len, Port, AXDEST, FALSE);
@ -224,8 +239,8 @@ VOID SendHeaders(int Number, int Port)
tm = gmtime((time_t *)&Msg->datecreated);
len += sprintf(&msg[len], "%-6d %c %6d %-13s %-6s %02d%02d%02d %s\r",
Msg->number, Msg->type, Msg->length, Msg->to,
len += sprintf(&msg[len], "%-6d %c %6d %-6s%-7s %-6s %02d%02d%02d %s\r",
Msg->number, Msg->type, Msg->length, Msg->to, Via,
Msg->from, tm->tm_year-100, tm->tm_mon+1, tm->tm_mday, Msg->title);
}
else
@ -248,12 +263,11 @@ VOID SendDummyUI(int num)
{
char msg[100];
int len, i;
int Mask = UIPortMask;
int NumPorts = GetNumberofPorts()
;
uint64_t Mask = UIPortMask;
len = sprintf_s(msg, sizeof(msg),"%-6d #\r", num);
for (i=1; i <= NumPorts; i++)
for (i=1; i <= MaxBPQPortNo; i++)
{
if (Mask & 1)
Send_AX_Datagram(msg, len, i, AXDEST, TRUE);
@ -266,8 +280,7 @@ VOID SendLatestUI(int Port)
{
char msg[20];
int len, i;
int Mask = UIPortMask;
int NumPorts = GetNumberofPorts();
uint64_t Mask = UIPortMask;
len = sprintf_s(msg, sizeof(msg),"%-6d !!\r", LatestMsg);
@ -277,9 +290,9 @@ VOID SendLatestUI(int Port)
return;
}
for (i=1; i <= NumPorts; i++)
for (i = 1; i <= MaxBPQPortNo; i++)
{
if ((Mask & 1) && UIHDDR[i])
if ((Mask & (uint64_t)1) && UIHDDR[i])
Send_AX_Datagram(msg, len, i, AXDEST, TRUE);
Mask >>= 1;
@ -325,8 +338,6 @@ static VOID Send_AX_Datagram(UCHAR * Msg, DWORD Len, UCHAR Port, UCHAR * HWADDR,
else
SendRaw(Port, (char *)&AXMSG.DEST, Len + 16);
return;
}
VOID UnQueueRaw(void * Param)
@ -366,6 +377,20 @@ VOID ProcessUItoFBB(char * msg, int len, int Port)
int Number, Sum, Sent = 0;
char cksum[3];
int n, i;
// Send_AX_Datagram uses Port Slot, not Port Number
for (n = 1 ; n <= GetNumberofPorts(); n++)
{
i = GetPortNumber(n);
if (i == Port)
{
Port = n;
break;
}
}
if (msg[0] == '?')
{
@ -523,8 +548,7 @@ VOID ExpandMailFor()
VOID SendMailFor(char * Msg, BOOL HaveCalls)
{
int Mask = UIPortMask;
int NumPorts = GetNumberofPorts();
uint64_t Mask = UIPortMask;
int i;
if (!HaveCalls)
@ -532,7 +556,7 @@ VOID SendMailFor(char * Msg, BOOL HaveCalls)
Sleep(1000);
for (i=1; i <= NumPorts; i++)
for (i=1; i <= MaxBPQPortNo; i++)
{
if (Mask & 1)
{

View File

@ -2914,12 +2914,14 @@ UZ7HO T GM8BPQ-2 APRS 1:Fm GM8BPQ-2 To APRS Via WIDE2-2 <UI F pid=F0 Len=28 >[1
AdjMsg = &Monframe; // Adjusted for digis
ptr = strstr(Msg, "Fm ");
if (ptr == 0) return;
ConvToAX25(&ptr[3], Monframe.ORIGIN);
memcpy(MHCall, &ptr[3], 11);
strlop(MHCall, ' ');
ptr = strstr(ptr, "To ");
if (ptr == 0) return;
ConvToAX25(&ptr[3], Monframe.DEST);
@ -2934,6 +2936,8 @@ UZ7HO T GM8BPQ-2 APRS 1:Fm GM8BPQ-2 To APRS Via WIDE2-2 <UI F pid=F0 Len=28 >[1
memcpy(Save, &ptr[4], 60);
ptr = strtok_s(Save, ", ", &context);
if (ptr == 0) return;
DigiLoop:
temp = (char *)AdjMsg;
@ -2952,6 +2956,7 @@ DigiLoop:
AdjMsg->ORIGIN[6] |= 0x80; // Set end of address
ptr = strtok_s(NULL, ", ", &context);
if (ptr == 0) return;
if (ptr[0] != '<')
goto DigiLoop;
@ -3012,18 +3017,21 @@ DigiLoop:
if (memcmp(&ptr[1], "RR", 2) == 0)
{
nrptr = strchr(&ptr[3], '>');
if (nrptr == 0) return;
AdjMsg->CTL = 0x1 | (nrptr[-2] << 5);
}
else
if (memcmp(&ptr[1], "RNR", 3) == 0)
{
nrptr = strchr(&ptr[4], '>');
if (nrptr == 0) return;
AdjMsg->CTL = 0x5 | (nrptr[-2] << 5);
}
else
if (memcmp(&ptr[1], "REJ", 3) == 0)
{
nrptr = strchr(&ptr[4], '>');
if (nrptr == 0) return;
AdjMsg->CTL = 0x9 | (nrptr[-2] << 5);
}
else
@ -3058,12 +3066,18 @@ DigiLoop:
if ((AdjMsg->CTL & 1) == 0 || AdjMsg->CTL == 3) // I or UI
{
ptr = strstr(ptr, "pid");
if (ptr == 0) return;
sscanf(&ptr[4], "%x", (unsigned int *)&AdjMsg->PID);
ptr = strstr(ptr, "Len");
if (ptr == 0) return;
ILen = atoi(&ptr[4]);
ptr = strstr(ptr, "]");
if (ptr == 0) return;
ptr += 2; // Skip ] and cr
memcpy(AdjMsg->L2DATA, ptr, ILen);
Monframe.LENGTH += ILen;
@ -3071,6 +3085,8 @@ DigiLoop:
else if (AdjMsg->CTL == 0x97) // FRMR
{
ptr = strstr(ptr, ">");
if (ptr == 0) return;
sscanf(ptr+1, "%hhx %hhx %hhx", &AdjMsg->PID, &AdjMsg->L2DATA[0], &AdjMsg->L2DATA[1]);
Monframe.LENGTH += 3;
}

7
VARA.c
View File

@ -2269,6 +2269,13 @@ VOID VARAProcessResponse(struct TNCINFO * TNC, UCHAR * Buffer, int MsgLen)
return;
}
if (_memicmp(Buffer, "ENCRYPTION ", 11) == 0)
{
strcat(Buffer, "\r");
WritetoTrace(TNC, Buffer, (int)strlen(Buffer));
return;
}
if (_memicmp(Buffer, "MISSING SOUNDCARD", 17) == 0)
{
strcat(Buffer, "\r");

View File

@ -10,14 +10,14 @@
#endif
#define KVers 6,0,23,77
#define KVerstring "6.0.23.77\0"
#define KVers 6,0,23,81
#define KVerstring "6.0.23.81\0"
#ifdef CKernel
#define Vers KVers
#define Verstring KVerstring
#define Datestring "May 2023"
#define Datestring "July 2023"
#define VerComments "G8BPQ Packet Switch (C Version)" KVerstring
#define VerCopyright "Copyright © 2001-2023 John Wiseman G8BPQ\0"
#define VerDesc "BPQ32 Switch\0"

View File

@ -34,6 +34,8 @@
#include "asmstrucs.h"
#define MaxBPQPortNo 63 // Port 64 reserved for BBS Mon
#define MAXBPQPORTS 63
#define NEWROUTING

View File

@ -2220,8 +2220,17 @@ L2Packet:
memcpy(BBuffer, Message, Message->LENGTH);
BBuffer->PORT = toPort;
BPORT = GetPortTableEntryFromPortNum(toPort);
if (BPORT)
{
if (BPORT->SmartIDInterval && BPORT->SmartIDNeeded == 0)
{
// Using Smart ID, but none scheduled
BPORT->SmartIDNeeded = time(NULL) + BPORT->SmartIDInterval;
}
PUT_ON_PORT_Q(BPORT, BBuffer);
}
else
ReleaseBuffer(BBuffer);
}

BIN
debug/BuildLog.htm Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.DebugCRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>

BIN
debug/MCP2221.obj Normal file

Binary file not shown.

BIN
debug/bpq32.pdb Normal file

Binary file not shown.

BIN
debug/hid.obj Normal file

Binary file not shown.

1
debug/mt.dep Normal file
View File

@ -0,0 +1 @@
Manifest resource last updated at 15:17:36.17 on 21/07/2023

BIN
debug/vc80.idb Normal file

Binary file not shown.

BIN
debug/vc80.pdb Normal file

Binary file not shown.

6
kiss.c
View File

@ -492,7 +492,7 @@ HANDLE OpenConnection(struct PORTCONTROL * PortVector)
ASYSEND(PortVector, ENCBUFF, 5);
}
if (KISS->KISSCMD && KISS->KISSCMDLEN)
if (KISS && KISS->KISSCMD && KISS->KISSCMDLEN)
ASYSEND(PortVector, KISS->KISSCMD, KISS->KISSCMDLEN);
@ -1890,9 +1890,7 @@ VOID ConnecttoTCPThread(NPASYINFO ASY)
ioctlsocket (sock, FIONBIO, &param);
// If configured send TNC command
if (KISS->KISSCMD && KISS->KISSCMDLEN)
if (KISS && KISS->KISSCMD && KISS->KISSCMDLEN)
send(sock, KISS->KISSCMD, KISS->KISSCMDLEN, 0);
continue;

View File

@ -629,6 +629,7 @@ typedef struct TNCINFO
int ReopenTimer; // Used to reopen device if failed (eg USB port removed)
BOOL HostMode; // Set if in DED Host Mode
// BOOL CRCMode; // Set if using SCS Extended DED Mode (JHOST4)
BOOL UsingTermMode; // Set if tnc should be left in term mode
int Timeout; // Timeout response counter
int Retries;
int Window; // Window Size for ARQ
@ -676,6 +677,7 @@ typedef struct TNCINFO
BOOL Robust; // Set if SCS Tracker is in Robust Packet mode or WINMOR TNC is in Robust Mode
BOOL RobustDefault; // Set if SCS Tracker default is Robust Packet mode
BOOL ForceRobust; // Don't allow Normal Packet even if scan requests it.
BOOL TeensyRPR; // Teensy RPR TNC - don't send %R
char NormSpeed[8]; // Speed Param for Normal Packet on Tracker
char RobustSpeed[8]; // Speed Param for Robust Packet on Tracker
BOOL RPBEACON; // Send Beacon after each session