I am designing a web app that uses manufacturer specific data from a BLE device. The device advertises manufacturer specific data and I can see this when using the chrome internal tools. Note that this packet is advertised and there is no scan response set.
Even using this example: https://googlechrome.github.io/samples/web-bluetooth/watch-advertisements.html does not work. I am using 0xFFFF company ID for testing and I set a prefix in the filters too however the map remains empty and so does the event.manufacturerData object.
I have turned on the relevant experimental flags, namely web Bluetooth and the one to do with permissions. Is this a bug or am I missing something with permissions?
Note that advertisement received events are fired and even filtering by data prefix works.
This question was answered on GitHub:
Data in advertisementreceived events enabled when watchAdvertisements() is filtered based on the parameters passed to requestDevice() when permission to access the device was granted. To receive manufacturer data the company ID must be included in the optionalManufacturerData option like this:
const manufacturerId = 0x0001;
await navigator.bluetooth.requestDevice({
acceptAllDevices: true,
optionalManufacturerData: [manufacturerId],
});
Related
I created a smart home action using action-on-google and nodeJs, and it works fine. When you say turn on switch off, it sends MQTT request to my server, means that onExecute function works fine but the problem is that google doesn't respond to my command by OK it says "sorry it looks like your device not available right now", I observed also that my device is always offline in Google home app. Is it required to work with firebase and get device state from there?
Firebase is one of web services allowed to store a device's states. You can feel free to use other web services.
If your device is offline, it may be because your Google Home App hasn't received your device's states.
Here are two paths for Google Home App receiving your device's data:
Google Server will send a action.devices.QUERY intent and callback your function (e.g. onQuery) to get the data of your device through your fulfillment, see action.devices.QUERY.
Thus, please print logs in the onQuery function and make sure that your function works fine.
Your smart home action must use the API of reportStateAndNotification to update your device's data in the Home Graph, see Method: devices.reportStateAndNotification.
If Google Assistant gives you "Sorry, device is not available right now", it probably is because the Google server hasn't received correct information from your fulfillment. Please follow the suggestions above and try it again.
If you're still having issues, check your logs to identify the particular issue for that device.
Is there a way to identify the browser based on web-push-notification endpoint url?
I would like to add a list of endpoints to the user settings page, so he could see what devices are connected and remove the ones that he does not need, but all I have is the endpoint (and auth data) in format like this one:
https://fcm.googleapis.com/fcm/send/fIoxgVbEb3Q:APA91bHN_ryToq_Oe6QQa-pO__uKoLjv2LJSI_8YxvqSN2j8UUHUxH8wTnOOHJdBq252baM3bkIXqRBp529GctrxLqF_A_K9R-5pnIL0jFw6f4p7yQq_Lp2AbNyPRyidU3JHwdmuI11p
I would like to convert it to something like:
Chrome on Samsung Galaxy 8
Firefox on Windows 7
Internet Explorer on IPhone 6
Is there any way I could do it, or do I need to collect this data in advance?
I know I can get the browser form domain, but is there any list that contains all of the possibilities?
I think there's no way to do this without collecting information in advance.
The domain will be the same for the same browser on different platforms.
I've created 2 AdUnits in my Dev Dashboard. One for mobile and one for tablet/pc.
How am I suppose to handle these? I've read so many articles but I've yet to find out anything that tells you how to use both of these? Is that done automatically?
From what I've read and understood, when you upload your app to be approved, it will read the AdMediator.config and update it accordingly but if that's the case, I only have an AdUnit for Microsoft Advertising and one for AdDuplex but nothing that specifies whether it is for mobile or pc/tablets.
What am I missing?
Thanks.
Thierry
To handle AdUnits for Windows Mobile and Tablet/PC, you need to config your AdMediator.config file.
In AdMediator.config following keys are used for Tablet/PC Device family
WApplicationId - Tablet/PC Device family Application Id
<Key>WApplicationId</Key>
<Value>d25517cb-12d4-4699-8bdc-52040c712cab</Value>
WAdUnitId - Tablet/PC Device family AdUnit Id
<Key>WAdUnitId</Key>
<Value>10043121</Value>
And following keys are used for Mobile Device family
MApplicationId - Mobile Device family Application Id
<Key>MApplicationId</Key>
<Value>3f83fe91-d6be-434d-a0ae-7351c5a997f1</Value>
MAdUnitId - Mobile Device family AdUnit Id
<Key>MAdUnitId</Key>
<Value>10865270</Value>
Refer the screenshot for any confusion. Hope this is helpful to you.
I have built a prototype board for a raspberry pi, and I would like to create a custom snmp OID that I can talk to, that will give me feed back from my device.
I can get the value back from my device, but I'm not sure where to start with creating a custom OID, registering it and then updating it.
Has anyone got any good places to start, tutorials, example code etc.
Cheers
Luke
The official channel would be to register for a 'Private Enterprise Number' via this link:
http://pen.iana.org/pen/PenApplication.page
After the approval process, you'll receive an OID which you can further branch out and create entire sub-trees of OIDs.
That said, as an individual, you can probably make do with any valid OID for testing purposes.
The "Which OIDs should you use?" section from the following Apache Directory Service article is a useful read:
http://directory.apache.org/apacheds/1.5/31-add-your-first-elements-to-the-schema.html
A related question mentions a UUID approach to OID:
SNMP: Create custom OID
I want to generate universally unique id for registration process of my j2me application. i came across following approaches for that
IMEI no of device Getting IMEI and IMSI in Java ME this approach doesn't work on most of devices. Problem with IMEI is is not that easy to get it from Midlet for most of models.
Bluetooth device address Getting Bluetooth Address
Problem Needs support for Bluetooth API and will limit no of devices app can run on.
UUID class
Problem Need Bluetooth API as it is in javax.bluetooth package same prob
The registration process used by my company for their android app is as follows
customer mobile will send IMEI no and Token provided by company to server using SMS
Server will send licence key to customer mobile which will be stored in customer mobile
And i have to follow the same approach for j2me application
One solution can be getting unique id from server through SMS. but company uses above registration process.
Is there any other approch that i can use for registraing my application or is there any way to overcome above problems.
I agree with #funkybro that a Jad key with a unique ID provided by the server would solve the issue. But if its not possible I would create an id based on mobile time and a hash code.
long time = System.currentTimeMillis();
StringBuffer id = new StringBuffer(Long.toString(time, 16).toUpperCase());
id.append(Integer.toHexString(new Object().hashCode()).toUpperCase());
If this id is duplicated the registration process fails and the application is asked for a new id.
You can put a server generated unique ID in the jad at deploy time.