Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Script Command
This thread has 2 replies. Displaying all posts.
Post 1 made on Tuesday October 7, 2008 at 14:30
xrmichael
Long Time Member
Joined:
Posts:
June 2007
73
Could someone tell me if the following command is correct, can you use a socket.match command or is this command only usable with the serial port ?

label = socket.match("get //counting/254/56/13 level \r","\r",1250);

I want to request a level of a device and display in one. Or do i need a separate

socket.write and then a socket.read ?

Also could some point me in the direction or tips on stripping of relevant data from the response, the command above should i think read the response up to the carriage return. But if i wanted to extract data between the word level= and the carriage return is this possible.

Sorry if it doesn't make sense i am rather new to this script stuff.

The response to the "Get level" command above will be something like "//house/254/56/13: level=153"

Michael
Post 2 made on Tuesday October 7, 2008 at 15:53
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
A lot depends on the device you are dealing with. In general if the device only sends out data in response to a command/query, then you must first do the write and then do a read to get the response data

If the device is periodically sending out data through its serial port in an unsolicited manner, then you do not need a write, but must do reads. That, unsolicited serial input, also brings up whole issues that are two complex to address here so avoid it if you can.
Post 3 made on Tuesday October 7, 2008 at 16:09
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
Sockets don't do matches, only serial ports do matches. Please review Appendix A of the dev guide closely!

For parsing responses, read up on Regular Expressions and capture groups.

If you are Level 1 certified, download one of the denon RS232 scripts from philips. They use Regular Expressions and should help to get you started.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse