modulecomm_fastrtps_tcp.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "modulecomm_fastrtps_tcp.h"
  2. //#include "procsm_if.h"
  3. //#include "procsm.h"
  4. #include "modulecomm_impl.h"
  5. namespace iv {
  6. namespace modulecomm_fastrtps_tcp {
  7. void * RegisterSend(const char * strcommname,const unsigned int nBufSize,const unsigned int nMsgBufCount,unsigned int nListenPort)
  8. {
  9. modulecomm_impl * pif = new modulecomm_impl(strcommname,modulecomm_impl::type_send,nListenPort);
  10. // procsm_if * pif = new procsm_if(strcommname,nBufSize,nMsgBufCount,procsm::ModeWrite);
  11. return (void *)pif;
  12. }
  13. void * RegisterRecv(const char * strcommname,SMCallBack pCall,const char * strpubip,unsigned int nListenPort)
  14. {
  15. modulecomm_impl * pif = new modulecomm_impl(strcommname,modulecomm_impl::type_recv,nListenPort,strpubip);
  16. // procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead);
  17. pif->listenmsg(pCall);
  18. return (void *)pif;
  19. }
  20. void * MODULECOMMFASTRTPSTCPSHARED_EXPORT RegisterRecvPlus(const char * strcommname,ModuleFun xFun,const char * strpubip,unsigned int nListenPort)
  21. {
  22. modulecomm_impl * pif = new modulecomm_impl(strcommname,modulecomm_impl::type_recv,nListenPort,strpubip);
  23. // procsm_if * pif = new procsm_if(strcommname,0,0,procsm::ModeRead);
  24. pif->listenmsg(xFun);
  25. return (void *)pif;
  26. }
  27. void ModuleSendMsg(void * pHandle,const char * strdata,const unsigned int nDataLen)
  28. {
  29. modulecomm_impl * pif= (modulecomm_impl *)pHandle;
  30. // procsm_if * pif = (procsm_if *)pHandle;
  31. pif->writemsg(strdata,nDataLen);
  32. }
  33. void Unregister(void * pHandle)
  34. {
  35. modulecomm_impl * pif= (modulecomm_impl *)pHandle;
  36. // procsm_if * pif = (procsm_if *)pHandle;
  37. delete pif;
  38. }
  39. void PauseComm(void *pHandle)
  40. {
  41. // procsm_if * pif = (procsm_if *)pHandle;
  42. // pif->pausecomm();
  43. }
  44. void ContintuComm(void *pHandle)
  45. {
  46. // procsm_if * pif = (procsm_if *)pHandle;
  47. // pif->continuecomm();
  48. }
  49. }
  50. }