Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

bridge.cpp should not use String #11

Open
agdl opened this issue Jul 12, 2016 · 2 comments
Open

bridge.cpp should not use String #11

agdl opened this issue Jul 12, 2016 · 2 comments
Assignees

Comments

@agdl
Copy link
Member

agdl commented Jul 12, 2016

From @jantje on January 28, 2014 16:27

Currently the bridge library relies on the String class for put command. I think that including String only for put is a bit expensive. The author probably agrees with this as the code has following comment

// TODO: do it in a more efficient way

I think extending transfer to another data set and this (untested) code would be far better

void BridgeClass::put(const char *key, const char *value) {
transfer("D",1,key,strlen(key),"\xFE",1,value,strlen(value));
}
Best regards
Jantje

Copied from original issue: arduino/Arduino#1831

@agdl
Copy link
Member Author

agdl commented Jul 12, 2016

From @bigjosh on March 31, 2014 22:2

I agree. These strings use up precious RAM and fail silently when dynamic RAM runs out. I'd prefer if all the Bridge functions used statically allocated buffers becuase they would be much more efficient in time and memory and at least you would know when you ran out of RAM at compile time rather than crashing at run time.

@jantje
Copy link

jantje commented Jul 12, 2016

This is a more than 2 year old issue. I'm surprised there is still some action :-)

@per1234 per1234 changed the title bridge.cpp should not use string. bridge.cpp should not use String May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants