modulecomm_fastrtps_tcp.cpp 1.8 KB

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