Ejemplo n.º 1
0
    def hackBuffer(self, index, buffer):
        data_0x10 = {
            1: [0x20, 0x00, 0x6e, 0xea, 0x00, 0x00, 0x01, 0xbc],
            2: [0x20, 0x00, 0x6d, 0xea, 0x00, 0x00, 0x81, 0x77],
            3: [0x20, 0x00, 0x6a, 0xea, 0x00, 0x00, 0xb1, 0xf3],
            4: [0x20, 0x00, 0x69, 0xea, 0x00, 0x00, 0x74, 0xfa],
            5: [0x20, 0x00, 0x6b, 0xea, 0x00, 0x00, 0x7c, 0x3e],
            6: [0x20, 0x00, 0x6f, 0xea, 0x00, 0x00, 0x14, 0xde],
            7: [0x20, 0x00, 0x70, 0xea, 0x00, 0x00, 0x35, 0xa1],
            8: [0x20, 0x00, 0x6c, 0xea, 0x00, 0x00, 0x3f, 0x2c],
            40: [0x2e, 0x00, 0xaa, 0xeb, 0x00, 0x00, 0x68,
                 0xf1],  #gts 0xaa, 0x68, 0xf1 may vary
            47: [0x28, 0x00, 0x8c, 0xea, 0x00, 0x00, 0x01, 0xbc],  # gtr 47
            42: [0x2a, 0x00, 0x72, 0xeb, 0x00, 0x00, 0x5c, 0xd3],  # gtr 42
        }

        if Config.isGtrMode():
            index = Config.isGtrMode()
        if Config.isGtsMode():
            index = Config.isGtsMode()
        p_0x10 = data_0x10[index]
        for i in range(len(p_0x10)):
            buffer[0x10 + i] = p_0x10[i]
        # hard coding?
        buffer[60:60 + 4] = int(64).to_bytes(4, byteorder='little')
Ejemplo n.º 2
0
 def hackBuffer(self, index, buffer):
     data_0x10 = {
         1 : [0x20, 0x00, 0x6e, 0xea, 0x00, 0x00, 0x01, 0xbc],
         2 : [0x20, 0x00, 0x6d, 0xea, 0x00, 0x00, 0x81, 0x77],
         3 : [0x20, 0x00, 0x6a, 0xea, 0x00, 0x00, 0xb1, 0xf3],
         4 : [0x20, 0x00, 0x69, 0xea, 0x00, 0x00, 0x74, 0xfa],
         5 : [0x20, 0x00, 0x6b, 0xea, 0x00, 0x00, 0x7c, 0x3e],
         6 : [0x20, 0x00, 0x6f, 0xea, 0x00, 0x00, 0x14, 0xde],
         7 : [0x20, 0x00, 0x70, 0xea, 0x00, 0x00, 0x35, 0xa1],
         8 : [0x20, 0x00, 0x6c, 0xea, 0x00, 0x00, 0x3f, 0x2c],
         9 : [0x28, 0x00, 0x8c, 0xea, 0x00, 0x00, 0x01, 0xbc], # gtr only (by manelto)
         # from https://github.com/amazfitbip/py_amazfit_tools
         40 : [0x2e, 0x00, 0xaa, 0xeb, 0x00, 0x00, 0x68, 0xf1], #gts 0xaa, 0x68, 0xf1 may vary
     }
     if Config.isGtrMode():
         index = 9
     if Config.isGtsMode():
         index = 40
     p_0x10 = data_0x10[index]
     for i in range(len(p_0x10)):
         buffer[0x10 + i] = p_0x10[i]
     # hard coding?
     buffer[60:60+4] = int(64).to_bytes(4, byteorder='little')