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

  • Do not worry for the delay Amanda,

    Thank you for your answer but they did not solve my main doubt and the Håkons explanation in this thread:  is not relates with our doubts.

    1) Why does at_cmd.h use recv () and not use nrf_recv ()? This is important because it is a Nordic example.

    2) What are the differences between recv () and nrf recv ()? Why do you needed to implemented nrf_recv () ? I mean, why in close code and not just a grapper?


    Sorry for our insistence, but nrf_recv() is closed source and our team cannot make objective decisions about it.

    As an additional note, these doubts arise because the implementations of at_cmd.c and therefore the lte link controller cannot be used in our company because it have practices that we consider dangerous such as the use of "goto" and others. For that reason, we must implement our own socket handlers.

    thanks a lot,

    René D.

Reply
  • Do not worry for the delay Amanda,

    Thank you for your answer but they did not solve my main doubt and the Håkons explanation in this thread:  is not relates with our doubts.

    1) Why does at_cmd.h use recv () and not use nrf_recv ()? This is important because it is a Nordic example.

    2) What are the differences between recv () and nrf recv ()? Why do you needed to implemented nrf_recv () ? I mean, why in close code and not just a grapper?


    Sorry for our insistence, but nrf_recv() is closed source and our team cannot make objective decisions about it.

    As an additional note, these doubts arise because the implementations of at_cmd.c and therefore the lte link controller cannot be used in our company because it have practices that we consider dangerous such as the use of "goto" and others. For that reason, we must implement our own socket handlers.

    thanks a lot,

    René D.

Children
Related