⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftps.h

📁 CSR蓝牙芯片的ftp程序的服务器端代码 客户端已经上传
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004

FILE NAME
    ftps.h
    
DESCRIPTION
 Interface definition for the FTP Server library

*/
/*!
@file ftps.h
@brief Interface to the FTP Server library


Library Dependecies : connection,region,service, goep, bdaddr
*/

#ifndef FTPS_H_
#define FTPS_H_

#include <bdaddr_.h>
#include <message.h>
#include <source.h>


/*! 
 @brief Type of FTP Server (Read Only or Read/Write).
*/
typedef enum
{
	ftps_serv_readonly,
	ftps_serv_readwrite
} ftps_serv_type;


/*! 
 @brief Possible results to a Set Path request.
*/
typedef enum
{
	ftps_setpath_OK,
	ftps_setpath_NotFound,
	ftps_setpath_NoBrowsing,
	ftps_setpath_AtRoot,
	ftps_setpath_ReadOnly
} ftps_setpath_result;

/*! 
 @brief Possible errors for a transfer (PUT or GET) request.
*/
typedef enum
{
	ftps_transfer_NotFound,
	ftps_transfer_Forbidden,
	ftps_transfer_Unauthorized,
	ftps_transfer_BadRequest,
	ftps_transfer_Readonly,

	ftps_transfer_EOL
} ftps_transfer_reason;


/*!
 @brief FTP status. 
*/
typedef enum 
{
	/*! Last operation was successful.*/
	ftps_success,  
	/*! Last operation failed.*/
	ftps_failure,  
	ftps_wrong_state,
	/*! A command has been attempted while another command is already
	  running. */
	ftps_not_idle,      
	ftps_invalid_sdp,
 
	ftps_badrequest,
	ftps_forbidden,
	ftps_notfound,

	ftps_remote_abort,
 
	ftps_end_of_status_list
} ftps_lib_status;

/*! 
    @brief Handle of the current FTP Server Session.
   
    For client-side session management, this value can be used in comparisons,
    but it's meaning cannot be relied upon.
 */
struct __ftpsState;
typedef struct __ftpsState FTPS; 

/*
   @brief Upstream Messages for the FTP Server Library   
*/
#define FTPS_MESSAGE_BASE 0x6500

/*
 Do not document this enum.
*/
#ifndef DO_NOT_DOCUMENT
enum
{
	/* Session Control */
	FTPS_INIT_CFM = FTPS_MESSAGE_BASE,
			
	FTPS_CONNECT_IND,
	FTPS_CONNECT_CFM,
	FTPS_DISCONNECT_IND,

	FTPS_GETFOLDER_START_IND,
	FTPS_GETFOLDER_DATA_IND,
	FTPS_GETFOLDER_COMPLETE_IND,

	FTPS_GETOBJECT_START_IND,
	FTPS_GETOBJECT_DATA_IND,
	FTPS_GETOBJECT_COMPLETE_IND,

	FTPS_PUTOBJECT_START_IND,
	FTPS_PUTOBJECT_DATA_IND,
	FTPS_PUTOBJECT_COMPLETE_IND,

	FTPS_DELETEOBJECT_IND,

	FTPS_SETPATH_SUBFOLDER_IND,
	FTPS_SETPATH_ROOT_IND,
	FTPS_SETPATH_PARENT_IND,

	FTPS_MESSAGE_TOP
};
#endif


/*!
	@brief This message returns the result of an FtpsInit attempt.
*/
typedef struct
{
	/*! FTPS Session Handle. This should not be used on error. */
	FTPS            *session;	    
	/*! The current status of the FTPS library. */
	ftps_lib_status status;	        
} FTPS_INIT_CFM_T;


/*!
     @brief This message is sent when an remote client attempts to make a
     connection.
*/
typedef struct
{
	/*! FTPS Session Handle.*/
	FTPS    *session;		
	/*! Bluetooth address of the remote client. */
	bdaddr  bd_addr;		
	/*! Maximum size of packet supported by this GOEP connection */
	uint16  maxPacketLen;	
} FTPS_CONNECT_IND_T;


/*!
     @brief This message is sent when a remote connection completes.
*/
typedef struct
{
	/*! FTPS Session Handle.*/
	FTPS            *session;	    
	/*! The current status of the FTPS library. */
	ftps_lib_status status;     	
	/*! Maximum size of packet supported by this GOEP connection */
	uint16          maxPacketLen;	
} FTPS_CONNECT_CFM_T;


/*!
     @brief This message indicates that the remote client has started a
     DISCONNECT request.
*/
typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
} FTPS_DISCONNECT_IND_T;


/*!
     @brief This message is sent when a remote device performs an OBEX Get.
*/
typedef struct
{
	FTPS    *session;			/*!< FTPS Session Handle.*/
    Source  src;				/*!< Source. */
    uint16  nameLen;
    uint16  nameOffset;
    uint16  typeLen;
    uint16  typeOffset;
} FTPS_GETOBJECT_START_IND_T;


/*!
	@brief This message is receieved when a PUT request starts.
*/
typedef struct 
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
    Source  src;			/*!< Source. */
    uint16  nameOffset;		/*!< Offset to name. */
    uint16  nameLen;		/*!< Length of name. */
    uint16  typeOffset;		/*!< Offset to type. */
    uint16  typeLen;		/*!< Length of type. */
    uint32  totalLength;	/*!< Total length of the object. */
    uint16  dataOffset;		/*!< Offset to data. */
    uint16  dataLength;		/*!< Length of data. */
    bool    moreData;		/*!< More data? Yes(TRUE) or No(FALSE). */
} FTPS_PUTOBJECT_START_IND_T;


/*!
	@brief This message is received when more of the data requested has
	arrived.

	GoepGetCompletePacket MUST be called for each GOEP_GET_DATA_IND received
	before asking for the next packet using GoepGetNext.
*/
typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
    Source  src;			/*!< Source. */
    uint16  dataOffset;		/*!< Offset to data. */
    uint16  dataLength;		/*!< Length of data. */
    bool    moreData;		/*!< More data? Yes(TRUE) or No(FALSE). */
} FTPS_PUTOBJECT_DATA_IND_T;


/*!
	@brief This message is received when a PUT requeste has completed.
*/
typedef struct
{
	FTPS            *session;	/*!< FTPS Session Handle.*/
    ftps_lib_status status;	    /*!< The current status of the FTPS library. */
} FTPS_PUTOBJECT_COMPLETE_IND_T;


typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
    Source  src;			/*!< Source. */
    uint16  nameOffset;		/*!< Offset to name. */
    uint16  nameLength;		/*!< Length of name. */
} FTPS_DELETEOBJECT_IND_T;


/*!
     @brief This message indicates the start of a remote GET FOLDER request.
*/
typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
} FTPS_GETFOLDER_START_IND_T;


/*!
    @brief This message indicates that the remote client is ready for more
    folder data.
*/
typedef struct
{
	FTPS    *session;			/*!< FTPS Session Handle.*/
} FTPS_GETFOLDER_DATA_IND_T;


/*!
    @brief This message indicates that the GET FOLDER request has completed.
*/
typedef struct
{
	FTPS            *session;	/*!< FTPS Session Handle.*/
    ftps_lib_status status;	    /*!< The current status of the FTPS library. */
} FTPS_GETFOLDER_COMPLETE_IND_T;


/*!
    @brief This message indicates that the remote client is ready for the next
    data packet of an object.
*/
typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
} FTPS_GETOBJECT_DATA_IND_T;


/*!
    @brief This message indicates that a GET OBJECT request has completed.
*/
typedef struct
{
	FTPS            *session;	/*!< FTPS Session Handle.*/
    ftps_lib_status status;	    /*!< The current status of the FTPS library. */
} FTPS_GETOBJECT_COMPLETE_IND_T;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -