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