示例#1
0
 def testEstablishEx(self):
     """ When the dongle uses establishEx, he doesn't read back on the
         ctrl channel """
     global FitbitClient
     FitbitClient = type('FitbitClient', (MyDongle, ),
                         dict(FitbitClient.__dict__))
     c = FitbitClient([
         (0xc0, 0x14, 0xc, 1, 0, 0, 0, 0, 42, 0, 0, 0),
     ])
     c.useEstablishLinkEx = True
     t = MyTracker()
     t.id = bytearray([0, 0, 42, 0, 0, 0])
     self.assertTrue(c.initializeAirlink(t))
示例#2
0
 def testestablishLinkExOk(self):
     global FitbitClient
     FitbitClient = type('FitbitClient', (MyDongle, ),
                         dict(FitbitClient.__dict__))
     c = FitbitClient([
         (0x20, 1, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6C, 0x69, 0x73, 0x68,
          0x4C, 0x69, 0x6E, 0x6B, 0x45, 0x78, 0x20, 0x63, 0x61, 0x6C, 0x6C,
          0x65, 0x64, 0x2E, 0x2E, 0x2E, 0x00),
         (3, 4, 0),
         (0x20, 1, 0x47, 0x41, 0x50, 0x5F, 0x4C, 0x49, 0x4E, 0x4B, 0x5F,
          0x45, 0x53, 0x54, 0x41, 0x42, 0x4C, 0x49, 0x53, 0x48, 0x45, 0x44,
          0x5F, 0x45, 0x56, 0x45, 0x4E, 0x54, 0),
         (2, 7),
     ])
     c.useEstablishLinkEx = True
     t = MyTracker()
     t.id = bytearray([0, 0, 42, 0, 0, 43])
     t.addrType = 1
     self.assertTrue(c.establishLink(t))