Xfer in C

discuss pc<>acorn file transfer issues and the use of other utils
Post Reply
Issue7
Posts: 83
Joined: Sun Jan 03, 2016 12:52 pm
Contact:

Xfer in C

Post by Issue7 »

Hi all,
I have been trying to use Xfer in C on a PC running Windows 10. When I start Xfer it immediately announces there is a problem opening the COM port and quits. I have tried two USB two serial port adapters which installed themselves on COM12 and COM13 with the same result.

However, when I try the Bluetooth COM9 port, XFER works and tries to talk to it, timing out after a short delay as there's nothing connected to the Bluetooth. So I have a theory that it will not recognise a COM port above 9. Unfortunately this computer is locked down, so I can't change the USB to a different numbered port.

Can anyone confirm this theory please?

Thanks
Tom
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

Did you have any luck with this.

If you have:
/-----BBC-----PC-----

Invalid data received. Please try again.

The fix is:

It appears that at the start there is always some junk in the buffer of the laptop that is going to get sent as part of the first line......so I made the following changes to XFER for the PC to send a string to the BBC which the BBC will ignore:

In xfer.bas one line has been added (shown in bold)

3550DEF PROCinitconnection
3560PROCstatus("Waiting for connection","",0)
...Baud settings...
3610text$=FNread_string
3620text$=FNread_string


On the PC side in main.c:

the following change in main() to the line below
/* Send synchronisation text, protocol and baud rate */
serial_printf(com, "IGNORE\r%s\r%d\r%d\r", TEXT_SYNC, XFER_PROTOCOL_VERSION,
baudtoi(config.baudrate)) ;


the line with IGNORE on it will have the junk character prepended and the line will get thrown away by the BBC and the connection will now be ready.

Or the issue maybe that XFER needs to work on a Widows 9X machine???
Issue7
Posts: 83
Joined: Sun Jan 03, 2016 12:52 pm
Contact:

Re: Xfer in C

Post by Issue7 »

I put it on the back burner for a long simmer! Thanks for having a look at it. My gut feeling was that the code was either written or compiled such that it could not recognise a two-digit COM number. My problem is that I have not had a C compiler for a while so I can't modify and re-compile the program. Would you be able to re-compile and send it on please? I can certainly give it a go.
chrisn
Posts: 980
Joined: Sat Apr 19, 2014 12:31 pm
Location: UK
Contact:

Re: Xfer in C

Post by chrisn »

Does it work if you set the COM port as \\.\COM12 or \\.\COM13? The Windows CreateFile function needs the \\.\ prefix to use COM ports above 9.
Atom / BBC B with Music 5000/4000/2000 / Electron / A3000 / Master 128
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

yes will have a look today - was just trying to find which computer I originally used to edit the code.
Issue7 wrote: Sun Feb 04, 2024 8:04 pm I put it on the back burner for a long simmer! Thanks for having a look at it. My gut feeling was that the code was either written or compiled such that it could not recognise a two-digit COM number. My problem is that I have not had a C compiler for a while so I can't modify and re-compile the program. Would you be able to re-compile and send it on please? I can certainly give it a go.
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

Hi, Issue 7,

I am getting the Windows anti-virus keeps removing it from my Win 10 machine.

How did you get round this?

Mark
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

Ok, I got this far, but I have nothing connected to the COM Port.
myxfer on Win 10
myxfer on Win 10
But my COM Port is COM1:
my COM port
my COM port
my_com_port.png (5.43 KiB) Viewed 1024 times
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

ok, here is myxfer.exe with the comport hardcoded to COM12
Attachments
myxfer.zip
myxfer (PC side)
(65.09 KiB) Downloaded 4 times
Issue7
Posts: 83
Joined: Sun Jan 03, 2016 12:52 pm
Contact:

Re: Xfer in C

Post by Issue7 »

Oh that's good!
If you can give me a few days, ill have a go with it.
Tom
User avatar
b_b_c_m_i_c_r_o_2
Posts: 336
Joined: Sun Jun 25, 2006 11:15 pm
Contact:

Re: Xfer in C

Post by b_b_c_m_i_c_r_o_2 »

sure, it may say COM1 in the text but is hard coded to COM12.

Also you may need to set WIndows 98 compatibility mode at some point.
Issue7 wrote: Mon Feb 19, 2024 6:34 pm Oh that's good!
If you can give me a few days, ill have a go with it.
Tom
Post Reply

Return to “software & utilities for the pc, mac or unix”