Finger.fingerID to Char

I’m able to send some characters in bluetooth to my android device.
But when I’m about to send the value from the value of my thumb from fingerprint scanner,
Only a special character was sent. So it came to me that the value is Integer and tried to convert it to character but still getting some error.
When I run my code here, I immediately getting back to void setup();

int getFingerprintIDez() {
  uint8_t p = finger.getImage();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.image2Tz();
  if (p != FINGERPRINT_OK)  return -1;

  p = finger.fingerFastSearch();
  if (p != FINGERPRINT_OK)  return -1;
  
  // found a match!
     
  String toStr;
  char toChar[2];
  toStr=String(finger.fingerID);  
  toStr.toCharArray(toChar, toStr.length());
  BTSerial.write(toChar);
  Serial.print("Found ID #"); Serial.print(finger.fingerID); 
  Serial.print(" with confidence of "); Serial.println(finger.confidence);
  return finger.fingerID; 
}

Your danse around fingerID is totally useless (and wrongly coded) Ask yourself what type the finger.fingerID (if i remember correctly it's uint16_t) is and then use print or write(buf, len) with the pointer+byte count format on your BTserial depending on what you want to see on the other side.

J-M-L: Your danse around fingerID is totally useless. Ask yourself what type the finger.fingerID is and then use print or write on your serial depending on what you want to see on the other side

I just want to convert it to character and send it to bluetooth. I assumed that fingerid is integer because the function returns int.

Print will send the ascii representation (consider using println() to have a marker of the end of the string on the receiving side), write will send the binary representation of your number

BTSerial.println(variable); // variable sent as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n')
// or use
BTSerial.write((byte*)&variable, sizeof(variable)); // variable sent as its binary representation, no end marker

J-M-L: Print will send the ascii representation (consider using println() to have a marker of the end of the string on the receiving side), write will send the binary representation of your number

BTSerial.println(variable); // variable sent as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n')
// or use
BTSerial.write((byte*)&variable, sizeof(variable)); // variable sent as its binary representation, no end marker

Thankyou so much. I used println. No need for convertion. thank you.

See life is easy :)