Take a look at KDE IOSlaves. They can control the entire protocol that you describe, plus several others (samba, ssh, ...).
You can create iOS devices via PyKDE or, if this dependency is too large, you can probably control ioslave from python using the subprocess module.
source
share