I2cBusExtensions.PerformBusScan Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| PerformBusScan(I2cBus, Int32, Int32) |
Performs a scan on the I2C bus, returning the addresses for all connected devices. |
| PerformBusScan(I2cBus, IProgress<Single>, Int32, Int32) |
Performs a scan on the I2C bus, returning the addresses for all connected devices. |
PerformBusScan(I2cBus, Int32, Int32)
Performs a scan on the I2C bus, returning the addresses for all connected devices.
public static System.Collections.Generic.List<int> PerformBusScan(this System.Device.I2c.I2cBus bus, int lowest = 3, int highest = 119);
static member PerformBusScan : System.Device.I2c.I2cBus * int * int -> System.Collections.Generic.List<int>
<Extension()>
Public Function PerformBusScan (bus As I2cBus, Optional lowest As Integer = 3, Optional highest As Integer = 119) As List(Of Integer)
Parameters
- bus
- I2cBus
The bus to scan
- lowest
- Int32
The lowest address to scan. Default 0x03
- highest
- Int32
The highest address to scan. Default 0x77
Returns
A list of bus addresses that are in use, an empty list if no device was found
Remarks
This method should never throw an exception. Bus scanning may interfere with normal device operation, so this should not be done while devices are being used.
Applies to
PerformBusScan(I2cBus, IProgress<Single>, Int32, Int32)
Performs a scan on the I2C bus, returning the addresses for all connected devices.
public static(System.Collections.Generic.List<int> FoundDevices, int LowestAddress, int HighestAddress) PerformBusScan(this System.Device.I2c.I2cBus bus, IProgress<float>? progress, int lowestAddress = 3, int highestAddress = 119);
static member PerformBusScan : System.Device.I2c.I2cBus * IProgress<single> * int * int -> ValueTuple<System.Collections.Generic.List<int>, int, int>
<Extension()>
Public Function PerformBusScan (bus As I2cBus, progress As IProgress(Of Single), Optional lowestAddress As Integer = 3, Optional highestAddress As Integer = 119) As ValueTuple(Of List(Of Integer), Integer, Integer)
Parameters
- bus
- I2cBus
The bus to scan
- lowestAddress
- Int32
The lowest address to scan. Default 0x03
- highestAddress
- Int32
The highest address to scan. Default 0x77
Returns
A list of bus addresses that are in use, an empty list if no device was found
Remarks
This method should never throw an exception. Bus scanning may interfere with normal device operation, so this should not be done while devices are being used.