This had multiple issues:
- linked list was modified while other instances were still running and
accessing it (the used linked list is NOT thread-safe).
- Mavlink instance was deleted, but it was still in the linked list, and
thus could still be dereferenced by other threads
- the instance was deleted, but it was still accessed by the 'stop-all'
calling thread
What we do now is:
- wait for all threads to exit
- then remove the instances from the linked list and delete them
This should help the Snapdragon to connect if the network is not yet up
by the time the mainapp starts. It will retry to find a network and
broadcast once it finds one.
It seems that Mac does not support the ioctl to check how big the ifconf
buffer needs to be. Therefore we just have to make a guess.
Alos, instead of allocating the variable size array on the stack, it's
probably safer to use the heap.
Instead of using 255.255.255.255 as the broadcast address, go through
the network interfaces and and try to use a broadcast in the local
network such as 192.168.1.255.
This moves the mavlink_log interface from ioctl to uORB and enables the
mavlink statusmessage output for Snapdragon. The API changes will lead
to changes in all modules that are using it.
This reverts commit 213cdf1a91.
Raising the stream rate of param values had the nice effect that
receiving the params became really quick. However, on the downside it
set all other streams pretty slow. This needs to be fixed differently.
This avoids the need to modify the source code to hard-code the IP when
broadcast doesn't work.
Initializing the sockaddr_in structs with memset is unnecessary because
they are value-initialized by the Mavlink constructor.