First you need to copy the data of the struct into a byte array
int len = sizeof(struct sMSG);
unsigned char * raw = malloc(len);
memcpy(raw, &msg, len);
Now use a function to convert the byte array into Base64 text or just hexadecimal representation (2 chars/byte). Since you use the embedded tag, the latter might be the easiest to implement.
#define TOHEX(x) (x > 9 ? (x - 10 + 'A') : (x + '0'));
char * text = malloc(2 * len + 1);
for (int i = 0; i < len; i++)
{
text[2 * i + 0] = TOHEX(raw[i] >> 4);
text[2 * i + 1] = TOHEX(raw[i] & 0xF);
}
text[2 * len] = '\0';
free(raw);
free(text);