예제 #1
0
import sys
import time
import DAN
import requests
import os

sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient
import custom

client = BridgeClient()

custom.profile_init()
odf_list = custom.odf()
idf_list = custom.idf()

DAN.profile['df_list'] = [t[0] for t in idf_list]

for t in odf_list:
    if t[0] not in DAN.profile['df_list']:
        DAN.profile['df_list'].append(t[0])

print('Detected features:')
for f_name in DAN.profile['df_list']:
    print('    {}'.format(f_name))
'''def LED_flash(LED_state):
    if LED_state:
        client.put('Reg_done', '1')
        os.system(r'echo "timer" > /sys/class/leds/ds:green:usb/trigger')      #For ArduinoYun Only. LED Blink.
    else:
        client.put('Reg_done', '0')
예제 #2
0
from functools import partial
from uuid import getnode
import time, sys, os, Queue
from dan import NoData
import custom

sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient

idfInfo = custom.idf()
odfInfo = custom.odf()
ODFcache = {}
IDFcache = {}
IDFsignal = {}
odf2Bridge = {}
incomming = {}
for f_name in [t[0] for t in odfInfo]:
    incomming[f_name] = 0
timestamp = time.time()

os.system(r'echo "none" > /sys/class/leds/ds:green:usb/trigger')
os.system(r'echo "none" > /sys/class/leds/ds:green:wlan/trigger')


class app(dict):
    global ODFcache, IDFcache, odf2Bridge

    api_url = custom.ServerIP
    device_name = custom.device_name
    device_model = custom.device_model
    device_addr = "{:012X}".format(getnode())
예제 #3
0
파일: DAI.py 프로젝트: IoTtalk/CameraPT
import sys
import time
import DAN
import requests
import os

sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient
import custom

client = BridgeClient()

custom.profile_init()
odf_list = custom.odf()
idf_list = custom.idf()

DAN.profile['df_list'] = [t[0] for t in idf_list]

for t in odf_list:
    if t[0] not in DAN.profile['df_list']:
        DAN.profile['df_list'].append(t[0])

print('Detected features:')
for f_name in DAN.profile['df_list']:
    print('    {}'.format(f_name))


def LED_flash(LED_state):
    if LED_state:
        client.put('Reg_done', '1')
        os.system(r'echo "timer" > /sys/class/leds/arduino:white:usb/trigger')      #For ArduinoYun Only. LED Blink.