Skip to content

External ipv4 MQTT broker error ETIMEDOUT #9456

Discussion options

You must be logged in to vote

I switched from Mqtt to CoAP but run into the same problem with ipv4.

This did finally the trick:

void SynthesizeIpv4ToIpv6Adress(char ip_str[], struct in6_addr *ipv6_addr)
{
	uint8_t ipv4_bytes[4];

    char *token = strtok(ip_str, ".");
    for (int i = 0; i < 4; i++) {
        ipv4_bytes[i] = atoi(token);
        token = strtok(NULL, ".");
    }
	int i;
	otIp4Address tmp_ipv4_addr;
	otIp6Address synt_ipv6_addr;

	for (i = 0; i < 4; i++)
	{
		tmp_ipv4_addr.mFields.m8[i] = ipv4_bytes[i];
	}

	if (OT_ERROR_NONE != otNat64SynthesizeIp6Address(
							 instance,
							 (const otIp4Address *)&tmp_ipv4_addr,
							 &synt_ipv6_addr))
	{
		LOG_INF("ERROR otNat64SynthesizeIp6Address() function!"

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@jwhui
Comment options

@sebastianspross
Comment options

@jwhui
Comment options

@sebastianspross
Comment options

Answer selected by sebastianspross
@FabienFranck
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants