1#!/usr/bin/env python3 2# 3# Copyright 2020 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import datetime 18 19from acts.controllers.fuchsia_lib.base_lib import BaseLib 20 21 22class FuchsiaHwinfoLib(BaseLib): 23 def __init__(self, addr, tc, client_id): 24 self.address = addr 25 self.test_counter = tc 26 self.client_id = client_id 27 28 def getDeviceInfo(self): 29 """Get's the hw info of the Fuchsia device under test. 30 31 Returns: 32 Dictionary, None if success, error if error. 33 """ 34 test_cmd = "hwinfo_facade.HwinfoGetDeviceInfo" 35 test_args = {} 36 test_id = self.build_id(self.test_counter) 37 self.test_counter += 1 38 39 return self.send_command(test_id, test_cmd, test_args) 40 41 def getProductInfo(self): 42 """Get's the hw info of the Fuchsia device under test. 43 44 Returns: 45 Dictionary, None if success, error if error. 46 """ 47 test_cmd = "hwinfo_facade.HwinfoGetProductInfo" 48 test_args = {} 49 test_id = self.build_id(self.test_counter) 50 self.test_counter += 1 51 52 return self.send_command(test_id, test_cmd, test_args) 53 54 def getBoardInfo(self): 55 """Get's the hw info of the Fuchsia device under test. 56 57 Returns: 58 Dictionary, None if success, error if error. 59 """ 60 test_cmd = "hwinfo_facade.HwinfoGetBoardInfo" 61 test_args = {} 62 test_id = self.build_id(self.test_counter) 63 self.test_counter += 1 64 65 return self.send_command(test_id, test_cmd, test_args) 66