I think it is some dbus stuff, look in the source code of 2g/3g selection applet(whatever the package name is) on how to do this.