enum libwebsocket_callback_reasons reason, void *user,
void *in, size_t len)
{
- //LOGD(" ");
+ LOGD(" ");
#if 0
char client_name[128];
char client_ip[128];
enum libwebsocket_callback_reasons reason,
void *user, void *in, size_t len)
{
- //LOGD(" %d",reason);
+ LOGD(" %d",reason);
static int last_session_id = 0;
const int bufsize = 512;
int n = 0;
break;
case LWS_CALLBACK_RECEIVE:
- //LOGD("LWS_CALLBACK_RECEIVE");
+ LOGD("LWS_CALLBACK_RECEIVE");
if (in) {
std::string str = (const char *)in;
- //LOGD("Receive MSG :|%s|", str.c_str());
+ LOGD("Receive MSG :|%s|", str.c_str());
ISE_MESSAGE message = CISEMessageSerializer::deserialize(str);
/*
if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_LOGIN]) == 0) {
void *process_ws_server(void *data)
{
- //LOGD(" ");
+ LOGD(" ");
unsigned int oldus = 0;
while (!force_exit && !g_ws_server_exit) {
void log_func(int level, const char *line)
{
- //LOGD(" ");
+ LOGD(" ");
}
WebSocketServer::WebSocketServer()
{
- //LOGD(" ");
+ LOGD(" ");
if (m_current_instance != NULL) {
LOGD("WARNING : m_current_instance is NOT NULL");
}
WebSocketServer::~WebSocketServer()
{
- //LOGD(" ");
+ LOGD(" ");
if (m_current_instance == this) {
m_current_instance = NULL;
}
static void recv_message_pipe_handler(void *data, void *buffer, unsigned int nbyte)
{
- //LOGD(" ");
+ LOGD(" ");
WebSocketServer *agent = WebSocketServer::get_current_instance();
if (agent) {
agent->process_recved_messages();
bool WebSocketServer::exit()
{
- //LOGD(" ");
+ LOGD(" ");
on_exit();
g_ws_server_exit = true;
void WebSocketServer::signal(int sig)
{
- //LOGD(" ");
+ LOGD(" ");
force_exit = 1;
}
void WebSocketServer::on_init()
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_INIT];
void WebSocketServer::on_exit()
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_EXIT];
void WebSocketServer::on_focus_in(int ic)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_FOCUS_IN];
void WebSocketServer::on_focus_out(int ic)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_FOCUS_OUT];
void WebSocketServer::on_show(int ic)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SHOW];
void WebSocketServer::on_hide(int ic)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_HIDE];
void WebSocketServer::on_set_rotation(int degree)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_ROTATION];
void WebSocketServer::on_update_cursor_position(int ic, int cursor_pos)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_UPDATE_CURSOR_POSITION];
void WebSocketServer::on_set_language(unsigned int language)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_LANGUAGE];
void WebSocketServer::on_set_imdata(char *buf, unsigned int len)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_IMDATA];
void WebSocketServer::on_get_imdata(char **buf, unsigned int *len)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_QUERY];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_GET_IMDATA];
void WebSocketServer::on_set_return_key_type(unsigned int type)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_RETURN_KEY_TYPE];
void WebSocketServer::on_get_return_key_type(unsigned int *type)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_QUERY];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_GET_RETURN_KEY_TYPE];
void WebSocketServer::on_set_return_key_disable(unsigned int disabled)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_RETURN_KEY_DISABLE];
void WebSocketServer::on_get_return_key_disable(unsigned int *disabled)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_QUERY];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_GET_RETURN_KEY_DISABLE];
void WebSocketServer::on_set_layout(unsigned int layout)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_SET_LAYOUT];
void WebSocketServer::on_get_layout(unsigned int *layout)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_QUERY];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_GET_LAYOUT];
void WebSocketServer::on_reset_input_context(int ic)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_PLAIN];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_RESET_INPUT_CONTEXT];
void WebSocketServer::on_process_key_event(unsigned int code, unsigned int mask, unsigned int layout, unsigned int *ret)
{
- //LOGD(" ");
+ LOGD(" ");
ISE_MESSAGE message;
message.type = ISE_MESSAGE_TYPE_STRINGS[ISE_MESSAGE_TYPE_QUERY];
message.command = ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_PROCESS_KEY_EVENT];
WebSocketServer* WebSocketServer::get_current_instance()
{
- //LOGD(" ");
+ LOGD(" ");
return m_current_instance;
}
std::queue<ISE_MESSAGE>& WebSocketServer::get_send_message_queue()
{
- //LOGD(" ");
+ LOGD(" ");
return m_send_message_queue;
}
std::queue<ISE_MESSAGE>& WebSocketServer::get_recv_message_queue()
{
- //LOGD(" ");
+ LOGD(" ");
return m_recv_message_queue;
}
Ecore_Pipe* WebSocketServer::get_recv_message_pipe()
{
- //LOGD(" ");
+ LOGD(" ");
return m_recv_message_pipe;
}
void WebSocketServer::wait_for_reply_message()
{
- //LOGD(" ");
+ LOGD(" ");
/* Let's wait for at most REPLY_TIMEOUT */
struct timeval now;
struct timespec timeout;
void WebSocketServer::process_recved_messages()
{
- //LOGD(" ");
+ LOGD(" ");
pthread_mutex_lock(&g_ws_server_mutex);
while (m_recv_message_queue.size() > 0) {
bool WebSocketServer::process_recved_messages_until_reply_found(std::string command, std::vector<std::string> &values)
{
- //LOGD(" ");
+ LOGD(" ");
bool ret = false;
void WebSocketServer::handle_recved_message(ISE_MESSAGE &message)
{
- //LOGD(" ");
- //LOGD("Received message : %s, %s, %s", message.type.c_str(), message.command.c_str() , message.values.at(0).c_str());
+ LOGD(" ");
+ LOGD("Received message : %s, %s, %s", message.type.c_str(), message.command.c_str() , message.values.at(0).c_str());
/*FIXME delte login
if (message.command.compare(ISE_MESSAGE_COMMAND_STRINGS[ISE_MESSAGE_COMMAND_LOGIN]) == 0) {
libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_KEYBOARD]);