#include "maru_common.h"
#include "emul_state.h"
+#include "skin/maruskin_server.h"
#include "debug_ch.h"
#if defined(CONFIG_LINUX)
{
if (state == BOOT_COMPLETED) {
INFO("boot completed!\n");
+ // TODO:
+ } else if (state == RESET) {
+ INFO("reset emulator!\n");
+
+ notify_emul_reset();
}
_emul_state.emulator_condition = state;
enum {
BOOTING = 0,
BOOT_COMPLETED = 1,
+ RESET = 2,
};
/* keep it consistent with emulator-skin definition */
RECV_ECS_STARTED((short) 802),
RECV_DRAW_FRAME((short) 900),
RECV_DRAW_BLANK_GUIDE((short) 901),
- RECV_SHUTDOWN((short) 999);
+ RECV_EMUL_RESET((short) 998),
+ RECV_EMUL_SHUTDOWN((short) 999);
private short value;
break;
}
- case RECV_SHUTDOWN: {
- logger.info("received SHUTDOWN from QEMU");
+ case RECV_EMUL_RESET: {
+ logger.info("received EMUL_RESET from QEMU");
+
+ // TODO:
+
+ break;
+ }
+ case RECV_EMUL_SHUTDOWN: {
+ logger.info("received EMUL_SHUTDOWN from QEMU");
sendToQEMU(SendCommand.RESPONSE_SHUTDOWN, null, false);
terminate();
SEND_ECS_STARTED = 802,
SEND_DRAW_FRAME = 900,
SEND_DRAW_BLANK_GUIDE = 901,
- SEND_SHUTDOWN = 999,
+ SEND_EMUL_RESET = 998,
+ SEND_EMUL_SHUTDOWN = 999,
};
static int seq_req_id = 0;
if (client_sock) {
INFO("send shutdown to skin.\n");
- if (0 > send_skin_header_only(client_sock, SEND_SHUTDOWN, 1)) {
+ if (0 > send_skin_header_only(client_sock, SEND_EMUL_SHUTDOWN, 1)) {
ERR("fail to send SEND_SHUTDOWN to skin.\n");
close_server_socket = 1;
} else {
}
}
+void notify_emul_reset(void)
+{
+ INFO("notify_emul_reset\n");
+
+ if (client_sock) {
+ if (0 > send_skin_header_only(
+ client_sock, SEND_EMUL_RESET, 1)) {
+
+ ERR("fail to send SEND_EMUL_RESET to skin\n");
+ }
+ } else {
+ INFO("skin client socket is not connected yet\n");
+ }
+}
+
int is_ready_skin_server(void)
{
return ready_server;
void notify_booting_progress(unsigned int layer, int progress_value);
void notify_brightness_state(bool on);
void notify_host_kbd_state(bool on);
+void notify_emul_reset(void);
int is_ready_skin_server(void);
int get_skin_server_port(void);