Compiling error lecture 7

This forum is for teachers wanting to make use of the course materials "Understanding Radio Communications - using SDRs" Initially moderated by course authors Paolo and Lorenzo, it is the place to ask questions about the materials and learn from the experiences of these and other teachers.
Post Reply
CN8ZE
Posts: 1
Joined: Tue Dec 01, 2020 11:15 am

Compiling error lecture 7

Post: # 36Post CN8ZE »

Hi,
compiling arduino code without any modification for lecture 7, i got the following error:


Arduino : 1.8.13 (Windows 10), Carte : "Arduino Uno"

C:\Users\admin\Desktop\ERA\SDR\URCmaterialsV1.0\Scripts\Scripts\Lectures 7&8\Arduino\CC1101_configurable\cc1101_configurable.ino: In function 'void loop()':

cc1101_configurable:40:65: error: cannot convert 'uint8_t** {aka unsigned char**}' to 'char*' for argument '1' to 'int sprintf(char*, const char*, ...)'

sprintf(pckt.data, "This is message number: %03d\n", ++counter);

^

cc1101_configurable:41:29: error: cannot convert 'uint8_t** {aka unsigned char**}' to 'const char*' for argument '1' to 'size_t strlen(const char*)'

int len = strlen(pckt.data);

^

exit status 1

cannot convert 'uint8_t** {aka unsigned char**}' to 'char*' for argument '1' to 'int sprintf(char*, const char*, ...)'

Please help
Thank you
Lorenzo.Frezza
Posts: 4
Joined: Wed Nov 04, 2020 5:31 pm

Re: Compiling error lecture 7

Post: # 37Post Lorenzo.Frezza »

Dear CN8ZE,
please try to change line 40 of cc1101_configurable to:

Code: Select all

sprintf((char *) pckt.data, "This is message number: %03d\n", ++counter);
and line 41 to:

Code: Select all

int len = strlen((char *) pckt.data);
We cannot reproduce the problem, even though we have the same version of the Arduino IDE, but this edit should fix the problem and will be included in future releases

Lorenzo
Post Reply