diff --git a/README.md b/README.md index 3b75ea6..ed6d726 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ This printer uses Bluetooth LE (GATT) to send labels & retrieve its status. It d `2b3d` part in the UUID may not be future-proof, but so far all produced printers of the same model seems to share the same UUID. -To discover the nearby printers, filter for the service UUID or/and check for the MAC address range. This printer has a MAC address in range of `58:CF:79:00:00:00` and `58:CF:79:FF:FF:FF`, which this MAC range block seems to be owned by Espressif Inc. according to Bluetooth vendor list. +To discover the nearby printers, filter for the service UUID or/and check for the MAC address range. This printer has a MAC address in range of `58:CF:79:00:00:00` and `58:CF:79:FF:FF:FF` or `DC:54:75:00:00:00` and `DC:54:75:FF:FF:FF`, which these MAC ranges block seems to be owned by Espressif Inc. according to Bluetooth vendor list. All data structures are explained below so it can be used as a future reference. @@ -287,4 +287,4 @@ RESULT[3] = 1B 52 + STATUS[1] ## Extras -The printer will automatically print its MAC address if power button was pressed long. \ No newline at end of file +The printer will automatically print its MAC address if power button was pressed long. diff --git a/dymo_bluetooth/bluetooth.py b/dymo_bluetooth/bluetooth.py index 32dc482..f28235e 100644 --- a/dymo_bluetooth/bluetooth.py +++ b/dymo_bluetooth/bluetooth.py @@ -48,6 +48,11 @@ def is_espressif(mac : str): start_block = 0x58_CF_79 << 24 end_block = start_block + (1 << 24) # Exclusive mac_value = int(mac.replace(":", ""), base = 16) + if (mac_value >= start_block) and (mac_value < end_block): + return True + start_block = 0xDC_54_75 << 24 + end_block = start_block + (1 << 24) # Exclusive + mac_value = int(mac.replace(":", ""), base = 16) if (mac_value >= start_block) and (mac_value < end_block): return True return False @@ -181,4 +186,4 @@ def create_code_128(text : str): imwrite = ImageWriter() imwrite.dpi = 200 code = Code128(text, writer = imwrite) - return convert_image_to_canvas(code.render(text = ""), dither = False, trim = True) \ No newline at end of file + return convert_image_to_canvas(code.render(text = ""), dither = False, trim = True)