Updating Guide 5-based user_code.cpp for v0.13.1 or v0.13.2

Hello,

I just updated a user_code.cpp based on hello_world_guide_5 to compile with v0.13.1 and am looking for feedback on my approach.

Issue 1) contents of bm_network.h moved to spotter.h and renamed slightly

Solution:

  • replace #include “bm_network.h” with #include “spotter.h”
  • replace BM_NETWORK_TYPE_CELLULAR_IRI_FALLBACK with BmNetworkTypeCellularIriFallback

Issue 2) pubsub changes

Solution:

  • replace #include “bm_pubsub.h” with #include “pubsub.h”

Issue 3) deprecation of various bm_printf() - style functions in favor of spotter_log()

Solution:

  • remove #include “bm_printf.h” include
  • change bm_fprintf()calls to spotter_log(), add the parameter USE_TIMESTAMPbetween the filename and text string
  • change bm_printf() calls to spotter_log_console()

Issue 4) proper format strings for variables

Solution:

  • change some %d formats to %lu or %u as appropriate

What else might go into adapting a user_code.cpp to v0.13.1 or v0.13.2?

Thanks

1 Like