Community discussions

MikroTik App
 
User avatar
voljka
newbie
Topic Author
Posts: 27
Joined: Tue Oct 27, 2009 4:34 pm

Device type discovery by MAC prefix

Sun Apr 14, 2024 5:23 pm

Hello. Please look and maybe improve my solution, it works, but I think, it is not very pretty.

I want to discover Motorola DMR Repeaters and map them to specific device type.
These repeaters has several MAC OUI prefixes, issued to Texas Instrument company.
Solution:
1) Dude function to get MAC address, cut first three bytes and search them in OUI List, stored in same function.
2) Dude device probe, what used function from p.1

Realization:
1) Function "DMR Repeater MAC"
Description: Returns MAC prefix position if in TI OUI list.
string_find("TI OUI: 80:F5:B5 30:E2:83 60:E8:5B ", string_substring(device_property("MacAddressesColumn"),0,8),0)
Comment: Repeaters MAC address stored in Device.MacAddressesColumn. If first three bytes from it can be found in TI OUI, then function returns positive value, but if prefix not found, it returns 4294967295


2) Probe "MOTO DMR Repeater"
Type: Function
Compare method: ==(equal)
Integer value: 0
Available: DMR_Repeater_MAC() < "2048"
Error: if(DMR_Repeater_MAC() > 0, "", "down")
Comment: here "2048" is just a threshold to cut down result "4294967295", when DMR_Repeater_MAC() has not founds MAC prefix in TI OUI List.

Who is online

Users browsing this forum: No registered users and 0 guests