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

Login:
Pass:
 
 

Original thread:
Post 34 made on Tuesday January 10, 2012 at 15:08
Stealth
Long Time Member
Joined:
Posts:
December 2003
72
On January 8, 2012 at 19:50, Guy Palmer said...
I am finding it difficult to say anything useful because I simply don't understand your code.

Hello Guy,

Thank you for your reply. I’m still trying to pickup Javascript and Prontoscript so thanks for bearing with me on this.

I understand from your response that I’m using incorrect syntax i.e :-

CF.widget("KeyA", "Unshifted").scheduleActions(TCPCommand ("chars:Not Shifted !"));

And it should look more like:-

CF.widget("KeyA", "Unshifted").scheduleActions();

With the actions added to the button I’m using (KeyA) which is placed on another page (Unshifted).

TCPCommand is a function created to send text to a socket. I tried to put the above “function command” example directly on “KeyA” (on the page named “Unshifted”) but it would not work. Hence how I came about using the incorrect code I used, as it did appear to send the command ok. Having given this some more thought I was wondering if its not working due to the code for the TCPCommand function is on another page i.e. “Activity Properties”?

Here is the code used on "Activity Properties:-


var keyboardState = 0;

// Define variables
var Target_PC = CF.widget("Remote_PC_IP_Address", "PARAMETERS").label
var Target_Port = CF.widget("Remote_PC_PORT", "PARAMETERS").label
var return_data = "";
var Remote_PC_Socket = new TCPSocket(false);

// Write log if failure
Remote_PC_Socket.onIOError = function(e)
{
Diagnostics.log("Remote_PC_Socket failure: " + e);
};

// Capture return data
Remote_PC_Socket.onData = function()
{
return_data += read();
};

// Initialize Socket
function Initialize()
{
Remote_PC_Socket.onConnect = function()
{

};

// Connect to socket
Remote_PC_Socket.connect(Target_PC,Target_Port,3000);
}

function TCPCommand(command)
{
Remote_PC_Socket.write(command + "\r\n");
}

I’m currently lost and think I need to go back to the beginning and have a re-think!

My goal is to have an onscreen keyboard (talking to Media Center PC) on an overlay which can send both TCP/IP commands if a socket is connected else fall back to Media Center IR commands. Hence I need two commands on each keyboard button.


Hosting Services by ipHouse