This repository was archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Cpp
Max Narvaez edited this page Nov 19, 2019
·
7 revisions
An AnimationSender is constructed with two arguments:
-
host: The IP address of the server (as a c-style string) -
port: The port that the client should connect to (as anint)
AnimationSender sender("10.0.0.254", 5);An AnimationSender is started by calling the start() method on the instance.
start() will return 0 if the connection is successful, -1 if there is an error.
sender.start();To stop the AnimationSender, call its end() method.
end() will return 0 if the disconnection is successful, -1 if there is an error.
sender.end();An animation can be sent to the server by creating an instance of the AnimationData struct, then calling sendAnimation with the struct as the argument.
ColorContainer cc;
cc.addColor(0xFF);
cc.addColor(0xFF00);
AnimationData data;
data.addColor(cc);
sender.sendAnimation(data);The C++ library uses the following values for animation, continuous and direction:
-
animation:COLOR,ALTERNATE,RIPPLE, etc. -
continuous:DEFAULT,CONTINUOUS,NONCONTINUOUS -
direction:FORWARD,BACKWARD
Currently the C++ library only supports sending data.