getGATTServer undefined for wearable api 6.0

Hi,

I have installed Tizen studio 4.0 and install the Api level 6.0. I have created a Wearable sensor web project for Samsung watch 3.

As per documentation “https://docs.tizen.org/application/web/api/6.0/device_api/wearable/tizen/bluetooth.html”, I was trying to create local GATT server on watch through which any phone can connect with over BLE and access the readings (Steps, Heart rate etc) by using custom services and characteristics.

When I tried to call Bluetooth api method “tizen.bluetooth.getGATTServer();” to get Gatt server object getting following error:

Uncaught TypeError: Cannot read property ‘getGATTServer’ of undefined

Please help, How we can resolve this issue.

Thanks
Rahul Jain

According to Mozilla Website, The TypeError object represents an error when an operation could not be performed, typically (but not exclusively) when a value is not of the expected type.

A TypeError may be thrown when:

  • an operand or argument passed to a function is incompatible with the type expected by that operator or function; or
  • when attempting to modify a value that cannot be changed; or
  • when attempting to use a value in an inappropriate way.

You can use a try-catch segment to catch the TypeError. Also, if you are using TAU library, then I would suggest you to check the same code on a BasicUI project.

Reference link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError