Platforms to show: All Mac Windows Linux Cross-Platform

Back to IORegistryMBS module.

IORegistryMBS.AudioRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the Audio tree inside the IO Registry.

Some examples using this method:

IORegistryMBS.DeviceRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the Device tree inside the IO Registry.

Some examples using this method:

IORegistryMBS.FirewireRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the Firewire tree inside the IO Registry.

Some examples using this method:

IORegistryMBS.MatchingServices(servicename as string) as IORegistryNodeMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the nodes matching the servicename.
Example
// search for Serial devices
dim devices() as IORegistryNodeMBS = IORegistryMBS.MatchingServices("IOSerialBSDClient")
dim names(-1) as string

// check devices and query names
for each dev as IORegistryNodeMBS in devices
dim dic as Dictionary = dev.Properties
names.Append dic.Lookup("IOTTYBaseName","")
next

// show all names
MsgBox Join(names,EndOfLine)

Some examples using this method:

IORegistryMBS.PerformanceStatistics(index as Integer = 0) as Dictionary

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 15.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Queries performance statistics for first graphics card on a Mac.
Example
dim d as Dictionary = IORegistryMBS.PerformanceStatistics

if d <> nil then

dim gpuCoreUse as Int64 = d.Value("GPU Core Utilization")
dim freeVramCount as Int64 = d.Value("vramFreeBytes")
dim usedVramCount as Int64 = d.Value("vramUsedBytes")

dim sum as int64 = (freeVramCount+usedVramCount)

List.AddRow format(gpuCoreUse/1000000000.0, "0%"), Format(freeVramCount/1024.0/1024.0, "0")+" MB of "+Format(sum/1024.0/1024.0, "0")+" MB", Format(usedVramCount / sum, "0%")
list.ScrollPosition = list.ListCount
else
Break
end if

The dictionary contains details about performance of graphics card.
This includes vramFreeBytes and vramUsedBytes for memory usage as well as "GPU Core Utilization" key with GPU time used.
Returns nil on any error.

Index is zero for first graphics card.
Or 1 for second graphics card.

Some examples using this method:

IORegistryMBS.PowerRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the Power tree inside the IO Registry.

Some examples using this method:

IORegistryMBS.Present as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Is the IORegistryMBS working?

Returns true on Mac OS X and false on other platforms.

IORegistryMBS.Root(plane as string) as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the IORegistry tree with the given plane name.
Example
// shows names of all USB devices
dim u as IORegistryNodeMBS = IORegistryMBS.Root("IOUSB") // same as USBRoot function

// now loop over all devices with all children (non recursive)
dim names(-1) as string
dim nodes(-1) as IORegistryNodeMBS = array(u)

while UBound(nodes)>=0
dim p as IORegistryNodeMBS = nodes.pop

names.Append p.Name
for each c as IORegistryNodeMBS in p.Children
nodes.Append c
next
wend

// and display array with names
MsgBox Join(names,EndOfLine)

IORegistryMBS.ServiceRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the Service tree inside the IO Registry.

Some examples using this method:

IORegistryMBS.USBRoot as IORegistryNodeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method IO Registry MBS MacCF Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the root of the USB tree inside the IO Registry.
Example
// shows names of all USB devices
dim u as IORegistryNodeMBS = IORegistryMBS.USBRoot

// now loop over all devices with all children (non recursive)
dim names(-1) as string
dim nodes(-1) as IORegistryNodeMBS = array(u)

while UBound(nodes)>=0
dim p as IORegistryNodeMBS = nodes.pop

names.Append p.Name
for each c as IORegistryNodeMBS in p.Children
nodes.Append c
next
wend

// and display array with names
MsgBox Join(names,EndOfLine)

Some examples using this method:

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...