void *socketViaStruct(void *pHStruct) { portHostStruct pHSt = *(portHostStruct *)pHStruct; int *sockResult = (int *)malloc(sizeof(int)); *sockResult = socketConnection(pHSt.hostName, pHSt.port); return (void *)sockResult; }
int main(int argc, char *argv[]) { GPIO gpio; gpio.Init(); RGBMatrix matrix(&gpio); Visualizer *visualizer = new Visualizer(&matrix); int command[]={2,0,0,0,0,0,0}; //Array with length 7 to get Information from the Webfile socketConnection(); socketfunction(command); //Wait for the first command while(true) { Visualizer *visualizer = new Visualizer(&matrix); visualizer->setCommand(command); visualizer->Start(); // Start doing things. socketfunction(command); //change animation as needed visualizer->Stop(); } getchar(); close(sockfd); delete visualizer; }