Example #1
0
void doSwitchMode(Mode mode){
    arduino.connect(ip, port);

    if (mode != currentMode){
        currentMode = mode;

        char data;
        switch (mode){
            case Mode::SolidWhite: data = (char) 0;
                                   break;
            case Mode::Marquee:    data = (char) 1;
                                   break;
            case Mode::ColorCycle: data = (char) 2;
                                   break;
            case Mode::Pew:        data = (char) 3;
                                   break;
            default: break;
        }

        char* dataPointer = &data;
        arduino.send(dataPointer, sizeof(data));
    }

    arduino.disconnect();

}
				inline void disconnect()	{ socket.disconnect(); busy = false; }
Example #3
0
	void Server::disconnect(sf::TcpSocket& socket)
	{
		socket.disconnect();
	}