scrcpy
scrcpy copied to clipboard
Client for Server 2.4
I´m using a Python module https://github.com/leng-yue/py-scrcpy-client as reference to develop a Python client just to control (touch). .With Server 1.20 work fine. I tried with version 2.4 and don´t work. I think that protocol change. In my code i used the package:
b = b'\x02'
b += b'\x00' #down
b += b'\xff\xff\xff\xff\xff\xff\xff\xff'
b += struct.pack('>I', int(300)) # x
b += struct.pack('>I', int(600)) # y
b += struct.pack('>h', int(1920))
b += struct.pack('>h', int(1200))
b += b'\xff\xff' # Pressure
b += b'\x00\x00\x00\x01' # Event button primary
The server initilization that is working is:
adb push scrcpy-server /data/local/tmp/scrcpy-server.jar
adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.20 info 0 8000000 0 -1 true - false true 0 false false - - false
Thank´s for help
The current protocol is documented here: https://github.com/Genymobile/scrcpy/blob/master/doc/develop.md#protocol
I will try, but some example ou could be helpfull
I´m using a Python module https://github.com/leng-yue/py-scrcpy-client as reference to develop a Python client just to control (touch). .With Server 1.20 work fine. I tried with version 2.4 and don´t work. I think that protocol change. In my code i used the package:
b = b'\x02' b += b'\x00' #down b += b'\xff\xff\xff\xff\xff\xff\xff\xff' b += struct.pack('>I', int(300)) # x b += struct.pack('>I', int(600)) # y b += struct.pack('>h', int(1920)) b += struct.pack('>h', int(1200)) b += b'\xff\xff' # Pressure b += b'\x00\x00\x00\x01' # Event button primaryThe server initilization that is working is:
adb push scrcpy-server /data/local/tmp/scrcpy-server.jar adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.20 info 0 8000000 0 -1 true - false true 0 false false - - falseThank´s for help
Try this and see if it can help you. https://github.com/me2sy/MYScrcpy/blob/1.1.1/myscrcpy/controller/control_socket_controller.py See the function > ControlSocketController.packet__touch()