CmdMessenger errors upon uploading a sketch

Hi there,

I'm trying to get my clone Mega2560 (with CH340 chip) working with a program called SPAD.next. That program (which is for a flight simulator) provides a sample sketch. No errors when I validate the sample sketch, but the following errors show up when I upload it:

C:\Users\...\Documents\Arduino\libraries\CmdMessenger\CmdMessenger.cpp: In member function 'char* CmdMessenger::readStringArg()':
C:\Users\...\Documents\Arduino\libraries\CmdMessenger\CmdMessenger.cpp:492:9: warning: invalid conversion from 'char' to 'char*' [-fpermissive]
  return '\0';

As of now, the SPAD.next program isn't even recognizing my clone Mega, even though I've used it with other programs successfully.

Some questions:

  1. Are the errors above consequential? In terms of Arduino, I'm a kindergartener.
  2. If so, what edits will solve those errors?
  3. Could the errors above be preventing SPAD.next from even recognizing the board?
  4. What do I put in the line after "// Unique Device ID: Change this!"? I'm guessing this should be the unique hardware ID of the Mega clone, but where exactly is that found? I looked in Device Manager, and there are several IDs that have the same format, but not sure which to use (Container ID, Class GUI ID, etc.).

Here is the sample sketch supplied by the SPAD.next program:

// *** SNDEMO ***

// This example shows how to autoconnect between the SPAD.neXt and Arduino.
//
// SPAD.neXt >= 0.9.7.5 required
//
// It demonstrates how to
// - Respond to a connection request from SPAD.neXt
// - Use a identifier to handshake
// - Expose a data value to SPAD.neXt
// - Request Data Updates from SPAD.neXt

#include <CmdMessenger.h>  // CmdMessenger

// Internal led
const int ledPin = LED_BUILTIN;

// Listen on serial connection for messages from the pc
CmdMessenger messenger(Serial);

// This is the list of recognized commands. These can be commands that can either be sent
// or received.
// In order to receive, attach a callback function to these events
enum
{
  kRequest = 0, // Request from SPAD.neXt
  kCommand = 1, // Command to SPAD.neXt
  kEvent = 2, // Events from SPAD.neXt
  kDebug = 3, // Debug strings to SPAD.neXt Logfile
  kSimCommand = 4, // Send Event to Simulation
  kLed = 10, // CMDID for exposed data to SPAD.neXt
  kHeading = 11, // CMDID for data updates from SPAD.neXt
};

int lastLedState = 999;
bool isReady = false;

void attachCommandCallbacks()
{
  // Attach callback methods
  messenger.attach(onUnknownCommand);
  messenger.attach(kRequest  , onIdentifyRequest);
  messenger.attach(kLed , onTurnLedOn);
  messenger.attach(kHeading , onHeadingLockChanged);
}

// ------------------  C A L L B A C K S -----------------------

// Called when a received command has no attached function
void onUnknownCommand()
{
  messenger.sendCmd(kDebug, "UNKNOWN COMMAND");
}

// Callback function to respond to indentify request. This is part of the
// Auto connection handshake.
void onIdentifyRequest()
{
  char *szRequest = messenger.readStringArg();

  if (strcmp(szRequest, "INIT") == 0) {
    messenger.sendCmdStart(kRequest);
    messenger.sendCmdArg("SPAD");
    // Unique Device ID: Change this!
    messenger.sendCmdArg(F("{DD7E3826-E439-4484-B186-A1443F3BC521}"));
    // Device Name for UI
    messenger.sendCmdArg("Arduino Demo");
    messenger.sendCmdEnd();
    return;
  }

  if (strcmp(szRequest, "PING") == 0) {
    messenger.sendCmdStart(kRequest);
    messenger.sendCmdArg("PONG");
    messenger.sendCmdArg(messenger.readInt32Arg());
    messenger.sendCmdEnd();
    return;
  }
  if (strcmp(szRequest, "CONFIG") == 0) {

    // Expose LED
    messenger.sendCmdStart(kCommand);
    messenger.sendCmdArg("ADD");
    messenger.sendCmdArg(kLed);
    messenger.sendCmdArg("leds/systemled"); // will become "SERIAL:<guid>/leds/systemled"
    messenger.sendCmdArg("U8");
    messenger.sendCmdArg("RW");
    messenger.sendCmdArg("Led");
    messenger.sendCmdArg("Toggle LED on/off");
    messenger.sendCmdEnd();

    // Request Heading Lock Dir Updates
    messenger.sendCmdStart(kCommand);
    messenger.sendCmdArg("SUBSCRIBE");
    messenger.sendCmdArg(kHeading);
    messenger.sendCmdArg("SIMCONNECT:AUTOPILOT HEADING LOCK DIR");
    messenger.sendCmdEnd();

    // tell SPAD.neXT we are done with config
    messenger.sendCmd(kRequest, "CONFIG");
    isReady = true;

    // Make sure led is turned off and SPAD.neXt gets the value
    setLED( LOW);
    return;
  }
}

// Callback to perform some action
void onTurnLedOn()
{
  int32_t newLed = messenger.readInt32Arg();
  if (newLed == 1)
  {
    setLED( HIGH);
    messenger.sendCmd(kDebug, "LED COMMAND ON");

    // For Demo Purpose:
    // If we received a LED ON command, we set the heading in the sim to 180
    messenger.sendCmd(kHeading, 180);

    // New in 0.9.7.5
    // For Demo purpose:
    // Send FLAPS_UP command to simulation
    messenger.sendCmd(kSimCommand, "SIMCONNECT:FLAPS_UP");

  }
  else
  {
    setLED( LOW);
    messenger.sendCmd(kDebug, "LED COMMAND OFF");

    // When we turned it off we unsubscribe from the heading lock for demo purpose
    messenger.sendCmdStart(kCommand);
    messenger.sendCmdArg("UNSUBSCRIBE");
    messenger.sendCmdArg(kHeading);
    messenger.sendCmdArg("SIMCONNECT:AUTOPILOT HEADING LOCK DIR");
    messenger.sendCmdEnd();
  }
}

// LED on if Heading > 180 else off;
void onHeadingLockChanged()
{
  int32_t newHeading = messenger.readInt32Arg();
  if (newHeading > 180)
  {
    setLED( HIGH);
    messenger.sendCmd(kDebug, "HEADING > 180");
  }
  else
  {
    setLED( LOW);
    messenger.sendCmd(kDebug, "HEADING < 180");
  }
}

// Update system LED and post state back to SPAD.neXt
void setLED(int ledVal)
{
  digitalWrite(ledPin, ledVal);
  // Update Led-Data on SPAD.neXt
  if ((ledVal != lastLedState) && isReady)
  {
    lastLedState = ledVal;
    messenger.sendCmd(kLed, ledVal);
  }
}
// ------------------ M A I N  ----------------------

// Setup function
void setup()
{

  // 115200 is typically the maximum speed for serial over USB
  Serial.begin(115200);

  // Attach my application's user-defined callback methods
  attachCommandCallbacks();

  // initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);

  // Turn LED on, will be turned off when connection to SPAD.neXt it up and running
  setLED( HIGH);
}

// Loop function
void loop()
{
  // Process incoming serial data, and perform callbacks
  messenger.feedinSerialData();

}

Here is a screenshot of the SPAD.next serial connection setup page. It should say "Connect/Disconnect" next to the COM9 entry, but it's not even recognizing a board is attached to that port.

It's not an error but a warning; quite sure that it also shows when you only verify (compile). I can compile as I don't have the library; do you have a link?

CmdMessenger::readStringArg() is supposed to return a pointer to a character; '\0' is not a pointer. To fix the warning, you will need to fix the library and replace '\0' by NULL where it complains.

Or better yet, 'nullptr'