Post a new topicPost a reply Page 1 of 1   [ 6 posts ]
Author Message
 Post subject: Building with #include<WaspSensorSmart.h>
PostPosted: Thu Jul 05, 2012 3:40 pm 

Joined: Wed Dec 14, 2011 11:02 am
Posts: 120
Building with #include<WaspSensorSmart.h> I get the following error:

WaspSensorSmart.h:162: error: 'byte' has not been declared

I get no compilation errors for the inclusion or for any of the method calls. the depenancy tree for WaspSensorSmart.h includes inttypes.h and stdint.h, but I don't see byte declared any where in those.

Was WaspSensorSmart.h simply included but unfinished at my version of the api?

Any advice as to what went wrong is appreciated.


Top
 Profile  
 
 Post subject: Re: Building with #include<WaspSensorSmart.h>
PostPosted: Fri Jul 06, 2012 9:16 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7501
Hi hardya,

it is a strange error, a byte is a type defined in file wiring.h, one of the basic files of the API. A library may have some flaws and can always be improved, but always it is uploaded to our website it is checked that there are no compilation errors. Did you modify any of the API files? Which version are you using? Could you please post the code that returned this error?

Regards.


Top
 OnlineProfile  
 
 Post subject: Re: Building with #include<WaspSensorSmart.h>
PostPosted: Fri Jul 06, 2012 12:00 pm 

Joined: Wed Dec 14, 2011 11:02 am
Posts: 120
Quote:
it is a strange error, a byte is a type defined in file wiring.h, one of the basic files of the API.


That may be but that file never gets included directly or indirectly by WaspSensorSmart.h. And although the depenancy tree for WaspSensorSmart.h includes inttypes.h and stdint.h, but I don't see byte declared any where in those.

Quote:
A library may have some flaws and can always be improved, but always it is uploaded to our website it is checked that there are no compilation errors.


You get the error as soon as you include WaspSensorSmart.h. May be no tests included it?

Quote:
Did you modify any of the API files?


No.

Quote:
Which version are you using?


This happened when I had v21 and now still happens when I have v25.

Quote:
Could you please post the code that returned this error?


Most of my code is not relevant, but if you want to recreate the error take your example program WaspXBee802_2_sending_receivingB and add at the top ...

#include<WaspSensorSmart.h>

...and it will fail. You could also add...

// Initialise Smart Board
SensorSmart.setBoardMode(SENS_ON);
SensorSmart.setSensorMode(SENS_ON, SENS_SMART_EFERGY);
delay(50);

...in setup() and it still fails.

I have successfully compiled loaded and executed using WaspSensorSmart_v20.h instead, however I have been 'told' not to use this because I have boards that just say "Smart Metering" and not "Smart Metering v20".

I would be very grateful for a fix / work around because this is affecting my progrees.

Many thanks in deed.

Andrew


Top
 Profile  
 
 Post subject: Re: Building with #include<WaspSensorSmart.h>
PostPosted: Fri Jul 06, 2012 1:29 pm 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7501
Hi hardya,

the problem is the #include you added at the top, since the API library is included in the WaspClasses.h file, as long as the wiring.h. Remove it and it will work.

Regards.


Top
 OnlineProfile  
 
 Post subject: Re: Building with #include<WaspSensorSmart.h>
PostPosted: Fri Jul 06, 2012 1:46 pm 

Joined: Wed Dec 14, 2011 11:02 am
Posts: 120
Ok, so the pde file is not like regular code, where a double inclusion of a header will be ignored, but the pde goes through a process right? and the different bits are moved into appropriate places in the real code, right?

Thanks for that, I do appreciate your help.

Kind Regards,

Andrew


Top
 Profile  
 
 Post subject: Re: Building with #include<WaspSensorSmart.h>
PostPosted: Mon Jul 09, 2012 9:22 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7501
Hi hardya,

that's correct, it is owed to the integration of both C and C++ files in the same project, and the way the compiler deals with it.

Regards.


Top
 OnlineProfile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 6 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use