{"protocol", getProperty, NULL, kJSPropertyAttributeReadOnly},
{"state", getProperty, NULL, kJSPropertyAttributeReadOnly},
{"peer", getProperty, NULL, kJSPropertyAttributeReadOnly},
- {"onError", NULL, setProperty, kJSPropertyAttributeNone},
- {"onMessage", NULL, setProperty, kJSPropertyAttributeNone},
- {"onClose", NULL, setProperty, kJSPropertyAttributeNone},
+ {"onerror", NULL, setProperty, kJSPropertyAttributeNone},
+ {"onmessage", NULL, setProperty, kJSPropertyAttributeNone},
+ {"onclose", NULL, setProperty, kJSPropertyAttributeNone},
{0, 0, 0, 0}
};
if (priv == NULL)
{
LogError("priv null");
- Throw(WrtDeviceApis::Commons::UnknownException);
+ Throw(WrtDeviceApis::Commons::ConversionException);
}
if(JSStringIsEqualToUTF8CString(propertyName, "uuid"))
if (priv == NULL)
{
LogError("priv null");
- Throw(WrtDeviceApis::Commons::UnknownException);
+ Throw(WrtDeviceApis::Commons::ConversionException);
}
- if (argumentCount < 1 || JSValueIsNull(context, arguments[0]) == true)
+ if (argumentCount < 1)
{
LogError("argument wrong");
- Throw(WrtDeviceApis::Commons::InvalidArgumentException);
+ Throw(WrtDeviceApis::Commons::ConversionException);
}
AceSecurityStatus status = BLUETOOTH_CHECK_ACCESS(
- priv->getContext(),
bluetoothExportedNames[BLUETOOTH_FUNCTION_API_SOCKET_WRITE_DATA]);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if (data.size() == 0)
{
LogError("size 0 array passed");
- Throw(WrtDeviceApis::Commons::InvalidArgumentException);
+ Throw(WrtDeviceApis::Commons::ConversionException);
}
DPL::ScopedArray<char> buffer(new char[data.size()]);
{
LogError("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
- JSTizenException::TYPE_MISMATCH_ERROR, "invalid value error");
+ JSTizenException::INVALID_VALUES_ERROR, "invalid value error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
IBluetoothSocketManagerPtr BluetoothSocketManager(priv->getObject());
AceSecurityStatus status = BLUETOOTH_CHECK_ACCESS(
- priv->getContext(),
bluetoothExportedNames[BLUETOOTH_FUNCTION_API_SOCKET_READ_DATA]);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
{
LogError("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
- JSTizenException::TYPE_MISMATCH_ERROR, "invalid value error");
+ JSTizenException::INVALID_VALUES_ERROR, "invalid value error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
LogDebug(bluetoothExportedNames[BLUETOOTH_FUNCTION_API_SOCKET_CLOSE]);
AceSecurityStatus status = BLUETOOTH_CHECK_ACCESS(
- priv->getContext(),
bluetoothExportedNames[BLUETOOTH_FUNCTION_API_SOCKET_CLOSE]);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ if (BluetoothSocketManager->close() != BT_ERROR_NONE)
+ {
+ Throw(WrtDeviceApis::Commons::UnknownException);
+ }
+
+ return JSValueMakeNull(context);
+
}
Catch (WrtDeviceApis::Commons::SecurityException)
{
{
LogError("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
- JSTizenException::TYPE_MISMATCH_ERROR, "invalid value error");
+ JSTizenException::INVALID_VALUES_ERROR, "invalid value error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{