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

rfoust
rfoust 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!

Answers

  • Mark_W3II
    Mark_W3II 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();


  • rfoust
    rfoust 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. :-)
  • Eric-KE5DTO
    Eric-KE5DTO Administrator, FlexRadio Employee admin
    edited December 2017
    Note that KeepAlive doesn't run in Debug mode.  Only in Release.
  • Eric-KE5DTO
    Eric-KE5DTO 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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.