Languages

Menu
Sites
Language
XMLHttpRequest - Gear S - Tizen / Bluetooth & Wifi

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.

 

Responses

4 Replies
mekabe remain

well, I found how to debug.

And the result;

on wifi, the gear S receives "200 OK" response from the server.

on bluetooth, debug window says "failed" immediately after the request is sent.

I see that the server response is received by my phone

But I am not sure why Gear S fails. 

Is it because phone does not forward the response to watch ? (if so, why doesn't it forward ? Is there a feature or privilege for that ?)

Or does it receive the response and doesn't like it ?

As the failure is immediate, I guess the watch receives "something" because otherwise there would be a timeout. No?

 

mekabe remain

any ideas ?

I am really helpless. Please if you have any ideas, please share...

 

mekabe remain

anyone ?

please , I need help...

 

daniel kim

Hi,

Will be helpful to check what was happened if you attach some code snippet or sample code here.