Callback Recent
1. Callback Description
Callbacks are messages the kernel actively broadcasts to all connected WebSocket clients. For example, when a device connects, disconnects, or settings change, the kernel pushes notifications.
Callback Format
json
{
"fun": "function_number",
"status": 200,
"message": "",
"msgid": 0,
"data": {}
}Callback Events
| # | Function | Event |
|---|---|---|
| 1 | im_connect | Kernel connection successful |
| 2 | dev_connect | Device connected |
| 3 | dev_disconnect | Device disconnected |
| 4 | dev_rotate | Device rotation |
| 5 | dev_change | Device properties changed |
| 6 | dev_delete | Device deleted |
| 7 | group_change | Group modified |
| 8 | group_delete | Group deleted |
| 9 | usb_change | USB hardware changed |
| 10 | collection_mouse | Mouse parameter collection status |
| 11 | airplay_connect_log | Auto screen casting log |
| 12 | restart_log | Restart phone log |
| 13 | user_info | User info (pushed every 30s) |
| 14 | im_log | Kernel information log |
| 15 | error_push | Kernel error log |
| 16 | im_config_change | Kernel config changed |
| 17 | logout | Account logged out |
| 18 | dev_sort_change | Device list sorting changed |
Key Callback Details
usb_change - USB Hardware Changes
The code field indicates hardware status:
19- Hardware connected to computer20- Hardware disconnected from computer12- Hardware connected to phone
collection_mouse - Mouse Parameter Status
The code field indicates:
0- Success4- Collection failed5- A device is collecting14- Start working21- Working
error_push - Error Log
Contains call_fun indicating which function was called when the error occurred.
user_info - Auto-pushed User Info
User information is pushed automatically every 30 seconds when logged in. Contains all fields from the login/user info response.