Re: Switching Airport of in code using SCF
Re: Switching Airport of in code using SCF
- Subject: Re: Switching Airport of in code using SCF
- From: Allan Nathanson <email@hidden>
- Date: Tue, 19 Feb 2008 15:05:37 -0500
On Feb 19, 2008, at 2:42 PM, Mike wrote:
You most certainly can elicit a change in hardware state using SCF.
configd monitors the dynamic and persistent stores for changes
continuously. If you make a change to either via SCF, configd will
automatically notice the changes and update everything in the system.
Actually, it's one (or more) of the configd plugins but you are
essentially correct.
...
From your description it sounds like you are updating the persistent
store but the dynamic store is not being updated (or not being
noticed). This would manifest itself in the symptoms you described -
it works after reboot but not immediately upon setting the info.
This would indicate the persistent store is getting updated but the
dynamic store isn't - the next time you reboot, configd re-reads the
persistent store to create a new dynamic store.
Yes, Jonathan's updating the persistent configuration. I suspect the
issue is that the change is "not being noticed".
I assume you are calling both SCPreferencesCommitChanges and
SCPreferencesApplyChanges? The former updates the persistent store,
the latter applies the changes to the running system. Also note you
must lock the store before making any changes or the changes won't
take effect.
Jonathan's sample code IS calling both the commit and apply
functions. As to acquiring the lock, it's not a requirement (the APIs
will attempt to acquire/release the lock for you) but it can avoid
some issues with multiple processes wanting to update the stored
configuration at the same time and since we only allow one writer the
other callers will get a "stale" error.
SCF was designed to allow dynamic changes to the system without
having drivers get involved. There is no need to have a driver do
anything to change supported settings in a service or services.
Correct.
- Allan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden