<commit_before>#include "SerialBuster.h"
#include "Buffer.h"

SerialBuster sb = SerialBuster(512, 512);
long mover = 0;

void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  sb.init(115200);
  //sb.setCallback(incomingPacket);
  delay(50);
}

void loop() {
  sb.update();
  if(mover++ % 4000 == 0) {

    const uint8_t * payload = (const uint8_t *)"Hello from Arduino.";
    sb.sendPacket(254, payload, 19);

    int a = availableMemory();
    float percent = ((float)a) / 2048.0;
    Serial.print("mem: ");
    Serial.println(percent * 100);
  }
}

// only for debugging
int availableMemory() {
  int size = 2048; // Use 2048 with ATmega328
  byte *buf;
  while ((buf = (byte *) malloc(--size)) == NULL)
    ;

  free(buf);
  return size;<commit_msg>Sending real packet for testing<commit_after>#include "SerialBuster.h"
#include "Buffer.h"

SerialBuster sb = SerialBuster(256, 256, 128);
long mover = 0;

void setup() {
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  sb.init(9600);
  //sb.setCallback(incomingPacket);
  delay(50);
}

void loop() {
  sb.update();
  if(mover++ % 10000 == 0) {

    const uint8_t * payload = (const uint8_t *)"An end (\x03) char!";
    sb.sendPacket(255, payload, strlen((const char *)payload));
    
//    int a = availableMemory();
//    float percent = ((float)a) / 2048.0;
//    Serial.print("mem: ");
//    Serial.println(percent * 100);
  }
}

// only for debugging
int availableMemory() {
  int size = 2048; // Use 2048 with ATmega328
  byte *buf;
  while ((buf = (byte *) malloc(--size)) == NULL)
    ;

  free(buf);
  return size;
{'fraction_non_alphanumeric': 0.17328292375551355, 'fraction_numerical': 0.06427221172022685, 'mean_word_length': 3.326975476839237, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7468080', 'n_tokens_mistral': 660, 'n_tokens_neox': 573, 'n_words': 145}