Esempio n. 1
0
def main():

    print("Starting up.")  #debug

    #instantiate new RiskbandApp obj & start it
    app = PifiApp()

    app.login()
    app.getUserByBluetooth('JSOINDFLISHDFLJSLIDF')
    trackUrl = app.getTrack('2daZovie6pc2ZK7StayD1K')
    app.playTrack(trackUrl)
def main():

    print("Starting up.") #debug

    #instantiate new RiskbandApp obj & start it
    app = PifiApp()

    app.login()
    app.getUserByBluetooth('JSOINDFLISHDFLJSLIDF')
    trackUrl = app.getTrack('2daZovie6pc2ZK7StayD1K')
    app.playTrack(trackUrl)
            print " "

    #send off the data

    # restore old filter
    sock.setsockopt(bluez.SOL_HCI, bluez.HCI_FILTER, old_filter)

    return results


def playSoundIfNecessary(arg):
    for i in range(arg):
        print "running"


pifi = PifiApp()
pifi.login()

while (True):
    dev_id = 0
    try:
        sock = bluez.hci_open_dev(dev_id)
    except:
        print "error accessing bluetooth device..."
        sys.exit(1)

    try:
        mode = read_inquiry_mode(sock)
    except Exception, e:
        print "error reading inquiry mode.  "
        print "Are you sure this a bluetooth 1.2 device?"
        else:
            print " "

    #send off the data 


    # restore old filter
    sock.setsockopt( bluez.SOL_HCI, bluez.HCI_FILTER, old_filter )

    return results

def playSoundIfNecessary(arg):
    for i in range(arg):
        print "running"

pifi = PifiApp()
pifi.login()

while (True):
    dev_id = 0
    try:
        sock = bluez.hci_open_dev(dev_id)
    except:
        print "error accessing bluetooth device..."
        sys.exit(1)

    try:
        mode = read_inquiry_mode(sock)
    except Exception, e:
        print "error reading inquiry mode.  "
        print "Are you sure this a bluetooth 1.2 device?"