String is too long

Hey,
I have a function that one of it's parameters is a String.
The String i'm trying to send is 60 characters long and i only get like 54.
Now i understand the problem about String length and memory, but i still need to send that long String.
Someone has any idea how to do that? if its even possible..

Please post your code, my crystal ball is out for repair again. See How to use the forum.

And on forehand, passing long Strings around is kind of asking for trouble on 8-bit micro's.

You can always send a String one char at a time.

" i only get like 54."
Serial (class) function "write (string) " returns exact number of characters written, no need to guess "like".

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

...R

Are you able to determine which side the issue is on? Is only 54 characters being sent or only 54 being received?

smarthings:
Hey,
I have a function that one of it's parameters is a String.
The String i'm trying to send is 60 characters long and i only get like 54.
Now i understand the problem about String length and memory, but i still need to send that long String.
Someone has any idea how to do that? if its even possible..

I have a function . . . But that's all you need to know.
I'm sending it using some software, and receiving it with some other software, but I don't think you need to see either.

Time-waster.

(I wonder what a "smar thing" is? Or a "smart hing", for that matter. And why they come as plurals.)

GrooveFlotilla:
I have a function . . . But that's all you need to know.
I'm sending it using some software, and receiving it with some other software, but I don't think you need to see either.

Time-waster.

(I wonder what a "smar thing" is? Or a "smart hing", for that matter. And why they come as plurals.)

Agreed, no need to divulge any trade secrets.

But knowing the EXACT function used would be helpful. See post #5.

It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

...R

This is something like an auto response! Whenever there is an issue of String (with captital S), the same message as quoted above appears. I thought that it should be @...R who writes the post himself; it is now clear to me that it is an auto response! If something else, @...R is being requested to clarify.

We have char s1[];, string str;, and String str2; to deal with character string. string (a language element of VC++) is not supported by Arduino IDE. Now, we have only String which supports arithmetic operation string concatenation (str2 +=str2;); therefore, we have to use it with carefulness so that the memory is not prematurely exhausted.

So, we have only String which supports arithmetic operation (str2 +=str2;);

Concatenation is not an arithmetic operation.

I've said it before - you don't half post some utter drivel, @GolamMostafa.

Hey,

if its even possible…

Short answer (big S)
Read about C strxxx() functions.

All the String (big S) features are written using them.
They require a little thought and ‘carefulness’, but are far more efficient when applied.

[180316] This not a canned response.

GolamMostafa:
This is something like an auto response!

It's an auto response. I have a little program running on a Mega that scans Forum posts for the word String and then makes the auto-response.

I note with interest that you do not disagree with the auto-response.

...R

Nice work :wink:

It's an auto response. I have a little program running on a Mega that scans Forum posts for the word String and then makes the auto-response.

...and it’s not re-entrant/recursive! Or it would have picked up all the subsequent posts posts posts...

Robin2:
It's an auto response. I have a little program running on a Mega that scans Forum posts for the word String and then makes the auto-response.

I note with interest that you do not disagree with the auto-response.

...R

OT
Would it too bold and inappropriate to ask YOU to answer the OP instead of cluttering airwaves with such automated spam? Even casual forum observer can see you have more than one such canned nonsense.

In case the above is not clear - I do not agree with auto-response of any kind.
It is insulting , shows lack of compassion and is not in spirit of mutual help of this forum.
Shame on you.

232:
OT
Would it too bold and inappropriate to ask YOU to answer the OP instead of cluttering airwaves with such automated spam? Even casual forum observer can see you have more than one such canned nonsense.

In case the above is not clear - I do not agree with auto-response of any kind.
It is insulting , shows lack of compassion and is not in spirit of mutual help of this forum.
Shame on you.

I guess the joke went over at least one head.

Let’s look at most of the replies - including #1

The OP has done nothing to help himself or answer intelligent responses.

Delta_G:
I guess the joke went over at least one head.

While it is certainly possible for a Mega to: search this forum, identify posts / threads that match the pattern of interest, create an OAuth2 authentication token ... wait ... never mind ... It is not possible.

There is also a failure to grasp the limitations of the largest AVR microcontroller.

:smiling_imp:

This will be a test of the time between a post containing the word < String > and the appearance of the canned response. :slight_smile:

Ready, set, Go!

[quote]I have a function that one of it's parameters is a String.
The String i'm trying to send is 60 characters long and i only get like 54.

How do you know that you are only getting like 54 characters?

Note the canned response is empty, and possibly has been used before.