cancel
Showing results for 
Search instead for 
Did you mean: 

setVerbosityLevel of the API

MSSloan1962
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Aziz BRIGUI
ST Employee

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.

View solution in original post

2 REPLIES 2
Aziz BRIGUI
ST Employee

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 II

Thanks. Most helpful. 🙂