@michinyon, I’m not sure, but I can only pass 1 character into the function. For example, if I pass ‘hi’ into it, I only get ‘h’ on the other end. If I pass ‘buff’ into it, I only get the first digit. Maybe I am misunderstanding something here.
You are completely confused.
Firstly, in C/C++, a character surrounded by single quotes is a single character. One character. Like ‘a’ or ‘B’ or ‘Q’. ‘hi’ is two characters, it is simply invalid in C/C++ and I am surprised the compiler accepts it.
For a sequence of characters, you use double quotes, like “hi”. This represents either an array of single char values, or an object of the String class. In the case of the array, the array must actually have three bytes in it, because the array of char values has to have an extra byte with 0x00 in it at the end.
The construct unsigned char* refers to a value which is a pointer. It represents the address ( memory location ) of a char value, or the address of the first item in an array of char values.
You can call a function with a value which is the value of a character. Or, you can call a function with a value which is the memory address of where one or more chars are stored in memory. These are two quite different things in C/C++, and you need to understand the difference.
The type “unsigned char” make very little sense if the value is to be used as an actual character and not as a single-byte integer.
Your function ble_value( unsigned char* ) requires an argument which is the address of a char, or more usually, the address of the first element of an array of chars.
Providing an actual single char value to this function would actually be wrong - unless there is also defined another function with the same name which takes a single char value.
The correct way to call this function would be something like
char myname[] = "awol" ; // this creates an array of 5 bytes
ble_value ( myname ) ; // the normal way
ble_value ( &myname[0] ) ; // the very explicit way
ble_value( &myname[1] ); // this will print "wol"