nearby-sharing / android

Share files between android and PC via the Windows 10 / 11 built-in sharing functionality (Project Rome)
https://nearshare.shortdev.de
GNU General Public License v3.0
648 stars 33 forks source link

Add support for udp advertisement #31

Closed BlockyTheDev closed 1 year ago

BlockyTheDev commented 1 year ago

My setup:

It's already possible to send files from the Android device to the Windows system because the PC in the home network is shown in the device overview after pressing "Send" and selecting the file in the app. My problem is that it's not possible to receive files on Android with the same setup, because Windows doesn't showe the Android device.

If this can be implemented it would be great to see this feature in the future.

ShortDevelopment commented 1 year ago

This is actually an interesting edge case! The CDP protocol is laid out to do discovery over BluetoothLE Beacons to guarantee the devices are actually “nearby” and later switch to local network if possible (TransportUpgrade).

But there’s actually a discovery method that works via network only (no Bluetooth needed). This one is used when you’re sending data to your PC.

Interestingly, it does not work with all PCs anymore (See #17)...

As I started working on my own implementation, I tried to do discovery via this network method, but Windows did not seem to respond, so it might actually be impossible to get this working, but it needs further investigation…

@BlockyTheDev Could you privately send me the following information via mail (nearshare@shortdev.de)?

BlockyTheDev commented 1 year ago

I have sent the information.

ShortDevelopment commented 1 year ago

Great, thanks! I'll have a look!

ShortDevelopment commented 1 year ago

@BlockyTheDev This could now work in theory but Windows does not seem to advertise itself via udp. But I could maybe create a patch for that...

BlockyTheDev commented 1 year ago

But I could maybe create a patch for that...

Would be nice because at the moment the code change has "no use" for me...