<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hardware_status(self):
 """Retrieves and returns the hardware status. Args: self (JLink):
 the ``JLink`` instance Returns: A ``JLinkHardwareStatus`` describing the J-Link hardware. """

        stat = structs.JLinkHardwareStatus()
        res = self._dll.JLINKARM_GetHWStatus(ctypes.byref(stat))
        if res == 1:
            raise errors.JLinkException('Error in reading hardware status.')
        return stat