Skip to content
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

WLAN completely unsupported #17

Closed
npyl opened this issue Jan 20, 2018 · 7 comments
Closed

WLAN completely unsupported #17

npyl opened this issue Jan 20, 2018 · 7 comments
Assignees

Comments

@npyl
Copy link
Member

npyl commented Jan 20, 2018

The build option BUILD_WLAN is only available for Linux.

We either need to provide an option BUILD_DARWIN_WLAN or patch the original code and keep BUILD_WLAN

@npyl npyl added the bug label Jan 20, 2018
@npyl npyl self-assigned this Jan 20, 2018
@npyl npyl added this to the Secondary Features milestone Jul 11, 2018
@npyl
Copy link
Member Author

npyl commented Jul 12, 2018

I chose to patch the original code to make BUILD_WLAN available for all OS. It is also set to OFF by default for backwards-compatibility. This should be the optimal behaviour.

See commits: 800992d, 504d27c, 51f5350.

@npyl npyl removed the bug label Jul 29, 2018
@npyl
Copy link
Member Author

npyl commented Jul 29, 2018

For macOS there are some options: (Apple doesn't really want you to know WIFI stuff 👻)

  • Use CoreWLAN.framework
  • Use airport command line utility
  • Use the private framework Apple80211.framework

First option means calling Obj-C somehow in our C++ project. (Probably convert darwin.cc to darwin.mm 😂)...

Second option means using pipes / parsing and ugly and tedious code just to get an essid and other information.

Third option means reverse-engineering, (this can help), probably later dealing with obsolete APIs, but too much fun.


Right now, the idea is finding a way to call Obj-C functions in conky in order to acheive No. 2


Though I could use this which will probably work.

npyl added a commit that referenced this issue Jul 30, 2018
@npyl
Copy link
Member Author

npyl commented Jul 30, 2018

082076a has been deleted. I decided not to go with this approach. Instead I am going to rename darwin.cc to darwin.mm and thus enable Objective-C++ and CoreWLAN.framework

npyl added a commit that referenced this issue Aug 1, 2018
npyl pushed a commit that referenced this issue Aug 9, 2018
* Try to amend #31

* BUILD_WLAN should be available for all OS.

Keep BUILD_WLAN OFF by default for compatibility reasons.

* WLAN-related variables should be available for every OS.

There are some problems (probably null-dereference)

* Fix $wireless_essid crashing conky if no argument provided.

Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable.

Also fix some documentation stuff.

* Improve `get_freq` #20

Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one.

Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.

* Oops, this accidently slipped in

* Introduce BUILD_IPGFREQ build option

This build option has been introduced for one particular reason:

On macOS getting current core-frequency is not supported by the APIs.  A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension.  Though, this may trouble some alot, thus introduce BUILD_IPGFREQ.

* Forgot static here.

* Some improvements for get_freq again.

Fix frequency not printing correctly (I wasn't using the divisor)
Add more guards.

* Setup cmake files and project code for Objective-C code #17

We want to use CoreWLAN framework.

* update_cpu_usage() now supports multiple cores

Also, some cleanup.

* Updated default conky config to monitor Mac Networking

* Made Mac Friendly BuildOptions and generic default conky configs

* Undid Xdamage config and cleaned up previous IF statements

* Re-Added XDamage fix

* Finish up the algorithm. I think its now correct. Closes: #33

* Cleanup macro and introduce a no-op free_cpu() function for ALL cpu-related variables

free_cpu() must be implemented for every OS and on all except macOS its a no-op function.

* Reformat, add empty comment.
npyl added a commit that referenced this issue Aug 9, 2018
npyl added a commit that referenced this issue Aug 19, 2018
@npyl
Copy link
Member Author

npyl commented Sep 19, 2018

This can now be closed as I have pretty-much done what I could to implement WLAN stats. They may be completely wrong but the solution may be one step away...

I am not well-versed with WLAN terminology / theory thus I cannot provide better implementation.

The work can be seen in the wifi branch.

More patches may come in the way but this can be considered done :)

@npyl npyl closed this as completed Sep 19, 2018
@npyl
Copy link
Member Author

npyl commented Sep 20, 2018

@matmunn Hi Mat, could you please take a look in my code for WLAN? I really don't know anything about WLAN terminology (haven't yet gone to uni) and don't really understand anything around the internet.

If you don't know either thats ok 😄

@matmunn
Copy link

matmunn commented Sep 20, 2018

Looks ok to me, from what I understand

@npyl
Copy link
Member Author

npyl commented Sep 21, 2018

@matmunn Thanks Mat!

npyl pushed a commit that referenced this issue Oct 11, 2018
* Work for #17 : Now we have ssid

* Since we are using Objective-C++ NSStrings, we need to link to Foundation.framework, too!

* If interface is UP use the interface SSID; otherwise "off/any" following the Linux implementation.
Add more

* More

* cleanup
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

2 participants