sys/shell: adapt ifconfig to work with sx1272/76 devices#7482
sys/shell: adapt ifconfig to work with sx1272/76 devices#7482miri64 merged 7 commits intoRIOT-OS:masterfrom
Conversation
a26c953 to
a923656
Compare
|
I see a problem with the proposed implementation here, at least the |
|
I'm not sure to understand your comment. |
a923656 to
f44e78e
Compare
|
Just pushed an update, let me know if it's better |
I'm not sure if it is that simple, but in general I agree. However, judging from @aabadie s implementation it looks like that a LoRa interface has several additional attributes/parameters compared to ethernet or 15.4 interface while other are even missing or are not supported. Maybe it does need an additional command to configure those special attributes, similar to TL;DR this may need some thinking as the |
f44e78e to
017970f
Compare
What about a
The get/set functions (and maybe others) could be shared between the actual |
Why is that one needed? What is different with lora, that
Same goes here. |
017970f to
fd9b6eb
Compare
I didn't first of it initially and I just pushed an update with this change. For the lora listen part, that's indeed true that it's not required since one can achieve the same result by putting the radio in RX state with ifconfig. |
c9734ef to
98a2f91
Compare
When it comes to new netopts to be supported (IQ_INVERTED etc.) it makes sense. Yes! The ifconfig code also has changed after the netif remodeling so adapting it will probably end up in a lot of #ifdef. No, they don't require any |
|
Needs also adaptation for #7925. |
505aff6 to
4d7a4dd
Compare
a10df39 to
656e115
Compare
sys/include/net/netopt.h
Outdated
| NETOPT_INTEGRITY_CHECK, | ||
|
|
||
| /** | ||
| * @brief Get/Set the channel frequency as uint32_t. |
There was a problem hiding this comment.
Maybe add some detailed description (i.e. paragraph under this line), about how this differs from the NETOPT_CHANNEL option.
There was a problem hiding this comment.
Not sure if better, but I added the detailed description.
There was a problem hiding this comment.
Maybe not perfect, but sufficient for me.
925e07a to
a67a719
Compare
a67a719 to
400ecd9
Compare
sys/shell/commands/sc_gnrc_netif.c
Outdated
| if (res >= 0) { | ||
| printf(" NID: 0x%" PRIx16, u16); | ||
| } | ||
| #ifdef MODULE_LORA |
There was a problem hiding this comment.
You removed the other #ifdefs. Why not this one (which except for size optimization is the least useful as it wouldn't show anything if compiled in but the options were not supported)?
sys/shell/commands/sc_gnrc_netif.c
Outdated
| else if ((strcmp("frequency", key) == 0) || (strcmp("freq", key) == 0)) { | ||
| return _netif_set_u32(iface, NETOPT_CHANNEL_FREQUENCY, 0, value); | ||
| } | ||
| #ifdef MODULE_LORA |
There was a problem hiding this comment.
Dito. Usage above isn't #ifdef'd
400ecd9 to
4ccfcfd
Compare
|
@miri64 I guess we are good here, shall I squash ? |
sys/shell/commands/sc_gnrc_netif.c
Outdated
| hex = true; | ||
| } | ||
|
|
||
| if (res > 0xffffffff) { |
There was a problem hiding this comment.
UINT32_MAX? Also, I think it is safe to make this an assert for now. I don't know of any platform in our scope where sizeof(unsigned long) > sizeof(uint32_t).
4ccfcfd to
056aa7e
Compare
|
@miri64 shall I squash this one ? |
056aa7e to
bfdd4c4
Compare
|
squashed ! |
bfdd4c4 to
d4d18d9
Compare
|
@miri64, I have rom overflows issues with Murdock. Is it ok if I add some ifdefs to skip the LoRa specific functions ? |
|
No, just put the |
because of not enough memory
|
But we definitely need a modular approach to ifconfig in the future. The current approach doesn't scale (as would |
|
(last proposal would be different than the original version of this PR would be that interface configuration from network layer view would still be done with |
As required in #7356, I adapted the ifconfig code to work with sx127x devices as well. Finally, not so difficult, but this code is becoming quite difficult to follow with all those #ifdefs.
Based on
#7356#8160for the netif/auto_init adaption.