<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _new_packet_cb(self, pk):
 """Callback for newly arrived packets"""

        if pk.channel == READ_CHANNEL or pk.channel == WRITE_CHANNEL:
            if self._useV2:
                var_id = struct.unpack('<H', pk.data[:2])[0]
                if pk.channel == READ_CHANNEL:
                    pk.data = pk.data[:2] + pk.data[3:]
            else:
                var_id = pk.data[0]
            if (pk.channel != TOC_CHANNEL and self._req_param == var_id and
                    pk is not None):
                self.updated_callback(pk)
                self._req_param = -1
                try:
                    self.wait_lock.release()
                except Exception:
                    pass