Re: Enable/disable Wi-Fi tethering when Wi-Fi dongle is not plugged in

2015-10-19 Thread Patrik Flykt

Hi,

On Thu, 2015-10-15 at 13:37 +1100, Craig McQueen wrote:
> I'm setting PersistentTetheringMode = true in /etc/connman/main.conf.
> I'm also providing an initial /var/lib/connman/settings which contains
> parameters for WiFi tethering enabled. So when a user plugs in a Wi-Fi
> USB dongle, it goes into tethering mode automatically.
> 
> However, when the Wi-Fi dongle is not plugged in, the D-Bus interface
> gives no indication that persistent tethering is enabled, and gives no
> ability to disable it.

There are exactly zero devices supporting WiFi, and there is also zero
knowledge of any possibly appearing at a later point either. So when
there are no devices of a certain technology, there is no point in
showing a technology that would somehow indicate something else...

> Perhaps if persistent tethering mode is saved, then the technology
> should continue to be visible, albeit with some property that
> indicates hardware isn't available.  E.g. Tethering = True, Powered =
> False, Hardware = False. Or something like that. Then it should be
> possible to at least disable the persistent tethering.

Sorry, no. It will make everybody believe that hardware is
malfunctioning although it will never be present. A technology that
exists implies Hardware = true.

> Similarly, I reckon it should be possible to see that configuration
> exists for a Wi-Fi network, and to remove it ("forget network"), even
> when the hardware isn't currently present or the network isn't
> currently detected. That is, all previously configured services should
> always appear in the list of services, with some property that
> indicates it isn't connected. E.g. Strength = 0, State = absent. Or
> something like that.

Sorry, no. We have had this discussion before, and the Service API is by
definition showing existing services. It has been repeatedly asked from
people needing this kind of a features to specify a configuration API
where all the configured services can be listed. So far no proposals
have been received.

> Another note: I notice that Connected = False when tethering is
> enabled and operational. I'm not sure what the rationale is for that,
> but perhaps that could be changed to Connected = True to clearly
> indicate when tethering is both enabled and operational.

Connected is defined to indicate that there is a service connected.

Cheers,

Patrik



___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


Re: Enable/disable Wi-Fi tethering when Wi-Fi dongle is not plugged in

2015-10-14 Thread Patrik Flykt
On Wed, 2015-10-14 at 17:53 +1100, Craig McQueen wrote:
> I am working on a system where a USB dongle is used for Wi-Fi
> functionality. The Wi-Fi can be used in client or access point mode,
> configurable. However, it seems it's not possible to enable/disable
> tethering mode while the USB Wi-Fi device is not currently plugged in.
> E.g.:
> 
> # connmanctl tether wifi off
> Error disabling wifi tethering: Method "SetProperty" with
> signature "sv" on interface "net.connman.Technology" doesn't exist
> 
> What options would there be for enabling/disabling tethering, while
> the Wi-Fi device is not currently plugged in?

If this dongle is the only WiFi device, removing it will cause the
technology to disappear as there are no devices this specific technology
is able to control. So no options for this, but see
TetheringTechnologies and PersistentTetheringMode in main.conf if the
use case is such that tethering state needs to be remembered.

Cheers,

Patrik


___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman


RE: Enable/disable Wi-Fi tethering when Wi-Fi dongle is not plugged in

2015-10-14 Thread Craig McQueen
Patrik wrote:
> On Wed, 2015-10-14 at 17:53 +1100, Craig McQueen wrote:
> > I am working on a system where a USB dongle is used for Wi-Fi
> > functionality. The Wi-Fi can be used in client or access point mode,
> > configurable. However, it seems it's not possible to enable/disable
> > tethering mode while the USB Wi-Fi device is not currently plugged in.
> > E.g.:
> > 
> > # connmanctl tether wifi off
> > Error disabling wifi tethering: Method "SetProperty" with
> > signature "sv" on interface "net.connman.Technology" doesn't exist
> > 
> > What options would there be for enabling/disabling tethering, while
> > the Wi-Fi device is not currently plugged in?
>
> If this dongle is the only WiFi device, removing it will cause the
> technology to disappear as there are no devices this specific technology
> is able to control. So no options for this, but see
> TetheringTechnologies and PersistentTetheringMode in main.conf if the
> use case is such that tethering state needs to be remembered.

I'm setting PersistentTetheringMode = true in /etc/connman/main.conf. I'm also 
providing an initial /var/lib/connman/settings which contains parameters for 
WiFi tethering enabled. So when a user plugs in a Wi-Fi USB dongle, it goes 
into tethering mode automatically.

However, when the Wi-Fi dongle is not plugged in, the D-Bus interface gives no 
indication that persistent tethering is enabled, and gives no ability to 
disable it.

Perhaps if persistent tethering mode is saved, then the technology should 
continue to be visible, albeit with some property that indicates hardware isn't 
available.  E.g. Tethering = True, Powered = False, Hardware = False. Or 
something like that. Then it should be possible to at least disable the 
persistent tethering.

Similarly, I reckon it should be possible to see that configuration exists for 
a Wi-Fi network, and to remove it ("forget network"), even when the hardware 
isn't currently present or the network isn't currently detected. That is, all 
previously configured services should always appear in the list of services, 
with some property that indicates it isn't connected. E.g. Strength = 0, State 
= absent. Or something like that.

Another note: I notice that Connected = False when tethering is enabled and 
operational. I'm not sure what the rationale is for that, but perhaps that 
could be changed to Connected = True to clearly indicate when tethering is both 
enabled and operational.

-- 
Craig McQueen

___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman