modulecomm_fastrtps_tcp.cpp 1.8 KB

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