Skip to main content
MSSloan1962
Associate III
September 29, 2022
Solved

setVerbosityLevel of the API

  • September 29, 2022
  • 2 replies
  • 1101 views

I am calling setVerbosityLevel of the API with CUBEPROGRAMMER_VER_LEVEL_NONE (0) in the C++ USB Example project supplied but the DLL routines (like connectDfuBootloader) are still outputting messages. Still there any way to stop these messages?

This topic has been closed for replies.
Best answer by Aziz BRIGUI

Hello @MSSloan1962​,

A way to do this would be to define your own function that displays messages (or doesn't). You can for example define the following function in DisplayManager.cpp (also don't forget to add the prototype in DisplayManager.h)

void DisplayMessageOff(int msgType, const wchar_t* str)
{
	return;
}

Then set it as the logMessage function in your displayCallBacks instance (in main.c) :

displayCallBacks vsLogMsg;
vsLogMsg.logMessage = DisplayMessageOff;

The problem with this is that the function is called each time there's a message, it just doesn't display it. So I recommend keeping the verbosity level at 0 to reduce the number of calls.

Also, it seems that you're using an old version of the API, I suggest you use the latest version (with CubeProgrammer v2.11).

I hope you find this helpful.

Aziz

2 replies

Aziz BRIGUI
Aziz BRIGUIBest answer
Technical Moderator
October 3, 2022

Hello @MSSloan1962​,

A way to do this would be to define your own function that displays messages (or doesn't). You can for example define the following function in DisplayManager.cpp (also don't forget to add the prototype in DisplayManager.h)

void DisplayMessageOff(int msgType, const wchar_t* str)
{
	return;
}

Then set it as the logMessage function in your displayCallBacks instance (in main.c) :

displayCallBacks vsLogMsg;
vsLogMsg.logMessage = DisplayMessageOff;

The problem with this is that the function is called each time there's a message, it just doesn't display it. So I recommend keeping the verbosity level at 0 to reduce the number of calls.

Also, it seems that you're using an old version of the API, I suggest you use the latest version (with CubeProgrammer v2.11).

I hope you find this helpful.

Aziz

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
MSSloan1962
Associate III
October 4, 2022

Thanks. Most helpful. :)