Add another possible mac range (#2)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							081d2fd617
						
					
				
				
					commit
					c9d465c644
				
			@@ -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.
 | 
			
		||||
The printer will automatically print its MAC address if power button was pressed long.
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
    return convert_image_to_canvas(code.render(text = ""), dither = False, trim = True)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user