-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native: add UART driver based on /dev/tty #4443
Conversation
Very nice PR - this feature is very much missing for a long time. |
Yep. @Yonezawa-T2 Thanks for getting into this! |
We have to update the wiki page when this PR is merged. |
I met a problem with For OS X, the child process monitoring file descriptors are suspended until explicitly resumed by the Possible solutions:
A) B) C) Which is better? Any alternatives? |
Reassigned to @kaspar030 since he is Mr. netdev2_eth ;) |
A) notifying error from |gnrc_netdev2_eth| to |netdev2_tap| to cleanup
things
So what needs to happen is that if gnrc_netdev2_eth cannot allocate the
pktbuf, it needs to somehow flush the current packet from netdev2_tap.
right?
We could piggyback that into recv(). Currently, if recv() is called with
a NULL pointer as buffer, it will just return the length of the packet.
We could make it drop the packet if buffer is NULL but length equals
expected packet length, or something like that.
Another option would be a set() call that flushes one (or all) packets.
|
C) doesn't seem like a good option as it messes with the layering (netdev2 itself was designed to be independent of gnrc, so we can't call any gnrc_* stuff there). |
B) seems tap specific. |
Implemented A. |
70cf879
to
0dcfa90
Compare
Rebased and resolved conflict with #3984. |
Can you tell me how this is supposed to work? Where should |
@OlegHahm For example, when using XBee,
TTY devices are specified by command-line option
|
3767da8
to
aa03d6b
Compare
rebased |
aa03d6b
to
e4e7bbd
Compare
Rebased and updated GPIO function signatures. |
@kYc0o, @emmanuelsearch, @thomaseichinger, can you test? |
Yes we can! |
I'm having this on native with
|
66b349a
to
03899a5
Compare
Fixed and rebased. |
Tested and working correctly, waiting for Murdock |
Both are merged. Please rebase. |
03899a5
to
9f732c8
Compare
Rebased. |
Let's try to merge this before Sunday (another exception from the feature freeze). |
uart0 functionality is removed by RIOT-OS#3164. This patch implements periph/uart, rather than deprecated uart0, using /dev/tty. To use with netdev2_tap simultaneously, this patch adds asynchronus read system and modifies netdev2_tap to use it. A TTY device is specified on command line with -c (COM) option, since -t was used by the old implementation. This patch also implements empty GPIO driver needed by the xbee driver.
On OS X, `netdev2_tap` suspends monitoring file descriptor until `_recv` is called. If no spaces in left in pktbuf, `gnrc_netdev2_eth` does not call `_recv` that results in deadlock. With this commit, `gnrc_netdev2_eth` calls `_recv` with NULL buffer and non-zero length parameter, that indicates the driver to drop frame and resume working.
9f732c8
to
c4bc424
Compare
Murdock passed (except NEEDS SQUASHING static-test). Squashed. |
Murdock happy -> GO! |
Cool - many thanks! |
uart0 functionality is removed by #3164. This PR implements periph/uart, rather than deprecated uart0, using /dev/tty. A TTY device is specified on command line with -c (COM) option, since -t was used by the old implementation.
To use with netdev2_tap simultaneously, this PR adds asynchronus read system and modifies netdev2_tap to use it. It monitors multiple file descriptors by
fcntl
O_ASYNC
option on non OS X system and byselect
system call on OS X system. It forks child process on OS X system.I'm struggling to make my Mac with XBee connected by USB to be a border router of 6LoWPAN and made several fixes. Other fixes will be filled as separate pull requests. This PR also implements empty GPIO driver needed by the xbee driver.
Tested on OS X.