SilverThings / bulldog

Java GPIO Library for BeagleBoneBlack, Raspberry Pi and CubieBoard.
http://www.silverspoon.io
Apache License 2.0
49 stars 23 forks source link

Automatically detect platform and use appropriate board implementation #23

Closed sbunciak closed 9 years ago

sbunciak commented 9 years ago

Add decision making here: https://github.com/px3/bulldog/blob/devel/bulldog-core/src/main/java/io/silverspoon/bulldog/core/platform/Platform.java

and here: https://github.com/px3/bulldog/blob/devel/bulldog-board-raspberrypi/src/main/java/io/silverspoon/bulldog/raspberrypi/RaspberryPiBoardFactory.java

Only reliable way of detecting the target platform is probably decode /dev/mem and parse vendor.

sbunciak commented 9 years ago

Inspect MemoryMap. Here is how lshw retrieves vendor: http://ezix.org/source/packages/lshw/releases/B.02.17/src/core/dmi.cc

sbunciak commented 9 years ago

Generally speaking, investigate a way how to have 1 universal dependency that will detect the board and pick up just to correct implementation.

sbunciak commented 9 years ago

Implemented in https://github.com/px3/bulldog/commit/a971487a3c90b7387b8243c2d7cd8c7fe2e0b86e, @pmacik can you please test it on all supported platforms?

sbunciak commented 9 years ago

Verified, bulldog determines appropriate board implementation based on present HW.