go4retro / tcpser

Hayes modem emulator application
104 stars 27 forks source link

AT parser error? #30

Open mrdudz opened 1 year ago

mrdudz commented 1 year ago

Just now that i had someone reproduce some things with a real modem... i noticed i have been using an invalid "modem init" with tcpser all the time:

tcpser -r -p 6400 -S 300 -v 25232 -l 4 -tmM -i"s5=20 s0=1"

That init string does not work, a real modem would just produce an error on ats5=20 s0=1 s39=1 - if i recall correctly the register assignments (or any other commands) must be concatenated using &, not separated by spaces. I'd expect tcpser to require this as well - ie the above string should produce an error, somehow, instead of silently work.

mrdudz commented 11 months ago

@go4retro Are you on vacation? :) Can you at least confirm this is a bug? Or are Modems allowed to use spaces in the string too? Would be good to have this behave as close to the real deal as possible...

geneb commented 11 months ago

A real modem won't produce an error with a space between the parameters. "&" is NOT a concatenation operator, it's a character used to specify extended commands - for example, AT&C0 (or AT &C0) in many US Robotics modems would set the carrier to high, regardless of whether or not the modem was connected. (AT&C1 would allow the carrier detect to follow what the modem state was).

go4retro commented 11 months ago

My apologies. I had hoped to test out my Hayes SmartModem to verify, but have not had a chance.

But, I will say that the at strings are handled very permissively, as I do not support all the various % and & type parameters. In fact, I silently parse and ignore many of them, to cut down on the amount of tweaking folks have to do in existing apps.

go4retro commented 11 months ago

A real modem won't produce an error with a space between the parameters. "&" is NOT a concatenation operator, it's a character used to specify extended commands - for example, AT&C0 (or AT &C0) in many US Robotics modems would set the carrier to high, regardless of whether or not the modem was connected. (AT&C1 would allow the carrier detect to follow what the modem state was).

I wondered about that. Sadly, my test Hayes modem went belly up when I tried it, so I need to get the other one from the stash.

mrdudz commented 11 months ago

A real modem won't produce an error with a space between the parameters.

That was exactly the reason for why i reported this - i used the commandline as in the above post for testing with tcpser, and then told someone to use "ats5=20 s0=1 s39=1" with his modem, and that did NOT work. And that is what i think should be avoided, ie tcpser should strictly behave as a real modem :)