borconi / WifiLauncherforHUR

15 stars 9 forks source link

Connecting to the HUR but with tasker #23

Open jgato opened 4 months ago

jgato commented 4 months ago

I am not sure if some would help me to create a tasker task that would do the same @borconi do here:

https://github.com/borconi/WifiLauncherforHUR/blob/9a61099f8bb8b9612744144f1cabd04408b7545d/app/src/main/java/com/borconi/emil/wifilauncherforhur/connectivity/Connector.java#L84-L90

basically and intent sent like:

    A1: Send Intent [
         Action: com.google.android.projection.gearhead.START_WIRELESS_PROJECTION
         Cat: Default
         Extra: PARAM_SERVICE_PORT:5288
         Extra: PARAM_HOST_ADDRESS:192.168.43.1
         Package: com.google.android.projection.gearhead
         Class: com.google.android.apps.auto.wireless.setup.service.impl.WirelessStartupActivity
         Target: Activity ]

I guess it depends on your connection mode, in my case, the hotspot is created on the Head Unit of my car, running Head Unit Reloaded. PARAM_HOST_ADDRESS should be the IP of the HUR?, or the mobile? I dont mind if I have to hardcode some params.

jgato commented 4 months ago

okaaa PARAM_HOST_ADDRESS is, indeed, the IP of the HUR. My scenario: My car, with HUR that creates a hotspot. The hotspot unit does not have an IP, but it is a gateway, so once I have connected my mobile wifi to the car's hotspot, I can check the connection gateway. But, the gateway changes every time I reconnect!! ouchhhhh :(

If I try to connect statically, it will not work. I guess HUR is listening, in some way, when a new connection is created to bind it. If I do it statically it does not work. What a pity.

Maybe I can create a wiffi, from my car, instead of a hotspot.

borconi commented 4 months ago

There is a function build in: getCurrentWifiGateway normally it gets the IP of the gateway and uses that to pass it on to the intent.