Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

KeepAlive() change request in the api

Member ✭✭
edited February 2018 in SmartSDR API
In radio.cs, the KeepAlive() function has an if block to check if:
if (!API.ProgramName.Contains("Maestro"))
Any chance that can be changed to check for the existence of ProgramName to prevent a null reference exception?  Something like this:
if ((API.ProgramName != null && API.ProgramName != "") && !API.ProgramName.Contains("Maestro"))
Thanks!

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Member ✭✭✭
    edited February 2018
    I am guessing they do not check for this because you should set this value before calling Init.
    Here is what I do for FRStack

    API.ProgramName = "FRStack";
    API.Init();


  • Member ✭✭
    edited December 2017
    Yeah I've modified my code to do that now, just took a sec to figure out why it was blowing up. Either way, not a huge deal.

    Now I gotta figure out why keepalive isn't actually keeping it alive. Haven't played with the API in a few years...It has changed quite a bit. :-)
  • Administrator, FlexRadio Employee admin
    edited December 2017
    Note that KeepAlive doesn't run in Debug mode.  Only in Release.
  • Administrator, FlexRadio Employee admin
    edited December 2017
    Indeed, a ProgramName should be set before calling API.Init.  However, it could be checked and something more sensible shown to help the developer figure this out.  I've entered issue #5528 to address this.  Thanks for the report.

Leave a Comment