[Mono-osx] CoreWlan Framework binding problem

Ashok Gelal ashokgelal at gmail.com
Sun Jan 16 23:26:36 EST 2011

Hello All,
Right now I'm working on rewriting a popular open source software inSSIDEr
from MetaGeek http://goo.gl/ompgJ makeing it cross platform using Mono and
Gtk#. I've managed to make the newly written application run in Windows and
Linux, and just a few days ago we released an alpha version of it (
https://github.com/metageek-llc/inSSIDer-2-Cross-Platform - just the
binaries for now) and so far the responses have been awesome! I've met a guy
or two talking against it for using Mono but, to be honest, I give a sh**
about them.

Now to the main point - to support the application so that it runs on Mac, I
need CoreWlan framework. I've successfully ran the program (without any
Network Scan support) on Mac and it looks super awesome! I wrote the
CoreWlan binding which is about 90% complete (see the attached corewlan.cs
file), and it compiled fine without any error. I'm pretty much sure only 90%
coverage should allow me to at least write a simple 'hello, corewlan'
program but I'm running out of luck. As soon as I call *NSApplication.Init
()* and call my static method (*CWInterface.SupportedInterfaces()*, I get a
segfault error right away. If I call the static method without calling *
NSApplication.Init()*, I don't get any segfault but I always get a null
value instead of an array of string.

I've noticed that when trying to invoke the static method (or any other
methods/ properties), the value of class_ptr is always 0x0.

Here is the simple example that I'm using:

*using System;*

*using MonoMac.CoreWlan;*

*namespace MacInssider*


* class MainClass*

* {*

* static void Main ()*

*        {*

*                    // NSApplication.Init(); // if I uncomment this out, I
get a segfault error right away*

*       var interfaces = CWInterface.SupportedInterfaces();*

*                     // interfaces is always null at this point.*

*               }*

* }*


My ultimate target is to get this example working using Mono (
http://goo.gl/YzEQy). Can anyone help me where I'm doing wrong? Or can help
me port CoreWlan framework?

I've attached the corewlan.cs file and also all the generated .g.cs files (I
don't think attaching these .g files are required but just-in-case)


Ashok Gelal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: corewlan.cs
Type: application/octet-stream
Size: 6169 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0006.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CW8021XProfile.g.cs
Type: application/octet-stream
Size: 7848 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0007.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CWConfiguration.g.cs
Type: application/octet-stream
Size: 10013 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0008.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CWInterface.g.cs
Type: application/octet-stream
Size: 20371 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0009.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CWNetwork.g.cs
Type: application/octet-stream
Size: 7708 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0010.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CWWirelessProfile.g.cs
Type: application/octet-stream
Size: 6961 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110116/eddf79c2/attachment-0011.obj 

More information about the Mono-osx mailing list