Esp32 not compiling .c files

Hello guys
don't know if this is a silly question or an intelligent on but never the less

am trying to use my esp32 read ibeacon tag using ble. so i found this library at github

=https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/ble_ibeacon/main

i tried opening the ibeacon_demo.c file with esp32 but had some issue with the .c extension so i changed it to .ino which then opens the file but give this error
"sorry, unimplemented: non-trivial designated initializers not supported
exit status 1"
when compiling.
am sure the error has to do with the extension and the #include files not able to be read by esp32.

so can anyone tell me please how i can run this code with esp32.
thanks..

I checked the code, and that is not arduino code, it is c.
so unless you restructure the code the arduino way (setup(), loop() it is not going to compile, ever....

You can look into the ESP32 CAN bus library which uses C and C++ code for some hints.

What line does the compiler complain about? From the message it appears to be using a C feature that the compiler included with the Arduino IDE has not implemented. Perhaps the code can be re-phrased to something the compiler can handle.

When programming an ESP32 you have 2 choices : use the Arduino IDE or use the ESP-IDF programming environment. The code you provide is designed for the last choice, and cannot be used with the Arduino IDE because it does not have a setup nor a loop function.

If you really want to test THIS code, you need to install the ESP-IDF environment, see here. If you accustomed with Arduino, it's not an easy move.

The other solution would be to rewrite the code using ESP32 Arduino-suited libraries and syntax (which is pretty similar to that of the ESP-IDF as they both use C codes, but with the setup and loop things) but I do not recommand that, because you would have to verify that all the libraries called in the code are accessible for the Arduino IDE:

#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
#include "nvs_flash.h"

#include "esp_bt.h"
#include "esp_gap_ble_api.h"
#include "esp_gattc_api.h"
#include "esp_gatt_defs.h"
#include "esp_bt_main.h"
#include "esp_bt_defs.h"
#include "esp_ibeacon_api.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"

I found an arduino library to read the ble from

incase anyone needs it.