New EEL Element - Problem

Hi,

When creating an EEL new element for IOT Studio, where do you locate the function definitions from the original C code. I have not found an example that starts from a .c file and end up in an .eel file so far. This has kept me stuck on my development as I find the porting of original .c and .h files into .eel file confusing.

Thanks for your help !

Alejandro

@aale2025 - Have you reviewed step 6 of the example? https://github.com/atmosphereiot/eel-builder/blob/master/examples/my_first_eel/README.md

Hi !

Yes, I have. I created an EEL to read from an external button so as to learn how to use the EEL tool and the APIs. It looks like that after I created my button.eel and imported into IoT Studio, I get a compile error:

“unknown type name ‘ATMO_GPIO_Device_Pin_t’”

I have tried with the following include files unsuccessfully:

#include “…/atmo/core.h”
//#include “…/gpio/gpio.h”

//#include “…/app_src/atmosphere_platform.h”

Thank you.

Best,

Alejandro

Hi,

In your include statements, you have 3 dots instead of 2. This is invalid. You should have #include "../app_src/atmosphere_platform.h".

-Nick

Hi Nick,

Thank you for your message. I copied it wrongly here, but it is ok with 2 points in the source code as:

//#include “…/app_src/atmosphere_platform.h”
#include “…/atmo/core.h”
//#include “…/gpio/gpio.h”

Still giving the same error.
Thanks,

Alejandro

It looks like this text message at the forum converts … to … for some reason. I just pasted and sent it in the previous message with this problem.
THanks,

Alejandro

Headers

Hi,

You must include atmosphere_platform.h, not core.h.

Can you upload your eel so I can take a look?

Nick

Hi Nick,

Sure, I am sending it to you attached to this email.

THanks,

Alejandro

(Attachment button.eel is missing)

Hi Nick,

The forum does not allow me to send attachments as new user. How can I send it to you ?
Thanks,

Alejandro

You can upload it as a public GitHub gist and put the link here.

Nick

You could also just send the .atmo file of the project you’re having issues with. The eel will be in there, and you should be able to upload an .atmo here. I think we need to add .eel to our filter.

Nick

Hi Nick,

The forum does not allow me to upload any file at all.
I could upload to github:

Thanks,

Alejandro

Alejandro,

I was able to get it to compile with a NXP Rapid IoT project after fixing two things:

  1. #include "../app_src/atmosphere_platform.h in your header. You have it commented out. That’s all you need. Your header should look like:
#ifndef _ATMO_BUTTON_H_
#define _ATMO_BUTTON_H_

#include "../app_src/atmosphere_platform.h"

typedef struct {
    ATMO_DriverInstanceHandle_t gpioDriverInstance;
    ATMO_GPIO_Device_Pin_t button1Pin;					// Type definition for a device pin
} ATMO_button_Config_t;

// Funtion Prototypes go here:

bool ATMO_button_Setbutton1State(bool isOn);

#endif
  1. Your ability code for setbutton1Off is incorrect. You are calling ATMO_buttonClick_Setbutton1State instead of ATMO_button_Setbutton1State.

Here’s a link to the fixed EEL: https://gist.github.com/nick-atmosphereiot/5f94552cff4ff1f73fad890e8a3cd477

-Nick