|
|
@ -97,6 +97,8 @@ def disconnect(): |
|
|
|
print("Received Disconnect message from %s" % sid) |
|
|
|
leave_room(ROOM) |
|
|
|
webrtccamera.disconnect_client(sid, ROOM) |
|
|
|
from roberto import serial |
|
|
|
serial.del_callback('B', display_battery) |
|
|
|
|
|
|
|
@socketio.on('connect', namespace='/webrtc') |
|
|
|
def connect(): |
|
|
@ -104,6 +106,8 @@ def connect(): |
|
|
|
print("Received Connect message from %s" % sid) |
|
|
|
join_room(ROOM) |
|
|
|
webrtccamera.connect_client(sid, ROOM) |
|
|
|
from roberto import serial |
|
|
|
serial.add_callback('B', display_battery) |
|
|
|
|
|
|
|
@socketio.on_error_default |
|
|
|
def default_error_handler(e): |
|
|
@ -113,3 +117,6 @@ def default_error_handler(e): |
|
|
|
keys.sort() |
|
|
|
for key in request: |
|
|
|
print('%s: %s' % (key, repr(request[key]))) |
|
|
|
|
|
|
|
def display_battery(val): |
|
|
|
socketio.emit('battery', data=val, room=ROOM, namespace='/webrtc') |
|
|
|