vedderb / vesc_express

The source code for the VESC Express
GNU General Public License v3.0
39 stars 31 forks source link

Add LBM APIs for BLE, WIFI, and TCP scripting #12

Closed laxsjo closed 9 months ago

laxsjo commented 10 months ago

Added LBM APIs for making the VESC behave as a BLE server, to manage connecting to WiFi networks, and to create and manage TCP connections over WiFi.

These APIs are documented here:

The BLE capabilities are quite lacking at the moment, and could probably be expanded in the future (like adding support for encryption).

Also added an extension for printing strings without surrounding it with quotes called puts. (I've wanted this for a long time. :P) This extension is not documented anywhere at the moment as that would be located in the bldc repository. Maybe I should open a pull request there as well?

I've also added a system for debug logging things in the VESC Terminal. These will start printing after running the store_log_context command which remembers the send medium to use (e.g. USB, WiFi, etc), so that they still print if also connected to VESC Tool with a different method. This feature has to be enabled at compile time by defining the macro #define LOGS_ENABLED 1 in the hardware config header file to ensure that the strings aren't unnecessarily bloating the firmware file size. They're disabled by default.

Resources used

These changes added 19 new extensions in total (of which the 9 BLE extensions are only enabled when they are configured to in the custom config).

These are the firmware build file sizes (they were all built with the same hw config files):

So this update adds 39 kB to the firmware size in total (without logs).