public static string GetSdkVersion() { int length = 16; StringBuilder buffer = new StringBuilder(length); GLedAPI.dllexp_GetSdkVersion(buffer, length); return(buffer.ToString()); }
public static int GetRGBPinType() { int returns = GLedAPI.dllexp_GetRGBPinType(); if (returns != 1) { ConsoleColor def = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("GetRGBPinType: Program may not work correctly, expected '1' not '{0}'", returns); Console.ForegroundColor = def; } return(returns); }
public static int MonocLedCtrlSupport() { int returns = GLedAPI.dllexp_MonocLedCtrlSupport(); if (returns != 3) { ConsoleColor def = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("MonocLedCtrlSupport: Program may not work correctly, expected '3' not '{0}'", returns); Console.ForegroundColor = def; } return(returns); }
static void Main(string[] args) { if (args.Length < 3) { Console.WriteLine("3 Args needed! eg. '1 1 0' [r, g, b] will set red and green on"); System.Environment.Exit(0); } DisplayFunc(GLedAPI.GetSdkVersion(), "GetSdkVersion()"); DisplayFunc(GLedAPI.InitAPI(), "InitAPI()"); DisplayFunc(GLedAPI.MonocLedCtrlSupport(), "MonocLedCtrlSupport()"); DisplayFunc(GLedAPI.GetRGBPinType(), "GetRGBPinType()"); int[] leds = { int.Parse(args[0]), int.Parse(args[1]), int.Parse(args[2]) }; DisplayFunc(GLedAPI.SetMonocLedMode(2), "SetMonocLedMode()"); DisplayFunc(GLedAPI.RGBPin_Type1(leds), "RGBPin_Type1(leds)"); Console.WriteLine("Done!"); Environment.Exit(0); }
public static uint RGBPin_Type1(int[] pins) { uint returns = GLedAPI._RGBPin_Type1(pins[0], pins[1], pins[2]); if (returns != 0) { ConsoleColor def = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; if (returns == 4317) { Console.WriteLine("RGBPin_Type1: are you sure dlls are in the same dir as exe?", returns); } else { Console.WriteLine("RGBPin_Type1: Program may not work correctly, expected '0' not '{0}'", returns); } Console.ForegroundColor = def; } return(returns); }