4 #include "../hubolib.h"
42 bool strToUChar(
char* str,
unsigned char& value);
46 int main(
int argc,
char *argv[])
48 unsigned char systemCode, socketNumber, value;
53 "RCSocket.out <system-code> <socket number> <0|1>\n"
54 "system-code: 0..31\n"
55 "socket number: 0..31 (whereas A=16, B=8, C=4, D=2 and E=1)\n"
67 printf (
"GPIO not properly initialized. Are you running the program as sudoer?\n");
77 mySwitch.
SwitchSocket(systemCode, socketNumber, value>0, 4, 10);
90 pthread_t threadHandle = pthread_self();
93 ret = pthread_getschedparam (threadHandle, &policy, ¶m);
98 param.sched_priority = sched_get_priority_max(policy);
99 ret = pthread_setschedparam(threadHandle, policy, ¶m);
106 if (sscanf(str,
"%lu", &v) != 1)
108 value = (
unsigned char)v;
109 if (value != (
unsigned long)v)
bool IsGPIOInitialized()
Returns the status of the initialisation of the GPIO part of the library.
int main(int argc, char *argv[])
bool strToUChar(char *str, unsigned char &value)
bool SwitchSocket(unsigned char SystemCode, unsigned char Receiver, bool bTurnOn, int repeatedSuccess, int totalTransmittion)
void BoostThreadPriority()