nrf52832 central and peripheral string send issue

hi destiny98 i also working on sending string from peripheral to central but central device not able to receive it and show the same message every time, here i attach code snippet, please guide me to resolve this issue.

another thing is that i am use ble_app_hrs_c for central device and ble_app_hrs for peripheral device and make modification in it as i need, here i attach my both code also.

static void hrs_c_evt_handler(ble_hrs_c_t *p_hrs_c, ble_hrs_c_evt_t *p_hrs_c_evt) {
switch (p_hrs_c_evt->evt_type) {
case BLE_HRS_C_EVT_HRM_NOTIFICATION: {
uint8_t *data = (uint8_t *)p_hrs_c_evt->params.hrm.rr_intervals;
uint16_t length = p_hrs_c_evt->params.hrm.rr_intervals_cnt;

if (length > 0) {
char message[20];
memcpy(message, data, length);
message[length] = '\0'; // Null-terminate the string

NRF_LOG_INFO("Received message: %s", message);
} else {
NRF_LOG_WARNING("Invalid message length: %d", length);
}
} break;

default:
NRF_LOG_INFO("Unhandled HRS client event: %d", p_hrs_c_evt->evt_type);
break;
}
}

Parents
  • Please double check if you select the correct COM port, it say COM1 , it could be correct in your case. 
    Which nRF52 DK did you use ? 

  • i use nrf52832 custom board.

    and yes you are right, it select incorrect com port.
    how i solve this issue?
    currently i am trying older version of python.  

Reply
  • i use nrf52832 custom board.

    and yes you are right, it select incorrect com port.
    how i solve this issue?
    currently i am trying older version of python.  

Children
  • Hi,

    Are you able to run wireshark now? You should be able to choose the correct COM port by using the toolbar at the top, for example in this screenshot from the wireshark guide in Devacedemy they use COM 17: 

    regards

    Jared