(2016-11-03, 11:03)Wimpie Wrote: I'm interested...
1st open a new VB6 project and add a form. then add a Winsock component to the form.
then add 2 textboxes txtSend and txtOutput
Code:
Private Sub Form_Load()
' The name of the Winsock control is tcpClient.
' Note: to specify a remote host, you can use
' either the IP address (ex: "121.111.1.1") or
' the computer's "friendly" name
tcpClient.RemoteHost = "192.168.xxx.xxx"
tcpClient.RemotePort = 9090
tcpClient.Connect
End Sub
Private Sub Form_Unload(Cancel As Integer)
tcpClient.Close
tcpClient.LocalPort = 0
tcpClient.RemotePort = 0
End Sub
Private Sub tcpClient_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
tcpClient.GetData strData
txtOutput.Text = strData
End Sub
Private Sub txtSend_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
tcpClient.SendData txtSend.Text
KeyAscii = 0
End If
End Sub
Now enter the jsonrpc commands into the send textbox and press enter
ie
(xxx.xxx = ip number)
http://192.168.xxx.xxx/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"JSONRPC.Ping"}
you should get a responce back. like {"id":1,"jsonrpc":"2.0","result":"pong"}
if you issue this
http://192.168.xxx.xxx/jsonrpc?request={"jsonrpc":"2.0","method":"VideoLibrary.Scan"}
the txtOutput show show.
{"jsonrpc":"2.0","method":"VideoLibrary.OnScanStarted","params":{"data":null,"sender":"xbmc"}}
when the scan finishes then it will display
{"jsonrpc":"2.0","method":"VideoLibrary.OnScanFinished","params":{"data":null,"sender":"xbmc"}}
i hope this helps you out