Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
taste-setup
Commits
9f65de3b
Commit
9f65de3b
authored
Jul 13, 2017
by
TASTE User
Browse files
Update peekpoke code
parent
5608bd76
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/peek-poke/peekpoke.py
View file @
9f65de3b
#!/usr/bin/env python
#!/usr/bin/env python
2
import
sys
,
os
,
re
,
threading
,
time
,
signal
import
sys
,
os
,
re
,
threading
,
time
,
signal
,
ctypes
sys
.
path
.
append
(
"."
)
#from PythonAccess import *
import
DV
import
dataview_uniq_asn
import
PythonAccess
as
PA
import
PythonController
PA
=
PythonController
.
PythonAccess
sizePerType
=
{
DV
.
int_32
:
4
,
...
...
@@ -80,14 +80,15 @@ class Poll_taste_probe_console(threading.Thread):
while
True
:
inform
(
"Attempting to open msgQ %s"
,
self
.
msgQname
)
self
.
_msgQueue
=
PA
.
OpenMsgQueueForReading
(
self
.
msgQname
)
if
(
self
.
_msgQueue
!=
-
1
):
break
if
(
self
.
_msgQueue
!=
-
1
):
break
print
"Communication channel over"
,
self
.
msgQname
,
"not established yet...
\n
"
time
.
sleep
(
1
)
if
self
.
_bDie
:
return
# Then, now that msgQ is opened, start polling:
bufferSize
=
PA
.
GetMsgQueueBufferSize
(
self
.
_msgQueue
)
self
.
_pMem
=
DV
.
new_byte_SWIG_PTR
(
bufferSize
)
self
.
_pMem
=
ctypes
.
create_string_buffer
(
bufferSize
)
.
raw
while
not
self
.
_bDie
:
inform
(
"Polling Q"
)
self
.
messageReceivedType
=
PA
.
RetrieveMessageFromQueue
(
self
.
_msgQueue
,
bufferSize
,
self
.
_pMem
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment