opcuaServer.c 795 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. ============================================================================
  3. Name : opcuaServer.c
  4. Author :
  5. Version :
  6. Copyright : Your copyright notice
  7. Description : lala
  8. ============================================================================
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include "networklayer.h"
  13. #include "ua_application.h"
  14. UA_Int32 serverCallback(void * arg) {
  15. char *name = (char *) arg;
  16. printf("%s does whatever servers do\n",name);
  17. return UA_SUCCESS;
  18. }
  19. int main(int argc, char** argv) {
  20. NL_data* nl = NL_init(&NL_Description_TcpBinary,16664);
  21. // NL_data* nl = NL_init(&NL_Description_TcpBinary,16664,NL_THREADINGTYPE_SINGLE);
  22. appMockup_init();
  23. struct timeval tv = {2, 0}; // 2 seconds
  24. NL_msgLoop(nl, &tv,serverCallback,argv[0]);
  25. }