Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Files

ftp-c.h/ftp-c.c

Prototype

Code Block
          CPU_BOOLEAN  FTPc_Open (       FTPc_CONN        *p_conn,
                                  const  FTPc_CFG         *p_cfg,
                                  const  FTPc_SECURE_CFG  *p_secure_cfg,                                    
								         CPU_CHAR         *p_host_server, 
                                         CPU_INT16U        port_nbr, 
                                         CPU_CHAR         *p_user, 
                                         CPU_CHAR         *p_pass,
                                         FTPc_ERR         *p_err);

Arguments

p_conn

Pointer to FTPc Connection object.

...

Notes / Warnings

  • None.

Example Usage

Code Block
          #define  FTP_SERVER_IP_ADDR       "192.168.1.101"
          #define  FTP_SERVER_PORT                      21
           
          #define  FTPc_USER                    "anonymous"
          #define  FTPc_PW               "test@micrium.com"
           
          FTPc_CONN    conn; 
          CPU_INT16U   server_port;
          CPU_BOOLEAN  result;
          FTPc_ERR     err;
           
          server_port = FTP_SERVER_PORT;
           
          result = FTPc_Open(&conn, DEF_NULL, DEF_NULL, FTP_SERVER_IP_ADDR, server_port, FTPc_USER, FTPc_PW, &err);
          if (result != DEF_OK) {
              printf("FTPc_Open() failed.\n\r");
          }


Code Block

          #define  FTP_SERVER_IP_ADDR       "192.168.1.101"
          #define  FTP_SERVER_PORT_SECURE               990
          #define  FTP_COMMON_NAME              "micrium.com"
           
          #define  FTPc_USER                    "anonymous"
          #define  FTPc_PW               "test@micrium.com"
           
          FTPc_CONN        conn;
          CPU_INT16U       server_port;
          CPU_BOOLEAN      result;
          FTPc_SECURE_CFG  ftpc_secure_cfg;
          FTPc_ERR         err;
           
          
          server_port = FTP_SERVER_PORT_SECURE; 
           
          Str_Copy(ftpc_secure_cfg.CommonName, FTP_COMMON_NAME);
          ftpc_secure_cfg.TrustCallback = (NET_SOCK_SECURE_TRUST_FNCT)NetSecure_TrustInvalidSig;
           
          result = FTPc_Open(&conn,
                              DEF_NULL,
                             &ftpc_secure_cfg,
                              FTP_SERVER_IP_ADDR
                              server_port,                            
                              FTPc_USER,                             
                              FTPc_PW,                                                     
                             &err);
          if (result != DEF_OK) { 
              printf("Secure FTPc_Open() failed.\n\r");  
          }