summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2017-12-14 16:15:53 -0800
committerCedric Bail <cedric@osg.samsung.com>2017-12-14 16:42:44 -0800
commit2853f9c3b3cac3dc5c3d93a29198f7c58d1ed2b7 (patch)
tree3a93ecd854f516257d197ef8f3be88d50a02a7f9
parentd5c9c0b784a80fe80c0c4066dd8e0deb70bcbd3c (diff)
ecore_con: update efl_net_control_access_point_connect to use Eina_Future.
-rw-r--r--src/examples/ecore/efl_net_control_example.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/src/examples/ecore/efl_net_control_example.c b/src/examples/ecore/efl_net_control_example.c
index d13475cb85..4dd596e0ba 100644
--- a/src/examples/ecore/efl_net_control_example.c
+++ b/src/examples/ecore/efl_net_control_example.c
@@ -852,22 +852,28 @@ _cmd_access_point_show(Eo *ctl, size_t argc EINA_UNUSED, char **argv)
852 _access_point_print(ap); 852 _access_point_print(ap);
853} 853}
854 854
855static void 855static Eina_Value
856_access_point_connect_done(void *data, const Efl_Event *event EINA_UNUSED) 856_access_point_connect(void *data, const Eina_Value v,
857 const Eina_Future *dead EINA_UNUSED)
857{ 858{
858 Eo *ap = data; 859 Eo *ap = data;
859 printf("INFO: access point '%s' finished connect.\n",
860 efl_net_control_access_point_name_get(ap));
861}
862 860
863static void 861 if (v.type == EINA_VALUE_TYPE_ERROR)
864_access_point_connect_error(void *data, const Efl_Event *event) 862 {
865{ 863 Eina_Error err = 0;
866 Eo *ap = data; 864
867 Efl_Future_Event_Failure *f = event->info; 865 eina_value_error_get(&v, &err);
868 printf("INFO: access point '%s' could not connect: %s\n", 866 printf("INFO: access point '%s' could not connect: %s\n",
869 efl_net_control_access_point_name_get(ap), 867 efl_net_control_access_point_name_get(ap),
870 eina_error_msg_get(f->error)); 868 eina_error_msg_get(err));
869 }
870 else
871 {
872 printf("INFO: access point '%s' finished connect.\n",
873 efl_net_control_access_point_name_get(ap));
874 }
875
876 return v;
871} 877}
872 878
873static void 879static void
@@ -876,11 +882,8 @@ _cmd_access_point_connect(Eo *ctl, size_t argc EINA_UNUSED, char **argv)
876 Eo *ap = _access_point_find(ctl, argv[1]); 882 Eo *ap = _access_point_find(ctl, argv[1]);
877 if (!ap) return; 883 if (!ap) return;
878 printf("INFO: connecting point '%s'\n", argv[1]); 884 printf("INFO: connecting point '%s'\n", argv[1]);
879 efl_future_then(efl_net_control_access_point_connect(ap), 885 eina_future_then(efl_net_control_access_point_connect(ap),
880 _access_point_connect_done, 886 _access_point_connect, ap);
881 _access_point_connect_error,
882 NULL,
883 ap);
884} 887}
885 888
886static void 889static void