Telnet send_string Formatting
I'm trying to use one master to telnet into a bunch of other masters and send what in a telnet terminal would be:
send_string dvSwitcher,"'#y 0,120,15',$0D"
Sending that ^ from within telnet on my PC does exactly what I expect it to do. This would include hitting enter on my keyboard for an extra $0D,$0A
Using one master to communicate via telnet to other masters is not a problem at all, the issue I'm having is properly formatting the above telnet string in the .axs file on the master master.
Sneak the $0D past the telnet connection - solved by putting it inside the ASCII string
Escape or modify ' " , so they don't break the string in Studio - solved by using $22(") $27(') $2C(,)
Is there some sort of escape within AMX that I'm unaware of? If there was it would make this a lot more readable.
Variations of what I've tried:
send_string dvTelnet,"'send_string dvSwitcher,',$22,$27,'#y 0,120,15',$27,',',$0D,$22,$0D,$0A";
^ That's no good because I think(?) the hex needs to be directly in the ASCII, so that's what I did with the next attempt:
send_string dvTelnet,"'send_string dvSwitcher$2C$22$27#y 0,120,15$27$2C$0D',$0D,$0A";
This is making it to the device but it's coming in as:
Line 1 2020-08-27 (08:40:31):: String To [5001:2:183]-["'x',$0F,'',',$0D"]
Line 2 2020-08-27 (08:40:31):: String From [5001:2:183]-["'x',$0F,'',',$0D"]
x is decimal 120, and $0F is decimal 15, so it looks like it might be getting broken in Telnet.
Thanks in advance for any help on this. Plan B is to just loop through the IP list with Python and send the telnet commands through there, but It'll drive me nuts not figuring this out.