0

I'm having issues with this two lines:

const unsigned char* sendstring = reinterpret_cast<const unsigned char *>( "Hello" );
txChar.writeValue(sendstring);

is giving me this error: invalid conversion from 'const unsigned char*' to 'unsigned char' [-fpermissive]

I was trying to convert the sendstring variable in the first line but no.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Why are you using a `const unsigned char*`? Would this work for you: `txChar.writeValue("Hello");` – Michael Kotzjan Jun 25 '21 at 05:02
  • Hi @M.Kotzjan it´s because it gaves me this error: `invalid conversion from 'const char*' to 'unsigned char' [-fpermissive]` –  Jun 26 '21 at 01:25
  • Could you add your full sourcecode? It is unclear what type of characteristic txChar is – Michael Kotzjan Jun 26 '21 at 11:59
  • sure @M.Kotzjan here it is: [source](https://github.com/Ladvien/arduino_ble_sense/blob/master/ble_sense_33_test.ino/ble_sense_33_test/ble_sense_33_test.ino) –  Jun 26 '21 at 16:39
  • Is this your code or are you trying to modify it to send `"Hello"`? txChar is a `BLEByteCharacteristic` and is probably not what you want – Michael Kotzjan Jun 27 '21 at 06:20

0 Answers0