Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android assertion failed #89

Open
calvin2021y opened this issue Aug 17, 2024 · 6 comments
Open

android assertion failed #89

calvin2021y opened this issue Aug 17, 2024 · 6 comments

Comments

@calvin2021y
Copy link

ingescape/src/igs_network.c:3719: igs_result_t igs_start_with_device(const char *, unsigned int): assertion "network_device" failed
@calvin2021y
Copy link
Author

igs_net_devices_list return zero in android, is there a workaround ?

@Mathsoum
Copy link
Collaborator

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).

@calvin2021y
Copy link
Author

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.

@stvales
Copy link
Collaborator

stvales commented Aug 22, 2024

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.

@calvin2021y
Copy link
Author

I try ziflist on android, ziflist_size always return 0

		ziflist_t* iflist = ziflist_new();
		assert (iflist);
		size_t items = ziflist_size(iflist);

@stvales
Copy link
Collaborator

stvales commented Aug 23, 2024

I would consider the application permissions in Android, with things like ACCESS_NETWORK_STATE or ACCESS_WIFI_STATE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants