ingescape
ingescape copied to clipboard
android assertion failed
ingescape/src/igs_network.c:3719: igs_result_t igs_start_with_device(const char *, unsigned int): assertion "network_device" failed
igs_net_devices_list return zero in android, is there a workaround ?
Hello and thanks for giving ingescape a try 😉
Could you give us some code snippet showing how you use this method?
The assert you get in your first comment comes from here. You probably are giving a NULL char* to igs_start_with_device as the device name to connect to so the program aborts.
igs_net_devices_list will give you all compatible network interfaces available on your device.
If it returns nothing, it's probably because you have no available compatible network interfaces (or at least ingescape/zeromq cannot see them for some reason).
As a note, compatible network interfaces are basically interfaces with UDP broadcast available (for agents auto-discovery).
you are right, on android devices = igs_net_devices_list(&nb); return 0 device. than pass that null into igs_start_with_device(device_name, 5670); cause the problem.
I guess maybe android has some limit on libc.
Ingescape works well with Android. No device means that you have no device with a valid configuration. To be valid, a network configuration shall have an IP address of course, but also a valid mask and a corresponding broadcast address. Here is an example of valid configuration returned by ifconfig: en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=50b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV,CHANNEL_IO> ether 5c:e9:1e:e8:8a:d1 inet 10.1.0.3 netmask 0xffff8000 broadcast 10.1.127.255 nd6 options=201<PERFORMNUD,DAD> media: autoselect (1000baseT <full-duplex,flow-control>) status: active
You can use CZMQ's ziflist object to get details on the available network adapters and their parameters. The doc is here : http://czmq.zeromq.org/czmq4-0:ziflist The example at the bottom of the page will give you details about the netmask and broadcast address of the available adapters.
I try ziflist on android, ziflist_size always return 0
ziflist_t* iflist = ziflist_new();
assert (iflist);
size_t items = ziflist_size(iflist);
I would consider the application permissions in Android, with things like ACCESS_NETWORK_STATE or ACCESS_WIFI_STATE