/** * 发送window_manager_exit请求 **/ int fake_window_manager_exit(struct egui_uds* uds_ptr) { si_t ret = 0; if(0 != comm_send_request(uds_ptr, REQUEST_TYPE_WINDOW_MANAGER_QUIT, NULL, 0)) { EGUI_PRINT_ERROR("failed to send window manager exit request"); return -1; } if(0 != comm_recv_respond(uds_ptr, RESPOND_TYPE_WINDOW_MANAGER_QUIT, &ret, NULL)) { EGUI_PRINT_ERROR("failed to recv window manager exit respond"); return -1; } EGUI_PRINT_INFO("send window manager exit request, recv ret %d", (int)ret); return ret; }
static si_t send_request_and_malloc_for_respond(si_t request_type, si_t respond_type, const_addr_t body, ui_t body_size, addr_t* result) { if(0 != comm_send_request(lib_uds, request_type, body, body_size)) { EGUI_PRINT_ERROR("failed to send request[%s]", request_type_to_str(request_type)); return -1; } if(0 != comm_recv_respond_in_new_buffer(lib_uds, respond_type, result, message_queue)) { EGUI_PRINT_ERROR("failed to receive respond[%s]", respond_type_to_str(respond_type)); return -1; } return 0; }
/** * 发送draw line请求 **/ int fake_draw_line(struct egui_uds* uds_ptr, si_t x1, si_t y1, si_t x2, si_t y2) { struct packet_body_draw_line body; si_t ret = 0; request_set_draw_line(&body, 0, x1, y1, x2, y2); if(0 != comm_send_request(uds_ptr, REQUEST_TYPE_DRAW_LINE, &body, sizeof(body))) { EGUI_PRINT_ERROR("failed to send draw line request"); return -1; } if(0 != comm_recv_respond(uds_ptr, RESPOND_TYPE_DRAW_LINE, &ret, NULL)) { EGUI_PRINT_ERROR("failed to recv draw line respond"); return -1; } EGUI_PRINT_INFO("send draw line request, recv ret %d", (int)ret); return ret; }