-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sensor service respin foundation implementation
Summary: ## General Idea Unlike PM respins where device creation order is sometimes required, sensors can be read in any orders (cc mikechoifb if wrong). We can afford to separate out the sensors for each versions to prevent config duplications as much as possible. Versions are separated by the following fields: * ProductProductionState * ProductVersion * ProductSubVersion Sensors defined in a version means they only exist in that version. This means sensors defined in PmSensor are common for all platform versions. If Sensor service discovers a set of sensors exist the particular version, it will reads their values along with common sensors. Sensor Service will know which set of sensors to read by comparing PmUnit's version against a list VersionedPmSensors. It will pick the largest VersionPmSensors which PmUnitVersions is greater than. ## PmUnitInfoFetcher As name suggests, fetches PmUnitInfo. How it will do, still undecided. So split out class for testing and modularization. For now, it will return null so Sensor service ignores versioned sensors. Reviewed By: mikechoifb Differential Revision: D61564795 fbshipit-source-id: d49d43a23f53389c31d21e222a9f12de85460797
- Loading branch information
1 parent
9f68006
commit 1b0a6fe
Showing
11 changed files
with
214 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
#include "fboss/platform/sensor_service/PmUnitInfoFetcher.h" | ||
|
||
namespace facebook::fboss::platform::sensor_service { | ||
std::optional<std::array<int16_t, 3>> PmUnitInfoFetcher::fetch( | ||
const std::string& /* slotPath */, | ||
const std::string& /* pmUnitName */) const { | ||
return std::nullopt; | ||
} | ||
} // namespace facebook::fboss::platform::sensor_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
|
||
#pragma once | ||
|
||
#include <array> | ||
#include <optional> | ||
#include <string> | ||
|
||
namespace facebook::fboss::platform::sensor_service { | ||
class PmUnitInfoFetcher { | ||
public: | ||
virtual ~PmUnitInfoFetcher() = default; | ||
// Returns {ProductProductionState,ProductVersion,ProductSubVersion} | ||
// TODO: Need to figure out how we're going to fetch (thrift? file? manual | ||
// eeprom reading?) | ||
virtual std::optional<std::array<int16_t, 3>> fetch( | ||
const std::string& slotPath, | ||
const std::string& pmUnitName) const; | ||
}; | ||
|
||
} // namespace facebook::fboss::platform::sensor_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters