Skip to content

emac HAL API, WiFiInterface additions #2874

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

Merged
merged 69 commits into from
Oct 5, 2016
Merged

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Sep 30, 2016

Description

This PR contains:

  • wifi extensions - connect with extended parameter lists, connect async, scan and scan asyn
  • emac API
  • ublox emac

Notes for reviewers:
@geky raised a question about those async methods, that if we should not be consistent and provide attach, set_blocking instead of connect_async for instance. I haven't yet reworked this as it will impact the esp8266 update and ublox driver changes, thus once we are all good with the rest, we can consider this, and I can redesign it (while there are still as pull request and we can edit those).

The branch was shared for the development, therefore there are merge commits (updates from master to bring network changes like lwip2 and others), and some commits are not that clean (additions and removals later). I can clean it up as the last step. Please do not focus on git log at first.

I can also split ublox emac HAL implementation from this patch.

What's missing are tests, they will come separately, plus ublox implementation (+driver).

Status

IN DEVELOPMENT
Up for review now, still expecting some changes. Need to run some basic tests as well, ethernet should be retested that any changes in lwip_stack files do not affect its functionality.

Migrations

The wifi modules might need to extend their implementation, for instance, there's esp8266 pull request done by @bulislaw : https://github.com/ARMmbed/esp8266-driver/pull/11/files

Todos

  • Tests
  • Documentation (API at least contains doxygen)

please review @kjbracey-arm @c1728p9 @geky @bulislaw @sg- @andreaslarssonublox @lauri-piikivi

If anyone can help to test basic eth functionality, would be appreciated.

0xc0170 and others added 30 commits September 14, 2016 12:53
General refactoring of the API and new methods added:
  * get_rssi() - measures radio signal strenght
  * get_state() - returns current state (not connected,
   		 connecting, connected, error)
  * scan() - scans for available networks sync and async versions
  * connect_async() - connect to a network without blocking
* Add details to documentation
* Add timeout for async functions
* Add channel parameter to connect
* Add wifi_ap_t to connection cb function
Conflicts:
	features/net/FEATURE_IPV4/lwip-interface/EthernetInterface.cpp
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.h
	features/net/network-socket/WiFiInterface.h
ethernet uses eth_arch_xxx_interrupts, emac_xxx_enable_interrupts
It now accepts additional arguments, that lwipipstack do not use, thus
all 0 and false for dhcp.
WifiInterface - add set_credentials
We do not want to mix Ethernet and Wifi at the moment, thus WiFiInterface
should implement own connect using emac.
Conflicts:
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
	hal/targets.json
Currently only for IPv4. lwip was updated to accept 2 arguments for getting
the ip address (buffer and length).
@kjbracey
Copy link
Contributor

kjbracey commented Oct 4, 2016

I'm happier with that final diff - it's not messing with the fundmental initialisation flow at all as far as I can see, so should be fine for both IPv4 and IPv6.

I think I would have put the "netif_add" into the connect rather than the init, but maybe you're right - if that split suits your driver, fine.

Would be nice to see a tidied up patch set, especially now there's the rename - would be possible to check the actual net diff apart from the rename.

@bulislaw
Copy link
Member

bulislaw commented Oct 4, 2016

Do you mean just this single commit? ae11b51

@kjbracey
Copy link
Contributor

kjbracey commented Oct 4, 2016

Do you mean just this single commit? ae11b51

No, that's the diff since your previous draft. I want to see the actual final patches versus master.

All GitHub can show me against master is your total branch, including the rename - can't easily isolate the other changes.

@geky
Copy link
Contributor

geky commented Oct 4, 2016

This looks good, thanks for fixing the API bugs.

The only remaining issue is with NSAPI_SECURITY_UNSUPPORTED.

@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 4, 2016

/morph test

@bridadan
Copy link
Contributor

bridadan commented Oct 4, 2016

/morph test

Returning a wifi access point without information regarding the
security type is only valid if the security type is unknown (from
the perspective of the network-socket API). For clarity in situations
in which scan may return an unsupported, but known security type,
type name has been changed to NSAPI_SECURITY_UNKNOWN.
@geky geky force-pushed the feature_wifi_ublox branch from 60afa03 to 4f1eded Compare October 4, 2016 19:23
@mbed-bot
Copy link

mbed-bot commented Oct 4, 2016

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test

@geky
Copy link
Contributor

geky commented Oct 4, 2016

/morph test

@geky
Copy link
Contributor

geky commented Oct 4, 2016

Tested locally with K64F, NUCLEO_F429ZI, and NUMAKER_PFM_NUC472

@mbed-bot
Copy link

mbed-bot commented Oct 5, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1052

All builds and test passed!

@sg- sg- merged commit 683d7b7 into ARMmbed:master Oct 5, 2016
@0xc0170
Copy link
Contributor Author

0xc0170 commented Oct 5, 2016

Thank you all of you for review and helping with this patch 👍

@andreaslarssonublox andreaslarssonublox mentioned this pull request Oct 11, 2016
2 tasks
@0xc0170 0xc0170 deleted the feature_wifi_ublox branch September 2, 2021 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants