예제 #1
0
파일: radio.py 프로젝트: adobekan/bramble
def radioChannel():
    try:
        ips = get_radio_ip()
    except (ValueError, subprocess.CalledProcessError):
        return jsonify(status = 'error')

    if request.method == 'POST':
        coap.post('coap://[%s]/config?param=channel' % (ips['addrs'][0]), request.json['channel'])
        load_radio()
        return jsonify(status = 'ok')
    else: # GET
        return coap.get('coap://[%s]/config?param=channel' % (ips['addrs'][0]))
예제 #2
0
파일: radio.py 프로젝트: zzuzpb/bramble
def radioChannel():
    try:
        ip = get_radio_not_local_ip()
    except (ValueError, subprocess.CalledProcessError):
        return jsonify(status='error')

    if request.method == 'POST':
        coap.post('coap://[%s]/config?param=channel' % (ip),
                  request.json['channel'])
        load_radio()
        return jsonify(status='ok')
    else:  # GET
        return str(get_radio_channel)
예제 #3
0
파일: radio.py 프로젝트: zzuzpb/bramble
def setSerial(serial):
    ip = get_radio_not_local_ip()
    coap.post('coap://[%s]/config?param=serial' % (ip), serial)
예제 #4
0
파일: radio.py 프로젝트: kevinxusz/bramble
def setSerial(serial):
    ip = get_radio_not_local_ip()
    coap.post('coap://[%s]/config?param=serial' % (ip), serial)