Hello Patrik,
> +void reload_config(const char * ident) {
> +struct inotify_event event;
> +
> +event.mask = IN_MODIFY;
> +
> +config_notify_handler(&event,ident);
There can be more than one services specified in the same
configuration file. With the above all other services will also be disrupted, which is not
nice if another service is connected while trying to remove the other one from the same
file.
You're right, they would be re-provisioned as well, meaning reset to default. And the
same currently happens if the user manually modifies the .config file for one service
only, the config_notify_handler has to be revised
> +if (service->immutable == true &&
service->config_file)
> +{/* force reprovision of immutable services */
> +
> +/* reset autoconnect to default, because it is not currently (connman 1.31)
> + * managed by .config files
> + */
> +auto_connect_types =
connman_setting_get_uint_list("DefaultAutoConnectTechnologies");
> +service->autoconnect = false;
> +for (i = 0; auto_connect_types &&
> +auto_connect_types[i] != 0; i++) {
> +if (service->type == auto_connect_types[i]) {
> +service->autoconnect = true;
> +break;
> +}
> +}
> +
All settings added by the user shall be removed. I wonder if the
removal can be combined with refactored parts of service_free(), as the service is
stripped of all extra values there. When adding the service back in a fresh state,
reprovisioning can be impelmented to happen for just this service, but it may also be
easier to do
__connman_service_create_from_network() here.
Yes it should be completed by clearing all the properties that the re-provision is going
to provide after. Here I kept the clears already present plus I added only autoconnect
which can be modified by d-bus but it is not read from .config files so it would stay at
the last value instead of being reset.
I've done a fast test with __connman_service_create_from_network(service->network)
instead of reload_config(ident) and passphrase at least is not re-read so it would need
some modification more to work.
Marco
________________________________
VISITA IL NOSTRO NUOVO SITO WEB! - VISIT OUR NEW WEB SITE!
www.magnetimarelli.com
Confidential Notice: This message - including its attachments - may contain proprietary,
confidential and/or legally protected information and is intended solely for the use of
the designated addressee(s) above. If you are not the intended recipient be aware that any
downloading, copying, disclosure, distribution or use of the contents of the above
information is strictly prohibited.
If you have received this communication by mistake, please forward the message back to the
sender at the email address above, delete the message from all mailboxes and any other
electronic storage medium and destroy all copies.
Disclaimer Notice: Internet communications cannot be guaranteed to be safe or error-free.
Therefore we do not assure that this message is complete or accurate and we do not accept
liability for any errors or omissions in the contents of this message.