use UDP for v-master

Ansicht von 1 Antwort-Thema
  • Autor
    Beiträge
    • #229729
      Paul van Boven
      Teilnehmer

      Hello,

      I have the following question:

      How can I slice incoming UDP commands so I can set a v-master to a value?

      Now I use the following script to read the UDP command.

      // UDP script comment

      RegisterEvent(UdpReceive, OnUdp)

      int nBob;
      nBob = BobAllocate(1800);
      int nLen;
      int nPort;
      string sIpAddress;
      string sText;
      int nDriverHandle;

      sIpAddress=”127.0.0.1″;
      nPort=9813;
      nDriverHandle = GetDriverHandle(“protocol1”);

      Suspend();

      function OnUdp(int nDriverHandle)
      {
      nLen = ReceiveFrom(nDriverHandle, nBob, sIpAddress, nPort);
      sText = BobGetString(nBob, 0, 255);
      printf(“Incoming Message: %s”, sText);
      //var test = sText.slice(1,3);
      //SetSpeedMaster(1, test);

      }

      I receive the command but how do I slice it so I can set the v-master id and value?

      My regards,

      Paul van Boven
      Haenen Audiovisueel

      • Dieses Thema wurde geändert vor 3 Jahre, 9 Monaten von Christoph Paduch. Grund: I have moved this article to the e:script Forum, because it is a programming question
    • #229731
      Christoph Paduch
      Moderator

      Hello Paul

      it would be helpful to see, how the UDP messages look like.
      Given the structure of the message, it is possible to answer this question.

      The String.slice(int start, int end) method looks like the e:script function midstr(string src, int pos, int len) where len = end – start and pos = start.

      I hope this helps.


      Kind regards / Freundliche Grüße
      Christoph Paduch

Ansicht von 1 Antwort-Thema
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.