Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VISCA Over IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amalio Coron
VISCA Over IP
Commits
22de25ec
Commit
22de25ec
authored
Dec 8, 2018
by
Pierre Minssen
Browse files
Options
Downloads
Patches
Plain Diff
Ajout reception + refomatage des responds_library
parent
d3547c9f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
viscaoveriplib/camera.py
+34
-0
34 additions, 0 deletions
viscaoveriplib/camera.py
with
34 additions
and
0 deletions
viscaoveriplib/camera.py
+
34
−
0
View file @
22de25ec
...
...
@@ -74,3 +74,37 @@ class Camera:
message
=
data
.
hex
()
return
message
from
threading
import
Thread
class
listener
(
Thread
):
"""
Thread chargé simplement d
'
afficher un mot dans la console.
"""
def
__init__
(
self
,
IP_OUT
=
"
192.168.0.57
"
,
PORT
=
52381
):
Thread
.
__init__
(
self
)
self
.
message
=
"
FF
"
self
.
IP_OUT
=
IP_OUT
self
.
PORT
=
PORT
def
run
(
self
):
sock
=
socket
.
socket
(
socket
.
AF_INET
,
# Internet
socket
.
SOCK_DGRAM
)
# UDP
sock
.
bind
((
self
.
IP_OUT
,
self
.
PORT
))
while
True
:
data
,
addr
=
sock
.
recvfrom
(
1024
)
# buffer size is 1024 bytes<
self
.
message
=
data
.
hex
()
C
=
Camera
()
thread_1
=
listener
()
thread_1
.
start
()
C
.
send
(
"
Commande en hex
"
)
print
(
thread_1
.
message
)
thread_1
.
join
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment