Interpreting logs

Hi

I am looking into modofying an existing BLE addon, so it can support a new type of device…

In my home-assistant log, I have this line:

2023-07-29 16:28:12.117 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] bathroom-bluetooth-proxy (c0:49:ef:65:1b:c8) [connectable]: EC:E0:26:98:92:79 AdvertisementData(local_name=‘ORAS’, manufacturer_data={305: b’\x00d\x002111007935\x00 '}, tx_power=-127, rssi=-97) match: set()

But I am not sure how to interpret the manufacturer data being listed… What is the “305”, and as some data is prefixed with “\x” I am unsure on how to read it…

Can anyone give me a brief intro ? :wink:

Regards

Look here at the HA bluetooth api code and you will see manufacturer data is a

manufacturer_data: Dict[_int, bytes]

Code link … https://github.com/home-assistant-libs/home-assistant-bluetooth/blob/b80b2aa434637d7537e9979e7aa90f0d083ca5d5/src/home_assistant_bluetooth/models.py

You will also see in this code, the manufacturer name is derived from the bleak python module.

@property
    def manufacturer(self) -> Optional[str]:
        """Convert manufacturer data to a string."""
        from bleak.backends._manufacturers import (
            MANUFACTURERS,  # pylint: disable=import-outside-toplevel
        )

        for manufacturer in self.manufacturer_data:
            if manufacturer in MANUFACTURERS:
                name: str = MANUFACTURERS[manufacturer]
                return name
        return None

Showing it looks up the int part of the manufacturer data in the manufacturers constant from bleak.

These are in hex so you have to convert your int to see if it is listed. 305 is 0x0131 which in this constant is 0x0131: “Cypress Semiconductor”,

1 Like