Exemple #1
0
	def BleScan(self):

		print "Scanning..."
		
		PKT_QUEUE = Blecontrl.ble_scan(self.sock)
		
		
		while not PKT_QUEUE.empty():
			Str = Blecontrl.parse_events(PKT_QUEUE)
			#print len(Str)
			if len(Str) == 7 :
				self.l_device.append(Str)
			elif len(Str) == 6:
				self.l_beacon.append(Str)
				
		print "Scan Finish."
		#print "Result: "
		#print 'Devices',
		#print '\n\t'.join([repr(x) for x in l_device])
		#print 'Beacons',
		#print '\n\t'.join([repr(x) for x in l_beacon])
		return len(self.l_beacon)+len(self.l_device)
Exemple #2
0
	def __init__(self):
		self.l_device = []
		self.l_beacon = []
		self.sock = Blecontrl.init_ble()
		self.name = "User9"
Exemple #3
0
	def BleAdvertise(self,cx,cy,stdev,floor,tvalue):
		print "Advertising..."
		Blecontrl.ble_adv(self.name,cx,cy,stdev,floor,tvalue)
		print "Advertise Finish"