return this.id;
}
- public static RotationInfo getValue( short id ) {
+ public static RotationInfo getValue(short id) {
RotationInfo[] values = RotationInfo.values();
for (int i = 0; i < values.length; i++) {
- if( values[i].id == id ) {
+ if (values[i].id == id) {
return values[i];
}
}
- throw new IllegalArgumentException( Integer.toString(id) );
- }
+ throw new IllegalArgumentException(Integer.toString(id));
+ }
}
public enum SendCommand {
ECP_PORT((short) 7),
SENSOR_DAEMON_START((short) 800),
SDB_DAEMON_START((short) 801),
+ ECS_SERVER_START((short) 802),
DRAW_FRAME((short) 900),
DRAW_BLANK_GUIDE((short) 901),
SHUTDOWN((short) 999);
*/
public class SocketCommunicator implements ICommunicator {
public class DataTranfer {
-
private boolean isTransferState;
private byte[] receivedData;
private boolean isTerminated;
private boolean isSensorDaemonStarted;
private boolean isSdbDaemonStarted;
+ private boolean isEcsServerStarted;
private boolean isRamdump;
private TimerTask heartbeatExecutor;
private Timer heartbeatTimer;
@Override
public void run() {
-
sendQueue = new LinkedList<SkinSendData>();
sendThread = new Thread("sendThread") {
-
List<SkinSendData> list = new ArrayList<SkinSendData>();
@Override
public void run() {
-
- while ( true ) {
-
- synchronized ( sendQueue ) {
-
- if ( sendQueue.isEmpty() ) {
+ while (true) {
+ synchronized (sendQueue) {
+ if (sendQueue.isEmpty()) {
try {
sendQueue.wait();
- } catch ( InterruptedException e ) {
- logger.log( Level.SEVERE, e.getMessage(), e );
+ } catch (InterruptedException e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
}
}
SkinSendData sendData = null;
- while ( true ) {
+ while (true) {
sendData = sendQueue.poll();
- if ( null != sendData ) {
- list.add( sendData );
+ if (null != sendData) {
+ list.add(sendData);
} else {
break;
}
}
-
}
if (isTerminated) {
break;
}
- for ( SkinSendData data : list ) {
- sendToQEMUInternal( data );
+ for (SkinSendData data : list) {
+ sendToQEMUInternal(data);
}
list.clear();
}
-
}
};
}
break;
}
+ case ECS_SERVER_START: {
+ logger.info("received ECS_SERVER_START from QEMU.");
+
+ synchronized (this) {
+ isEcsServerStarted = true;
+ }
+ break;
+ }
case DRAW_FRAME: {
//logger.info("received DRAW_FRAME from QEMU.");
SEND_ECP_PORT = 7,
SEND_SENSOR_DAEMON_START = 800,
SEND_SDB_DAEMON_START = 801,
+ SEND_ECS_SERVER_START = 802,
SEND_DRAW_FRAME = 900,
SEND_DRAW_BLANK_GUIDE = 901,
SEND_SHUTDOWN = 999,
static int stop_server = 0;
static int is_sensord_initialized = 0;
static int is_sdbd_initialized = 0;
+static int is_ecs_initialized = 0;
static int ready_server = 0;
static int ignore_heartbeat = 0;
static int is_force_close_client = 0;
}
}
+void notify_ecs_server_start(void)
+{
+ INFO("notify_ecs_server_start\n");
+
+ is_ecs_initialized = 1;
+ if (client_sock) {
+ if (0 > send_skin_header_only(
+ client_sock, SEND_ECS_SERVER_START, 1)) {
+
+ ERR("fail to send SEND_ECS_SERVER_START to skin.\n");
+ }
+ } else {
+ INFO("skin client socket is not connected yet\n");
+ }
+}
+
void notify_sdb_daemon_start(void)
{
INFO("notify_sdb_daemon_start\n");
ERR("fail to send SEND_SDB_DAEMON_START to skin.\n");
}
+ } else {
+ INFO("skin client socket is not connected yet\n");
}
}
ERR("fail to send SEND_SENSOR_DAEMON_START to skin.\n");
}
+ } else {
+ INFO("skin client socket is not connected yet\n");
}
}
void notify_draw_blank_guide(void);
void notify_sensor_daemon_start(void);
void notify_sdb_daemon_start(void);
+void notify_ecs_server_start(void);
void notify_ramdump_completed(void);
void notify_booting_progress(int progress_value);
void notify_brightness(bool on);