How do I #define an unsigned char * string?

I have the following definition in my code

#define PRODUCTNAME     "SomeName"

and I want to send it using a function com_reply(unsigned char* msg, uint16_t lenght).

Now I get a warning that my argument is different by signature. I know what the problem is, and why it com_replyuses unsigned char*instead char*, I just want to know:

How can I define my string as unsigned char*, so I can use it in my entire program without receiving a warning everywhere.

EDIT:

Strictly speaking, here I have more than one, and the main reason is that there is a definition BANNERthat consists of several others, for example:

#define PRODUCTNAME     "SomeName"
#define PRODUCTDATE     "2013-03-30"
#define BANNER          PRODUCTNAME " (" PRODUCTDATE ")"

Should I create constant variables and concatenate them when the program starts, and not use the definitions here?

+5
source share
1 answer

This should work:

#define PRODUCTNAME     ((const unsigned char *)"SomeName")
+11
source

All Articles