def _make_str(self, container):
     data = parse_hexstring(container.src_data.data)
     e_type = ERR[data[0]]
     errnum = data[1]
     wide_error = (data[2] << 8) + data[3]
     context = container.src_data._asdict()
     context['message'] = '{}(Type={}, Num={}, Wide={})'.format(self.name, e_type, errnum, wide_error)
     return STR_TEMPLATE.format(**context)
Exemplo n.º 2
0
 def _make_str(self, container):
     evts = []
     for e in parse_hexstring(container.src_data.data):
         if not e:
             continue
         evts.append(self.data.get(e, str(e)))
     context = container.src_data._asdict()
     context['message'] = '{}({})'.format(self.name, ','.join(evts))
     return STR_TEMPLATE.format(**context)
 def _make_str(self, container):
     data = parse_hexstring(container.src_data.data)
     context = container.src_data._asdict()
     context['message'] = '{}({})'.format(self.name, SYNC[data[0]])
     return STR_TEMPLATE.format(**context)
Exemplo n.º 4
0
 def _make_str(self, container):
     data = parse_hexstring(container.src_data.data)
     context = container.src_data._asdict()
     context['message'] = '{}(Type={}, BlockNum={})'.format(
         self.name, BLOCK[data[0]], data[1])
     return STR_TEMPLATE.format(**context)
 def _make_str(self, container):
     data = parse_hexstring(container.src_data.data)
     struct = self._parse_params(data)
     context = container.src_data._asdict()
     context['message'] = '{}({})'.format(self.name, self._make_dict_str(struct))
     return STR_TEMPLATE.format(**context)
 def _make_str(self, container):
     data = parse_hexstring(container.src_data.data)
     remain_time = (data[0] << 8) + data[1]
     context = container.src_data._asdict()
     context['message'] = '{}({})'.format(self.name, remain_time)
     return STR_TEMPLATE.format(**context)