Arduino hardwareSerial Bluetooth.println not sending string over 310 chars

Hey all I am wondering if my code below can be modified in order for the arduino to send more than 300 chars to a HM-10 bluetooth 4.0 le module?

#include <SoftwareSerial.h>
#define SERIAL_BUFFER_SIZE 512

SoftwareSerial bluetooth(8,9); // RX, TX
String btString;
String comString;
int isVS;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {;}

  Serial.println("PC Side Connected");

  bluetooth.begin(115200);
  while (!bluetooth) {;}

  bluetooth.println("Bluetooth Side Connected");
}

void loop() { 
  if (Serial.available() > 0) {
    //The IDE Sends and the phone receives
    comString = Serial.readString();

    //Check to see if this request is coming from Visual Studio
    isVS = comString.indexOf("_VS");

    if (isVS > -1) {
      //Is coming from Visual Studio so display it over serial port      
    } else {
      //Not coming from VS so send it to the bluetooth phone
      //bluetooth.write(comString);
      bluetooth.println(comString);
    }
  }

  if (bluetooth.available() > 0) {
    //The phone sends and the IDE receives
    btString = bluetooth.readStringUntil('\n');
    Serial.println(btString);
  }
}

As in my code above, i've already tried to add the #define SERIAL_BUFFER_SIZE 512 to the top to give the software serial more buffers but that does not allow me to send more than ~310 chars.

So sending this string:

{MAC:'00-14-22-01-23-45',settings:{rgb:true,quotes:true,sleep:false,timeFrame:{on:'05:30:00',off:'22:30:00'},reset:false,weatherZip:'57104',userInfo:{left:'John Rambo',right:'T100'}},wifiInfo:{Name:'ItBurnsWhenIP',Pwd:'AwHk6gKnsMdxw3boWWAhus5NNCV304YQb/2287QqzH0WnS5W59vCzzW2pR8kgHI79hAUglQOCcBiEKiNWRBQ3oyvyJ0/fDfM1aKa9gfoy3kGHA=='}}

works just fine but if i send out a little more information:

{MAC:'00-14-22-01-23-45',settings:{rgb:true,quotes:true,sleep:false,timeFrame:{on:'05:30:00',off:'22:30:00'},reset:false,weatherZip:'57104',userInfo:{left:'JohnRambo',right:'T100'}},wifiInfo:{Name:'ItBurnsWhenIP',Pwd:'AwHk6gKnsMdxw3boWWAhus5NNCV304YQb/2287QqzH0WnS5W59vCzzW2pR8kgHI79hAUglQOCcBiEKiNWRBQ3oyvyJ0/fDfM1aKa9gfoy3kGHA==','testing out some more strings'}}

It shows everything but the gs'}} at the end on the iphone.

How would i go about fixing this so i can send much more than this?

Hey all I am wondering if my code below can be modified

Are you sure you want our advice? I answered your previous question on stackoverflow (duplicated on this forum here).

In spite of my advice, you are still using SoftwareSerial (instead of AltSoftSerial) and the String class. This sort of truncation is a symptom of exhausting dynamic memory with String. -_-

That's not the problem you are having now. It is probably due to using SoftwareSerial. As I said on stackoverflow:

SoftwareSerial is very inefficient, and it cannot send and receive at the same time. It will lose received data while it is transmitting to the BT. This can also interfere with other parts of your sketch or other libraries.

BTW, defining SERIAL_BUFFER_SIZE does nothing.

Basically, you need to rethink how the Arduino is forwarding information. Instead of trying to buffer a large string (lowercase "string" means a C char array), you should forward the characters as they are received. This will also make your sketch immune to strings that are too long (accidentally, erroneously or maliciously). With only 2K RAM on the UNO, you have to be more careful.

For example, if the PC program sends a special prefix character, you could start forwarding all characters to the BT port. When the end of the command is received (a newline? Some other special sequence?), you can revert to interpreting the Serial characters.

I would suggest taking a look at Serial Input Basics on the Useful Links page. It shows you how to accumulate a little until the special marker are received.

In your case, watch for the start marker, then start forwarding until the end marker is received. Then go back to watching for the start marker again.