Hi all,..
ok, I'm still playing with this file transfer mbed->pc routine.
I'm this -> <- close, but my C++ has let me down.
I've trawled the internet, to no avail.
I have a bunch of values sitting in an Eeprom, and I want to make them into one MASSIVE string.
(about 6k)
that can be sent back from an RPC Call. The mechanism works.. (I have written a java utility that requests the file from mbed and then saves it down to disk on the pc, and it works)
EXCEPT, the following C code is soooo slow, that my mbed crashes. (it's doing other interrupt stuff).
anyway.. could someone help me to rewrite what is below, into proper code please. (except I need to up the loop to about 1000 values)
char* sendFile() {
string c;
c = 0x02; //start of transmission string : It's listening for this at the other end.
float f;
char* num;
string b;
for (int i = 30; i > 0 ; i--) {
f = getEepromStoreValue24(i); //returns a float from the Eeprom.
num = ftostr(f);
b = num;
c+=b;
c+="\r\n";
}
c += 0x04; //End of transmission. (it's listening for it)
char* p = (char*)b.c_str();
return p;
}
char* ftostr(float myfloat) {
char ans[20];
snprintf(ans, 20, "%f", myfloat);
return ans;
}
Hi all,..
ok, I'm still playing with this file transfer mbed->pc routine. I'm this -> <- close, but my C++ has let me down.
I've trawled the internet, to no avail.
I have a bunch of values sitting in an Eeprom, and I want to make them into one MASSIVE string. (about 6k)
that can be sent back from an RPC Call. The mechanism works.. (I have written a java utility that requests the file from mbed and then saves it down to disk on the pc, and it works)
EXCEPT, the following C code is soooo slow, that my mbed crashes. (it's doing other interrupt stuff).
anyway.. could someone help me to rewrite what is below, into proper code please. (except I need to up the loop to about 1000 values)