8 _elements_print(E_Connman_Element **elements, int count)
11 for (i = 0; i < count; i++)
13 printf("--- element %d:\n", i);
14 e_connman_element_print(stdout, elements[i]);
17 printf("END: all elements count = %d\n", count);
21 _on_element_add(void *data, int type, void *info)
23 E_Connman_Element *element = info;
24 printf(">>> %s\n", element->path);
29 _on_element_del(void *data, int type, void *info)
31 E_Connman_Element *element = info;
32 printf("<<< %s\n", element->path);
37 _on_element_updated(void *data, int type, void *info)
39 E_Connman_Element *element = info;
40 printf("!!! %s\n", element->path);
41 e_connman_element_print(stderr, element);
46 _on_cmd_quit(char *cmd, char *args)
48 fputs("Bye!\n", stderr);
49 ecore_main_loop_quit();
54 _on_cmd_sync(char *cmd, char *args)
56 e_connman_manager_sync_elements();
78 _on_cmd_get_all(char *cmd, char *args)
80 E_Connman_Element **elements;
91 ret = e_connman_elements_get_all_type(type, &count, &elements);
93 ret = e_connman_elements_get_all(&count, &elements);
96 fputs("ERROR: could not get elements\n", stderr);
99 printf("BEG: all elements type=%s count = %d\n", type, count);
100 _elements_print(elements, count);
106 static E_Connman_Element *
107 _element_from_args(char *args, char **next_args)
109 E_Connman_Element *element;
113 fputs("ERROR: missing element path\n", stderr);
118 *next_args = _tok(args);
119 element = e_connman_element_get(args);
121 fprintf(stderr, "ERROR: no element called \"%s\".\n", args);
127 _on_cmd_print(char *cmd, char *args)
130 E_Connman_Element *element = _element_from_args(args, &next_args);
132 e_connman_element_print(stdout, element);
137 _on_cmd_get_properties(char *cmd, char *args)
140 E_Connman_Element *element = _element_from_args(args, &next_args);
142 e_connman_element_properties_sync(element);
147 _on_cmd_property_set(char *cmd, char *args)
149 char *next_args, *name, *p;
150 E_Connman_Element *element = _element_from_args(args, &next_args);
162 fputs("ERROR: missing parameters name, type and value.\n", stderr);
170 fputs("ERROR: missing parameters type and value.\n", stderr);
177 fputs("ERROR: missing parameter value.\n", stderr);
184 case DBUS_TYPE_BOOLEAN:
185 vlong = !!atol(next_args);
186 value = (void *)vlong;
187 fprintf(stderr, "DBG: boolean is: %ld\n", vlong);
189 case DBUS_TYPE_UINT16:
190 vu16 = strtol(next_args, &p, 0);
193 fprintf(stderr, "ERROR: invalid number \"%s\".\n", next_args);
197 fprintf(stderr, "DBG: u16 is: %hu\n", vu16);
199 case DBUS_TYPE_UINT32:
200 vu32 = strtol(next_args, &p, 0);
203 fprintf(stderr, "ERROR: invalid number \"%s\".\n", next_args);
207 fprintf(stderr, "DBG: u16 is: %u\n", vu32);
209 case DBUS_TYPE_STRING:
210 case DBUS_TYPE_OBJECT_PATH:
211 p = next_args + strlen(next_args);
214 while (p > next_args && isspace(*p))
218 fprintf(stderr, "ERROR: invalid string \"%s\".\n", next_args);
222 fprintf(stderr, "DBG: string is: \"%s\"\n", next_args);
225 fprintf(stderr, "ERROR: don't know how to parse type '%c' (%d)\n",
230 fprintf(stderr, "set_property %s [%p] %s %c %p...\n",
231 args, element, name, type, value);
232 if (!e_connman_element_property_set(element, name, type, value))
234 fputs("ERROR: error setting property.\n", stderr);
241 /* Manager Commands */
244 _on_cmd_manager_get(char *cmd, char *args)
246 E_Connman_Element *element;
247 element = e_connman_manager_get();
248 e_connman_element_print(stderr, element);
253 _on_cmd_manager_get_profiles(char *cmd, char *args)
256 E_Connman_Element **profiles;
258 if (!e_connman_manager_profiles_get(&count, &profiles))
260 fputs("ERROR: can't get profiles\n", stderr);
263 printf("BEG: all manager profiles elements count = %d\n", count);
264 _elements_print(profiles, count);
269 _on_cmd_manager_get_devices(char *cmd, char *args)
272 E_Connman_Element **devices;
274 if (!e_connman_manager_devices_get(&count, &devices))
276 fputs("ERROR: can't get devices\n", stderr);
279 printf("BEG: all manager devices elements count = %d\n", count);
280 _elements_print(devices, count);
285 _on_cmd_manager_get_connections(char *cmd, char *args)
288 E_Connman_Element **connections;
290 if (!e_connman_manager_connections_get(&count, &connections))
292 fputs("ERROR: can't get connections\n", stderr);
295 printf("BEG: all manager connections elements count = %d\n", count);
296 _elements_print(connections, count);
301 _on_cmd_manager_get_services(char *cmd, char *args)
304 E_Connman_Element **services;
306 if (!e_connman_manager_services_get(&count, &services))
308 fputs("ERROR: can't get services\n", stderr);
311 printf("BEG: all manager services elements count = %d\n", count);
312 _elements_print(services, count);
317 _on_cmd_manager_register_agent(char *cmd, char *args)
323 fputs("ERROR: missing the object path\n", stderr);
328 if (e_connman_manager_register_agent(path, NULL, NULL))
329 printf(":::Registering agent %s...\n", path);
331 fprintf(stderr, "ERROR: can't register agent %s\n", path);
337 _on_cmd_manager_unregister_agent(char *cmd, char *args)
343 fputs("ERROR: missing the object path\n", stderr);
348 if (e_connman_manager_unregister_agent(path, NULL, NULL))
349 printf(":::Unregistering agent %s...\n", path);
351 fprintf(stderr, "ERROR: can't unregister agent %s\n", path);
357 _on_cmd_manager_get_state(char *cmd, char *args)
360 if (e_connman_manager_state_get(&state))
361 printf(":::Manager state = \"%s\"\n", state);
363 fputs("ERROR: can't get manager state\n", stderr);
368 _on_cmd_manager_get_policy(char *cmd, char *args)
371 if (e_connman_manager_policy_get(&policy))
372 printf(":::Manager policy = \"%s\"\n", policy);
374 fputs("ERROR: can't get manager policy\n", stderr);
379 _on_cmd_manager_set_policy(char *cmd, char *args)
384 fputs("ERROR: missing the policy value\n", stderr);
389 if (e_connman_manager_policy_set(policy, NULL, NULL))
390 printf(":::Manager policy set to \"%s\"\n", policy);
392 fputs("ERROR: can't set manager policy\n", stderr);
397 _on_cmd_manager_get_offline_mode(char *cmd, char *args)
400 if (e_connman_manager_offline_mode_get(&offline))
401 printf(":::Manager Offline Mode = %hhu\n", offline);
403 fputs("ERROR: can't get manager offline mode\n", stderr);
408 _on_cmd_manager_set_offline_mode(char *cmd, char *args)
413 fputs("ERROR: missing the offline mode value\n", stderr);
417 offline = !!atol(args);
418 if (e_connman_manager_offline_mode_set(offline, NULL, NULL))
419 printf(":::Manager Offline Mode set to %hhu\n", offline);
421 fputs("ERROR: can't set manager offline mode\n", stderr);
425 /* Device Commands */
428 _on_cmd_device_create_network(char *cmd, char *args)
431 E_Connman_Element *e;
435 fputs("ERROR: missing the device path\n", stderr);
440 e = e_connman_device_get(path);
441 if (e_connman_device_network_create(e, NULL, NULL))
442 printf(":::Creating Network %s...\n", path);
444 fputs("ERROR: can't create network\n", stderr);
449 _on_cmd_device_remove_network(char *cmd, char *args)
451 char *path, *device_path;
452 E_Connman_Element *e;
456 fputs("ERROR: missing the device path\n", stderr);
464 fputs("ERROR: missing the object network\n", stderr);
469 e = e_connman_device_get(device_path);
470 if (e_connman_device_network_remove(e, path, NULL, NULL))
471 printf(":::Removing Network %s...\n", path);
473 fputs("ERROR: can't remove network\n", stderr);
478 _on_cmd_device_propose_scan(char *cmd, char *args)
481 E_Connman_Element *e;
485 fputs("ERROR: missing the device path\n", stderr);
491 e = e_connman_device_get(path);
492 if (e_connman_device_propose_scan(e, NULL, NULL))
493 printf(":::Proposing scan %s...\n", path);
495 fputs("ERROR: can't propose scan\n", stderr);
500 _on_cmd_device_get_name(char *cmd, char *args)
502 const char *name, *path;
503 E_Connman_Element *e;
507 fputs("ERROR: missing the device path\n", stderr);
513 e = e_connman_device_get(path);
514 if (e_connman_device_name_get(e, &name))
515 printf(":::Device %s Name = \"%s\"\n", path, name);
517 fputs("ERROR: can't get device name\n", stderr);
522 _on_cmd_device_get_type(char *cmd, char *args)
524 const char *type, *path;
525 E_Connman_Element *e;
529 fputs("ERROR: missing the device path\n", stderr);
535 e = e_connman_device_get(path);
536 if (e_connman_device_type_get(e, &type))
537 printf(":::Device %s Type = \"%s\"\n", path, type);
539 fputs("ERROR: can't get device type\n", stderr);
544 _on_cmd_device_get_interface(char *cmd, char *args)
546 const char *interface, *path;
547 E_Connman_Element *e;
551 fputs("ERROR: missing the device path\n", stderr);
557 e = e_connman_device_get(path);
558 if (e_connman_device_interface_get(e, &interface))
559 printf(":::Device %s Interface = \"%s\"\n", path, interface);
561 fputs("ERROR: can't get device interface\n", stderr);
566 _on_cmd_device_get_policy(char *cmd, char *args)
568 const char *policy, *path;
569 E_Connman_Element *e;
573 fputs("ERROR: missing the device path\n", stderr);
579 e = e_connman_device_get(path);
580 if (e_connman_device_policy_get(e, &policy))
581 printf(":::Device %s Policy = \"%s\"\n", path, policy);
583 fputs("ERROR: can't get device policy\n", stderr);
588 _on_cmd_device_set_policy(char *cmd, char *args)
591 const char *device_path;
592 E_Connman_Element *e;
596 fputs("ERROR: missing the device path\n", stderr);
604 fputs("ERROR: missing the policy value\n", stderr);
609 e = e_connman_device_get(device_path);
610 if (e_connman_device_policy_set(e, policy, NULL, NULL))
611 printf(":::Device %s policy set to \"%s\"\n", device_path, policy);
613 fputs("ERROR: can't set device policy\n", stderr);
618 _on_cmd_device_get_priority(char *cmd, char *args)
621 unsigned char priority;
622 E_Connman_Element *e;
626 fputs("ERROR: missing the device path\n", stderr);
632 e = e_connman_device_get(path);
633 if (e_connman_device_priority_get(e, &priority))
634 printf(":::Device %s Priority = %#02hhx (%d)\n", path, priority, priority);
636 fputs("ERROR: can't get device priority\n", stderr);
641 _on_cmd_device_set_priority(char *cmd, char *args)
643 char *next_args, *device_path, *p;
644 unsigned char priority;
645 E_Connman_Element *e;
649 fputs("ERROR: missing the device path\n", stderr);
653 next_args = _tok(args);
656 fputs("ERROR: missing the priority value\n", stderr);
660 priority = strtol(next_args, &p, 0);
663 fprintf(stderr, "ERROR: invalid number \"%s\".\n", next_args);
667 e = e_connman_device_get(device_path);
668 if (e_connman_device_priority_set(e, priority, NULL, NULL))
669 printf(":::Device %s priority set to %d\n", device_path, priority);
671 fputs("ERROR: can't set device priority\n", stderr);
676 _on_cmd_device_get_powered(char *cmd, char *args)
680 E_Connman_Element *e;
684 fputs("ERROR: missing the device path\n", stderr);
690 e = e_connman_device_get(path);
691 if (e_connman_device_powered_get(e, &powered))
692 printf(":::Device %s Powered = %hhu\n", path, powered);
694 fputs("ERROR: can't get device powered\n", stderr);
699 _on_cmd_device_set_powered(char *cmd, char *args)
701 char *device_path, *next_args;
703 E_Connman_Element *e;
707 fputs("ERROR: missing the device path\n", stderr);
711 next_args = _tok(args);
714 fputs("ERROR: missing the powered value\n", stderr);
717 powered = !!atol(next_args);
719 e = e_connman_device_get(device_path);
720 if (e_connman_device_powered_set(e, powered, NULL, NULL))
721 printf(":::Device %s powered set to %hhu\n", device_path, powered);
723 fputs("ERROR: can't set device powered\n", stderr);
728 _on_cmd_device_get_scan_interval(char *cmd, char *args)
731 unsigned short scan_interval;
732 E_Connman_Element *e;
736 fputs("ERROR: missing the device path\n", stderr);
742 e = e_connman_device_get(path);
743 if (e_connman_device_scan_interval_get(e, &scan_interval))
744 printf(":::Device %s ScanInterval = %hu\n", path, scan_interval);
746 fputs("ERROR: can't get device scan interval\n", stderr);
751 _on_cmd_device_set_scan_interval(char *cmd, char *args)
753 char *device_path, *next_args, *p;
754 unsigned short scan_interval;
755 E_Connman_Element *e;
759 fputs("ERROR: missing the device path\n", stderr);
763 next_args = _tok(args);
766 fputs("ERROR: missing the scan interval value\n", stderr);
769 scan_interval = strtol(next_args, &p, 0);
772 fprintf(stderr, "ERROR: invalid number \"%s\".\n", next_args);
776 e = e_connman_device_get(device_path);
777 if (e_connman_device_scan_interval_set(e, scan_interval, NULL, NULL))
778 printf(":::Device %s scan interval set to %hu\n", device_path, scan_interval);
780 fputs("ERROR: can't set device scan interval\n", stderr);
785 _on_cmd_device_get_scanning(char *cmd, char *args)
789 E_Connman_Element *e;
793 fputs("ERROR: missing the device path\n", stderr);
799 e = e_connman_device_get(path);
800 if (e_connman_device_scanning_get(e, &scanning))
801 printf(":::Device %s Scanning = %hhu\n", path, scanning);
803 fputs("ERROR: can't get device scanning\n", stderr);
808 _on_cmd_device_get_networks(char *cmd, char *args)
810 E_Connman_Element **networks;
813 E_Connman_Element *e;
817 fputs("ERROR: missing the device path\n", stderr);
823 e = e_connman_device_get(path);
824 if (!e_connman_device_networks_get(e, &count, &networks))
826 fputs("ERROR: can't get networks\n", stderr);
830 printf("BEG: all device network elements count = %d\n", count);
831 _elements_print(networks, count);
835 /* Profile Commands */
838 _on_cmd_profile_get_name(char *cmd, char *args)
840 const char *name, *path;
841 E_Connman_Element *e;
845 fputs("ERROR: missing the profile path\n", stderr);
851 e = e_connman_profile_get(path);
852 if (e_connman_profile_name_get(e, &name))
853 printf(":::Profile %s Name = \"%s\"\n", path, name);
855 fputs("ERROR: can't get profile name\n", stderr);
860 _on_cmd_profile_get_offline_mode(char *cmd, char *args)
864 E_Connman_Element *e;
868 fputs("ERROR: missing the profile path\n", stderr);
874 e = e_connman_profile_get(path);
875 if (e_connman_profile_offline_mode_get(e, &offline))
876 printf(":::Profile %s Offline Mode = %hhu\n", path, offline);
878 fputs("ERROR: can't get profile offline mode\n", stderr);
883 _on_cmd_profile_set_offline_mode(char *cmd, char *args)
885 char *path, *next_args;
887 E_Connman_Element *e;
891 fputs("ERROR: missing the profile path\n", stderr);
895 next_args = _tok(args);
898 fputs("ERROR: missing the offline mode value\n", stderr);
902 offline = !!atol(next_args);
904 e = e_connman_profile_get(path);
905 if (e_connman_profile_offline_mode_set(e, offline, NULL, NULL))
906 printf(":::Profile %s Offline Mode set to %hhu\n", path, offline);
908 fputs("ERROR: can't set profile offline mode\n", stderr);
913 _on_cmd_profile_get_services(char *cmd, char *args)
915 E_Connman_Element **services;
916 E_Connman_Element *e;
922 fputs("ERROR: missing the profile path\n", stderr);
928 e = e_connman_profile_get(path);
929 if (!e_connman_profile_services_get(e, &count, &services))
931 fputs("ERROR: can't get services\n", stderr);
934 printf("BEG: all profile services count = %d\n", count);
935 _elements_print(services, count);
939 /* Connection Commands */
942 _on_cmd_connection_get_type(char *cmd, char *args)
944 const char *type, *path;
945 E_Connman_Element *e;
949 fputs("ERROR: missing the connection path\n", stderr);
955 e = e_connman_connection_get(path);
956 if (e_connman_connection_type_get(e, &type))
957 printf(":::Connection %s Type = \"%s\"\n", path, type);
959 fputs("ERROR: can't get connection type\n", stderr);
964 _on_cmd_connection_get_interface(char *cmd, char *args)
966 const char *interface, *path;
967 E_Connman_Element *e;
971 fputs("ERROR: missing the connection path\n", stderr);
977 e = e_connman_connection_get(path);
978 if (e_connman_connection_interface_get(e, &interface))
979 printf(":::Connection %s Interface = \"%s\"\n", path, interface);
981 fputs("ERROR: can't get connection type\n", stderr);
986 _on_cmd_connection_get_device(char *cmd, char *args)
988 E_Connman_Element *e, *device;
993 fputs("ERROR: missing the connection path\n", stderr);
999 e = e_connman_connection_get(path);
1000 if (!e_connman_connection_device_get(e, &device))
1001 fputs("ERROR: can't get connection device\n", stderr);
1003 e_connman_element_print(stderr, device);
1008 _on_cmd_connection_get_network(char *cmd, char *args)
1010 E_Connman_Element *e, *network;
1015 fputs("ERROR: missing the connection path\n", stderr);
1021 e = e_connman_connection_get(path);
1022 if (!e_connman_connection_network_get(e, &network))
1023 fputs("ERROR: can't get connection network\n", stderr);
1025 e_connman_element_print(stderr, network);
1030 _on_cmd_connection_get_strength(char *cmd, char *args)
1033 unsigned char strength;
1034 E_Connman_Element *e;
1038 fputs("ERROR: missing the connection path\n", stderr);
1044 e = e_connman_connection_get(path);
1045 if (e_connman_connection_strength_get(e, &strength))
1046 printf(":::Connection %s Strength = %#02hhx (%d)\n", path, strength, strength);
1048 fputs("ERROR: can't get connection strength\n", stderr);
1053 _on_cmd_connection_get_default(char *cmd, char *args)
1056 bool connection_default;
1057 E_Connman_Element *e;
1061 fputs("ERROR: missing the connection path\n", stderr);
1067 e = e_connman_connection_get(path);
1068 if (e_connman_connection_default_get(e, &connection_default))
1069 printf(":::Connection %s Default = %hhu\n", path, connection_default);
1071 fputs("ERROR: can't get connection default\n", stderr);
1076 _on_cmd_connection_get_ipv4_method(char *cmd, char *args)
1078 const char *method, *path;
1079 E_Connman_Element *e;
1083 fputs("ERROR: missing the connection path\n", stderr);
1089 e = e_connman_connection_get(path);
1090 if (e_connman_connection_ipv4_method_get(e, &method))
1091 printf(":::Connection %s IPv4 Method = \"%s\"\n", path, method);
1093 fputs("ERROR: can't get connection ipv4 method\n", stderr);
1098 _on_cmd_connection_get_ipv4_address(char *cmd, char *args)
1100 const char *address, *path;
1101 E_Connman_Element *e;
1105 fputs("ERROR: missing the connection path\n", stderr);
1111 e = e_connman_connection_get(path);
1112 if (e_connman_connection_ipv4_address_get(e, &address))
1113 printf(":::Connection %s IPv4 Address = \"%s\"\n", path, address);
1115 fputs("ERROR: can't get connection ipv4 address\n", stderr);
1119 /* Network Commands */
1122 _on_cmd_network_connect(char *cmd, char *args)
1125 E_Connman_Element *e;
1129 fputs("ERROR: missing the network path\n", stderr);
1135 e = e_connman_network_get(path);
1136 if (e_connman_network_connect(e, NULL, NULL))
1137 printf(":::Connecting to Network %s...\n", path);
1139 fputs("ERROR: can't connect to network\n", stderr);
1144 _on_cmd_network_disconnect(char *cmd, char *args)
1147 E_Connman_Element *e;
1151 fputs("ERROR: missing the network path\n", stderr);
1157 e = e_connman_network_get(path);
1158 if (e_connman_network_disconnect(e, NULL, NULL))
1159 printf(":::Disconnecting Network %s...\n", path);
1161 fputs("ERROR: can't disconnect network\n", stderr);
1166 _on_cmd_network_get_name(char *cmd, char *args)
1168 const char *name, *path;
1169 E_Connman_Element *e;
1173 fputs("ERROR: missing the network path\n", stderr);
1179 e = e_connman_network_get(path);
1180 if (e_connman_network_name_get(e, &name))
1181 printf(":::Network %s Name = \"%s\"\n", path, name);
1183 fputs("ERROR: can't get network name\n", stderr);
1188 _on_cmd_network_get_available(char *cmd, char *args)
1192 E_Connman_Element *e;
1196 fputs("ERROR: missing the network path\n", stderr);
1202 e = e_connman_network_get(path);
1203 if (e_connman_network_available_get(e, &available))
1204 printf(":::Network %s Available = %hhu\n", path, available);
1206 fputs("ERROR: can't get network available\n", stderr);
1211 _on_cmd_network_get_connected(char *cmd, char *args)
1215 E_Connman_Element *e;
1219 fputs("ERROR: missing the network path\n", stderr);
1225 e = e_connman_network_get(path);
1226 if (e_connman_network_connected_get(e, &connected))
1227 printf(":::Network %s Connected = %hhu\n", path, connected);
1229 fputs("ERROR: can't get network connected\n", stderr);
1234 _on_cmd_network_get_remember(char *cmd, char *args)
1238 E_Connman_Element *e;
1242 fputs("ERROR: missing the network path\n", stderr);
1248 e = e_connman_network_get(path);
1249 if (e_connman_network_remember_get(e, &remember))
1250 printf(":::Network %s Remember = %hhu\n", path, remember);
1252 fputs("ERROR: can't get network remember\n", stderr);
1257 _on_cmd_network_set_remember(char *cmd, char *args)
1259 char *network_path, *next_args;
1261 E_Connman_Element *e;
1265 fputs("ERROR: missing the network path\n", stderr);
1268 network_path = args;
1269 next_args = _tok(args);
1272 fputs("ERROR: missing the remember value\n", stderr);
1276 remember = !!atol(next_args);
1278 e = e_connman_network_get(network_path);
1279 if (e_connman_network_remember_set(e, remember, NULL, NULL))
1280 printf(":::Network %s remember set to %d\n", network_path, remember);
1282 fputs("ERROR: can't set network remember\n", stderr);
1287 _on_cmd_network_get_strength(char *cmd, char *args)
1290 unsigned char strength;
1291 E_Connman_Element *e;
1295 fputs("ERROR: missing the network path\n", stderr);
1301 e = e_connman_network_get(path);
1302 if (e_connman_network_strength_get(e, &strength))
1303 printf(":::Network %s Strength = %#02hhx (%d)\n", path, strength, strength);
1305 fputs("ERROR: can't get network strength\n", stderr);
1310 _on_cmd_network_get_device(char *cmd, char *args)
1312 E_Connman_Element *e, *device;
1317 fputs("ERROR: missing the network path\n", stderr);
1323 e = e_connman_network_get(path);
1324 if (!e_connman_network_device_get(e, &device))
1325 fputs("ERROR: can't get network device\n", stderr);
1327 e_connman_element_print(stderr, device);
1332 _on_cmd_network_get_wifi_ssid(char *cmd, char *args)
1334 unsigned char *bytes;
1336 unsigned int i, count;
1337 E_Connman_Element *e;
1341 fputs("ERROR: missing the network path\n", stderr);
1347 e = e_connman_network_get(path);
1348 if (e_connman_network_wifi_ssid_get(e, &count, &bytes))
1350 printf(":::Network %s Wifi SSID = ", path);
1351 for (i = 0; i < count; i++)
1352 printf("%#02hhx (\"%c\"), ", bytes[i], bytes[i]);
1356 fputs("ERROR: can't get network wifi ssid\n", stderr);
1361 _on_cmd_network_get_wifi_mode(char *cmd, char *args)
1363 const char *wifi_mode, *path;
1364 E_Connman_Element *e;
1368 fputs("ERROR: missing the network path\n", stderr);
1374 e = e_connman_network_get(path);
1375 if (e_connman_network_wifi_mode_get(e, &wifi_mode))
1376 printf(":::Network %s Wifi Mode = \"%s\"\n", path, wifi_mode);
1378 fputs("ERROR: can't get network wifi mode\n", stderr);
1383 _on_cmd_network_set_wifi_mode(char *cmd, char *args)
1386 const char *network_path;
1387 E_Connman_Element *e;
1391 fputs("ERROR: missing the network path\n", stderr);
1394 network_path = args;
1395 wifi_mode = _tok(args);
1399 fputs("ERROR: missing the wifi mode value\n", stderr);
1404 e = e_connman_network_get(network_path);
1405 if (e_connman_network_wifi_mode_set(e, wifi_mode, NULL, NULL))
1406 printf(":::Network %s wifi mode set to \"%s\"\n", network_path, wifi_mode);
1408 fputs("ERROR: can't set network wifi mode\n", stderr);
1413 _on_cmd_network_get_wifi_security(char *cmd, char *args)
1415 const char *wifi_security, *path;
1416 E_Connman_Element *e;
1420 fputs("ERROR: missing the network path\n", stderr);
1426 e = e_connman_network_get(path);
1427 if (e_connman_network_wifi_security_get(e, &wifi_security))
1428 printf(":::Network %s Wifi Security = \"%s\"\n", path, wifi_security);
1430 fputs("ERROR: can't get network wifi security\n", stderr);
1435 _on_cmd_network_set_wifi_security(char *cmd, char *args)
1437 char *wifi_security, *network_path;
1438 E_Connman_Element *e;
1442 fputs("ERROR: missing the network path\n", stderr);
1445 network_path = args;
1446 wifi_security = _tok(args);
1450 fputs("ERROR: missing the wifi security value\n", stderr);
1453 _tok(wifi_security);
1455 e = e_connman_network_get(network_path);
1456 if (e_connman_network_wifi_security_set(e, wifi_security, NULL, NULL))
1457 printf(":::Network %s wifi security set to \"%s\"\n", network_path, wifi_security);
1459 fputs("ERROR: can't set network wifi security\n", stderr);
1464 _on_cmd_network_get_wifi_passphrase(char *cmd, char *args)
1466 const char *wifi_passphrase, *path;
1467 E_Connman_Element *e;
1471 fputs("ERROR: missing the network path\n", stderr);
1477 e = e_connman_network_get(path);
1478 if (e_connman_network_wifi_passphrase_get(e, &wifi_passphrase))
1479 printf(":::Network %s Wifi Passphrase = \"%s\"\n", path, wifi_passphrase);
1481 fputs("ERROR: can't get network wifi passphrase\n", stderr);
1486 _on_cmd_network_set_wifi_passphrase(char *cmd, char *args)
1488 char *wifi_passphrase, *network_path;
1489 E_Connman_Element *e;
1493 fputs("ERROR: missing the network path\n", stderr);
1496 network_path = args;
1497 wifi_passphrase = _tok(args);
1499 if (!wifi_passphrase)
1501 fputs("ERROR: missing the wifi passphrase value\n", stderr);
1504 _tok(wifi_passphrase);
1506 e = e_connman_network_get(network_path);
1507 if (e_connman_network_wifi_passphrase_set(e, wifi_passphrase, NULL, NULL))
1508 printf(":::Network %s wifi passphrase set to \"%s\"\n", network_path, wifi_passphrase);
1510 fputs("ERROR: can't set network wifi passphrase\n", stderr);
1514 /* Services Commands */
1517 _on_cmd_service_connect(char *cmd, char *args)
1520 E_Connman_Element *e;
1524 fputs("ERROR: missing the service path\n", stderr);
1530 e = e_connman_service_get(path);
1531 if (e_connman_service_connect(e, NULL, NULL))
1532 printf(":::Connecting to Service %s...\n", path);
1534 fputs("ERROR: can't connect to service\n", stderr);
1539 _on_cmd_service_disconnect(char *cmd, char *args)
1542 E_Connman_Element *e;
1546 fputs("ERROR: missing the service path\n", stderr);
1552 e = e_connman_service_get(path);
1553 if (e_connman_service_disconnect(e, NULL, NULL))
1554 printf(":::Disconnecting Service %s...\n", path);
1556 fputs("ERROR: can't disconnect service\n", stderr);
1561 _on_cmd_service_remove(char *cmd, char *args)
1564 E_Connman_Element *e;
1568 fputs("ERROR: missing the service path\n", stderr);
1574 e = e_connman_service_get(path);
1575 if (e_connman_service_remove(e, NULL, NULL))
1576 printf(":::Removing Service %s...\n", path);
1578 fputs("ERROR: can't remove service\n", stderr);
1583 _on_cmd_service_move_before(char *cmd, char *args)
1585 char *path, *service_path;
1586 E_Connman_Element *e;
1590 fputs("ERROR: missing the service path\n", stderr);
1593 service_path = args;
1598 fputs("ERROR: missing the object service\n", stderr);
1603 e = e_connman_service_get(service_path);
1604 if (e_connman_service_move_before(e, path, NULL, NULL))
1605 printf(":::Moving before %s...\n", path);
1607 fputs("ERROR: can't move before\n", stderr);
1612 _on_cmd_service_move_after(char *cmd, char *args)
1614 char *path, *service_path;
1615 E_Connman_Element *e;
1619 fputs("ERROR: missing the service path\n", stderr);
1622 service_path = args;
1627 fputs("ERROR: missing the object service\n", stderr);
1632 e = e_connman_service_get(service_path);
1633 if (e_connman_service_move_after(e, path, NULL, NULL))
1634 printf(":::Moving after %s...\n", path);
1636 fputs("ERROR: can't move after\n", stderr);
1641 _on_cmd_service_get_state(char *cmd, char *args)
1643 const char *state, *path;
1644 E_Connman_Element *e;
1648 fputs("ERROR: missing the service path\n", stderr);
1654 e = e_connman_service_get(path);
1655 if (e_connman_service_state_get(e, &state))
1656 printf(":::Service %s State = \"%s\"\n", path, state);
1658 fputs("ERROR: can't get service state\n", stderr);
1663 _on_cmd_service_get_error(char *cmd, char *args)
1665 const char *error, *path;
1666 E_Connman_Element *e;
1670 fputs("ERROR: missing the service path\n", stderr);
1676 e = e_connman_service_get(path);
1677 if (e_connman_service_error_get(e, &error))
1678 printf(":::Service %s Error = \"%s\"\n", path, error);
1680 fputs("ERROR: can't get service error\n", stderr);
1685 _on_cmd_service_get_name(char *cmd, char *args)
1687 const char *name, *path;
1688 E_Connman_Element *e;
1692 fputs("ERROR: missing the service path\n", stderr);
1698 e = e_connman_service_get(path);
1699 if (e_connman_service_name_get(e, &name))
1700 printf(":::Service %s Name = \"%s\"\n", path, name);
1702 fputs("ERROR: can't get service name\n", stderr);
1707 _on_cmd_service_get_type(char *cmd, char *args)
1709 const char *type, *path;
1710 E_Connman_Element *e;
1714 fputs("ERROR: missing the service path\n", stderr);
1720 e = e_connman_service_get(path);
1721 if (e_connman_service_type_get(e, &type))
1722 printf(":::Service %s Type = \"%s\"\n", path, type);
1724 fputs("ERROR: can't get service type\n", stderr);
1729 _on_cmd_service_get_mode(char *cmd, char *args)
1731 const char *mode, *path;
1732 E_Connman_Element *e;
1736 fputs("ERROR: missing the service path\n", stderr);
1742 e = e_connman_service_get(path);
1743 if (e_connman_service_mode_get(e, &mode))
1744 printf(":::Service %s Mode = \"%s\"\n", path, mode);
1746 fputs("ERROR: can't get service mode\n", stderr);
1751 _on_cmd_service_get_security(char *cmd, char *args)
1753 const char *security, *path;
1754 E_Connman_Element *e;
1758 fputs("ERROR: missing the service path\n", stderr);
1764 e = e_connman_service_get(path);
1765 if (e_connman_service_security_get(e, &security))
1766 printf(":::Service %s Security = \"%s\"\n", path, security);
1768 fputs("ERROR: can't get service security\n", stderr);
1773 _on_cmd_service_get_passphrase(char *cmd, char *args)
1775 const char *passphrase, *path;
1776 E_Connman_Element *e;
1780 fputs("ERROR: missing the service path\n", stderr);
1786 e = e_connman_service_get(path);
1787 if (e_connman_service_passphrase_get(e, &passphrase))
1788 printf(":::Service %s Passphrase = \"%s\"\n", path, passphrase);
1790 fputs("ERROR: can't get service passphrase\n", stderr);
1795 _on_cmd_service_set_passphrase(char *cmd, char *args)
1797 char *passphrase, *path;
1798 E_Connman_Element *e;
1802 fputs("ERROR: missing the service path\n", stderr);
1806 passphrase = _tok(args);
1810 fputs("ERROR: missing the passphrase value\n", stderr);
1815 e = e_connman_service_get(path);
1816 if (e_connman_service_passphrase_set(e, passphrase, NULL, NULL))
1817 printf(":::Service %s passphrase set to \"%s\"\n", path, passphrase);
1819 fputs("ERROR: can't set service passphrase\n", stderr);
1824 _on_cmd_service_get_passphrase_required(char *cmd, char *args)
1828 E_Connman_Element *e;
1832 fputs("ERROR: missing the service path\n", stderr);
1838 e = e_connman_service_get(path);
1839 if (e_connman_service_passphrase_required_get(e, &passphrase))
1840 printf(":::Service %s Passphrase Required = %hhu\n", path, passphrase);
1842 fputs("ERROR: can't get service passphrase required\n", stderr);
1847 _on_cmd_service_get_strength(char *cmd, char *args)
1850 unsigned char strength;
1851 E_Connman_Element *e;
1855 fputs("ERROR: missing the service path\n", stderr);
1861 e = e_connman_service_get(path);
1862 if (e_connman_service_strength_get(e, &strength))
1863 printf(":::Service %s Strength = %#02hhx (%d)\n", path, strength, strength);
1865 fputs("ERROR: can't get service strength\n", stderr);
1870 _on_cmd_service_get_favorite(char *cmd, char *args)
1874 E_Connman_Element *e;
1878 fputs("ERROR: missing the service path\n", stderr);
1884 e = e_connman_service_get(path);
1885 if (e_connman_service_favorite_get(e, &favorite))
1886 printf(":::Service %s Favorite = %hhu\n", path, favorite);
1888 fputs("ERROR: can't get service favorite\n", stderr);
1893 _on_cmd_service_get_auto_connect(char *cmd, char *args)
1897 E_Connman_Element *e;
1901 fputs("ERROR: missing the service path\n", stderr);
1907 e = e_connman_service_get(path);
1908 if (e_connman_service_auto_connect_get(e, &auto_connect))
1909 printf(":::Service %s Auto Connect = %hhu\n", path, auto_connect);
1911 fputs("ERROR: can't get service auto connect\n", stderr);
1916 _on_cmd_service_set_auto_connect(char *cmd, char *args)
1918 char *path, *next_args;
1920 E_Connman_Element *e;
1924 fputs("ERROR: missing the service path\n", stderr);
1928 next_args = _tok(args);
1932 fputs("ERROR: missing the auto connect value\n", stderr);
1936 auto_connect = !!atol(next_args);
1938 e = e_connman_service_get(path);
1939 if (e_connman_service_auto_connect_set(e, auto_connect, NULL, NULL))
1940 printf(":::Service %s auto connect set to %d\n", path, auto_connect);
1942 fputs("ERROR: can't set service auto connect\n", stderr);
1947 _on_cmd_service_get_setup_required(char *cmd, char *args)
1950 bool setup_required;
1951 E_Connman_Element *e;
1955 fputs("ERROR: missing the service path\n", stderr);
1961 e = e_connman_service_get(path);
1962 if (e_connman_service_setup_required_get(e, &setup_required))
1963 printf(":::Service %s Setup Required = %hhu\n", path, setup_required);
1965 fputs("ERROR: can't get service setup required\n", stderr);
1970 _on_cmd_service_get_apn(char *cmd, char *args)
1972 const char *apn, *path;
1973 E_Connman_Element *e;
1977 fputs("ERROR: missing the service path\n", stderr);
1983 e = e_connman_service_get(path);
1984 if (e_connman_service_apn_get(e, &apn))
1985 printf(":::Service %s APN = \"%s\"\n", path, apn);
1987 fputs("ERROR: can't get service APN\n", stderr);
1992 _on_cmd_service_set_apn(char *cmd, char *args)
1995 E_Connman_Element *e;
1999 fputs("ERROR: missing the service path\n", stderr);
2007 fputs("ERROR: missing the apn value\n", stderr);
2012 e = e_connman_service_get(path);
2013 if (e_connman_service_apn_set(e, apn, NULL, NULL))
2014 printf(":::Service %s APN set to \"%s\"\n", path, apn);
2016 fputs("ERROR: can't set service APN\n", stderr);
2021 _on_cmd_service_get_mcc(char *cmd, char *args)
2023 const char *mcc, *path;
2024 E_Connman_Element *e;
2028 fputs("ERROR: missing the service path\n", stderr);
2034 e = e_connman_service_get(path);
2035 if (e_connman_service_mcc_get(e, &mcc))
2036 printf(":::Service %s MCC = \"%s\"\n", path, mcc);
2038 fputs("ERROR: can't get service MCC\n", stderr);
2043 _on_cmd_service_get_mnc(char *cmd, char *args)
2045 const char *mnc, *path;
2046 E_Connman_Element *e;
2050 fputs("ERROR: missing the service path\n", stderr);
2056 e = e_connman_service_get(path);
2057 if (e_connman_service_mnc_get(e, &mnc))
2058 printf(":::Service %s MNC = \"%s\"\n", path, mnc);
2060 fputs("ERROR: can't get service MNC\n", stderr);
2065 _on_cmd_service_get_roaming(char *cmd, char *args)
2069 E_Connman_Element *e;
2073 fputs("ERROR: missing the service path\n", stderr);
2079 e = e_connman_service_get(path);
2080 if (e_connman_service_roaming_get(e, &roaming))
2081 printf(":::Service %s Roaming = %hhu\n", path, roaming);
2083 fputs("ERROR: can't get service roaming\n", stderr);
2088 _on_cmd_service_get_ipv4_method(char *cmd, char *args)
2090 const char *ipv4_method, *path;
2091 E_Connman_Element *e;
2095 fputs("ERROR: missing the service path\n", stderr);
2101 e = e_connman_service_get(path);
2102 if (e_connman_service_ipv4_method_get(e, &ipv4_method))
2103 printf(":::Service %s ipv4 method = \"%s\"\n", path, ipv4_method);
2105 fputs("ERROR: can't get service ipv4 method\n", stderr);
2110 _on_cmd_service_set_ipv4_method(char *cmd, char *args)
2112 char *ipv4_method, *path;
2113 E_Connman_Element *e;
2117 fputs("ERROR: missing the service path\n", stderr);
2121 ipv4_method = _tok(args);
2125 fputs("ERROR: missing the ipv4 method value\n", stderr);
2130 e = e_connman_service_get(path);
2131 if (e_connman_service_ipv4_method_set(e, ipv4_method, NULL, NULL))
2132 printf(":::Service %s set to ipv4 method\"%s\"\n", path, ipv4_method);
2134 fputs("ERROR: can't set service ipv4 method\n", stderr);
2139 _on_cmd_service_get_ipv4_address(char *cmd, char *args)
2141 const char *ipv4_address, *path;
2142 E_Connman_Element *e;
2146 fputs("ERROR: missing the service path\n", stderr);
2152 e = e_connman_service_get(path);
2153 if (e_connman_service_ipv4_address_get(e, &ipv4_address))
2154 printf(":::Service %s ipv4 address = \"%s\"\n", path, ipv4_address);
2156 fputs("ERROR: can't get service ipv4 address\n", stderr);
2161 _on_cmd_service_set_ipv4_address(char *cmd, char *args)
2163 char *ipv4_address, *path;
2164 E_Connman_Element *e;
2168 fputs("ERROR: missing the service path\n", stderr);
2172 ipv4_address= _tok(args);
2176 fputs("ERROR: missing the ipv4 address value\n", stderr);
2181 e = e_connman_service_get(path);
2182 if (e_connman_service_ipv4_address_set(e, ipv4_address, NULL, NULL))
2183 printf(":::Service %s ipv4 address set to \"%s\"\n", path, ipv4_address);
2185 fputs("ERROR: can't set service ipv4 address\n", stderr);
2191 _on_input(void *data, Ecore_Fd_Handler *fd_handler)
2197 int (*cb)(char *cmd, char *args);
2199 {"quit", _on_cmd_quit},
2200 {"sync", _on_cmd_sync},
2201 {"get_all", _on_cmd_get_all},
2202 {"print", _on_cmd_print},
2203 {"get_properties", _on_cmd_get_properties},
2204 {"set_property", _on_cmd_property_set},
2205 {"manager_get", _on_cmd_manager_get},
2206 {"manager_get_profiles", _on_cmd_manager_get_profiles},
2207 {"manager_get_devices", _on_cmd_manager_get_devices},
2208 {"manager_get_connections", _on_cmd_manager_get_connections},
2209 {"manager_get_services", _on_cmd_manager_get_services},
2210 {"manager_register_agent", _on_cmd_manager_register_agent},
2211 {"manager_unregister_agent", _on_cmd_manager_unregister_agent},
2212 {"manager_get_state", _on_cmd_manager_get_state},
2213 {"manager_get_policy", _on_cmd_manager_get_policy},
2214 {"manager_set_policy", _on_cmd_manager_set_policy},
2215 {"manager_get_offline_mode", _on_cmd_manager_get_offline_mode},
2216 {"manager_set_offline_mode", _on_cmd_manager_set_offline_mode},
2217 {"device_create_network", _on_cmd_device_create_network},
2218 {"device_remove_network", _on_cmd_device_remove_network},
2219 {"device_propose_scan", _on_cmd_device_propose_scan},
2220 {"device_get_name", _on_cmd_device_get_name},
2221 {"device_get_type", _on_cmd_device_get_type},
2222 {"device_get_interface", _on_cmd_device_get_interface},
2223 {"device_get_policy", _on_cmd_device_get_policy},
2224 {"device_set_policy", _on_cmd_device_set_policy},
2225 {"device_get_priority", _on_cmd_device_get_priority},
2226 {"device_set_priority", _on_cmd_device_set_priority},
2227 {"device_get_powered", _on_cmd_device_get_powered},
2228 {"device_set_powered", _on_cmd_device_set_powered},
2229 {"device_get_scan_interval", _on_cmd_device_get_scan_interval},
2230 {"device_set_scan_interval", _on_cmd_device_set_scan_interval},
2231 {"device_get_scanning", _on_cmd_device_get_scanning},
2232 {"device_get_networks", _on_cmd_device_get_networks},
2233 {"profile_get_name", _on_cmd_profile_get_name},
2234 {"profile_get_offline_mode", _on_cmd_profile_get_offline_mode},
2235 {"profile_set_offline_mode", _on_cmd_profile_set_offline_mode},
2236 {"profile_get_services", _on_cmd_profile_get_services},
2237 {"connection_get_type", _on_cmd_connection_get_type},
2238 {"connection_get_interface", _on_cmd_connection_get_interface},
2239 {"connection_get_strength", _on_cmd_connection_get_strength},
2240 {"connection_get_default", _on_cmd_connection_get_default},
2241 {"connection_get_device", _on_cmd_connection_get_device},
2242 {"connection_get_network", _on_cmd_connection_get_network},
2243 {"connection_get_ipv4_method", _on_cmd_connection_get_ipv4_method},
2244 {"connection_get_ipv4_address", _on_cmd_connection_get_ipv4_address},
2245 {"network_connect", _on_cmd_network_connect},
2246 {"network_disconnect", _on_cmd_network_disconnect},
2247 {"network_get_name", _on_cmd_network_get_name},
2248 {"network_get_available", _on_cmd_network_get_available},
2249 {"network_get_connected", _on_cmd_network_get_connected},
2250 {"network_get_remember", _on_cmd_network_get_remember},
2251 {"network_set_remember", _on_cmd_network_set_remember},
2252 {"network_get_strength", _on_cmd_network_get_strength},
2253 {"network_get_device", _on_cmd_network_get_device},
2254 {"network_get_wifi_ssid", _on_cmd_network_get_wifi_ssid},
2255 {"network_get_wifi_mode", _on_cmd_network_get_wifi_mode},
2256 {"network_set_wifi_mode", _on_cmd_network_set_wifi_mode},
2257 {"network_get_wifi_security", _on_cmd_network_get_wifi_security},
2258 {"network_set_wifi_security", _on_cmd_network_set_wifi_security},
2259 {"network_get_wifi_passphrase", _on_cmd_network_get_wifi_passphrase},
2260 {"network_set_wifi_passphrase", _on_cmd_network_set_wifi_passphrase},
2261 {"service_connect", _on_cmd_service_connect},
2262 {"service_disconnect", _on_cmd_service_disconnect},
2263 {"service_remove", _on_cmd_service_remove},
2264 {"service_move_before", _on_cmd_service_move_before},
2265 {"service_move_after", _on_cmd_service_move_after},
2266 {"service_get_state", _on_cmd_service_get_state},
2267 {"service_get_error", _on_cmd_service_get_error},
2268 {"service_get_name", _on_cmd_service_get_name},
2269 {"service_get_type", _on_cmd_service_get_type},
2270 {"service_get_mode", _on_cmd_service_get_mode},
2271 {"service_get_security", _on_cmd_service_get_security},
2272 {"service_get_passphrase", _on_cmd_service_get_passphrase},
2273 {"service_set_passphrase", _on_cmd_service_set_passphrase},
2274 {"service_get_passphrase_required", _on_cmd_service_get_passphrase_required},
2275 {"service_get_strength", _on_cmd_service_get_strength},
2276 {"service_get_favorite", _on_cmd_service_get_favorite},
2277 {"service_get_auto_connect", _on_cmd_service_get_auto_connect},
2278 {"service_set_auto_connect", _on_cmd_service_set_auto_connect},
2279 {"service_get_setup_required", _on_cmd_service_get_setup_required},
2280 {"service_get_apn", _on_cmd_service_get_apn},
2281 {"service_set_apn", _on_cmd_service_set_apn},
2282 {"service_get_mcc", _on_cmd_service_get_mcc},
2283 {"service_get_mnc", _on_cmd_service_get_mnc},
2284 {"service_get_roaming", _on_cmd_service_get_roaming},
2285 {"service_get_ipv4_method", _on_cmd_service_get_ipv4_method},
2286 {"service_set_ipv4_method", _on_cmd_service_set_ipv4_method},
2287 {"service_get_ipv4_address", _on_cmd_service_get_ipv4_address},
2288 {"service_set_ipv4_address", _on_cmd_service_set_ipv4_address},
2293 if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_ERROR))
2295 fputs("ERROR: reading from stdin, exit\n", stderr);
2299 if (!ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
2301 fputs("ERROR: nothing to read?\n", stderr);
2305 if (!fgets(buf, sizeof(buf), stdin))
2307 fprintf(stderr, "ERROR: could not read command: %s\n", strerror(errno));
2308 ecore_main_loop_quit();
2313 while (isspace(*cmd))
2316 args = strchr(cmd, ' ');
2324 while (isspace(*args))
2327 p = args + strlen(args) - 1;
2335 p = cmd + strlen(cmd) - 1;
2340 if (strcmp(cmd, "help") == 0)
2344 printf("Commands with '%s' in the name:\n", args);
2345 for (itr = maps; itr->cmd != NULL; itr++)
2346 if (strstr(itr->cmd, args))
2347 printf("\t%s\n", itr->cmd);
2351 fputs("Commands:\n", stdout);
2352 for (itr = maps; itr->cmd != NULL; itr++)
2353 printf("\t%s\n", itr->cmd);
2355 fputc('\n', stdout);
2359 for (itr = maps; itr->cmd != NULL; itr++)
2360 if (strcmp(itr->cmd, cmd) == 0)
2361 return itr->cb(cmd, args);
2363 printf("unknown command \"%s\", args=%s\n", cmd, args);
2368 main(int argc, char *argv[])
2370 E_DBus_Connection *c;
2376 c = e_dbus_bus_get(DBUS_BUS_SYSTEM);
2378 printf("ERROR: can't connect to system session\n");
2382 e_connman_system_init(c);
2383 ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_ADD, _on_element_add, NULL);
2384 ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_DEL, _on_element_del, NULL);
2385 ecore_event_handler_add(E_CONNMAN_EVENT_ELEMENT_UPDATED,
2386 _on_element_updated, NULL);
2388 ecore_main_fd_handler_add
2389 (0, ECORE_FD_READ | ECORE_FD_ERROR, _on_input, NULL, NULL, NULL);
2391 ecore_main_loop_begin();
2393 e_connman_system_shutdown();
2395 e_dbus_connection_close(c);
2400 fputs("DBG: clean exit.\n", stderr);