libember_slim

310 views
Skip to first unread message

ash

unread,
Nov 11, 2014, 12:20:30 PM11/11/14
to ember-plus-...@googlegroups.com
Hi Guys,
I am looking for c examples in implementing Libember_slim. Iam trying to build and ember consumer and provider for a microcontroller module. I would really appreciate if you can help me with any relevent documentation if any.

Regards
-Ash

Andreas Huber

unread,
Nov 13, 2014, 3:37:48 AM11/13/14
to ember-plus-...@googlegroups.com
Hi Ash


On Tuesday, November 11, 2014 6:20:30 PM UTC+1, ash wrote:
I am looking for c examples in implementing Libember_slim. Iam trying to build and ember consumer and provider for a microcontroller module. I would really appreciate if you can help me with any relevent documentation if any.

Have you had a look at the __sample.c,  __sample_consumer.c and __sample_provider.c in the current release?

Regards,

Andreas

ash

unread,
Nov 13, 2014, 4:44:35 AM11/13/14
to ember-plus-...@googlegroups.com
Hi Andreas,

I tried to look intop the source code and thats fine. I am trying to build the source sode using a command line borland compiler and i get errors trying to build the examples.

Regards
Ash

Andreas Huber

unread,
Nov 13, 2014, 5:01:21 AM11/13/14
to ember-plus-...@googlegroups.com
On Thursday, November 13, 2014 10:44:35 AM UTC+1, ash wrote:
I tried to look intop the source code and thats fine. I am trying to build the source sode using a command line borland compiler and i get errors trying to build the examples.

Could you please post the errors?

Thanks,

Andreas

ash

unread,
Nov 13, 2014, 5:13:24 AM11/13/14
to ember-plus-...@googlegroups.com

 

Hi Andres,
Thanks for responding.
In the header function bertype.h in lines 52 and 59 the keyword long has been repeated twice. and please find the attachment for the errors when i try to run __sample.c.

Regards
-Ash
emberplusslim.png

Andreas Huber

unread,
Nov 13, 2014, 5:30:19 AM11/13/14
to ember-plus-...@googlegroups.com
On Thursday, November 13, 2014 11:13:24 AM UTC+1, ash wrote:
In the header function bertype.h in lines 52 and 59 the keyword long has been repeated twice. and please find the attachment for the errors when i try to run __sample.c.

I'm not an expert on C or Borland, but it seems that your compiler does not support the C99 standard, which defines long long as a signed integer type with at least 64 bits:


AFAICT Borland 5.5.1 is well over 10 years old, is there any way you could use a newer compiler?

Regards,

Andreas

ash

unread,
Nov 13, 2014, 7:19:26 AM11/13/14
to ember-plus-...@googlegroups.com
Hi Andres,

Now i checked it using Mingw compiler and it still throws those errors. It will be very helpful to tell me what was the compiler wich the author of the library used to compile and test the sources.

Regards
-Ash

Hoffmann, Kimon (Lawo AG)

unread,
Nov 13, 2014, 8:00:13 AM11/13/14
to ember-plus-...@googlegroups.com
Hi Ash,

> Now i checked it using Mingw compiler and it still throws those errors. It will be very helpful to tell me what was the compiler wich the author of the library used to compile and test the sources.

Did you use the included premake file to generate the Makefile for the library? If you did have a look at the GCC options used in there for the corresponding configuration. If your mingw GCC is moderately recent the samples should compile just fine.

Best regards,
Kimon

ash

unread,
Nov 21, 2014, 4:29:04 AM11/21/14
to ember-plus-...@googlegroups.com
Hi Hoffmann,

I tried the recent version of gcc using qt and used msvcr using visual c++. i was able to build fine but when i run the the build both the programs shut down before i enter any application parameters like the port or the ip address.Please find the attachments so that you can understan what iam trying to say.

regards
-Ash
2.png
1.png

Andreas Huber

unread,
Nov 21, 2014, 5:10:50 AM11/21/14
to ember-plus-...@googlegroups.com
Hi Ash

On Friday, November 21, 2014 10:29:04 AM UTC+1, ash wrote:
I tried the recent version of gcc using qt and used msvcr using visual c++. i was able to build fine but when i run the the build both the programs shut down before i enter any application parameters like the port or the ip address.Please find the attachments so that you can understan what iam trying to say.

I looks like you've started the exes from within Visual Studio. Have you tried to start them from the console with the appropriate command line arguments?

Regards,

Andreas

ash

unread,
Dec 1, 2014, 5:21:07 AM12/1/14
to ember-plus-...@googlegroups.com
Hi Andreas,

Following your guidance i have successfully built the sample project using command line ans it worked completely whithout any issues as a consumer and a provider. Now when i try to move on to the second step which is to implement the ecxact samples on my microcontroller i am facing some problems as the __sample_provider.c is not strictly ansi c complient. I however believe that certain aspects are posix-1-2001 compliant. for example macros such as _itoa_s, stringDup etc are not ansi c. and how do i replace msvcrt specific functions.

i replaced the stringDup with a function which i wrote
Enter code here...
char *strdup (const char *s) {
   
char *d = malloc (strlen (s) + 1);   // Space for length plus nul
   
if (d == NULL) return NULL;          // No memory
    strcpy
(d,s);                        // Copy the characters
   
return d;                            // Return the new string
}

ash

unread,
Dec 1, 2014, 5:27:53 AM12/1/14
to ember-plus-...@googlegroups.com
and i forgot to mention that i am trying to use sprintf instead of atoi as a replacement. but by doing so i still have problems the ember viewer sees the microcontroller on the port but the color of the circle before my port blinks purple. i hope you can understand what i am trying to convey.

Regards
-Ash

nullable.type

unread,
Dec 1, 2014, 8:51:09 AM12/1/14
to ember-plus-...@googlegroups.com
Hi Ash

It would be nice, if you could file an issue regarding the ANSI C compliance of libember_slim and its samples.
Bugs and enhancements can be filed here: https://code.google.com/p/ember-plus/issues/list

I guess you solved the compilation problems on the micro controller in the meantime, correct?

The pruple blinking port means, as far as i know, that the TCP connection has been estanblished. Furthermore, a GetDirectory request has been sent from the Ember+ viewer to the provider, but was not answered. Using the GlowLoggerProxy (see Downloads on the Ember+ website) could help you finding out, what data is exchanged between the provider and the consumer.

Regards
Simon

ash

unread,
Dec 1, 2014, 11:00:26 AM12/1/14
to ember-plus-...@googlegroups.com
Hi Simon,

Yes I have managed to solve the compilation problem for the header and source files. but i am unable to run the provider and consumer examples which throws me back the above mentioned errors.

Regards
-Ash

nullable.type

unread,
Dec 2, 2014, 3:41:37 AM12/2/14
to ember-plus-...@googlegroups.com
Hi Ash

Please take a look at the GlowLoggerProxy to make the communication visible.

Regards
Simon

ash

unread,
Dec 2, 2014, 4:54:42 AM12/2/14
to ember-plus-...@googlegroups.com
Hi Simon,
I tried using the GlowLoggerProxy and for some reason the connection suddenly preaks down. and for the microcontroller the log is not even print in complete in the xml file. I have attached the xml log file for both the cases.

Regards
Ash
lan_provider.xml
microcontroller_log.xml

nullable.type

unread,
Dec 2, 2014, 7:55:02 AM12/2/14
to ember-plus-...@googlegroups.com
Hi Ash

There is not much in the logs - the lan_provider.xml just says, that there could no connection be made:
No connection could be made because the target machine actively refused it 192.168.1.4:9000

Regards
Simon
Reply all
Reply to author
Forward
0 new messages