ibeacon UUID

    import sys;
    import uuid;
    s=uuid.uuid4().hex
    #s="f6bc15e0939046679be1866ec8a199dc"
    sys.stdout.write("UUID:\t\t"+s+"\n")
    sys.stdout.write("Proximity UUID:\t"+s[0:8]+'-'+s[8:12]+'-'+s[12:16]+'-'+s[16:20]+'-'+s[20:]+"\n")
    sys.stdout.write("Cmd:\t\thcitool -i hci0 cmd 0x08 0x0008 1E 02 01 1A 1A FF 4C 00 02 15 "+
        s[0:2]  +' '+s[2:4]  +' '+s[4:6]  +' '+s[6:8]  +' '+
        s[8:10] +' '+s[10:12]+' '+s[12:14]+' '+s[14:16]+' '+
        s[16:18]+' '+s[18:20]+' '+s[20:22]+' '+s[22:24]+' '+
        s[24:26]+' '+s[26:28]+' '+s[28:30]+' '+s[30:32]+' '+
        "00 00 00 00 C8 00\n")

 

posted on 2017-01-26 16:54  与非朋仔  阅读(975)  评论(0编辑  收藏  举报

导航