TAPI for remote calls of power switch
Overview
// global functions int rpc_power_sw(rcf_rpc_server* rpcs, const char* type, const char* dev, int mask, const char* cmd);
Detailed Documentation
Global Functions
int rpc_power_sw(rcf_rpc_server* rpcs, const char* type, const char* dev, int mask, const char* cmd)
Call power switch command on/off/rst for given power switch lines
Parameters:
rpcs |
RPC server handle |
type |
Power switch device type Device type ‘parport’ is default |
dev |
Power switch device name Device name used to contact device. Default value is used if not specified. Device /dev/parport0 is used for parport switch, /dev/ttyUSB0 for tty, /dev/ttyACM0 for digispark. |
mask |
Power lines bitmask for type ‘parport’ or ‘tty’, position of each nonzero bit in mask denotes number of power line to apply specified command Power socket number for type ‘digispark’ |
cmd |
Power switch command on/off/rst to be applied to power lines specified in bitmask |
Returns:
0 on success, otherwise -1