Extract message from Mesh Chat example to custom use

I want to display the number in an Seven Segment Display, which was sent through BLE Mesh from Server
(nRF52840 DK) to a Client. I have successfully interfaced the Display with the Mesh chat program and to the Client.
But I don't know , how to get the number from the transmitted message, as it is in String format and also it shows the pointer of the message location.

static void handle_chat_private_message(struct bt_mesh_chat_cli *chat,
					struct bt_mesh_msg_ctx *ctx,
					const uint8_t *msg)
{
	/* Don't print own messages. */
	if (address_is_local(chat->model, ctx->addr)) {
		return;
	}

	shell_print(chat_shell, "<0x%04X>: *you* %s", ctx->addr, msg);
	tm1637_set_number(lcd, number);//Have to place the number received from Server.
}


The above code is responsible for the display of transmitted message in Shell (PuTTY).
It points to the pointer of the message location. How can I get the original message from this line, which I can get to display it in the Seven Segment display.

After getting the message, I convert it to the integer format to display it in Seven Segment Display.

How can I extract the message and convert it to the integer number?

Related