-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayer1.py
More file actions
26 lines (21 loc) · 795 Bytes
/
layer1.py
File metadata and controls
26 lines (21 loc) · 795 Bytes
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
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Layer1
import threading, subprocess, os
from config import *
class Layer1(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.daemon=True
self.tocontinue=True
self.flashed=False
def run(self):
print "Launching Layer1..."
p = subprocess.Popen([os.path.join(INSTALL_PATH,'osmocom-bb/src/host/osmocon/osmocon'),'-p','/dev/ttyUSB0','-m','c123xor',os.path.join(INSTALL_PATH,'osmocom-bb/src/target/firmware/board/compal_e88/layer1.compalram.bin')], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p.stdin.close()
l = p.stdout.readline()
while l!=None and self.tocontinue:
#print l,
if 'OSMOCOM Layer 1' in l: self.flashed=True
l=p.stdout.readline()
print 'Layer1 finished!'