Merge "[Bluetooth] Add bluetooth power off listener for GATTServer" into tizen
[platform/core/api/webapi-plugins.git] / src / bluetooth / bluetooth_gatt_server.cc
index fe33139..194df4b 100644 (file)
@@ -245,6 +245,25 @@ bool BluetoothGATTServer::IsRunning() {
   return running_;
 }
 
+void BluetoothGATTServer::NotifyAboutValueChange(const picojson::value& args,
+                                                 picojson::object& out) {
+  ScopeLogger();
+
+  if (!initialized_) {
+    LoggerE("Server not started");
+    ReportError(common::PlatformResult{common::ErrorCode::ABORT_ERR, "Server not started"}, &out);
+    return;
+  }
+
+  auto result = service_.NotifyAboutValueChange(args);
+  if (result.IsError()) {
+    ReportError(result, &out);
+    return;
+  }
+
+  ReportSuccess(out);
+}
+
 PlatformResult BluetoothGATTServer::Initialize() {
   ScopeLogger();