XMLHttpRequest – Gear S – Tizen / Bluetooth & Wifi

XMLHttpRequest – Gear S – Tizen / Bluetooth & Wifi

BY 08 Dec 2014 Web Application Development

Hi,

 

I am trying to post XML commands to a HTTP server from Gear S.

For that purpose, I use XMLHttpRequest method. (I belive this is called XHR)

When I do that over wifi, I can get responses and it always works fine.

when I close wifi interface and enable bluetooth connection to my phone, I expect this to work through my phone.

So the Gear S will try to access the HTTP server through my phone’s wifi connection.

Actually, after shutting down Gear S wifi interface and connecting with bluetooth, my first request to the server runs well.

But then , in my second attempt, Gear S does not send any requests. 

At this point, if I disable and re-enable my Gear S bluetooth connection, it works again (for   just the first attempt)

 

I believe, Gear S doesn’t like something it received from the server. Or it didn’t even receive anything and stays in a waiting state. (until I restart bluetooth)

Some friendly developer told me that my connection relies on CORS (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)

So, I should see an “Access-Control-Allow-Origin: *” response header from the http server. I see that header is being sent from my server to the phone. But I don’t know a method to see the http response sent back to my Gear S.

 

How can I trace that ? Is there a way to see packets from phone to the Gear S ?

Maybe I should debug this on the Tizen IDE but I don’t know how to do that. Can anyone guide me ?

Thanks.

 

Written by