Cynical network parsing output from CYP amp

Posted on
Tue Jul 31, 2018 4:39 pm
colinpartridge offline
Posts: 329
Joined: Jan 13, 2014
Location: London, UK

Cynical network parsing output from CYP amp

I have a CYP amp au-300 which can have some parameters changed by commands sent by telnet. Sending commands via Cynical network is straight forward. for example to check the volume I send the following text..
Code: Select all
VOL S
with line ending set to CRNL.
My issue is trying to parse the response.
which comes back as the following, with debug on..
Code: Select all
CYP Volume status
   Cynical Network                 scanning 'telnet-> \x00\n VOLUME IS -40.5dB\r\n\r\n\r\ntelnet-> '
   Cynical Network                  trying <RE('(.*?)\\r?\\n')0> _UNRECOGNIZED
   Cynical Network                  matched 'telnet-> \x00\n' | ' VOLUME IS -40.5dB\r\n\r\n\r\ntelnet-> '
   Cynical Network                 Kitchen CYP out unrecognized input 'telnet-> \x00'
   Cynical Network                 scanning ' VOLUME IS -40.5dB\r\n\r\n\r\ntelnet-> '
   Cynical Network                  trying <RE('(.*?)\\r?\\n')0> _UNRECOGNIZED
   Cynical Network                  matched ' VOLUME IS -40.5dB\r\n' | '\r\n\r\ntelnet-> '
   Cynical Network                 Kitchen CYP out unrecognized input ' VOLUME IS -40.5dB'
   Cynical Network                 scanning '\r\n\r\ntelnet-> '
   Cynical Network                  trying <RE('(.*?)\\r?\\n')0> _UNRECOGNIZED
   Cynical Network                  matched '\r\n' | '\r\ntelnet-> '
   Cynical Network                 Kitchen CYP out unrecognized input ''
   Cynical Network                 scanning '\r\ntelnet-> '
   Cynical Network                  trying <RE('(.*?)\\r?\\n')0> _UNRECOGNIZED
   Cynical Network                  matched '\r\n' | 'telnet-> '
   Cynical Network                 Kitchen CYP out unrecognized input ''
   Cynical Network                 scanning 'telnet-> '
   Cynical Network                  trying <RE('(.*?)\\r?\\n')0> _UNRECOGNIZED
   Cynical Network                  no match


the bit I'm interested in is the VOLUME IS -40.5dB. the problem is that it isn't the last line read ( as I understand it) and doesn't get placed in to variable. How do I get around the plethora of \r\n in the response?

Confused Colin

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest