Parse temperature sensors in gen_ipmi_sensor script
At present temperature sensors are added with hand coded
YAML file the same has been modified to auto-generate
by reading the MRW file.
Change-Id: I4d7294395305dba09bfb526682cb32977c79ee05
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
diff --git a/Util.pm b/Util.pm
index 396f056..57c82a2 100644
--- a/Util.pm
+++ b/Util.pm
@@ -43,6 +43,24 @@
return @units;
}
+#Returns size of child units based on their Type.
+# param[in] $targetObj = The Targets object
+# param[in] $type = The type of the units to find
+# param[in] $chip = The chip target to find the units on
+sub getSizeOfChildUnitsWithType
+{
+ my ($targetObj, $type, $chip) = @_;
+ my @units;
+ my @children = $targetObj->getAllTargetChildren($chip);
+ for my $child (@children) {
+ if ($targetObj->getType($child) eq $type) {
+ push @units, $child;
+ }
+ }
+ my $size = @units;
+ return $size;
+}
+
# Returns OBMC name corresponding to a Target name
# param[in] \@inventory = reference to array of inventory items
# param[in] $targetName = A Target name
@@ -155,6 +173,11 @@
Returns an array of targets that have target-type C<TargetType>
and are children (any level) of target C<ChipTarget>.
+=item getSizeOfChildUnitsWithType(C<TargetsObj>, C<Type>, C<ChipTarget>)
+
+Returns size of targets that have Type C<Type>
+and are children (any level) of target C<ChipTarget>.
+
=item getObmcName(C<InventoryItems>, C<TargetName>)
Returns an OBMC name corresponding to a Target name. Returns