예제 #1
0
def lab_arduino_status(lab_id):
    laboratory = Laboratory.query.filter_by(id=lab_id).first()
    if laboratory is not None:
        all_arduino = get_all_arduino_laboratory(lab_id)
        result = check_list_arduino_connection(all_arduino)
        resp = jsonify(lab_name=laboratory.name, lab_id=laboratory.id,
                        all_arduino = result)
        resp.status_code = 200

        return resp
    return get_json_message(404, 'Lab not found.')
예제 #2
0
def all_arduino_status():
    all_arduino = Arduino.query.all()
    result = check_list_arduino_connection(all_arduino)
    resp = jsonify(results = result)
    resp.status_code = 200
    return resp