|
@ -89,7 +89,10 @@ def disconnect(): |
|
|
leave_room(ROOM) |
|
|
leave_room(ROOM) |
|
|
webrtccamera.disconnect_client(sid, ROOM) |
|
|
webrtccamera.disconnect_client(sid, ROOM) |
|
|
from roberto import serial |
|
|
from roberto import serial |
|
|
|
|
|
try: |
|
|
serial.del_callback('B', display_battery, sid) |
|
|
serial.del_callback('B', display_battery, sid) |
|
|
|
|
|
except: |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
@socketio.on('connect') |
|
|
@socketio.on('connect') |
|
|
def connect(): |
|
|
def connect(): |
|
@ -108,5 +111,6 @@ def default_error_handler(e): |
|
|
print('%s: %s' % (key, repr(request[key]))) |
|
|
print('%s: %s' % (key, repr(request[key]))) |
|
|
|
|
|
|
|
|
def display_battery(val, sid=ROOM): |
|
|
def display_battery(val, sid=ROOM): |
|
|
|
|
|
print("sending battery value %s to client %s" % (val, sid)) |
|
|
socketio.emit('battery', data=val, room=sid) |
|
|
socketio.emit('battery', data=val, room=sid) |
|
|
#socketio.emit('battery', data=val) |
|
|
#socketio.emit('battery', data=val) |
|
|