mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
view: 751|reply: 8
打印 prevThread nextThread

使用MFC 通过FTP访问设备文件

[copyURL]

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
jumpTo
owner
poston 2020-8-17 16:55 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

void ms_On_Ftp_Event(BVCU_FTP_HSession hSession, int iEventCode, void* pParam)
{
        BVCU_Result result = ((BVCU_Event_Common*)pParam)->iResult;
        printf_s("\n\n=========ms_On_Ftp_Event: hSession:%d, iEventCode:%d, result:%d.\n\n", hSession, iEventCode, result);
}
void ms_On_Ftp_Cmd(BVCU_FTP_HSession hSession, BVCU_FTP_Command* pCommand, int iEventCode, void* pParam)
{
        BVCU_Event_SessionCmd* sessionCmd = (BVCU_Event_SessionCmd*)pParam;
        int dataCount = sessionCmd->stContent.iDataCount;

        string * fileNames = new string[dataCount];
        BVCU_FTP_RecordFileInfo* infos = (BVCU_FTP_RecordFileInfo*)(sessionCmd->stContent.pData);
        for (int i = 0;i < dataCount;i++)
        {
                fileNames[i] = string(infos[i].szFileName);
        }

        printf_s("\n\n---------ms_On_Ftp_Cmd: hSession:%d, iResult:%d, dataCount:%d, iEventCode:%d.\n",
                hSession, sessionCmd->iResult, dataCount, iEventCode);
        for (int i = 0;i < dataCount; i++)
        {
                printf_s("fileName: %s\n", fileNames[i]);
        }
}

void Login_Ftp()
{
        BVCU_FTP_ServerParam pParam;//= new BVCU_FTP_ServerParam();

    memset(&pParam, 0, sizeof(pParam));
    pParam.iSize = sizeof(pParam);
    pParam.hSession = CMLibBVCU::m_session;
    strcpy_s(pParam.szID, sizeof(pParam.szID), "PU_273A");
    memset(pParam.szUserName, 0, sizeof(pParam.szUserName));
    memset(pParam.szPassword, 0, sizeof(pParam.szPassword));
    memset(pParam.szServerAddr, 0, sizeof(pParam.szServerAddr));
    //strcpy_s(pParam.szUserName, sizeof(pParam.szUserName), "");
    //strcpy_s(pParam.szPassword, sizeof(pParam.szPassword), "");
    //strcpy_s(pParam.szServerAddr, sizeof(pParam.szServerAddr), "");
    pParam.iServerPort = 0;
    pParam.iTimeOut = 10000;// loginTimeOut <= 0 ? 300000 : loginTimeOut;
    pParam.iKeepAliveInterval = 0;

    pParam.OnEvent = ms_On_Ftp_Event;
        BVCU_FTP_HSession* m_FtpSessionHandle;
    BVCU_Result ret = BVCU_FTP_Login(&m_FtpSessionHandle, &pParam);
        printf_s("\n\n+++++++++++++BVCU_FTP_Login:%d\n\n", ret);
}

void Query_Ftp_Record()
{
        BVCU_FTP_Command cmd;
    memset(&cmd, 0, sizeof(BVCU_FTP_Command));
    cmd.iSize = sizeof(BVCU_FTP_Command);
    cmd.iMethod = BVCU_FTP_METHOD_SEARCH_RECORDFILE;// BVCU_FTP_METHOD_SEARCH_RECORDFILE;
    cmd.OnEvent = ms_On_Ftp_Cmd;
    cmd.iTimeOut = 10000;

    cmd.stMsgContent.iDataCount = 1;

    BVCU_FTP_RecordFileFilter recordFilter;// = new BVCU_FTP_RecordFileFilter();
    memset(&recordFilter, 0, sizeof(recordFilter));
    strcpy_s(recordFilter.szPUID, sizeof(recordFilter.szPUID), "PU_273A");
    //strcpy_s(recordFilter->szPUName, sizeof(recordFilter->szPUName), "CYYHDMDVR2737");
    recordFilter.iChannelIndex = -1;// channelIndex < 0 ? -1 : channelIndex;//如果小于0,则设置为-1,查询所有
    recordFilter.iFileType = 0;
    recordFilter.iTimeBegin = 1407132000000000;// mktime(t_startTime) * 1000000;
    recordFilter.iTimeEnd = 1407218400000000;// mktime(t_endTime) * 1000000;

    cmd.stMsgContent.iDataCount = 1;
    cmd.stMsgContent.pData = &recordFilter;

    BVCU_Result ret = BVCU_FTP_SendCommand(m_FtpSessionHandle, &cmd);
        printf_s("\n\n+++++++++++++BVCU_FTP_SendCommand:%d\n\n", ret);
}
---------------------------------------------------------
以上是MFCDEMO 里面的代码 都是被注释起来了,  我想通过FTP访问设备文件,

请问一下  BVCU_Event_SessionCmd,BVCU_FTP_HSession等  这个数据结构定义的头文件是哪个?在MFCDEMO里我没找到 ,开发手册里没有







本帖子中包含更多资源

pls login 才可以下载或查看,没有帐号?registerNow

x
reply

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
sofa
 Owner| poston 2020-8-17 17:05 | 显示全部楼层
全新的优化的文件上传、下载的接口是哪个   有技术文档吗?
reply agree Against

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
bench
 Owner| poston 2020-8-17 17:13 | 显示全部楼层
没有C++的demo吗?
reply agree Against

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
ground
 Owner| poston 2020-8-18 09:51 | 显示全部楼层
请问一下 方便QQ或者微信联系吗?QQ:419273936   VX :z7899999
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-2 17:15 , Processed in 0.058590 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList