control: command line tool to retrieve fan status (set/resume functions)

This is part three of a multipart commit to create a fan control command
line utility to report service status, show target/actual RPM/PWM info,
and manually control single fans. This commit contains the set/resume
commands. Further functionality will come in subsequent commits.

The resume command is a shortcut to start phosphor-fan-control@0 systemd
service, since most workflows require stopping it to allow control of
individual fans. Once manual intervention is done, it can be resumed.

root@p10bmc:~# systemctl stop phosphor-fan-control@0.service
root@p10bmc:~# fanctl resume
root@p10bmc:~# systemctl status phosphor-fan-control@0.service
root@p10bmc:~# <output indicates service is running>

For set/get functions, here is a usage example:

root@p10bmc:~# fanctl set 10000
root@p10bmc:~# fanctl set 2000 fan1 fan3_0
root@p10bmc:~# fanctl get

TARGET SENSOR    TARGET(RPM)   FEEDBACK SENSOR   FEEDBACK(RPMS)
===============================================================
fan0_0                 10000            fan0_0            10000
                                        fan0_1            13591
fan1_0                  2000            fan1_0             1991
                                        fan1_1             2000
fan2_0                 10000            fan2_0            10000
                                        fan2_1            13591
fan3_0                  2000            fan3_0             1991
                                        fan3_1             2000
fan4_0                 10000            fan4_0            10000
                                        fan4_1            10091
fan5_0                 10000            fan5_0            10000
                                        fan5_1            10021

Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: Ib2b2f7433701e0178fcb8d2223e452b541ea5b0c
2 files changed