Code Monkey home page Code Monkey logo

Comments (13)

davidmurray avatar davidmurray commented on July 26, 2024

I can't really help you if you don't show me your code. :(

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

Sorry I didn't have internet access so I am answering after 4 days:)
Here is what I do

main.m:

int main (int argc, const char * argv[])
{

@autoreleasepool
{
    NSLog(@"\n\n\n MSManagerStarted 01 \n\n\n");

    // insert code here...
    MSManager *server = [[MSManager alloc] init];

    NSDate *now = [[NSDate alloc] init];
    NSTimer *timer = [[NSTimer alloc] initWithFireDate:now
                                              interval:.01
                                                target:server
                                              selector:@selector(start)
                                              userInfo:nil
                                               repeats:NO];

    NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
    [runLoop addTimer:timer forMode:NSDefaultRunLoopMode];
    [runLoop run];
}
return 0;
}

here is MSManager's class start method implementation:

- (void)start
{
       [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(managerDidFinishScanning) name:kDMNetworksManagerDidFinishScanning object:nil];
        [[DMNetworksManager sharedInstance] scan];
}

But after it is scanned nothing happens. I mean 'managerDidFinishScanning' isn't called. Can you help?

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

Maybe try to use CFRunLoopRun() instead of your NSDate, NSTimer and NSRunLoop code?

Also, can you check the syslog? Maybe you're missing an important entitlement.

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

There is no problem with the entitlements. Even with CFRunLoopRun() it doesn't work. Any other ideas?

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

Can you add an NSLog at the beginning of DMNetworksManager's _scanDidFinishWithError method?

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

Nothing happens. It gets stuck at _scan method
Have you ever used this in a launch daemon?

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

Try CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false). Also, make sure that this is the last thing that your main function does.

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

This doesn't work either:(
I can solve my problem another way. What I am trying to do is I want to connect to a given network (the ssid and encryption model and password is given). What i used to do was scan for networks and then if the given said network was scanned then i associated with it. Can I do this another way if there is a problem with scanning?

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

I think it's because of the entitlements thing. Can you run ldid -e YourBinary on your daemon? ldidis available in Cydia.

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

here is the result:
`

com.apple.CommCenter.Messages-send com.apple.coretelephony.Identity.get com.apple.developer.ubiquity-container-identifiers com.apple.locationd.preauthorized com.apple.wifi.manager-access keychain-access-groups apple com.apple.preferences com.apple.CommCenter.Messages-send com.apple.coretelephony.Identity.get com.apple.developer.ubiquity-container-identifiers com.apple.locationd.preauthorized com.apple.wifi.manager-access keychain-access-groups apple com.apple.preferences com.apple.CommCenter.Messages-send com.apple.coretelephony.Identity.get com.apple.developer.ubiquity-container-identifiers com.apple.locationd.preauthorized com.apple.wifi.manager-access keychain-access-groups apple com.apple.preferences `

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

Hm, looks correct. No idea then.

from wifi.

H-Shafiei avatar H-Shafiei commented on July 26, 2024

any help with the network association thing? I mean connect to network without scanning.

from wifi.

davidmurray avatar davidmurray commented on July 26, 2024

See -[DMNetworksViewController tableView:didSelectRowAtIndexPath:].

from wifi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.