mobile CCTV,mobile surveillance,police body worn cameras

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

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

[copyURL]

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
jumpTo
owner
poston 2020-8-17 16:55 | authorOnly 回帖奖励 |倒序浏览 |阅读模式

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

60

主题

1410

帖子

5785

积分

Moderator

Rank: 7Rank: 7Rank: 7

积分
5785
sofa
poston 2020-8-17 16:57 | authorOnly
请加微信13355692871
reply agree Against

使用道具 report

1

主题

580

帖子

1999

积分

vipMem

Rank: 6Rank: 6

积分
1999
bench
poston 2020-8-17 17:02 | authorOnly
您好,请问用的是什么设备呢? ftp接口已经不推荐使用,且android设备已经不再支持。android设备 查询/下载文件,分别使用BVCU_SUBMETHOD_SEARCH_LIST命令和BVCU_FileTransfer_Open接口。
reply agree Against

使用道具 report

60

主题

1410

帖子

5785

积分

Moderator

Rank: 7Rank: 7Rank: 7

积分
5785
ground
poston 2020-8-17 17:03 | authorOnly
FTP接口是针对老一代的基于海思芯片的嵌入式LINUX设备的,
目前主流的安卓终端已经废弃了这种旧的接口,改用全新的优化的文件上传、下载的接口了。
reply agree Against

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

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

使用道具 report

1

主题

580

帖子

1999

积分

vipMem

Rank: 6Rank: 6

积分
1999
6#
poston 2020-8-17 17:11 | authorOnly
zhu52170341 post on2020-8-17 17:05
全新的优化的文件上传、下载的接口是哪个   有技术文档吗?

https://github.com/besovideo/bvcusdk
https://gitee.com/besovideo/bvcusdk
c#demo中有示例代码。
查询文件:BVCU_SUBMETHOD_SEARCH_LIST命令
下载文件:BVCU_FileTransfer_Open接口。
reply agree Against

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
7#
 Owner| poston 2020-8-17 17:13 | authorOnly
没有C++的demo吗?
reply agree Against

使用道具 report

60

主题

1410

帖子

5785

积分

Moderator

Rank: 7Rank: 7Rank: 7

积分
5785
8#
poston 2020-8-17 17:14 | authorOnly
底层都是C++,只是界面是C#的,没本质区别。您仔细研究下即可。
reply agree Against

使用道具 report

1

主题

4

帖子

23

积分

newBie

Rank: 1

积分
23
9#
 Owner| poston 2020-8-18 09:51 | authorOnly
请问一下 方便QQ或者微信联系吗?QQ:419273936   VX :z7899999
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-4-19 17:59 , Processed in 0.066402 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList