forked from MStrecke/pyFosControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
camtest.py
36 lines (29 loc) · 975 Bytes
/
camtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python
# -*- coding: utf-8 -*-
from foscontrol import Cam
import ConfigParser
################################
# Don't forget to edit cam.cfg #
# to reflect you setup! #
################################
if __name__ == "__main__":
config = ConfigParser.ConfigParser()
# see cam.cfg.example
config.readfp(open('cam.cfg'))
prot = config.get('general', 'protocol')
host = config.get('general', 'host')
port = config.get('general', 'port')
user = config.get('general', 'user')
passwd = config.get('general', 'password')
# connection to the camera
do = Cam(prot, host, port, user, passwd)
# display basic camera info
res = do.getDevInfo()
if res.result == 0: # quick check
print """product name: %s
serial number: %s
camera name: %s
firmware version: %s
hardware version: %s""" % (res.productName, res.serialNo, res.devName, res.firmwareVer, res.hardwareVer)
else:
print res._result