Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

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:

Include dependency graph

Go to the source code of this file.

Defines

#define RCVBUFSIZE   32 /* Size of receive buffer */
#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"
 

Definition at line 31 of file kmot_ipserver.c.

Referenced by kmot_ipConfigPID(), kmot_ipFirmware(), kmot_ipInitMotor(), kmot_ipMeasure(), kmot_ipResetError(), kmot_ipSetPointSource(), kmot_ipSetPos(), kmot_ipSetSpeed(), and kmot_ipStatus().

#define NMOTOR   4
 

Definition at line 29 of file kmot_ipserver.c.

Referenced by kmot_ipConfigPID(), kmot_ipFirmware(), kmot_ipInitMotor(), kmot_ipMeasure(), kmot_ipResetError(), kmot_ipSetPointSource(), kmot_ipSetPos(), kmot_ipSetSpeed(), and kmot_ipStatus().

#define RCVBUFSIZE   32 /* Size of receive buffer */
 

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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, 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(), motorList, NMOTOR, sendBuffer, and status().

Referenced by main().

Here is the call graph for this function:

int main int  argc,
char *  argv[]
 

Definition at line 338 of file kmot_ipserver.c.

References DEFAULTPORT, DieWithError(), kb_init(), kb_set_debug_level(), kmot_GetFWVersion(), kmot_ipConfigPID(), kmot_ipFirmware(), kmot_ipInitMotor(), kmot_ipMeasure(), kmot_ipResetError(), kmot_ipSetPointSource(), kmot_ipSetPos(), kmot_ipSetSpeed(), kmot_ipStatus(), KMOT_REVISION, KMOT_VERSION, KNET_BUS_ANY, knet_open(), ksock_add_command(), ksock_exec_command_pending(), ksock_get_command(), ksock_init(), ksock_next_connection(), ksock_server_open(), list_command(), motorList, and RCVBUFSIZE.

Here is the call graph for this function:


Variable Documentation

knet_dev_t* motorList[NMOTOR]
 

Definition at line 33 of file kmot_ipserver.c.

Referenced by kmot_ipConfigPID(), kmot_ipFirmware(), kmot_ipInitMotor(), kmot_ipMeasure(), kmot_ipResetError(), kmot_ipSetPointSource(), kmot_ipSetPos(), kmot_ipSetSpeed(), kmot_ipStatus(), and main().

char sendBuffer[SENDBUFFERSIZE]
 

Definition at line 34 of file kmot_ipserver.c.

Referenced by kmot_ipConfigPID(), kmot_ipFirmware(), kmot_ipInitMotor(), kmot_ipMeasure(), kmot_ipResetError(), kmot_ipSetPointSource(), kmot_ipSetPos(), kmot_ipSetSpeed(), and kmot_ipStatus().


Generated on Thu Nov 17 15:36:30 2005 for KoreBot Library by doxygen 1.3.7