1 |
dpavlin |
47 |
<html> |
2 |
|
|
<head> |
3 |
|
|
<title>3M RFID</title> |
4 |
|
|
<script type="text/javascript" src="jquery-1.3.2.min.js"></script> |
5 |
dpavlin |
52 |
<style type="text/css"> |
6 |
|
|
.status { |
7 |
|
|
background: #ff8; |
8 |
|
|
} |
9 |
dpavlin |
54 |
|
10 |
|
|
.da { |
11 |
|
|
background: #fcc; |
12 |
|
|
} |
13 |
|
|
|
14 |
|
|
.d7 { |
15 |
|
|
background: #cfc; |
16 |
|
|
} |
17 |
dpavlin |
52 |
</style> |
18 |
dpavlin |
47 |
<script type="text/javascript"> |
19 |
|
|
|
20 |
dpavlin |
55 |
function got_visible_tags(data,textStatus) { |
21 |
|
|
var html = 'No tags in range'; |
22 |
|
|
if ( data.tags ) { |
23 |
|
|
html = '<ul class="tags">'; |
24 |
|
|
$.each(data.tags, function(i,tag) { |
25 |
|
|
console.debug( i, tag ); |
26 |
|
|
html += '<li class=' + tag.security + '><tt>' + tag.sid + ' ' + tag.content + '</tt>'; |
27 |
|
|
}); |
28 |
|
|
html += '</ul>'; |
29 |
|
|
} |
30 |
|
|
html = '<div class=status>' |
31 |
|
|
+ textStatus |
32 |
|
|
+ '##########'.substr(0,data.time % 10) |
33 |
|
|
+ '</div>' |
34 |
|
|
+ html |
35 |
|
|
; |
36 |
|
|
$('#tags').html( html ); |
37 |
|
|
window.setTimeout(function(){ |
38 |
|
|
scan_tags(); |
39 |
|
|
},200); // re-scan every 200ms |
40 |
|
|
}; |
41 |
|
|
|
42 |
dpavlin |
47 |
function scan_tags() { |
43 |
|
|
console.info('scan_tags'); |
44 |
dpavlin |
55 |
$.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags); |
45 |
dpavlin |
47 |
} |
46 |
|
|
|
47 |
|
|
$(document).ready(function() { |
48 |
|
|
scan_tags(); |
49 |
|
|
}); |
50 |
|
|
</script> |
51 |
|
|
</head> |
52 |
|
|
<body> |
53 |
|
|
|
54 |
|
|
<h1>RFID tags in range</h1> |
55 |
|
|
|
56 |
|
|
<div id="tags"> |
57 |
|
|
RFID reader not found or driver program not started. |
58 |
|
|
</div> |
59 |
|
|
|
60 |
|
|
</body> |
61 |
|
|
</html> |