-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
connmanctl.c
743 lines (597 loc) · 21.3 KB
/
connmanctl.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2017 - Jean-André Santoni
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <compat/strl.h>
#include <file/file_path.h>
#include <string/stdstring.h>
#include <retro_miscellaneous.h>
#include <configuration.h>
#include <verbosity.h>
#include "../wifi_driver.h"
#include "../../retroarch.h"
#include "../../lakka.h"
#ifdef HAVE_GFX_WIDGETS
#include "../../gfx/gfx_widgets.h"
#endif
typedef struct
{
bool connman_cache[256];
unsigned connman_counter;
struct string_list* lines;
char command[256];
bool connmanctl_widgets_supported;
} connman_t;
static void *connmanctl_init(void)
{
connman_t *connman = (connman_t*)calloc(1, sizeof(connman_t));
#ifdef HAVE_GFX_WIDGETS
connman->connmanctl_widgets_supported = gfx_widgets_ready();
#endif
return connman;
}
static void connmanctl_free(void *data)
{
if (data)
free(data);
}
static bool connmanctl_start(void *data)
{
(void)data;
return true;
}
static void connmanctl_stop(void *data)
{
(void)data;
}
static bool connmanctl_tether_status(connman_t *connman)
{
/* Returns true if the tethering is active
* false when tethering is not active
*/
size_t ln_size;
FILE *command_file = NULL;
char ln[3] = {0};
/* Following command lists 'technologies' of connman,
* greps the wifi + 10 following lines, then first
* occurance of 'Tethering', then 'True' and counts
* the matching lines.
* Expected result is either 1 (active) or 0 (not active)
*/
snprintf(connman->command, sizeof(connman->command), "\
connmanctl technologies | \
grep \"/net/connman/technology/wifi\" -A 10 | \
grep \"^ Tethering =\" -m 1 | \
grep \"True\" | \
wc -l");
command_file = popen(connman->command, "r");
fgets(ln, sizeof(ln), command_file);
ln_size = strlen(ln)-1;
if (ln[ln_size] == '\n')
ln[ln_size] = '\0';
RARCH_LOG("[CONNMANCTL] Tether Status: command: \"%s\", output: \"%s\"\n",
connman->command, ln);
pclose(command_file);
if (!ln)
return false;
if (ln[0] == '0')
return false;
if (ln[0] == '1')
return true;
return false;
}
static void connmanctl_tether_toggle(
connman_t *connman, bool switch_on, char* apname, char* passkey)
{
/* Starts / stops the tethering service on wi-fi device */
char output[256] = {0};
FILE *command_file = NULL;
settings_t *settings = config_get_ptr();
#ifdef HAVE_GFX_WIDGETS
bool widgets_active = connman->connmanctl_widgets_supported;
#endif
snprintf(connman->command, sizeof(connman->command), "\
connmanctl tether wifi %s %s %s",
switch_on ? "on" : "off", apname, passkey);
command_file = popen(connman->command, "r");
RARCH_LOG("[CONNMANCTL] Tether toggle: command: \"%s\"\n",
connman->command);
while (fgets(output, sizeof(output), command_file))
{
size_t output_size = strlen(output) - 1;
if (output[output_size] == '\n')
output[output_size] = '\0';
RARCH_LOG("[CONNMANCTL] Tether toggle: output: \"%s\"\n",
output);
#ifdef HAVE_GFX_WIDGETS
if (!widgets_active)
#endif
runloop_msg_queue_push(output, 1, 180, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
}
pclose(command_file);
RARCH_LOG("[CONNMANCTL] Tether toggle: command finished\n");
if (switch_on)
{
if (!connmanctl_tether_status(connman))
configuration_set_bool(settings,
settings->bools.localap_enable, false);
}
else
{
if (connmanctl_tether_status(connman))
configuration_set_bool(settings,
settings->bools.localap_enable, true);
}
}
static void connmanctl_scan(void *data)
{
char line[512];
union string_list_elem_attr attr;
FILE *serv_file = NULL;
settings_t *settings = config_get_ptr();
connman_t *connman = (connman_t*)data;
attr.i = RARCH_FILETYPE_UNSET;
if (connman->lines)
free(connman->lines);
connman->lines = string_list_new();
if (connmanctl_tether_status(connman))
{
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_SWITCHING_OFF),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
configuration_set_bool(settings,
settings->bools.localap_enable, false);
connmanctl_tether_toggle(connman, false, "", "");
}
pclose(popen("connmanctl enable wifi", "r"));
pclose(popen("connmanctl scan wifi", "r"));
runloop_msg_queue_push(msg_hash_to_str(MSG_WIFI_SCAN_COMPLETE),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
serv_file = popen("connmanctl services", "r");
while (fgets(line, 512, serv_file))
{
size_t len = strlen(line);
if (len > 0 && line[len-1] == '\n')
line[--len] = '\0';
string_list_append(connman->lines, line, attr);
}
pclose(serv_file);
}
static void connmanctl_get_ssids(void *data, struct string_list* ssids)
{
unsigned i;
union string_list_elem_attr attr;
attr.i = RARCH_FILETYPE_UNSET;
connman_t *connman = (connman_t*)data;
if (!connman->lines)
return;
for (i = 0; i < connman->lines->size; i++)
{
char ssid[32];
const char *line = connman->lines->elems[i].data;
strlcpy(ssid, line+4, sizeof(ssid));
string_list_append(ssids, ssid, attr);
}
}
static bool connmanctl_ssid_is_online(void *data, unsigned i)
{
char ln[512] = {0};
char service[128] = {0};
connman_t *connman = (connman_t*)data;
const char *line = connman->lines->elems[i].data;
FILE *command_file = NULL;
if (connman->connman_counter == 60)
{
static struct string_list* list = NULL;
connman->connman_counter = 0;
list = string_split(line, " ");
if (!list)
return false;
if (list->size == 0)
{
string_list_free(list);
return false;
}
strlcpy(service, list->elems[list->size-1].data, sizeof(service));
string_list_free(list);
snprintf(connman->command, sizeof(connman->command), "\
connmanctl services %s | grep 'State = \\(online\\|ready\\)'",
service);
command_file = popen(connman->command, "r");
while (fgets(ln, 512, command_file))
{
connman->connman_cache[i] = true;
return true;
}
pclose(command_file);
connman->connman_cache[i] = false;
}
else
{
connman->connman_counter++;
return connman->connman_cache[i];
}
return false;
}
static bool connmanctl_connect_ssid(
void *data, unsigned idx, const char* passphrase)
{
unsigned i;
char ln[512] = {0};
char name[64] = {0};
char service[128] = {0};
char settings_dir[PATH_MAX_LENGTH] = {0};
char settings_path[PATH_MAX_LENGTH] = {0};
FILE *command_file = NULL;
FILE *settings_file = NULL;
connman_t *connman = (connman_t*)data;
const char *line = connman->lines->elems[idx].data;
settings_t *settings = config_get_ptr();
static struct string_list* list = NULL;
#ifdef HAVE_GFX_WIDGETS
bool widgets_active = connman->connmanctl_widgets_supported;
#endif
/* connmanctl services outputs a 4 character prefixed lines,
* either whitespace or an identifier. i.e.:
* $ connmanctl services
* '*A0 SSID some_unique_id'
* ' SSID some_another_unique_id'
*/
list = string_split(line+4, " ");
if (!list)
return false;
if (list->size == 0)
{
string_list_free(list);
return false;
}
for (i = 0; i < list->size-1; i++)
{
strlcat(name, list->elems[i].data, sizeof(name));
strlcat(name, " ", sizeof(name));
}
strlcpy(service, list->elems[list->size-1].data, sizeof(service));
string_list_free(list);
strlcat(settings_dir, LAKKA_CONNMAN_DIR, sizeof(settings_dir));
strlcat(settings_dir, service, sizeof(settings_dir));
path_mkdir(settings_dir);
strlcat(settings_path, settings_dir, sizeof(settings_path));
strlcat(settings_path, "/settings", sizeof(settings_path));
settings_file = fopen(settings_path, "w");
fprintf(settings_file, "[%s]\n", service);
fprintf(settings_file, "Name=%s\n", name);
fprintf(settings_file, "SSID=");
for (i = 0; i < strlen(name); i++)
fprintf(settings_file, "%02x", (unsigned int) name[i]);
fprintf(settings_file, "\n");
fprintf(settings_file, "Favorite=%s\n", "true");
fprintf(settings_file, "AutoConnect=%s\n", "true");
fprintf(settings_file, "Passphrase=%s\n", passphrase);
fprintf(settings_file, "IPv4.method=%s\n", "dhcp");
fclose(settings_file);
if (connmanctl_tether_status(connman))
{
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_SWITCHING_OFF),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
configuration_set_bool(settings,
settings->bools.localap_enable, false);
connmanctl_tether_toggle(connman, false, "", "");
}
pclose(popen("systemctl restart connman", "r"));
snprintf(connman->command, sizeof(connman->command), "\
connmanctl connect %s 2>&1",
service);
command_file = popen(connman->command, "r");
while (fgets(ln, sizeof(ln), command_file))
{
#ifdef HAVE_GFX_WIDGETS
if (!widgets_active)
#endif
runloop_msg_queue_push(ln, 1, 180, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
}
pclose(command_file);
return true;
}
static void connmanctl_get_connected_ssid(
connman_t *connman, char* ssid, size_t buffersize)
{
size_t ssid_size;
/* Stores the SSID of the currently connected Wi-Fi
* network in ssid
*/
FILE *command_file = NULL;
if (buffersize < 1)
return;
/* Following command lists all connman services, greps
* only 'wifi_' services, then greps the one with
* 'R' (Ready) or 'O' (Online) flag and cuts out the ssid
*/
snprintf(connman->command, sizeof(connman->command), "\
connmanctl services | \
grep wifi_ | \
grep \"^..\\(R\\|O\\)\" | \
cut -d' ' -f 2");
command_file = popen(connman->command, "r");
fgets(ssid, buffersize, command_file);
pclose(command_file);
ssid_size = strlen(ssid) - 1;
if ((ssid_size + 1) > 0)
if (ssid[ssid_size] == '\n')
ssid[ssid_size] = '\0';
RARCH_LOG("[CONNMANCTL] Get Connected SSID: command: \"%s\", output: \"%s\"\n",
connman->command, (ssid_size + 1) ? ssid : "<nothing_found>");
}
static void connmanctl_get_connected_servicename(
connman_t *connman, char* servicename, size_t buffersize)
{
/* Stores the service name of currently connected Wi-Fi
* network in servicename
*/
FILE *command_file = NULL;
FILE *service_file = NULL;
char ln[3] = {0};
char *temp;
if (buffersize < 1)
return;
temp = (char*)malloc(sizeof(char) * buffersize);
/* Following command lists all stored services in
* connman settings folder, which are then used in
* the next while loop for parsing if the service
* is currently online/ready
*/
snprintf(connman->command, sizeof(connman->command), "\
for serv in %s/wifi_*/ ; do \
if [ -d $serv ] ; then \
basename $serv ; \
fi ; \
done",
LAKKA_CONNMAN_DIR);
command_file = popen(connman->command, "r");
RARCH_LOG("[CONNMANCTL] Testing configured services for activity: command: \"%s\"\n",
connman->command);
while (fgets(temp, buffersize, command_file))
{
size_t ln_size;
size_t temp_size = strlen(temp) - 1;
if ((temp_size + 1) > 0)
if (temp[temp_size] == '\n')
temp[temp_size] = '\0';
if ((temp_size + 1) == 0)
{
RARCH_WARN("[CONNMANCTL] Service name empty.\n");
continue;
}
/* Here we test the found service for online | ready
* status and count the lines. Expected results are
* 0 = is not active, 1 = is active
*/
snprintf(connman->command, sizeof(connman->command), "\
connmanctl services %s | \
grep \"^ State = \\(online\\|ready\\)\" | \
wc -l",
temp);
service_file = popen(connman->command, "r");
fgets(ln, sizeof(ln), service_file);
ln_size = strlen(ln) - 1;
if (ln[ln_size] == '\n')
ln[ln_size] = '\0';
pclose(service_file);
RARCH_LOG("[CONNMANCTL] Service: \"%s\", status: \"%s\"\n",
temp, ln);
if (ln[0] == '1')
{
pclose(command_file);
strlcpy(servicename, temp, buffersize);
free(temp);
RARCH_LOG("[CONNMANCTL] Service \"%s\" considered as currently online\n",
servicename);
return;
}
}
pclose(command_file);
}
static void connmanctl_tether_start_stop(void *data, bool start, char* configfile)
{
/* Start / stop wrapper for the tethering service
* It also checks, if we are currently connected
* to a wi-fi network, which needs to be disconnected
* before starting the tethering service, or if the
* tethering service is already running / not running
* before performing the desired action
*/
FILE *command_file = NULL;
char apname[64] = {0};
char passkey[256] = {0};
char ln[512] = {0};
char ssid[64] = {0};
char service[256] = {0};
connman_t *connman = (connman_t*)data;
#ifdef HAVE_GFX_WIDGETS
bool widgets_active = connman->connmanctl_widgets_supported;
#endif
RARCH_LOG("[CONNMANCTL] Tether start stop: begin\n");
if (start) /* we want to start tethering */
{
RARCH_LOG("[CONNMANCTL] Tether start stop: request to start access point\n");
if (connmanctl_tether_status(connman)) /* check if already tethering and bail out if so */
{
RARCH_LOG("[CONNMANCTL] Tether start stop: AP already running\n");
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_ALREADY_RUNNING),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
return;
}
/* check if there is a config file, if not, create one, if yes, parse it */
if (!(command_file = fopen(configfile, "r")))
{
RARCH_WARN("[CONNMANCTL] Tether start stop: config \"%s\" does not exist\n",
configfile);
if (!(command_file = fopen(configfile, "w")))
{
RARCH_ERR("[CONNMANCTL] Tether start stop: cannot create config file \"%s\"\n",
configfile);
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_ERROR_CONFIG_CREATE),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_ERROR);
return;
}
RARCH_LOG("[CONNMANCTL] Tether start stop: creating new config \"%s\"\n",
configfile);
snprintf(apname, sizeof(apname), "LakkaAccessPoint");
snprintf(passkey, sizeof(passkey), "RetroArch");
fprintf(command_file, "APNAME=%s\nPASSWORD=%s", apname, passkey);
fclose(command_file);
RARCH_LOG("[CONNMANCTL] Tether start stop: new config \"%s\" created\n",
configfile);
}
else
{
fclose(command_file);
RARCH_LOG("[CONNMANCTL] Tether start stop: config \"%s\" exists, reading it\n",
configfile);
snprintf(connman->command, sizeof(connman->command), "\
grep -m 1 \"^APNAME=\" %s | cut -d '=' -f 2- && \
grep -m 1 \"^PASSWORD=\" %s | cut -d '=' -f 2-",
configfile, configfile);
command_file = popen(connman->command, "r");
int i = 0;
RARCH_LOG("[CONNMANCTL] Tether start stop: parsing command: \"%s\"\n",
connman->command);
while (fgets(ln, sizeof(ln), command_file))
{
size_t ln_size = strlen(ln) - 1;
i++;
if ((ln_size + 1) > 1)
{
if (ln[ln_size] == '\n')
ln[ln_size] = '\0';
if (i == 1)
{
strlcpy(apname, ln, sizeof(apname));
RARCH_LOG("[CONNMANCTL] Tether start stop: found APNAME: \"%s\"\n",
apname);
continue;
}
if (i == 2)
{
strlcpy(passkey, ln, sizeof(passkey));
RARCH_LOG("[CONNMANCTL] Tether start stop: found PASSWORD: \"%s\"\n",
passkey);
continue;
}
if (i > 2)
{
RARCH_WARN("[CONNMANCTL] Tether start stop: you should not get here...\n");
break;
}
}
}
pclose(command_file);
}
if (!apname || !passkey)
{
RARCH_ERR("[CONNMANCTL] Tether start stop: APNAME or PASSWORD missing\n");
snprintf(ln, sizeof(ln),
msg_hash_to_str(MSG_LOCALAP_ERROR_CONFIG_PARSE),
configfile);
runloop_msg_queue_push(ln,
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_ERROR);
return;
}
/* check if connected to a wi-fi network */
RARCH_LOG("[CONNMANCTL] Tether start stop: checking if not connected to a wi-fi network...\n");
connmanctl_get_connected_ssid(connman, ssid, sizeof(ssid));
if (strlen(ssid) != 0)
{
connmanctl_get_connected_servicename(connman, service, sizeof(service));
if (strlen(service) != 0)
{
/* disconnect from wi-fi network */
RARCH_LOG("[CONNMANCTL] Tether start stop: connected to SSID \"%s\", service \"%s\"\n",
ssid, service);
snprintf(ln, sizeof(ln),
msg_hash_to_str(MSG_WIFI_DISCONNECT_FROM),
ssid);
runloop_msg_queue_push(ln, 1, 180, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
snprintf(connman->command, sizeof(connman->command), "\
connmanctl disconnect %s",
service);
command_file = popen(connman->command, "r");
RARCH_LOG("[CONNMANCTL] Tether start stop: disconnecting from service \"%s\", command: \"%s\"\n",
service, connman->command);
while (fgets(ln, sizeof(ln), command_file))
{
size_t ln_size = strlen(ln) - 1;
if (ln[ln_size] == '\n')
ln[ln_size] = '\0';
RARCH_LOG("[CONNMANCTL] Tether start stop: output: \"%s\"\n",
ln);
#ifdef HAVE_GFX_WIDGETS
if (!widgets_active)
#endif
runloop_msg_queue_push(ln, 1, 180, true,
NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
}
pclose(command_file);
RARCH_LOG("[CONNMANCTL] Tether start stop: disconnect end\n");
}
}
snprintf(connman->command, sizeof(connman->command),
msg_hash_to_str(MSG_LOCALAP_STARTING),
apname, passkey);
runloop_msg_queue_push(connman->command,
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
}
else /* we want to stop tethering */
{
RARCH_LOG("[CONNMANCTL] Tether start stop: request to stop access point\n");
if (!connmanctl_tether_status(connman)) /* check if not tethering and when not, bail out */
{
RARCH_LOG("[CONNMANCTL] Tether start stop: access point is not running\n");
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_NOT_RUNNING),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
return;
}
runloop_msg_queue_push(msg_hash_to_str(MSG_LOCALAP_SWITCHING_OFF),
1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT,
MESSAGE_QUEUE_CATEGORY_INFO);
}
RARCH_LOG("[CONNMANCTL] Tether start stop: calling tether_toggle()\n");
/* call the tether toggle function */
connmanctl_tether_toggle(connman, start, apname, passkey);
RARCH_LOG("[CONNMANCTL] Tether start stop: end\n");
}
wifi_driver_t wifi_connmanctl = {
connmanctl_init,
connmanctl_free,
connmanctl_start,
connmanctl_stop,
connmanctl_scan,
connmanctl_get_ssids,
connmanctl_ssid_is_online,
connmanctl_connect_ssid,
connmanctl_tether_start_stop,
"connmanctl",
};