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

📄 ftps.h

📁 CSR蓝牙芯片的ftp程序的服务器端代码 客户端已经上传
💻 H
📖 第 1 页 / 共 2 页
字号:
/*!
	@brief This message is received when a remote client issues a SET PATH to
	SubFolder request.
*/
typedef struct
{
	FTPS    *session;		/*!< FTPS Session Handle.*/
    Source  src;			/*!< Source. */
    uint16  nameOffset;		/*!< Offset to name. */
    uint16  nameLength;		/*!< Length of name. */
	bool    create;			/*!< Create folder if it doesn't exist. */
} FTPS_SETPATH_SUBFOLDER_IND_T;


/*!
     @brief This message indicates that the remote client wishes to set the
     current folder to the root.
*/
typedef struct
{
	FTPS    *session;			/*!< FTPS Session Handle.*/
} FTPS_SETPATH_ROOT_IND_T;


/*!
     @brief This message indicates that the remote client wishes to set the
     current folder to the parent folder.
*/
typedef struct
{
	FTPS    *session;			/*!< FTPS Session Handle.*/
} FTPS_SETPATH_PARENT_IND_T;




/*   Downstream API for the FTPS Library   */


/*!
	@brief Initialise the FTPS Library.

	@param theAppTask The current application task.

	@param priority The profile instance low power mode priority. For a set of
	profile instances with connections on a given ACL the instance with the
	highest priority value wins and the low power mode on the ACL is set
	according to it's power table.
	
	FTPS_INIT_CFM message will be received by the application. 
*/
void FtpsInit(Task theAppTask, uint16 priority);

		
/*!
    @brief Respond to a connection request.  
    @param session FTPS Session Handle.
    @param accept TRUE to accept the connection, or FALSE to refuse it.
    @param pktSize Maximum packet size that can be accepted on this connection.
    @param type Server type - Is the server read only?
	
	This function should be called on recept of a FTPS_CONNECT_IND message.
	A FTPS_CONNECT_CFM message will be received on completion.
*/
void FtpsConnectResponse(FTPS *session, bool accept, uint16 pktSize, ftps_serv_type type);


/*!
    @brief Send the first packet of a folder listing.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param packet The first packet
    @param totalLen Total length of the folder listing
    @param onlyPacket Is this the only packet to transfer.
	
	If data is in a VM Source (e.g. from the filesystem),
	FtpsGetFolderFirstPacketSource should be used instead of
	FtpsGetFolderFirstPacket.
	
	This function should be called on receipt of a FTPS_GETFOLDER_START_IND message.
	A FTPS_GETFOLDER_DATA_IND message will be received to request the next packet.
	A FTPS_GETFOLDER_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetFolderFirstPacket(FTPS *session, const uint16 size_packet,  const uint8 *packet, const uint32 totalLen, const bool onlyPacket);


/*!
    @brief Send the next packet of a folder listing.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param packet The next packet
    @param lastPacket Is this the last packet to transfer.
	
	If data is in a VM Source (e.g. from the filesystem),
	FtpsGetFolderNextPacketSource should be used instead of
	FtpsGetFolderNextPacket.
	
	This function should be called on receipt of a FTPS_GETFOLDER_DATA_IND message.
	A FTPS_GETFOLDER_DATA_IND message will be received to request the next packet.
	A FTPS_GETFOLDER_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetFolderNextPacket(FTPS *session, const uint16 size_packet,  const uint8 *packet, const bool lastPacket);


/*!
    @brief Send the first packet of a folder listing.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param src The source containing the packet
    @param offset The offset into the source
    @param totalLen Total length of the folder listing
    @param onlyPacket Is this the only packet to transfer.
	
	This function should be called on receipt of a FTPS_GETFOLDER_START_IND message.
	A FTPS_GETFOLDER_DATA_IND message will be received to request the next packet.
	A FTPS_GETFOLDER_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetFolderFirstPacketSource(FTPS *session, const uint16 size_packet,  Source src, uint16 offset, const uint32 totalLen, const bool onlyPacket);


/*!
    @brief Send the next packet of a folder listing.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param src The source containing the packet
    @param offset The offset into the source
    @param lastPacket Is this the last packet to transfer.
	
	This function should be called on receipt of a FTPS_GETFOLDER_DATA_IND message.
	A FTPS_GETFOLDER_DATA_IND message will be received to request the next packet.
	A FTPS_GETFOLDER_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetFolderNextPacketSource(FTPS *session, const uint16 size_packet,  Source src, uint16 offset, const bool lastPacket);


/*!
    @brief Send the first packet of a get object request.  
    @param session FTPS Session Handle.
    @param size_name Length of this name
    @param name The first packet
    @param size_type Length of this type
    @param type The first packet
    @param size_packet Length of this packet
    @param packet The first packet
    @param totalLen Total length of the folder listing
    @param onlyPacket Is this the only packet to transfer.
	
	If data is in a VM Source (e.g. from the filesystem),
	FtpsGetObjectFirstPacketSource should be used instead of
	FtpsGetObjectFirstPacket.
	
	This function should be called on receipt of a FTPS_GETOBJECT_START_IND message.
	A FTPS_GETOBJECT_DATA_IND message will be received to request the next packet.
	A FTPS_GETOBJECT_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetObjectFirstPacket(FTPS *session, const uint16 size_name,  const uint8 *name,  const uint16 size_type,  const uint8 *type, const uint16 size_packet,  const uint8 *packet, const uint32 totalLen, const bool onlyPacket);


/*!
    @brief Send the next packet of a get object request.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param packet The first packet
    @param lastPacket Is this the last packet to transfer.
	
	If data is in a VM Source (e.g. from the filesystem),
	FtpsGetObjectNextPacketSource should be used instead of
	FtpsGetObjectNextPacket.
	
	This function should be called on receipt of a FTPS_GETOBJECT_DATA_IND message.
	A FTPS_GETOBJECT_DATA_IND message will be received to request the next packet.
	A FTPS_GETOBJECT_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetObjectNextPacket(FTPS *session, const uint16 size_packet,  const uint8 *packet, const bool lastPacket);


/*!
    @brief Send the first packet of a get object request.  
    @param session FTPS Session Handle.
    @param size_name Length of this name
    @param name The first packet
    @param size_type Length of this type
    @param type The first packet
    @param size_packet Length of this packet
    @param src The source containing the packet
    @param offset The offset into the source
    @param totalLen Total length of the folder listing
    @param onlyPacket Is this the only packet to transfer.
	
	This function should be called on receipt of a FTPS_GETOBJECT_START_IND message.
	A FTPS_GETOBJECT_DATA_IND message will be received to request the next packet.
	A FTPS_GETOBJECT_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetObjectFirstPacketSource(FTPS *session, const uint16 size_name,  const uint8 *name, const uint16 size_type,  const uint8 *type, const uint16 size_packet,  Source src, uint16 offset, const uint32 totalLen, const bool onlyPacket);


/*!
    @brief Send the next packet of a get object request.  
    @param session FTPS Session Handle.
    @param size_packet Length of this packet
    @param src The source containing the packet
    @param offset The offset into the source
    @param lastPacket Is this the last packet to transfer.
	
	This function should be called on receipt of a FTPS_GETOBJECT_DATA_IND message.
	A FTPS_GETOBJECT_DATA_IND message will be received to request the next packet.
	A FTPS_GETOBJECT_COMPLETE_IND message will be received after sending the final packet.
*/
void FtpsGetObjectNextPacketSource(FTPS *session, const uint16 size_packet,  Source src, uint16 offset, const bool lastPacket);


/*!
    @brief Send a reject response to a get object request.  
    @param session FTPS Session Handle.
    @param reason Reason to reject the request.
	
	This function can be called on receipt of a FTPS_GETOBJECT_START_IND message to inform the
	remote client that it can not have the requested object.
*/
void FtpsGetObjectReject(FTPS *session, ftps_transfer_reason reason);

/*!
    @brief Request the next packet during a Remote PUT operation.  
	
    @param session FTPS Session Handle.
	
    @param moreData TRUE if expecting more data, else False not expecting more
    data.
	
	This function should be called on receipt of a FTPS_PUTOBJECT_START_IND or FTPS_PUTOBJECT_DATA_IND
	to indicate to the client that the packet has been received and the server is ready for the next.
	A FTPS_PUTOBJECT_COMPLETE_IND message will be received after the last packet has arrived.
*/
void FtpsPutObjectGetNextPacket(FTPS *session, bool moreData);


/*!
    @brief Send a reject response to a put object request.  
    @param session FTPS Session Handle.
    @param reason Reason to reject the request.
	
	This function can be called on receipt of a FTPS_PUTOBJECT_START_IND message to inform the
	remote client that the server is rejecting the object transfer.
*/
void FtpsPutObjectReject(FTPS *session, ftps_transfer_reason reason);


/*!
	@brief Send the result of a DELETE request.
	@param session FTPS Session Handle.
	@param success. Was the request successful?
	
	This function should be called on receipt of a FTPS_DELETEOBJECT_IND message.
*/
void FtpsDeleteResponse(FTPS *session, bool success);


/*!
	@brief Send the result of a SETPATH Root request.
	@param session FTPS Session Handle.
	@param result Result of a SETPATH request.
	
	This function should be called on receipt of a FTPS_SETPATH_ROOT_IND message.
*/
void FtpsSetPathRootResponse(FTPS *session, ftps_setpath_result result);


/*!
	@brief Send the result of a SETPATH Parent request.
	@param session FTPS Session Handle.
	@param result Result of a SETPATH request.
	
	This function should be called on receipt of a FTPS_SETPATH_PARENT_IND message.
*/
void FtpsSetPathParentResponse(FTPS *session, ftps_setpath_result result);


/*!
	@brief Send the result of a SETPATH Subfolder request.
	@param session FTPS Session Handle.
	@param result Result of a SETPATH request.
	
	This function should be called on receipt of a FTPS_SETPATH_SUBFOLDER_IND message.
*/
void FtpsSetPathSubFolderResponse(FTPS *session, ftps_setpath_result result);


/*!
	@brief The packet received has been processed and is no longer needed.
	@param session FTPS Session Handle (as returned in FTPS_INIT_CFM).
	
	Every packet send to the client that contains a source must be declared
	complete before the next function is called.  e.g. When a
	OPPS_PUSH_OBJ_START_IND has been received, FtpsPacketComplete must be
	called before calling FtpsPutObjectGetNextPacket.
	
	No message is received on completion.
*/
void FtpsPacketComplete(FTPS *session);

		
#endif /* FTPS_H_ */


⌨️ 快捷键说明

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