问题
I'm currently building an app that creates a platform where users can share information on a network but I wanted to create an offline option where users could still communicate on a peer-to-peer network when in close proximity. Is it possible to create a BT mesh network with smart phones?
I've seen that Bluetooth has the option to create mesh networks using BLE but after looking into CoreBluetooth I haven't been able to find anything that would support this type of network. I've see some solutions using iOS Multipeer connectivity but I would ideally like a cross platform solution if at all possible.
回答1:
Bluetooth SIG announced Bluetooth Mesh functionality in July 2017. The mesh network specifications was derived from Bluetooth Low Energy v4.0 specification and many mobile phones support Bluetooth Low Energy v4.0.
However, mobile phone will not support Bluetooth Mesh networking topology in near future. This is just my thought.
In the mesh network, you can transmit packets to a destination which is out of direct radio range by hoping nodes.
I believe that, this scenario can be simulated by sending beacons and scanning beacons. The following steps might not be an complete solution but it will give you insight about basic mesh network design.
Here is the steps;
- You need to know all mac address of your mobile devices.
- All mobile device must be in scanning mode to receive incoming beacons.
- You need to make custom beacon data format which must contain source address, destination address, time to live value and your data.
- When a mobile device receive BLE packet; If the target address in the packet is same as receiving device address means that your packet is delivered successfully. If the target address in the packet is not same as receiving device address means that the packet should be re-transmit. Before re-transmitting packet, you need to decrements time to live value for preventing infinite packet transmission.
It would be good practice, if you cache last sent beacon packets to prevent re-transmitting same packet more than one.
I hope that, this will give you basic understanding about how mesh networking topology can be implemented in mobile phones.
回答2:
Yes it is possible. Android and iOS doesnt natively provides support BLE Mesh API but they can be built on top of the existing BLE APIs for iOS and Androi
STMicroelectronics : https://www.st.com/en/embedded-software/stsw-bnrg-mesh.html
https://play.google.com/store/apps/details?id=com.st.bluenrgmesh&hl=en_IN
Support : https://community.st.com/s/topic/0TO0X000000BSrIWAW/ble-mesh
Nordic :
https://github.com/NordicSemiconductor/Android-nRF-Mesh-Library
https://github.com/NordicSemiconductor/IOS-nRF-Mesh-Library
https://play.google.com/store/apps/details?id=no.nordicsemi.android.nrfmeshprovisioner&hl=en_IN
Support : https://devzone.nordicsemi.com/
来源:https://stackoverflow.com/questions/57384918/is-it-possible-to-create-a-bluetooth-mesh-network-with-ios-and-android-devices