# Path: beacontools/utils.py
# def data_to_hexstring(data):
#     """Convert an array of binary data to the hex representation as a string."""
#     return hexlify(data_to_binstring(data)).decode('ascii')


from ..utils import data_to_hexstring
        """If beacon has a firmware problem.
        Only available if protocol version > 0, None otherwise."""
        return self._has_firmware_error

    @property
    def has_clock_error(self):
        """If beacon has a clock problem. Only available if protocol version > 0, None otherwise."""
        return self._has_clock_error

    @property
    def pressure(self):
        """Atmosperic pressure in Pascal. None if all bits are set.
        Only available if protocol version is 2, None otherwise ."""
        return self._pressure

    @property
    def properties(self):
        """Get beacon properties."""
        return {'identifier': self.identifier, 'protocol_version': self.protocol_version}

    def __str__(self):
        return "EstimoteTelemetryFrameA<identifier: %s, protocol_version: %u>" \
            % (self.identifier, self.protocol_version)


class EstimoteTelemetryFrameB(object):
    """Estimote telemetry subframe B."""

    def __init__(self, data, protocol_version):
        self._protocol_version = protocol_version

# Path: beacontools/utils.py
# def data_to_hexstring(data):
#     """Convert an array of binary data to the hex representation as a string."""
#     return hexlify(data_to_binstring(data)).decode('ascii')


# Path: beacontools/packet_types/estimote.py
from ..utils import data_to_hexstring

        """If beacon has a firmware problem.
        Only available if protocol version > 0, None otherwise."""
        return self._has_firmware_error

    @property
    def has_clock_error(self):
        """If beacon has a clock problem. Only available if protocol version > 0, None otherwise."""
        return self._has_clock_error

    @property
    def pressure(self):
        """Atmosperic pressure in Pascal. None if all bits are set.
        Only available if protocol version is 2, None otherwise ."""
        return self._pressure

    @property
    def properties(self):
        """Get beacon properties."""
        return {'identifier': self.identifier, 'protocol_version': self.protocol_version}

    def __str__(self):
        return "EstimoteTelemetryFrameA<identifier: %s, protocol_version: %u>" \
            % (self.identifier, self.protocol_version)


class EstimoteTelemetryFrameB(object):
    """Estimote telemetry subframe B."""

    def __init__(self, data, protocol_version):
        self._protocol_version = protocol_version

        self._identifier = data_to_hexstring(data['identifier'])