123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #pragma once
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 EBUS_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // EBUS_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- /*
- #ifndef EBUS_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "eBusX64D.lib")
- #else
- #pragma comment(lib, "eBusX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "eBusD.lib")
- #else
- #pragma comment(lib, "eBus.lib")
- #endif
- #endif
- #endif
- #ifdef EBUS_EXPORTS
- #define EBUS_API __declspec(dllexport)
- #define EBUS_C_API extern "C" __declspec(dllexport)
- #else
- #define EBUS_API __declspec(dllimport)
- #define EBUS_C_API extern "C" __declspec(dllimport)
- #endif
- */
- #include "DeviceBus.h"
- #define EBUS_CONNECTION_LOCAL ("Local")
- #define EBUS_CONNECTION_BUSID ("BusId")
- #define EBUS_CONNECTION_PORT ("Port")
- #define EBUS_CONNECTION_ROUTERIP ("RouterIp")
- /*
- /// <summary>
- /// 完成eBus服务的初始化
- /// </summary>
- /// <param name="EnableLog"> 使能日志 </param>
- /// <returns></returns>
- void InitEbusEnv(bool EnableLog);
- /// <summary>
- /// 清理eBus服务
- /// </summary>
- /// <returns></returns>
- void QuitEbusEnv(); //
- /// <summary>
- /// 设备bus实现,使用eBus和p2p 两个通道;完成ccos包的收发,含大对象(图像),p2p收到的包转回 Service处理
- /// </summary>
- class eBus : public DeviceBUS
- {
- HANDLE m_pBusService; //实际的eBus实现服务对象
- bool TryGetConnectOptions(ResDataObject &connection, const char *pKey, ResDataObject &result);
- public:
- eBus(void);
- virtual ~eBus(void);
- //Local Connection
- //Local:1
- //Port:xxx (OPTIONAL)
- //srcBusId:BusId
- //Ethernet Connection
- //Local:0
- //Port:xxx (OPTIONAL)
- //RouterIp:ipaddress
- //srcBusId:BusId
- virtual bool Connect(ResDataObject &connection);
- virtual void DisConnect();
- virtual bool IsConnected();
- virtual void Quit();
- virtual void SetLogPath(const char *pPath);
- virtual bool SendSMPacket(const char *pTargetID, const char *pContext, unsigned long long nShareMemID);
- virtual bool SendRawPacket(const char *pTargetID, const char *pContext, DWORD ChannelId);
- virtual bool SendPacket(const char *pTargetID, const char *pContext, const char *pBlock = NULL, DWORD BlockSize = 0);
- virtual void BlobDataArrived(const char *pMsg, unsigned char *pBlockData, DWORD BlockDataLen);
-
- virtual void InitP2P(const char *pszIp, const char *pszLocalBusId, bool AsServer);
- virtual void UnRegistThread(DWORD Tid);
- };
- */
|