/* Copyright (c) 2016 CurlyMo This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include #include #include #include #include "wiringx.h" char *usage = "Usage: %s platform GPIO GPIO\n" " first GPIO to write to = output\n" " second GPIO to read from = input\n" "Example: %s raspberrypi2 4 23\n"; int main(int argc, char *argv[]) { char *str = NULL, *platform = NULL; char usagestr[170]; int i = 0, gpio_out = 0, gpio_in = 0, invalid = 0; memset(usagestr, '\0', 170); // expect 2 arguments => argc must be 3 if(argc != 4) { snprintf(usagestr, 169, usage, argv[0], argv[0]); puts(usagestr); return -1; } // check for valid, numeric arguments for(i=2; i