def get_block(self, code_word, count): d = [] tmk.bcputw(0, code_word) for i in range(count): tmk.bcputw(i + 1, 0) self.logfun(tmk.bcstart, 0, 0, tmk.DATA_RT_BC) sleep(0.01) for i in range(count): d.append(tmk.bcgetw(i + 2)) return tuple(d)
def send_block(self, code_word, data): tmk.bcputw(0, code_word) for i in range(len(data)): tmk.bcputw(i + 1, data[i]) tmk.bcputw(len(data) + 1, 0xFFFF) self.logfun(tmk.bcstart, 0, 0, tmk.DATA_BC_RT) sleep(0.01)