python-osc for python3

Esse commit está contido em:
micuat
2017-06-18 22:37:43 +00:00
commit 2be559064a
2 arquivos alterados com 12 adições e 14 exclusões
Arquivo normal → Arquivo executável
+9 -11
Ver Arquivo
@@ -1,6 +1,7 @@
# requires pyosc
from OSC import OSCClient, OSCMessage
# requires python-osc
from pythonosc import osc_message_builder
from pythonosc import udp_client
import plugin_interface as plugintypes
# Use OSC protocol to broadcast data (UDP layer), using "/openbci" stream. (NB. does not check numbers of channel as TCP server)
@@ -31,26 +32,23 @@ class StreamerOSC(plugintypes.IPluginExtended):
if len(self.args) > 2:
self.address = self.args[2]
# init network
print "Selecting OSC streaming. IP: ", self.ip, ", port: ", self.port, ", address: ", self.address
self.client = OSCClient()
self.client.connect( (self.ip, self.port) )
print("Selecting OSC streaming. IP: " + self.ip + ", port: " + str(self.port) + ", address: " + self.address)
self.client = udp_client.SimpleUDPClient(self.ip, self.port)
# From IPlugin: close connections, send message to client
def deactivate(self):
self.client.send(OSCMessage("/quit") )
self.client.send_message("/quit")
# send channels values
def __call__(self, sample):
mes = OSCMessage(self.address)
mes.append(sample.channel_data)
# silently pass if connection drops
try:
self.client.send(mes)
self.client.send_message(self.address, sample.channel_data)
except:
return
def show_help(self):
print """Optional arguments: [ip [port [address]]]
print("""Optional arguments: [ip [port [address]]]
\t ip: target IP address (default: 'localhost')
\t port: target port (default: 12345)
\t address: select target address (default: '/openbci')"""
\t address: select target address (default: '/openbci')""")
Arquivo normal → Arquivo executável
+1 -1
Ver Arquivo
@@ -1,6 +1,6 @@
numpy==1.9.2
pylsl==1.10.4
pyOSC==0.3.5b-5294
python-osc==1.6.3
pyserial==2.7
requests==2.7.0
six==1.9.0