Code Monkey home page Code Monkey logo

Comments (7)

lukaskollmer avatar lukaskollmer commented on June 12, 2024 1

Had a look at this, two things:

  1. The call stack issue does indeed seem to be an error in this package, I'll fix that.
  2. I don't think IOKit will work with this at all, since it isn't an Objective-C framework but rather a C library. (Same reason why e.g. CoreFoundation wouldn't really work either...). You'll probably need to directly use the ffi module to interface w/ IOKit (the same way this package currently uses the ffi to interface w/ the objc runtime).

from objc.

kernel-dev avatar kernel-dev commented on June 12, 2024

Thank you a lot for the quick response. Apologies for the misleading issue, though, I had originally thought you could bundle it in Obj-C? I remember using it.

Otherwise, thank you. It's immensely appreciated 👍

from objc.

kernel-dev avatar kernel-dev commented on June 12, 2024

An update:

I notice that you are importing frameworks with this format:

  • /System/Library/Frameworks/{NAME}.framework;

Meaning, IOKit should technically be applicable to this rule?
It's supposedly an Obj-C framework, as far as I've been told.

It can also be found under /System/Library/Frameworks:
image

It imports the framework just fine, but it can't import values from it properly.

from objc.

lukaskollmer avatar lukaskollmer commented on June 12, 2024

A .framework can contain Objective-C and/or C code. In the case of IOKit, I'd be surprised if it contains any Objective-C code, tbh.

The symbol you tried to access above, IOServiceMatching, is itself defined as a C function, meaning that, even if IOKit were to contain ObjC code, this package wouldn't be able to access this function.

This package currently only supports accessing Objective-C symbols (primarily classes). You should be able to use the ffi-napi and ref-napi packages to interact with IOKit, though. You can have a look at the runtime.js file to see an example of how this would work. Essentially, you just have to define the signature of the function you want to access, bring in the library from somewhere (this might be the most difficult part, they moved a bunch of frameworks into the shared dyld cache in Big Sur...), and then can call it almost as if it were a "normal" function.

from objc.

kernel-dev avatar kernel-dev commented on June 12, 2024

I see!

Thank you for the elaboration, it means a lot 👍

I'll likely create an IOKit wrapper as a Node lib and share it so that it's more accessible for anyone who wishes to use it 👍

from objc.

kernel-dev avatar kernel-dev commented on June 12, 2024

Sorry to contact you over this, but is it possible that I'd be allowed to contact you over Twitter? I've got some questions I'd like to ask regarding my implementations for IOKit that I'm not sure how to resolve; if you have any free time, and are willing to spare your free time to do so.

Thank you in advance.

from objc.

lukaskollmer avatar lukaskollmer commented on June 12, 2024

Sure

from objc.

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.