EB1.4 on TC8000 - Proximity Sensor

All,

 

With EB1.4 on a TC8000, I'm having trouble turning on the proximity sensor via JavaScript. I see that that turning it on in the settings and using DataWedge it appears to work fine.

 

But when using JavaScript and the EB object, I've been unsuccessful trying to turn the sensor on.

 

Can anyone share their code to get the proximity sensor turned on please ?

 

Thank you very much.

 

Gord.

Gord Davey
Bump.I really need to know

Bump.

I really need to know about the proximity sensor please.

When I turn on hands-free scanning in settings, the proximity sensor works, but as soon as I start the Enterprise Browser (1.4) is quits working, and I can find nothing in the API that works to turn the Proximity sensor on.

Thank you.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Edward Correia
sorry for the delay. I am

sorry for the delay. I am asking around...

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Gord,Please let us know

Dear Gord,

Please let us know the below things:

1. Which Enterprsie Browser API are you using for turning on the proximity sensor?

2. Is it running on TC8000 KK or above platform?

Please note:

You can set the proximity sensor using EnterpriseBrowser RE 2.x RawSensors API as mentioned below:

Syntax: Add the below syntax to the html page which enables the proximity sensor data retrieval.

     RawSensors.proximity = 'Enabled';

Note:

In the html page, the above syntax will work if and only if "elements.js" is included to the page.

"elements.js" file is present under "C:\EnterpriseBrowser\JavaScriptFiles\BackwardCompatibility\Android" if EnterpriseBrowser MSI is installed under "C:/" drive on Windows PC.

Thanks & Regards,

Abhineet

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gord Davey
Abhineet,Re #1 - I am using

Abhineet,

Re #1 - I am using Enterprise Browser 1.4

Re #2 - I am using a TC8000 with KitKat

A) I've just tried your suggestion of using "elements.js"

Both with the JavaScript:

In the page

This also has no effect in turning the sensor on.

D) I've tried all possibilities I can think of using the EB 1.4 API, as

well as the rhoapi-modules.js commands for the proximity sensor, and now

the elements.js and still nothing is turning it on.

E) My TC8000 does have the proximity sensor in it. If I turn the sensor

on in the Android Settings, then the sensor functions just fine until I

start the Enterprise browser. Then it is off, and I cannot get it to

turn back on.

Gord Davey <Gord.Davey@DaveyComputing.com>

President - Gord Davey Computing - www.DaveyComputing.com

Rockwood ON Canada. Tel: +1 (519) 835-4322

- High Tech Resources For All Your Computing Needs.

- Custom Programming, Consulting, OS, Networking, Support &

Administration.

- PVX Plus, ProvideX and more.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Gord,We have validated

Dear Gord,

We have validated Proximity Sensor API from EB application and it is working fine from EB application.

Sample HTML Page:

<html>

<head>

<script type="text/javascript" charset="utf-8" src="ebapi-modules.js"></script>

<script type="text/javascript" >

  var sensorInstance;

  function proximitySernsordata()

  {

       sensorInstance = EB.Sensor.makeSensorByType(EB.Sensor.SENSOR_TYPE_PROXIMITY);

       if(sensorInstance)

       {

            sensorInstance.start(callbackData);

       }

       else

       {

            outputDiv.innerHTML = "Proximity Sensor is not supported.";

       }

  }

  //Do whatever when proximity sensor associated callback is fired.

  function callbackData(data)

  {

        var proximitySensorData = "<B>Proximity Sensor Data:</B>";

        proximitySensorData = proximitySensorData + JSON.stringify(data.proximity_value) +"<BR>";

        outputDiv.innerHTML = proximitySensorData;

        //Here one can enable the soft scanner if they want using below syntax. Currently i have commented the same..

        //EB.Barcode.enable();

        //EB.Barcode.start();

  }

</script>

</head>

<body onload="proximitySernsordata()">

       <h2>Welcome to Enterprise Browser - EB 1.X Proximity Sensor Sample Page</h2>

       <div id="outputDiv"></div>

</body>

</html>

Please note:

  1. User need to ensure to include ebapi-modules.js file, if EB 1.X API is used in the html page
  2. User can do whatever when EB Proximity Sensor callback is fired.
  3. DataWedge application should be turned off if Barcode Scanner is going to be enabled from EB application

         DataWedge Profiles --> Settings --> DataWedge Settings --> UnCheck the DataWedge enabled

   4. From settings, under Hands Free Scanning, the  Scanning Mode should be changed to Hands Free Off option.

          Setting --> Hands Free Scanning --> Scanning Mode --> Hands Free Off

Attaching the sample page for your reference which is availabe at zebra box link: ProximitySensor - Box 

The zip file consists the below files:-

  1. EB1.X_ProximitySensorCommonAPI.html
  2. ebapi-modules.js

Please raise a ticket and our team will assist you further, If it doesn't work with the above mentioned steps.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gord Davey
Abhineet,Well, this solution

Abhineet,

Well, this solution does not work for me.

Downloading the HTML and JS (just to be safe), ensuring the Hands Free Scanning setting is off, and the Data Wedge is disabled, the HTML page simply says "Proximity Sensor Not Supported".

I've tried some variations and the HTML just says the same thing.

Turning on Hands Free and Data Wedge, and the proximity sensor works fine, so its not a bad sensor.

I'll fill out a support ticket and see what they can do for me. Thanks anyways.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Gord,This looks strange

Dear Gord,

This looks strange to me as it works fine at our end. . However please raise a support ticket. Our team will further investigate on the same.

Thanks & Regards,

Abhineet

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gord Davey
Abhineet,I've put a ticket

Abhineet,

I've put a ticket into to support.

One question for you, the ebapi-modules.js you posted was a newer

edition. Did you run your Proximity test on EB 1.5 ?

Gord Davey <Gord.Davey@DaveyComputing.com>

President - Gord Davey Computing - www.DaveyComputing.com

Rockwood ON Canada. Tel: +1 (519) 835-4322

- High Tech Resources For All Your Computing Needs.

- Custom Programming, Consulting, OS, Networking, Support &

Administration.

- PVX Plus, ProvideX and more.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Gord,We have tested in

Dear Gord,

We have tested in both the version i.e. EB 1.5 & EB 1.4. It is working fine in both the version.

The one which I have shared is EB1.4 JS file..

Thanks & Regards,

Abhineet

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Edward Correia
Hi Gord-Did Abhineet's answer

Hi Gord-

Did Abhineet's answer help you? Please let us know if you require further assistance.

Regards,

Eddie Correia

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gord Davey
Edward and Abhineet,Sorry I

Edward and Abhineet,

Sorry I haven't had a chance to get to test this solution, I was pulled

off onto a side project, and need to complete it before getting back to

the proximity sensor, I will check it soon, thank you for the detail on

how to do it, I would not have figured that sequence out on my own with

the existing documentation.

Gord Davey <Gord.Davey@DaveyComputing.com>

President - Gord Davey Computing - www.DaveyComputing.com

Rockwood ON Canada. Tel: +1 (519) 835-4322

- High Tech Resources For All Your Computing Needs.

- Custom Programming, Consulting, OS, Networking, Support &

Administration.

- PVX Plus, ProvideX and more.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Abhineet Agarwal
Dear Gord,We found out the

Dear Gord,

We found out the root cause of this issue that WHY it worked at our end but not at your end.

On investigation, we found out that the value of Sensor.TYPE_PROXIMITY(used internally by EnterpriseBrowser ) has been changed recently on TC8000 BSP.

That is why the sensor instance was always returning null as EnterpriseBrowser was trying to get the sensor instance with the old value of Sensor.TYPE_PROXIMITY.

But the latest upgraded TC8000 BSP was expecting different value for getting the sensor instance. We have already addressed this to TC8000 BSP team to update the right value to Sensor.TYPE_PROXIMITY.

As you have already raised support ticket, our team will provide you solution through support site.

Thanks & Regards,

Abhineet Agarwal

Enterprise Browser Software Lead

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Gord Davey
Abhineet,Thank you for the

Abhineet,

Thank you for the update on the issue. I look forward to getting a fix.

Gord Davey <Gord.Davey@DaveyComputing.com>

President - Gord Davey Computing - www.DaveyComputing.com

Rockwood ON Canada. Tel: +1 (519) 835-4322

- High Tech Resources For All Your Computing Needs.

- Custom Programming, Consulting, OS, Networking, Support &

Administration.

- PVX Plus, ProvideX and more.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments