rec::robotino::api2 C interface
Macros | Typedefs | Functions
Relay.h File Reference

In "rec/robotino/api2/c/Relay.h" you can find functions for reading Robotino's bumper. More...

#include "rec/robotino/api2/c/globals.h"
#include "rec/robotino/api2/c/Com.h"

Go to the source code of this file.

Macros

#define INVALID_RELAYID   -1
 

Typedefs

typedef int RelayId
 

Functions

DLLEXPORT RelayId Relay_construct (unsigned int number)
 
DLLEXPORT BOOL Relay_destroy (RelayId id)
 
DLLEXPORT BOOL Relay_setComId (RelayId id, ComId comId)
 
DLLEXPORT BOOL Relay_setRelayNumber (RelayId id, unsigned int n)
 
DLLEXPORT unsigned int numRelays ()
 
DLLEXPORT BOOL Relay_setValue (RelayId id, BOOL on)
 

Detailed Description

In "rec/robotino/api2/c/Relay.h" you can find functions for reading Robotino's bumper.

Use Relay_construct() to create a new relay object. Associate the relay object with a com object using Relay_setComId(). Use Relay_setSetPointSpeed() to set the relay's speed.

Macro Definition Documentation

#define INVALID_RELAYID   -1

Invalid RelayId is -1

Typedef Documentation

typedef int RelayId

RelayId

Function Documentation

DLLEXPORT unsigned int numRelays ( )
Returns
Returns the number of drive relays on Robotino
DLLEXPORT RelayId Relay_construct ( unsigned int  number)

Construct an relay object

Parameters
numbernumber of this relay. Range [0; numRelays()-1].
Returns
Returns the ID of the newly constructed relay object.
DLLEXPORT BOOL Relay_destroy ( RelayId  id)

Destroy the relay object assigned to id

Parameters
idThe id of the relay object to be destroyed
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given RelayId is invalid.
DLLEXPORT BOOL Relay_setComId ( RelayId  id,
ComId  comId 
)

Associated a relay object with a communication interface, i.e. binding the relay to a specific Robotino

Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given RelayId or ComId is invalid.
DLLEXPORT BOOL Relay_setRelayNumber ( RelayId  id,
unsigned int  n 
)

Sets the relay number.

Parameters
idThe id of the relay object to be set
nThe relay number. Range: [0 - numRelays()]
Exceptions
RobotinoExceptionif relay number is invalid.
DLLEXPORT BOOL Relay_setValue ( RelayId  id,
BOOL  on 
)

Sets the setpoint speed of this relay.

Parameters
idThe id of the relay object.
onThe value the relay will be set to.
Returns
Returns TRUE (1) on success. Returns FALSE (0) if the given RelayId is invalid.