Skip to content

Commit

Permalink
revert whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzvieli committed Dec 9, 2024
1 parent b5be0b9 commit 3401e90
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions config/ola.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ AC_MSG_CHECKING([protobuf library version])
PROTOBUF_VERSION=`pkg-config --modversion protobuf`;
AC_MSG_RESULT([$PROTOBUF_VERSION])
AC_SUBST([PROTOBUF_VERSION])
AC_SUBST([libprotobuf_CFLAGS])
AC_ARG_WITH([protoc],
Expand Down
44 changes: 24 additions & 20 deletions java/src/main/java/ola/OlaClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class OlaClient {


public OlaClient() throws Exception {

channel = new StreamRpcChannel();
controller = new SimpleRpcController();
serverService = OlaServerService.Stub.newStub(channel);
Expand All @@ -82,11 +83,12 @@ public OlaClient() throws Exception {
/**
* Generic method for making Rpc Calls.
*
* @param method Name of the Rpc Method to call
* @param method Name of the Rpc Method to call
* @param inputMessage Input RpcMessage
* @return Message result message or null if the call failed.
*/
private Message callRpcMethod(String method, Message inputMessage) {

final Message[] outputMessage = new Message[1];
controller.reset();

Expand All @@ -107,6 +109,7 @@ public void run(Message arg0) {
}



/**
* Get a list of plugins from olad.
*
Expand Down Expand Up @@ -199,7 +202,7 @@ public DeviceInfoReply getCandidatePorts(int universe) {
* Configure device.
*
* @param device the id of the device to configure.
* @param data device configuration data.
* @param data device configuration data.
* @return
*/
public DeviceConfigReply configureDevice(int device, short[] data) {
Expand Down Expand Up @@ -265,7 +268,6 @@ public UIDListReply forceDiscovery(int universe, boolean full) {

/**
* Retrieve dmx data from universe.
*
* @param universe the id of the universe
* @return
*/
Expand All @@ -277,13 +279,14 @@ public DmxData getDmx(int universe) {
/**
* Patch a port.
*
* @param device number
* @param port number
* @param action PachAction.PATCH or PatchAction.UNPATCH
* @param device number
* @param port number
* @param action PachAction.PATCH or PatchAction.UNPATCH
* @param universe number
* @return true when succeeded.
*/
public boolean patchPort(int device, int port, PatchAction action, int universe) {

PatchPortRequest patchRequest = PatchPortRequest.newBuilder()
.setPortId(port)
.setAction(action)
Expand All @@ -300,10 +303,11 @@ public boolean patchPort(int device, int port, PatchAction action, int universe)
* Send dmx data to olad.
*
* @param universe number
* @param values array of dmx data values
* @param values array of dmx data values
* @return true when succeeded.
*/
public boolean sendDmx(int universe, short[] values) {

DmxData dmxData = DmxData.newBuilder()
.setUniverse(universe)
.setData(convertToUnsigned(values))
Expand All @@ -320,12 +324,12 @@ public boolean sendDmx(int universe, short[] values) {
*/
public boolean setPortPriority(int device, int port, int priority, int mode, boolean output) {
PortPriorityRequest request = PortPriorityRequest.newBuilder()
.setDeviceAlias(device)
.setPortId(port)
.setPriority(priority)
.setPriorityMode(mode)
.setIsOutput(output)
.build();
.setDeviceAlias(device)
.setPortId(port)
.setPriority(priority)
.setPriorityMode(mode)
.setIsOutput(output)
.build();

return callRpcMethod("SetPortPriority", request) != null;
}
Expand All @@ -335,7 +339,7 @@ public boolean setPortPriority(int device, int port, int priority, int mode, boo
* Set universe name.
*
* @param universe id of universe for which to set the name.
* @param name The name to set.
* @param name The name to set.
* @return true if the call succeeded.
*/
public boolean setUniverseName(int universe, String name) {
Expand All @@ -351,7 +355,7 @@ public boolean setUniverseName(int universe, String name) {
* Define merge mode for a universe.
*
* @param universe The id of the universe
* @param mode, merge mode to use
* @param mode, merge mode to use
* @return true if call succeeded.
*/
public boolean setMergeMode(int universe, MergeMode mode) {
Expand All @@ -367,7 +371,7 @@ public boolean setMergeMode(int universe, MergeMode mode) {
* Register for dmx
*
* @param universe
* @param action RegisterAction
* @param action RegisterAction
* @return true if call succeeded.
*/
public boolean registerForDmx(int universe, RegisterAction action) {
Expand All @@ -381,7 +385,6 @@ public boolean registerForDmx(int universe, RegisterAction action) {

/**
* Set source UID for device.
*
* @param device The id of the device
* @param estaId the UID to set.
* @return true if call succeeded.
Expand All @@ -398,8 +401,8 @@ public boolean setSourceUID(int device, int estaId) {
/**
* Send TimeCode.
*
* @param type TimeCodeType
* @param frames number of frames
* @param type TimeCodeType
* @param frames number of frames
* @param hours
* @param minutes
* @param seconds
Expand Down Expand Up @@ -447,9 +450,10 @@ public RDMResponse sendRDMCommand(UID uid, int subDevice, int paramId, boolean i
* Send dmx data, but don't wait for response.
*
* @param universe the id of the universe
* @param values dmx data
* @param values dmx data
*/
public void streamDmx(int universe, short[] values) {

DmxData dmxData = DmxData.newBuilder()
.setUniverse(universe)
.setData(convertToUnsigned(values))
Expand Down

0 comments on commit 3401e90

Please sign in to comment.