Fix dbus parameter 'ay' to 'a(y)'
[platform/core/connectivity/zigbee-manager.git] / zigbee-daemon / zigbee-interface / src / zigbee_service_dbus_interface_zcl_thermostat.c
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Contact: Suresh Kumar N (suresh.n@samsung.com)
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #include "zigbee_service_interface_common.h"
20
21 #include <zblib_driver_zcl_thermostat.h>
22
23 static void *_service_interface_ref_zigbee_zcl_thermostat(
24         ZigBeeServiceInterface *service_interface)
25 {
26         ZigbeeObjectSkeleton *zigbee_object = NULL;
27         ZigbeeCustomData_t *custom_data = NULL;
28         ZigbeeZcl_thermostat *thermo_object = NULL;
29
30         custom_data = (ZigbeeCustomData_t *)zblib_service_interface_ref_user_data(service_interface);
31         if (NULL == custom_data) {
32                 Z_LOGE("D-BUS service interface custom_data is NULL!");
33                 return NULL;
34         }
35
36         /* Get zigbee object */
37         zigbee_object = g_hash_table_lookup(custom_data->objects, ZIGBEE_SERVICE_PATH);
38         if (NULL == zigbee_object) {
39                 Z_LOGW("Cannot find ZigBee D-BUS interface object!", zigbee_object);
40                 return NULL;
41         }
42
43         thermo_object = zigbee_object_get_zcl_thermostat(ZIGBEE_OBJECT(zigbee_object));
44         return thermo_object;
45 }
46
47 static void on_thermostat_get_local_temp_resp(ZigBeeServiceInterface *service_interface,
48         guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
49 {
50         ZigbeeServiceInterfaceRespCbData_t *cb_data =
51                 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
52
53         ZigbeeZcl_thermostat *thermo_object = NULL;
54         GDBusMethodInvocation *invocation = NULL;
55
56         ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t *)resp_data;
57
58         NOT_USED(service_interface);
59         NOT_USED(request_id);
60
61         if (NULL == resp_data || 0 == resp_data_len) {
62                 Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
63                 g_free(cb_data);
64                 return;
65         }
66
67         thermo_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
68         zblib_check_null_free_and_ret("thermo_object", thermo_object, cb_data);
69
70         invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
71         zblib_check_null_free_and_ret("invocation", invocation, cb_data);
72
73         zigbee_zcl_thermostat_complete_get_local_temp(thermo_object, invocation,
74                 payload->result);
75
76         g_free(cb_data);
77 }
78
79 static gboolean on_thermostat_get_local_temp(ZigbeeZcl_thermostat *thermostat_object,
80         GDBusMethodInvocation *invocation,
81         GVariant *eui64,
82         gchar endpoint,
83         gpointer user_data)
84 {
85         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
86         ZigbeeZclThermostatGetLocalTemp_t req;
87         ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
88
89         GVariantIter *iter = NULL;
90         guint i = 0;
91
92         gboolean ret;
93
94         memset(&req, 0x0, sizeof(ZigbeeZclThermostatGetLocalTemp_t));
95
96         /* Update request structure */
97         g_variant_get(eui64, "a(y)", &iter);
98         while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
99                 i++;
100                 if (i >= ZIGBEE_EUI64_SIZE)
101                         break;
102         }
103         req.endpoint = endpoint;
104
105         /* Allocate response callback data */
106         resp_cb_data =
107                 zigbee_service_dbus_interface_create_resp_cb_data(thermostat_object,
108                         invocation, NULL, 0);
109         if (NULL == resp_cb_data) {
110                 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
111
112                 /* Send failure response */
113                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
114
115                 return TRUE;
116         }
117
118         /* Dispatch request */
119         ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
120                 ZBLIB_DRIVER_TYPE_ZCL_THERMOSTAT,
121                 ZBLIB_ZCL_THERMOSTAT_OPS_GET_LOCAL_TEMP,
122                 &req, sizeof(req),
123                 on_thermostat_get_local_temp_resp, resp_cb_data);
124         if (FALSE == ret) {
125                 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
126
127                 /* Free response callback data */
128                 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
129
130                 /* Send failure response */
131                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
132
133                 return TRUE;
134         }
135
136         return TRUE;
137 }
138
139 static void on_thermostat_get_weekly_schedule_resp(ZigBeeServiceInterface *service_interface,
140         guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
141 {
142         ZigbeeServiceInterfaceRespCbData_t *cb_data =
143                 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
144
145         ZigbeeZcl_thermostat *thermo_object = NULL;
146         GDBusMethodInvocation *invocation = NULL;
147
148         ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t *)resp_data;
149
150         NOT_USED(service_interface);
151         NOT_USED(request_id);
152
153         if (NULL == resp_data || 0 == resp_data_len) {
154                 Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
155                 g_free(cb_data);
156                 return;
157         }
158
159         thermo_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
160         zblib_check_null_free_and_ret("thermo_object", thermo_object, cb_data);
161
162         invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
163         zblib_check_null_free_and_ret("invocation", invocation, cb_data);
164
165         zigbee_zcl_thermostat_complete_get_weekly_schedule(thermo_object, invocation,
166                 payload->result);
167
168         g_free(cb_data);
169 }
170
171 static gboolean on_thermostat_get_weekly_schedule(ZigbeeZcl_thermostat *thermostat_object,
172         GDBusMethodInvocation *invocation,
173         GVariant *eui64,
174         gchar endpoint,
175         gchar no_of_days,
176         gchar mode,
177         gpointer user_data)
178 {
179         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
180         ZigbeeZclThermostatGetWeeklySchedule_t req;
181         ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
182
183         GVariantIter *iter = NULL;
184         guint i = 0;
185
186         gboolean ret;
187
188         memset(&req, 0x0, sizeof(ZigbeeZclThermostatGetWeeklySchedule_t));
189
190         /* Update request structure */
191         g_variant_get(eui64, "a(y)", &iter);
192         while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
193                 i++;
194                 if (i >= ZIGBEE_EUI64_SIZE)
195                         break;
196         }
197         req.endpoint = endpoint;
198         req.num_of_days = no_of_days;
199         req.mode = mode;
200
201         /* Allocate response callback data */
202         resp_cb_data =
203                 zigbee_service_dbus_interface_create_resp_cb_data(thermostat_object,
204                         invocation, NULL, 0);
205         if (NULL == resp_cb_data) {
206                 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
207
208                 /* Send failure response */
209                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
210
211                 return TRUE;
212         }
213
214         /* Dispatch request */
215         ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
216                 ZBLIB_DRIVER_TYPE_ZCL_THERMOSTAT,
217                 ZBLIB_ZCL_THERMOSTAT_OPS_GET_WEEKLY_SCHEDULE,
218                 &req, sizeof(req),
219                 on_thermostat_get_weekly_schedule_resp, resp_cb_data);
220         if (FALSE == ret) {
221                 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
222
223                 /* Free response callback data */
224                 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
225
226                 /* Send failure response */
227                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
228
229                 return TRUE;
230         }
231
232         return TRUE;
233 }
234
235 static void on_thermostat_set_weekly_schedule_resp(ZigBeeServiceInterface *service_interface,
236         guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
237 {
238         ZigbeeServiceInterfaceRespCbData_t *cb_data =
239                 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
240
241         ZigbeeZcl_thermostat *thermo_object = NULL;
242         GDBusMethodInvocation *invocation = NULL;
243
244         ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t *)resp_data;
245
246         NOT_USED(service_interface);
247         NOT_USED(request_id);
248
249         if (NULL == resp_data || 0 == resp_data_len) {
250                 Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
251                 g_free(cb_data);
252                 return;
253         }
254
255         thermo_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
256         zblib_check_null_free_and_ret("thermo_object", thermo_object, cb_data);
257
258         invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
259         zblib_check_null_free_and_ret("invocation", invocation, cb_data);
260
261         zigbee_zcl_thermostat_complete_set_weekly_schedule(thermo_object, invocation,
262                 payload->result);
263
264         g_free(cb_data);
265 }
266
267 static gboolean on_thermostat_set_weekly_schedule(ZigbeeZcl_thermostat *thermostat_object,
268         GDBusMethodInvocation *invocation,
269         GVariant *eui64,
270         gchar endpoint,
271         gchar no_of_transitions,
272         gchar no_of_days,
273         gchar mode,
274         GVariant *payload,
275         gchar payload_len,
276         gpointer user_data)
277 {
278         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
279         ZigbeeZclThermostatSetWeeklySchedule_t req;
280         ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
281
282         GVariantIter *iter = NULL;
283         guint i = 0;
284
285         gboolean ret;
286
287         memset(&req, 0x0, sizeof(ZigbeeZclThermostatSetWeeklySchedule_t));
288
289         /* Update request structure */
290         g_variant_get(eui64, "a(y)", &iter);
291         while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
292                 i++;
293                 if (i >= ZIGBEE_EUI64_SIZE)
294                         break;
295         }
296         req.endpoint = endpoint;
297         req.no_of_transitions = no_of_transitions;
298         req.num_of_days = no_of_days;
299         req.mode = mode;
300
301         i = 0;
302         g_variant_get(payload, "a(y)", &iter);
303         while (g_variant_iter_loop(iter, "(y)", &(req.payload[i]))) {
304                 i++;
305                 if (i >= (guint)payload_len)
306                         break;
307         }
308         req.payload_len = payload_len;
309
310         /* Allocate response callback data */
311         resp_cb_data =
312                 zigbee_service_dbus_interface_create_resp_cb_data(thermostat_object,
313                         invocation, NULL, 0);
314         if (NULL == resp_cb_data) {
315                 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
316
317                 /* Send failure response */
318                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
319
320                 return TRUE;
321         }
322
323         /* Dispatch request */
324         ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
325                 ZBLIB_DRIVER_TYPE_ZCL_THERMOSTAT,
326                 ZBLIB_ZCL_THERMOSTAT_OPS_SET_WEEKLY_SCHEDULE,
327                 &req, sizeof(req),
328                 on_thermostat_set_weekly_schedule_resp, resp_cb_data);
329         if (FALSE == ret) {
330                 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
331
332                 /* Free response callback data */
333                 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
334
335                 /* Send failure response */
336                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
337
338                 return TRUE;
339         }
340
341         return TRUE;
342 }
343
344 static void on_thermostat_clear_weekly_schedule_resp(ZigBeeServiceInterface *service_interface,
345         guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
346 {
347         ZigbeeServiceInterfaceRespCbData_t *cb_data =
348                 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
349
350         ZigbeeZcl_thermostat *thermo_object = NULL;
351         GDBusMethodInvocation *invocation = NULL;
352
353         ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t *)resp_data;
354
355         NOT_USED(service_interface);
356         NOT_USED(request_id);
357
358         if (NULL == resp_data || 0 == resp_data_len) {
359                 Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
360                 g_free(cb_data);
361                 return;
362         }
363
364         thermo_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
365         zblib_check_null_free_and_ret("thermo_object", thermo_object, cb_data);
366
367         invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
368         zblib_check_null_free_and_ret("invocation", invocation, cb_data);
369
370         zigbee_zcl_thermostat_complete_clear_weekly_schedule(thermo_object, invocation,
371                 payload->result);
372
373         g_free(cb_data);
374 }
375
376 static gboolean on_thermostat_clear_weekly_schedule(ZigbeeZcl_thermostat *thermostat_object,
377         GDBusMethodInvocation *invocation,
378         GVariant *eui64,
379         gchar endpoint,
380         gpointer user_data)
381 {
382         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
383         ZigbeeZclThermostatClearWeeklySchedule_t req;
384         ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
385
386         GVariantIter *iter = NULL;
387         guint i = 0;
388
389         gboolean ret;
390
391         memset(&req, 0x0, sizeof(ZigbeeZclThermostatClearWeeklySchedule_t));
392
393         /* Update request structure */
394         g_variant_get(eui64, "a(y)", &iter);
395         while (g_variant_iter_loop(iter, "(y)", &(req.eui64[i]))) {
396                 i++;
397                 if (i >= ZIGBEE_EUI64_SIZE)
398                         break;
399         }
400         req.endpoint = endpoint;
401
402         /* Allocate response callback data */
403         resp_cb_data =
404                 zigbee_service_dbus_interface_create_resp_cb_data(thermostat_object,
405                         invocation, NULL, 0);
406         if (NULL == resp_cb_data) {
407                 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
408
409                 /* Send failure response */
410                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
411
412                 return TRUE;
413         }
414
415         /* Dispatch request */
416         ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
417                 ZBLIB_DRIVER_TYPE_ZCL_THERMOSTAT,
418                 ZBLIB_ZCL_THERMOSTAT_OPS_CLEAR_WEEKLY_SCHEDULE,
419                 &req, sizeof(req),
420                 on_thermostat_clear_weekly_schedule_resp, resp_cb_data);
421         if (FALSE == ret) {
422                 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
423
424                 /* Free response callback data */
425                 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
426
427                 /* Send failure response */
428                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
429
430                 return TRUE;
431         }
432
433         return TRUE;
434 }
435
436 static void on_thermostat_setpoint_raise_lower_resp(ZigBeeServiceInterface *service_interface,
437         guint request_id, gpointer resp_data, guint resp_data_len, gpointer resp_cb_data)
438 {
439         ZigbeeServiceInterfaceRespCbData_t *cb_data =
440                 (ZigbeeServiceInterfaceRespCbData_t *)resp_cb_data;
441
442         ZigbeeZcl_thermostat *thermo_object = NULL;
443         GDBusMethodInvocation *invocation = NULL;
444
445         ZigbeeGeneralResp_t *payload = (ZigbeeGeneralResp_t *)resp_data;
446
447         NOT_USED(service_interface);
448         NOT_USED(request_id);
449
450         if (NULL == resp_data || 0 == resp_data_len) {
451                 Z_LOGE("resp_data=%p or resp_data_len=%d is null", resp_data, resp_data_len);
452                 g_free(cb_data);
453                 return;
454         }
455
456         thermo_object = zigbee_service_dbus_interface_ref_interface_object(cb_data);
457         zblib_check_null_free_and_ret("thermo_object", thermo_object, cb_data);
458
459         invocation = zigbee_service_dbus_interface_ref_invocation(cb_data);
460         zblib_check_null_free_and_ret("invocation", invocation, cb_data);
461
462         zigbee_zcl_thermostat_complete_setpoint_raise_lower(thermo_object, invocation,
463                 payload->result);
464
465         g_free(cb_data);
466 }
467
468 static gboolean on_thermostat_setpoint_raise_lower(ZigbeeZcl_thermostat *thermostat_object,
469         GDBusMethodInvocation *invocation,
470         gshort node_id,
471         gchar endpoint,
472         gchar mode,
473         gchar amount,
474         gpointer user_data)
475 {
476         ZigBeeServiceInterface *service_interface = (ZigBeeServiceInterface *)user_data;
477         ZigbeeZclThermostatSetpointRaiseLower_t req;
478         ZigbeeServiceInterfaceRespCbData_t *resp_cb_data = NULL;
479
480         gboolean ret;
481
482         memset(&req, 0x0, sizeof(ZigbeeZclThermostatSetpointRaiseLower_t));
483
484         /* Update request structure */
485         req.node_id = node_id;
486         req.endpoint = endpoint;
487         req.mode = mode;
488         req.amount = amount;
489
490         /* Allocate response callback data */
491         resp_cb_data =
492                 zigbee_service_dbus_interface_create_resp_cb_data(thermostat_object,
493                         invocation, NULL, 0);
494         if (NULL == resp_cb_data) {
495                 Z_LOGE("zigbee_service_dbus_interface_create_resp_cb_data failed!");
496
497                 /* Send failure response */
498                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
499
500                 return TRUE;
501         }
502
503         /* Dispatch request */
504         ret = zigbee_service_dbus_interface_dispatch_request(service_interface,
505                 ZBLIB_DRIVER_TYPE_ZCL_THERMOSTAT,
506                 ZBLIB_ZCL_THERMOSTAT_OPS_SETPOINT_RAISE_LOWER,
507                 &req, sizeof(req),
508                 on_thermostat_setpoint_raise_lower_resp, resp_cb_data);
509         if (FALSE == ret) {
510                 Z_LOGE("zigbee_service_dbus_interface_dispatch_request failed!");
511
512                 /* Free response callback data */
513                 zigbee_service_dbus_interface_destroy_resp_cb_data(resp_cb_data);
514
515                 /* Send failure response */
516                 ZIGBEE_DBUS_FAIL_RESPONSE(invocation, ZIGBEE_DBUS_DEFAULT_REQ_FAILED_MSG);
517
518                 return TRUE;
519         }
520
521         return TRUE;
522 }
523
524 void zigbee_service_dbus_interface_zcl_thermostat_notification(ZigBeeServiceInterface *service_interface,
525         guint noti_id, gpointer noti_data, guint noti_data_len, gpointer noti_cb_data)
526 {
527         ZigbeeZcl_thermostat *thermo_object;
528
529         zblib_check_null_ret("service_interface", service_interface);
530
531         if (NULL == noti_data || 0 == noti_data_len) {
532                 Z_LOGE("noti_data=%p or noti_data_len=%d is null", noti_data, noti_data_len);
533                 return;
534         }
535
536         thermo_object = _service_interface_ref_zigbee_zcl_thermostat(service_interface);
537         zblib_check_null_ret("thermo_object", thermo_object);
538
539         NOT_USED(noti_cb_data);
540
541         switch(noti_id) {
542         default:
543                 Z_LOGE("Unexpected notification [%x]", noti_id);
544         break;
545         }
546
547         /* ZigbeeZcl_thermostat should be dereferenced */
548         g_object_unref(thermo_object);
549
550 }
551
552 gboolean zigbee_service_dbus_interface_zcl_thermostat_init(ZigBeeServiceInterface *service_interface,
553         ZigbeeObjectSkeleton *zigbee_object)
554 {
555         ZigbeeZcl_thermostat *thermostat_object;
556
557         if (NULL == service_interface) {
558                 Z_LOGE("service_interface is NULL");
559                 return FALSE;
560         }
561
562         thermostat_object = zigbee_zcl_thermostat_skeleton_new();
563         zigbee_object_skeleton_set_zcl_thermostat(zigbee_object, thermostat_object);
564         g_object_unref(thermostat_object);
565
566         Z_LOGI("thermostat_object: [%p]", thermostat_object);
567
568         /*
569          * Register signal handlers for 'thermostat' interface
570          */
571         g_signal_connect(thermostat_object,
572                 "handle-get-local-temp",
573                 G_CALLBACK(on_thermostat_get_local_temp), service_interface);
574
575         g_signal_connect(thermostat_object,
576                 "handle-get-weekly-schedule",
577                 G_CALLBACK(on_thermostat_get_weekly_schedule), service_interface);
578
579         g_signal_connect(thermostat_object,
580                 "handle-set-weekly-schedule",
581                 G_CALLBACK(on_thermostat_set_weekly_schedule), service_interface);
582
583         g_signal_connect(thermostat_object,
584                 "handle-clear-weekly-schedule",
585                 G_CALLBACK(on_thermostat_clear_weekly_schedule), service_interface);
586
587         g_signal_connect(thermostat_object,
588                 "handle-setpoint-raise-lower",
589                 G_CALLBACK(on_thermostat_setpoint_raise_lower), service_interface);
590
591         return TRUE;
592 }