Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

Fixes #2387

This PR completely removes the PinNumberingScheme enum and all references to it throughout the codebase, as it was obsoleted in the last major release and is no longer needed.

Changes Made

Core Library Changes

  • Deleted PinNumberingScheme.cs entirely
  • Removed obsolete constructors from GpioController:
    • GpioController(PinNumberingScheme numberingScheme)
    • GpioController(PinNumberingScheme numberingScheme, GpioDriver driver)
  • Removed the obsolete NumberingScheme property from GpioController
  • Simplified GetLogicalPinNumber() method to always use logical numbering (no conversion needed)

Updated Samples and Documentation

  • Updated 3 sample files to remove PinNumberingScheme constructor parameters
  • Updated 11 README files across device bindings to remove PinNumberingScheme references
  • Removed obsolete test methods that were testing Board numbering scheme functionality

API Impact

This is a breaking change only for code that was explicitly using the obsolete Board numbering scheme. The vast majority of existing code will continue to work unchanged because:

  • The default constructor GpioController() still works and defaults to logical numbering
  • The GpioController(GpioDriver driver) constructor continues to work as before
  • All pin operations maintain the same behavior for logical numbering (the recommended approach)

Migration for Board Numbering Users

Users who were using Board numbering can:

  1. Switch to logical numbering (recommended)
  2. Manually convert pin numbers using driver-specific mapping functions where available

Before/After Examples

Before (obsolete usage):

// This will no longer compile
var controller = new GpioController(PinNumberingScheme.Board, new OrangePiZeroDriver());

After (recommended usage):

// Simplified - always uses logical numbering
var controller = new GpioController(new OrangePiZeroDriver());

This change eliminates the complexity of dual numbering schemes while maintaining full functionality for the recommended logical numbering approach.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1k9vsblobprodcus379.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • 4vyvsblobprodcus361.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • 4zjvsblobprodcus390.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • 6s7vsblobprodcus313.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • 80zvsblobprodcus35.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • c78vsblobprodcus322.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • ckzvsblobprodcus347.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • dlbvsblobprodcus316.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot//.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/iot/iot/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/iot/iot/artifacts/toolset/8.0.0-beta.25378.1.txt (dns block)
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build --no-restore --verbosity minimal (dns block)
  • fdpvsblobprodcus345.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • h6tvsblobprodcus346.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • m16vsblobprodcus374.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • m6xvsblobprodcus342.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • o3svsblobprodcus318.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • pe3vsblobprodcus354.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • pkvvsblobprodcus321.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • s4uvsblobprodcus326.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)
  • ytvvsblobprodcus310.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/iot/iot/.dotnet/dotnet build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Microsoft Reviewers: Open in CodeFlow

@dotnet-policy-service dotnet-policy-service bot added area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio labels Sep 4, 2025
Copilot AI and others added 2 commits September 4, 2025 16:16
Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Remove PinNumberingScheme class and all references from codebase Remove obsolete PinNumberingScheme enum and all references Sep 4, 2025
@Copilot Copilot AI requested a review from joperezr September 4, 2025 16:26
Copilot finished work on behalf of joperezr September 4, 2025 16:26
@joperezr
Copy link
Member

joperezr commented Sep 4, 2025

cc: @raffaeler @krwq @pgrawehr does this look like what you were expecting?

@raffaeler
Copy link
Contributor

@joperezr I didn't review the code yet, but it is definitely a different story!
Apparently the previous PR go wrong because the copilot instructions were changed after the first interaction. Do you believe it is just that or did you change anything else?

Copy link
Contributor

@pgrawehr pgrawehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. A bit surprising how many PinNumberScheme.Board occurences in documentation(!) still had to be removed. But I guess the FTXXX driver didn't really care about that value anyway.

Copy link
Contributor

@raffaeler raffaeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed all the changes and they also looks good to me.

@raffaeler
Copy link
Contributor

@joperezr after your review, I believe we can merge this.
Anyway, we should not forget to introduce asap the virtual gpio which may greatly help anyone currently using PinNumberingScheme and willing to upgrade the library.

@joperezr
Copy link
Member

joperezr commented Sep 8, 2025

Changes look good to me, but I'm curious as to why this isn't throwing build errors due to breaking changes. I'll look into that first before merging.

@joperezr joperezr enabled auto-merge (squash) September 25, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finish removing PinNumberingScheme.Board
4 participants