This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Which API to use, socket or nrf_socket?

Hi,

I just tried to use the following code on the nrf9160DK with zephyr version 0.3.0:

 errVal =setsockopt(at_socket_fd, NRF_SOL_SOCKET, NRF_SO_RCVTIMEO, (const char*)&sock_timeout, sizeof(sock_timeout));
    if (errVal != 0L)
    {
        printk("Error: %d\n",errVal);
        return -EFAULT;
    }

While setsockopt exists SO_RCVTIMEO doesn't, NRF_SO_RCVTIMEO however does exist but doesn't work with sockets, i.e. errVal is -1.

So the question is does it make sense to use socket, or should I rather use nrf_setsockopt()?

Regards,

KT

Parents Reply Children
Related