srcp.c File Reference


Detailed Description

This file implements the SRCP client module.

Software License
See the MBCSL for details.
Author:
Sven Schlender (kontakt at mobacon dot de)
Date:
2009-10-30

Definition in file srcp.c.

Go to the source code of this file.

Functions

SRCP_HANDSHAKE_RETCODE _eHandShake (SSRCPSOCKET *hSRCP)
static BOOL _bGetNextWord (BYTE u8Socket, BYTE *au8Buf, BYTE u8BufSize, BOOL *bEnd)
 This function delivers the next SRCP word from the TCP stream.
void SRCPRestoreToFactory (void)
 Resets the SRCP related stuff to a well known start configuration.
void SRCPLocoDirModeHasChanged (void)
 Takes changes on the changed direction mode for locos.
void SRCPInitialInit (void)
 This function must be called on startup to load the persistent SRCP configuration data into RAM and to do some initialization.
BOOL SRCPMain (void)
 The main state machine of the SRCP client is called during the client is connected with the SRCP server.
void SRCPPrepareConnection (void)
 Prepare internal state before starting a connect to the SRCP server.
APPL_CONNECTING_RETCODE SRCPHandleServerConnection (void)
 State machine is called during connecting and handshaking to or disconnecting from SRCP server.
BOOL SRCPIsConnected (void)
 Delivers if the SRCP client is actually connected with the server.
void SRCPStartDisconnect (void)
 Start disconnecting from server.


Function Documentation

static BOOL _bGetNextWord ( BYTE  u8Socket,
BYTE *  au8Buf,
BYTE  u8BufSize,
BOOL *  bEnd 
) [static]

This function delivers the next SRCP word from the TCP stream.

SRCP word means, that the stream is parsed for whitespace characters. The parser throws away the prepending whitespace(s), stores all following characters in the given buffer (as long as space is left) until it finds whitespace characters again. In case the parser finds the end of line, it sets the end flag. Errors while reading from the TCP stream leads to an returned FALSE. Also FALSE will returned if the end flag is already set upon function entry. Else the function returns TRUE.

Definition at line 1478 of file srcp.c.

SRCP_HANDSHAKE_RETCODE _eHandShake ( SSRCPSOCKET *  hSRCP  ) 

Todo:
Revise the error messages.

Definition at line 3310 of file srcp.c.


Generated on Sun Nov 27 20:02:39 2011 for eWicht by  doxygen 1.5.5