Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

sol-connman: Add sol-connman basic API #2068

Closed
wants to merge 13 commits into from

Conversation

wzhen12
Copy link
Contributor

@wzhen12 wzhen12 commented May 20, 2016

so-connman is for implementing connection manager features.
The APIs should be implemented in Zephyr, connman and so on.

The patches are for implementing sol-connman basic APIs to connman.
the connman D-Bus APIs are wrapped in the so-connman APIs.
The user can use the so-connman APIs to control connman.

Signed-off-by: Wu Zheng [email protected]

@wzhen12
Copy link
Contributor Author

wzhen12 commented May 20, 2016

Sorry, I am ready for Malaysia training and fix other project issues.
It results in that the patches are updated today.

According to the comments of #1935 ,
the related issues have been fixed.
It is the version 4 of sol-connman.

  1. The "connman" name has been modified.
  2. The connect/disconnect test cases have been added.
  3. fbp test cases have been added.
  4. others.

Thanks for chaojie to implement the fbp test cases.

Please check it. Thanks.

@wzhen12 wzhen12 force-pushed the master branch 2 times, most recently from 5162cec to f720edd Compare May 20, 2016 05:33
@vcgomes
Copy link
Contributor

vcgomes commented May 20, 2016

I still need to properly review these changes, but in the mean time, please take a look at these two commits: ddd0dcb a0bf641 (the whole series is here: #2074, in case you want to take a look :-)

I think they can be helpful here, please see if anything is missing.

* @return 0 on success, -errno on failure.
*/
int sol_netctl_service_get_network_address(
const struct sol_netctl_service *service, struct sol_network_link **link);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason that this function doesn't return a const struct sol_network_link *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gustavo suggests it.
And "return -errno" is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the whole series is here: #2074, in case you want to take a look
@vcgomes, I will check it quickly.

@vcgomes
Copy link
Contributor

vcgomes commented May 20, 2016

I just have a question, looking good.

/**
* @brief Gets the service name
*
* This function gets the name for the connman service,

Choose a reason for hiding this comment

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

no mention to connman here :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay.

@barbieri
Copy link

Almost ready to get it, my last comments are:

  • no mention to connman outside of -impl-connman.c, that is, the header and kconfig shouldn't have that.
  • rewrite the commits to state netctl instead of connman. This is painful, so my suggestion is to squash all commits into a single one that merges the netctl.

wzhen12 added 13 commits May 24, 2016 15:10
so-netctl is for implementing connection manager features.
The APIs should be implemented in Zephyr, connman and so on.
To connman, the connman D-Bus APIs are wrapped in the so-netctl
APIs. The user can use the so-netctl APIs to control connman.

To invoke the D-Bus method of connman, the async call is used,
the callback function is set to get the results of async call.

The basic so-netctl APIs are in the patch.
It provides the APIs of getting the name, ip address... of services.
The service connect/disconnect APIs and set/get offline
are implemented too.

The further sol-netctl APIs are being planned.

Signed-off-by: Wu Zheng <[email protected]>
Get the service properties is implemented.
It based on connman and wraps the D-Bus APIs of connman services.
Get the name, state, type, ip address ... of services are done.

Signed-off-by: Wu Zheng <[email protected]>
sol-netctl init/shutdown are implemented.
It based on connman and wraps the D-Bus APIs of connman.
init/shutdown are not true to init/shutdown sol-netctl.
init_lazy/shutdown_lazy are true to init/shutdown sol-netctl.

Signed-off-by: Wu Zheng <[email protected]>
sol-netctl set offline is implemented.
It based on connman and wraps the D-Bus APIs of connman.
It sets the connman to offline mode.
It will close the all connection interfaces(including ethernet ...).

Signed-off-by: Wu Zheng <[email protected]>
Get connection manager state is implemented.
It based on connman and wraps the D-Bus APIs of connman.
Get connection manager state is from connman.
It includes online, ready, offline, idle.

Signed-off-by: Wu Zheng <[email protected]>
Get services properties is implemented.
It based on connman and wraps the D-Bus APIs of connman.
It only is invoked internal and in the process of init lazy.
Get services properties APIs can't invoke the D-Bus APIs of connman directly.

Signed-off-by: Wu Zheng <[email protected]>
Add/del monitors functions are implemented.
It based on connman and wraps the D-Bus APIs of connman.
After add the monitors, the connman services and connection
manager state are monitored.
After del the monitors, the related network info can't be monitored.

Signed-off-by: Wu Zheng <[email protected]>
Monitor callback functions are implemented.
It based on connman and wraps the D-Bus APIs of connman.
When Netctl monitor is added, callback function need to be registered.
when any services properties and connection manager state are changed,
the callback functions can be invoked to notify the related info.

Signed-off-by: Wu Zheng <[email protected]>
Network devices connect/disconnect are implemented.
It based on connman and wraps the D-Bus APIs of connman.

Signed-off-by: Wu Zheng <[email protected]>
Get services list is implemented.
It based on connman and wraps the D-Bus APIs of connman.
The user can use the API to get services list.

Signed-off-by: Wu Zheng <[email protected]>
Add sol-netctl build files, so that sol-netctl API can be built.

Signed-off-by: Wu Zheng <[email protected]>
The test cases will test sol-netctl APIs

Signed-off-by: Wu Zheng <[email protected]>
The init and shutdown process of sol-netctl need to be added to
the init and shutdown process of sol-comms.

Signed-off-by: Wu Zheng <[email protected]>
@wzhen12
Copy link
Contributor Author

wzhen12 commented May 24, 2016

Please check #2087 for the new version.

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

Successfully merging this pull request may close these issues.

3 participants