Skip to content

Conversation

@pfalcon
Copy link
Contributor

@pfalcon pfalcon commented Mar 26, 2019

The current idea is that we document zsock_* prefixed symbols, refer
to Open Group POSIX website
(http://pubs.opengroup.org/onlinepubs/9699919799/) for normative
descriptions, and explicitly mention bare POSIX name of a function
too (so e.g. users could find it via search).

Fixes: #13397

Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org

@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 26, 2019

So, this is what I have in mind re: addressing #13397. Interested parties, please confirm that this satisfies your expectation, and I'll continue in the same vein with other functions/defines.

@pfalcon pfalcon changed the title net: sockets: Add docstrings for BSD Sockets API [WIP] net: sockets: Add docstrings for BSD Sockets API Mar 26, 2019
@pfalcon pfalcon added the DNM This PR should not be merged (Do Not Merge) label Mar 26, 2019
@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 26, 2019

Screenshot at 2019-03-26 16-41-14

Example of rendered docs.

@zephyrbot
Copy link

zephyrbot commented Mar 26, 2019

All checks are passing now.

Review history of this comment for details about previous failed status.
Note that some checks might have not completed yet.

@pfalcon pfalcon force-pushed the sockets-docstrings branch from 09d53a4 to 81ae455 Compare March 26, 2019 15:03
@jukkar
Copy link
Member

jukkar commented Mar 26, 2019

So, this is what I have in mind re: addressing #13397. Interested parties, please confirm that this satisfies your expectation, and I'll continue in the same vein with other functions/defines.

Thanks @pfalcon, this looks just fine to me.

@jukkar jukkar added this to the v1.14.0 milestone Mar 26, 2019
@pfalcon pfalcon force-pushed the sockets-docstrings branch from 81ae455 to 687234e Compare March 26, 2019 19:58
@pfalcon pfalcon added bug The issue is a bug, or the PR is fixing a bug and removed DNM This PR should not be merged (Do Not Merge) labels Mar 26, 2019
@pfalcon pfalcon changed the title [WIP] net: sockets: Add docstrings for BSD Sockets API net: sockets: Add docstrings for BSD Sockets API Mar 26, 2019
@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 26, 2019

Ok, hopefully this adds enough goodies. Ready for review.

@codecov-io
Copy link

codecov-io commented Mar 26, 2019

Codecov Report

Merging #14912 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14912   +/-   ##
=======================================
  Coverage   52.93%   52.93%           
=======================================
  Files         309      309           
  Lines       45251    45251           
  Branches    10447    10447           
=======================================
  Hits        23953    23953           
  Misses      16533    16533           
  Partials     4765     4765
Impacted Files Coverage Δ
include/net/socket_select.h 100% <ø> (ø) ⬆️
include/net/socket.h 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3cf543...ccfe149. Read the comment docs.

Copy link
Contributor

@dbkinder dbkinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc changes look good, one edit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* for normative description. This function is provided to ease porting
* for normative description. This function is provided to ease porting of

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good, couple of defines are still missing documentation in
https://builds.zephyrproject.org/zephyrproject-rtos/zephyr/14912/docs/reference/networking/sockets.html
like

ZSOCK_POLLIN
ZSOCK_POLLPRI
ZSOCK_POLLOUT
ZSOCK_POLLERR
ZSOCK_POLLHUP
ZSOCK_POLLNVAL
ZSOCK_MSG_PEEK
ZSOCK_MSG_DONTWAIT
ZSOCK_SHUT_RD
ZSOCK_SHUT_WR
ZSOCK_SHUT_RDWR
SOL_SOCKET
SO_REUSEADDR
SO_ERROR
TCP_NODELAY
IPV6_V6ONLY
ZSOCK_FD_SETSIZE

and

void ZSOCK_FD_ZERO(zsock_fd_set *set)
int ZSOCK_FD_ISSET(int fd, zsock_fd_set *set)
void ZSOCK_FD_CLR(int fd, zsock_fd_set *set)
void ZSOCK_FD_SET(int fd, zsock_fd_set *set)

Some of them might not need documentation, but in that case we should mark them internal using

/** @cond INTERNAL_HIDDEN */
xxx
/** @endcond */

@pfalcon pfalcon force-pushed the sockets-docstrings branch 2 times, most recently from c56b0a2 to ccfe149 Compare March 27, 2019 19:54
@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 27, 2019

Looks mostly good, couple of defines are still missing documentation

Ok, added more. Please keep in mind there's always something to improve in the documentation and "perfect is the enemy of good" ;-).

@jukkar
Copy link
Member

jukkar commented Mar 27, 2019

Ok, added more. Please keep in mind there's always something to improve in the documentation and "perfect is the enemy of good" ;-).

I went through the networking documentation and these "empty" entries in the documentation look quite bad. So I was not really looking for perfect documentation here, just something that does not look bad when browsing the docs.

@pfalcon
Copy link
Contributor Author

pfalcon commented Mar 27, 2019

By now, at least 90%, likely 95%, of entries which were empty, are no longer empty.

@jukkar
Copy link
Member

jukkar commented Mar 28, 2019

Couple of defines are still missing text. Please either add some text there or mark them internal so they get hidden.

SOL_SOCKET
SO_REUSEADDR
SO_ERROR
TCP_NODELAY
IPV6_V6ONLY
ZSOCK_FD_SETSIZE

Copy link
Contributor

@dbkinder dbkinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc changes LGTM, thanks!

The current idea is that we document zsock_* prefixed symbols, refer
to Open Group POSIX website
(http://pubs.opengroup.org/onlinepubs/9699919799/) for normative
descriptions, and explicitly mention bare POSIX name of a function
too (so e.g. users could find it via search).

Fixes: zephyrproject-rtos#13397

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
@pfalcon pfalcon force-pushed the sockets-docstrings branch from ccfe149 to 3147bb3 Compare April 4, 2019 08:40
@pfalcon
Copy link
Contributor Author

pfalcon commented Apr 4, 2019

@jukkar

Couple of defines are still missing text.

Ok, added something for those too.

P.S. I'm on vacation next week, and hopefully did everything so this could fit into 1.14.

@galak galak merged commit bd10c72 into zephyrproject-rtos:master Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Documentation area: Networking area: Sockets Networking sockets bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function documentation is missing for BSD sockets

6 participants