Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

UDP SendAll fails after number of chars reaches 1473

$
0
0

@Collin_Schupman wrote:

I am sending char * from OF to a teensy board.

Here is my OF code:

void ofApp::draw() {
    string message = "";
    int total = 1472;
    for (int i = 0; i < total; i++) {
        message += (char)ofRandom(0,255);
    }
    udpConnection.SendAll(message.c_str(), message.length());
}

Here is my teensy code:

void loop() {
  int packetSize = Udp.parsePacket();
  if (packetSize) {
    Serial.println("Got it!");
    Udp.read((char*)packetBuffer, 648*3);
    for (int i = 0; i <  3*NUM_LEDS; i+=3) {
      leds[i/3].setRGB(packetBuffer[i], packetBuffer[i+1], packetBuffer[i+2]);
    }
    FastLED.show();
  }
}

The teensy code responds when it receives a packet of any size, which works fine up to 1472 chars. In the OF code, as soon as the length of the char * length is increased to 1473, the teensy stops receiving anything, and I am not getting any run time errors OF-side. Does anyone know why this would happen/what the fix is? I need to scale this up to 1944 chars eventually

Thanks,

Collin

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles