"""
  This is a simple python script to test the autogenerated module

"""
print '        START TESTING AVCaptureRemote MODULE'

from naoqi import ALProxy
import time

IP = "127.0.0.1"
PORT = 9559

#________________________________
# Generic Proxy creation 
#________________________________

try:
  AVCaptureRemote_Proxy = ALProxy("AVCaptureRemote",IP,PORT)
except Exception,e:
  print "Error when creating AVCaptureRemote_Proxy proxy:"
  print str(e)
  exit(1)

#________________________________
# Remote procedure call
#________________________________

# stop the capture which has been launched when starting the module 
try:
  ret = AVCaptureRemote_Proxy.stopCapture()
except Exception,e:
  print "stopCapture failed"
  exit(1)

#wait for 2 seconds
time.sleep(2)

# relaunch the capture 
try:
  ret = AVCaptureRemote_Proxy.startCapture(True,True)
except Exception,e:
  print "startCapture failed"
  exit(1)

#waits for 2 seconds
time.sleep(2)

# and stops it
try:
  ret = AVCaptureRemote_Proxy.stopCapture()
except Exception,e:
  print "stopCapture failed"
  exit(1)

exit(0)

