Comments (7)
Had a look at this, two things:
- The call stack issue does indeed seem to be an error in this package, I'll fix that.
- 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.
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.
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
:
It imports the framework just fine, but it can't import values from it properly.
from objc.
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.
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.
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.
Sure
from objc.
Related Issues (20)
- Ref conversions HOT 2
- Getting data out of a CVPixelBuffer HOT 18
- please update to node >10 version HOT 1
- Symbol not found with Node 10.11.0 and Electron 4.0 HOT 1
- Delegating HOT 5
- how convert nativeWindowHandle to NSView HOT 8
- how can i import custom framework?
- build fails on npm install --save objc HOT 3
- Support for Node 14.x ??? HOT 2
- How to get NSView or NSWindow? HOT 3
- How to use NSRange as a Block parameter? HOT 1
- Unhelpful error message when framework not found HOT 2
- xxxx.apply is not a function
- "Unexpected token 'o'" in type-encodings.js
- Can you use private frameworks with this?
- Can't introspect various symbols (e.g. require('objc').NSTitledWindowMask)
- Can we do an example for synchronizing documents in the icloud multiple devices?
- Install fails
- Support electron 21 / v8 memory cage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objc.