question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make RaspberryBoardInfo public

See original GitHub issue

Is your feature request related to a problem? Please describe.

I’d like to be able to get an information about the device that my code is running on. I see that the RaspberryBoardInfo class is internal (https://github.com/dotnet/iot/blob/54469318f33124e3455bf974e6a75167dfb831e6/src/System.Device.Gpio/System/Device/Gpio/RaspberryBoardInfo.cs).

Describe the ideal solution

Either RaspberryBoardInfo should be public or any other way of getting information about the device model should be retrievable.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
joperezrcommented, Sep 9, 2021

@marcinjahn The big problem about making this type public, is that it lives in System.Device.Gpio library, which is a library that has full support and backwards compat guarantees which makes us uncomfortable to ship an API that a) only works on a RaspberryPi and b) the RaspberryPi must be running Raspbian for it to work. It is also an API that haven’t gone through the full design review process (because it is just internal) so it is not ready to be shipped in System.Device.Gpio. That said, I can propose two alternatives here:

  1. We could ship this API publicly in Iot.Device.Bindings library. This package, contrary to System.Device.Gpio, doesn’t have the same level of support or guarantees so it allows us to change the API after shipping it publicly there. This will allow consumers to use the type and contribute to its logic to help fine-tuning it. We would still ship an internal version in System.Device.Gpio which we would use there, but consumers would now be able to get access to it via Iot.Device.Bindings.
  2. We could suggest you using reflection to call the internal type in your code. Of course Reflection has it’s down sides, like performance or a very fragile link that could be easily broken (given you would be doing private reflection) but that is an alternative that could work as well.
0reactions
joperezrcommented, Sep 9, 2021

I see, yeah if you want to manually read cpuinfo yourself then that’s fine and I guess we don’t need to take any of the two approaches I suggested above and keep the type internal only. That probably also means that we can close this issue for now. If you still think that exposing this type as-is via Iot.Device.Bindings package would be valuable, let us know and we can re-open this and consider that option. Change should be trivial.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RaspberryPi3Driver.cs
This repo includes .NET Core implementations for various IoT boards, chips, displays and PCBs. - iot/src/System.Device.
Read more >
Raspberry Pi Model 3A+ Throws exception when trying to ...
using the System.Device.Gpio assembly fails on Raspberry Pi Model 3A+, same code works as expected on Raspberry Pi Model 4B.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found