8000 Consolidate use of modnetwork, modusocket and cc31k · Issue #4096 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Consolidate use of modnetwork, modusocket and cc31k #4096

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

Closed
glennrub opened this issue Sep 3, 2018 · 3 comments
Closed

Consolidate use of modnetwork, modusocket and cc31k #4096

glennrub opened this issue Sep 3, 2018 · 3 comments

Comments

@glennrub
Copy link
Contributor
glennrub commented Sep 3, 2018

In an attempt on getting a WiFi uplink in the nrf port i have experimented with cc3k and cc31k modules. Without to much success using cc3k. After ordering a cc3100 click module i finally made some progress and got wifi up running quite well after implementing the SPI driver needed for nrf5x.

However, I'm not too keen on introducing yet another modnetwork and modusocket and a raw copy of the cc3200 modwlan with removal of cc3200 specific header includes and so on. So, i'm proposing to consolidate the modnetwork, modusocket and cc31k module (modnwcc31k.c) into extmod/.

Proposal can be seen here:
master...glennrub:network_consolidate

I have nrf, stm32 and cc3200 targets in a state where it is possible to compile, but untested (only tested non-secure socket on nrf52). Right now its a rough implementation to show the proof-of-concept.

@dpgeorge, could this be a viable solution?
@danicampora, could this work for the cc3200 port? I know this would be an intrusive patch to the cc3200 as the WLAN is renamed to CC31K (could it be weak-linked?). At least it would make the code existing for cc31k reusable for other ports quite easy, by just defining a SPI transport for it and use the alternate cc31k_make_new with the extra SPI parameters.

@dpgeorge
Copy link
Member
dpgeorge commented Sep 4, 2018

could this be a viable solution?

Yes it could. In principle it is a good idea to consolidate duplicated functionality, and make code more port-agnostic. But in practice, in this case, it might be made harder because the different ports have very different modnetwork.c code.

And the modusocket.c code is very different depending on the approach used: lwIP (esp8266, stm32 in certain configurations), POSIX-ish (unix, esp32 to some extent), or generic wrapper (cc3200, stm32). So if things get moved to extmod/ then it would be called something like extmod/modusocket_generic.c.

could this work for the cc3200 port? I know this would be an intrusive patch to the cc3200 as the WLAN is renamed to CC31K (could it be weak-linked?)

Yes it would also be good to move generic stuff out of ports/cc3200/ and make it reusable. We can always add compile time config options to retain existing behaviour on cc3200 where appropriate. IMO keeping the network class named "WLAN" is important.

@pfalcon
Copy li 8000 nk
Contributor
pfalcon commented Sep 4, 2018

So, i'm proposing to consolidate the modnetwork, modusocket and cc31k module (modnwcc31k.c) into extmod/.

extmod/ neither was intended to contain, nor contains, nor should contain hardware-specific stuff, like "modnwcc31k.c". There's drivers/ for that.

tannewt added a commit to tannewt/circuitpython that referenced this issue Feb 3, 2021
@jonnor
Copy link
Contributor
jonnor commented Jul 27, 2024

modsocket and modnetwork are now in extmod and not port-specific. Drivers must, as mentioned, stay separate. So I believe this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0