uint8_t conversion to char

Hi, I am working with some hardware that accepts UDP commands. I have some example code to work with to get things going. The example code uses uint8_t types and bit shifting to create the command signals. The ofxUDPManager only allows const char to be sent.

ofxUDPManager::SendAll(const char* pBuff, const int iSize);

As I may have other problems with my test code, I am not sure if this is one of them. Does it make any difference- should I just do the same bitwise operations with const char* or can I convert at the last possible time (easier for me) from uint8_t to const char?

uint8_t connectHello[] = {
		0x10, 0x14, 0x53, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

Also is there a way to see these messages in the console? At the moment when I print the messages they print as upside down question marks- I assume this is because they are bit shifted and no longer have an ascii equivalent. Is there a way to view the raw data to see if I am getting the correct responses from the unit?



You can keep it all as uint8_t and just cast it when u call the function eg SendAll((char *)connectHello, len);

For printing it might be easier to use printf with %x or %#x eg for (int i = 0; i < len; i++) printf("%x", connectHello[i]);

@pants thanks a lot, you made my life a lot easier!