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

Nrf_recv() VS recv()

Hello, 

Our setup:

-nRF9160

- Zephyr OS

- Segger Embedded Studio for  Arm (Nordic Edition)

- SDK v1.3

Questions

1) which  are the differences between Zephyr  functions VS Nordic functions to be more specifics in nrf_recv() and recv().

2)Do you have tech notes regarding to it?

3)In what cases is recommended using nordic socket functions  and in which ones zephyr functions?

As note, I see that int at_cmd.c did you used recv() but in some tickets here in Devzone you recommend to use the Nordic functions.

Regards,

Rene D.

Parents
  • Hi Rene,

    Sorry for the delay. 

     I agree with Emil's explanation. The nrf_recv() is supported by the BSD library OS-specific parts are moved out of the library. See BSD library.

    3)In what cases is recommended using nordic socket functions  and in which ones zephyr functions?

    Please see Håkons explanation in this thread:

    - "you are mixing the nrf_socket.h and the zephyr socket API. They do not play well together and need translation (see nrf91_sockets.c for more detailed info).

    The include "net/socket.h" is also a bit suspicious, as you want to use the socket offloading, thus the translation between nrf and zephyr API. When you are calling socket() (and other calls), I am unsure which function you are calling in the background. This could be the network stacks socket implementation, which will not work with the nRF9160, or it could be the socket offloading (thus going into nrf91_sockets.c) which would have a mismatch of the structs."

    -Amanda H

Reply
  • Hi Rene,

    Sorry for the delay. 

     I agree with Emil's explanation. The nrf_recv() is supported by the BSD library OS-specific parts are moved out of the library. See BSD library.

    3)In what cases is recommended using nordic socket functions  and in which ones zephyr functions?

    Please see Håkons explanation in this thread:

    - "you are mixing the nrf_socket.h and the zephyr socket API. They do not play well together and need translation (see nrf91_sockets.c for more detailed info).

    The include "net/socket.h" is also a bit suspicious, as you want to use the socket offloading, thus the translation between nrf and zephyr API. When you are calling socket() (and other calls), I am unsure which function you are calling in the background. This could be the network stacks socket implementation, which will not work with the nRF9160, or it could be the socket offloading (thus going into nrf91_sockets.c) which would have a mismatch of the structs."

    -Amanda H

Children
Related