Hey Nordic,
I am using
- SDKv17.1.0
- VSCODE as IDE
- S140 as softdevice
- Windows
Let me first insert my code snippet:
// ALREADY_DONE_FOR_YOU: Declaration of a function that will take care of some housekeeping of ble connections related to our service and characteristic void ble_our_service_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context) { uint32_t former, latter, charIndex; ble_os_t * p_our_service =(ble_os_t *) p_context; // OUR_JOB: Step 3.D Implement switch case handling BLE events related to our service. switch (p_ble_evt->header.evt_id) { case BLE_GATTS_EVT_WRITE: printf("BLE_GATTS_EVT_WRITE"); for(charIndex = 0; charIndex < NO_OF_CHARACTERISTICS; charIndex++) { if(p_ble_evt->evt.gatts_evt.params.write.uuid.uuid == BLE_UUID_OUR_CHARACTERISTC_UUID + charIndex) { NRF_LOG_INFO("16-bit UUID: 0x%x", p_ble_evt->evt.gatts_evt.params.write.uuid.uuid); former = (p_ble_evt->evt.gatts_evt.params.write.data[0]<<8) + (p_ble_evt->evt.gatts_evt.params.write.data[1]); latter = (p_ble_evt->evt.gatts_evt.params.write.data[2]<<8) + (p_ble_evt->evt.gatts_evt.params.write.data[3]); printf("former = 0x%x", (unsigned int) former); NRF_LOG_INFO("latter = 0x%x", latter); } } break; case BLE_GAP_EVT_CONNECTED: p_our_service->conn_handle = p_ble_evt->evt.gap_evt.conn_handle; break; case BLE_GAP_EVT_DISCONNECTED: p_our_service->conn_handle = BLE_CONN_HANDLE_INVALID; break; default: // No implementation needed. break; } }
Here, NRF_LOG_INFO() function works, meaning that, I can see the log messages on PuTTY but printf() doesn't print anything to the terminal as expected.
This is the screenshot taken from PuTTY:
I want to print the same thing to the vscode terminal with printf() function.
You can download my project folder from here.
Thanks,
Omer