Capability Integration

This section introduces how to integrate FIRERPA Remote Desktop and its related capabilities, which can be integrated into front-end pages for operation, display, and other functions. Detailed descriptions are not provided here; you can refer to the APIFOX documentation for viewing and testing. However, some prerequisite settings and basic information need to be introduced first.

Hint

The following content requires you to have a basic understanding of WebSocket, Canvas drawing, H.264, etc.

Prerequisite Setup

To facilitate your interface testing, please ensure that the device is connected to the current computer via USB, and make sure that the device has not enabled login certificate verification (HTTPS). After completing these two steps, you also need to complete the relevant settings on the APIFOX platform. Since WS interfaces are involved, you need to install the APIFOX desktop client (not the web version) and import the relevant project into the client. Please explore the installation and import methods on your own.

Real-time Video

Real-time video is transmitted via WebSocket and supports two formats: MJPEG (Motion JPEG) and H.264 NALU. MJPEG is the simplest to use; it essentially transmits continuous screenshots of the device screen, and when the transmission speed is fast enough, it forms a dynamic real-time screen. You only need to draw each frame message received from the WebSocket onto the screen in JPEG format. The other format, H.264, requires more foundational knowledge, as you need to perform decoding before rendering to the canvas. You can search for or integrate an existing H.264 decoder to handle the decoding and drawing.

Compared with MJPEG, H.264 can reduce bandwidth usage by at least half and is faster, but it is not suitable for all devices. Some devices may have poor H.264 encoding performance, in which case MJPEG should be used. Of course, MJPEG also has its disadvantages: since each frame is a complete image, it demands higher bandwidth.

Real-time Touch

Real-time touch is also transmitted via WebSocket, and there is nothing special about it. You just need to send three types of operations – "press", "move", and "release" – in a specific format. You can trigger these through web page events such as mousedown and mouseup, and the main data transmitted are the event type and coordinates. The only thing to note is that you need to perform coordinate conversion based on the canvas and the actual screen size, calculating the actual screen coordinates corresponding to the user's operation coordinates on the canvas.

Key Operations

Key operations are relatively simple; you just need to send a POST request to the relevant interface in a specific format. Key operations support controlling the device's navigation keys and performing standard English text input.

Command Terminal

The command terminal communicates via WebSocket, and you need to use technologies such as xterm.js for integration. You just need to format the input and output into a specific format according to the API documentation and send them, or request xterm output.

Real-time Commands

The real-time command interface is used to send automation or control commands to the device. For the specific request format and WebSocket/HTTP paths, please refer to the APIFOX project documentation. When integrating, it is recommended to use it together with "Real-time Video" and "Real-time Touch" to ensure the temporal consistency of the screen and operations.