tcpser icon indicating copy to clipboard operation
tcpser copied to clipboard

AT parser error?

Open mrdudz opened this issue 1 year ago • 5 comments

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 avatar Jul 07 '23 21:07 mrdudz

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

mrdudz avatar Aug 13 '23 13:08 mrdudz

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

geneb avatar Aug 13 '23 17:08 geneb

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 avatar Aug 14 '23 02:08 go4retro

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.

go4retro avatar Aug 14 '23 02:08 go4retro

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

mrdudz avatar Aug 14 '23 10:08 mrdudz