Skip to content

Instantly share code, notes, and snippets.

@yosemitebandit
Created October 28, 2014 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yosemitebandit/835799c3a4a1321236cd to your computer and use it in GitHub Desktop.
Save yosemitebandit/835799c3a4a1321236cd to your computer and use it in GitHub Desktop.
''' communicating to openbts through zeromq
'''
import json
import zmq
address = 'tcp://127.0.0.1:45060'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(address)
payload = {
'target': 'openbts',
'command': 'config',
'action': 'read',
'key': ''
}
print 'request:', json.dumps(payload)
socket.send(json.dumps(payload))
response = socket.recv()
print 'response:', response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment