kmot_ipserver.c File Reference

Demo program to create a tcp/ip server that controls the KoreMotor. The server provides network commands for all the KoreMotor functions to allow a remote client to control the board. More...

Include dependency graph for kmot_ipserver.c:

Go to the source code of this file.

Defines

#define RCVBUFSIZE   32
#define DEFAULTPORT   344
#define NMOTOR   4
#define SENDBUFFERSIZE   64
#define ERRORSTRING   "kmot_error"

Functions

int kmot_ipFirmware (int argc, char *argv[], void *data)
int kmot_ipStatus (int argc, char *argv[], void *data)
int kmot_ipConfigPID (int argc, char *argv[], void *data)
int kmot_ipSetPointSource (int argc, char *argv[], void *data)
int kmot_ipMeasure (int argc, char *argv[], void *data)
int kmot_ipResetError (int argc, char *argv[], void *data)
int kmot_ipSetSpeed (int argc, char *argv[], void *data)
int kmot_ipSetPos (int argc, char *argv[], void *data)
int kmot_ipInitMotor (int argc, char *argv[], void *data)
int main (int argc, char *argv[])

Variables

knet_dev_tmotorList [NMOTOR]
char sendBuffer [SENDBUFFERSIZE]


Detailed Description

Demo program to create a tcp/ip server that controls the KoreMotor. The server provides network commands for all the KoreMotor functions to allow a remote client to control the board.

Author:
Pierre Bureau (K-Team SA)
Note:
Copyright (C) 2004 K-TEAM SA

Definition in file kmot_ipserver.c.


Define Documentation

#define DEFAULTPORT   344

Definition at line 28 of file kmot_ipserver.c.

Referenced by main().

#define ERRORSTRING   "kmot_error"

#define NMOTOR   4

#define RCVBUFSIZE   32

Definition at line 27 of file kmot_ipserver.c.

Referenced by main().

#define SENDBUFFERSIZE   64

Definition at line 30 of file kmot_ipserver.c.


Function Documentation

int kmot_ipConfigPID ( int  argc,
char *  argv[],
void *  data 
)

Configure the motor controller PID

Syntax: "ipConfigPID requestId motor regtype Kp Kd Ki\\n"

Return: "ipConfigPID requestId\\n"

Definition at line 106 of file kmot_ipserver.c.

References ERRORSTRING, kmot_ConfigurePID(), ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipFirmware ( int  argc,
char *  argv[],
void *  data 
)

Get the motor controler firmare version.

Syntax: "ipFirmware requestId motor\\n"

Return: "ipFirmware requestId version\\n"

Definition at line 43 of file kmot_ipserver.c.

References ERRORSTRING, kmot_GetFWVersion(), KMOT_REVISION, KMOT_VERSION, ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipInitMotor ( int  argc,
char *  argv[],
void *  data 
)

Set default initialization for the given controller

Syntax: "ipInit requestId motor\\n"

Return: "ipInit requestId\\n"

Definition at line 296 of file kmot_ipserver.c.

References ERRORSTRING, kmot_ConfigurePID(), kmot_ResetError(), kmot_SetBlockedTime(), kmot_SetLimits(), kmot_SetMargin(), kmot_SetMode(), kmot_SetOptions(), kmot_SetSampleTime(), kmot_SetSpeedProfile(), kMotModeIdle, kMotRegCurrent, kMotRegPos, kMotRegSpeed, kMotSWOptStopMotorBlk, kMotSWOptWindup, ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipMeasure ( int  argc,
char *  argv[],
void *  data 
)

Get a measure from a motor controller

Syntax: "ipMeasure requestId motor regtype\\n"

Return: "ipMeasure requestId measure\\n"

Definition at line 169 of file kmot_ipserver.c.

References ERRORSTRING, kmot_GetMeasure(), ksock_send_answer(), measure(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipResetError ( int  argc,
char *  argv[],
void *  data 
)

Reset errors from a motor controller

Syntax: "ipResetError requestId motor\\n"

Return: "ipResetError requestId\\n"

Definition at line 201 of file kmot_ipserver.c.

References ERRORSTRING, kmot_ResetError(), ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipSetPointSource ( int  argc,
char *  argv[],
void *  data 
)

Select the target point source for the controller

Syntax: "ipSetPointSource requestId motor regtype wavetype period amplitude offset\\n"

Return: "ipSetPointSource requestId\\n"

Definition at line 137 of file kmot_ipserver.c.

References ERRORSTRING, kmot_SetPointSource(), ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipSetPos ( int  argc,
char *  argv[],
void *  data 
)

Set target position for the given motor

Syntax: "ipSetPos requestId motor position\\n"

Return: "ipSetPos requestId\\n"

Definition at line 263 of file kmot_ipserver.c.

References ERRORSTRING, kmot_SetPoint(), kMotRegPos, ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipSetSpeed ( int  argc,
char *  argv[],
void *  data 
)

Set target speed for the given motor

Syntax: "ipSetSpeed requestId motor speed\\n"

Return: "ipSetSpeed requestId\\n"

Definition at line 232 of file kmot_ipserver.c.

References ERRORSTRING, kmot_SetPoint(), kMotRegSpeed, ksock_send_answer(), motor, NMOTOR, and sendBuffer.

Referenced by main().

Here is the call graph for this function:

int kmot_ipStatus ( int  argc,
char *  argv[],
void *  data 
)

Get the motor controler status.

Syntax: "ipStatus requestId motor\\n"

Return: "ipStatus requestId status error\\n"

Definition at line 74 of file kmot_ipserver.c.

References ERRORSTRING, kmot_GetStatus(), ksock_send_answer(), motor, NMOTOR, sendBuffer, and status().

Referenced by main().

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)


Variable Documentation

Definition at line 33 of file kmot_ipserver.c.

char sendBuffer[SENDBUFFERSIZE]


Generated on Wed Dec 15 11:49:29 2010 for KoreBot Library by  doxygen 1.5.5