pureqml/qmlcore

Retrieve Mac Address

dseeker opened this issue · 6 comments

Is there any way to retrieve the mac address from a device?

I'm seeing a property macAddress on the core/Device object but I can't find it by tracing it in the running application

property string macAddress; ///< device MAC address if its available for current platform

do I need to add this cordova plugin?
0ea061c

thanks for any pointers

Hello @dseeker!
You cannot retrieve the device MAC address in web browser but you can get it from some platforms which allows you to do that right now:

  • LG NetCast
  • Samsung Orsay

On the other platforms I need to ckeck it out is it possible or not.
Do you want to get the MAC address on the android platform?

@comrat Yes from the browser I expect nothing to come as there is no access to that data.
But I imagine on TIzen and WebOS it would be possible with the cordova plugin, no? They have JS bridge library with the information. something like this

if (context.system.vendor == 'LG') webOS.service.request("luna://com.webos.service.connectionmanager", {
		    method: "getinfo",
		    parameters: {},
		    onSuccess: function (args) {
			console.log('success', args)
		//         mac = args.wiredInfo.macAddress;
		    },
		    onFailure: function (args) {
		        console.log('failure', args)
		    }
		}); 

Right now I'm looking for a way to get it in AndroidTV, but in general I want to know how to access this macAddress property using the library, I couldn't find any code examples.

@dseeker where did you find this method?
I only see the getStatusmethod https://webostv.developer.lge.com/api/webos-service-api/connection-manager/
and there is no MAC address

I honestly don't remember where I lifted from
https://www.webosose.org/docs/reference/ls2-api/com-webos-service-connectionmanager/
https://stackoverflow.com/a/42934118/845195

but that's something external to the Qmlcore framework, that I'm doing on the JS side.
I'm still wondering how do I access the Device.macAddress property on Qmlcore in AndroidTV device, is that currently possible?

I've tried this method on my WebOS and got an error

"Denied method call "getinfo" for category "/""

So I'm not sure this should work for WebOS.
For the androidtv we'll try to implement in the corresponded project https://github.com/pureqml/qmlcore-android

pureqml/qmlcore-android#11
create the corresponded issue for qmlcore-android
@dseeker FYI