ttlappalainen / NMEA2000

NMEA2000 library for Arduino
535 stars 226 forks source link

Water depth/temperature sensor with STM32F302 #271

Open Jeanluc22 opened 2 years ago

Jeanluc22 commented 2 years ago

Hi, I'm working on a sensor that uses STM32F302 mcu. The device must be able to be connected to a NMEA2000 network and provide information about the depth and temperature of the water. I'd like to use Timo’s NMEA2000 library, but the whole project is written in c using Keil uVision IDE.

Since the device has to transmit only some messages is it possible to extract from the library only the necessary parts and convert them into c?

Do you have any suggestions on how I might proceed?

Thank you!

ttlappalainen commented 2 years ago

There is no shortcut. You have to convert every class to pure c structure and write all class functions to pure c and add c "class" structure as function parameter. Handling inheritance is bit more complex, since you need to write your own virtual function pointer handler.