<commit_before>/*
  Send AT Commands to Sim900 via Serial

  Sketch can be used to configure Sim900 shield

  Notes:
  - Notice that the baud rate for the shield connection is 4800. This
    is a workaround for SMS messages greater than 64 characters. Another
    option is to increase the buffer size defined in the Software Serial
    library.
  - The GSM shield will need to be set to listen at this baud rate. The
    AT command to use is "AT+IPR=4800"

  Created 14 6 2014
  Modified 14 6 2014
*/
#include <SoftwareSerial.h>

// GSM Shield uses software serial on pins 7, 8. Need to
// switch jumpers and do some soldering to enable software serial.
//
// NOTE: Software serial does not seem to work with this shield using
// 8 Mhz Arduinos
//
SoftwareSerial Sim900(7, 8);

const int MAX_BUFFER_SIZE = 100;

void setup()
{
  Serial.begin(9600);
  Sim900.begin(4800);

  Serial.println("Sim900 Command Console");
  Serial.println("----------------------");
}


void loop()
{
  char buffer[MAX_BUFFER_SIZE];
  int inputLength = 0;

  Serial.println("Enter AT command: ");

  while (!Serial.available())
  {
    delay(100);
  }

  inputLength = Serial.readBytesUntil('\n', buffer, MAX_BUFFER_SIZE - 1);
  buffer[inputLength] = '\0';

  Sim900.println(buffer);
  delay(100);
}<commit_msg>Fix bug with console not displaying messages from shield<commit_after>/*
  Send AT Commands to Sim900 via Serial

  Sketch can be used to configure Sim900 shield

  Notes:
  - Make sure shield is manually powered on (ie, red light is on)
  - Notice that the baud rate for the shield connection is 4800. This
    is a workaround for SMS messages greater than 64 characters. Another
    option is to increase the buffer size defined in the Software Serial
    library.
  - The GSM shield will need to be set to listen at this baud rate. The
    AT command to use is "AT+IPR=4800"

  Created 14 6 2014
  Modified 22 6 2014
*/
#include <SoftwareSerial.h>

// GSM Shield uses software serial on pins 7, 8. Need to
// switch jumpers and do some soldering to enable software serial.
//
// NOTE: Software serial does not seem to work with this shield using
// 8 Mhz Arduinos
//
SoftwareSerial Sim900(7, 8);

const int MAX_BUFFER_SIZE = 100;

void setup()
{
  Serial.begin(19200);
  Sim900.begin(19200);

  Serial.println("Sim900 Command Console");
  Serial.println("----------------------");
}


void loop()
{
  char buffer[MAX_BUFFER_SIZE];
  int inputLength = 0;

  Serial.println("Enter AT command: ");

  while (!Serial.available())
  {
    delay(100);
  }

  inputLength = Serial.readBytesUntil('\n', buffer, MAX_BUFFER_SIZE - 1);
  buffer[inputLength] = '\0';

  Sim900.println(buffer);

  // Give some time for GSM shield to process command
  delay(500);

  // Listen for input from GSM shield.
  while (Sim900.available())
  {
    Serial.write(Sim900.read());
  }
}
{'fraction_non_alphanumeric': 0.10756832515767344, 'fraction_numerical': 0.049754730203223546, 'mean_word_length': 3.155749636098981, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4629381', 'n_tokens_mistral': 982, 'n_tokens_neox': 843, 'n_words': 352}