Lines Matching +full:gpio +full:- +full:key
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright 2016 IBM Corporation
6 #include <systemd/sd-event.h>
9 #include <phosphor-logging/lg2.hpp>
16 CLI::App app{"Monitor GPIO line for requested state change"}; in main()
20 std::string key{}; in main() local
26 app.add_option("-p,--path", path, in main()
28 ->required(); in main()
29 app.add_option("-k,--key", key, "Input GPIO key number")->required(); in main()
30 app.add_option("-r,--polarity", polarity, in main()
32 ->required(); in main()
33 app.add_option("-t,--target", target, in main()
34 "Systemd unit to be called on GPIO state change") in main()
35 ->required(); in main()
36 app.add_flag("-c,--continue", continueRun, in main()
37 "Whether or not to continue after key pressed"); in main()
60 phosphor::gpio::EventPtr eventP{event}; in main()
64 phosphor::gpio::Monitor monitor(path, std::stoi(key), std::stoi(polarity), in main()
68 // at least one expected GPIO state change in main()
71 // -1 denotes wait for ever in main()
72 r = sd_event_run(eventP.get(), (uint64_t)-1); in main()