This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can I write log on Keil? (such as printf, file print)

My question a little weird. Because I am super beginner about BLE. So what I want is how to write string data. now i am looking to information about this. I cannot find it. :( so could you help me? Below code, you can well understand what I want.

this code is from "ble_app_proximity.uvpoj" . in the code, how can i write string to see console or data as text file?


static void alert_signal(uint8_t alert_level)
{
    switch (alert_level)
    {
        case BLE_CHAR_ALERT_LEVEL_NO_ALERT:
            m_is_link_loss_alerting = false;
            alert_led_blink_stop();

printf("NO_ALERT"); // I would like to use this kind method.
fprintf("NO_ALERT", "C:\\data.txt"); // or this kind method.

            break;

        case BLE_CHAR_ALERT_LEVEL_MILD_ALERT:
            alert_led_blink_start();
            break;

        case BLE_CHAR_ALERT_LEVEL_HIGH_ALERT:
            alert_led_blink_stop();
            nrf_gpio_pin_set(ALERT_PIN_NO);
            break;
            
        default:
            // No implementation needed.
            break;
    }
}

sorry about my English expression is not enough to understand.
do you understand? if you understand what i want and know about how to this, please help me:(

in short, I want to write string on text file using code in keil5.

Related