* @see zb_zcl_door_lock_lock()
*/
typedef void (*zb_zcl_doorlock_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char status,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char status,
+ void *user_data);
/**
* @see zb_zcl_door_lock_get_log_record()
*/
typedef void (*zb_zcl_doorlock_get_log_record_rsp)(
- zigbee_h handle,
- nwk_addr addr16,
- unsigned char ep,
- unsigned short log_entry_id,
- unsigned int timestamp,
- unsigned char event_type,
- unsigned char source,
- unsigned char event_id,
- unsigned char user_id,
- const char *pin,
- void *user_data);
+ zigbee_h handle,
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned short log_entry_id,
+ unsigned int timestamp,
+ unsigned char event_type,
+ unsigned char source,
+ unsigned char event_id,
+ unsigned char user_id,
+ const char *pin,
+ void *user_data);
/**
* @brief Command description for get pin code response
* @see zb_zcldoor_lock_get_pin_code()
*/
typedef void (*zb_zcl_doorlock_get_pin_code_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_status,
- unsigned char user_type,
- const char* code,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_status,
+ unsigned char user_type,
+ const char* code,
+ void *user_data);
/**
* @brief Command description for get user status response
* @see zb_zcldoor_lock_get_user_status()
*/
typedef void (*zb_zcl_doorlock_get_user_status_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_status,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_status,
+ void *user_data);
/**
* @brief Command description for get week day schedule response
* @see zb_zcl_doorlock_set_week_day_schedule()
*/
typedef void (*zb_zcl_doorlock_get_week_day_schedule_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- unsigned char status,
- unsigned char days_mask,
- unsigned char start_hour,
- unsigned char start_minute,
- unsigned char end_hour,
- unsigned char end_minute,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ unsigned char status,
+ unsigned char days_mask,
+ unsigned char start_hour,
+ unsigned char start_minute,
+ unsigned char end_hour,
+ unsigned char end_minute,
+ void *user_data);
/**
* @brief Command description for get year day schedule response
* @see zb_zcl_doorlock_get_year_day_schedule()
*/
typedef void (*zb_zcl_doorlock_get_year_day_schedule_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- unsigned char status,
- unsigned int zigbee_local_start_time,
- unsigned int zigbee_local_end_time,
- unsigned char operating_mode_during_holiday,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ unsigned char status,
+ unsigned int zigbee_local_start_time,
+ unsigned int zigbee_local_end_time,
+ unsigned char operating_mode_during_holiday,
+ void *user_data);
/**
* @brief Command description for get holiday schedule response
* @see zb_zcl_doorlock_get_holiday_schedule()
*/
typedef void (*zb_zcl_doorlock_get_holiday_schedule_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned char status,
- unsigned int local_start_time,
- unsigned int local_end_time,
- unsigned char operating_mode,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned char status,
+ unsigned int local_start_time,
+ unsigned int local_end_time,
+ unsigned char operating_mode,
+ void *user_data);
/**
* @brief Command description for get user type response
* @see zb_zcl_doorlock_set_user_type()
*/
typedef void (*zb_zcl_doorlock_get_user_type_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_type,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_type,
+ void *user_data);
/**
* @brief Command description for get RFID code response
* @see zb_zcl_doorlock_get_rfid_code()
*/
typedef void (*zb_zcl_doorlock_get_rfid_code_rsp)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_type,
- const char *rfid_code,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_type,
+ const char *rfid_code,
+ void *user_data);
#if 1
/**
*
*/
typedef void (*zb_zcl_doorlock_operational_event_noti)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char operation_event_source,
- unsigned char operation_event_code,
- unsigned short user_id,
- unsigned char pin,
- unsigned int local_time,
- const char *data,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char operation_event_source,
+ unsigned char operation_event_code,
+ unsigned short user_id,
+ unsigned char pin,
+ unsigned int local_time,
+ const char *data,
+ void *user_data);
/**
* @brief Description for programming event notification
*
*/
typedef void (*zb_zcl_doorlock_programming_event_noti)(
- nwk_addr addr16,
- unsigned char ep,
- unsigned char programming_event_source,
- unsigned char programming_event_code,
- unsigned short user_id,
- unsigned char pin,
- unsigned char status,
- unsigned int local_time,
- const char *data,
- void *user_data);
+ nwk_addr addr16,
+ unsigned char ep,
+ unsigned char programming_event_source,
+ unsigned char programming_event_code,
+ unsigned short user_id,
+ unsigned char pin,
+ unsigned char status,
+ unsigned int local_time,
+ const char *data,
+ void *user_data);
#endif
/* Table 10.10 Commands Received by the Server Cluster
int zb_zcl_doorlock_lock(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- const char *pin_or_rfid_code,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ const char *pin_or_rfid_code,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for unlock door command
int zb_zcl_doorlock_unlock(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- const char *pin_or_rfid_code,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ const char *pin_or_rfid_code,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for toggle command
int zb_zcl_doorlock_toggle(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- const char *pin_or_rfid_code,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ const char *pin_or_rfid_code,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for unlock with timeout command
int zb_zcl_doorlock_unlock_with_timeout(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short timeout,
- const char *pin_or_rfid_code,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short timeout,
+ const char *pin_or_rfid_code,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get log record command
int zb_zcl_doorlock_get_log_record(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short log_index,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short log_index,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for set PIN code command
int zb_zcl_doorlock_set_pin_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_status,
- unsigned char user_type,
- const char *pin,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_status,
+ unsigned char user_type,
+ const char *pin,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get PIN code command
int zb_zcl_doorlock_get_pin_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- zb_zcl_doorlock_get_pin_code_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ zb_zcl_doorlock_get_pin_code_rsp cb,
+ void *user_data);
/**
* @brief Description for clear PIN code command
int zb_zcl_doorlock_clear_pin_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for clear all PIN code command
int zb_zcl_doorlock_clear_all_pin_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for set user status command
int zb_zcl_doorlock_set_user_status(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_status,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_status,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for set week day command
int zb_zcl_doorlock_set_week_day_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- unsigned char days_mask,
- unsigned char start_hour,
- unsigned char start_minute,
- unsigned char end_hour,
- unsigned char end_minute,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ unsigned char days_mask,
+ unsigned char start_hour,
+ unsigned char start_minute,
+ unsigned char end_hour,
+ unsigned char end_minute,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get week day schedule command
int zb_zcl_doorlock_get_week_day_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- zb_zcl_doorlock_get_week_day_schedule_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ zb_zcl_doorlock_get_week_day_schedule_rsp cb,
+ void *user_data);
/**
* @brief Description for set year day command
int zb_zcl_doorlock_set_year_day_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- unsigned int zigbee_local_start_time,
- unsigned int zigbee_local_end_time,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ unsigned int zigbee_local_start_time,
+ unsigned int zigbee_local_end_time,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get year day schedule command
int zb_zcl_doorlock_get_year_day_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char schedule_id,
- unsigned short user_id,
- zb_zcl_doorlock_get_year_day_schedule_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char schedule_id,
+ unsigned short user_id,
+ zb_zcl_doorlock_get_year_day_schedule_rsp cb,
+ void *user_data);
/**
* @brief Description for set holiday schedule command
int zb_zcl_doorlock_set_holiday_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char holiday_schedule_id,
- unsigned int zigbee_local_start_time,
- unsigned int zigbee_local_end_time,
- unsigned char operating_mode_during_holiday,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char holiday_schedule_id,
+ unsigned int zigbee_local_start_time,
+ unsigned int zigbee_local_end_time,
+ unsigned char operating_mode_during_holiday,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get holiday schedule command
int zb_zcl_doorlock_get_holiday_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char holiday_schedule_id,
- zb_zcl_doorlock_get_holiday_schedule_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char holiday_schedule_id,
+ zb_zcl_doorlock_get_holiday_schedule_rsp cb,
+ void *user_data);
/**
* @brief Description for clear holiday schedule command
int zb_zcl_doorlock_clear_holiday_schedule(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned char holiday_schedule_id,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned char holiday_schedule_id,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for set user type command
int zb_zcl_doorlock_set_user_type(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_type,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_type,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for get user type command
int zb_zcl_doorlock_get_user_type(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- zb_zcl_doorlock_get_user_type_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ zb_zcl_doorlock_get_user_type_rsp cb,
+ void *user_data);
/**
* @brief Description for set RFID code command
int zb_zcl_doorlock_set_rfid_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- unsigned char user_status,
- unsigned char user_type,
- const char *rfid_code,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ unsigned char user_status,
+ unsigned char user_type,
+ const char *rfid_code,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
int zb_zcl_doorlock_get_rfid_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- zb_zcl_doorlock_get_rfid_code_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ zb_zcl_doorlock_get_rfid_code_rsp cb,
+ void *user_data);
/**
int zb_zcl_doorlock_clear_rfid_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- unsigned short user_id,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ unsigned short user_id,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @brief Description for clear all RFID code command
int zb_zcl_doorlock_clear_all_rfid_code(
zigbee_h handle,
nwk_addr addr16,
- unsigned char ep,
- zb_zcl_doorlock_rsp cb,
- void *user_data);
+ unsigned char ep,
+ zb_zcl_doorlock_rsp cb,
+ void *user_data);
/**
* @}
*/
/* Remove item if exists */
DBG("Remove global cmd info");
item = g_list_find_custom(list, container, _global_compare_func);
- if (NULL != item) {
+ if (NULL != item)
handle->global_cmd_req = g_list_remove(list, container);
- }
}
static void _zbl_remove_global_req(zigbee_h handle, unsigned char ep,
static gboolean _zbl_timeout_cb(gpointer p)
{
- zbl_req_cb_s *container =(zbl_req_cb_s *)p;
+ zbl_req_cb_s *container = (zbl_req_cb_s *)p;
RETVM_IF(NULL == gdbus_conn, G_SOURCE_REMOVE, "gdbus_conn is NULL");
RETVM_IF(NULL == p, G_SOURCE_REMOVE, "container is NULL");
zb_zdo_binding_table_h *records = NULL;
records = calloc(1, sizeof(zb_zdo_binding_table_h));
- if (records) {
+ if (records)
records[0] = calloc(1, sizeof(struct zb_zdo_binding_table_s));
- }
cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata);
zb_zdo_neighbor_table_desc_h *records = NULL;
records = calloc(1, sizeof(zb_zdo_neighbor_table_desc_h));
- if (records) {
+ if (records)
records[0] = calloc(1, sizeof(struct zb_zdo_neighbor_table_desc_s));
- }
+
cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata);
free(records[0]);
zb_zdo_routing_table_h *records = NULL;
records = calloc(1, sizeof(zb_zdo_routing_table_h));
- if (records) {
+ if (records)
records[0] = calloc(1, sizeof(struct zb_zdo_routing_table_s));
- }
+
cb(ZB_ZDP_TIMEOUT, 0, 0, 0, records, container->userdata);
free(records[0]);
zb_zdo_mgmt_nwk_disc_rsp cb = container->cb;
zb_zdo_network_list_record_h *records = NULL;
records = calloc(1, sizeof(zb_zdo_network_list_record_h));
- if (records) {
+ if (records)
records[0] = calloc(1, sizeof(struct zb_zdo_network_list_record_s));
- }
+
cb(0, 0, 0, 0, records, container->userdata);
free(records[0]);
free(records);
if (payload_len > 0) {
payload = calloc(payload_len+1, sizeof(unsigned char));
- while (g_variant_iter_loop(payload_iter, "(y)", &value)) {
+ while (g_variant_iter_loop(payload_iter, "(y)", &value))
payload[i++] = value;
- }
+
if (NULL != payload_iter)
g_variant_iter_free(payload_iter);
}
if (payload_len > 0) {
payload = calloc(payload_len + 1, sizeof(unsigned char));
- while (g_variant_iter_loop(payload_iter, "(y)", &value)) {
+ while (g_variant_iter_loop(payload_iter, "(y)", &value))
payload[i++] = value;
- }
+
if (NULL != payload_iter)
g_variant_iter_free(payload_iter);
}
if (length > 0) {
data = calloc(length, sizeof(unsigned char));
- while (g_variant_iter_loop(payload_iter, "(y)", &value)) {
+ while (g_variant_iter_loop(payload_iter, "(y)", &value))
data[i++] = value;
- }
+
if (NULL != payload_iter)
g_variant_iter_free(payload_iter);
}
g_variant_get(variant, "(ib)", &result, &enabled);
DBG("ret = [0x%x]", result);
- if(variant)
+ if (variant)
g_variant_unref(variant);
return result;
payload_builder = g_variant_builder_new(G_VARIANT_TYPE("a(y)"));
if (payload_len > 0) {
- for (i = payload_len - 1; i >= 0 ; i--) {
+ for (i = payload_len - 1; i >= 0 ; i--)
g_variant_builder_add(payload_builder, "(y)", payload[i]);
- }
}
payload_variant = g_variant_builder_end(payload_builder);
g_variant_builder_unref(payload_builder);
payload_builder = g_variant_builder_new(G_VARIANT_TYPE("a(y)"));
if (payload_len > 0) {
- for (i = payload_len - 1; i >= 0 ; i--) {
+ for (i = payload_len - 1; i >= 0 ; i--)
g_variant_builder_add(payload_builder, "(y)", payload[i]);
- }
}
payload_variant = g_variant_builder_end(payload_builder);
g_variant_builder_unref(payload_builder);
payload_builder = g_variant_builder_new(G_VARIANT_TYPE("a(y)"));
if (length > 0) {
- for (i = length - 1; i >= 0 ; i--) {
+ for (i = length - 1; i >= 0 ; i--)
g_variant_builder_add(payload_builder, "(y)", data[i]);
- }
}
payload_variant = g_variant_builder_end(payload_builder);
g_variant_builder_unref(payload_builder);
DBG("ret = [0x%x]", result);
g_variant_unref(variant);
- return result;}
+ return result;
+}
int zbl_group_get_group_membership(nwk_addr addr16, unsigned char ep,
unsigned char group_count, unsigned short *group_list,
DBG("zbl_group_remove_all_group()");
variant = g_dbus_proxy_call_sync(zcl_group_proxy, "remove_all_group",
- g_variant_new("(qy)", addr16, ep),G_DBUS_CALL_FLAGS_NONE, -1, NULL, &dbus_err);
+ g_variant_new("(qy)", addr16, ep), G_DBUS_CALL_FLAGS_NONE, -1, NULL, &dbus_err);
if (!variant) {
ERR("Failed to get 'remove_all_group' [%s]", dbus_err->message);