net/tcputils.h File Reference

TCP Helper functions. More...

#include "net\ip.h"
#include "net\tcp.h"
#include "net\tick.h"
#include "net\fsee.h"

Data Structures

struct  _TCP_FILESEND_INFO

Defines

#define TCPU_ERR_FILE_NOT_FOUND   (5ul)
#define TCPU_ERR_FILE_RD   (4ul)
#define TCPU_ERR_FSYS_NOT_AVAIL   (6ul)
#define TCPU_ERR_IP_RESOLVE   (1ul)
#define TCPU_ERR_TCP_OPEN   (2ul)
#define TCPU_ERR_TCP_TIMEOUT   (3ul)
#define TCPU_NOT_FINISHED   (0xfful)

Typedefs

typedef struct _TCP_FILESEND_INFO TCP_FILESEND_INFO

Functions

BYTE sendFileToTcpServer (BYTE *filename, TCP_FILESEND_INFO *tcb)


Detailed Description

TCP Helper functions.

Author:
Modtronix Engineering
Dependencies:
stacktsk.h
Compiler:
MPLAB C18 v2.10 or higher
HITECH PICC-18 V8.35PL3 or higher

Description

This module contains TCP helper functions.
For a detailed description, see the TCP/IP Helper Functions section of this document - in [Modules] [TCP/IP Stack] [Helper Functions].

Define Documentation

#define TCPU_ERR_FILE_NOT_FOUND   (5ul)

#define TCPU_ERR_FILE_RD   (4ul)

#define TCPU_ERR_FSYS_NOT_AVAIL   (6ul)

#define TCPU_ERR_IP_RESOLVE   (1ul)

#define TCPU_ERR_TCP_OPEN   (2ul)

#define TCPU_ERR_TCP_TIMEOUT   (3ul)

#define TCPU_NOT_FINISHED   (0xfful)


Typedef Documentation


Function Documentation

BYTE sendFileToTcpServer ( BYTE filename,
TCP_FILESEND_INFO tcb 
)

Send the given file to the given port and server. To use this function, a TCP_FILESEND_INFO structure must be created and initialized with desired values. Then sendFileToTcpServer() is called with the created TCP_FILESEND_INFO structure, and the filename of the file to send.

This function has to be repetitively called as long as it returns 0xff.

Parameters:
filename Name of file to send to the server
tcb Info used by this function
Returns:
Returns 0 if success, else error:
  • 0: File successfully sent
  • 255: File partially sent, this function has to be called again to complete this operation!
  • 1: Could not resolve IP address
  • 2: Could not open TCP socket
  • 3: TCPConnect timed out
  • 4: File read error
  • 5: File not found
  • 6: File system not available
Examples:
ex_tcp_sendfile.c.


Generated on Wed Feb 3 12:45:35 2010 for SBC65EC Web Server by  doxygen 1.5.8