1 #define Uses_SCIM_TRANSACTION
2 #define Uses_ISF_REMOTE_CLIENT
3 #define Uses_STL_STRING
8 #include <vconf-keys.h>
11 #include "isf_remote_control.h"
12 #include "isf_debug.h"
17 #define LOG_TAG "ISF_REMOTE_CONTROL"
19 #define MESSAGE_DELIMETER "\t"
23 static bool focus_flag;
25 struct _remote_control_client {
26 RemoteInputClient *remote_client;
27 GIOChannel *remote_client_iochannel;
28 guint remote_client_iochannel_read;
29 guint remote_client_iochannel_err;
30 guint remote_client_iochannel_hup;
32 remote_control_focus_in_cb focus_in_cb;
33 void* focus_in_cb_user_data;
34 remote_control_focus_out_cb focus_out_cb;
35 void* focus_out_cb_user_data;
36 remote_control_entry_metadata_cb metadata_cb;
37 void* metadata_cb_user_data;
38 remote_control_text_updated_cb text_updated_cb;
39 void* text_updated_cb_user_data;
40 remote_control_input_resource_changed_cb input_resource_changed_cb;
41 void* input_resource_changed_cb_user_data;
42 remote_control_key_event_cb key_event_cb;
43 void* key_event_cb_user_data;
44 remote_control_cursor_position_updated_cb cursor_position_updated_cb;
45 void* cursor_position_updated_cb_user_data;
47 _remote_control_client() : remote_client(NULL),
48 remote_client_iochannel(NULL),
49 remote_client_iochannel_read(0),
50 remote_client_iochannel_err(0),
51 remote_client_iochannel_hup(0),
54 focus_in_cb_user_data(NULL),
56 focus_out_cb_user_data(NULL),
58 metadata_cb_user_data(NULL),
59 text_updated_cb(NULL),
60 text_updated_cb_user_data(NULL),
61 input_resource_changed_cb(NULL),
62 input_resource_changed_cb_user_data(NULL),
64 key_event_cb_user_data(NULL),
65 cursor_position_updated_cb(NULL),
66 cursor_position_updated_cb_user_data(NULL)
72 remote_handler(GIOChannel *source, GIOCondition condition, gpointer user_data)
74 if (condition == G_IO_IN) {
75 remote_control_client *client = static_cast<remote_control_client*>(user_data);
76 if (client->remote_client->has_pending_event()) {
77 switch (client->remote_client->recv_callback_message()) {
78 case REMOTE_CONTROL_CALLBACK_FOCUS_IN:
80 LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_IN");
83 if (client->focus_in_cb)
84 client->focus_in_cb (client->focus_in_cb_user_data);
87 case REMOTE_CONTROL_CALLBACK_FOCUS_OUT:
89 LOGD ("REMOTE_CONTROL_CALLBACK_FOCUS_OUT");
92 if (client->focus_out_cb)
93 client->focus_out_cb (client->focus_out_cb_user_data);
96 case REMOTE_CONTROL_CALLBACK_ENTRY_METADATA:
99 remote_control_entry_metadata_s *data = new remote_control_entry_metadata_s;
100 int hint = 0, layout = 0, variation = 0, autocapital_type = 0, return_key_disabled = 0, return_key_type = 0;
102 client->remote_client->get_entry_metadata (&hint, &layout, &variation, &autocapital_type, &return_key_disabled, &return_key_type);
103 data->hint = static_cast<Ecore_IMF_Input_Hints> (hint);
104 data->layout = static_cast<Ecore_IMF_Input_Panel_Layout> (layout);
105 data->variation = variation;
106 data->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type> (autocapital_type);
107 data->return_key_disabled = return_key_disabled;
108 data->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type> (return_key_type);
110 LOGD ("REMOTE_CONTROL_CALLBACK_ENTRY_METADATA: hint=0x%04x, layout=%d, variation=%d, autocap=%d, retKey_disabled=%d, retKey_type=%d",
111 data->hint, data->layout, data->variation, data->autocapital_type, data->return_key_disabled, data->return_key_type);
113 if (client->metadata_cb)
114 client->metadata_cb (client->metadata_cb_user_data, data);
119 case REMOTE_CONTROL_CALLBACK_TEXT_UPDATED:
122 String surrounding_text;
125 client->remote_client->get_surrounding_text (surrounding_text, &cursor);
126 SECURE_LOGD ("REMOTE_CONTROL_CALLBACK_TEXT_UPDATED: %d \"%s\"", cursor, surrounding_text.c_str ());
128 if (client->text_updated_cb)
129 client->text_updated_cb (client->text_updated_cb_user_data, surrounding_text.c_str (), cursor);
133 case REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE:
138 client->remote_client->get_input_resource (&resource);
139 LOGD ("REMOTE_CONTROL_CALLBACK_INPUT_RESOURCE: %s", (resource ? "REMOTE" : "LOCAL"));
141 if (client->input_resource_changed_cb)
142 client->input_resource_changed_cb (client->input_resource_changed_cb_user_data,
143 static_cast<remote_control_input_resource> (resource));
147 case REMOTE_CONTROL_CALLBACK_KEY_EVENT:
150 remote_control_key_event_s *data = new remote_control_key_event_s;
152 int press = 0, timestamp = 0;
154 client->remote_client->get_key_symbol (key_symbol, &press, ×tamp);
156 if (strcmp (key_symbol.c_str(), "Return") == 0)
157 data->type = REMOTE_CONTROL_KEY_SELECT;
158 else if (strcmp (key_symbol.c_str(), "space") == 0)
159 data->type = REMOTE_CONTROL_KEY_SPACE;
160 else if (strcmp (key_symbol.c_str(), "BackSpace") == 0)
161 data->type = REMOTE_CONTROL_KEY_BACKSPACE;
162 else if (strcmp (key_symbol.c_str(), "XF86Back") == 0)
163 data->type = REMOTE_CONTROL_KEY_CANCEL;
164 else if (strcmp (key_symbol.c_str(), "Up") == 0)
165 data->type = REMOTE_CONTROL_KEY_UP;
166 else if (strcmp (key_symbol.c_str(), "Down") == 0)
167 data->type = REMOTE_CONTROL_KEY_DOWN;
168 else if (strcmp (key_symbol.c_str(), "Left") == 0)
169 data->type = REMOTE_CONTROL_KEY_LEFT;
170 else if (strcmp (key_symbol.c_str(), "Right") == 0)
171 data->type = REMOTE_CONTROL_KEY_RIGHT;
173 data->pressed = press;
174 data->timestamp = timestamp;
175 LOGD ("REMOTE_CONTROL_CALLBACK_KEY_EVENT: type : %d, pressed : %d, timestamp : %d", data->type, data->pressed, data->timestamp);
177 if (client->key_event_cb)
178 client->key_event_cb (client->key_event_cb_user_data, data);
183 case REMOTE_CONTROL_CALLBACK_CURSOR_POSITION_UPDATED:
188 client->remote_client->get_cursor_position (&cursor);
189 SECURE_LOGD ("REMOTE_CONTROL_CALLBACK_CURSOR_POSITION_UPDATED: %d", cursor);
191 if (client->cursor_position_updated_cb)
192 client->cursor_position_updated_cb (client->cursor_position_updated_cb_user_data, cursor);
196 case REMOTE_CONTROL_CALLBACK_ERROR:
197 LOGE ("REMOTE_CONTROL_CALLBACK_ERROR");
203 LOGE ("Failed to receive callback message");
204 return (gboolean)FALSE;
206 } else if (condition == G_IO_ERR || condition == G_IO_HUP) {
207 LOGE ("Failed to receive callback message");
208 return (gboolean)FALSE;
211 return (gboolean)TRUE;
214 EXAPI remote_control_client * remote_control_connect(void)
216 remote_control_client *client = NULL;
219 client = new remote_control_client;
220 } catch(const std::bad_alloc& e) {
221 LOGE("Memory allocation failed");
228 client->remote_client = new RemoteInputClient;
229 } catch(const std::bad_alloc& e) {
230 LOGE("Memory allocation failed");
235 if (!client->remote_client->open_connection()) {
236 LOGE ("REMOTE_CONTROL_REPLY_TIMEOUT");
241 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
243 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
248 client->remote_client_id = client->remote_client->get_panel2remote_connection_number();
250 if (client->remote_client_id >= 0) {
251 client->remote_client_iochannel = g_io_channel_unix_new(client->remote_client_id);
253 if (client->remote_client_iochannel == NULL) {
254 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
258 client->remote_client_iochannel_read = g_io_add_watch (client->remote_client_iochannel, G_IO_IN, remote_handler, client);
259 client->remote_client_iochannel_err = g_io_add_watch (client->remote_client_iochannel, G_IO_ERR, remote_handler, client);
260 client->remote_client_iochannel_hup = g_io_add_watch (client->remote_client_iochannel, G_IO_HUP, remote_handler, client);
263 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
271 delete client->remote_client;
276 EXAPI int remote_control_disconnect(remote_control_client *client)
280 if (client == NULL) {
281 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
282 return REMOTE_CONTROL_INVALID_PARAMETER;
285 if (client->remote_client) {
286 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege ();
288 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
292 if (client->remote_client_iochannel)
293 g_io_channel_unref (client->remote_client_iochannel);
295 if (client->remote_client_iochannel_read)
296 g_source_remove (client->remote_client_iochannel_read);
298 if (client->remote_client_iochannel_err)
299 g_source_remove (client->remote_client_iochannel_err);
301 if (client->remote_client_iochannel_hup)
302 g_source_remove (client->remote_client_iochannel_hup);
304 client->remote_client_iochannel = NULL;
305 client->remote_client_iochannel_read = 0;
306 client->remote_client_iochannel_err = 0;
307 client->remote_client_iochannel_hup = 0;
309 client->remote_client->close_connection();
311 delete client->remote_client;
317 return REMOTE_CONTROL_ERROR_NONE;
320 EXAPI int remote_control_focus_in_callback_set(remote_control_client *client, remote_control_focus_in_cb func, void *user_data)
322 if (client == NULL || func == NULL) {
323 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
324 return REMOTE_CONTROL_INVALID_PARAMETER;
327 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
329 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
333 client->focus_in_cb = func;
334 client->focus_in_cb_user_data = user_data;
337 return REMOTE_CONTROL_ERROR_NONE;
340 EXAPI int remote_control_focus_in_callback_unset(remote_control_client *client)
342 if (client == NULL) {
343 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
344 return REMOTE_CONTROL_INVALID_PARAMETER;
347 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
349 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
353 client->focus_in_cb = NULL;
354 client->focus_in_cb_user_data = NULL;
357 return REMOTE_CONTROL_ERROR_NONE;
360 EXAPI int remote_control_focus_out_callback_set(remote_control_client *client, remote_control_focus_out_cb func , void *user_data)
362 if (client == NULL || func == NULL) {
363 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
364 return REMOTE_CONTROL_INVALID_PARAMETER;
367 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
369 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
373 client->focus_out_cb = func;
374 client->focus_out_cb_user_data = user_data;
377 return REMOTE_CONTROL_ERROR_NONE;
380 EXAPI int remote_control_focus_out_callback_unset(remote_control_client *client)
382 if (client == NULL) {
383 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
384 return REMOTE_CONTROL_INVALID_PARAMETER;
387 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
389 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
393 client->focus_out_cb = NULL;
394 client->focus_out_cb_user_data = NULL;
397 return REMOTE_CONTROL_ERROR_NONE;
400 EXAPI int remote_control_entry_metadata_callback_set(remote_control_client *client, remote_control_entry_metadata_cb func, void *user_data)
402 if (client == NULL || func == NULL) {
403 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
404 return REMOTE_CONTROL_INVALID_PARAMETER;
407 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
409 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
413 client->metadata_cb = func;
414 client->metadata_cb_user_data = user_data;
417 return REMOTE_CONTROL_ERROR_NONE;
420 EXAPI int remote_control_entry_metadata_callback_unset(remote_control_client *client)
422 if (client == NULL) {
423 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
424 return REMOTE_CONTROL_INVALID_PARAMETER;
427 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
429 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
433 client->metadata_cb = NULL;
434 client->metadata_cb_user_data = NULL;
437 return REMOTE_CONTROL_ERROR_NONE;
440 EXAPI int remote_control_text_updated_callback_set(remote_control_client *client, remote_control_text_updated_cb func, void *user_data)
442 if (client == NULL || func == NULL) {
443 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
444 return REMOTE_CONTROL_INVALID_PARAMETER;
447 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
449 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
453 client->text_updated_cb = func;
454 client->text_updated_cb_user_data = user_data;
457 return REMOTE_CONTROL_ERROR_NONE;
460 EXAPI int remote_control_text_updated_callback_unset(remote_control_client *client)
462 if (client == NULL) {
463 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
464 return REMOTE_CONTROL_INVALID_PARAMETER;
467 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
469 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
473 client->text_updated_cb = NULL;
474 client->text_updated_cb_user_data = NULL;
477 return REMOTE_CONTROL_ERROR_NONE;
480 EXAPI int remote_control_input_resource_changed_callback_set(remote_control_client *client, remote_control_input_resource_changed_cb func , void *user_data)
482 if (client == NULL || func == NULL) {
483 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
484 return REMOTE_CONTROL_INVALID_PARAMETER;
487 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
489 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
493 client->input_resource_changed_cb = func;
494 client->input_resource_changed_cb_user_data = user_data;
497 return REMOTE_CONTROL_ERROR_NONE;
500 EXAPI int remote_control_input_resource_changed_callback_unset(remote_control_client *client)
502 if (client == NULL) {
503 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
504 return REMOTE_CONTROL_INVALID_PARAMETER;
507 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
509 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
513 client->input_resource_changed_cb = NULL;
514 client->input_resource_changed_cb_user_data = NULL;
517 return REMOTE_CONTROL_ERROR_NONE;
520 EXAPI int remote_control_send_key_event(remote_control_client *client, remote_control_key_type_e key)
522 if (client == NULL || key > REMOTE_CONTROL_KEY_CANCEL) {
523 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
524 return REMOTE_CONTROL_INVALID_PARAMETER;
527 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
529 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
533 char key_str[12] = {};
534 snprintf(key_str, sizeof(key_str), "%d", key);
535 String command = String (MESSAGE_DELIMETER) + String ("plain") + String (MESSAGE_DELIMETER) +
536 String ("send_key_event") + String (MESSAGE_DELIMETER) + String (key_str) + String (MESSAGE_DELIMETER);
539 error_e = (remote_control_error_e)client->remote_client->send_remote_input_message(command.c_str ());
542 SECURE_LOGD ("%p, key=%d", client, key);
543 if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 1) != 0)
544 LOGW ("Failed to set vconf key");
550 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
551 return REMOTE_CONTROL_INVALID_OPERATION;
554 EXAPI int remote_control_send_commit_string(remote_control_client *client, const char *text)
556 if (client == NULL || !text) {
557 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
558 return REMOTE_CONTROL_INVALID_PARAMETER;
561 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
563 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
567 String command = String (MESSAGE_DELIMETER) + String ("plain") + String (MESSAGE_DELIMETER) +
568 String ("commit_string") + String (MESSAGE_DELIMETER) + String (text) + String (MESSAGE_DELIMETER);
571 error_e = (remote_control_error_e)client->remote_client->send_remote_input_message(command.c_str ());
574 SECURE_LOGD ("%p, \"%s\"", client, text);
575 if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 1) != 0)
576 LOGW ("Failed to set vconf key");
582 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
583 return REMOTE_CONTROL_INVALID_OPERATION;
586 EXAPI int remote_control_update_preedit_string(remote_control_client *client, const char *text, Eina_List *attrs, int cursor_pos)
588 if (client == NULL) {
589 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
590 return REMOTE_CONTROL_INVALID_PARAMETER;
593 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
595 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
599 char cursor_position[10] = {};
600 snprintf(cursor_position, sizeof(cursor_position), "%d", cursor_pos);
601 String command = String (MESSAGE_DELIMETER) + String ("plain") + String (MESSAGE_DELIMETER) +String ("update_preedit_string") +
602 String (MESSAGE_DELIMETER) + String (text) + String (MESSAGE_DELIMETER) + String (cursor_position) + String (MESSAGE_DELIMETER);
605 error_e = (remote_control_error_e)client->remote_client->send_remote_input_message(command.c_str ());
608 SECURE_LOGD ("%p, %d, \"%s\"", client, cursor_pos, text);
609 if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 1) != 0)
610 LOGW ("Failed to set vconf key");
616 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
617 return REMOTE_CONTROL_INVALID_OPERATION;
620 EXAPI int remote_control_delete_surrounding_text(remote_control_client *client, int offset, int len)
622 if (client == NULL || len < 0) {
623 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
624 return REMOTE_CONTROL_INVALID_PARAMETER;
627 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
629 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
634 error_e = (remote_control_error_e)client->remote_client->delete_surrounding_text(offset, len);
637 LOGD ("%p, (%d, %d)", client, offset, len);
638 if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 1) != 0)
639 LOGW ("Failed to set vconf key");
645 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
646 return REMOTE_CONTROL_INVALID_OPERATION;
649 EXAPI int remote_control_key_event_callback_set(remote_control_client *client, remote_control_key_event_cb func , void *user_data)
651 if (client == NULL || func == NULL) {
652 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
653 return REMOTE_CONTROL_INVALID_PARAMETER;
656 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
658 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
662 client->key_event_cb = func;
663 client->key_event_cb_user_data = user_data;
666 return REMOTE_CONTROL_ERROR_NONE;
669 EXAPI int remote_control_key_event_callback_unset(remote_control_client *client)
671 if (client == NULL) {
672 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
673 return REMOTE_CONTROL_INVALID_PARAMETER;
676 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
678 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
682 client->key_event_cb = NULL;
683 client->key_event_cb_user_data = NULL;
686 return REMOTE_CONTROL_ERROR_NONE;
689 EXAPI int remote_control_set_cursor_position(remote_control_client *client, int cursor_pos)
691 if (client == NULL || cursor_pos < 0) {
692 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
693 return REMOTE_CONTROL_INVALID_PARAMETER;
696 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
698 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
703 error_e = (remote_control_error_e)client->remote_client->set_cursor_position(cursor_pos);
706 LOGD ("%p, (%d)", client, cursor_pos);
707 if (vconf_set_bool (VCONFKEY_ISF_REMOTE_INPUT_DETECTED, 1) != 0)
708 LOGW ("Failed to set vconf key");
714 LOGE ("REMOTE_CONTROL_INVALID_OPERATION");
715 return REMOTE_CONTROL_INVALID_OPERATION;
718 EXAPI int remote_control_cursor_position_updated_callback_set(remote_control_client *client, remote_control_cursor_position_updated_cb func , void *user_data)
720 if (client == NULL || func == NULL) {
721 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
722 return REMOTE_CONTROL_INVALID_PARAMETER;
725 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
727 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
731 client->cursor_position_updated_cb = func;
732 client->cursor_position_updated_cb_user_data = user_data;
735 return REMOTE_CONTROL_ERROR_NONE;
738 EXAPI int remote_control_cursor_position_updated_callback_unset(remote_control_client *client)
740 if (client == NULL) {
741 LOGE ("REMOTE_CONTROL_INVALID_PARAMETER");
742 return REMOTE_CONTROL_INVALID_PARAMETER;
745 remote_control_error_e error_e = (remote_control_error_e)client->remote_client->check_privilege();
747 LOGE ("REMOTE_CONTROL_PERMISSION_DENIED");
751 client->cursor_position_updated_cb = NULL;
752 client->cursor_position_updated_cb_user_data = NULL;
755 return REMOTE_CONTROL_ERROR_NONE;