Skip to content
Snippets Groups Projects
Commit 575e3993 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Added incomplete LEDButton code generator extensions.

parent a7b09767
No related branches found
No related tags found
No related merge requests found
Showing
with 458 additions and 0 deletions
/* ***********************************************************
* This file was automatically generated on 2017-07-27. *
* *
* C/C++ Bindings Version 2.1.17 *
* *
* If you have a bugfix for this file and want to commit it, *
* please fix the bug in the generator. You can find a link *
* to the generators git repository on tinkerforge.com *
*************************************************************/
#ifndef BRICKLET_RGB_LED_H
#define BRICKLET_RGB_LED_H
#include "ip_connection.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup BrickletRGBLED RGB LED Bricklet
*/
/**
* \ingroup BrickletRGBLED
*
* Controls one RGB LED
*/
typedef Device RGBLED;
/**
* \ingroup BrickletRGBLED
*/
#define RGB_LED_FUNCTION_SET_RGB_VALUE 1
/**
* \ingroup BrickletRGBLED
*/
#define RGB_LED_FUNCTION_GET_RGB_VALUE 2
/**
* \ingroup BrickletRGBLED
*/
#define RGB_LED_FUNCTION_GET_IDENTITY 255
/**
* \ingroup BrickletRGBLED
*
* This constant is used to identify a RGB LED Bricklet.
*
* The {@link rgb_led_get_identity} function and the
* {@link IPCON_CALLBACK_ENUMERATE} callback of the IP Connection have a
* \c device_identifier parameter to specify the Brick's or Bricklet's type.
*/
#define RGB_LED_DEVICE_IDENTIFIER 271
/**
* \ingroup BrickletRGBLED
*
* This constant represents the display name of a RGB LED Bricklet.
*/
#define RGB_LED_DEVICE_DISPLAY_NAME "RGB LED Bricklet"
/**
* \ingroup BrickletRGBLED
*
* Creates the device object \c rgb_led with the unique device ID \c uid and adds
* it to the IPConnection \c ipcon.
*/
void rgb_led_create(RGBLED *rgb_led, const char *uid, IPConnection *ipcon);
/**
* \ingroup BrickletRGBLED
*
* Removes the device object \c rgb_led from its IPConnection and destroys it.
* The device object cannot be used anymore afterwards.
*/
void rgb_led_destroy(RGBLED *rgb_led);
/**
* \ingroup BrickletRGBLED
*
* Returns the response expected flag for the function specified by the
* \c function_id parameter. It is *true* if the function is expected to
* send a response, *false* otherwise.
*
* For getter functions this is enabled by default and cannot be disabled,
* because those functions will always send a response. For callback
* configuration functions it is enabled by default too, but can be disabled
* via the rgb_led_set_response_expected function. For setter functions it is
* disabled by default and can be enabled.
*
* Enabling the response expected flag for a setter function allows to
* detect timeouts and other error conditions calls of this setter as well.
* The device will then send a response for this purpose. If this flag is
* disabled for a setter function then no response is send and errors are
* silently ignored, because they cannot be detected.
*/
int rgb_led_get_response_expected(RGBLED *rgb_led, uint8_t function_id, bool *ret_response_expected);
/**
* \ingroup BrickletRGBLED
*
* Changes the response expected flag of the function specified by the
* \c function_id parameter. This flag can only be changed for setter
* (default value: *false*) and callback configuration functions
* (default value: *true*). For getter functions it is always enabled.
*
* Enabling the response expected flag for a setter function allows to detect
* timeouts and other error conditions calls of this setter as well. The device
* will then send a response for this purpose. If this flag is disabled for a
* setter function then no response is send and errors are silently ignored,
* because they cannot be detected.
*/
int rgb_led_set_response_expected(RGBLED *rgb_led, uint8_t function_id, bool response_expected);
/**
* \ingroup BrickletRGBLED
*
* Changes the response expected flag for all setter and callback configuration
* functions of this device at once.
*/
int rgb_led_set_response_expected_all(RGBLED *rgb_led, bool response_expected);
/**
* \ingroup BrickletRGBLED
*
* Returns the API version (major, minor, release) of the bindings for this
* device.
*/
int rgb_led_get_api_version(RGBLED *rgb_led, uint8_t ret_api_version[3]);
/**
* \ingroup BrickletRGBLED
*
* Sets the *rgb* value for the LED.
*/
int rgb_led_set_rgb_value(RGBLED *rgb_led, uint8_t r, uint8_t g, uint8_t b);
/**
* \ingroup BrickletRGBLED
*
* Returns the *rgb* value of the LED as set by {@link rgb_led_set_rgb_value}.
*/
int rgb_led_get_rgb_value(RGBLED *rgb_led, uint8_t *ret_r, uint8_t *ret_g, uint8_t *ret_b);
/**
* \ingroup BrickletRGBLED
*
* Returns the UID, the UID where the Bricklet is connected to,
* the position, the hardware and firmware version as well as the
* device identifier.
*
* The position can be 'a', 'b', 'c' or 'd'.
*
* The device identifier numbers can be found :ref:`here <device_identifier>`.
* |device_identifier_constant|
*/
int rgb_led_get_identity(RGBLED *rgb_led, char ret_uid[8], char ret_connected_uid[8], char *ret_position, uint8_t ret_hardware_version[3], uint8_t ret_firmware_version[3], uint16_t *ret_device_identifier);
#ifdef __cplusplus
}
#endif
#endif
......@@ -188,6 +188,45 @@
</objectClass>
</target>
</transformationProvider>
<transformationProvider
transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.brick.LEDButtonRActuatorTransformation">
<source>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.model.brick.LEDButtonRActuator">
</objectClass>
</source>
<target>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonRActuatorGeneratorExtension">
</objectClass>
</target>
</transformationProvider>
<transformationProvider
transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.brick.LEDButtonGActuatorTransformation">
<source>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.model.brick.LEDButtonGActuator">
</objectClass>
</source>
<target>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonGActuatorGeneratorExtension">
</objectClass>
</target>
</transformationProvider>
<transformationProvider
transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.brick.LEDButtonBActuatorTransformation">
<source>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.model.brick.LEDButtonBActuator">
</objectClass>
</source>
<target>
<objectClass
objectClass="org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonBActuatorGeneratorExtension">
</objectClass>
</target>
</transformationProvider>
<transformationProvider
transformationProvider="org.fortiss.af3.platform.raspberry.generator.transform.brick.UltraSonicTransformation">
<source>
......
ActuatorDigitsGeneratorExtension.java 5df8861318c5b8002785ae4ff9fb9af0d095b7bc YELLOW
BrickGeneratorExtensionBase.java 01442772f80ebf32eaf0507495a4380d0de034b1 YELLOW
LEDButtonBActuatorGeneratorExtension.java 1efdf2890c7704d264f3532a9b86a4e7585bab4d RED
LEDButtonGActuatorGeneratorExtension.java 22aae48f67268b9767ae426eae20e586ca5db1db RED
LEDButtonRActuatorGeneratorExtension.java 567a7d5035537e91cb1ce32c40a46996dd682b60 RED
LaserRangeSensorGeneratorExtension.java ff0c1e5e96a69b7deb6d7675e40f18510a36e7a0 YELLOW
UltraSonicSensorGeneratorExtension.java cbd4555e28600ce8f47c737330adfc9b5581bae8 YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.extension.brick;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.platform.raspberry.generator.framework.IWriteableGeneratorExtension;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonBActuator;
/**
* Generator extension for {@link LEDButtonBActuator}s.
*
* @author hoelzl
*/
public class LEDButtonBActuatorGeneratorExtension extends
BrickGeneratorExtensionBase<LEDButtonBActuator> implements IWriteableGeneratorExtension {
/** Constructor. */
public LEDButtonBActuatorGeneratorExtension(LEDButtonBActuator modelElement) {
super(modelElement);
}
/** {@inheritDoc} */
@Override
public String getWriteCode(String postfix, String singletonPostfix, OutputPort logicalSignal,
String value) {
return "// FIXME: " + logicalSignal.getName() + " is deployed onto " +
modelElement.getName() + "\n";
}
/** {@inheritDoc} */
@Override
public String getNoValWriteCode(String postfix, String singletonPostfix,
OutputPort logicalSignal) {
return null;
}
/** {@inheritDoc} */
@Override
public String getHeaderFileName() {
return "bricklet_rgb_led_button.h";
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.extension.brick;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.platform.raspberry.generator.framework.IWriteableGeneratorExtension;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonGActuator;
/**
* Generator extension for {@link LEDButtonGActuator}s.
*
* @author hoelzl
*/
public class LEDButtonGActuatorGeneratorExtension extends
BrickGeneratorExtensionBase<LEDButtonGActuator> implements IWriteableGeneratorExtension {
/** Constructor. */
public LEDButtonGActuatorGeneratorExtension(LEDButtonGActuator modelElement) {
super(modelElement);
}
/** {@inheritDoc} */
@Override
public String getWriteCode(String postfix, String singletonPostfix, OutputPort logicalSignal,
String value) {
return "// FIXME: " + logicalSignal.getName() + " is deployed onto " +
modelElement.getName() + "\n";
}
/** {@inheritDoc} */
@Override
public String getNoValWriteCode(String postfix, String singletonPostfix,
OutputPort logicalSignal) {
return null;
}
/** {@inheritDoc} */
@Override
public String getHeaderFileName() {
return "bricklet_rgb_led_button.h";
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.extension.brick;
import org.fortiss.af3.component.model.OutputPort;
import org.fortiss.af3.platform.raspberry.generator.framework.IWriteableGeneratorExtension;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonRActuator;
/**
* Generator extension for {@link LEDButtonRActuator}s.
*
* @author hoelzl
*/
public class LEDButtonRActuatorGeneratorExtension extends
BrickGeneratorExtensionBase<LEDButtonRActuator> implements IWriteableGeneratorExtension {
/** Constructor. */
public LEDButtonRActuatorGeneratorExtension(LEDButtonRActuator modelElement) {
super(modelElement);
}
/** {@inheritDoc} */
@Override
public String getWriteCode(String postfix, String singletonPostfix, OutputPort logicalSignal,
String value) {
return "// FIXME: " + logicalSignal.getName() + " is deployed onto " +
modelElement.getName() + "\n";
}
/** {@inheritDoc} */
@Override
public String getNoValWriteCode(String postfix, String singletonPostfix,
OutputPort logicalSignal) {
return null;
}
/** {@inheritDoc} */
@Override
public String getHeaderFileName() {
return "bricklet_rgb_led_button.h";
}
}
ActuatorDigitsTransformation.java 7b7b0fb3f185cd05ae4f45766366bc2e6c2e872a YELLOW
LEDButtonBActuatorTransformation.java 5d1821cb7b952132c2d22ab6e38306cafd276f2d YELLOW
LEDButtonGActuatorTransformation.java 78be0fdb2fa5921ddb29cbd8f2ae7c17b2a60f81 YELLOW
LEDButtonRActuatorTransformation.java 38a10a58049ffd687129a1336b58da6fc6a6928c YELLOW
LaserRangeTransformation.java 270d75e0bbdea4e7e917b10455d5b71210667e82 YELLOW
UltraSonicTransformation.java d278ee2d489f467f0df2cd25895afaee879035d0 YELLOW
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.transform.brick;
import org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonBActuatorGeneratorExtension;
import org.fortiss.af3.platform.raspberry.generator.transform.RasPiGeneratorTransformationBase;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonBActuator;
/** Transformation for {@link LEDButtonBActuator}. */
public class LEDButtonBActuatorTransformation extends RasPiGeneratorTransformationBase {
/** Constructor. */
public LEDButtonBActuatorTransformation() {
super(LEDButtonBActuator.class, LEDButtonBActuatorGeneratorExtension.class);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.transform.brick;
import org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonGActuatorGeneratorExtension;
import org.fortiss.af3.platform.raspberry.generator.transform.RasPiGeneratorTransformationBase;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonGActuator;
/** Transformation for {@link LEDButtonGActuator}. */
public class LEDButtonGActuatorTransformation extends RasPiGeneratorTransformationBase {
/** Constructor. */
public LEDButtonGActuatorTransformation() {
super(LEDButtonGActuator.class, LEDButtonGActuatorGeneratorExtension.class);
}
}
/*-------------------------------------------------------------------------+
| Copyright 2018 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.platform.raspberry.generator.transform.brick;
import org.fortiss.af3.platform.raspberry.generator.extension.brick.LEDButtonRActuatorGeneratorExtension;
import org.fortiss.af3.platform.raspberry.generator.transform.RasPiGeneratorTransformationBase;
import org.fortiss.af3.platform.raspberry.model.brick.LEDButtonRActuator;
/** Transformation for {@link LEDButtonRActuator}. */
public class LEDButtonRActuatorTransformation extends RasPiGeneratorTransformationBase {
/** Constructor. */
public LEDButtonRActuatorTransformation() {
super(LEDButtonRActuator.class, LEDButtonRActuatorGeneratorExtension.class);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment